@arcgis/core 4.25.0-next.20220708 → 4.25.0-next.20220711

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (51) hide show
  1. package/assets/esri/core/workers/RemoteClient.js +1 -1
  2. package/assets/esri/core/workers/chunks/40d9c753be00b81d9e79.js +1 -0
  3. package/assets/esri/core/workers/chunks/{8cdeccb6b67098d6a8d7.js → 54b01d2a4aba08d7e16b.js} +1 -1
  4. package/assets/esri/core/workers/chunks/5db5afec37f69c4acaaf.js +1 -0
  5. package/assets/esri/core/workers/chunks/63922dadaa642a959164.js +1 -0
  6. package/assets/esri/core/workers/chunks/{35d46e4eeb43c256a63b.js → 8d6fb50fff035f21878b.js} +1 -1
  7. package/assets/esri/core/workers/chunks/937eed1e51055f730270.js +1 -0
  8. package/assets/esri/core/workers/chunks/9b802fcf571c91347da4.js +1 -0
  9. package/assets/esri/core/workers/chunks/b02a43cf767d8ee13313.js +1 -0
  10. package/assets/esri/core/workers/chunks/ba6c6957830b3f0c4ec8.js +1 -0
  11. package/assets/esri/core/workers/chunks/fc6423ca92289c739e19.js +1 -0
  12. package/interfaces.d.ts +8395 -6016
  13. package/layers/BaseElevationLayer.js +1 -1
  14. package/layers/BaseTileLayer.js +1 -1
  15. package/layers/support/ElevationQuery.js +1 -1
  16. package/layers/support/ExportImageServiceParameters.js +1 -1
  17. package/layers/support/Sublayer.js +1 -1
  18. package/layers/support/TileInfo.js +1 -1
  19. package/layers/support/TileKey.js +5 -0
  20. package/layers/support/TilemapCache.js +1 -1
  21. package/package.json +1 -1
  22. package/renderers/DotDensityRenderer.js +1 -1
  23. package/support/revision.js +1 -1
  24. package/views/2d/interactive/snapping/featureSources/featureServiceSource/FeatureServiceTiles2D.js +1 -1
  25. package/views/3d/interactive/snapping/featureSources/featureServiceSource/FeatureServiceTiles3D.js +1 -1
  26. package/views/3d/layers/graphics/Graphics3DScaleVisibility.js +1 -1
  27. package/views/3d/terrain/TerrainSurface.js +1 -1
  28. package/views/DOMContainer.js +1 -1
  29. package/views/interactive/snapping/featureSources/GraphicsSnappingSource.js +1 -1
  30. package/views/interactive/snapping/featureSources/featureServiceSource/FeatureServiceTileStore.js +1 -1
  31. package/views/interactive/snapping/featureSources/featureServiceSource/FeatureServiceTilesSimple.js +1 -1
  32. package/views/interactive/snapping/snappingUtils.js +1 -1
  33. package/widgets/AreaMeasurement3D.js +1 -1
  34. package/widgets/Daylight.js +1 -1
  35. package/widgets/DirectLineMeasurement3D.js +1 -1
  36. package/widgets/ElevationProfile/ElevationProfileViewModel.js +1 -1
  37. package/widgets/ElevationProfile.js +1 -1
  38. package/widgets/Measurement.js +1 -1
  39. package/widgets/Popup.js +1 -1
  40. package/widgets/ShadowCast.js +1 -1
  41. package/widgets/Spinner.js +1 -1
  42. package/widgets/Weather.js +1 -1
  43. package/widgets/Widget.js +1 -1
  44. package/assets/esri/core/workers/chunks/009386ed70740f87a014.js +0 -1
  45. package/assets/esri/core/workers/chunks/1970d7a65832b70f7f5c.js +0 -1
  46. package/assets/esri/core/workers/chunks/4a364bc073fdc7c1b563.js +0 -1
  47. package/assets/esri/core/workers/chunks/4ca6ada7a4ccde5b5a24.js +0 -1
  48. package/assets/esri/core/workers/chunks/95451d6405729a9f50c7.js +0 -1
  49. package/assets/esri/core/workers/chunks/a9a459639c82c35ada1f.js +0 -1
  50. package/assets/esri/core/workers/chunks/beead2b06c994b4e61af.js +0 -1
  51. package/assets/esri/core/workers/chunks/ecaf8f030026e41e1d1a.js +0 -1
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[7175],{44422:(e,t,i)=>{i.d(t,{B:()=>s});var r=i(5600);function s(e,t){const i=t?{...t,source:e}:e;return(0,r.Cb)({aliasOf:i})}},47175:(e,t,i)=>{i.r(t),i.d(t,{default:()=>Ft});var r,s=i(43697),n=i(51773),a=i(70586),o=i(16453),l=i(95330),u=i(5600),p=(i(67676),i(80442),i(75215)),c=i(52011),m=i(30556),d=i(87085),h=i(66577),y=i(38171),f=i(30030),g=i(3172),b=i(20102),R=i(35454),v=i(22974),w=i(92604),_=i(17445),C=i(17452),S=i(71715),I=i(21506),x=i(35956),F=i(96674),T=i(44422),N=i(36030);const D=new Set(["raster","raster2","dem","fillraster"]),P=new Set(["rasters"]),O=e=>e&&e.rasterFunction?A.fromJSON(e):e,j=e=>e&&e instanceof A?e.toJSON():e,V=e=>e?.functionName&&!e.declaredClass,M=e=>V(e)?new A(e):e;let A=r=class extends F.wq{constructor(e){super(e),this.functionName=null,this.outputPixelType="unknown",this.variableName=null,this.rasterFunctionDefinition=null}set functionArguments(e){if(e){const t=Object.keys(e);if(t.some((t=>D.has(t.toLowerCase())&&V(e[t])))||t.some((t=>P.has(t.toLowerCase())&&Array.isArray(e[t])&&e[t].some((e=>V(e)))))){e=(0,v.d9)(e);for(const i of t)D.has(i.toLowerCase())?e[i]=M(e[i]):P.has(i.toLowerCase())&&Array.isArray(e[i])&&(e[i]=e[i].map((e=>M(e))))}}this._set("functionArguments",e)}readFunctionArguments(e){return(e=>{if(null==e)return null;e=(0,v.d9)(e);const t={};for(const i of Object.keys(e))D.has(i.toLowerCase())?t[i]=O(e[i]):P.has(i.toLowerCase())&&Array.isArray(e[i])?t[i]=e[i].map(O):t[i]=e[i];return t})(e)}writeFunctionArguments(e,t,i){const r={};for(const t of Object.keys(e))D.has(t.toLowerCase())?r[t]=j(e[t]):P.has(t.toLowerCase())&&Array.isArray(e[t])?r[t]=e[t].map(j):r[t]=j(e[t]);t[i]=r}readFunctionName(e,t){const i=t.rasterFunctionInfos;return t.name||(i&&i.length&&"None"!==i[0].name?i[0].name:t.rasterFunctionDefinition?t.rasterFunctionDefinition.name:t.rasterFunction)}clone(){return new r({functionName:this.functionName,functionArguments:(0,v.d9)(this.functionArguments),outputPixelType:this.outputPixelType,variableName:this.variableName,rasterFunctionDefinition:(0,v.d9)(this.rasterFunctionDefinition)})}};(0,s._)([(0,u.Cb)({json:{type:Object,name:"rasterFunctionArguments"}})],A.prototype,"functionArguments",null),(0,s._)([(0,S.r)("functionArguments")],A.prototype,"readFunctionArguments",null),(0,s._)([(0,m.c)("functionArguments")],A.prototype,"writeFunctionArguments",null),(0,s._)([(0,u.Cb)({json:{type:String,write:{target:"rasterFunction"}}})],A.prototype,"functionName",void 0),(0,s._)([(0,S.r)("functionName",["rasterFunction","rasterFunctionInfos","rasterFunctionDefinition"])],A.prototype,"readFunctionName",null),(0,s._)([(0,N.J)({C128:"c128",C64:"c64",F32:"f32",F64:"f64",S16:"s16",S32:"s32",S8:"s8",U1:"u1",U16:"u16",U2:"u2",U32:"u32",U4:"u4",U8:"u8",UNKNOWN:"unknown"},{ignoreUnknown:!1}),(0,u.Cb)({json:{default:"unknown"}})],A.prototype,"outputPixelType",void 0),(0,s._)([(0,u.Cb)({type:String,json:{read:!0,write:!0}})],A.prototype,"variableName",void 0),(0,s._)([(0,u.Cb)({type:Object,json:{name:"rasterFunctionDefinition"}})],A.prototype,"rasterFunctionDefinition",void 0),A=r=(0,s._)([(0,c.j)("esri.layers.support.RasterFunction")],A);const J=A,E={StretchFunction:{arguments:{ComputeGamma:{isDataset:!1,isPublic:!1,name:"ComputeGamma",type:"RasterFunctionVariable",value:!1},DRA:{isDataset:!1,isPublic:!1,name:"DRA",type:"RasterFunctionVariable",value:!1},EstimateStatsHistogram:{isDataset:!1,isPublic:!1,name:"EstimateStatsHistogram",type:"RasterFunctionVariable",value:!1},Gamma:{displayName:"Gamma",isDataset:!1,isPublic:!1,name:"Gamma",type:"RasterFunctionVariable"},Histograms:{isDataset:!1,isPublic:!1,name:"Histograms",type:"RasterFunctionVariable"},Max:{isDataset:!1,isPublic:!1,name:"Max",type:"RasterFunctionVariable",value:255},MaxPercent:{isDataset:!1,isPublic:!1,name:"MaxPercent",type:"RasterFunctionVariable",value:.5},Min:{isDataset:!1,isPublic:!1,name:"Min",type:"RasterFunctionVariable",value:0},MinPercent:{isDataset:!1,isPublic:!1,name:"MinPercent",type:"RasterFunctionVariable",value:.25},NumberOfStandardDeviations:{isDataset:!1,isPublic:!1,name:"NumberOfStandardDeviation",type:"RasterFunctionVariable",value:2},Raster:{isDataset:!0,isPublic:!1,name:"Raster",type:"RasterFunctionVariable"},SigmoidStrengthLevel:{isDataset:!1,isPublic:!1,name:"SigmoidStrengthLevel",type:"RasterFunctionVariable",value:2},Statistics:{isDataset:!1,isPublic:!1,name:"Statistics",type:"RasterFunctionVariable"},StretchType:{isDataset:!1,isPublic:!1,name:"StretchType",type:"RasterFunctionVariable",value:0},type:"StretchFunctionArguments",UseGamma:{isDataset:!1,isPublic:!1,name:"UseGamma",type:"RasterFunctionVariable",value:!1}},description:"Enhances an image by adjusting the range of values displayed. This does not alter the underlying pixel values. If a pixel has a value outside of the specified range, it will appear as either the minimum or maximum value.",function:{description:"Enhances an image by adjusting the range of values displayed. This does not alter the underlying pixel values. If a pixel has a value outside of the specified range, it will appear as either the minimum or maximum value.",name:"Stretch",pixelType:"UNKNOWN",type:"StretchFunction"},functionType:0,name:"Stretch",thumbnail:""},RemapFunction:{name:"Remap",description:"Changes pixel values by assigning new values to ranges of pixel values or using an external table.",function:{type:"RemapFunction",pixelType:"UNKNOWN",name:"Remap",description:"Changes pixel values by assigning new values to ranges of pixel values or using an external table."},arguments:{Raster:{name:"Raster",isPublic:!1,isDataset:!0,type:"RasterFunctionVariable"},UseTable:{name:"UseTable",isPublic:!1,isDataset:!1,value:!1,type:"RasterFunctionVariable"},InputRanges:{name:"InputRanges",isPublic:!1,isDataset:!1,type:"RasterFunctionVariable",displayName:"Input Ranges"},OutputValues:{name:"OutputValues",isPublic:!1,isDataset:!1,type:"RasterFunctionVariable",displayName:"Output Values"},NoDataRanges:{name:"NoDataRanges",isPublic:!1,isDataset:!1,type:"RasterFunctionVariable",displayName:"NoData Ranges"},Table:{name:"Table",isPublic:!1,isDataset:!1,type:"RasterFunctionVariable"},InputField:{name:"InputField",isPublic:!1,isDataset:!1,type:"RasterFunctionVariable"},OutputField:{name:"OutputField",isPublic:!1,isDataset:!1,type:"RasterFunctionVariable"},InputMaxField:{name:"InputMaxField",isPublic:!1,isDataset:!1,type:"RasterFunctionVariable"},RemapTableType:{name:"RemapTableType",isPublic:!1,isDataset:!1,value:1,type:"RasterFunctionVariable"},AllowUnmatched:{name:"AllowUnmatched",isPublic:!1,isDataset:!1,value:!0,type:"RasterFunctionVariable"},type:"RemapFunctionArguments"},functionType:0,thumbnail:""},ColormapFunction:{name:"Colormap",description:"Changes pixel values to display the raster data as either a grayscale or a red, green, blue (RGB) image, based on a colormap or a color ramp.",function:{type:"ColormapFunction",pixelType:"UNKNOWN",name:"Colormap",description:"Changes pixel values to display the raster data as either a grayscale or a red, green, blue (RGB) image, based on a colormap or a color ramp."},arguments:{Raster:{name:"Raster",isPublic:!1,isDataset:!0,type:"RasterFunctionVariable"},ColorSchemeType:{name:"ColorSchemeType",isPublic:!1,isDataset:!1,value:1,type:"RasterFunctionVariable"},Colormap:{name:"Colormap",isPublic:!1,isDataset:!1,type:"RasterFunctionVariable"},ColormapName:{name:"ColormapName",isPublic:!1,isDataset:!1,value:"Gray",type:"RasterFunctionVariable"},ColorRamp:{name:"ColorRamp",isPublic:!1,isDataset:!1,type:"RasterFunctionVariable"},type:"ColormapFunctionArguments"},functionType:0,thumbnail:""},ShadedReliefFunction:{name:"Shaded Relief",description:"Creates a multiband, color coded, 3D representation of the surface, with the sun's relative position taken into account for shading the image.",function:{type:"ShadedReliefFunction",pixelType:"UNKNOWN",name:"Shaded Relief",description:"Creates a multiband, color coded, 3D representation of the surface, with the sun's relative position taken into account for shading the image."},arguments:{Raster:{name:"Raster",isPublic:!1,isDataset:!0,type:"RasterFunctionVariable"},ColorSchemeType:{name:"ColorSchemeType",isPublic:!1,isDataset:!1,value:1,type:"RasterFunctionVariable"},ColorRamp:{name:"ColorRamp",isPublic:!1,isDataset:!1,type:"RasterFunctionVariable"},HillshadeType:{name:"HillshadeType",isPublic:!1,isDataset:!1,value:0,type:"RasterFunctionVariable"},Colormap:{name:"Colormap",isPublic:!1,isDataset:!1,type:"RasterFunctionVariable"},Azimuth:{name:"Azimuth",isPublic:!1,isDataset:!1,value:315,type:"RasterFunctionVariable"},Altitude:{name:"Altitude",isPublic:!1,isDataset:!1,value:45,type:"RasterFunctionVariable"},SlopeType:{name:"SlopeType",isPublic:!1,isDataset:!1,value:1,type:"RasterFunctionVariable"},ZFactor:{name:"ZFactor",isPublic:!1,isDataset:!1,value:1,type:"RasterFunctionVariable"},PSPower:{name:"PSPower",isPublic:!1,isDataset:!1,value:.664,type:"RasterFunctionVariable"},PSZFactor:{name:"PSZFactor",isPublic:!1,isDataset:!1,value:.024,type:"RasterFunctionVariable"},RemoveEdgeEffect:{name:"RemoveEdgeEffect",isPublic:!1,isDataset:!1,value:!1,type:"RasterFunctionVariable"},type:"ShadedReliefFunctionArguments"},functionType:0,thumbnail:""},HillshadeFunction:{name:"Hillshade",description:"Creates a 3D representation of the surface, with the sun's relative position taken into account for shading the image",function:{type:"HillshadeFunction",pixelType:"UNKNOWN",name:"Hillshade",description:"Creates a 3D representation of the surface, with the sun's relative position taken into account for shading the image"},arguments:{DEM:{name:"DEM",isPublic:!1,isDataset:!0,type:"RasterFunctionVariable"},HillshadeType:{name:"HillshadeType",isPublic:!1,isDataset:!1,value:0,type:"RasterFunctionVariable"},Azimuth:{name:"Azimuth",isPublic:!1,isDataset:!1,value:315,type:"RasterFunctionVariable"},Altitude:{name:"Altitude",isPublic:!1,isDataset:!1,value:45,type:"RasterFunctionVariable"},SlopeType:{name:"SlopeType",isPublic:!1,isDataset:!1,value:1,type:"RasterFunctionVariable"},ZFactor:{name:"ZFactor",isPublic:!1,isDataset:!1,value:1,type:"RasterFunctionVariable"},PSPower:{name:"PSPower",isPublic:!1,isDataset:!1,value:.664,type:"RasterFunctionVariable"},PSZFactor:{name:"PSZFactor",isPublic:!1,isDataset:!1,value:.024,type:"RasterFunctionVariable"},RemoveEdgeEffect:{name:"RemoveEdgeEffect",isPublic:!1,isDataset:!1,value:!1,type:"RasterFunctionVariable"},type:"HillshadeFunctionArguments"},functionType:0,thumbnail:""},ResampleFunction:{name:"Resample",description:"Changes the cell size of a raster.",function:{type:"ResampleFunction",pixelType:"UNKNOWN",name:"Resample",description:"Changes the cell size of a raster."},arguments:{Raster:{name:"Raster",isPublic:!1,isDataset:!0,type:"RasterFunctionVariable"},ResamplingType:{name:"ResamplingType",isPublic:!1,isDataset:!1,value:0,type:"RasterFunctionVariable"},InputCellSize:{name:"InputCellsize",isPublic:!1,isDataset:!1,value:{x:0,y:0},type:"RasterFunctionVariable"},OutputCellSize:{name:"OutputCellsize",isPublic:!1,isDataset:!1,value:{x:0,y:0},type:"RasterFunctionVariable"},type:"ResampleFunctionArguments"},functionType:0,thumbnail:""}};var q=i(93010),z=i(75509),L=i(27922);const Z={u1:[0,1],u2:[0,3],u4:[0,15],u8:[0,255],s8:[-128,127],u16:[0,65535],s16:[-32768,32767]},k={simple_scalar:"Simple Scalar",wind_barb:"Wind Barb",single_arrow:"Single Arrow",beaufort_kn:"Beaufort Wind (Knots)",beaufort_m:"Beaufort Wind (MetersPerSecond)",ocean_current_m:"Ocean Current (MetersPerSecond)",ocean_current_kn:"Ocean Current (Knots)"},U=new Set(["raster-stretch","unique-value","class-breaks","raster-shaded-relief","vector-field","raster-colormap"]);function H(e){return U.has(e.type)}function Q(e,t){if(!e||!t)return(0,v.d9)(e||t);const i=(0,v.d9)(e);if(t.rasterFunctionDefinition){const e=t.rasterFunctionDefinition;(e.thumbnail||e.thumbnailEx)&&(e.thumbnail=e.thumbnailEx=null),G(i.rasterFunctionDefinition.arguments,t)}else"none"!==t.functionName.toLowerCase()&&(W(i.functionArguments).Raster=t);return i}function G(e,t){for(const i in e)"raster"===i.toLowerCase()&&("RasterFunctionVariable"===e[i].type?(e[i]=t.rasterFunctionDefinition,e[i].type="RasterFunctionTemplate"):"RasterFunctionTemplate"===e[i].type&&G(e[i].arguments,t))}function B(e){const t=(0,v.d9)(E[e.functionName+"Function"]),i=e.functionArguments;for(const e in i)"raster"===e.toLowerCase()?(t.arguments[e]=B(i[e]),t.arguments[e].type="RasterFunctionTemplate"):"colormap"===e.toLowerCase()?(t.arguments[e].value=ee(i[e]),t.arguments.ColorSchemeType.value=0):t.arguments[e].value=i[e];return t}function W(e){const t=e.Raster;return t&&"esri.layers.support.RasterFunction"===t.declaredClass?W(t.functionArguments):e}const $={none:0,standardDeviation:3,histogramEqualization:4,minMax:5,percentClip:6,sigmoid:9};function K(e,t){const i=Z[String(t).toLowerCase()];return i&&e.push([Math.floor(i[0]-1),0,0,0],[Math.ceil(i[1]+1),0,0,0]),e}function X(e){if((0,a.Wi)(e))return;const{fields:t}=e,i=t&&t.find((e=>e&&e.name&&"value"===e.name.toLowerCase()));return i&&i.name}function Y(e){const t=[];return e.forEach((e=>{const i=e;if(Array.isArray(i))t.push(i);else{if(null==i.min||null==i.max)return;const e=[i.min,i.max,i.avg||0,i.stddev||0];t.push(e)}})),t}function ee(e){const t=[],i=[];return e.forEach((e=>{t.push(e[0]),i.push((0,q.io)([...e.slice(1),255]))})),{type:"RasterColormap",values:t,colors:i}}var te,ie=i(90578),re=i(13473);const se=(0,R.w)()({MT_FIRST:"first",MT_LAST:"last",MT_MIN:"min",MT_MAX:"max",MT_MEAN:"mean",MT_BLEND:"blend",MT_SUM:"sum"}),ne=(0,R.w)()({esriMosaicNone:"none",esriMosaicCenter:"center",esriMosaicNadir:"nadir",esriMosaicViewpoint:"viewpoint",esriMosaicAttribute:"attribute",esriMosaicLockRaster:"lock-raster",esriMosaicNorthwest:"northwest",esriMosaicSeamline:"seamline"});let ae=te=class extends F.wq{constructor(e){super(e),this.ascending=!0,this.itemRenderingRule=null,this.lockRasterIds=null,this.method=null,this.multidimensionalDefinition=null,this.objectIds=null,this.operation=null,this.sortField=null,this.sortValue=null,this.viewpoint=null,this.where=null}readAscending(e,t){return null!=t.ascending?t.ascending:null==t.sortAscending||t.sortAscending}readMethod(e,t){return function(e){let t;switch(e?e.toLowerCase().replace("esrimosaic",""):""){case"byattribute":case"attribute":t="esriMosaicAttribute";break;case"lockraster":t="esriMosaicLockRaster";break;case"center":t="esriMosaicCenter";break;case"northwest":t="esriMosaicNorthwest";break;case"nadir":t="esriMosaicNadir";break;case"viewpoint":t="esriMosaicViewpoint";break;case"seamline":t="esriMosaicSeamline";break;default:t="esriMosaicNone"}return ne.fromJSON(t)}(t.mosaicMethod||t.defaultMosaicMethod)}readOperation(e,t){const i=t.mosaicOperation,r=t.mosaicOperator&&t.mosaicOperator.toLowerCase(),s=i||(r?se.toJSON(r):null);return se.fromJSON(s)||"first"}castSortValue(e){return null==e||"string"==typeof e||"number"==typeof e?e:`${e}`}clone(){return new te({ascending:this.ascending,itemRenderingRule:(0,v.d9)(this.itemRenderingRule),lockRasterIds:(0,v.d9)(this.lockRasterIds),method:this.method,multidimensionalDefinition:(0,v.d9)(this.multidimensionalDefinition),objectIds:(0,v.d9)(this.objectIds),operation:this.operation,sortField:this.sortField,sortValue:this.sortValue,viewpoint:(0,v.d9)(this.viewpoint),where:this.where})}};(0,s._)([(0,u.Cb)({type:Boolean,json:{write:!0}})],ae.prototype,"ascending",void 0),(0,s._)([(0,S.r)("ascending",["ascending","sortAscending"])],ae.prototype,"readAscending",null),(0,s._)([(0,u.Cb)({type:J,json:{write:!0}})],ae.prototype,"itemRenderingRule",void 0),(0,s._)([(0,u.Cb)({type:[p.z8],json:{write:{overridePolicy(){return{enabled:"lock-raster"===this.method}}}}})],ae.prototype,"lockRasterIds",void 0),(0,s._)([(0,u.Cb)({type:String,json:{type:ne.jsonValues,write:{target:"mosaicMethod",writer:ne.write}}})],ae.prototype,"method",void 0),(0,s._)([(0,S.r)("method",["mosaicMethod","defaultMosaicMethod"])],ae.prototype,"readMethod",null),(0,s._)([(0,u.Cb)({type:[x.Z],json:{write:!0}})],ae.prototype,"multidimensionalDefinition",void 0),(0,s._)([(0,u.Cb)({type:[p.z8],json:{name:"fids",write:!0}})],ae.prototype,"objectIds",void 0),(0,s._)([(0,u.Cb)({json:{type:se.jsonValues,read:{reader:se.read},write:{target:"mosaicOperation",writer:se.write}}})],ae.prototype,"operation",void 0),(0,s._)([(0,S.r)("operation",["mosaicOperation","mosaicOperator"])],ae.prototype,"readOperation",null),(0,s._)([(0,u.Cb)({type:String,json:{write:{overridePolicy(){return{enabled:"attribute"===this.method}}}}})],ae.prototype,"sortField",void 0),(0,s._)([(0,u.Cb)({type:[String,Number],json:{write:{allowNull:!0,overridePolicy(){return{enabled:"attribute"===this.method,allowNull:!0}}}}})],ae.prototype,"sortValue",void 0),(0,s._)([(0,ie.p)("sortValue")],ae.prototype,"castSortValue",null),(0,s._)([(0,u.Cb)({type:re.Z,json:{write:!0}})],ae.prototype,"viewpoint",void 0),(0,s._)([(0,u.Cb)({type:String,json:{write:!0}})],ae.prototype,"where",void 0),ae=te=(0,s._)([(0,c.j)("esri.layers.support.MosaicRule")],ae);const oe=ae;var le=i(69608);let ue=class extends F.wq{constructor(){super(...arguments),this.layer=null,this.adjustAspectRatio=void 0,this.bandIds=void 0,this.compression=void 0,this.compressionQuality=void 0,this.compressionTolerance=.01,this.interpolation=null,this.noData=null,this.noDataInterpretation=void 0,this.pixelType=void 0,this.lercVersion=2}writeAdjustAspectRatio(e,t,i){this.layer.version<10.3||(t[i]=e)}writeCompressionQuality(e,t,i){this.format&&this.format.toLowerCase().includes("jpg")&&null!=e&&(t[i]=e)}writeCompressionTolerance(e,t,i){"lerc"===this.format&&null!=e&&(t[i]=e)}get format(){return"vector-field"===this.layer.renderer?.type?"lerc":this.layer.format}writeLercVersion(e,t,i){"lerc"===this.format&&this.layer.version>=10.5&&(t[i]=e)}get version(){const e=this.layer;return e.commitProperty("bandIds"),e.commitProperty("format"),e.commitProperty("compressionQuality"),e.commitProperty("compressionTolerance"),e.commitProperty("interpolation"),e.commitProperty("noData"),e.commitProperty("noDataInterpretation"),e.commitProperty("mosaicRule"),e.commitProperty("renderingRule"),e.commitProperty("adjustAspectRatio"),e.commitProperty("pixelFilter"),e.commitProperty("renderer"),e.commitProperty("definitionExpression"),(this._get("version")||0)+1}set version(e){this._set("version",e)}get mosaicRule(){const e=this.layer;let t=e.mosaicRule;const i=e.definitionExpression;return t?i&&i!==t.where&&(t=t.clone(),t.where=i):i&&(t=new oe({where:i})),t}get renderingRule(){const e=this.layer;let t=e.renderingRule;const i=e.pixelFilter,r=!e.format||e.format.includes("jpg")||e.format.includes("png");return t=this._addResampleRasterFunction(t),r&&!i&&"vector-field"!==e.renderer?.type&&(t=this.combineRendererWithRenderingRule()),t}combineRendererWithRenderingRule(){const e=this.layer,{rasterInfo:t,renderingRule:i,renderer:r}=e;return r&&H(r)?Q(function(e,t){switch(t=t||{},e.type){case"raster-stretch":return function(e,t){const i=t.convertToRFT,r=new J;r.functionName="Stretch";const s=$[z.v.toJSON(e.stretchType)],n="u8",a={StretchType:s,Statistics:Y(e.statistics),DRA:e.dynamicRangeAdjustment,UseGamma:e.useGamma,Gamma:e.gamma,ComputeGamma:e.computeGamma};if(null!=e.outputMin&&(a.Min=e.outputMin),null!=e.outputMax&&(a.Max=e.outputMax),s===$.standardDeviation?(a.NumberOfStandardDeviations=e.numberOfStandardDeviations,r.outputPixelType=n):s===$.percentClip?(a.MinPercent=e.minPercent,a.MaxPercent=e.maxPercent,r.outputPixelType=n):s===$.minMax?r.outputPixelType=n:s===$.sigmoid&&(a.SigmoidStrengthLevel=e.sigmoidStrengthLevel),r.functionArguments=a,r.variableName="Raster",e.colorRamp){const s=e.colorRamp,n=new J;if(i)n.functionArguments={ColorRamp:(0,q.pM)(s)};else{const i=(0,q.Uh)(s);if(i)n.functionArguments={colorRamp:i};else if(!t.convertColorRampToColormap||"algorithmic"!==s.type&&"multipart"!==s.type){const t=e.colorRamp.toJSON();"algorithmic"===t.type?t.algorithm=t.algorithm||"esriCIELabAlgorithm":"multipart"===t.type&&t.colorRamps?.length&&t.colorRamps.forEach((e=>e.algorithm=e.algorithm||"esriCIELabAlgorithm")),n.functionArguments={colorRamp:t}}else n.functionArguments={Colormap:(0,q.Jw)(s,256)}}return n.variableName="Raster",n.functionName="Colormap",n.functionArguments.Raster=r,i?new J({rasterFunctionDefinition:B(n)}):n}return i?new J({rasterFunctionDefinition:B(r)}):r}(e,t);case"class-breaks":return function(e,t){const i=[],r=[],s=[],n=[],o=1e-6,{pixelType:l,rasterAttributeTable:u}=t,p=(0,a.Wi)(u)?null:u.features,c=X(u);if(p&&Array.isArray(p)&&e.classBreakInfos){e.classBreakInfos.forEach(((t,i)=>{const r=t.symbol.color;let s;r.a&&p.forEach((a=>{s=a.attributes[e.field],(s>=t.minValue&&s<t.maxValue||i===e.classBreakInfos.length-1&&s>=t.minValue)&&n.push([a.attributes[c],r.r,r.g,r.b])}))}));const i=l?K(n,l):n,r=new J;return r.functionName="Colormap",r.functionArguments={},r.functionArguments.Colormap=i,r.variableName="Raster",t.convertToRFT?new J({rasterFunctionDefinition:B(r)}):r}e.classBreakInfos.forEach(((e,t)=>{const a=e.symbol&&e.symbol.color;a.a?(0===t?i.push(e.minValue,e.maxValue+o):i.push(e.minValue+o,e.maxValue+o),r.push(t),n.push([t,a.r,a.g,a.b])):s.push(e.minValue,e.maxValue)}));const m=l?K(n,l):n,d=new J;d.functionName="Remap",d.functionArguments={InputRanges:i,OutputValues:r,NoDataRanges:s},d.variableName="Raster";const h=new J;return h.functionName="Colormap",h.functionArguments={Colormap:m,Raster:d},t.convertToRFT?new J({rasterFunctionDefinition:B(h)}):h}(e,t);case"unique-value":return function(e,t){const i=[],{pixelType:r,rasterAttributeTable:s}=t,n=(0,a.Wi)(s)?null:s.features,o=X(s),l=e.defaultSymbol?.color?.toRgb(),u=e.uniqueValueInfos;if(u)if(n){const t=new Map;u.forEach((e=>{const i=e.value,r=e.symbol.color?.toRgb();null!=i&&r&&t.set(String(i),r)}));const r=e.field;n.forEach((({attributes:e})=>{const s=String(e[r]),n=e[o];if(t.has(s)){const e=t.get(s);i.push([n,...e])}else l&&i.push([n,...l])}))}else for(let e=0;e<u.length;e++){const t=u[e],r=t.symbol.color,s=+t.value;if(r?.a){if(isNaN(s))return null;i.push([s,r.r,r.g,r.b])}}const p=r&&i.length>0?K(i,r):i,c=new J;return c.functionName="Colormap",c.functionArguments={},c.functionArguments.Colormap=p,c.variableName="Raster",t.convertToRFT?new J({rasterFunctionDefinition:B(c)}):c}(e,t);case"raster-colormap":return function(e,t){const i=e.extractColormap();if(!i||0===i.length)return;const{pixelType:r}=t,s=r?K(i,r):i,n=new J;return n.functionName="Colormap",n.functionArguments={},n.functionArguments.Colormap=s,t.convertToRFT?new J({rasterFunctionDefinition:B(n)}):n}(e,t);case"vector-field":return function(e,t){const i=new J;i.functionName="VectorFieldRenderer";const{dataType:r,bandProperties:s}=t,n="vector-uv"===r;let a,o;s&&2===s.length&&(a=s.map((e=>e.BandName.toLowerCase())).indexOf("magnitude"),o=s.map((e=>e.BandName.toLowerCase())).indexOf("direction")),-1!==a&&null!==a||(a=0,o=1);const l="arithmetic"===e.rotationType?1:2,u="flow-from"===e.flowRepresentation?0:1,p=e.visualVariables?e.visualVariables.find((e=>"Magnitude"===e.field)):new L.Z,c={magnitudeBandID:a,directionBandID:o,isUVComponents:n,referenceSystem:l,massFlowAngleRepresentation:u,symbolTileSize:50,symbolTileSizeUnits:100,calculationMethod:"Vector Average",symbologyName:k[e.style.toLowerCase().replace("-","_")],minimumMagnitude:p.minDataValue,maximumMagnitude:p.maxDataValue,minimumSymbolSize:p.minSize,maximumSymbolSize:p.maxSize};return i.functionArguments=c,t.convertToRFT?new J({rasterFunctionDefinition:B(i)}):i}(e,t);case"raster-shaded-relief":return function(e,t){const i=t.convertToRFT;if("elevation"!==t.dataType)return new J;const r=new J;r.functionName="Hillshade";const s="traditional"===e.hillshadeType?0:1,n="none"===e.scalingType?1:3,a={HillshadeType:s,SlopeType:n,ZFactor:e.zFactor};return 0===s&&(a.Azimuth=e.azimuth,a.Altitude=e.altitude),3===n&&(a.PSPower=e.pixelSizePower,a.PSZFactor=e.pixelSizeFactor),r.functionArguments=a,r.variableName="Raster",e.colorRamp&&(r.functionName="ShadedRelief",i?a.ColorRamp=(0,q.pM)(e.colorRamp):a.Colormap=(0,q.Jw)(e.colorRamp,256)),i?new J({rasterFunctionDefinition:B(r)}):r}(e,t);case"flow":throw new Error("Unsupported rendering rule.")}}(r,{rasterAttributeTable:t.attributeTable,pixelType:t.pixelType,dataType:t.dataType,bandProperties:t.keyProperties?.BandProperties,convertColorRampToColormap:e.version<10.6,convertToRFT:!!i?.rasterFunctionDefinition}),i):i}_addResampleRasterFunction(e){if("vector-field"!==this.layer.renderer?.type||"Resample"===e?.functionName||(0,a.Wi)(this.layer.serviceRasterInfo))return e;const t="esriImageServiceDataTypeVector-UV"===this.layer.serviceDataType?7:10,i=this.layer.serviceRasterInfo.pixelSize;let r=new J({functionName:"Resample",functionArguments:{ResamplingType:t,InputCellSize:i}});return r=e?.rasterFunctionDefinition?new J({rasterFunctionDefinition:B(r)}):r,Q(r,e)}};(0,s._)([(0,u.Cb)()],ue.prototype,"layer",void 0),(0,s._)([(0,u.Cb)({json:{write:!0}})],ue.prototype,"adjustAspectRatio",void 0),(0,s._)([(0,m.c)("adjustAspectRatio")],ue.prototype,"writeAdjustAspectRatio",null),(0,s._)([(0,u.Cb)({json:{write:!0}}),(0,T.B)("layer.bandIds")],ue.prototype,"bandIds",void 0),(0,s._)([(0,u.Cb)({json:{write:!0}})],ue.prototype,"compression",void 0),(0,s._)([(0,u.Cb)({json:{write:!0}}),(0,T.B)("layer.compressionQuality")],ue.prototype,"compressionQuality",void 0),(0,s._)([(0,m.c)("compressionQuality")],ue.prototype,"writeCompressionQuality",null),(0,s._)([(0,u.Cb)({json:{write:!0}}),(0,T.B)("layer.compressionTolerance")],ue.prototype,"compressionTolerance",void 0),(0,s._)([(0,m.c)("compressionTolerance")],ue.prototype,"writeCompressionTolerance",null),(0,s._)([(0,u.Cb)({json:{write:!0}})],ue.prototype,"format",null),(0,s._)([(0,u.Cb)({type:String,json:{read:{reader:le.c.read},write:{writer:le.c.write}}}),(0,T.B)("layer.interpolation")],ue.prototype,"interpolation",void 0),(0,s._)([(0,u.Cb)({json:{write:!0}}),(0,T.B)("layer.noData")],ue.prototype,"noData",void 0),(0,s._)([(0,u.Cb)({type:String,json:{read:{reader:le.k.read},write:{writer:le.k.write}}}),(0,T.B)("layer.noDataInterpretation")],ue.prototype,"noDataInterpretation",void 0),(0,s._)([(0,u.Cb)({json:{write:!0}})],ue.prototype,"pixelType",void 0),(0,s._)([(0,u.Cb)({json:{write:!0}})],ue.prototype,"lercVersion",void 0),(0,s._)([(0,m.c)("lercVersion")],ue.prototype,"writeLercVersion",null),(0,s._)([(0,u.Cb)({type:Number})],ue.prototype,"version",null),(0,s._)([(0,u.Cb)({json:{write:!0}})],ue.prototype,"mosaicRule",null),(0,s._)([(0,u.Cb)({json:{write:!0}})],ue.prototype,"renderingRule",null),ue=(0,s._)([(0,c.j)("esri.layers.mixins.ExportImageServiceParameters")],ue);var pe=i(1231),ce=i(99514),me=i(54163),de=i(48526),he=i(88281),ye=i(99815),fe=i(75993),ge=i(80676),be=i(67058),Re=i(91219),ve=i(82526),we=i(11282),_e=i(82971);let Ce=class extends F.wq{constructor(){super(...arguments),this.north=null,this.up=null,this.spatialReference=null}};(0,s._)([(0,u.Cb)({type:Number,json:{write:!0}})],Ce.prototype,"north",void 0),(0,s._)([(0,u.Cb)({type:Number,json:{write:!0}})],Ce.prototype,"up",void 0),(0,s._)([(0,u.Cb)({type:_e.Z,json:{write:!0}})],Ce.prototype,"spatialReference",void 0),Ce=(0,s._)([(0,c.j)("esri.rest.support.ImageAngleResult")],Ce);const Se=Ce;var Ie=i(74889);let xe=class extends F.wq{constructor(){super(...arguments),this.catalogItemVisibilities=null,this.catalogItems=null,this.location=null,this.name=null,this.objectId=null,this.processedValues=null,this.properties=null,this.value=null}};(0,s._)([(0,u.Cb)({json:{write:!0}})],xe.prototype,"catalogItemVisibilities",void 0),(0,s._)([(0,u.Cb)({type:Ie.default,json:{write:!0}})],xe.prototype,"catalogItems",void 0),(0,s._)([(0,u.Cb)({type:re.Z,json:{write:!0}})],xe.prototype,"location",void 0),(0,s._)([(0,u.Cb)({json:{write:!0}})],xe.prototype,"name",void 0),(0,s._)([(0,u.Cb)({json:{write:!0}})],xe.prototype,"objectId",void 0),(0,s._)([(0,u.Cb)({json:{write:!0}})],xe.prototype,"processedValues",void 0),(0,s._)([(0,u.Cb)({json:{write:!0}})],xe.prototype,"properties",void 0),(0,s._)([(0,u.Cb)({json:{write:!0}})],xe.prototype,"value",void 0),xe=(0,s._)([(0,c.j)("esri.rest.support.ImageIdentifyResult")],xe);const Fe=xe;let Te=class extends F.wq{constructor(){super(...arguments),this.geometries=null}};(0,s._)([(0,u.Cb)({json:{write:!0}})],Te.prototype,"geometries",void 0),Te=(0,s._)([(0,c.j)("esri.rest.support.ImagePixelLocationResult")],Te);const Ne=Te;let De=class extends F.wq{constructor(){super(...arguments),this.attributes=null,this.location=null,this.locationId=null,this.rasterId=null,this.resolution=null,this.pixelValue=null}};(0,s._)([(0,u.Cb)({json:{write:!0}})],De.prototype,"attributes",void 0),(0,s._)([(0,u.Cb)({type:re.Z,json:{write:!0}})],De.prototype,"location",void 0),(0,s._)([(0,u.Cb)({json:{write:!0}})],De.prototype,"locationId",void 0),(0,s._)([(0,u.Cb)({json:{write:!0}})],De.prototype,"rasterId",void 0),(0,s._)([(0,u.Cb)({json:{write:!0}})],De.prototype,"resolution",void 0),(0,s._)([(0,u.Cb)({json:{write:!0}})],De.prototype,"pixelValue",void 0),De=(0,s._)([(0,c.j)("esri.rest.support.ImageSample")],De);const Pe=De;let Oe=class extends F.wq{constructor(){super(...arguments),this.samples=null}};(0,s._)([(0,u.Cb)({type:[Pe],json:{write:!0}})],Oe.prototype,"samples",void 0),Oe=(0,s._)([(0,c.j)("esri.rest.support.ImageSampleResult")],Oe);const je=Oe;function Ve(e){const t=e?.time;if(t&&(null!=t.start||null!=t.end)){const i=[];null!=t.start&&i.push(t.start),null==t.end||i.includes(t.end)||i.push(t.end),e.time=i.join(",")}}async function Me(e,t,i){const r=(0,we.en)(e),s=t.geometry?[t.geometry]:[],n=await(0,ve.aX)(s),o=t.toJSON();Ve(o);const l=n&&n[0];(0,a.pC)(l)&&(o.geometry=l.toJSON());const u=(0,we.cv)({...r.query,f:"json",...o});return(0,we.lA)(u,i)}async function Ae(e,t,i){const r=(0,we.en)(e),s=t.geometry?[t.geometry]:[];return(0,ve.aX)(s).then((e=>{const s=t.toJSON(),n=e&&e[0];(0,a.pC)(n)&&(s.geometry=JSON.stringify(n.toJSON()));const o=(0,we.cv)({...r.query,f:"json",...s}),l=(0,we.lA)(o,i);return(0,g.default)(r.path+"/identify",l)})).then((e=>Fe.fromJSON(e.data)))}function Je(e){const{imageCoordinateSystem:t}=e;if(t){const{id:e,referenceServiceName:i}=t;return null!=e?i?{icsid:e,icsns:i}:{icsid:e}:{ics:t}}return e.toJSON()}function Ee(e,t){const i=Je(e),{icsid:r,icsns:s,wkid:n}=i;return null!=r?null==s||t?.toLowerCase().includes("/"+s.toLowerCase()+"/")?`0:${r}`:JSON.stringify(i):n?n.toString():JSON.stringify(i)}i(10158);var qe,ze=i(4967),Le=(i(67900),i(8744),i(98732),i(6570)),Ze=(i(9361),i(65091)),ke=i(38913),Ue=(i(58901),i(45091),i(57444)),He=(i(40330),i(98326),i(56545),i(41818)),Qe=i(5396),Ge=(i(75935),i(28141),i(26059)),Be=i(36679);let We=qe=class extends F.wq{constructor(){super(...arguments),this.angleNames=null,this.point=null,this.spatialReference=null,this.rasterId=null}clone(){return new qe((0,v.d9)({angleNames:this.angleNames,point:this.point,spatialReference:this.spatialReference,rasterId:this.rasterId}))}};(0,s._)([(0,u.Cb)({type:[String],json:{name:"angleName",write:!0}})],We.prototype,"angleNames",void 0),(0,s._)([(0,u.Cb)({type:re.Z,json:{write:!0}})],We.prototype,"point",void 0),(0,s._)([(0,u.Cb)({type:_e.Z,json:{write:!0}})],We.prototype,"spatialReference",void 0),(0,s._)([(0,u.Cb)({type:p.z8,json:{write:!0}})],We.prototype,"rasterId",void 0),We=qe=(0,s._)([(0,c.j)("esri.rest.support.ImageAngleParameters")],We);const $e=We;var Ke,Xe=i(92835),Ye=i(33955);let et=Ke=class extends F.wq{constructor(){super(...arguments),this.geometry=null,this.mosaicRule=null,this.renderingRule=null,this.pixelSize=null,this.raster=void 0,this.timeExtent=null}writeGeometry(e,t,i){null!=e&&(t.geometryType=(0,Ye.Ji)(e),t[i]=e.toJSON())}clone(){return new Ke((0,v.d9)({geometry:this.geometry,mosaicRule:this.mosaicRule,renderingRule:this.renderingRule,pixelSize:this.pixelSize,raster:this.raster,timeExtent:this.timeExtent}))}};(0,s._)([(0,u.Cb)({types:h.qM,json:{read:Ye.im}})],et.prototype,"geometry",void 0),(0,s._)([(0,m.c)("geometry")],et.prototype,"writeGeometry",null),(0,s._)([(0,u.Cb)({type:oe,json:{write:!0}})],et.prototype,"mosaicRule",void 0),(0,s._)([(0,u.Cb)({type:J,json:{write:!0}})],et.prototype,"renderingRule",void 0),(0,s._)([(0,u.Cb)({type:re.Z,json:{write:!0}})],et.prototype,"pixelSize",void 0),(0,s._)([(0,u.Cb)({json:{write:!0}})],et.prototype,"raster",void 0),(0,s._)([(0,u.Cb)({type:Xe.Z,json:{read:{source:"time"},write:{target:"time"}}})],et.prototype,"timeExtent",void 0),et=Ke=(0,s._)([(0,c.j)("esri.rest.support.ImageHistogramParameters")],et);const tt=et;var it;let rt=it=class extends F.wq{constructor(){super(...arguments),this.geometry=null,this.renderingRules=null,this.pixelSize=null,this.returnGeometry=!0,this.returnCatalogItems=!0,this.returnPixelValues=!0,this.maxItemCount=null,this.timeExtent=null,this.raster=void 0,this.viewId=void 0,this.processAsMultidimensional=!1}writeGeometry(e,t,i){null!=e&&(t.geometryType=(0,Ye.Ji)(e),t[i]=JSON.stringify(e.toJSON()))}set mosaicRule(e){let t=e;t&&t.mosaicMethod&&(t=oe.fromJSON({...t.toJSON(),mosaicMethod:t.mosaicMethod,mosaicOperation:t.mosaicOperation})),this._set("mosaicRule",t)}writeMosaicRule(e,t,i){null!=e&&(t[i]=JSON.stringify(e.toJSON()))}set renderingRule(e){let t=e;t&&t.rasterFunction&&(t=J.fromJSON({...t.toJSON(),rasterFunction:t.rasterFunction,rasterFunctionArguments:t.rasterFunctionArguments})),this._set("renderingRule",t)}writeRenderingRule(e,t,i){null!=e&&(t[i]=JSON.stringify(e.toJSON())),e.rasterFunctionDefinition&&(t[i]=JSON.stringify(e.rasterFunctionDefinition))}writeRenderingRules(e,t,i){null!=e&&(t[i]=JSON.stringify(e.map((e=>e.rasterFunctionDefinition||e.toJSON()))))}writePixelSize(e,t,i){null!=e&&(t[i]=JSON.stringify(e))}writeTimeExtent(e,t,i){if(null!=e){const r=(0,a.pC)(e.start)?e.start.getTime():null,s=(0,a.pC)(e.end)?e.end.getTime():null;t[i]=null!=r?null!=s?`${r},${s}`:`${r}`:null}}clone(){return new it((0,v.d9)({geometry:this.geometry,mosaicRule:this.mosaicRule,renderingRule:this.renderingRule,pixelSize:this.pixelSize,returnGeometry:this.returnGeometry,returnCatalogItems:this.returnCatalogItems,returnPixelValues:this.returnPixelValues,maxItemCount:this.maxItemCount,processAsMultidimensional:this.processAsMultidimensional,raster:this.raster,viewId:this.viewId,timeExtent:this.timeExtent}))}};(0,s._)([(0,u.Cb)({json:{write:!0}})],rt.prototype,"geometry",void 0),(0,s._)([(0,m.c)("geometry")],rt.prototype,"writeGeometry",null),(0,s._)([(0,u.Cb)({type:oe,json:{write:!0}})],rt.prototype,"mosaicRule",null),(0,s._)([(0,m.c)("mosaicRule")],rt.prototype,"writeMosaicRule",null),(0,s._)([(0,u.Cb)({type:J,json:{write:!0}})],rt.prototype,"renderingRule",null),(0,s._)([(0,m.c)("renderingRule")],rt.prototype,"writeRenderingRule",null),(0,s._)([(0,u.Cb)({type:[J],json:{write:!0}})],rt.prototype,"renderingRules",void 0),(0,s._)([(0,m.c)("renderingRules")],rt.prototype,"writeRenderingRules",null),(0,s._)([(0,u.Cb)({type:re.Z,json:{write:!0}})],rt.prototype,"pixelSize",void 0),(0,s._)([(0,m.c)("pixelSize")],rt.prototype,"writePixelSize",null),(0,s._)([(0,u.Cb)({type:Boolean,json:{write:!0}})],rt.prototype,"returnGeometry",void 0),(0,s._)([(0,u.Cb)({type:Boolean,json:{write:!0}})],rt.prototype,"returnCatalogItems",void 0),(0,s._)([(0,u.Cb)({type:Boolean,json:{write:!0}})],rt.prototype,"returnPixelValues",void 0),(0,s._)([(0,u.Cb)({type:Number,json:{write:!0}})],rt.prototype,"maxItemCount",void 0),(0,s._)([(0,u.Cb)({type:Xe.Z,json:{write:{target:"time"}}})],rt.prototype,"timeExtent",void 0),(0,s._)([(0,m.c)("timeExtent")],rt.prototype,"writeTimeExtent",null),(0,s._)([(0,u.Cb)({json:{write:!0}})],rt.prototype,"raster",void 0),(0,s._)([(0,u.Cb)({json:{write:!0}})],rt.prototype,"viewId",void 0),(0,s._)([(0,u.Cb)({type:Boolean,json:{write:!0}})],rt.prototype,"processAsMultidimensional",void 0),rt=it=(0,s._)([(0,c.j)("esri.rest.support.ImageIdentifyParameters")],rt);const st=rt;var nt;let at=nt=class extends F.wq{constructor(){super(...arguments),this.geometries=null,this.rasterId=null}writeGeometry(e,t,i){t.geometries={geometryType:"esriGeometryPoint",geometries:e.map((e=>e.toJSON()))}}clone(){return new nt({geometries:this.geometries.map((e=>e.clone())),rasterId:this.rasterId})}};(0,s._)([(0,u.Cb)({type:[re.Z],json:{write:!0}})],at.prototype,"geometries",void 0),(0,s._)([(0,m.c)("geometries")],at.prototype,"writeGeometry",null),(0,s._)([(0,u.Cb)({type:p.z8,json:{write:!0}})],at.prototype,"rasterId",void 0),at=nt=(0,s._)([(0,c.j)("esri.rest.support.ImagePixelLocationParameters")],at);const ot=at;var lt;let ut=lt=class extends F.wq{constructor(){super(...arguments),this.geometry=null,this.interpolation="nearest",this.mosaicRule=null,this.outFields=null,this.pixelSize=null,this.returnFirstValueOnly=!0,this.sampleDistance=null,this.sampleCount=null,this.sliceId=null,this.timeExtent=null}writeGeometry(e,t,i){null!=e&&(t.geometryType=(0,Ye.Ji)(e),t[i]=e.toJSON())}set locations(e){if(e?.length){const t=new Ze.Z({spatialReference:e[0].spatialReference});t.points=e.map((e=>[e.x,e.y])),this._set("locations",e),this.geometry=t}}clone(){return new lt((0,v.d9)({geometry:this.geometry,locations:this.locations,interpolation:this.interpolation,mosaicRule:this.mosaicRule,outFields:this.outFields,raster:this.raster,returnFirstValueOnly:this.returnFirstValueOnly,sampleDistance:this.sampleDistance,sampleCount:this.sampleCount,sliceId:this.sliceId,pixelSize:this.pixelSize,timeExtent:this.timeExtent}))}};(0,s._)([(0,u.Cb)({types:h.qM,json:{read:Ye.im}})],ut.prototype,"geometry",void 0),(0,s._)([(0,m.c)("geometry")],ut.prototype,"writeGeometry",null),(0,s._)([(0,u.Cb)()],ut.prototype,"locations",null),(0,s._)([(0,u.Cb)({type:String,json:{type:le.c.jsonValues,read:le.c.read,write:le.c.write}})],ut.prototype,"interpolation",void 0),(0,s._)([(0,u.Cb)({type:oe,json:{write:!0}})],ut.prototype,"mosaicRule",void 0),(0,s._)([(0,u.Cb)({type:[String],json:{write:!0}})],ut.prototype,"outFields",void 0),(0,s._)([(0,u.Cb)({type:re.Z,json:{write:!0}})],ut.prototype,"pixelSize",void 0),(0,s._)([(0,u.Cb)({type:String,json:{write:!0}})],ut.prototype,"raster",void 0),(0,s._)([(0,u.Cb)({type:Boolean,json:{write:!0}})],ut.prototype,"returnFirstValueOnly",void 0),(0,s._)([(0,u.Cb)({type:Number,json:{write:!0}})],ut.prototype,"sampleDistance",void 0),(0,s._)([(0,u.Cb)({type:Number,json:{write:!0}})],ut.prototype,"sampleCount",void 0),(0,s._)([(0,u.Cb)({type:Number,json:{write:!0}})],ut.prototype,"sliceId",void 0),(0,s._)([(0,u.Cb)({type:Xe.Z,json:{read:{source:"time"},write:{target:"time"}}})],ut.prototype,"timeExtent",void 0),ut=lt=(0,s._)([(0,c.j)("esri.rest.support.ImageSampleParameters")],ut);const pt=ut;var ct=i(23808);const mt=(0,R.w)()({U1:"u1",U2:"u2",U4:"u4",U8:"u8",S8:"s8",U16:"u16",S16:"s16",U32:"u32",S32:"s32",F32:"f32",F64:"f64",C64:"c64",C128:"c128",UNKNOWN:"unknown"}),dt=new Set(["png","png8","png24","png32","jpg","bmp","gif","jpgpng","lerc","tiff"]),ht=(0,u.Eg)(p.q9,{min:0,max:255}),yt=e=>{let t=class extends e{constructor(){super(...arguments),this._functionRasterInfos={},this._rasterJobHandler={instance:null,refCount:0,connectionPromise:null},this._defaultServiceMosaicRule=null,this._serviceSourceType=null,this._serviceSupportsMosaicRule=null,this.rasterAttributeTableFieldPrefix="Raster.",this.adjustAspectRatio=null,this.bandIds=void 0,this.capabilities=null,this.compressionQuality=void 0,this.compressionTolerance=.01,this.copyright=null,this.definitionExpression=null,this.exportImageServiceParameters=null,this.rasterInfo=null,this.fields=null,this.fullExtent=null,this.hasMultidimensions=!1,this.imageMaxHeight=4100,this.imageMaxWidth=4100,this.interpolation=void 0,this.minScale=0,this.maxScale=0,this.noData=null,this.noDataInterpretation=void 0,this.objectIdField=null,this.geometryType="polygon",this.typeIdField=null,this.types=[],this.pixelFilter=null,this.raster=void 0,this.viewId=void 0,this.symbolizer=null,this.rasterFunctionInfos=null,this.serviceDataType=null,this.spatialReference=null,this.pixelType=null,this.serviceRasterInfo=null,this.sourceJSON=null,this.url=null,this.version=void 0}initialize(){this._set("exportImageServiceParameters",new ue({layer:this}))}readDefaultServiceMosaicRule(e,t){return this._serviceSupportsMosaicRule?oe.fromJSON(t):null}readServiceSourceType(e,t){return this._isMosaicDataset(t)?"mosaic-dataset":"raster-dataset"}readServiceSupportsMosaicRule(e,t){return this._isMosaicRuleSupported(t)}get _rasterFunctionNamesIndex(){const e=new Map;return!this.rasterFunctionInfos||(0,a.pC)(this.rasterFunctionInfos)&&this.rasterFunctionInfos.length<1||(0,a.pC)(this.rasterFunctionInfos)&&this.rasterFunctionInfos.forEach((t=>{e.set(t.name.toLowerCase().replace(/ /gi,"_"),t.name)})),e}readBandIds(e,t){if(Array.isArray(e)&&e.length>0&&e.every((e=>"number"==typeof e)))return e}readCapabilities(e,t){return this._readCapabilities(t)}writeCompressionQuality(e,t,i){null!=e&&"lerc"!==this.format&&(t[i]=e)}writeCompressionTolerance(e,t,i){"lerc"===this.format&&null!=e&&(t[i]=e)}get fieldsIndex(){return this.fields?new ce.Z(this.fields):null}set format(e){e&&dt.has(e.toLowerCase())&&this._set("format",e.toLowerCase())}readFormat(e,t){return"esriImageServiceDataTypeVector-UV"===t.serviceDataType||"esriImageServiceDataTypeVector-MagDir"===t.serviceDataType||null!=this.pixelFilter?"lerc":"jpgpng"}readMinScale(e,t){return null!=t.minLOD&&null!=t.maxLOD?e:0}readMaxScale(e,t){return null!=t.minLOD&&null!=t.maxLOD?e:0}set mosaicRule(e){let t=e;t&&t.mosaicMethod&&(t=oe.fromJSON({...t.toJSON(),mosaicMethod:t.mosaicMethod,mosaicOperation:t.mosaicOperation})),this._set("mosaicRule",t)}readMosaicRule(e,t){const i=e||t.mosaicRule;return i?oe.fromJSON(i):this._isMosaicRuleSupported(t)?oe.fromJSON(t):null}writeMosaicRule(e,t,i){let r=this.mosaicRule;const s=this.definitionExpression;r?s&&s!==r.where&&(r=r.clone(),r.where=s):s&&(r=new oe({where:s})),this._isValidCustomizedMosaicRule(r)&&(t[i]=r.toJSON())}get multidimensionalInfo(){return(0,a.pC)(this.serviceRasterInfo)?this.serviceRasterInfo.multidimensionalInfo:null}writeNoData(e,t,i){null!=e&&"number"==typeof e&&(t[i]=ht(e))}readObjectIdField(e,t){if(!e){const i=t.fields.filter((e=>"esriFieldTypeOID"===e.type||"oid"===e.type));e=i&&i[0]&&i[0].name}return e}get parsedUrl(){return this.url?(0,C.mN)(this.url):null}set renderer(e){this.loaded&&(e=this._configRenderer(e)),this._set("renderer",e)}readRenderer(e,t,i){const r=t?.layerDefinition?.drawingInfo?.renderer,s=(0,f.ij)(r,i);return null==s?null:("vector-field"===s.type&&t.symbolTileSize&&!r.symbolTileSize&&(s.symbolTileSize=t.symbolTileSize),H(s)||w.Z.getLogger(this.declaredClass).warn("ArcGISImageService","Imagery layer doesn't support given renderer type."),s)}writeRenderer(e,t,i){t.layerDefinition=t.layerDefinition||{},t.layerDefinition.drawingInfo=t.layerDefinition.drawingInfo||{},t.layerDefinition.drawingInfo.renderer=e.toJSON(),"vector-field"===e.type&&(t.symbolTileSize=e.symbolTileSize)}get rasterFields(){const e=this.rasterAttributeTableFieldPrefix||"Raster.",t=new pe.Z({name:"Raster.ItemPixelValue",alias:"Item Pixel Value",domain:null,editable:!1,length:50,type:"string"}),i=new pe.Z({name:"Raster.ServicePixelValue",alias:"Service Pixel Value",domain:null,editable:!1,length:50,type:"string"}),r=new pe.Z({name:"Raster.ServicePixelValue.Raw",alias:"Raw Service Pixel Value",domain:null,editable:!1,length:50,type:"string"});let s=this.fields?(0,v.d9)(this.fields):[];s.push(i),this.capabilities.operations.supportsQuery&&this.fields&&this.fields.length>0&&s.push(t),this.version>=10.4&&(0,a.pC)(this.rasterFunctionInfos)&&this.rasterFunctionInfos.some((e=>"none"===e.name.toLowerCase()))&&s.push(r),(0,a.pC)(this.rasterFunctionInfos)&&this.rasterFunctionInfos.filter((e=>"none"!==e.name.toLowerCase())).forEach((e=>{s.push(new pe.Z({name:"Raster.ServicePixelValue."+e.name,alias:e.name,domain:null,editable:!1,length:50,type:"string"}))})),this._isVectorDataSet()&&(s.push(new pe.Z({name:"Raster.Magnitude",alias:"Magnitude",domain:null,editable:!1,type:"double"})),s.push(new pe.Z({name:"Raster.Direction",alias:"Direction",domain:null,editable:!1,type:"double"})));const{attributeTable:n}=this.rasterInfo,o=(0,a.pC)(n)?n.fields:null;if(o.length){const t=o.filter((e=>"esriFieldTypeOID"!==e.type&&"value"!==e.name.toLowerCase())).map((t=>{const i=(0,v.d9)(t);return i.name=e+t.name,i}));s=s.concat(t)}return s}set renderingRule(e){let t=e;t&&t.rasterFunction&&(t=J.fromJSON({...t.toJSON(),rasterFunction:t.rasterFunction,rasterFunctionArguments:t.rasterFunctionArguments})),this._set("renderingRule",t)}readRenderingRule(e,t){const i=t.rasterFunctionInfos;return t.renderingRule||i&&i.length&&"None"!==i[0].name?this._isRFTJson(t.renderingRule)?J.fromJSON({rasterFunctionDefinition:t.renderingRule}):J.fromJSON(t.renderingRule||{rasterFunctionInfos:t.rasterFunctionInfos}):null}writeRenderingRule(e,t,i){const r=e.toJSON();r.rasterFunctionDefinition?t[i]=r.rasterFunctionDefinition:t[i]=r}readSpatialReference(e,t){const i=e||t.extent.spatialReference;return i?_e.Z.fromJSON(i):null}readPixelType(e){return mt.fromJSON(e)||e}writePixelType(e,t,i){((0,a.Wi)(this.serviceRasterInfo)||this.pixelType!==this.serviceRasterInfo.pixelType)&&(t[i]=mt.toJSON(e))}readVersion(e,t){let i=t.currentVersion;return i||(i=t.hasOwnProperty("fields")||t.hasOwnProperty("timeInfo")?10:9.3),i}applyFilter(e){let t=e;return this.pixelFilter&&(t=this._clonePixelData(e),this.pixelFilter(t)),t}async applyRenderer(e,t){let i=e;if(!this._isPicture()&&this.renderer&&this.symbolizer&&!this.pixelFilter){const r=JSON.stringify(this._cachedRendererJson)!==JSON.stringify(this.renderer.toJSON()),s=this._rasterJobHandler.instance,{bandIds:n}=this;if(s){r&&(this.symbolizer.bind(),await s.updateSymbolizer(this.symbolizer,t),this._cachedRendererJson=this.renderer.toJSON());const a=await s.symbolize({bandIds:n,...e},t);i={extent:e.extent,pixelBlock:a}}else i={extent:e.extent,pixelBlock:this.symbolizer.symbolize({bandIds:n,...e})}}return i}destroy(){this._shutdownJobHandler()}increaseRasterJobHandlerUsage(){this._rasterJobHandler.refCount++}decreaseRasterJobHandlerUsage(){this._rasterJobHandler.refCount--,this._rasterJobHandler.refCount<=0&&this._shutdownJobHandler()}async computeAngles(e,t){if(await this._fetchCapabilities(t?.signal),!this.capabilities.operations.supportsComputeAngles)throw new b.Z("imagery-layer:compute-angles","this operation is not supported on the input image service");return e=(0,p.TJ)($e,e).clone(),async function(e,t,i){const r=t.toJSON();(0,a.pC)(r.angleName)&&(r.angleName=r.angleName.join(",")),(0,a.pC)(t.point)&&t.point.spatialReference?.imageCoordinateSystem&&(r.point.spatialReference=Je(t.point.spatialReference)),(0,a.pC)(t.spatialReference)&&t.spatialReference.imageCoordinateSystem&&(r.spatialReference=Ee(t.spatialReference));const s=(0,we.en)(e),n=(0,we.cv)({...s.query,f:"json",...r}),o=(0,we.lA)(n,i),{data:l}=await(0,g.default)(`${s.path}/computeAngles`,o);return l.spatialReference=l.spatialReference?null!=l.spatialReference.geodataXform?new _e.Z({wkid:0,imageCoordinateSystem:l.spatialReference}):_e.Z.fromJSON(l.spatialReference):null,"NaN"===l.north&&(l.north=null),"NaN"===l.up&&(l.up=null),new Se(l)}(this.url,e,this._getRequestOptions(t))}async computePixelSpaceLocations(e,t){if(await this._fetchCapabilities(t?.signal),!this.capabilities.operations.supportsComputePixelLocation)throw new b.Z("imagery-layer:compute-pixel-space-locations","this operation is not supported on the input image service");return e=(0,p.TJ)(ot,e).clone(),async function(e,t,i){const r=t.toJSON(),{geometries:s}=t;for(let e=0;e<s.length;e++)s[e].spatialReference?.imageCoordinateSystem&&(r.geometries.geometries[e].spatialReference=Je(s[e].spatialReference));const n=(0,we.en)(e),a=(0,we.cv)({...n.query,f:"json",...r}),o=(0,we.lA)(a,i),{data:l}=await(0,g.default)(`${n.path}/computePixelLocation`,o);return Ne.fromJSON(l)}(this.url,e,this._getRequestOptions(t))}async computeHistograms(e,t){if(await this._fetchCapabilities(t?.signal),!this.capabilities.operations.supportsComputeHistograms)throw new b.Z("imagery-layer:compute-histograms","this operation is not supported on the input image service");e=(0,p.TJ)(tt,e).clone();const{raster:i,mosaicRule:r,renderingRule:s}=this;return s&&null==e.renderingRule&&(e.renderingRule=s),r&&null==e.mosaicRule&&(e.mosaicRule=r),i&&null==e.raster&&(e.raster=i),async function(e,t,i){const r=await Me(e,t,i),s=(0,we.en)(e),{data:n}=await(0,g.default)(`${s.path}/computeHistograms`,r);return{histograms:n.histograms}}(this.url,e,this._getRequestOptions(t))}async computeStatisticsHistograms(e,t){if(await this._fetchCapabilities(t?.signal),!this.capabilities.operations.supportsComputeStatisticsHistograms)throw new b.Z("imagery-layer:compute-statistics-histograms","this operation is not supported on the input image service");e=(0,p.TJ)(tt,e).clone();const{raster:i,mosaicRule:r,renderingRule:s}=this;return s&&null==e.renderingRule&&(e.renderingRule=s),r&&null==e.mosaicRule&&(e.mosaicRule=r),i&&null==e.raster&&(e.raster=i),async function(e,t,i){const r=await Me(e,t,i),s=(0,we.en)(e),{data:n}=await(0,g.default)(`${s.path}/computeStatisticsHistograms`,r),{statistics:a}=n;return a?.length&&a.forEach((e=>{e.avg=e.mean,e.stddev=e.standardDeviation})),{statistics:a,histograms:n.histograms}}(this.url,e,this._getRequestOptions(t))}getField(e){const{fieldsIndex:t}=this;return(0,a.pC)(t)?t.get(e):void 0}getFieldDomain(e,t){const i=this.getField(e);return i?i.domain:null}fetchImage(e,t,i,r={}){if(null==e||null==t||null==i)return Promise.reject(new b.Z("imagery-layer:fetch-image","Insufficient parameters for requesting an image. A valid extent, width and height values are required."));const s=this.renderer||this.symbolizer?this.generateRasterInfo(this.renderingRule,{signal:r.signal}):null;return(0,l.gx)(s).then((s=>{s&&(this.rasterInfo=s);const n={imageServiceParameters:this.getExportImageServiceParameters(e,t,i,r.timeExtent),imageProps:{extent:e,width:t,height:i,format:this.format},requestAsImageElement:r.requestAsImageElement&&!this.pixelFilter||!1,signal:r.signal};return this._requestArrayBuffer(n)}))}fetchKeyProperties(e){return(0,g.default)(this.parsedUrl.path+"/keyProperties",{query:this._getQueryParams({renderingRule:this.version>=10.3?e?.renderingRule:null})}).then((e=>e.data))}fetchRasterAttributeTable(e){return this.version<10.1?Promise.reject(new b.Z("#fetchRasterAttributeTable()","Failed to get rasterAttributeTable")):(0,g.default)(this.parsedUrl.path+"/rasterAttributeTable",{query:this._getQueryParams({renderingRule:this.version>=10.3?e?.renderingRule:null})}).then((e=>Ie.default.fromJSON(e.data)))}getCatalogItemRasterInfo(e,t){const i={...t,query:this._getQueryParams()};return async function(e,t,i){const r=(0,we.en)(e),s=(0,we.cv)({...r.query,f:"json"}),n=(0,we.lA)(s,i),a=`${r.path}/${t}/info`,o=(0,g.default)(`${a}`,n),l=(0,g.default)(`${a}/keyProperties`,n),u=await Promise.allSettled([o,l]),p="fulfilled"===u[0].status?u[0].value.data:null,c="fulfilled"===u[1].status?u[1].value.data:null;let m=null;p.statistics?.length&&(m=p.statistics.map((e=>({min:e[0],max:e[1],avg:e[2],stddev:e[3]}))));const d=Le.Z.fromJSON(p.extent),h=Math.ceil(d.width/p.pixelSizeX-.1),y=Math.ceil(d.height/p.pixelSizeY-.1),f=d.spatialReference,b=new re.Z({x:p.pixelSizeX,y:p.pixelSizeY,spatialReference:f}),R=p.histograms?.length?p.histograms:null,v=new Be.Z({origin:p.origin,blockWidth:p.blockWidth,blockHeight:p.blockHeight,firstPyramidLevel:p.firstPyramidLevel,maximumPyramidLevel:p.maxPyramidLevel});return new de.Z({width:h,height:y,bandCount:p.bandCount,extent:d,spatialReference:f,pixelSize:b,pixelType:p.pixelType.toLowerCase(),statistics:m,histograms:R,keyProperties:c,storageInfo:v})}(this.parsedUrl.path,e,i)}async getCatalogItemICSInfo(e,t){const{data:i}=await(0,g.default)(this.parsedUrl.path+"/"+e+"/info/ics",{query:this._getQueryParams(),...t}),r=i&&i.ics;if(!r)return;let s=null;try{s=(await(0,g.default)(this.parsedUrl.path+"/"+e+"/info",{query:this._getQueryParams(),...t})).data.extent}catch{}if(!s||!s.spatialReference)return{ics:r,icsToPixelTransform:null,icsExtent:null,northDirection:null};const n=this.version>=10.7?(0,g.default)(this.parsedUrl.path+"/"+e+"/info/icstopixel",{query:this._getQueryParams(),...t}).then((e=>e.data)).catch((()=>({}))):{},a=s.spatialReference,o={geometries:JSON.stringify({geometryType:"esriGeometryEnvelope",geometries:[s]}),inSR:a.wkid||JSON.stringify(a),outSR:"0:"+e},l=(0,g.default)(this.parsedUrl.path+"/project",{query:this._getQueryParams(o),...t}).then((e=>e.data)).catch((()=>({}))),u=(s.xmin+s.xmax)/2,p=(s.ymax-s.ymin)/6,c=s.ymin+p,m=[];for(let e=0;e<5;e++)m.push({x:u,y:c+p*e});const d={geometries:JSON.stringify({geometryType:"esriGeometryPoint",geometries:m}),inSR:a.wkid||JSON.stringify(a),outSR:"0:"+e},h=(0,g.default)(this.parsedUrl.path+"/project",{query:this._getQueryParams(d),...t}).then((e=>e.data)).catch((()=>({}))),y=await Promise.all([n,l,h]);let f=y[0].ipxf;if(null==f){const e=r.geodataXform?.xf_0;"topup"===e?.name?.toLowerCase()&&6===e?.coefficients?.length&&(f={affine:{name:"ics [sensor: Frame] to pixel (column, row) transformation",coefficients:e.coefficients,cellsizeRatio:0,type:"GeometricXform"}})}const b=Le.Z.fromJSON(y[1]&&y[1].geometries&&y[1].geometries[0]);b&&(b.spatialReference=new _e.Z({wkid:0,imageCoordinateSystem:r}));const R=y[2].geometries?y[2].geometries.filter((e=>null!=e&&null!=e.x&&null!=e.y&&"NaN"!==e.x&&"NaN"!==e.y)):[],v=R.length;if(v<3)return{ics:r,icsToPixelTransform:f,icsExtent:b,northDirection:null};let w=0,_=0,C=0,S=0;for(let e=0;e<v;e++)w+=R[e].x,_+=R[e].y,C+=R[e].x*R[e].x,S+=R[e].x*R[e].y;const I=(v*S-w*_)/(v*C-w*w);let x=0;const F=R[4].x>R[0].x,T=R[4].y>R[0].y;return I===1/0?x=T?90:270:0===I?x=F?0:180:I>0?x=F?180*Math.atan(I)/Math.PI:180*Math.atan(I)/Math.PI+180:I<0&&(x=T?180+180*Math.atan(I)/Math.PI:360+180*Math.atan(I)/Math.PI),{ics:r,icsToPixelTransform:f,icsExtent:b,northDirection:x}}async generateRasterInfo(e,t){if((!e||"none"===e?.functionName?.toLowerCase()||this._isVectorFieldResampleFunction(e))&&(0,a.pC)(this.serviceRasterInfo))return this.serviceRasterInfo;const i=function(e){if(!e)return null;const t=JSON.stringify(e).match(/"rasterFunction":"(.*?")/gi)?.map((e=>e.replace('"rasterFunction":"',"").replace('"',"")));return t?t.join("/"):null}(e);if(this._functionRasterInfos[i])return this._functionRasterInfos[i];const r=this._generateRasterInfo(e,t);this._functionRasterInfos[i]=r;try{return await r}catch{return this._functionRasterInfos[i]=null,null}}getExportImageServiceParameters(e,t,i,r){const s=Ee((e=e.clone().shiftCentralMeridian()).spatialReference,this.parsedUrl.path);(0,a.pC)(this.serviceRasterInfo)&&this.pixelType!==this.serviceRasterInfo.pixelType&&(this.exportImageServiceParameters.pixelType=this.pixelType);const n=this.exportImageServiceParameters.toJSON(),{bandIds:o,noData:l}=n;let{renderingRule:u}=n;const p=this.renderingRule?.rasterFunctionDefinition,c=!this.renderer||"raster-stretch"===this.renderer.type;if(o?.length&&this._hasRenderingRule(this.renderingRule)&&!p&&c){const e={rasterFunction:"ExtractBand",rasterFunctionArguments:{BandIds:o}};if("Stretch"===u.rasterFunction)e.rasterFunctionArguments.Raster=u.rasterFunctionArguments.Raster,u.rasterFunctionArguments.Raster=e;else if("Colormap"===u.rasterFunction){const t=u.rasterFunctionArguments.Raster;"Stretch"===t?.rasterFunction?(e.rasterFunctionArguments.Raster=t.rasterFunctionArguments.Raster,t.rasterFunctionArguments.Raster=e):(e.rasterFunctionArguments.Raster=t,u.rasterFunctionArguments.Raster=e)}else e.rasterFunctionArguments.Raster=u,u=e;n.bandIds=void 0}else n.bandIds=o?.join(",");l instanceof Array&&l.length>0&&(n.noData=l.join(","));const m=this._serviceSupportsMosaicRule?this._combineMosaicRuleWithTimeExtent(this.exportImageServiceParameters.mosaicRule,r):null;n.mosaicRule=m&&JSON.stringify(m),n.renderingRule=this._getRenderingRuleString(J.fromJSON(u));const d={};if(r){const{start:e,end:t}=r.toJSON();e&&t&&e===t?d.time=""+e:null==e&&null==t||(d.time=`${e??"null"},${t??"null"}`)}return{bbox:e.xmin+","+e.ymin+","+e.xmax+","+e.ymax,bboxSR:s,imageSR:s,size:t+","+i,...n,...d}}async getSamples(e,t){if(await this._fetchCapabilities(t?.signal),!this.capabilities.operations.supportsGetSamples)throw new b.Z("imagery-layer:get-samples","getSamples operation is not supported on the input image service");e=(0,p.TJ)(pt,e).clone();const{raster:i}=this;return i&&null==e.raster&&(e.raster=i),async function(e,t,i){const r=t.toJSON();Ve(r),r.outFields?.length&&(r.outFields=r.outFields.join(","));const s=(await(0,ve.aX)(t.geometry))?.[0];(0,a.pC)(s)&&(r.geometry=s.toJSON());const n=(0,we.en)(e),o=(0,we.cv)({...n.query,f:"json",...r}),l=(0,we.lA)(o,i),{data:u}=await(0,g.default)(`${n.path}/getSamples`,l),p=u?.samples?.map((e=>{const t="NaN"===e.value||""===e.value?null:e.value.split(" ").map((e=>Number(e)));return{...e,pixelValue:t}}));return je.fromJSON({samples:p})}(this.url,e,this._getRequestOptions(t))}async identify(e,t){if(await this._fetchCapabilities(t?.signal),!this.capabilities.operations.supportsIdentify)throw new b.Z("imagery-layer:query-rasters","query operation is not supported on the input image service");e=(0,p.TJ)(st,e).clone();const{raster:i,mosaicRule:r,renderingRule:s}=this;if(s&&null==e.renderingRule&&(e.renderingRule=s),r&&null==e.mosaicRule){const t=this._combineMosaicRuleWithTimeExtent(r,e.timeExtent);e.mosaicRule=(0,a.Wg)(t)}return i&&null==e.raster&&(e.raster=i),Ae(this.url,e,this._getRequestOptions(t))}createQuery(){const e=new Ue.Z;return e.outFields=["*"],e.returnGeometry=!0,e.where=this.definitionExpression||"1=1",e}async queryRasters(e,t){return({query:e,requestOptions:t}=await this._prepareForQuery(e,t)),(0,ze.e)(this.url,e,t)}async queryObjectIds(e,t){return({query:e,requestOptions:t}=await this._prepareForQuery(e,t)),(0,Qe.G)(this.url,e,t)}async queryRasterCount(e,t){return({query:e,requestOptions:t}=await this._prepareForQuery(e,t)),(0,He.P)(this.url,e,t)}async queryVisibleRasters(e,t){if(!e)throw new b.Z("imagery-layer: query-visible-rasters","missing query parameter");const{pixelSize:i,returnDomainValues:r,returnTopmostRaster:s,showNoDataRecords:n}=t||{pixelSize:null,returnDomainValues:!1,returnTopmostRaster:!1,showNoDataRecords:!1};let o=!1,l=null,u=null;const p="raster.servicepixelvalue",c=this._rasterFunctionNamesIndex;if((0,a.pC)(e.outFields)&&(o=e.outFields.some((e=>!e.toLowerCase().includes(p))),this.version>=10.4)){const t=e.outFields.filter((e=>e.toLowerCase().includes(p)&&e.length>p.length)).map((e=>{const t=e.slice(p.length+1);return[this._updateRenderingRulesFunctionName(t,c),t]}));l=t.map((e=>new J({functionName:e[0]}))),u=t.map((e=>e[1])),0===l.length?this.renderingRule?(l.push(this.renderingRule),u.push(this.renderingRule.functionName)):l=null:this.renderingRule&&!l.some((e=>e.functionName===this.renderingRule.functionName))&&(l.push(this.renderingRule),u.push(this.renderingRule.functionName))}const m=(0,a.Wi)(e.outSpatialReference)||e.outSpatialReference.equals(this.spatialReference),d=e.timeExtent||this.timeExtent,h=this._combineMosaicRuleWithTimeExtent(this.exportImageServiceParameters.mosaicRule,d),y=this._getQueryParams({geometry:e.geometry,timeExtent:d,mosaicRule:h,renderingRule:this.version<10.4?this.renderingRule:null,renderingRules:l,pixelSize:i,returnCatalogItems:o,returnGeometry:m,raster:this.raster,maxItemCount:s?1:null});delete y.f;const f=new st(y);try{await this.generateRasterInfo(this.renderingRule);const i=await Ae(this.url,f,{signal:t?.signal,query:{...this.customParameters}}),s=e.outFields,l=i.value.toLowerCase().includes("nodata");if(!o||m||!i?.catalogItems?.features.length||!n&&l)return this._processVisibleRastersResponse(i,{returnDomainValues:r,templateRRFunctionNames:u,showNoDataRecords:n,templateFields:s});const p=this.objectIdField||"ObjectId",c=i.catalogItems.features,d=c.map((e=>e.attributes?.[p])),h=new Ue.Z({objectIds:d,returnGeometry:!0,outSpatialReference:e.outSpatialReference,outFields:[p]}),y=await this.queryRasters(h);return y?.features?.length&&y.features.forEach((t=>{c.forEach((i=>{i.attributes[p]===t.attributes[p]&&(i.geometry=new ke.Z(t.geometry),(0,a.pC)(e.outSpatialReference)&&(i.geometry.spatialReference=e.outSpatialReference))}))})),this._processVisibleRastersResponse(i,{returnDomainValues:r,templateRRFunctionNames:u,showNoDataRecords:n,templateFields:s})}catch{throw new b.Z("imagery-layer:query-visible-rasters","encountered error when querying visible rasters")}}async fetchVariableStatisticsHistograms(e,t){const i=(0,g.default)(this.parsedUrl.path+"/statistics",{query:this._getQueryParams({variable:e}),signal:t}).then((e=>e.data?.statistics)),r=(0,g.default)(this.parsedUrl.path+"/histograms",{query:this._getQueryParams({variable:e}),signal:t}).then((e=>e.data?.histograms)),s=await Promise.all([i,r]);return s[0]&&s[0].forEach((e=>{e.avg=e.mean,e.stddev=e.standardDeviation})),{statistics:s[0]||null,histograms:s[1]||null}}async createFlowMesh(e,t){const i=this._rasterJobHandler.instance;return i?i.createFlowMesh(e,t):(0,ct.GE)(e.meshType,e.simulationSettings,e.flowData,(0,a.pC)(t.signal)?t.signal:(new AbortController).signal)}async _fetchService(e){await this._fetchServiceInfo(e),(0,a.pC)(this.serviceRasterInfo)&&!this.rasterInfo&&(this.rasterInfo=this.serviceRasterInfo);const t=this.sourceJSON,i=(0,a.pC)(this.serviceRasterInfo)?Promise.resolve(this.serviceRasterInfo):(0,Ge.g)(this.parsedUrl.path,t,{signal:e,query:this._getQueryParams()}).then((e=>(this._set("serviceRasterInfo",e),e))),r=this._hasRenderingRule(this.renderingRule)?this.generateRasterInfo(this.renderingRule,{signal:e}):null,s=this._getRasterFunctionInfos();return Promise.all([i,r,s]).then((e=>{e[1]?this._set("rasterInfo",e[1]):this._set("rasterInfo",e[0]),e[2]&&this._set("rasterFunctionInfos",e[2]),this.renderer&&!this._isSupportedRenderer(this.renderer)&&(this._set("renderer",null),w.Z.getLogger(this.declaredClass).warn("ArcGISImageService","Switching to the default renderer. Renderer applied is not valid for this Imagery Layer")),this._set("renderer",this._configRenderer(this.renderer)),this.addHandles((0,_.YP)((()=>this.renderingRule),(e=>{(this.renderer||this.symbolizer||this.popupEnabled&&this.popupTemplate)&&this.generateRasterInfo(e).then((e=>{e&&(this.rasterInfo=e)}))})));const{serviceRasterInfo:t}=this;(0,a.pC)(t)&&t.multidimensionalInfo&&this._updateMultidimensionalDefinition(t)}))}_combineMosaicRuleWithTimeExtent(e,t){const i=this.timeInfo;if((0,a.Wi)(e)||(0,a.Wi)(this.multidimensionalInfo)||(0,a.Wi)(t)||(0,a.Wi)(i?.startField))return e;const{startField:r}=i,s=this.multidimensionalInfo.variables.some((e=>e.dimensions.some((e=>e.name===r))))?r:"StdTime";if(e=e.clone(),"mosaic-dataset"===this._serviceSourceType)return e.multidimensionalDefinition=e.multidimensionalDefinition?.filter((e=>e.dimensionName!==s)),this._cleanupMultidimensionalDefinition(e);e.multidimensionalDefinition=e.multidimensionalDefinition||[];const n=e.multidimensionalDefinition.filter((e=>e.dimensionName===s)),o=(0,a.pC)(t.start)?t.start.getTime():null,l=(0,a.pC)(t.end)?t.end.getTime():null,u=null==o||null==l||o===l,p=u?[o||l]:[[o,l]],c=this.version>=10.8;if(n.length)n.forEach((e=>{e.dimensionName===s&&(c?(e.dimensionName=null,e.isSlice=null,e.values=null):(e.isSlice=u,e.values=p))}));else if(!c){const t=e.multidimensionalDefinition.filter((e=>null!=e.variableName&&null==e.dimensionName));t.length?t.forEach((e=>{e.dimensionName=s,e.isSlice=u,e.values=p})):e.multidimensionalDefinition.push(new x.Z({variableName:"",dimensionName:s,isSlice:u,values:p}))}return this._cleanupMultidimensionalDefinition(e)}_cleanupMultidimensionalDefinition(e){return(0,a.Wi)(e)?null:(e.multidimensionalDefinition&&(e.multidimensionalDefinition=e.multidimensionalDefinition.filter((e=>!(!e.variableName&&!e.dimensionName))),0===e.multidimensionalDefinition.length&&(e.multidimensionalDefinition=null)),"mosaic-dataset"!==this._serviceSourceType&&null==e.multidimensionalDefinition?null:e)}async _prepareForQuery(e,t){if(await this._fetchCapabilities(t?.signal),!this.capabilities.operations.supportsQuery)throw new b.Z("imagery-layer:query-rasters","query operation is not supported on the input image service");return e=(0,a.pC)(e)?(0,p.TJ)(Ue.Z,e):this.createQuery(),t=this._getRequestOptions(t),this.raster&&(t.query={...t.query,raster:this.raster}),{query:e,requestOptions:t}}async _initJobHandler(){if(null!=this._rasterJobHandler.connectionPromise)return this._rasterJobHandler.connectionPromise;const e=new he.Z;this._rasterJobHandler.connectionPromise=e.initialize().then((()=>{this._rasterJobHandler.instance=e}),(()=>null)),await this._rasterJobHandler.connectionPromise}_shutdownJobHandler(){this._rasterJobHandler.instance&&this._rasterJobHandler.instance.destroy(),this._rasterJobHandler.instance=null,this._rasterJobHandler.connectionPromise=null,this._rasterJobHandler.refCount=0,this._cachedRendererJson=null}_isSupportedRenderer(e){const{rasterInfo:t,renderingRule:i}=this;return"unique-value"===e.type&&this._hasRenderingRule(i)&&1===t.bandCount&&["u8","s8"].includes(t.pixelType)||(0,be.U0)(this.rasterInfo).includes(this.renderer.type)}async _fetchCapabilities(e){return this.capabilities||await this._fetchServiceInfo(e),this.capabilities}async _fetchServiceInfo(e){let t=this.sourceJSON;if(!t){const{data:i,ssl:r}=await(0,g.default)(this.parsedUrl.path,{query:this._getQueryParams(),signal:e});t=i,this.sourceJSON=t,r&&(this.url=this.url.replace(/^http:/i,"https:"))}if(t.capabilities?.toLowerCase().split(",").map((e=>e.trim())).indexOf("tilesonly")>-1)throw new b.Z("imagery-layer:fetch-service-info","use ImageryTileLayer to open tiles-only image services");this.read(t,{origin:"service",url:this.parsedUrl})}_isMosaicDataset(e){return e.serviceSourceType?"esriImageServiceSourceTypeMosaicDataset"===e.serviceSourceType:e.fields?.length>0}_isMosaicRuleSupported(e){if(!e)return!1;const t=this._isMosaicDataset(e),i=e.currentVersion>=10.71&&e.hasMultidimensions&&e.timeInfo&&!(e.objectIdField&&e.fields?.length>1);return t||i}_isVectorFieldResampleFunction(e){if((0,a.Wi)(e))return!1;const{functionName:t,functionArguments:i}=e,r="resample"===t?.toLowerCase(),s=i?.ResampleType||i?.resampleType;return r&&(7===s||10===s)}_isPicture(){return!this.format||this.format.includes("jpg")||this.format.includes("png")}_configRenderer(e){if(!this._isPicture()&&!this.pixelFilter||this._isVectorDataSet()){if(!this.bandIds&&this.rasterInfo.bandCount>=3){const e=(0,be.YD)(this.rasterInfo);!e||3===this.rasterInfo.bandCount&&0===e[0]&&1===e[1]&&2===e[2]||(this.bandIds=e)}e||(e=(0,be.Ob)(this.rasterInfo,{bandIds:this.bandIds,variableName:this.renderingRule?null:this.mosaicRule?.multidimensionalDefinition?.[0].variableName}));const t=(0,be.ol)(e.toJSON());this.symbolizer?(this.symbolizer.rendererJSON=t,this.symbolizer.rasterInfo=this.rasterInfo):this.symbolizer=new Re.Z({rendererJSON:t,rasterInfo:this.rasterInfo}),this.symbolizer.bind().success||(this.symbolizer=null)}return e}_clonePixelData(e){return null==e?e:{extent:e.extent&&e.extent.clone(),pixelBlock:(0,a.pC)(e.pixelBlock)&&e.pixelBlock.clone()}}_getQueryParams(e){(0,a.pC)(e?.renderingRule)&&"string"!=typeof e.renderingRule&&(e.renderingRule=this._getRenderingRuleString(e.renderingRule));const{raster:t,viewId:i}=this;return{raster:t,viewId:i,f:"json",...e,...this.customParameters}}_getRequestOptions(e){return{...e,query:{...e?.query,...this.customParameters}}}_decodePixelBlock(e,t,i){return this._rasterJobHandler.instance?this._rasterJobHandler.instance.decode({data:e,options:t}):(0,fe.J)(e,t,i)}async _getRasterFunctionInfos(e){const t=this.sourceJSON.rasterFunctionInfos;return this.serviceRasterInfo?t:t&&this.version>=10.3?1===t.length&&"none"===t[0].name.toLowerCase()?t:(await(0,g.default)(this.parsedUrl.path+"/rasterFunctionInfos",{query:this._getQueryParams(),signal:e})).data?.rasterFunctionInfos:null}async _requestArrayBuffer(e){const{imageProps:t,requestAsImageElement:i,signal:r}=e;if(i&&!this.pixelFilter&&t.format?.indexOf("png")>-1)return{imageElement:(await(0,g.default)(this.parsedUrl.path+"/exportImage",{responseType:"image",query:this._getQueryParams({f:"image",...e.imageServiceParameters}),signal:r})).data,params:t};const s=this._initJobHandler(),n=(0,g.default)(this.parsedUrl.path+"/exportImage",{responseType:"array-buffer",query:this._getQueryParams({f:"image",...e.imageServiceParameters}),signal:r}),a=(await Promise.all([n,s]))[0].data,o=t.format||"jpgpng";let l=o;if("bsq"!==l&&"bip"!==l&&(l=(0,fe.y)(a)),!l)throw new b.Z("imagery-layer:fetch-image","unsupported format signature "+String.fromCharCode.apply(null,new Uint8Array(a)));const u={signal:r},p="gif"===o||"bmp"===o||o.includes("png")&&("png"===l||"jpg"===l)?(0,fe.J)(a,{useCanvas:!0,...t},u):this._decodePixelBlock(a,{width:t.width,height:t.height,planes:null,pixelType:null,noDataValue:null,format:o},u);return{pixelData:{pixelBlock:await p,extent:t.extent},params:t}}_generateRasterInfo(e,t){const i={...t,query:this._getQueryParams()};return(0,Ge.N)(this.parsedUrl.path,e,i)}_isValidCustomizedMosaicRule(e){return e&&JSON.stringify(e.toJSON())!==JSON.stringify(this._defaultServiceMosaicRule?.toJSON())}_updateMultidimensionalDefinition(e){if(this._isValidCustomizedMosaicRule(this.mosaicRule))return;const t=(0,ye.Tj)(e);if((0,a.pC)(t)&&t.length>0){this.mosaicRule=this.mosaicRule||new oe;const e=this.mosaicRule.multidimensionalDefinition;(!e||e&&e.length<=0)&&(this.mosaicRule.multidimensionalDefinition=t)}}_processVisibleRastersResponse(e,t){t=t||{};const i=e.value,{templateRRFunctionNames:r,showNoDataRecords:s,returnDomainValues:n,templateFields:o}=t,l=e.processedValues;let u=e.catalogItems&&e.catalogItems.features,p=e.properties&&e.properties.Values&&e.properties.Values.map((e=>e.replace(/ /gi,", ")))||[];const c=this.objectIdField||"ObjectId",m="string"==typeof i&&i.toLowerCase().includes("nodata"),d=[];if(i&&!u&&!m){const e={};e[c]=0,p=[i],u=[new y.Z(this.fullExtent,null,e)]}if(!u)return[];let h,f,g;this._updateResponseFieldNames(u,o),m&&!s&&(u=[]);for(let e=0;e<u.length;e++){if(h=u[e],null!=i){if(f=p[e],g=this.renderingRule&&l&&l.length>0&&r&&r.length>0&&r.includes(this.renderingRule.functionName)?l[r.indexOf(this.renderingRule.functionName)]:i,"nodata"===f.toLowerCase()&&!s)continue;const t="Raster.ItemPixelValue",n="Raster.ServicePixelValue";h.attributes[t]=f,h.attributes[n]=g,this._updateFeatureWithMagDirValues(h,f);const o=this.fields&&this.fields.length>0;let u=this.renderingRule&&(0,a.pC)(this.serviceRasterInfo)&&this.serviceRasterInfo.attributeTable?o?f:i:g;this.renderingRule||(u=o?f:i),this._updateFeatureWithRasterAttributeTableValues(h,u)}if(h.sourceLayer=h.layer=this,n&&this._updateFeatureWithDomainValues(h),r&&l&&r.length===l.length)for(let e=0;e<r.length;e++){const t="Raster.ServicePixelValue."+r[e];h.attributes[t]=l[e]}d.push(u[e])}return d}_updateFeatureWithRasterAttributeTableValues(e,t){const i=this.rasterInfo&&this.rasterInfo.attributeTable||((0,a.pC)(this.serviceRasterInfo)?this.serviceRasterInfo.attributeTable:null);if((0,a.Wi)(i))return;const{features:r,fields:s}=i,n=s.map((e=>e.name)).filter((e=>"value"===e.toLowerCase())),o=n&&n[0];if(!o)return;const l=r.filter((e=>e.attributes[o]===(null!=t?parseInt(t,10):null)));l&&l[0]&&s.forEach((t=>{const i=this.rasterAttributeTableFieldPrefix+t.name;e.attributes[i]=l[0].attributes[t.name]}))}_updateFeatureWithMagDirValues(e,t){if(!this._isVectorDataSet())return;const i=t.split(/,\s*/).map((e=>parseFloat(e))),r=i.map((e=>[e])),s=i.map((e=>({minValue:e,maxValue:e,noDataValue:null}))),n=new me.Z({height:1,width:1,pixelType:"f32",pixels:r,statistics:s});null!=this.pixelFilter&&this.pixelFilter({pixelBlock:n,extent:new Le.Z(0,0,0,0,this.spatialReference)});const a="esriImageServiceDataTypeVector-MagDir"===this.serviceDataType?[n.pixels[0][0],n.pixels[1][0]]:(0,ge.Tg)([n.pixels[0][0],n.pixels[1][0]]);e.attributes["Raster.Magnitude"]=a[0],e.attributes["Raster.Direction"]=a[1]}_updateFeatureWithDomainValues(e){const t=this.fields&&this.fields.filter((e=>e.domain&&"coded-value"===e.domain.type));null!=t&&t.forEach((t=>{const i=e.attributes[t.name];if(null!=i){const r=t.domain.codedValues.find((e=>e.code===i));r&&(e.attributes[t.name]=r.name)}}))}_updateResponseFieldNames(e,t){if(!t||t.length<1)return;const i=this.fieldsIndex;(0,a.Wi)(i)||e.forEach((e=>{if(e&&e.attributes)for(const r of t)if(i.has(r)){const t=i.get(r).name;t!==r&&(e.attributes[r]=e.attributes[t],delete e.attributes[t])}}))}_getRenderingRuleString(e){if(this._hasRenderingRule(e)){let t=e.toJSON();return t=t.rasterFunctionDefinition??t,(t.thumbnail||t.thumbnailEx)&&(t.thumbnail=t.thumbnailEx=null),JSON.stringify(t)}return null}_hasRenderingRule(e){return e&&e.functionName&&"none"!==e.functionName.toLowerCase()}_updateRenderingRulesFunctionName(e,t){if(!e||e.length<1)return;if("Raw"===e)return e.replace("Raw","None");const i=e.toLowerCase().replace(/ /gi,"_");return t.has(i)?t.get(i):e}_isRFTJson(e){return e&&e.name&&e.arguments&&e.function&&e.hasOwnProperty("functionType")}_isVectorDataSet(){return"esriImageServiceDataTypeVector-UV"===this.serviceDataType||"esriImageServiceDataTypeVector-MagDir"===this.serviceDataType}_readCapabilities(e){const t=e.capabilities?e.capabilities.toLowerCase().split(",").map((e=>e.trim())):["image","catalog"],{currentVersion:i,advancedQueryCapabilities:r,maxRecordCount:s}=e,n=t.includes("image"),a="esriImageServiceDataTypeElevation"===e.serviceDataType,o=!!(e.spatialReference||e.extent&&e.extent.spatialReference),l=t.includes("edit");return{data:{supportsAttachment:!1},operations:{supportsComputeHistograms:n,supportsExportImage:n,supportsIdentify:n,supportsMeasure:t.includes("mensuration")&&o,supportsDownload:t.includes("download"),supportsQuery:t.includes("catalog")&&e.fields&&e.fields.length>0,supportsGetSamples:i>=10.2&&n,supportsProject:i>=10.3&&n,supportsComputeStatisticsHistograms:i>=10.4&&n,supportsQueryBoundary:i>=10.6&&n,supportsCalculateVolume:i>=10.7&&a,supportsComputePixelLocation:i>=10.7&&t.includes("catalog"),supportsComputeAngles:i>=10.91,supportsAdd:l,supportsDelete:l,supportsEditing:l,supportsUpdate:l,supportsCalculate:!1,supportsTruncate:!1,supportsValidateSql:!1,supportsChangeTracking:!1,supportsQueryAttachments:!1,supportsResizeAttachments:!1,supportsSync:!1,supportsExceedsLimitStatistics:!1,supportsQueryAnalytics:!1,supportsQueryTopFeatures:!1},query:{maxRecordCount:s,maxRecordCountFactor:void 0,supportsStatistics:!!r?.supportsStatistics,supportsOrderBy:!!r?.supportsOrderBy,supportsDistinct:!!r?.supportsDistinct,supportsPagination:!!r?.supportsPagination,supportsStandardizedQueriesOnly:!!r?.useStandardizedQueries,supportsPercentileStatistics:!!r?.supportsPercentileStatistics,supportsCentroid:!!r?.supportsReturningGeometryCentroid,supportsDistance:!!r?.supportsQueryWithDistance,supportsExtent:!!r?.supportsReturningQueryExtent,supportsGeometryProperties:!!r?.supportsReturningGeometryProperties,supportsHavingClause:!!r?.supportsHavingClause,supportsQuantization:!1,supportsQuantizationEditMode:!1,supportsQueryGeometry:!1,supportsResultType:!1,supportsMaxRecordCountFactor:!1,supportsSqlExpression:!1,supportsTopFeaturesQuery:!1,supportsQueryByOthers:!1,supportsHistoricMoment:!1,supportsFormatPBF:!1,supportsDisjointSpatialRelationship:!1,supportsCacheHint:!1,supportsSpatialAggregationStatistics:!1,supportedSpatialAggregationStatistics:{envelope:!1,centroid:!1,convexHull:!1},supportsDefaultSpatialReference:!!r?.supportsDefaultSR,supportsCompactGeometry:!1,standardMaxRecordCount:void 0,tileMaxRecordCount:void 0}}}};return(0,s._)([(0,u.Cb)()],t.prototype,"_functionRasterInfos",void 0),(0,s._)([(0,u.Cb)()],t.prototype,"_rasterJobHandler",void 0),(0,s._)([(0,u.Cb)({dependsOn:["_serviceSupportsMosaicRule"]})],t.prototype,"_defaultServiceMosaicRule",void 0),(0,s._)([(0,S.r)("_defaultServiceMosaicRule",["defaultMosaicMethod"])],t.prototype,"readDefaultServiceMosaicRule",null),(0,s._)([(0,u.Cb)()],t.prototype,"_cachedRendererJson",void 0),(0,s._)([(0,u.Cb)({readOnly:!0})],t.prototype,"_serviceSourceType",void 0),(0,s._)([(0,S.r)("_serviceSourceType",["serviceSourceType","fields"])],t.prototype,"readServiceSourceType",null),(0,s._)([(0,u.Cb)({readOnly:!0})],t.prototype,"_serviceSupportsMosaicRule",void 0),(0,s._)([(0,S.r)("_serviceSupportsMosaicRule",["currentVersion","fields"])],t.prototype,"readServiceSupportsMosaicRule",null),(0,s._)([(0,u.Cb)()],t.prototype,"rasterAttributeTableFieldPrefix",void 0),(0,s._)([(0,u.Cb)({readOnly:!0})],t.prototype,"_rasterFunctionNamesIndex",null),(0,s._)([(0,u.Cb)()],t.prototype,"adjustAspectRatio",void 0),(0,s._)([(0,u.Cb)({type:[p.z8],json:{write:!0}})],t.prototype,"bandIds",void 0),(0,s._)([(0,S.r)("bandIds")],t.prototype,"readBandIds",null),(0,s._)([(0,u.Cb)({readOnly:!0,json:{read:!1}})],t.prototype,"capabilities",void 0),(0,s._)([(0,S.r)("service","capabilities",["capabilities","currentVersion","serviceDataType"])],t.prototype,"readCapabilities",null),(0,s._)([(0,u.Cb)({type:Number})],t.prototype,"compressionQuality",void 0),(0,s._)([(0,m.c)("compressionQuality")],t.prototype,"writeCompressionQuality",null),(0,s._)([(0,u.Cb)({type:Number})],t.prototype,"compressionTolerance",void 0),(0,s._)([(0,m.c)("compressionTolerance")],t.prototype,"writeCompressionTolerance",null),(0,s._)([(0,u.Cb)({json:{read:{source:"copyrightText"}}})],t.prototype,"copyright",void 0),(0,s._)([(0,u.Cb)({type:String,json:{name:"layerDefinition.definitionExpression",write:{enabled:!0,allowNull:!0}}})],t.prototype,"definitionExpression",void 0),(0,s._)([(0,u.Cb)({readOnly:!0,constructOnly:!0})],t.prototype,"exportImageServiceParameters",void 0),(0,s._)([(0,u.Cb)()],t.prototype,"rasterInfo",void 0),(0,s._)([(0,u.Cb)({readOnly:!0,type:[pe.Z]})],t.prototype,"fields",void 0),(0,s._)([(0,u.Cb)({readOnly:!0})],t.prototype,"fieldsIndex",null),(0,s._)([(0,u.Cb)({type:["png","png8","png24","png32","jpg","bmp","gif","jpgpng","lerc","tiff"],json:{write:!0}})],t.prototype,"format",null),(0,s._)([(0,S.r)("service","format",["serviceDataType"])],t.prototype,"readFormat",null),(0,s._)([(0,u.Cb)({type:Le.Z})],t.prototype,"fullExtent",void 0),(0,s._)([(0,u.Cb)({readOnly:!0})],t.prototype,"hasMultidimensions",void 0),(0,s._)([(0,u.Cb)({json:{read:{source:"maxImageHeight"}}})],t.prototype,"imageMaxHeight",void 0),(0,s._)([(0,u.Cb)({json:{read:{source:"maxImageWidth"}}})],t.prototype,"imageMaxWidth",void 0),(0,s._)([(0,u.Cb)({type:String,json:{type:le.c.jsonValues,read:le.c.read,write:le.c.write}})],t.prototype,"interpolation",void 0),(0,s._)([(0,u.Cb)()],t.prototype,"minScale",void 0),(0,s._)([(0,S.r)("service","minScale")],t.prototype,"readMinScale",null),(0,s._)([(0,u.Cb)()],t.prototype,"maxScale",void 0),(0,s._)([(0,S.r)("service","maxScale")],t.prototype,"readMaxScale",null),(0,s._)([(0,u.Cb)({type:oe})],t.prototype,"mosaicRule",null),(0,s._)([(0,S.r)("mosaicRule",["mosaicRule","defaultMosaicMethod"])],t.prototype,"readMosaicRule",null),(0,s._)([(0,m.c)("mosaicRule")],t.prototype,"writeMosaicRule",null),(0,s._)([(0,u.Cb)()],t.prototype,"multidimensionalInfo",null),(0,s._)([(0,u.Cb)({json:{type:p.z8}})],t.prototype,"noData",void 0),(0,s._)([(0,m.c)("noData")],t.prototype,"writeNoData",null),(0,s._)([(0,u.Cb)({type:String,json:{type:le.k.jsonValues,read:le.k.read,write:le.k.write}})],t.prototype,"noDataInterpretation",void 0),(0,s._)([(0,u.Cb)({type:String,readOnly:!0,json:{read:{source:["fields"]}}})],t.prototype,"objectIdField",void 0),(0,s._)([(0,S.r)("objectIdField")],t.prototype,"readObjectIdField",null),(0,s._)([(0,u.Cb)({})],t.prototype,"geometryType",void 0),(0,s._)([(0,u.Cb)({})],t.prototype,"typeIdField",void 0),(0,s._)([(0,u.Cb)({})],t.prototype,"types",void 0),(0,s._)([(0,u.Cb)({readOnly:!0})],t.prototype,"parsedUrl",null),(0,s._)([(0,u.Cb)({type:Function})],t.prototype,"pixelFilter",void 0),(0,s._)([(0,u.Cb)()],t.prototype,"raster",void 0),(0,s._)([(0,u.Cb)()],t.prototype,"viewId",void 0),(0,s._)([(0,u.Cb)({types:f.dr,json:{name:"layerDefinition.drawingInfo.renderer",origins:{"web-scene":{types:f.FK,name:"layerDefinition.drawingInfo.renderer",write:{overridePolicy:e=>({enabled:e&&"vector-field"!==e.type&&"flow"!==e.type})}}}}})],t.prototype,"renderer",null),(0,s._)([(0,S.r)("renderer")],t.prototype,"readRenderer",null),(0,s._)([(0,m.c)("renderer")],t.prototype,"writeRenderer",null),(0,s._)([(0,u.Cb)()],t.prototype,"symbolizer",void 0),(0,s._)([(0,u.Cb)(I.Oh)],t.prototype,"opacity",void 0),(0,s._)([(0,u.Cb)({readOnly:!0})],t.prototype,"rasterFields",null),(0,s._)([(0,u.Cb)({constructOnly:!0})],t.prototype,"rasterFunctionInfos",void 0),(0,s._)([(0,u.Cb)({type:J})],t.prototype,"renderingRule",null),(0,s._)([(0,S.r)("renderingRule",["renderingRule","rasterFunctionInfos"])],t.prototype,"readRenderingRule",null),(0,s._)([(0,m.c)("renderingRule")],t.prototype,"writeRenderingRule",null),(0,s._)([(0,u.Cb)()],t.prototype,"serviceDataType",void 0),(0,s._)([(0,u.Cb)({readOnly:!0,type:_e.Z})],t.prototype,"spatialReference",void 0),(0,s._)([(0,S.r)("spatialReference",["spatialReference","extent"])],t.prototype,"readSpatialReference",null),(0,s._)([(0,u.Cb)({json:{type:mt.jsonValues}})],t.prototype,"pixelType",void 0),(0,s._)([(0,S.r)("pixelType")],t.prototype,"readPixelType",null),(0,s._)([(0,m.c)("pixelType")],t.prototype,"writePixelType",null),(0,s._)([(0,u.Cb)({constructOnly:!0,type:de.Z})],t.prototype,"serviceRasterInfo",void 0),(0,s._)([(0,u.Cb)()],t.prototype,"sourceJSON",void 0),(0,s._)([(0,u.Cb)(I.HQ)],t.prototype,"url",void 0),(0,s._)([(0,u.Cb)({readOnly:!0})],t.prototype,"version",void 0),(0,s._)([(0,S.r)("version",["currentVersion","fields","timeInfo"])],t.prototype,"readVersion",null),t=(0,s._)([(0,c.j)("esri.layers.mixins.ArcGISImageService")],t),t};var ft=i(17287),gt=i(71612),bt=i(17017),Rt=i(38009),vt=i(16859),wt=i(34760),_t=i(72965),Ct=i(28294),St=i(60199),It=i(32163);let xt=class extends((0,gt.h)((0,Ct.n)((0,wt.Q)((0,_t.M)((0,Rt.q)((0,vt.I)(yt((0,bt.N)((0,ft.Y)((0,o.R)(d.Z))))))))))){constructor(...e){super(...e),this.legendEnabled=!0,this.isReference=null,this.operationalLayerType="ArcGISImageServiceLayer",this.popupEnabled=!0,this.popupTemplate=null,this.type="imagery"}normalizeCtorArgs(e,t){return"string"==typeof e?{url:e,...t}:e}load(e){const t=(0,a.pC)(e)?e.signal:null;return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["Image Service"]},e).catch(l.r9).then((()=>this._fetchService(t)))),Promise.resolve(this)}writeOperationalLayerType(e,t,i){const r="vector-field"===this.renderer?.type;t[i]=r?"ArcGISImageServiceVectorLayer":"ArcGISImageServiceLayer"}get defaultPopupTemplate(){return this.createPopupTemplate()}createPopupTemplate(e){const t=this.rasterFields,i=this.title,r=new Set;let s=!1,n=!1;this.capabilities&&(s=this.capabilities.operations.supportsQuery&&this.fields&&this.fields.length>0,n="esriImageServiceDataTypeVector-UV"===this.serviceDataType||"esriImageServiceDataTypeVector-MagDir"===this.serviceDataType);const a=new Set;s&&a.add("raster.itempixelvalue");for(const e of t){const t=e.name.toLowerCase();a.has(t)||t.includes("raster.servicepixelvalue.")||r.add(e.name)}return n&&r.add("raster.magnitude").add("raster.direction"),(0,It.eZ)({fields:t,title:i},{...e,visibleFieldNames:r})}queryFeatures(e,t){return this.queryRasters(e,t).then((e=>{if(e?.features)for(const t of e.features)t.layer=t.sourceLayer=this;return e}))}queryFeatureCount(e,t){return this.queryRasterCount(e,t)}redraw(){this.emit("redraw")}serviceSupportsSpatialReference(e){return(0,St.D)(this,e)}};(0,s._)([(0,u.Cb)(I.rn)],xt.prototype,"legendEnabled",void 0),(0,s._)([(0,u.Cb)({type:["show","hide"]})],xt.prototype,"listMode",void 0),(0,s._)([(0,u.Cb)({type:Boolean,json:{read:!1,write:{enabled:!0,overridePolicy:()=>({enabled:!1})}}})],xt.prototype,"isReference",void 0),(0,s._)([(0,u.Cb)({type:["ArcGISImageServiceLayer"],json:{origins:{"web-map":{type:["ArcGISImageServiceLayer","ArcGISImageServiceVectorLayer"],read:!1,write:{target:"layerType",ignoreOrigin:!0}}}}})],xt.prototype,"operationalLayerType",void 0),(0,s._)([(0,m.c)("web-map","operationalLayerType")],xt.prototype,"writeOperationalLayerType",null),(0,s._)([(0,u.Cb)(I.C_)],xt.prototype,"popupEnabled",void 0),(0,s._)([(0,u.Cb)({type:n.Z,json:{read:{source:"popupInfo"},write:{target:"popupInfo"}}})],xt.prototype,"popupTemplate",void 0),(0,s._)([(0,u.Cb)({readOnly:!0})],xt.prototype,"defaultPopupTemplate",null),(0,s._)([(0,u.Cb)({readOnly:!0,json:{read:!1}})],xt.prototype,"type",void 0),xt=(0,s._)([(0,c.j)("esri.layers.ImageryLayer")],xt);const Ft=xt},17287:(e,t,i)=>{i.d(t,{Y:()=>u});var r=i(43697),s=i(92604),n=i(70586),a=i(5600),o=(i(67676),i(80442),i(75215),i(52011)),l=i(66677);const u=e=>{let t=class extends e{get title(){if(this._get("title")&&"defaults"!==this.originOf("title"))return this._get("title");if(this.url){const e=(0,l.Qc)(this.url);if((0,n.pC)(e)&&e.title)return e.title}return this._get("title")||""}set title(e){this._set("title",e)}set url(e){this._set("url",(0,l.Nm)(e,s.Z.getLogger(this.declaredClass)))}};return(0,r._)([(0,a.Cb)()],t.prototype,"title",null),(0,r._)([(0,a.Cb)({type:String})],t.prototype,"url",null),t=(0,r._)([(0,o.j)("esri.layers.mixins.ArcGISService")],t),t}},16859:(e,t,i)=>{i.d(t,{I:()=>R});var r=i(43697),s=i(40330),n=i(3172),a=i(66643),o=i(20102),l=i(92604),u=i(70586),p=i(95330),c=i(17452),m=i(5600),d=(i(67676),i(80442),i(75215),i(71715)),h=i(52011),y=i(30556),f=i(65587),g=i(15235),b=i(86082);const R=e=>{let t=class extends e{constructor(){super(...arguments),this.resourceReferences={portalItem:null,paths:[]},this.userHasEditingPrivileges=!0}destroy(){this.portalItem?.destroy(),this.portalItem=null}set portalItem(e){e!==this._get("portalItem")&&(this.removeOrigin("portal-item"),this._set("portalItem",e))}readPortalItem(e,t,i){if(t.itemId)return new g.default({id:t.itemId,portal:i&&i.portal})}writePortalItem(e,t){e&&e.id&&(t.itemId=e.id)}async loadFromPortal(e,t){if(this.portalItem&&this.portalItem.id)try{const r=await i.e(8062).then(i.bind(i,18062));return(0,p.k_)(t),await r.load({instance:this,supportedTypes:e.supportedTypes,validateItem:e.validateItem,supportsData:e.supportsData},t)}catch(e){throw(0,p.D_)(e)||l.Z.getLogger(this.declaredClass).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,p.r9)(e),!0))))}async _fetchUserHasEditingPrivileges(e){const t=this.url?s.id?.findCredential(this.url):null;if(!t)return!0;const i=v.credential===t?v.user:await this._fetchEditingUser(e);return v.credential=t,v.user=i,(0,u.Wi)(i)||null==i.privileges||i.privileges.includes("features:user:edit")}async _fetchEditingUser(e){const t=this.portalItem?.portal?.user;if(t)return t;const i=s.id.findServerInfo(this.url);if(!i?.owningSystemUrl)return null;const r=`${i.owningSystemUrl}/sharing/rest`,o=f.Z.getDefault();if(o&&o.loaded&&(0,c.Fv)(o.restUrl)===(0,c.Fv)(r))return o.user;const l=`${r}/community/self`,p=(0,u.pC)(e)?e.signal:null,m=await(0,a.q6)((0,n.default)(l,{authMode:"no-prompt",query:{f:"json"},signal:p}));return m.ok?b.default.fromJSON(m.value.data):null}read(e,t){t&&(t.layer=this),super.read(e,t)}write(e,t){const i=t&&t.portal,r=this.portalItem&&this.portalItem.id&&(this.portalItem.portal||f.Z.getDefault());return i&&r&&!(0,c.tm)(r.restUrl,i.restUrl)?(t.messages&&t.messages.push(new o.Z("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,r._)([(0,m.Cb)({type:g.default})],t.prototype,"portalItem",null),(0,r._)([(0,d.r)("web-document","portalItem",["itemId"])],t.prototype,"readPortalItem",null),(0,r._)([(0,y.c)("web-document","portalItem",{itemId:{type:String}})],t.prototype,"writePortalItem",null),(0,r._)([(0,m.Cb)({clonable:!1})],t.prototype,"resourceReferences",void 0),(0,r._)([(0,m.Cb)({readOnly:!0})],t.prototype,"userHasEditingPrivileges",void 0),t=(0,r._)([(0,h.j)("esri.layers.mixins.PortalLayer")],t),t},v={credential:null,user:null}},41818:(e,t,i)=>{i.d(t,{P:()=>a});var r=i(11282),s=i(34599),n=i(57444);async function a(e,t,i){const a=(0,r.en)(e);return(0,s.executeQueryForCount)(a,n.Z.from(t),{...i}).then((e=>e.data.count))}},5396:(e,t,i)=>{i.d(t,{G:()=>a});var r=i(11282),s=i(34599),n=i(57444);async function a(e,t,i){const a=(0,r.en)(e);return(0,s.executeQueryForIds)(a,n.Z.from(t),{...i}).then((e=>e.data.objectIds))}},4967:(e,t,i)=>{i.d(t,{F:()=>l,e:()=>o});var r=i(11282),s=i(34599),n=i(74889),a=i(57444);async function o(e,t,i){const r=await l(e,t,i);return n.default.fromJSON(r)}async function l(e,t,i){const n=(0,r.en)(e),o={...i},l=a.Z.from(t),{data:u}=await(0,s.executeQuery)(n,l,l.sourceSpatialReference,o);return u}},98326:(e,t,i)=>{i.d(t,{Z:()=>c});var r,s=i(43697),n=i(96674),a=i(5600),o=(i(67676),i(80442),i(75215)),l=i(52011);const u={1:{id:1,rotation:0,mirrored:!1},2:{id:2,rotation:0,mirrored:!0},3:{id:3,rotation:180,mirrored:!1},4:{id:4,rotation:180,mirrored:!0},5:{id:5,rotation:-90,mirrored:!0},6:{id:6,rotation:90,mirrored:!1},7:{id:7,rotation:90,mirrored:!0},8:{id:8,rotation:-90,mirrored:!1}};let p=r=class extends n.wq{constructor(e){super(e),this.contentType=null,this.exifInfo=null,this.id=null,this.globalId=null,this.keywords=null,this.name=null,this.parentGlobalId=null,this.parentObjectId=null,this.size=null,this.url=null}get orientationInfo(){const{exifInfo:e}=this,t=function(e){const{exifInfo:t,exifName:i,tagName:r}=e;if(!t||!i||!r)return null;const s=t.find((e=>e.name===i));return s?function(e){const{tagName:t,tags:i}=e;if(!i||!t)return null;const r=i.find((e=>e.name===t));return r&&r.value||null}({tagName:r,tags:s.tags}):null}({exifName:"Exif IFD0",tagName:"Orientation",exifInfo:e});return u[t]||null}clone(){return new r({contentType:this.contentType,exifInfo:this.exifInfo,id:this.id,globalId:this.globalId,keywords:this.keywords,name:this.name,parentGlobalId:this.parentGlobalId,parentObjectId:this.parentObjectId,size:this.size,url:this.url})}};(0,s._)([(0,a.Cb)({type:String})],p.prototype,"contentType",void 0),(0,s._)([(0,a.Cb)()],p.prototype,"exifInfo",void 0),(0,s._)([(0,a.Cb)({readOnly:!0})],p.prototype,"orientationInfo",null),(0,s._)([(0,a.Cb)({type:o.z8})],p.prototype,"id",void 0),(0,s._)([(0,a.Cb)({type:String})],p.prototype,"globalId",void 0),(0,s._)([(0,a.Cb)({type:String})],p.prototype,"keywords",void 0),(0,s._)([(0,a.Cb)({type:String})],p.prototype,"name",void 0),(0,s._)([(0,a.Cb)({json:{read:!1}})],p.prototype,"parentGlobalId",void 0),(0,s._)([(0,a.Cb)({json:{read:!1}})],p.prototype,"parentObjectId",void 0),(0,s._)([(0,a.Cb)({type:o.z8})],p.prototype,"size",void 0),(0,s._)([(0,a.Cb)({json:{read:!1}})],p.prototype,"url",void 0),p=r=(0,s._)([(0,l.j)("esri.layers.support.AttachmentInfo")],p);const c=p}}]);