@arcgis/core 4.32.0-next.20241021 → 4.32.0-next.20241023

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 (257) hide show
  1. package/applications/MapViewer/templateUtils.d.ts +4 -0
  2. package/applications/MapViewer/templateUtils.js +5 -0
  3. package/assets/esri/core/workers/RemoteClient.js +1 -1
  4. package/assets/esri/core/workers/chunks/0b7ee57bec7ffac312f2.js +1 -0
  5. package/assets/esri/core/workers/chunks/{1ba1d9c867ec6a492af9.js → 0f3912bca9fe25eea75c.js} +1 -1
  6. package/assets/esri/core/workers/chunks/{842ebde78db9bfcaf07b.js → 1678d1d0ecb9b2af69a8.js} +1 -1
  7. package/assets/esri/core/workers/chunks/1d16ca7791f64dd7c7fb.js +1 -0
  8. package/assets/esri/core/workers/chunks/1d4be734ff961e313257.js +1 -0
  9. package/assets/esri/core/workers/chunks/{b292758308dfac4ba8ee.js → 2d8aa31dc96bbd014036.js} +1 -1
  10. package/assets/esri/core/workers/chunks/{53f648321c5fde26bfe4.js → 319e06888467f9f460ab.js} +1 -1
  11. package/assets/esri/core/workers/chunks/33cae7ece52a77394b05.js +1 -0
  12. package/assets/esri/core/workers/chunks/{210a954f5299fe105e0b.js → 539060ffb7f230fb1bd0.js} +1 -1
  13. package/assets/esri/core/workers/chunks/545441dcc8e915e63ff1.js +1 -0
  14. package/assets/esri/core/workers/chunks/{303f39b9b7bd33109df8.js → 587df97288a83721d251.js} +1 -1
  15. package/assets/esri/core/workers/chunks/5caa02a7a85d05e253b4.js +1 -0
  16. package/assets/esri/core/workers/chunks/5cfecb320e1dcd258b2e.js +1 -0
  17. package/assets/esri/core/workers/chunks/67018ef25736f0722f6e.js +1 -0
  18. package/assets/esri/core/workers/chunks/89f74819ac1b5884c149.js +1 -0
  19. package/assets/esri/core/workers/chunks/92b2d81ef16877341f97.js +1 -0
  20. package/assets/esri/core/workers/chunks/{e6e77cbdeb99d90caad1.js → 97f62fad6d416a666319.js} +1 -1
  21. package/assets/esri/core/workers/chunks/98c1956b2e27058c8a51.js +1 -0
  22. package/assets/esri/core/workers/chunks/9c8a910b6261a4d5da77.js +1 -0
  23. package/assets/esri/core/workers/chunks/ab6eaa3ae2e233f91a5e.js +1 -0
  24. package/assets/esri/core/workers/chunks/{63719f892a7d1025c7d3.js → b42c1ab7579a3c464f72.js} +1 -1
  25. package/assets/esri/core/workers/chunks/{03eba36affe6ed1f5a11.js → bc4ef18d0a02354186e3.js} +7 -7
  26. package/assets/esri/core/workers/chunks/{c71304c88fce556340ef.js → c859f73b57a764e99b02.js} +1 -1
  27. package/assets/esri/core/workers/chunks/cb3038ec3ef0d86bf2a0.js +1 -0
  28. package/assets/esri/core/workers/chunks/{ae20ca2008a2ea6a46b2.js → d8f4bd2b4366388f8a28.js} +1 -1
  29. package/assets/esri/core/workers/chunks/e71fa25ed45bae5a1adb.js +320 -0
  30. package/assets/esri/core/workers/chunks/{9c9a8a529494c6d1dfa3.js → ec9d5af8887854e821c8.js} +1 -1
  31. package/assets/esri/libs/parquet/pkg/arcgis_parquet_bg.wasm +0 -0
  32. package/assets/esri/themes/base/widgets/_BatchAttributeForm.scss +14 -0
  33. package/assets/esri/themes/base/widgets/_OrientedImageryViewer.scss +1 -1
  34. package/assets/esri/themes/dark/main.css +1 -1
  35. package/assets/esri/themes/light/main.css +1 -1
  36. package/assets/esri/themes/light/view.css +1 -1
  37. package/chunks/Bufferer-BhkgvSV4.js +5 -0
  38. package/chunks/{Distance2DCalculator-DM4OojiI.js → Distance2DCalculator-BX0Ep7eP.js} +1 -1
  39. package/chunks/{GeodeticDistanceCalculator-DzvUOSaR.js → GeodeticDistanceCalculator-B5uO-Y_z.js} +1 -1
  40. package/chunks/OperatorCrosses.js +5 -0
  41. package/chunks/OperatorCut.js +1 -1
  42. package/chunks/OperatorGeodesicBuffer.js +1 -1
  43. package/chunks/OperatorGeodeticArea.js +1 -1
  44. package/chunks/OperatorGeodeticDensifyByLength.js +1 -1
  45. package/chunks/OperatorGeodeticDistance.js +1 -1
  46. package/chunks/OperatorGeodeticLength.js +1 -1
  47. package/chunks/OperatorIntersects.js +5 -0
  48. package/chunks/OperatorMultiPartToSinglePart.js +1 -1
  49. package/chunks/OperatorOverlaps.js +5 -0
  50. package/chunks/OperatorProximity.js +1 -1
  51. package/chunks/OperatorProximityGeodesic.js +1 -1
  52. package/chunks/OperatorShapePreservingLength.js +1 -1
  53. package/chunks/OperatorTouches.js +5 -0
  54. package/chunks/OperatorWithin.js +5 -0
  55. package/chunks/QuadraticBezier.js +1 -1
  56. package/chunks/SSAOBlur.glsl.js +5 -5
  57. package/chunks/SideCalculator2D-CoWc8Oe3.js +1 -1
  58. package/chunks/Transformation2D.js +1 -1
  59. package/core/MemCache.js +1 -1
  60. package/core/MemCachePool.js +1 -1
  61. package/core/unitUtils.js +1 -1
  62. package/geometry/Mesh.js +1 -1
  63. package/geometry/operators/affineTransformOperator.js +1 -1
  64. package/geometry/operators/alphaShapeOperator.js +1 -1
  65. package/geometry/operators/areaOperator.js +1 -1
  66. package/geometry/operators/autoCompleteOperator.js +1 -1
  67. package/geometry/operators/boundaryOperator.js +1 -1
  68. package/geometry/operators/bufferOperator.js +1 -1
  69. package/geometry/operators/centroidOperator.js +1 -1
  70. package/geometry/operators/clipOperator.js +1 -1
  71. package/geometry/operators/containsOperator.js +1 -1
  72. package/geometry/operators/convexHullOperator.js +1 -1
  73. package/geometry/operators/crossesOperator.js +1 -1
  74. package/geometry/operators/cutOperator.js +1 -1
  75. package/geometry/operators/densifyOperator.js +1 -1
  76. package/geometry/operators/differenceOperator.js +1 -1
  77. package/geometry/operators/disjointOperator.js +1 -1
  78. package/geometry/operators/distanceOperator.js +1 -1
  79. package/geometry/operators/equalsOperator.js +1 -1
  80. package/geometry/operators/extendOperator.js +1 -1
  81. package/geometry/operators/generalizeOperator.js +1 -1
  82. package/geometry/operators/geodesicBufferOperator.js +1 -1
  83. package/geometry/operators/geodesicProximityOperator.js +1 -1
  84. package/geometry/operators/geodeticAreaOperator.js +1 -1
  85. package/geometry/operators/geodeticDensifyOperator.js +1 -1
  86. package/geometry/operators/geodeticDistanceOperator.js +1 -1
  87. package/geometry/operators/geodeticLengthOperator.js +1 -1
  88. package/geometry/operators/graphicBufferOperator.js +1 -1
  89. package/geometry/operators/gx/operatorAlphaShape.js +1 -1
  90. package/geometry/operators/gx/operatorAutoComplete.js +1 -1
  91. package/geometry/operators/gx/operatorBoundary.js +1 -1
  92. package/geometry/operators/gx/operatorBuffer.js +1 -1
  93. package/geometry/operators/gx/operatorConvexHull.js +1 -1
  94. package/geometry/operators/gx/operatorDifference.js +1 -1
  95. package/geometry/operators/gx/operatorGeodesicBuffer.js +1 -1
  96. package/geometry/operators/gx/operatorGeodeticArea.js +1 -1
  97. package/geometry/operators/gx/operatorGeodeticDensify.js +1 -1
  98. package/geometry/operators/gx/operatorGeodeticDistance.js +1 -1
  99. package/geometry/operators/gx/operatorGeodeticLength.js +1 -1
  100. package/geometry/operators/gx/operatorGraphicBuffer.js +1 -1
  101. package/geometry/operators/gx/operatorIntegrate.js +1 -1
  102. package/geometry/operators/gx/operatorIntersection.js +1 -1
  103. package/geometry/operators/gx/operatorLabelPoint.js +1 -1
  104. package/geometry/operators/gx/operatorLinesToPolygons.js +1 -1
  105. package/geometry/operators/gx/operatorLocateBetween.js +1 -1
  106. package/geometry/operators/gx/operatorOffset.js +1 -1
  107. package/geometry/operators/gx/operatorPolygonOverlay.js +1 -1
  108. package/geometry/operators/gx/operatorPolygonSlicer.js +1 -1
  109. package/geometry/operators/gx/operatorProject.js +1 -1
  110. package/geometry/operators/gx/operatorProximityGeodesic.js +1 -1
  111. package/geometry/operators/gx/operatorSimplify.js +1 -1
  112. package/geometry/operators/gx/operatorSymmetricDifference.js +1 -1
  113. package/geometry/operators/gx/operatorUnion.js +1 -1
  114. package/geometry/operators/integrateOperator.js +1 -1
  115. package/geometry/operators/intersectionOperator.js +1 -1
  116. package/geometry/operators/intersectsOperator.js +1 -1
  117. package/geometry/operators/isNearOperator.js +1 -1
  118. package/geometry/operators/json/containsOperator.js +5 -0
  119. package/geometry/operators/json/crossesOperator.js +5 -0
  120. package/geometry/operators/json/disjointOperator.js +5 -0
  121. package/geometry/operators/json/intersectsOperator.js +5 -0
  122. package/geometry/operators/json/offsetOperator.js +5 -0
  123. package/geometry/operators/json/overlapsOperator.js +5 -0
  124. package/geometry/operators/json/touchesOperator.js +5 -0
  125. package/geometry/operators/json/withinOperator.js +5 -0
  126. package/geometry/operators/labelPointOperator.js +1 -1
  127. package/geometry/operators/lengthOperator.js +1 -1
  128. package/geometry/operators/linesToPolygonsOperator.js +1 -1
  129. package/geometry/operators/locateBetweenOperator.js +1 -1
  130. package/geometry/operators/minimumBoundingCircleOperator.js +1 -1
  131. package/geometry/operators/multiPartToSinglePartOperator.js +1 -1
  132. package/geometry/operators/offsetOperator.js +1 -1
  133. package/geometry/operators/overlapsOperator.js +1 -1
  134. package/geometry/operators/polygonOverlayOperator.js +1 -1
  135. package/geometry/operators/polygonSlicerOperator.js +1 -1
  136. package/geometry/operators/projectOperator.js +1 -1
  137. package/geometry/operators/proximityOperator.js +1 -1
  138. package/geometry/operators/relateOperator.js +1 -1
  139. package/geometry/operators/reshapeOperator.js +1 -1
  140. package/geometry/operators/simplifyOperator.js +1 -1
  141. package/geometry/operators/singlePartToMultiPartOperator.js +1 -1
  142. package/geometry/operators/support/apiConverter.js +5 -0
  143. package/geometry/operators/support/initNoPeFactory.js +5 -0
  144. package/geometry/operators/support/jsonConverter.js +5 -0
  145. package/geometry/operators/support/proximityResult.js +1 -1
  146. package/geometry/operators/symmetricDifferenceOperator.js +1 -1
  147. package/geometry/operators/touchesOperator.js +1 -1
  148. package/geometry/operators/unionOperator.js +1 -1
  149. package/geometry/operators/withinOperator.js +1 -1
  150. package/geometry/support/MeshVertexAttributes.js +1 -1
  151. package/interfaces.d.ts +134 -0
  152. package/layers/LinkChartLayer.js +1 -1
  153. package/layers/SceneLayer.js +1 -1
  154. package/layers/graphics/OptimizedGeometry.js +1 -1
  155. package/layers/graphics/sources/ParquetSource.js +1 -1
  156. package/layers/knowledgeGraph/supportUtils.js +1 -1
  157. package/layers/support/ElevationQueryTileCache.js +1 -1
  158. package/layers/support/ElevationTileData.js +1 -1
  159. package/layers/support/mediaUtils.js +1 -1
  160. package/layers/support/parquetLayerUtils.js +1 -1
  161. package/layers/support/rasterFunctions/ClipFunction.js +1 -1
  162. package/layers/support/rasterFunctions/clipUtils.js +1 -1
  163. package/layers/support/rasterFunctions/localUtils.js +1 -1
  164. package/libs/parquet/parquet.js +1 -1
  165. package/linkChart/LinkChartProperties.js +1 -1
  166. package/package.json +1 -1
  167. package/smartMapping/raster/renderers/classBreaks.js +1 -1
  168. package/smartMapping/raster/renderers/rgb.js +1 -1
  169. package/smartMapping/raster/renderers/stretch.js +1 -1
  170. package/smartMapping/raster/support/adapters/ImageryTileLayerAdapter.js +1 -1
  171. package/smartMapping/raster/support/adapters/RasterLayerAdapter.js +1 -1
  172. package/smartMapping/renderers/support/rendererUtils.d.ts +4 -0
  173. package/support/revision.js +1 -1
  174. package/symbols/cim/effects/EffectControlMeasureLine.js +1 -1
  175. package/views/2d/engine/vectorTiles/RenderBucket.js +1 -1
  176. package/views/2d/engine/vectorTiles/TileHandler3D.js +1 -1
  177. package/views/2d/engine/vectorTiles/VectorTile.js +1 -1
  178. package/views/2d/engine/webgl/shaderGraph/techniques/animated/AnimatedMarkerMeshWriter.js +1 -1
  179. package/views/2d/engine/webgl/shaderGraph/techniques/animated/AnimatedMarkerShader.js +1 -1
  180. package/views/2d/grid/GridView2D.js +1 -1
  181. package/views/2d/layers/FeatureLayerView2D.js +1 -1
  182. package/views/2d/layers/MediaLayerView2D.js +1 -1
  183. package/views/2d/layers/TileLayerView2D.js +1 -1
  184. package/views/2d/layers/features/layerAdapters/ParquetLayerAdapter.js +1 -1
  185. package/views/2d/layers/features/schema/processor/symbols/ComplexSymbolSchema.js +1 -1
  186. package/views/2d/layers/features/support/FeatureSetReaderParquet.js +1 -1
  187. package/views/3d/analysis/Viewshed/ViewshedSubTool.js +1 -1
  188. package/views/3d/camera/constraintUtils/tilt.js +1 -1
  189. package/views/3d/glTF/loader.js +1 -1
  190. package/views/3d/layers/I3SMeshView3D.js +1 -1
  191. package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
  192. package/views/3d/layers/PointCloudLayerView3D.js +1 -1
  193. package/views/3d/layers/SceneLayerGraphicsView3D.js +1 -1
  194. package/views/3d/layers/graphics/Graphics3DCore.js +1 -1
  195. package/views/3d/layers/graphics/Graphics3DSymbol.js +1 -1
  196. package/views/3d/layers/graphics/Graphics3DWebStyleSymbol.js +1 -1
  197. package/views/3d/layers/graphics/ObjectResourceCache.js +1 -1
  198. package/views/3d/layers/graphics/wosrLoader.js +1 -1
  199. package/views/3d/layers/i3s/CachedMeshData.js +5 -0
  200. package/views/3d/layers/i3s/I3SClientNodeLoader.js +1 -1
  201. package/views/3d/layers/i3s/I3SOverrides.js +1 -1
  202. package/views/3d/layers/i3s/PointRenderer.js +1 -1
  203. package/views/3d/layers/support/FeatureTile.js +1 -1
  204. package/views/3d/layers/support/FeatureTileFetcher3D.js +1 -1
  205. package/views/3d/state/ViewStateManager.js +1 -1
  206. package/views/3d/state/controllers/FovController.js +1 -1
  207. package/views/3d/support/buffer/InterleavedLayout.js +1 -1
  208. package/views/3d/terrain/Tile.js +1 -1
  209. package/views/3d/terrain/TileTexture.js +1 -1
  210. package/views/3d/webgl/ManagedFBO.js +1 -1
  211. package/views/3d/webgl/ManagedFBOAttachment.js +1 -1
  212. package/views/3d/webgl-engine/core/FBOCache.js +1 -1
  213. package/views/3d/webgl-engine/core/FBOPool.js +1 -1
  214. package/views/3d/webgl-engine/core/shaderLibrary/output/OutputHighlight.glsl.js +1 -1
  215. package/views/3d/webgl-engine/lib/edgeRendering/EdgeView.js +1 -1
  216. package/views/3d/webgl-engine/materials/ProceduralTextureRepository.js +1 -1
  217. package/views/3d/webgl-engine/materials/renderers/MergedRenderer.js +1 -1
  218. package/views/3d/webgl-engine/shaders/SSAOBlur.glsl.js +1 -1
  219. package/views/input/BrowserEventSource.js +1 -1
  220. package/views/webgl/Texture.js +1 -1
  221. package/views/webgl/VertexArrayObject.js +1 -1
  222. package/webdoc/support/webdocSaveUtils.js +1 -1
  223. package/widgets/Attribution/AttributionViewModel.js +1 -1
  224. package/widgets/BatchAttributeForm/BatchAttributeFormViewModel.js +1 -1
  225. package/widgets/BatchAttributeForm/css.js +1 -1
  226. package/widgets/BatchAttributeForm/templates/support/createBatchFormTemplate.js +1 -1
  227. package/widgets/BatchAttributeForm.js +1 -1
  228. package/widgets/ElevationProfile/support/ElevationProfileView2D.js +1 -1
  229. package/widgets/ElevationProfile/support/ProfileLine2D.js +5 -0
  230. package/widgets/ElevationProfile/support/ProfileLines3D.js +1 -1
  231. package/widgets/ElevationProfile/support/constants.js +1 -1
  232. package/widgets/ElevationProfile/support/visualizationUtils.js +5 -0
  233. package/widgets/FeatureTable/FeatureTableViewModel.js +1 -1
  234. package/widgets/FeatureTable/Grid/GridViewModel.js +1 -1
  235. package/widgets/FeatureTable/support/columnUtils.js +1 -1
  236. package/widgets/FeatureTable/support/tableUtils.js +1 -1
  237. package/widgets/FeatureTable/support/templateUtils.js +5 -0
  238. package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
  239. package/widgets/support/GridControls/GridControlsViewModel.js +1 -1
  240. package/widgets/support/GridControls.js +1 -1
  241. package/assets/esri/core/workers/chunks/03d0394fff1463c224f9.js +0 -1
  242. package/assets/esri/core/workers/chunks/0c40cac18711f79f0a7d.js +0 -1
  243. package/assets/esri/core/workers/chunks/1a97f98facfc62a9fc69.js +0 -1
  244. package/assets/esri/core/workers/chunks/1e3ed3ee48c2977cff6f.js +0 -1
  245. package/assets/esri/core/workers/chunks/1fc064e37d030e449d5e.js +0 -1
  246. package/assets/esri/core/workers/chunks/4daab36de5efa03a8cbb.js +0 -1
  247. package/assets/esri/core/workers/chunks/77d129134c2a66cd86d8.js +0 -1
  248. package/assets/esri/core/workers/chunks/88bd9e023764da377aa7.js +0 -1
  249. package/assets/esri/core/workers/chunks/92ce57cb12d9a7a3699e.js +0 -1
  250. package/assets/esri/core/workers/chunks/a5675c989d00b7400f98.js +0 -1
  251. package/assets/esri/core/workers/chunks/c06c5c815b5e37717fa1.js +0 -1
  252. package/assets/esri/core/workers/chunks/ca1385e165aae8a32ca2.js +0 -1
  253. package/assets/esri/core/workers/chunks/ce8c1208916f54af7e68.js +0 -320
  254. package/assets/esri/core/workers/chunks/df51c93b2dbcc89efc23.js +0 -1
  255. package/assets/esri/core/workers/chunks/efa3c919261672871f2f.js +0 -1
  256. package/chunks/Bufferer-fr1_Nc47.js +0 -5
  257. package/geometry/operators/support/converterAPI.js +0 -5
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[6260,7136],{71903:(e,t,i)=>{var s;i.d(t,{u:()=>s}),function(e){e[e.KILOBYTES=1024]="KILOBYTES",e[e.MEGABYTES=1048576]="MEGABYTES",e[e.GIGABYTES=1073741824]="GIGABYTES"}(s||(s={}))},69540:(e,t,i)=>{i.d(t,{O:()=>u,P:()=>h});var s=i(90237),n=i(69622),r=(i(44208),i(4718)),a=(i(53966),i(97768)),o=i(35666),l=i(88620),c=i(40608);const u=e=>{let t=class extends e{clone(){const e=(0,l.oY)(this);(0,a.Lw)(e,"unable to clone instance of non-accessor class");const t=e.metadata,i=e.store,s={},n=new Map;for(const e in t){const a=t[e],l=i?.originOf(e),c=a.clonable;if(a.readOnly||!1===c||l!==o.Gr.USER&&l!==o.Gr.DEFAULTS&&l!==o.Gr.WEB_MAP&&l!==o.Gr.WEB_SCENE)continue;const u=this[e];let h=null;h="function"==typeof c?c(u):"reference"===c?u:(0,r.TU)(u),null!=u&&null==h||(l===o.Gr.DEFAULTS?n.set(e,h):s[e]=h)}const c=new(0,Object.getPrototypeOf(this).constructor)(s);if(n.size){const e=(0,l.oY)(c)?.store;if(e)for(const[t,i]of n)e.set(t,i,o.Gr.DEFAULTS)}return c}};return t=(0,s._)([(0,c.$)("esri.core.Clonable")],t),t};let h=class extends(u(n.A)){};h=(0,s._)([(0,c.$)("esri.core.Clonable")],h)},32587:(e,t,i)=>{i.d(t,{A:()=>r});var s=i(62788),n=i(95488);class r{constructor(e){this._observable=new n.I,this._map=new Map(e)}get size(){return(0,s.gc)(this._observable),this._map.size}clear(){this._map.size>0&&(this._map.clear(),this._observable.notify())}delete(e){const t=this._map.delete(e);return t&&this._observable.notify(),t}entries(){return(0,s.gc)(this._observable),this._map.entries()}forEach(e,t){(0,s.gc)(this._observable),this._map.forEach(((i,s)=>e.call(t,i,s,this)),t)}get(e){return(0,s.gc)(this._observable),this._map.get(e)}has(e){return(0,s.gc)(this._observable),this._map.has(e)}keys(){return(0,s.gc)(this._observable),this._map.keys()}set(e,t){return this._map.set(e,t),this._observable.notify(),this}values(){return(0,s.gc)(this._observable),this._map.values()}[Symbol.iterator](){return(0,s.gc)(this._observable),this._map[Symbol.iterator]()}get[Symbol.toStringTag](){return this._map[Symbol.toStringTag]}}},44794:(e,t,i)=>{i.d(t,{v:()=>o});var s=i(4718),n=i(62788),r=i(95488);class a{constructor(e,t){this._observable=new r.I,this._value=e,this._equalityFunction=t}get value(){return(0,n.gc)(this._observable),this._value}set value(e){this._equalityFunction(e,this._value)||(this._value=e,this._observable.notify())}mutate(e){e(this._value),this._observable.notify()}}function o(e,t=s.gh){return new a(e,t)}},17136:(e,t,i)=>{i.d(t,{el:()=>b});var s=i(92602),n=i(49186),r=i(53966),a=i(39829),o=i(82799),l=i(80754),c=i(21325),u=i(28735),h=(i(59456),i(78888)),f=i(65864),p=i(2272),d=i(84952),m=i(92300);const y=()=>r.A.getLogger("esri.geometry.support.normalizeUtils");function g(e){return"polygon"===e[0].type}function x(e){return"polyline"===e[0].type}function w(e,t,i){if(t){const t=function(e,t){if(!(e instanceof o.A||e instanceof a.A)){const e="straightLineDensify: the input geometry is neither polyline nor polygon";throw y().error(e),new n.A(e)}const i=(0,l.r8)(e),s=[];for(const e of i){const i=[];s.push(i),i.push([e[0][0],e[0][1]]);for(let s=0;s<e.length-1;s++){const n=e[s][0],r=e[s][1],a=e[s+1][0],o=e[s+1][1],l=Math.sqrt((a-n)*(a-n)+(o-r)*(o-r)),c=(o-r)/l,u=(a-n)/l,h=l/t;if(h>1){for(let e=1;e<=h-1;e++){const s=e*t,a=u*s+n,o=c*s+r;i.push([a,o])}const e=(l+Math.floor(h-1)*t)/2,s=u*e+n,a=c*e+r;i.push([s,a])}i.push([a,o])}}return function(e){return"polygon"===e.type}(e)?new a.A({rings:s,spatialReference:e.spatialReference}):new o.A({paths:s,spatialReference:e.spatialReference})}(e,1e6);e=(0,u.ci)(t,!0)}return i&&(e=(0,l.kS)(e,i)),e}function _(e,t,i){if(Array.isArray(e)){const s=e[0];if(s>t){const i=(0,l.kd)(s,t);e[0]=s+i*(-2*t)}else if(s<i){const t=(0,l.kd)(s,i);e[0]=s+t*(-2*i)}}else{const s=e.x;if(s>t){const i=(0,l.kd)(s,t);e=e.clone().offset(i*(-2*t),0)}else if(s<i){const t=(0,l.kd)(s,i);e=e.clone().offset(t*(-2*i),0)}}return e}function v(e,t){let i=-1;for(let s=0;s<t.cutIndexes.length;s++){const n=t.cutIndexes[s],r=t.geometries[s],a=(0,l.r8)(r);for(let e=0;e<a.length;e++){const t=a[e];t.some((i=>{if(i[0]<180)return!0;{let i=0;for(let e=0;e<t.length;e++){const s=t[e][0];i=s>i?s:i}i=Number(i.toFixed(9));const s=-360*(0,l.kd)(i,180);for(let i=0;i<t.length;i++){const t=r.getPoint(e,i);r.setPoint(e,i,t.clone().offset(s,0))}return!0}}))}if(n===i){if(g(e))for(const t of(0,l.r8)(r))e[n]=e[n].addRing(t);else if(x(e))for(const t of(0,l.r8)(r))e[n]=e[n].addPath(t)}else i=n,e[n]=r}return e}async function b(e,t,i){if(!Array.isArray(e))return b([e],t);t&&"string"!=typeof t&&y().warn("normalizeCentralMeridian()","The url object is deprecated, use the url string instead");const n="string"==typeof t?t:t?.url??s.A.geometryServiceUrl;let r,g,x,I,R,S,T,A,M=0;const k=[],O=[];for(const t of e)if(null!=t)if(r||(r=t.spatialReference,g=(0,c.Vp)(r),x=r.isWebMercator,S=x?102100:4326,I=l.j7[S].maxX,R=l.j7[S].minX,T=l.j7[S].plus180Line,A=l.j7[S].minus180Line),g)if("mesh"===t.type)O.push(t);else if("point"===t.type)O.push(_(t.clone(),I,R));else if("multipoint"===t.type){const e=t.clone();e.points=e.points.map((e=>_(e,I,R))),O.push(e)}else if("extent"===t.type){const e=t.clone()._normalize(!1,!1,g);O.push(e.rings?new a.A(e):e)}else if(t.extent){const e=t.extent,i=(0,l.kd)(e.xmin,R)*(2*I);let s=0===i?t.clone():(0,l.kS)(t.clone(),i);e.offset(i,0);let{xmin:n,xmax:r}=e;n=Number(n.toFixed(9)),r=Number(r.toFixed(9)),e.intersects(T)&&r!==I?(M=r>M?r:M,s=w(s,x),k.push(s),O.push("cut")):e.intersects(A)&&n!==R?(M=r*(2*I)>M?r*(2*I):M,s=w(s,x,360),k.push(s),O.push("cut")):O.push(s)}else O.push(t.clone());else O.push(t);else O.push(t);let F=(0,l.kd)(M,I),C=-90;const P=F,N=new o.A;for(;F>0;){const e=360*F-180;N.addPath([[e,C],[e,-1*C]]),C*=-1,F--}if(k.length>0&&P>0){const t=v(k,await async function(e,t,i,s){const n=(0,p.Dl)(e),r=t[0].spatialReference,a={...s,responseType:"json",query:{...n.query,f:"json",sr:(0,c.YX)(r),target:JSON.stringify({geometryType:(0,f.$B)(t[0]),geometries:t}),cutter:JSON.stringify(i)}},o=await(0,h.A)(n.path+"/cut",a),{cutIndexes:l,geometries:u=[]}=o.data;return{cutIndexes:l,geometries:u.map((e=>{const t=(0,f.rS)(e);return t.spatialReference=r,t}))}}(n,k,N,i)),s=[],r=[];for(let i=0;i<O.length;i++){const n=O[i];if("cut"!==n)r.push(n);else{const n=t.shift(),a=e[i];null!=a&&"polygon"===a.type&&a.rings&&a.rings.length>1&&n.rings.length>=a.rings.length?(s.push(n),r.push("simplify")):r.push(x?(0,u.Gh)(n):n)}}if(!s.length)return r;const a=await async function(e,t,i){const s="string"==typeof e?(0,d.An)(e):e,n=t[0].spatialReference,r=(0,f.$B)(t[0]),a={...i,query:{...s.query,f:"json",sr:(0,c.YX)(n),geometries:JSON.stringify((0,m.X)(t))}},{data:o}=await(0,h.A)(s.path+"/simplify",a);return(0,m.V)(o.geometries,r,n)}(n,s,i),o=[];for(let e=0;e<r.length;e++){const t=r[e];"simplify"!==t?o.push(t):o.push(x?(0,u.Gh)(a.shift()):a.shift())}return o}const D=[];for(let e=0;e<O.length;e++){const t=O[e];if("cut"!==t)D.push(t);else{const e=k.shift();D.push(!0===x?(0,u.Gh)(e):e)}}return D}},80754:(e,t,i)=>{i.d(t,{j7:()=>a,kS:()=>l,kd:()=>o,r8:()=>c});var s=i(82799),n=i(16930),r=i(65864);const a={102100:{maxX:20037508.342788905,minX:-20037508.342788905,plus180Line:new s.A({paths:[[[20037508.342788905,-20037508.342788905],[20037508.342788905,20037508.342788905]]],spatialReference:n.A.WebMercator}),minus180Line:new s.A({paths:[[[-20037508.342788905,-20037508.342788905],[-20037508.342788905,20037508.342788905]]],spatialReference:n.A.WebMercator})},4326:{maxX:180,minX:-180,plus180Line:new s.A({paths:[[[180,-180],[180,180]]],spatialReference:n.A.WGS84}),minus180Line:new s.A({paths:[[[-180,-180],[-180,180]]],spatialReference:n.A.WGS84})}};function o(e,t){return Math.ceil((e-t)/(2*t))}function l(e,t){const i=c(e);for(const e of i)for(const i of e)i[0]+=t;return e}function c(e){return(0,r.Bi)(e)?e.rings:e.paths}},97327:(e,t,i)=>{i.r(t),i.d(t,{default:()=>It});var s=i(90237),n=i(13874),r=i(69540),a=i(49186),o=i(53966),l=i(92071),c=i(74887),u=i(36708),h=i(10107),f=i(56507),p=(i(87811),i(44208)),d=i(40608),m=i(4146),y=i(18768),g=i(63074),x=i(69208),w=(i(59456),i(68729)),_=i(78888),v=i(51447),b=i(93223),I=i(36005),R=i(21325),S=i(60694),T=i(10873),A=i(45617),M=i(43577),k=i(13868),O=i(22796),F=i(69409),C=i(87045),P=i(39829),N=i(25482),D=i(91806),E=i(20223),B=i(77301),z=i(70834),L=i(86738);const J=new Map,H=new class{constructor(e=15e3,t=5e3){this._timer=null,this._cachedBlocks=new Map,this._size=-1,this._duration=e,this._interval=Math.min(e,t)}decreaseRefCount(e,t){const i=e+"/"+t,s=this._cachedBlocks;if(s.has(i)){const e=s.get(i);return e.refCount--,e.refCount<=0&&(s.delete(i),e.controller&&e.controller.abort()),e.refCount}return 0}getBlock(e,t){const i=e+"/"+t,s=this._cachedBlocks;if(s.has(i)){const e=s.get(i);return e.ts=Date.now(),e.refCount++,s.delete(i),s.set(i,e),e.block}return null}putBlock(e,t,i,s){const n=this._cachedBlocks,r=e+"/"+t;if(n.has(r)){const e=n.get(r);e.ts=Date.now(),e.refCount++}else n.set(r,{block:i,ts:Date.now(),refCount:1,controller:s});this._trim(),this._updateTimer()}deleteBlock(e,t){const i=this._cachedBlocks,s=e+"/"+t;i.has(s)&&i.delete(s)}updateMaxSize(e){this._size=e,this._trim()}empty(){this._cachedBlocks.clear(),this._clearTimer()}getCurrentSize(){return this._cachedBlocks.size}_updateTimer(){if(null!=this._timer)return;const e=this._cachedBlocks;this._timer=setInterval((()=>{const t=Array.from(e),i=Date.now();for(let s=0;s<t.length&&t[s][1].ts<=i-this._duration;s++)e.delete(t[s][0]);0===e.size&&this._clearTimer()}),this._interval)}_trim(){const e=this._cachedBlocks;if(-1===this._size||this._size>=e.size)return;const t=Array.from(e);for(let i=0;i<t.length-this._size;i++)e.delete(t[i][0])}_clearTimer(){null!=this._timer&&(clearInterval(this._timer),this._timer=null)}};function G(e,t){return null==t?e:`${e}?sliceId=${t}`}function q(e,t,i){const s=J.get(e);if(!s)return null==t?H.decreaseRefCount(e,i):0;if(null==t||null==s[t])return H.decreaseRefCount(e,i);const n=s[t]?.cache,r=n?.get(i);if(n&&r){if(r.refCount--,0===r.refCount){n.delete(i);for(let e=0;e<s.length;e++)s[e]?.cache.delete(i);r.controller&&r.controller.abort()}return r.refCount}return 0}function W(e,t,i){const s=J.get(e);if(!s)return null==t?H.getBlock(e,i):null;if(null==t||null==s[t]){for(let e=0;e<s.length;e++){const t=s[e]?.cache.get(i);if(t)return t.refCount++,t.block}return H.getBlock(e,i)}const n=s[t]?.cache.get(i);if(n)return n.refCount++,n.block;for(let e=0;e<s.length;e++){if(e===t||!s[e])continue;const n=s[e]?.cache,r=n?.get(i);if(n&&r)return r.refCount++,n.set(i,r),r.block}return null}function j(e,t,i,s,n=null){const r=J.get(e);if(!r)return void(null==t&&H.putBlock(e,i,s,n));if(null==t||null==r[t])return void H.putBlock(e,i,s,n);const a={refCount:1,block:s,isResolved:!1,isRejected:!1,controller:n};s.then((()=>a.isResolved=!0)).catch((()=>a.isRejected=!0)),r[t]?.cache.set(i,a)}function Z(e,t,i){const s=J.get(e);s?null!=t&&null!=s[t]?s[t]?.cache.delete(i):H.deleteBlock(e,i):null==t&&H.deleteBlock(e,i)}var $=i(16019),U=i(51244),V=i(28435),Y=i(14636),X=i(89738),K=i(5443),Q=i(16930);let ee=0,te=class extends N.oY{constructor(){super(...arguments),this._tileFetchQueue=new X.e({concurrency:32,process:(e,t)=>this._fetchRawTile(e.pyramidLevel,e.row,e.col,{...e.options,signal:t})}),this.datasetName=null,this.datasetFormat=null,this.hasUniqueSourceStorageInfo=!0,this.rasterInfo=null,this.ioConfig={sampling:"closest"}}normalizeCtorArgs(e){return e?.ioConfig&&(e={...e,ioConfig:{resolution:null,bandIds:null,sampling:"closest",tileInfo:C.A.create(),...e.ioConfig}}),e}get _isGlobalWrappableSource(){const{rasterInfo:e}=this,t=(0,z.FT)(e.spatialReference);return null!=t&&e.extent.width>=t/2}get _hasNoneOrGCSShiftTransform(){const{transform:e}=this.rasterInfo;return null==e||"gcs-shift"===e.type}set rasterJobHandler(e){this._set("rasterJobHandler",e),"Function"===this.datasetFormat&&this.primaryRasters?.rasters?.forEach((t=>t.rasterJobHandler=e))}get rasterId(){return this.url||"rasterId-"+ee++}set url(e){this._set("url",(0,S.Jf)(e,o.A.getLogger(this)))}async open(e){return this._openPromise??=(0,z.Hh)().then((()=>this._open(e))),this._openPromise}async fetchTile(e,t,i,s={}){const n=s.tileInfo||this.rasterInfo.storageInfo.tileInfo,r=this.getTileExtentFromTileInfo(e,t,i,n);return s={noClip:!0,...s},this.fetchPixels(r,n.size[0],n.size[1],s)}async identify(e,t={}){e=(0,f.PZ)(L.A,e).clone().normalize();const{multidimensionalDefinition:i,timeExtent:s}=t,{rasterInfo:n}=this,{hasMultidimensionalTranspose:r,multidimensionalInfo:a}=n;let{transposedVariableName:o}=t;const l=null!=a&&r&&(null!=s||(0,B.DY)(i));l&&!o&&(o=null!=i&&i.length>0?i[0].variableName??void 0:a.variables[0].name,t={...t,transposedVariableName:o}),t=this._getRequestOptionsWithSliceId(t);const{spatialReference:c,extent:u}=n,{datumTransformation:h}=t;let p=(0,z._I)(e,c,h);if(!u.intersects(p))return{location:p,value:null};if(null!=n.transform){const e=n.transform.inverseTransform(p);if(!n.nativeExtent.intersects(e))return{location:e,value:null};p=e}let d=0;const m=null!=o&&null!=a&&n.hasMultidimensionalTranspose;if("Function"===this.datasetFormat){const e=this.primaryRasters.rasters[0];if(m)return e.identify(p,t);const{pixelSize:s}=n,r=3,a=s.x*r/2,o=s.y*r/2,l=new K.A({xmin:p.x-a,xmax:p.x+a,ymin:p.y-o,ymax:p.y+o,spatialReference:c}),u={interpolation:"nearest",multidimensionalDefinition:i,sliceId:t.sliceId},{pixelBlock:h}=await e.fetchPixels(l,r,r,u),{pixelBlock:f}=await this.fetchPixels(l,r,r,u);if(null==h)return{location:p,value:null};const d=Math.floor(r*r*.5),y=!h.mask||h.mask[d]?h.pixels.map((e=>e[d])):null;let g;return null!=f&&(g=!f.mask||f.mask[d]?f.pixels.map((e=>e[d])):void 0),{location:p,value:y,processedValue:g,pyramidLevel:0}}if(!m)if(t.srcResolution)d=(0,z.t$)(t.srcResolution,n,this.ioConfig.sampling).pyramidLevel;else if(d=await this.computeBestPyramidLevelForLocation(e,t),null==d)return{location:p,value:null};const y=this.identifyPixelLocation(p,d,null,m);if(null===y)return{location:p,value:null};const{row:g,col:x,rowOffset:w,colOffset:_,blockWidth:v}=y,b=o??t.sliceId,I=G(this.rasterId,b),R=`${d}/${g}/${x}`;let S=W(I,null,R);null==S&&(S=this.fetchRawTile(d,g,x,t),j(I,null,R,S));const T=await S;if(!T?.pixels?.length)return{location:p,value:null};const A=w*v+_;return this._processIdentifyResult(T,{srcLocation:p,position:A,pyramidLevel:d,useTransposedTile:!!m,requestSomeSlices:l,identifyOptions:t})}async fetchPixels(e,t,i,s={}){e=(0,z.Ps)(e),s=this._getRequestOptionsWithSliceId(s);const{_hasNoneOrGCSShiftTransform:n}=this;if(s.requestRawData&&n)return this._fetchPixels(e,t,i,s);const r=(0,z.FT)(e.spatialReference),a=(0,z.OM)(e);if(null==r||0===a||1===a&&this._isGlobalWrappableSource&&n)return this._fetchPixels(e,t,i,s);if(a>=3)return{extent:e,pixelBlock:null};const o=[],{xmin:l,xmax:c}=e,u=Math.round(r/(c-l)*t),h=u-Math.round((r/2-l)/(c-l)*t);let f=0;const p=[];for(let n=0;n<=a;n++){const d=new K.A({xmin:0===n?l:-r/2,xmax:n===a?c-r*n:r/2,ymin:e.ymin,ymax:e.ymax,spatialReference:e.spatialReference}),m=0===n?u-h:n===a?t-f:u;f+=m,p.push(m);const y=s.disableWrapAround&&n>0?null:this._fetchPixels(d,m,i,s);o.push(y)}const d=(await Promise.all(o)).map((e=>e?.pixelBlock));let m=null;const y={width:t,height:i};return m=this.rasterJobHandler?(await this.rasterJobHandler.mosaicAndTransform({srcPixelBlocks:d,srcMosaicSize:y,destDimension:null,coefs:null,sampleSpacing:null,interpolation:"nearest",alignmentInfo:null,blockWidths:p},s)).pixelBlock:(0,V.z7)(d,y,{blockWidths:p}),{extent:e,srcExtent:(0,z._l)(e,this.rasterInfo.spatialReference,s.datumTransformation),pixelBlock:m}}async fetchRawPixels(e,t,i,s={}){t={x:Math.floor(t.x),y:Math.floor(t.y)};const n=await this._fetchRawTiles(e,t,i,s),{nativeExtent:r,nativePixelSize:a,storageInfo:o}=this.rasterInfo,l=2**e,c=a.x*l,u=a.y*l,h=new K.A({xmin:r.xmin+c*t.x,xmax:r.xmin+c*(t.x+i.width-1),ymin:r.ymax-u*(t.y+i.height-1),ymax:r.ymax-u*t.y,spatialReference:r.spatialReference});if(!n)return{extent:h,srcExtent:h,pixelBlock:null};const{pixelBlocks:f,mosaicSize:p}=n;if(1===f.length&&null!=f[0]&&f[0].width===i.width&&f[0].height===i.height)return{extent:h,srcExtent:h,pixelBlock:n.pixelBlocks[0]};const d=e>0?o.pyramidBlockWidth:o.blockWidth,m=e>0?o.pyramidBlockHeight:o.blockHeight,y={x:t.x%d,y:t.y%m};let g;return g=this.rasterJobHandler?(await this.rasterJobHandler.mosaicAndTransform({srcPixelBlocks:f,srcMosaicSize:p,destDimension:i,clipOffset:y,clipSize:i,coefs:null,sampleSpacing:null,interpolation:s.interpolation,alignmentInfo:null,blockWidths:null},s)).pixelBlock:(0,V.z7)(f,p,{clipOffset:y,clipSize:i}),{extent:h,srcExtent:h,pixelBlock:g}}fetchRawTile(e,t,i,s){throw new a.A("BaseRaster:read-not-implemented","fetchRawTile() is not implemented")}computeExtent(e){return(0,z._l)(this.rasterInfo.extent,e)}decodePixelBlock(e,t){return!this.rasterJobHandler||t.useCanvas?(0,U.D)(e,t):this.rasterJobHandler.decode({data:e,options:t})}async request(e,t,i=0){const{customFetchParameters:s}=this.ioConfig,{range:n,query:r,headers:a}=t;i=i??t.retryCount??this.ioConfig.retryCount;const o=n?{Range:`bytes=${n.from}-${n.to}`}:null;try{return await(0,_.A)(e,{...t,query:{...r,...s},headers:{...a,...o}})}catch(s){if(i>0)return i--,this.request(e,t,i);throw s}}getSliceIndex(e){const{multidimensionalInfo:t}=this.rasterInfo;return null==t||null==e||0===e.length?null:(0,B.NG)(e,t)}getTileExtentFromTileInfo(e,t,i,s){const n=s.lodAt(e);return this.getTileExtent({x:n.resolution,y:n.resolution},t,i,s.origin,s.spatialReference,s.size)}updateTileInfo(){const{storageInfo:e,spatialReference:t,extent:i,pixelSize:s}=this.rasterInfo,{pyramidResolutions:n}=e;if(!e.tileInfo){const r=[],a=e.maximumPyramidLevel||0;let o=(s.x+s.y)/2,l=1/.0254*96*o;for(let e=0;e<=a&&(r.unshift(new D.A({level:a-e,resolution:o,scale:l})),e!==a);e++)if(n){const t=(n[e].x+n[e].y)/2;l*=t/o,o=t}else o*=2,l*=2;const c=new L.A({x:i.xmin,y:i.ymax,spatialReference:t});e.tileInfo=new C.A({origin:c,size:[e.blockWidth,e.blockHeight],spatialReference:t,lods:r}),e.isVirtualTileInfo=!0}}createRemoteDatasetStorageInfo(e,t=512,i=512,s){const{width:n,height:r,nativeExtent:a,pixelSize:o,spatialReference:l}=e,c=new L.A({x:a.xmin,y:a.ymax,spatialReference:l});null==s&&(s=Math.max(0,Math.round(Math.log(Math.max(n,r))/Math.LN2-8)));const u=this.computeBlockBoundary(a,512,512,{x:a.xmin,y:a.ymax},[o],s);e.storageInfo=new E.A({blockWidth:t,blockHeight:i,pyramidBlockWidth:t,pyramidBlockHeight:i,origin:c,firstPyramidLevel:1,maximumPyramidLevel:s,blockBoundary:u})}async computeBestPyramidLevelForLocation(e,t={}){return 0}computeBlockBoundary(e,t,i,s,n,r=0,a=2){if(1===n.length&&r>0){n=[...n];let{x:e,y:t}=n[0];for(let i=0;i<r;i++)e*=a,t*=a,n.push({x:e,y:t})}const o=[],{x:l,y:c}=s;for(let s=0;s<n.length;s++){const{x:r,y:a}=n[s];o.push({minCol:Math.floor((e.xmin-l+.1*r)/t/r),maxCol:Math.floor((e.xmax-l-.1*r)/t/r),minRow:Math.floor((c-e.ymax+.1*a)/i/a),maxRow:Math.floor((c-e.ymin-.1*a)/i/a)})}return o}getPyramidPixelSize(e){const{nativePixelSize:t}=this.rasterInfo,{pyramidResolutions:i,pyramidScalingFactor:s}=this.rasterInfo.storageInfo;if(0===e)return t;if(null!=i&&i.length)return i[e-1];const n=s**e;return{x:t.x*n,y:t.y*n}}identifyPixelLocation(e,t,i,s){const{spatialReference:n,nativeExtent:r,storageInfo:a}=this.rasterInfo,{maximumPyramidLevel:o,origin:l,transposeInfo:c}=a,u=s&&null!=c?c.tileSize[0]:a.blockWidth,h=s&&null!=c?c.tileSize[1]:a.blockHeight,f=(0,z._I)(e,n,i);if(!r.intersects(f))return null;if(t<0||t>o)return null;const p=this.getPyramidPixelSize(t),{x:d,y:m}=p,y=(l.y-f.y)/m/h,g=(f.x-l.x)/d/u,x=Math.min(h-1,Math.floor((y-Math.floor(y))*h)),w=Math.min(u-1,Math.floor((g-Math.floor(g))*u));return{pyramidLevel:t,row:Math.floor(y),col:Math.floor(g),rowOffset:x,colOffset:w,blockWidth:u,srcLocation:f}}getTileExtent(e,t,i,s,n,r){const[a,o]=r,l=s.x+i*a*e.x,c=l+a*e.x,u=s.y-t*o*e.y,h=u-o*e.y;return new K.A({xmin:l,xmax:c,ymin:h,ymax:u,spatialReference:n})}getBlockWidthHeight(e){return{blockWidth:e>0?this.rasterInfo.storageInfo.pyramidBlockWidth:this.rasterInfo.storageInfo.blockWidth,blockHeight:e>0?this.rasterInfo.storageInfo.pyramidBlockHeight:this.rasterInfo.storageInfo.blockHeight}}isBlockOutside(e,t,i){const s=this.rasterInfo.storageInfo.blockBoundary[e];return!s||s.maxRow<t||s.maxCol<i||s.minRow>t||s.minCol>i}updateImageSpaceRasterInfo(e){const{pixelSize:t}=e,{width:i,height:s}=e,n=Q.A.WebMercator;e.spatialReference=n,e.extent=e.nativeExtent=new K.A({xmin:-.5,ymax:.5,xmax:i-.5,ymin:.5-s,spatialReference:n}),e.isPseudoSpatialReference=!0,e.transform=null,e.pixelSize=new L.A({x:1,y:1,spatialReference:n});const{extent:r,storageInfo:a}=e;if(a){a.origin=new L.A({x:r.xmin,y:r.ymax,spatialReference:n});const{pyramidResolutions:i,tileInfo:s}=a;if(i&&i.forEach((e=>{e.x/=t.x,e.y/=t.y})),s){s.origin=a.origin;const t=(e.nativePixelSize.x+e.nativePixelSize.y)/2;s.lods.forEach(((e,i)=>{e.resolution=t*2**i,e.scale=96*e.resolution/.0254}))}}}async _fetchPixels(e,t,i,s={}){let n=(0,z.OM)(e);if(n>=2)return{extent:e,pixelBlock:null};const r=this._getSourceDataInfo(e,t,i,s),{pyramidLevel:a,srcResolution:o,srcExtent:l,srcWidth:c,srcHeight:u,ul:h}=r;if(0===c||0===u)return{extent:e,srcExtent:l,pixelBlock:null};const{rasterInfo:f}=this,p=f.transform,d="gcs-shift"===p?.type,m=null!=(0,z.FT)(e.spatialReference);!d&&m||(n=(0,z.OM)(r.srcExtent,d));const y=await this._fetchRawTiles(a,h,{width:c,height:u,wrapCount:n},s);if(!y)return{extent:e,srcExtent:l,pixelBlock:null};const g=f.storageInfo,x=a>0?g.pyramidBlockWidth:g.blockWidth,w=a>0?g.pyramidBlockHeight:g.blockHeight;let{x:_,y:v}=f.pixelSize;if(a>0){const{pyramidResolutions:e,pyramidScalingFactor:t}=g;if(null!=e&&e[a-1])({x:_,y:v}=e[a-1]);else{const e=t**a;_*=e,v*=e}}const b=f.spatialReference,I=new L.A({x:_,y:v,spatialReference:b}),R=x===c&&w===u&&h.x%x==0&&h.y%w==0,S=new L.A({x:(e.xmax-e.xmin)/t,y:(e.ymax-e.ymin)/i,spatialReference:e.spatialReference}),T=!e.spatialReference.equals(b),A=b.isGeographic?1e-9:1e-4,{datumTransformation:M}=s;if(!T&&R&&1===y.pixelBlocks.length&&x===t&&w===i&&function(e,t,i){return Math.abs(e.x-t.x)<i&&Math.abs(e.y-t.y)<i}(o,S,A))return{extent:e,srcExtent:l,srcTilePixelSize:I,pixelBlock:y.pixelBlocks[0]};const k=m&&null!=(0,z.FT)(l.spatialReference)&&this._hasNoneOrGCSShiftTransform,O=s.requestProjectedLocalDirections&&this.rasterInfo.dataType.startsWith("vector");O&&!this.rasterJobHandler&&await(0,z.Hh)();const F=this.rasterJobHandler?await this.rasterJobHandler.getProjectionOffsetGrid({projectedExtent:e,srcBufferExtent:y.extent,pixelSize:S.toJSON(),datumTransformation:M,rasterTransform:p,hasWrapAround:n>0||k,isAdaptive:!1!==this.ioConfig.optimizeProjectionAccuracy,includeGCSGrid:O},s):(0,z.l0)({projectedExtent:e,srcBufferExtent:y.extent,pixelSize:S,datumTransformation:M,rasterTransform:p,hasWrapAround:n>0||k,isAdaptive:!1,includeGCSGrid:O});let C;const P=!s.requestRawData,N={rows:F.spacing[0],cols:F.spacing[1]},D=this._hasNoneOrGCSShiftTransform?this._getRasterTileAlignmentInfo(a,y.extent.xmin):void 0,{pixelBlocks:E,mosaicSize:B,isPartiallyFilled:J}=y;let H=null;if(this.rasterJobHandler){const e=await this.rasterJobHandler.mosaicAndTransform({srcPixelBlocks:E,srcMosaicSize:B,destDimension:P?{width:t,height:i}:null,coefs:P?F.coefficients:null,sampleSpacing:P?N:null,projectDirections:O,gcsGrid:O?F.gcsGrid:null,isUV:"vector-uv"===this.rasterInfo.dataType,interpolation:s.interpolation,alignmentInfo:D,blockWidths:null},s);({pixelBlock:C,localNorthDirections:H}=e)}else{const e=(0,V.z7)(E,B,{alignmentInfo:D});C=P?(0,V.$i)(e,{width:t,height:i},F.coefficients,N,s.interpolation):e,O&&F.gcsGrid&&(H=(0,V.QF)({width:t,height:i},F.gcsGrid),C=(0,Y.Y2)(C,this.rasterInfo.dataType,H))}return s.requestRawData||O?{extent:e,srcExtent:l,srcTilePixelSize:I,pixelBlock:C,transformGrid:F,localNorthDirections:H,isPartiallyFilled:J}:{extent:e,srcExtent:l,srcTilePixelSize:I,pixelBlock:C}}async _fetchRawTiles(e,t,i,s){const{origin:n,blockBoundary:r}=this.rasterInfo.storageInfo,{blockWidth:a,blockHeight:o}=this.getBlockWidthHeight(e);let{x:l,y:c}=t,{width:u,height:h,wrapCount:f}=i;const p=this._getRasterTileAlignmentInfo(e,0);s.buffer&&(l-=s.buffer.cols,c-=s.buffer.rows,u+=2*s.buffer.cols,h+=2*s.buffer.rows);let d=0,m=0,y=0;f&&null!=p&&(({worldColumnCountFromOrigin:m,originColumnOffset:y,rightPadding:d}=p),m*p.blockWidth-d>=l+u&&(d=0));const g=Math.floor(l/a),x=Math.floor(c/o),w=Math.floor((l+u+d-1)/a),_=Math.floor((c+h+d-1)/o),v=r[e];if(!v)return null;const{minRow:b,minCol:I,maxCol:R,maxRow:S}=v;if(0===f&&(_<b||w<I||x>S||g>R))return null;const T=new Array;let A=!1;const M=null==this.ioConfig.allowPartialFill?s.allowPartialFill:this.ioConfig.allowPartialFill;for(let t=x;t<=_;t++)for(let i=g;i<=w;i++){let n=i;if(!s.disableWrapAround&&f&&null!=p&&m<=i&&(n=i-m-y),t>=b&&n>=I&&S>=t&&R>=n){const i=this._tileFetchQueue.push({pyramidLevel:e,row:t,col:n,options:s},{signal:s.signal});M?T.push(new Promise((e=>{i.then((t=>e(t))).catch((()=>{A=!0,e(null)}))}))):T.push(i)}else T.push(Promise.resolve(null))}if(0===T.length)return null;const k=await Promise.all(T),O={height:(_-x+1)*o,width:(w-g+1)*a},{spatialReference:F}=this.rasterInfo,C=this.getPyramidPixelSize(e),{x:P,y:N}=C;return{extent:new K.A({xmin:n.x+g*a*P,xmax:n.x+(w+1)*a*P,ymin:n.y-(_+1)*o*N,ymax:n.y-x*o*N,spatialReference:F}),pixelBlocks:k,mosaicSize:O,isPartiallyFilled:A}}_fetchRawTile(e,t,i,s){const n=this.rasterInfo.storageInfo.blockBoundary[e];if(!n)return Promise.resolve(null);const{minRow:r,minCol:a,maxCol:o,maxRow:l}=n;if(t<r||i<a||t>l||i>o)return Promise.resolve(null);const u=G(this.rasterId,s.sliceId),h=`${e}/${t}/${i}`;let f=W(u,s.registryId,h);if(null==f){const n=new AbortController;f=this.fetchRawTile(e,t,i,{...s,signal:n.signal}),j(u,s.registryId,h,f,n),f.catch((()=>Z(u,s.registryId,h)))}return s.signal&&(0,c.u7)(s,(()=>{q(u,s.registryId,h)})),f}_computeMagDirValues(e){const{bandCount:t,dataType:i}=this.rasterInfo;if((2!==t||"vector-magdir"!==i)&&"vector-uv"!==i||2!==e?.length||!e[0]?.length)return null;const s=e[0].length;if("vector-magdir"===i){const t=e[1].map((e=>(e+360)%360));return[e[0],t]}const[n,r]=e,a=[],o=[];for(let e=0;e<s;e++){const[t,i]=(0,Y.Lu)([n[e],r[e]]);a.push(t),o.push(i)}return[a,o]}_getRasterTileAlignmentInfo(e,t){return null==this._rasterTileAlignmentInfo&&(this._rasterTileAlignmentInfo=(0,z.DO)(this.rasterInfo)),null==this._rasterTileAlignmentInfo.pyramidsInfo?null:{startX:t,halfWorldWidth:this._rasterTileAlignmentInfo.halfWorldWidth,hasGCSSShiftTransform:this._rasterTileAlignmentInfo.hasGCSSShiftTransform,...this._rasterTileAlignmentInfo.pyramidsInfo[e]}}_getSourceDataInfo(e,t,i,s={}){const n={datumTransformation:s.datumTransformation,pyramidLevel:0,pyramidResolution:null,srcExtent:null,srcHeight:0,srcResolution:null,srcWidth:0,ul:{x:0,y:0}};s.srcResolution&&(n.srcResolution=s.srcResolution,this._updateSourceDataInfo(e,n));const r=this.rasterInfo.storageInfo.maximumPyramidLevel||0,{srcWidth:a,srcHeight:o,pyramidLevel:l}=n,c=a/t,u=o/i,h=l<r&&c*u>=16,f=l===r&&this._requireTooManySrcTiles(a,o,t,i);if(h||f||0===a||0===o){const a=new L.A({x:(e.xmax-e.xmin)/t,y:(e.ymax-e.ymin)/i,spatialReference:e.spatialReference});let o=(0,z.Wo)(a,this.rasterInfo.spatialReference,e,n.datumTransformation);const f=!o||s.srcResolution&&o.x+o.y<s.srcResolution.x+s.srcResolution.y;if(h&&s.srcResolution&&f){const e=Math.round(Math.log(Math.max(c,u))/Math.LN2)-1;if(r-l+3>=e){const t=2**e;o={x:s.srcResolution.x*t,y:s.srcResolution.y*t}}}o&&(n.srcResolution=o,this._updateSourceDataInfo(e,n))}return this._requireTooManySrcTiles(n.srcWidth,n.srcHeight,t,i)&&(n.srcWidth=0,n.srcHeight=0),n}_requireTooManySrcTiles(e,t,i,s){const{tileInfo:n}=this.rasterInfo.storageInfo,r=e/i,a=t/s;return Math.ceil(e/n.size[0])*Math.ceil(t/n.size[1])>=256*Math.max(1,(i+s)/1024)||r>8||a>8}_updateSourceDataInfo(e,t){t.srcWidth=0,t.srcHeight=0;const{rasterInfo:i}=this,s=i.spatialReference,{srcResolution:n,datumTransformation:r}=t,{pyramidLevel:a,pyramidResolution:o,excessiveReading:l}=(0,z.t$)(n,i,this.ioConfig.sampling);if(l)return;let c=t.srcExtent||(0,z._l)(e,s,r);if(null==c)return;const u=i.transform;u&&(c=u.inverseTransform(c)),t.srcExtent=c;const{x:h,y:f}=i.storageInfo.origin,p=Math.floor((c.xmin-h)/o.x+.1),d=Math.floor((f-c.ymax)/o.y+.1),m=Math.floor((c.xmax-h)/o.x-.1),y=Math.floor((f-c.ymin)/o.y-.1),g=c.width<.1*o.x?0:m-p+1,x=c.height<.1*o.y?0:y-d+1;t.pyramidLevel=a,t.pyramidResolution=o,t.srcWidth=g,t.srcHeight=x,t.ul={x:p,y:d}}_getRequestOptionsWithSliceId(e){return null!=this.rasterInfo.multidimensionalInfo&&null==e.sliceId&&(e={...e,sliceId:this.getSliceIndex(e.multidimensionalDefinition)}),e}_processIdentifyResult(e,t){const{srcLocation:i,position:s,pyramidLevel:n,useTransposedTile:r}=t,a=e.pixels[0].length/e.width/e.height;if(e.mask&&!e.mask[s])return{location:i,value:null};const{multidimensionalInfo:o}=this.rasterInfo;if(null==o||!r){const t=e.pixels.map((e=>e[s])),r={location:i,value:t,pyramidLevel:n},a=this._computeMagDirValues(t.map((e=>[e])));return a?.length&&(r.magdirValue=a.map((e=>e[0]))),r}let l=e.pixels.map((e=>e.slice(s*a,s*a+a))),c=this._computeMagDirValues(l);const{requestSomeSlices:u,identifyOptions:h}=t;let f=(0,B.QW)(o,h.transposedVariableName);if(u){const e=(0,B.xx)(f,h.multidimensionalDefinition,h.timeExtent);l=l.map((t=>e.map((e=>t[e])))),c=c?.map((t=>e.map((e=>t[e])))),f=e.map((e=>f[e]))}const p=e.noDataValues||this.rasterInfo.noDataValue,d={pixels:l,pixelType:e.pixelType};let m;return null!=p&&((0,$.Sp)(d,p),m=d.mask),{location:i,value:null,dataSeries:f.map(((e,t)=>{const i={value:0===m?.[t]?null:l.map((e=>e[t])),multidimensionalDefinition:e.multidimensionalDefinition.map((e=>new A.A({...e,isSlice:!0})))};return c?.length&&(i.magdirValue=[c[0][t],c[1][t]]),i})),pyramidLevel:n}}};(0,s._)([(0,h.MZ)()],te.prototype,"_rasterTileAlignmentInfo",void 0),(0,s._)([(0,h.MZ)()],te.prototype,"_tileFetchQueue",void 0),(0,s._)([(0,h.MZ)({readOnly:!0})],te.prototype,"_isGlobalWrappableSource",null),(0,s._)([(0,h.MZ)({readOnly:!0})],te.prototype,"_hasNoneOrGCSShiftTransform",null),(0,s._)([(0,h.MZ)()],te.prototype,"_openPromise",void 0),(0,s._)([(0,h.MZ)()],te.prototype,"rasterJobHandler",null),(0,s._)([(0,h.MZ)({readOnly:!0})],te.prototype,"rasterId",null),(0,s._)([(0,h.MZ)(T.OZ)],te.prototype,"url",null),(0,s._)([(0,h.MZ)({type:String,json:{write:!0}})],te.prototype,"datasetName",void 0),(0,s._)([(0,h.MZ)({type:String,json:{write:!0}})],te.prototype,"datasetFormat",void 0),(0,s._)([(0,h.MZ)()],te.prototype,"hasUniqueSourceStorageInfo",void 0),(0,s._)([(0,h.MZ)()],te.prototype,"rasterInfo",void 0),(0,s._)([(0,h.MZ)()],te.prototype,"ioConfig",void 0),(0,s._)([(0,h.MZ)()],te.prototype,"sourceJSON",void 0),te=(0,s._)([(0,d.$)("esri.layers.support.rasterDatasets.BaseRaster")],te);const ie=te;var se=i(83047),ne=i(14140);async function re(e,t,s){if("extent"===s.type)return function(e,t,i){const{width:s,height:n}=e,r=new Uint8Array(s*n),a=t.width/s,o=t.height/n;if(i.width/a<.5||i.height/o<.5)return new ne.A({pixelType:e.pixelType,width:s,height:n,mask:r,pixels:[...e.pixels]});const{xmin:l,xmax:c,ymin:u,ymax:h}=t,{xmin:f,xmax:p,ymin:d,ymax:m}=i,y=Math.max(l,f),g=Math.min(c,p),x=Math.max(u,d),w=Math.min(h,m),_=.5*a,v=.5*o;if(g-y<_||w-x<v||g<l+_||y>c-_||x>h-v||w<u+v)return new ne.A({pixelType:e.pixelType,width:s,height:n,mask:r,pixels:[...e.pixels]});const b=Math.max(0,(y-l)/a),I=Math.min(s,Math.max(0,(g-l)/a)),R=Math.max(0,(h-w)/o),S=Math.min(n,Math.max(0,(h-x)/o)),T=Math.round(b),A=Math.round(I)-1,M=Math.round(R),k=Math.round(S)-1;if(T===A&&b%1>.5&&I%1<.5||M===k&&R%1>.5&&S%1<.5)return new ne.A({pixelType:e.pixelType,width:s,height:n,mask:r,pixels:[...e.pixels]});if(0===T&&0===M&&A===s&&k===n)return e;const O=e.mask;for(let e=M;e<=k;e++)for(let t=T;t<=A;t++){const i=e*s+t;r[i]=O?O[i]:255}return new ne.A({pixelType:e.pixelType,width:s,height:n,mask:r,pixels:[...e.pixels]})}(e,t,s);const{width:n,height:r}=e,a=new Uint8Array(n*r),{contains:o,intersects:l}=await Promise.all([i.e(9930),i.e(3209)]).then(i.bind(i,33209));return l(t,s)?"polyline"===s.type?function(e,t,i){const{width:s,height:n}=e,r=new Uint8Array(s*n),a=t.width/s,o=t.height/n,{xmin:l,ymax:c}=t,{paths:u}=i,h=e.mask;for(let e=0;e<u.length;e++){const t=u[e];for(let e=0;e<t.length-1;e++){const[i,u]=t[e],[f,p]=t[e+1];let d=Math.floor((c-u)/o),m=Math.floor((c-p)/o);if(m<d){const e=d;d=m,m=e}d=Math.max(0,d),m=Math.min(n-1,m);const y=(f-i)/(p-u);for(let e=d;e<=m;e++){const t=e===d?Math.max(u,p):(n+1-e)*o,c=e===m?Math.min(u,p):t-o;let g=p===u?Math.floor((i-l)/a):Math.floor((y*(t-u)+i-l)/a),x=p===u?Math.floor((f-l)/a):Math.floor((y*(c-u)+i-l)/a);if(x<g){const e=g;g=x,x=e}const w=e*s;g=Math.max(0,g),x=Math.min(s-1,x);for(let e=w+g;e<=w+x;e++)r[e]=h?h[e]:255}}}return new ne.A({pixelType:e.pixelType,width:s,height:n,mask:r,pixels:[...e.pixels]})}(e,t,s):o(s,t)?e:function(e,t,i){if(!e)return e;const{width:s,height:n}=e,r=t.width/s,a=t.height/n,{xmin:o,ymax:l}=t;let c;if("extent"===i.type){const e=(i.xmin-o)/r,t=(i.xmax-o)/r,s=(l-i.ymax)/a,n=(l-i.ymin)/a;c=[[[e,s],[e,n],[t,n],[t,s],[e,s]]]}else c=i.rings.map((e=>e.map((([e,t])=>[(e-o)/r,(l-t)/a]))));const u=document.createElement("canvas");u.width=s,u.height=n;const h=u.getContext("2d");h.fillStyle="#f00",h.beginPath(),c.forEach((e=>{h.moveTo(e[0][0],e[0][1]);for(let t=0;t<e.length;t++)h.lineTo(e[t][0],e[t][1]);h.closePath()})),h.fill();const f=h.getImageData(0,0,s,n).data,p=e.mask,d=s*n,m=new Uint8Array(d);for(let e=0;e<d;e++)p&&!p[e]||(m[e]=f[4*e+3]>127?255:0);return new ne.A({pixelType:e.pixelType,width:s,height:n,mask:m,maskIsAlpha:!1,pixels:[...e.pixels]})}(e,t,s):new ne.A({pixelType:e.pixelType,width:n,height:r,mask:a,maskIsAlpha:!1,pixels:[...e.pixels]})}var ae=i(22671);let oe=class extends ie{constructor(){super(...arguments),this.datasetFormat="Function",this.tileType="Raster",this.rasterFunction=null,this._clippingGeometry=new Map}async fetchPixels(e,t,i,s={}){const{rasters:n,rasterIds:r}=this.primaryRasters;let a=!1;const{interpolation:o}=s,l=this.rasterFunction.flatWebGLFunctionChain?.hasFocalFunction;!s.requestRawData&&l&&(a=1===n.length&&!s.skipRasterFunction,s={...s,interpolation:"bilinear",requestRawData:a});const c=n.map((n=>n.fetchPixels(e,t,i,s))),u=await Promise.all(c),h=u.map((e=>e.pixelBlock)),f=a||s.requestRawData?u.map((e=>e.srcTilePixelSize)):null;if(s.skipRasterFunction||h.every((e=>null==e)))return u[0];const p=u.find((e=>null!=e.pixelBlock))?.extent??e;let d=this.rasterJobHandler?await this.rasterJobHandler.process({extent:p,primaryPixelBlocks:h,primaryPixelSizes:f,primaryRasterIds:r}):this.rasterFunction.process({extent:p,primaryPixelBlocks:h,primaryPixelSizes:f,primaryRasterIds:r});const{transformGrid:m}=u[0];if(!a||null==d||null==m){const e=s.noClip?null:this.getClippingGeometry(p.spatialReference);return s.noClip||s.requestRawData||null==d||!e||(d=await re(d,p,e)),{...u[0],pixelBlock:d}}const y={rows:m.spacing[0],cols:m.spacing[1]};let g;g=this.rasterJobHandler?(await this.rasterJobHandler.mosaicAndTransform({srcPixelBlocks:[d],srcMosaicSize:{width:d.width,height:d.height},destDimension:{width:t,height:i},coefs:m.coefficients,sampleSpacing:y,projectDirections:!1,gcsGrid:null,isUV:!1,interpolation:o,alignmentInfo:void 0,blockWidths:null},s)).pixelBlock:(0,V.$i)(d,{width:t,height:i},m.coefficients,y,o);const x=s.noClip?null:this.getClippingGeometry(e.spatialReference);return s.noClip||s.requestRawData||null==g||null==x||(g=await re(g,e,x)),{extent:e,srcExtent:u[0].srcExtent,pixelBlock:g}}getClippingGeometry(e){const t=this._clippingGeometry.get("0");if(!e||!t)return t;const i=function(e){return String(e.wkid??e.wkt??e.wkt2)}(e);let s=this._clippingGeometry.get(i);return null!=s||(s=e.equals(t.spatialReference)?t:(0,z.uk)(t,e),this._clippingGeometry.set(i,s)),s}async _open(e){const{rasterFunction:t}=this;this.primaryRasters?.rasters?.length?t.sourceRasters=this.primaryRasters.rasters:(this.primaryRasters=t.getPrimaryRasters(),this.rasterJobHandler&&this.primaryRasters.rasters?.forEach((e=>e.rasterJobHandler=this.rasterJobHandler)));const{rasters:i,rasterIds:s}=this.primaryRasters,n=i.map((t=>t.rasterInfo?void 0:t.open(e)));await Promise.all(n);const r=i.map((({rasterInfo:e})=>e)),o=t.bind({rasterInfos:r,rasterIds:s});if(t.rawSourceRasterInfos=r,!o.success||0===r.length)throw new a.A("raster-function:open",`cannot bind the function: ${o.error??""}`);const l="Table"===t.functionName?t:t.functionArguments?.raster;"Table"===l?.functionName&&(t.rasterInfo.attributeTable=ae.A.fromJSON(l.functionArguments.attributeTableAsRecordSet)),await this.syncJobHandler();const c=r[0];this.hasUniqueSourceStorageInfo=1===r.length||r.slice(1).every((e=>function(e,t){const{storageInfo:i,pixelSize:s,spatialReference:n,extent:r}=e,{storageInfo:a,pixelSize:o,spatialReference:l,extent:c}=t;return s.x===o.x&&s.y===o.y&&n.equals(l)&&r.equals(c)&&i.blockHeight===a.blockHeight&&i.blockWidth===a.blockWidth&&i.maximumPyramidLevel===a.maximumPyramidLevel}(e,c))),this.set("sourceJSON",i[0].sourceJSON),this.set("rasterInfo",t.rasterInfo),await this._updateClipGeometry()}async syncJobHandler(){return this.rasterJobHandler?.updateRasterFunction(this.rasterFunction)}async _updateClipGeometry(){const e=this.rasterFunction.getClippingGeometries()[0];let t=e?.clippingGeometry;if(t&&"inside"===e.clippingType){const{extent:e}=this.rasterInfo,{difference:s,densify:n}=await Promise.all([i.e(9930),i.e(3209)]).then(i.bind(i,33209));let r=n(P.A.fromExtent(e),2*(e.width+e.height)/40);r=(0,z.uk)(r,t.spatialReference),t=s(r,t)}this._clippingGeometry.clear(),t&&this._clippingGeometry.set("0",t)}};(0,s._)([(0,h.MZ)({type:String,json:{write:!0}})],oe.prototype,"datasetFormat",void 0),(0,s._)([(0,h.MZ)()],oe.prototype,"tileType",void 0),(0,s._)([(0,h.MZ)()],oe.prototype,"rasterFunction",void 0),(0,s._)([(0,h.MZ)()],oe.prototype,"primaryRasters",void 0),oe=(0,s._)([(0,d.$)("esri.layers.support.rasterDatasets.FunctionRaster")],oe);const le=oe;var ce=i(6049),ue=i(6952),he=i(12711),fe=i(85676),pe=i(22048),de=i(4095);const me=e=>{let t=class extends e{constructor(...e){super(...e),this._isConstructedFromFunctionRaster=!1,this._rasterJobHandler={instance:null,refCount:0,connectionPromise:null},this.bandIds=null,this.copyright=null,this.interpolation=null,this.multidimensionalSubset=null,this.raster=null,this.serviceRasterInfo=null,this.sourceJSON=null,this.spatialReference=null,this.symbolizer=null,this._isConstructedFromFunctionRaster="Function"===e[0]?.raster?.datasetFormat}get fullExtent(){return this.serviceRasterInfo?.extent}set multidimensionalDefinition(e){this._set("multidimensionalDefinition",e),this.updateRenderer()}set rasterFunction(e){"none"===e?.functionName?.toLowerCase()&&(e=void 0),this._set("rasterFunction",e),this.updateRasterFunction()}get rasterInfo(){return(0,v.Lx)(o.A.getLogger(this),"rasterInfo",{replacement:"serviceRasterInfo",version:"4.29",warnOnce:!0}),this._get("serviceRasterInfo")}set url(e){this._set("url",(0,S.Jf)(e,o.A.getLogger(this)))}get renderer(){if("imagery-tile"!==this.type)return this.internalRenderer;const{activePresetRendererName:e,presetRenderers:t}=this;if(e){const i=t?.find((({name:t})=>t===e));return i?.renderer.clone()}return this.internalRenderer}set renderer(e){"imagery-tile"===this.type&&(this.activePresetRendererName=null),this.internalRenderer=e}set internalRenderer(e){null==e&&null==this.rasterFunction?this._configDefaultRenderer("override"):(this._set("internalRenderer",e),this.updateRenderer())}readRenderer(e,t,i){const s=t?.layerDefinition?.drawingInfo?.renderer;return(0,w.LF)(s,i)||void 0}async convertVectorFieldData(e,t){const{serviceRasterInfo:i}=this;if(null==e||!i)return null;const s=this._rasterJobHandler.instance,n=i.dataType;return s?s.convertVectorFieldData({pixelBlock:e,dataType:n},t):(0,Y.FI)(e,n)}async computeStatisticsHistograms(e,t){await this.load(t),e=(0,f.PZ)(pe.A,e).clone();const{serviceRasterInfo:i}=this;if(null==i)throw new a.A("imagery-tile-mixin:compute-statistics-histograms","serviceRasterInfo must be specified");const{geometry:s}=e;if(null==s)throw new a.A("imagery-tile-mixin:compute-statistics-histograms","geometry must be specified");let n=s;const{spatialReference:r}=i;s.spatialReference.equals(r)||(await(0,z.Hh)(),n="extent"===s.type?(0,z._l)(s,r):(0,z.uk)(s,r));const o=e.pixelSize??new L.A({x:i.pixelSize.x,y:i.pixelSize.y,spatialReference:r}),{extent:l,width:c,height:u}=function(e,t,i,s=!0){const{spatialReference:n}=e,{x:r,y:a}=function(e,t){if(e.spatialReference.equals(t))return e;const i=(0,se.GA)(e.spatialReference),s=(0,se.GA)(t);if(i===s)return e;const n=i/s;return{x:e.x*n,y:e.y*n}}(i,n);let o,l,c;const u="extent"===t.type?t:t.extent;let{xmin:h,xmax:f,ymax:p,ymin:d}=u;const{xmin:m,ymax:y}=e.extent;return s?(h=m+(h>m?r*Math.round((h-m)/r):0),p=y-(p<y?a*Math.round((y-p)/a):0),f=m+(f>m?r*Math.round((f-m)/r):0),d=y-(d<y?a*Math.round((y-d)/a):0),o=new K.A({xmin:h,ymax:p,xmax:f,ymin:d,spatialReference:n}),l=Math.round(o.width/r),c=Math.round(o.height/a)):(l=Math.floor((f-h)/r+.8),c=Math.floor((p-d)/a+.8),h=m+(h>m?r*Math.floor((h-m)/r+.1):0),p=y-(p<y?a*Math.floor((y-p)/a+.1):0),f=h+l*r,d=p-c*a,o=new K.A({xmin:h,ymax:p,xmax:f,ymin:d,spatialReference:n})),{extent:o,width:l,height:c}}(i,n,o),h=await this.fetchPixels(l,c,u,{...t,interpolation:"nearest"});if(null==h.pixelBlock)throw new a.A("imagery-tile-mixin:compute-statistics-histograms","failed to fetch pixels");const p=await re(h.pixelBlock,l,n),d=this._rasterJobHandler.instance;return d?d.computeStatisticsHistograms({pixelBlock:p},t):(0,ue.eH)(p)}async createFlowMesh(e,t){const i=this._rasterJobHandler.instance;return i?i.createFlowMesh(e,t):(0,de.CW)(e.meshType,e.simulationSettings,e.flowData,null!=t.signal?t.signal:(new AbortController).signal)}normalizeRasterFetchOptions(e){const{multidimensionalInfo:t}=this.serviceRasterInfo??{};if(null==t)return e;let i=e.multidimensionalDefinition||this.multidimensionalDefinition;i?.length||(i=(0,B.fy)(this.raster.rasterInfo,{multidimensionalSubset:this.multidimensionalSubset}));const s=e.timeExtent||this.timeExtent;if(null!=i&&null!=s&&(null!=s.start||null!=s.end)){i=i.map((e=>e.clone()));const n=t.variables.find((({name:e})=>e===i[0].variableName))?.dimensions?.find((({name:e})=>"StdTime"===e)),r=i.find((({dimensionName:e})=>"StdTime"===e));if(!n||!r)return{...e,multidimensionalDefinition:null};const{start:a,end:o}=s,l=null==a?null:a.getTime(),c=null==o?null:o.getTime(),u=l??c,h=c??l;if(null!=n.values){const e=n.values.filter((e=>{if(Array.isArray(e)){if(u===h)return e[0]<=u&&e[1]>=u;const t=e[0]<=u&&e[1]>u||e[0]<h&&e[1]>=h,i=e[0]>=u&&e[1]<=h||e[0]<u&&e[1]>h;return t||i}return u===h?e===u:e>=u&&e<=h}));if(e.length){const t=e.sort(((e,t)=>{const i=Array.isArray(e)?e[0]:e,s=Array.isArray(e)?e[1]:e,n=Array.isArray(t)?t[0]:t,r=Array.isArray(t)?t[1]:t;return u===h?i-n:Math.abs(s-h)-Math.abs(r-h)}))[0];r.values=[t]}else i=null}else if(n.hasRegularIntervals&&n.extent){const[e,t]=n.extent;u>t||h<e?i=null:r.values=u===h?[u]:[Math.max(e,u),Math.min(t,h)]}}return null!=i&&(0,B.sx)(i,this.multidimensionalSubset)?{...e,multidimensionalDefinition:null}:{...e,multidimensionalDefinition:i}}async updateRasterFunction(){if(!this.loaded||"imagery-tile"!==this.type||!this.rasterFunction&&!this._cachedRasterFunctionJson||JSON.stringify(this.rasterFunction)===JSON.stringify(this._cachedRasterFunctionJson))return;if(this._isConstructedFromFunctionRaster&&"Function"===this.raster.datasetFormat){const e=this.raster.rasterFunction.toJSON();return!this.rasterFunction&&e&&this._set("rasterFunction",O.A.fromJSON(e)),void(this._cachedRasterFunctionJson=this.rasterFunction?.toJSON())}let e,t=this.raster,i=!1;"Function"===t.datasetFormat?(e=t.primaryRasters.rasters,t=e[0],i=!0):e=[t];const{rasterFunction:s}=this;if(s){const i={raster:t};e.length>1&&e.forEach((e=>i[e.url]=e));const n=(0,ce.vt)(s.functionDefinition?.toJSON()??s.toJSON(),i),r=new le({rasterFunction:n});r.rasterJobHandler=this._rasterJobHandler.instance,await r.open(),this._cachedRasterFunctionJson=this.rasterFunction?.toJSON(),this.raster=r}else this.raster=t,this._cachedRasterFunctionJson=null,await t.open();if(this._cachedRendererJson=null,!i&&!s)return;const{bandIds:n}=this,{bandCount:r}=this.raster.rasterInfo,a=n?.length?n.some((e=>e>=r)):r>=3;n&&(a||this.renderer&&"raster-stretch"!==this.renderer.type)&&this._set("bandIds",null),this._configDefaultRenderer("auto")}async updateRenderer(){const{loaded:e,symbolizer:t}=this;if(!e||!t||!this.renderer)return;const{rasterInfo:i}=this.raster,s=(0,B.ct)(i,{multidimensionalDefinition:this.multidimensionalDefinition,multidimensionalSubset:this.multidimensionalSubset}),n=s?.name,r=(0,he.$P)({...this.renderer.toJSON(),variableName:n});if(JSON.stringify(this._cachedRendererJson)===JSON.stringify(r))return;const a=this._rasterJobHandler.instance;a&&(t.rasterInfo=(0,he.m7)(i,n),t.rendererJSON=r,t.bind(),await a.updateSymbolizer(t),this._cachedRendererJson=r)}async applyRenderer(e,t){const i=e?.pixelBlock;if(!(null!=i&&i.pixels&&i.pixels.length>0))return null;let s;await this.updateRenderer();const n=this._rasterJobHandler.instance,r=this.bandIds??[];return s=n?await n.symbolize({...e,simpleStretchParams:t,bandIds:r}):this.symbolizer.symbolize({...e,simpleStretchParams:t,bandIds:r}),s}getTileUrl(e,t,i){return"RasterTileServer"===this.raster.datasetFormat?`${this.url}/tile/${e}/${t}/${i}`:""}getCompatibleTileInfo(e,t,i=!1){if(!this.loaded||null==t)return null;if(i&&e.equals(this.spatialReference))return this.tileInfo;const s=(0,R.Vp)(e);return C.A.create({size:256,spatialReference:e,origin:s?{x:s.origin[0],y:s.origin[1]}:{x:t.xmin,y:t.ymax}})}getCompatibleFullExtent(e){return this.loaded?(this._compatibleFullExtent?.spatialReference.equals(e)||(this._compatibleFullExtent=this.raster.computeExtent(e)),this._compatibleFullExtent):null}async fetchTile(e,t,s,n={}){if(i(this),n.requestAsImageElement){const i=this.getTileUrl(e,t,s);return(0,_.A)(i,{responseType:"image",query:{...this.refreshParameters,...this.raster.ioConfig.customFetchParameters},signal:n.signal}).then((e=>e.data))}const{serviceRasterInfo:r}=this;if(null!=r.multidimensionalInfo&&null==(n=this.normalizeRasterFetchOptions(n)).multidimensionalDefinition){const i=n.tileInfo||r.storageInfo.tileInfo;return{extent:this.raster.getTileExtentFromTileInfo(e,t,s,i),pixelBlock:null}}return await this._initJobHandler(),await this.updateRasterFunction(),"raster-shaded-relief"===this.renderer?.type&&(n={...n,buffer:{cols:1,rows:1}}),this.raster.fetchTile(e,t,s,n)}async fetchPixels(e,t,i,s={}){return null!=this.serviceRasterInfo.multidimensionalInfo&&null==(s=this.normalizeRasterFetchOptions(s)).multidimensionalDefinition?{extent:e,pixelBlock:null}:(await this._initJobHandler(),await this.updateRasterFunction(),t=Math.round(t),i=Math.round(i),this.raster.fetchPixels(e,t,i,s))}async identify(e,t={}){await this.load();const{raster:i,serviceRasterInfo:s}=this;if(null!=s?.multidimensionalInfo&&!(s.hasMultidimensionalTranspose&&((0,B.DY)(t.multidimensionalDefinition)||t.transposedVariableName||t.timeExtent)||null!=(t=this.normalizeRasterFetchOptions(t)).multidimensionalDefinition))return{location:e,value:null};const n=this.multidimensionalSubset?.areaOfInterest;if(n&&!n.contains(e))throw new a.A("imagery-tile-mixin:identify","the request cannot be fulfilled when falling outside of the multidimensional subset");return i.identify(e,t)}increaseRasterJobHandlerUsage(){this._rasterJobHandler.refCount++}decreaseRasterJobHandlerUsage(){this._rasterJobHandler.refCount--,this._rasterJobHandler.refCount<=0&&this._shutdownJobHandler()}hasStandardTime(){const e=this.serviceRasterInfo?.multidimensionalInfo;if(null==e||"standard-time"!==this.serviceRasterInfo?.dataType)return!1;const t=this.multidimensionalDefinition,i=t?.[0]?.variableName;return e.variables.some((e=>e.name===i&&(!t?.[0].dimensionName||e.dimensions.some((e=>"StdTime"===e.name)))))}getStandardTimeValue(e){return new Date(24*(e-25569)*3600*1e3).toString()}getMultidimensionalSubsetVariables(e){const t=e??this.serviceRasterInfo?.multidimensionalInfo;return(0,B.z2)(this.multidimensionalSubset,t)}_configDefaultSettings(){this._configDefaultInterpolation(),this.multidimensionalDefinition||(this.multidimensionalDefinition=(0,B.fy)(this.raster.rasterInfo,{multidimensionalSubset:this.multidimensionalSubset})),this.rasterFunction&&"Function"===this.raster.datasetFormat&&(this._cachedRasterFunctionJson=this.rasterFunction.toJSON()),this._configDefaultRenderer()}_initJobHandler(){if(null!=this._rasterJobHandler.connectionPromise)return this._rasterJobHandler.connectionPromise;const e=new F.A;return this._rasterJobHandler.connectionPromise=e.initialize().then((async()=>{i(this),this._rasterJobHandler.instance=e,this.raster.rasterJobHandler=e,"Function"===this.raster.datasetFormat&&this.raster.syncJobHandler(),this.rasterFunction&&await this.updateRasterFunction().catch((()=>{})),this.renderer&&this.updateRenderer()})).catch((()=>{})),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,this.raster&&(this.raster.rasterJobHandler=null)}_configDefaultInterpolation(){if(null==this.interpolation){i(this);const{raster:e}=this,t=(0,he.w6)(e.rasterInfo,e.tileType,this.sourceJSON?.defaultResamplingMethod);this._set("interpolation",t)}}_configDefaultRenderer(e="no"){i(this);const{rasterInfo:t}=this.raster,s=(0,B.ct)(t,{multidimensionalDefinition:this.multidimensionalDefinition,multidimensionalSubset:this.multidimensionalSubset}),n=s?.name,r=(0,he.I8)({variableName:n,rasterFunctionName:this.rasterFunction?.functionName,presetRenderers:this.presetRenderers});if(!this.bandIds&&t.bandCount>1&&(this.bandIds=r?.bandIds??(0,he.ci)(t)),!this.renderer||"override"===e){const e=(0,he.Mm)(this.raster),i=r?.renderer??(0,he.PD)(t,{bandIds:this.bandIds,variableName:n,rasterFunctionColorRamp:e}),s=t.statistics,a=s&&s.length>0?s[0]:null,o=a?.max??0,l=a?.min??0;"WCSServer"===this.raster.datasetFormat&&"raster-stretch"===i.type&&(o>1e24||l<-1e24)&&(i.dynamicRangeAdjustment=!0,i.customStatistics=null,"none"===i.stretchType&&(i.stretchType="min-max")),this.renderer=i}const a=(0,he.$P)({...this.renderer.toJSON(),variableName:n}),l=(0,he.m7)(t,n);this.symbolizer?(this.symbolizer.rendererJSON=a,this.symbolizer.rasterInfo=l):this.symbolizer=new fe.A({rendererJSON:a,rasterInfo:l});const c=this.symbolizer.bind();if(c.success){if("auto"===e){const{colormap:e}=this.raster.rasterInfo,t=this.renderer;if(null!=e&&"raster-colormap"===t.type){const e=(0,he.PD)(this.raster.rasterInfo);JSON.stringify(e)!==JSON.stringify(t)&&this._configDefaultRenderer("override")}else if("raster-stretch"===t.type){const e=this.bandIds?.length,i=t.customStatistics?.length;!t.dynamicRangeAdjustment&&i&&e&&i!==e&&this._configDefaultRenderer("override")}}}else o.A.getLogger(this).warn("imagery-tile-mixin",c.error||"The given renderer is not supported by the layer."),"auto"===e&&this._configDefaultRenderer("override")}};function i(e){if(!e.raster||!e.serviceRasterInfo)throw new a.A("imagery-tile","no raster")}return(0,s._)([(0,h.MZ)({clonable:!1})],t.prototype,"_cachedRendererJson",void 0),(0,s._)([(0,h.MZ)({clonable:!1})],t.prototype,"_cachedRasterFunctionJson",void 0),(0,s._)([(0,h.MZ)({clonable:!1})],t.prototype,"_compatibleFullExtent",void 0),(0,s._)([(0,h.MZ)({clonable:!1})],t.prototype,"_isConstructedFromFunctionRaster",void 0),(0,s._)([(0,h.MZ)({clonable:!1})],t.prototype,"_rasterJobHandler",void 0),(0,s._)([(0,h.MZ)({type:[f.jz],json:{write:{overridePolicy(){return{enabled:!this.loaded||"Raster"===this.raster.tileType||"0,1,2"!==this.bandIds?.join(",")}}}}})],t.prototype,"bandIds",void 0),(0,s._)([(0,h.MZ)({json:{origins:{service:{read:{source:"copyrightText"}}}}})],t.prototype,"copyright",void 0),(0,s._)([(0,h.MZ)({json:{read:!1}})],t.prototype,"fullExtent",null),(0,s._)([(0,h.MZ)({json:{write:{overridePolicy(){return{enabled:!this.loaded||"Raster"===this.raster.tileType||"bilinear"!==this.interpolation}}}}}),(0,b.e)(k.SZ)],t.prototype,"interpolation",void 0),(0,s._)([(0,h.MZ)()],t.prototype,"ioConfig",void 0),(0,s._)([(0,h.MZ)({type:[A.A],json:{write:!0}})],t.prototype,"multidimensionalDefinition",null),(0,s._)([(0,h.MZ)({type:M.A,json:{write:!0}})],t.prototype,"multidimensionalSubset",void 0),(0,s._)([(0,h.MZ)()],t.prototype,"raster",void 0),(0,s._)([(0,h.MZ)({type:O.A,json:{name:"renderingRule",write:!0}})],t.prototype,"rasterFunction",null),(0,s._)([(0,h.MZ)({readOnly:!0})],t.prototype,"rasterInfo",null),(0,s._)([(0,h.MZ)()],t.prototype,"serviceRasterInfo",void 0),(0,s._)([(0,h.MZ)()],t.prototype,"sourceJSON",void 0),(0,s._)([(0,h.MZ)({readOnly:!0,type:Q.A,json:{read:!1}})],t.prototype,"spatialReference",void 0),(0,s._)([(0,h.MZ)({type:C.A})],t.prototype,"tileInfo",void 0),(0,s._)([(0,h.MZ)(T.OZ)],t.prototype,"url",null),(0,s._)([(0,h.MZ)()],t.prototype,"renderer",null),(0,s._)([(0,h.MZ)({types:w.uy,json:{name:"layerDefinition.drawingInfo.renderer",write:{overridePolicy(){const e="raster-stretch"===this.renderer?.type&&"none"===this.renderer.stretchType&&!this.renderer.useGamma;return{enabled:!this.loaded||"Raster"===this.raster.tileType||!e}}},origins:{"web-scene":{types:w.Gj,name:"layerDefinition.drawingInfo.renderer",write:{overridePolicy:e=>({enabled:e&&"vector-field"!==e.type&&"flow"!==e.type})}}}}})],t.prototype,"internalRenderer",null),(0,s._)([(0,I.w)("internalRenderer")],t.prototype,"readRenderer",null),(0,s._)([(0,h.MZ)({clonable:!1})],t.prototype,"symbolizer",void 0),t=(0,s._)([(0,d.$)("esri.layers.mixins.ImageryTileMixin")],t),t};var ye=i(16131),ge=i(8303),xe=i(56551),we=i(54310),_e=i(25036),ve=i(82935),be=i(20437),Ie=i(68197),Re=i(73444);function Se(e){return["x","e","east","long","longitude"].includes(e.toLowerCase())}function Te(e){return["y","n","west","lat","latitude"].includes(e.toLowerCase())}function Ae(e){const{axes:t}=e.domain,i=Object.keys(t),s=[],n=[];let r=-1,a=-1,o=[];for(let e=0;e<i.length;e++){const l=i[e];Se(l)?r=e:Te(l)&&(a=e);const c=t[l],u=[];if("values"in c){c.values.forEach((e=>u.push("string"==typeof e?new Date(e).getTime():e)));const e=u[1]-u[0];s.push([u[0]-.5*e,u[u.length-1]+.5*e]),n.push(e)}else{const{start:e,stop:t,num:i}=c,r=(t-e)/(i-1);s.push([e-.5*r,t+.5*r]),n.push(r);for(let t=0;t<i;t++)u.push(e+r*t)}o.push({name:l,values:u,extent:[u[0],u[u.length-1]]})}r>-1&&-1===a?a=0===r?1:0:a>-1&&-1===r?r=0===a?1:0:-1===a&&-1===r&&(r=0,a=1),o=o.filter(((e,t)=>!(t===r||t===a)));const{referencing:l}=e.domain,c=l.find((e=>e.coordinates.includes(i[r]))).system.id,u=c?.slice(c.lastIndexOf("/")+1),h=null==u||"CRS84"===u?4326:Number(u),f=new Q.A({wkid:h}),[p,d]=s[r],[m,y]=s[a],g=new K.A({xmin:p,xmax:d,ymin:m,ymax:y,spatialReference:f});return{width:Math.round(g.width/n[r]),height:Math.round(g.height/n[a]),extent:g,dimensions:o}}function Me(e){const t=(0,Re.Z0)();return t?e[t]??Object.values(e)[0]:Object.values(e)[0]}function ke(){return Math.round(255*Math.random())}function Oe(e){let t=Number.MAX_VALUE,i=-Number.MAX_VALUE;for(let s=0;s<e.length;s++){const n=e[s];null!=n&&(n<t&&(t=n),n>i&&(i=n))}return(0,$.X1)(t,i)}function Fe(e,t,i){const s=e.map(((e,i)=>({name:e,count:t[i]}))).sort(((e,t)=>e.name>t.name?-1:1)),n=(r=1,e=>r*=e.count);var r;const a=[...s.slice(1),{name:"",count:1}].reverse().map(n).reverse();let o=0;for(let n=e.length-1;n>=0;n--)o+=a[s.findIndex((({name:t})=>t===e[n]))]*(i%t[n]),i=Math.floor(i/t[n]);return o}var Ce=i(87186);let Pe=class extends ie{constructor(){super(...arguments),this.datasetFormat="MEMORY",this.source=null}get url(){return""}fetchRawTile(e,t,i,s={}){if(!this._pixelBlockTiles){const{rasterInfo:n}=this,[r,a]=n.storageInfo.tileInfo.size,{sliceId:o}=s,{pixelBlocks:l}=this.source,c={pixelBlock:null==o?l[0]:l[o],useBilinear:"thematic"!==n.dataType,tileSize:{width:r,height:a},level:e,row:t,col:i},u=this.rasterJobHandler?this.rasterJobHandler.clipTile(c,s):(0,V.J$)(c);return Promise.resolve(u)}const n=this._pixelBlockTiles.get(`${e}/${t}/${i}`);return Promise.resolve(n)}async _open(e){const t=this.source,{pixelBlocks:i,attributeTable:s,statistics:n,histograms:r,name:a,nativeExtent:o,transform:l}=t,c=i[0],{width:u,height:h,pixelType:f}=c,p=t.extent??new K.A({xmin:-.5,ymin:.5,xmax:u-.5,ymax:h-.5,spatialReference:new Q.A({wkid:3857})}),d=t.isPseudoSpatialReference??!t.extent,m={x:p.width/u,y:p.height/h},y={...t.keyProperties};s&&(y.DataType="Thematic");const g=new Ce.A({width:u,height:h,pixelType:f,extent:p,nativeExtent:o,attributeTable:s,transform:l,pixelSize:m,spatialReference:p.spatialReference,bandCount:c.pixels.length,keyProperties:y,multidimensionalInfo:t.multidimensionalInfo,statistics:n,isPseudoSpatialReference:d,histograms:r});this.ioConfig.skipMapInfo&&this.updateImageSpaceRasterInfo(g),this.createRemoteDatasetStorageInfo(g,512,512),this._set("rasterInfo",g),this.updateTileInfo(),g.multidimensionalInfo?await this._buildMDimStats(t.pixelBlocks,g.multidimensionalInfo):await this._buildInMemoryRaster(c,{width:512,height:512},e),g.multidimensionalInfo||(this.source=null),this.datasetName=a}async _buildInMemoryRaster(e,t,i){const{rasterInfo:s}=this,n=s.storageInfo.maximumPyramidLevel??0,r="thematic"!==s.dataType,o=this.rasterJobHandler?this.rasterJobHandler.split({pixelBlock:e,tileSize:t,maximumPyramidLevel:n,useBilinear:r},i):Promise.resolve((0,V.lD)(e,t,n,r)),l=null!=s.statistics,u=null!=s.histograms,h=this.ioConfig.skipStatistics||l?Promise.resolve({statistics:null,histograms:null}):this.rasterJobHandler?this.rasterJobHandler.estimateStatisticsHistograms({pixelBlock:e},i):Promise.resolve((0,ue.f4)(e)),f=await(0,c.Lx)([o,h]);if(!f[0].value&&f[1].value)throw new a.A("inmemory-raster:open","failed to build in memory raster");this._pixelBlockTiles=f[0].value,l||(s.statistics=f[1].value?.statistics),u||(s.histograms=f[1].value?.histograms)}async _buildMDimStats(e,t,i){for(let s=0;s<t.variables.length;s++){const n=t.variables[s];if(n.statistics)continue;const r=n.dimensions.map((e=>new A.A({variableName:n.name,dimensionName:e.name,values:[e.values?.[0]??e.extent?.[0]],isSlice:!0}))),a=(0,B.NG)(r,t),o=null==a?null:e[a];if(null==o)continue;const l=this.rasterJobHandler?await this.rasterJobHandler.computeStatisticsHistograms({pixelBlock:o},i):(0,ue.eH)(o);n.statistics=l.statistics,n.histograms||(n.histograms=l.histograms)}}};(0,s._)([(0,h.MZ)({type:String,json:{write:!0}})],Pe.prototype,"datasetFormat",void 0),(0,s._)([(0,h.MZ)()],Pe.prototype,"source",void 0),(0,s._)([(0,h.MZ)()],Pe.prototype,"url",null),Pe=(0,s._)([(0,d.$)("esri.layers.support.rasterDatasets.InMemoryRaster")],Pe);const Ne=Pe;let De=class extends ie{constructor(){super(...arguments),this.datasetFormat="CovJSON"}fetchRawTile(e,t,i,s={}){return this._inMemoryRaster.fetchRawTile(e,t,i,s)}async _open(e){const{extent:t,pixelBlocks:i,multidimensionalInfo:s,attributeTable:n,bandNames:r}=await this._fetchData(e),{statistics:a,histograms:o}=(0,ue.eH)(i[0]),l=r?.map((e=>({BandName:e}))),c={DataType:n?"Thematic":s?"Scientific":"Generic",BandProperties:l},u=new Ne({source:{extent:t,pixelBlocks:i,attributeTable:n?ae.A.fromJSON(n):null,multidimensionalInfo:s,statistics:a,histograms:o,keyProperties:c,isPseudoSpatialReference:!1}});await u.open(),this._inMemoryRaster=u;const h=this.source?"":this.url.slice(this.url.lastIndexOf("/")+1);this._set("datasetName",h.slice(0,h.indexOf("."))),this._set("rasterInfo",u.rasterInfo)}async _fetchData(e){const t=this.source??(await this.request(this.url,{signal:e?.signal})).data,i="imagery-tile-layer:open-coverage-json";if("coverage"!==t.type?.toLowerCase()||"grid"!==t.domain?.domainType?.toLowerCase())throw new a.A(i,"Only coverage with Grid domain type is supported");if(!t.ranges)throw new a.A(i,"Missing ranges in the grid coverage data");if(!t.domain.referencing?.length)throw new a.A(i,"Missing domain referencing in the grid coverage data");const s=Object.values(t.ranges);for(let e=0;e<s.length;e++){const{axisNames:t,shape:n,type:r,values:o}=s[e];if(!("ndarray"===r.toLowerCase()&&o?.length&&t?.length&&n?.length))throw new a.A(i,"Only ranges with valid NdArray, axisNames, shape, and inline values are supported");if(!Se(t[t.length-1])||!Te(t[t.length-2]))throw new a.A(i,"Only row-major ordered pixel values are supported. X axis must be the last axis.")}return function(e){const{width:t,height:i,extent:s,dimensions:n}=Ae(e),{ranges:r}=e,a=Object.keys(r).sort(((e,t)=>e<t?-1:1)),o=[];for(let e=0;e<a.length;e++){const t=a[e];n?.length&&o.push({name:t,dimensions:n})}const l=function(e){const t={},{parameters:i}=e;if(!i)return t;for(const[e,s]of Object.entries(i)){const{type:i,description:n,unit:r,categoryEncoding:a,observedProperty:o}=s;if("Parameter"===i&&(t[e]={},n&&(t[e].description=Me(n)),r&&(t[e].unit=r.label?Me(r.label):null,t[e].symbol=r.symbol?.value),a)){const i=Object.entries(a).map(((e,t)=>({OID:t,Value:Number(e[1]),ClassName:e[0].slice(e[0].lastIndexOf("/")+1),Count:1})));let s=!1;o?.categories?.length&&(o.categories.forEach((e=>{if(!e.id)return;const t=e.id.slice(e.id.lastIndexOf("/")+1),n=i.find((e=>e.ClassName===t));if(!n)return;const r=e.label?Me(e.label):null;if(n.Label=r,e.preferredColor){const t=Ie.A.fromHex(e.preferredColor);t&&(s=!0,n.Red=t.r,n.Green=t.g,n.Blue=t.b)}})),s&&i.forEach((e=>{null==e.Red&&(e.Red=ke(),e.Green=ke(),e.Blue=ke())})));const n={objectIdFieldName:"",fields:[{name:"OID",type:"esriFieldTypeOID",alias:"OID",domain:null},{name:"Value",type:"esriFieldTypeInteger",alias:"Value",domain:null},{name:"Count",type:"esriFieldTypeDouble",alias:"Count",domain:null},{name:"ClassName",type:"esriFieldTypeString",alias:"ClassName",domain:null,length:50},{name:"Label",type:"esriFieldTypeString",alias:"Label",domain:null,length:50}],features:i.map((e=>({attributes:e})))};s&&n.fields.push({name:"Red",type:"esriFieldTypeInteger",alias:"Red",domain:null},{name:"Green",type:"esriFieldTypeInteger",alias:"Green",domain:null},{name:"Blue",type:"esriFieldTypeInteger",alias:"Blue",domain:null}),t[e].attributeTable=n}}return t}(e);o.forEach((e=>l[e.name]&&Object.assign(e,l[e.name])));const c=o.length?{variables:o}:void 0,u=[];for(let e=0;e<a.length;e++){const s=a[e],{values:o,dataType:l,axisNames:c,shape:h}=r[s],f=h.length>2?e*h.slice(0,-2).reduce(((e,t)=>e*t)):0,p=c.slice(0,-2),d=h.slice(0,-2),m="float"===l?"f32":Oe(o),y=t*i,g=o.length/y;for(let s=0;s<g;s++){const r=ne.A.createEmptyBand(m,y),a=new Uint8Array(y).fill(255);let l=!1;const c=s*y;for(let e=0;e<y;e++){const t=o[c+e];null==t?(a[e]=0,l=!0):r[e]=t}if(0===e||n?.length){const e=new ne.A({width:t,height:i,mask:l?a:null,pixels:[r],pixelType:m});e.updateStatistics(),n?.length?u[Fe(p,d,s)+f]=e:u.push(e)}else{const e=u[s];e.pixels.push(r),l?e.mask&&(e.mask=ne.A.combineBandMasks([e.mask,a])):e.mask=l?a:null}}}const h=Object.values(l).find((e=>e.attributeTable))?.attributeTable;return{extent:s,pixelBlocks:u,multidimensionalInfo:c,attributeTable:h,bandNames:c?void 0:a}}(t)}};(0,s._)([(0,h.MZ)({type:String,json:{write:!0}})],De.prototype,"datasetFormat",void 0),(0,s._)([(0,h.MZ)({constructOnly:!0})],De.prototype,"source",void 0),De=(0,s._)([(0,d.$)("esri.layers.support.rasterDatasets.CovJSONRaster")],De);const Ee=De;var Be=i(4576);function ze(e,t){if(!e||!t)return[];let i=t;t.includes("/")?(i=t.slice(0,t.indexOf("/")),t=t.slice(t.indexOf("/")+1)):t="";const s=[];if(t){const n=ze(e,i);for(let e=0;e<n.length;e++)ze(n[e],t).forEach((e=>s.push(e)));return s}const n=e.getElementsByTagNameNS("*",i);if(!n||0===n.length)return[];for(let e=0;e<n.length;e++)s.push(n[e]||n.item(e));return s}function Le(e,t){if(!e||!t)return null;let i=t;t.includes("/")?(i=t.slice(0,t.indexOf("/")),t=t.slice(t.indexOf("/")+1)):t="";const s=ze(e,i);return s.length>0?t?Le(s[0],t):s[0]:null}function Je(e,t=null){const i=t?Le(e,t):e;let s;return i?(s=i.textContent||i.nodeValue,s?s.trim():null):null}function He(e,t){return function(e,t){const i=ze(e,t),s=[];let n;for(let e=0;e<i.length;e++)n=i[e].textContent||i[e].nodeValue,n&&(n=n.trim(),""!==n&&s.push(n));return s}(e,t).map((e=>Number(e)))}function Ge(e,t){const i=Je(e,t);return Number(i)}function qe(e,t){const i=e?.nodeName?.toLowerCase(),s=t.toLowerCase();return i.slice(i.lastIndexOf(":")+1)===s}var We=i(21312);function je(e,t){if(!e||!t)return null;const i=[];for(let s=0;s<e.length;s++)i.push(e[s]),i.push(t[s]);return i}function Ze(e){if(!e)return null;let t=Number(e);if(!isNaN(t)&&0!==t)return new Q.A({wkid:t});if(e=String(e).trim(),(0,R.jp)(e))return new Q.A({wkt2:e});const i=e.toUpperCase();if(i.startsWith("COMPD_CS")){if(!i.includes("VERTCS")||!i.includes("GEOGCS")&&!i.startsWith("PROJCS"))return null;const s=i.indexOf("VERTCS"),n=i.indexOf("PROJCS"),r=n>-1?n:i.indexOf("GEOGCS");if(-1===r)return null;const a=e.slice(r,e.lastIndexOf("]",s)+1).trim(),o=e.slice(s,e.lastIndexOf("]")).trim();t=$e(a);const l=new Q.A(t?{wkid:t}:{wkt:a}),c=$e(o);return c&&(l.vcsWkid=c),l}return i.startsWith("GEOGCS")||i.startsWith("PROJCS")?(t=$e(e),new Q.A(0!==t?{wkid:t}:{wkt:e})):null}function $e(e){const t=e.replaceAll("]","[").replaceAll('"',"").split("[").map((e=>e.trim())).filter((e=>""!==e)),i=t[t.length-1].split(","),s=i[0]?.toLowerCase();if(("epsg"===s||"esri"===s)&&e.endsWith('"]]')){const e=Number(i[1]);if(!isNaN(e)&&0!==e)return e}return 0}function Ue(e){if("pamdataset"!==e?.documentElement.tagName?.toLowerCase())return{};const t={spatialReference:null,transform:null,metadata:{},rasterBands:[],statistics:null,histograms:null};e.documentElement.childNodes.forEach((e=>{if(1===e.nodeType)if(qe(e,"SRS")){if(!t.spatialReference){const i=Je(e);t.spatialReference=Ze(i)}}else if(qe(e,"Metadata"))if("xml:ESRI"===e.getAttribute("domain")){const{spatialReference:i,transform:s}=function(e){const t=Le(e,"GeodataXform"),i=Ze(Ge(t,"SpatialReference/WKID")||Je(t,"SpatialReference/WKT"));if("typens:PolynomialXform"!==t.getAttribute("xsi:type"))return{spatialReference:i,transform:null};const s=Ge(t,"PolynomialOrder")??1,n=He(t,"CoeffX/Double"),r=He(t,"CoeffY/Double"),a=He(t,"InverseCoeffX/Double"),o=He(t,"InverseCoeffY/Double"),l=je(n,r),c=je(a,o);return{spatialReference:i,transform:l&&c&&l.length&&c.length?new We.A({spatialReference:i,polynomialOrder:s,forwardCoefficients:l,inverseCoefficients:c}):null}}(e);t.transform=s,t.spatialReference||(t.spatialReference=i)}else ze(e,"MDI").forEach((e=>t.metadata[e.getAttribute("key")]=Je(e)));else if(qe(e,"PAMRasterBand")){const i=function(e){const t=Ge(e,"NoDataValue"),i=Le(e,"Histograms/HistItem"),s=Ge(i,"HistMin"),n=Ge(i,"HistMax"),r=Ge(i,"BucketCount"),a=Je(i,"HistCounts")?.split("|").map((e=>Number(e)));let o,l,c,u;ze(e,"Metadata/MDI").forEach((e=>{const t=Number(e.textContent??e.nodeValue);switch(e.getAttribute("key").toUpperCase()){case"STATISTICS_MINIMUM":o=t;break;case"STATISTICS_MAXIMUM":l=t;break;case"STATISTICS_MEAN":c=t;break;case"STATISTICS_STDDEV":u=t}}));const h=Ge(e,"Metadata/SourceBandIndex");return{noDataValue:t,histogram:a?.length&&null!=s&&null!=n?{min:s,max:n,size:r||a.length,counts:a}:null,sourceBandIndex:h,statistics:null!=o&&null!=l?{min:o,max:l,avg:c,stddev:u}:null}}(e);null!=i.sourceBandIndex&&null==t.rasterBands[i.sourceBandIndex]?t.rasterBands[i.sourceBandIndex]=i:t.rasterBands.push(i)}}));const i=t.rasterBands;if(i.length){const e=!!i[0].statistics;t.statistics=e?i.map((e=>e.statistics)).filter(Be.Ru):null;const s=!!i[0].histogram;t.histograms=s?i.map((e=>e.histogram)).filter(Be.Ru):null}return t}let Ve=class extends ie{fetchRawTile(e,t,i,s={}){return this._inMemoryRaster.fetchRawTile(e,t,i,s)}async _open(e){const t=await this._fetchData(e);let{spatialReference:i,statistics:s,histograms:n,transform:r}=await this._fetchAuxiliaryData(e);const a=!i;a&&(i=new Q.A({wkid:3857})),n?.length&&null==s&&(s=(0,ue.Pg)(n));const{width:o,height:l}=t;let c=new K.A({xmin:-.5,ymin:.5-l,xmax:o-.5,ymax:.5,spatialReference:i});const u=r?r.forwardTransform(c):c;let h=!0;if(r){const e=r.forwardCoefficients;h=e&&0===e[1]&&0===e[2],h&&(r=null,c=u)}const f=new Ne({source:{extent:u,nativeExtent:c,transform:r,pixelBlocks:[t],statistics:s,histograms:n,keyProperties:{DateType:"Processed"},isPseudoSpatialReference:a},ioConfig:{sampling:"closest",skipStatistics:!0}});this.ioConfig.skipMapInfo&&(f.ioConfig.skipMapInfo=!0),await f.open(),f.source=null,this._set("rasterInfo",f.rasterInfo),this._inMemoryRaster=f}async _fetchData(e){const{data:t}=await this.request(this.url,{responseType:"array-buffer",signal:e?.signal}),i=(0,U.g)(t).toUpperCase();if("JPG"!==i&&"PNG"!==i&&"GIF"!==i&&"BMP"!==i)throw new a.A("image-aux-raster:open","the data is not a supported format");this._set("datasetFormat",i);const s=i.toLowerCase(),n="gif"===s||"bmp"===s||!(0,p.A)("ios"),r=await this.decodePixelBlock(t,{format:s,useCanvas:n,hasNoZlibMask:!0});if(null==r)throw new a.A("image-aux-raster:open","the data cannot be decoded");return r}async _fetchAuxiliaryData(e){const t=e?.signal,{skipExtensions:i=[],skipMapInfo:s}=this.ioConfig,n=s||i.includes("aux.xml")?null:this.request(this.url+".aux.xml",{responseType:"xml",signal:t}),r=this.datasetFormat,a="JPG"===r?"jgw":"PNG"===r?"pgw":"BMP"===r?"bpw":null,o=a&&i.includes(a)?null:this.request(this.url.slice(0,this.url.lastIndexOf("."))+"."+a,{responseType:"text",signal:t}),l=await(0,c.Lx)([n,o]);if(t?.aborted)throw(0,c.NK)();const u=Ue(l[0].value?.data);if(!u.transform){const e=l[1].value?l[1].value.data.split("\n").slice(0,6).map((e=>Number(e))):null;u.transform=6===e?.length?new We.A({forwardCoefficients:[e[4],e[5],e[0],-e[1],e[2],-e[3]]}):null}return u}};(0,s._)([(0,h.MZ)({type:String,json:{write:!0}})],Ve.prototype,"datasetFormat",void 0),Ve=(0,s._)([(0,d.$)("esri.layers.support.rasterDatasets.ImageAuxRaster")],Ve);const Ye=Ve;var Xe=i(97768),Ke=i(84952),Qe=i(25943),et=i(73037),tt=i(82371);let it=class extends ie{constructor(){super(...arguments),this._levelOffset=0,this._tilemapCache=null,this._slices=null,this.datasetFormat="RasterTileServer",this.tileType=null}async fetchRawTile(e,t,i,s={}){const{storageInfo:n,extent:r}=this.rasterInfo,{transposeInfo:a}=n,o=null!=a&&!!s.transposedVariableName;if(this._slices&&!o&&null==s.sliceId)return null;const l=o?0:n.maximumPyramidLevel-e+this._levelOffset,c=`${this.url}/tile/${l}/${t}/${i}`,u=this._slices?o?{variable:s.transposedVariableName}:{sliceId:s.sliceId||0}:null,{data:h}=await this.request(c,{query:u,responseType:"array-buffer",signal:s.signal});if(!h)return null;const f=o?a.tileSize:n.tileInfo.size,p=await this.decodePixelBlock(h,{width:f[0],height:f[1],planes:null,pixelType:null,isPoint:"Elevation"===this.tileType,returnInterleaved:o,noDataValue:this.rasterInfo.noDataValue});if(null==p)return null;const d=n.blockBoundary[e];if("jpg"!==n.compression||i>d.minCol&&i<d.maxCol&&t>d.minRow&&t<d.maxRow)return p;const{origin:m,blockWidth:y,blockHeight:g}=n,{x,y:w}=this.getPyramidPixelSize(e),_=Math.round((r.xmin-m.x)/x)%y,v=Math.round((r.xmax-m.x)/x)%y||y,b=Math.round((m.y-r.ymax)/w)%g,I=Math.round((m.y-r.ymin)/w)%g||g,R=i===d.minCol?_:0,S=t===d.minRow?b:0,T=i===d.maxCol?v:y,A=t===d.maxRow?I:g;return(0,V.z$)(p,{x:R,y:S},{width:T-R,height:A-S}),p}getSliceIndex(e){if(!this._slices||null==e||0===e.length)return null;const t=e;for(let e=0;e<this._slices.length;e++){const i=this._slices[e].multidimensionalDefinition;if(i.length===t.length&&!i.some((e=>{const i=t.find((t=>e.variableName===t.variableName&&t.dimensionName===e.dimensionName));return!i||(Array.isArray(e.values[0])?`${e.values[0][0]}-${e.values[0][1]}`:e.values[0])!==(Array.isArray(i.values[0])?`${i.values[0][0]}-${i.values[0][1]}`:i.values[0])})))return e}return null}async fetchVariableStatisticsHistograms(e,t){const i=this.request(this.url+"/statistics",{query:{variable:e,f:"json"},signal:t}).then((e=>e.data?.statistics)),s=this.request(this.url+"/histograms",{query:{variable:e,f:"json"},signal:t}).then((e=>e.data?.histograms)),n=await Promise.all([i,s]);return n[0]&&n[0].forEach((e=>{e.avg=e.mean,e.stddev=e.standardDeviation})),n[1]?.[0]?.counts?.length||(n[1]=null),{statistics:n[0]||null,histograms:n[1]||null}}async computeBestPyramidLevelForLocation(e,t={}){if(!this._tilemapCache)return 0;let i=this.identifyPixelLocation(e,0,t.datumTransformation);if(null===i)return null;let s=0;const{maximumPyramidLevel:n}=this.rasterInfo.storageInfo;let r=n-s+this._levelOffset;const a=i.srcLocation;for(;r>=0;){try{if("available"===await this._tilemapCache.fetchAvailability(r,i.row,i.col,t))break}catch{}if(r--,s++,i=this.identifyPixelLocation(a,s,t.datumTransformation),null===i)return null}return-1===r||null==i?null:s}async _open(e){const t=e?.signal,i=this.sourceJSON?{data:this.sourceJSON}:await this.request(this.url,{query:{f:"json"},signal:t});i.ssl&&(this.url=this.url.replace(/^http:/i,"https:"));const s=i.data;if(this.sourceJSON=s,!s)throw new a.A("imageserverraster:open","cannot initialize tiled image service, missing service info");if(!s.tileInfo)throw new a.A("imageserverraster:open","use ImageryLayer to open non-tiled image services");this._fixScaleInServiceInfo(),this.tileType=s.cacheType,null==this.tileType&&(["jpg","jpeg","png","png8","png24","png32","mixed"].includes(s.tileInfo.format.toLowerCase())?this.tileType="Map":"lerc"===s.tileInfo.format.toLowerCase()?this.tileType="Elevation":this.tileType="Raster"),this.datasetName=s.name?.slice(s.name.indexOf("/")+1)??"";const n=await this._fetchRasterInfo({signal:t});if(null==n)throw new a.A("image-server-raster:open","cannot initialize image service");(0,tt.E9)(n,s);const r="Map"===this.tileType?function(e,t){if(!e)return null;const{minScale:i,maxScale:s,minLOD:n,maxLOD:r}=t;if(null!=n&&null!=r)return C.A.fromJSON({...e,lods:e.lods.filter((({level:e})=>null!=e&&e>=n&&e<=r))});if(0!==i&&0!==s){const t=e=>Math.round(1e4*e)/1e4,n=i?t(i):1/0,r=s?t(s):-1/0;return C.A.fromJSON({...e,lods:e.lods.filter((e=>{const i=t(e.scale);return i<=n&&i>=r}))})}return C.A.fromJSON(e)}(s.tileInfo,s):C.A.fromJSON(s.tileInfo);(0,Xe.Lw)(r);const[o,l]=this._computeMinMaxLOD(n,r),{extent:c,pixelSize:u}=n,h=.5/n.width*u.x,f=Math.max(u.x,u.y),{lods:p}=r;("Map"!==this.tileType&&0!==s.maxScale||Math.abs(u.x-u.y)>h||!p.some((e=>Math.abs(e.resolution-f)<h)))&&(u.x=u.y=o.resolution,n.width=Math.ceil((c.xmax-c.xmin)/u.x-.1),n.height=Math.ceil((c.ymax-c.ymin)/u.y-.1));const d=o.level-l.level,[m,y]=r.size,g=[],x=[];p.forEach(((e,t)=>{e.level>=l.level&&e.level<=o.level&&g.push({x:e.resolution,y:e.resolution}),t<p.length-1&&x.push(Math.round(10*e.resolution/p[t+1].resolution)/10)})),g.sort(((e,t)=>e.x-t.x));const w=this.computeBlockBoundary(c,m,y,r.origin,g,d),_=g.length>1?g.slice(1):null;let v;s.transposeInfo&&(v={tileSize:[s.transposeInfo.rows,s.transposeInfo.cols],packetSize:n.keyProperties?._yxs.PacketSize??0});const b=x.length<=1||x.length>=3&&x.slice(0,-1).every((e=>e===x[0]))?x[0]??2:Math.round(10/(l.resolution/o.resolution)**(-1/d))/10;if(n.storageInfo=new E.A({blockWidth:r.size[0],blockHeight:r.size[1],pyramidBlockWidth:r.size[0],pyramidBlockHeight:r.size[1],pyramidResolutions:_,pyramidScalingFactor:b,compression:r.format,origin:r.origin,firstPyramidLevel:1,maximumPyramidLevel:d,tileInfo:r,transposeInfo:v,blockBoundary:w}),function(e){const{extent:t,spatialReference:i}=e;t.xmin>-1&&t.xmax>181&&i?.wkid&&i.isGeographic&&(e.nativeExtent=e.extent,e.transform=new et.A,e.extent=e.transform.forwardTransform(t))}(n),this._set("rasterInfo",n),s.capabilities.toLowerCase().includes("tilemap")){const e={tileInfo:n.storageInfo.tileInfo,parsedUrl:(0,Ke.An)(this.url),url:this.url,tileServers:[]};this._tilemapCache=new Qe.d({layer:e})}}async _fetchRasterInfo(e){const t=this.sourceJSON;if("Map"===this.tileType){const e=t.fullExtent||t.extent,i=Math.ceil((e.xmax-e.xmin)/t.pixelSizeX-.1),s=Math.ceil((e.ymax-e.ymin)/t.pixelSizeY-.1),n=Q.A.fromJSON(t.spatialReference||e.spatialReference),r=new L.A({x:t.pixelSizeX,y:t.pixelSizeY,spatialReference:n});return new Ce.A({width:i,height:s,bandCount:3,extent:K.A.fromJSON(e),spatialReference:n,pixelSize:r,pixelType:"u8",statistics:null,keyProperties:{DataType:"processed"}})}const{signal:i}=e,s=(0,tt.Tw)(this.url,this.sourceJSON,{signal:i,query:this.ioConfig.customFetchParameters}),n=t.hasMultidimensions?this.request(`${this.url}/slices`,{query:{f:"json"},signal:i}).then((e=>e.data?.slices)).catch((()=>null)):null,r=await Promise.all([s,n]);return this._slices=r[1],r[0]}_fixScaleInServiceInfo(){const{sourceJSON:e}=this;e.minScale&&e.minScale<0&&(e.minScale=0),e.maxScale&&e.maxScale<0&&(e.maxScale=0)}_computeMinMaxLOD(e,t){const{pixelSize:i}=e,s=.5/e.width*i.x,{lods:n}=t,r=t.lodAt(Math.max.apply(null,n.map((e=>e.level)))),a=t.lodAt(Math.min.apply(null,n.map((e=>e.level)))),{tileType:o}=this;if("Map"===o)return this._levelOffset=n[0].level,[r,a];if("Raster"===o)return[n.find((e=>e.resolution===i.x))??r,a];const{minScale:l,maxScale:c}=this.sourceJSON;let u=r;c>0&&(u=n.find((e=>Math.abs(e.scale-c)<s)),u||(u=n.filter((e=>e.scale>c)).sort(((e,t)=>e.scale>t.scale?1:-1))[0]??r));let h=a;return l>0&&(h=n.find((e=>Math.abs(e.scale-l)<s))??a,this._levelOffset=h.level-a.level),[u,h]}};(0,s._)([(0,h.MZ)({type:String,json:{write:!0}})],it.prototype,"datasetFormat",void 0),(0,s._)([(0,h.MZ)()],it.prototype,"tileType",void 0),it=(0,s._)([(0,d.$)("esri.layers.support.rasterDatasets.ImageServerRaster")],it);const st=it;var nt=i(47124);const rt=new Map;rt.set("Int8","s8"),rt.set("UInt8","u8"),rt.set("Int16","s16"),rt.set("UInt16","u16"),rt.set("Int32","s32"),rt.set("UInt32","u32"),rt.set("Float32","f32"),rt.set("Float64","f32"),rt.set("Double64","f32");const at=new Map;at.set("none",{blobExtension:".til",isOneSegment:!0,decoderFormat:"bip"}),at.set("lerc",{blobExtension:".lrc",isOneSegment:!1,decoderFormat:"lerc"}),at.set("deflate",{blobExtension:".pzp",isOneSegment:!0,decoderFormat:"deflate"}),at.set("jpeg",{blobExtension:".pjg",isOneSegment:!0,decoderFormat:"jpg"});let ot=class extends ie{constructor(){super(...arguments),this._files=null,this._storageIndex=null,this.datasetFormat="MRF"}async fetchRawTile(e,t,i,s={}){const{blockWidth:n,blockHeight:r,blockBoundary:a}=this.rasterInfo.storageInfo,o=a[e];if(!o||o.maxRow<t||o.maxCol<i||o.minRow>t||o.minCol>i)return null;const{bandCount:l,pixelType:c}=this.rasterInfo,{ranges:u,actualTileWidth:h,actualTileHeight:f}=this._getTileLocation(e,t,i);if(!u||0===u.length)return null;if(0===u[0].from&&0===u[0].to){const e=new Uint8Array(n*r);return new ne.A({width:n,height:r,pixels:void 0,mask:e,validPixelCount:0})}const{bandIds:p}=this.ioConfig,d=this._getBandSegmentCount(),m=[];let y=0;for(y=0;y<d;y++)p&&!p.includes(y)||m.push(this.request(this._files.data,{range:{from:u[y].from,to:u[y].to},responseType:"array-buffer",signal:s.signal}));const g=await Promise.all(m),x=g.map((e=>e.data.byteLength)).reduce(((e,t)=>e+t)),w=new Uint8Array(x),_=[];let v=0;for(y=0;y<d;y++)_.push(v),w.set(new Uint8Array(g[y].data),v),v+=g[y].data.byteLength;const b=at.get(this.rasterInfo.storageInfo.compression).decoderFormat,I=await this.decodePixelBlock(w.buffer,{width:n,height:r,format:b,planes:p?.length||l,offsets:_,pixelType:c});if(null==I)return null;let{noDataValue:R}=this.rasterInfo;if(null!=R&&"lerc"!==b&&!I.mask&&(R=R[0],null!=R)){const e=I.width*I.height,t=new Uint8Array(e);if(Math.abs(R)>1e24)for(y=0;y<e;y++)Math.abs((I.pixels[0][y]-R)/R)>1e-6&&(t[y]=1);else for(y=0;y<e;y++)I.pixels[0][y]!==R&&(t[y]=1);I.mask=t}let S=0,T=0;if(h!==n||f!==r){let e=I.mask;if(e)for(y=0;y<r;y++)if(T=y*n,y<f)for(S=h;S<n;S++)e[T+S]=0;else for(S=0;S<n;S++)e[T+S]=0;else for(e=new Uint8Array(n*r),I.mask=e,y=0;y<f;y++)for(T=y*n,S=0;S<h;S++)e[T+S]=1}return I}async _open(e){this.datasetName=this.url.slice(this.url.lastIndexOf("/")+1);const t=e?e.signal:null,i=await this.request(this.url,{responseType:"xml",signal:t}),{rasterInfo:s,files:n}=this._parseHeader(i.data),{skipMapInfo:r,skipExtensions:a=[]}=this.ioConfig;if(!a.includes("aux.xml")&&!r){const t=await this._fetchAuxiliaryData(e);null!=t&&(s.statistics=t.statistics??s.statistics,s.histograms=t.histograms,t.histograms&&null==s.statistics&&(s.statistics=(0,ue.Pg)(t.histograms)))}r&&this.updateImageSpaceRasterInfo(s),this._set("rasterInfo",s),this._files=n;const o=await this.request(n.index,{responseType:"array-buffer",signal:t});this._storageIndex=function(e){if(e.byteLength%16>0)throw new Error("invalid array buffer must be multiples of 16");let t,i,s,n,r,a;if(nt.Z){for(i=new Uint8Array(e),n=new ArrayBuffer(e.byteLength),s=new Uint8Array(n),r=0;r<e.byteLength/4;r++)for(a=0;a<4;a++)s[4*r+a]=i[4*r+3-a];t=new Uint32Array(n)}else t=new Uint32Array(e);return t}(o.data);const{blockWidth:l,blockHeight:c}=this.rasterInfo.storageInfo,u=this.rasterInfo.storageInfo.pyramidScalingFactor,{width:h,height:f}=this.rasterInfo,p=[],d=this._getBandSegmentCount();let m=0,y=-1;for(;m<this._storageIndex.length;){y++;const e=Math.ceil(h/l/u**y)-1,t=Math.ceil(f/c/u**y)-1;m+=(e+1)*(t+1)*d*4,p.push({maxRow:t,maxCol:e,minCol:0,minRow:0})}this.rasterInfo.storageInfo.blockBoundary=p,y>0&&(this.rasterInfo.storageInfo.firstPyramidLevel=1,this.rasterInfo.storageInfo.maximumPyramidLevel=y),this.updateTileInfo()}_getBandSegmentCount(){return at.get(this.rasterInfo.storageInfo.compression).isOneSegment?1:this.rasterInfo.bandCount}_getTileLocation(e,t,i){const{blockWidth:s,blockHeight:n,pyramidScalingFactor:r}=this.rasterInfo.storageInfo,{width:a,height:o}=this.rasterInfo,l=this._getBandSegmentCount();let c,u,h,f=0,p=0;for(h=0;h<e;h++)p=r**h,c=Math.ceil(a/s/p),u=Math.ceil(o/n/p),f+=c*u;p=r**e,c=Math.ceil(a/s/p),u=Math.ceil(o/n/p),f+=t*c+i,f*=4*l;const d=this._storageIndex.subarray(f,f+4*l);let m=0,y=0;const g=[];for(let e=0;e<l;e++)m=d[4*e]*2**32+d[4*e+1],y=m+d[4*e+2]*2**32+d[4*e+3],g.push({from:m,to:y});return{ranges:g,actualTileWidth:i<c-1?s:Math.ceil(a/p)-s*(c-1),actualTileHeight:t<u-1?n:Math.ceil(o/p)-n*(u-1)}}_parseHeader(e){const t=Le(e,"MRF_META/Raster");if(!t)throw new a.A("mrf:open","not a valid MRF format");const i=Le(t,"Size"),s=parseInt(i.getAttribute("x"),10),n=parseInt(i.getAttribute("y"),10),r=parseInt(i.getAttribute("c"),10),o=(Je(t,"Compression")||"none").toLowerCase();if(!at.has(o))throw new a.A("mrf:open","currently does not support compression "+o);const l=Je(t,"DataType")||"UInt8",c=rt.get(l);if(null==c)throw new a.A("mrf:open","currently does not support pixel type "+l);const u=Le(t,"PageSize"),h=parseInt(u.getAttribute("x"),10),f=parseInt(u.getAttribute("y"),10),p=Le(t,"DataValues");let d,m;if(p&&(m=p.getAttribute("NoData"),null!=m&&(d=m.trim().split(" ").map((e=>parseFloat(e))))),Le(e,"MRF_META/CachedSource"))throw new a.A("mrf:open","currently does not support MRF referencing other data files");const y=Le(e,"MRF_META/GeoTags"),g=Le(y,"BoundingBox");let x,w=!1;if(null!=g){const e=parseFloat(g.getAttribute("minx")),t=parseFloat(g.getAttribute("miny")),i=parseFloat(g.getAttribute("maxx")),s=parseFloat(g.getAttribute("maxy")),n=Je(y,"Projection")||"";let r=Q.A.WGS84;if("LOCAL_CS[]"!==n)if(n.toLowerCase().startsWith("epsg:")){const e=Number(n.slice(5));isNaN(e)||0===e||(r=new Q.A({wkid:e}))}else r=Ze(n)??Q.A.WGS84;else w=!0,r=new Q.A({wkid:3857});x=new K.A(e,t,i,s),x.spatialReference=r}else w=!0,x=new K.A({xmin:-.5,ymin:.5-n,xmax:s-.5,ymax:.5,spatialReference:new Q.A({wkid:3857})});const _=Le(e,"MRF_META/Rsets"),v=parseInt(_?.getAttribute("scale")||"2",10),b=x.spatialReference,I=new E.A({origin:new L.A({x:x.xmin,y:x.ymax,spatialReference:b}),blockWidth:h,blockHeight:f,pyramidBlockWidth:h,pyramidBlockHeight:f,compression:o,pyramidScalingFactor:v}),R=new L.A({x:x.width/s,y:x.height/n,spatialReference:b}),S=new Ce.A({width:s,height:n,extent:x,isPseudoSpatialReference:w,spatialReference:b,bandCount:r,pixelType:c,pixelSize:R,noDataValue:d,storageInfo:I}),T=Je(e,"datafile"),A=Je(e,"IndexFile");return{rasterInfo:S,files:{mrf:this.url,index:A||this.url.replace(".mrf",".idx"),data:T||this.url.replace(".mrf",at.get(o).blobExtension)}}}async _fetchAuxiliaryData(e){try{const{data:t}=await this.request(this.url+".aux.xml",{responseType:"xml",signal:e?.signal});return Ue(t)}catch{return null}}};(0,s._)([(0,h.MZ)()],ot.prototype,"_files",void 0),(0,s._)([(0,h.MZ)()],ot.prototype,"_storageIndex",void 0),(0,s._)([(0,h.MZ)({type:String,json:{write:!0}})],ot.prototype,"datasetFormat",void 0),ot=(0,s._)([(0,d.$)("esri.layers.support.rasterDatasets.MRFRaster")],ot);const lt=ot;var ct=i(15265);function ut(e){const t=e.fields,i=e.records,s=t.some((e=>"oid"===e.name.toLowerCase()))?"OBJECTID":"OID",n=[{name:s,type:"esriFieldTypeOID",alias:"OID"}].concat(t.map((e=>({name:e.name,type:"esriFieldType"+e.typeName,alias:e.name})))),r=n.map((e=>e.name)),a=[];let o=0,l=0;return i.forEach((e=>{const t={};for(t[s]=o++,l=1;l<r.length;l++)t[r[l]]=e[l-1];a.push({attributes:t})})),{displayFieldName:"",fields:n,features:a}}class ht{static get supportedVersions(){return[5]}static parse(e){const t=new DataView(e),i=3&t.getUint8(0);if(3!==i)return{header:{version:i},recordSet:null};const s=t.getUint32(4,!0),n=t.getUint16(8,!0),r=t.getUint16(10,!0),a={version:i,recordCount:s,headerByteCount:n,recordByteCount:r};let o=32;const l=[],c=[];let u;if(3===i){for(;13!==t.getUint8(o);)u=String.fromCharCode(t.getUint8(o+11)).trim(),l.push({name:(0,ct.w)(new Uint8Array(e,o,11)),type:u,typeName:["String","Date","Double","Boolean","String","Integer"][["C","D","F","L","M","N"].indexOf(u)],length:t.getUint8(o+16)}),o+=32;if(o+=1,l.length>0)for(;c.length<s&&e.byteLength-o>r;){const i=[];32===t.getUint8(o)?(o+=1,l.forEach((t=>{if("C"===t.type)i.push((0,ct.w)(new Uint8Array(e,o,t.length)).trim());else if("N"===t.type)i.push(parseInt(String.fromCharCode.apply(null,new Uint8Array(e,o,t.length)).trim(),10));else if("F"===t.type)i.push(parseFloat(String.fromCharCode.apply(null,new Uint8Array(e,o,t.length)).trim()));else if("D"===t.type){const s=String.fromCharCode.apply(null,new Uint8Array(e,o,t.length)).trim();i.push(new Date(parseInt(s.slice(0,4),10),parseInt(s.slice(4,6),10)-1,parseInt(s.slice(6,8),10)))}o+=t.length})),c.push(i)):o+=r}}return{header:a,fields:l,records:c,recordSet:ut({fields:l,records:c})}}}var ft=i(45664),pt=i(47915);const dt=(e,t)=>e.get(t)?.values,mt=(e,t)=>e.get(t)?.values?.[0];let yt=class extends ie{constructor(){super(...arguments),this._files=null,this._headerInfo=null,this._bufferSize=1048576,this.datasetFormat="TIFF"}async fetchRawTile(e,t,i,s={}){if(!this._headerInfo?.isSupported||this.isBlockOutside(e,t,i))return null;const n=await this._fetchRawTiffTile(e,t,i,!1,s);if(null!=n&&this._headerInfo.hasMaskBand){const r=await this._fetchRawTiffTile(e,t,i,!0,s);null!=r&&r.pixels[0]instanceof Uint8Array&&(n.mask=r.pixels[0])}return n}async _open(e){const t=e?e.signal:null,{data:i}=await this.request(this.url,{range:{from:0,to:this._bufferSize},responseType:"array-buffer",signal:t});if(!i)throw new a.A("tiffraster:open","failed to open url "+this.url);this.datasetName=this.url.slice(this.url.lastIndexOf("/")+1,this.url.lastIndexOf("."));const{littleEndian:s,firstIFDPos:n,isBigTiff:r}=(0,ft.uT)(i),l=[];await this._readIFDs(l,i,s,n,0,r?8:4,t);const{imageInfo:c,rasterInfo:u}=function(e){const t=(0,ft.uc)(e),{width:i,height:s,tileWidth:n,tileHeight:r,planes:a,pixelType:o,compression:l,firstPyramidLevel:c,maximumPyramidLevel:u,pyramidBlockWidth:h,pyramidBlockHeight:f,pyramidResolutions:p,tileBoundary:d,affine:m,metadata:y}=t;let g=Ze(t.extent.spatialReference?.wkt||t.extent.spatialReference?.wkid),x=!!t.isPseudoGeographic;null==g&&(x=!0,g=new Q.A({wkid:3857}));const w=new K.A({...t.extent,spatialReference:g}),_=new L.A(w?{x:w.xmin,y:w.ymax,spatialReference:g}:{x:0,y:0}),v=new E.A({blockWidth:n,blockHeight:r,pyramidBlockWidth:h,pyramidBlockHeight:f,compression:l,origin:_,firstPyramidLevel:c,maximumPyramidLevel:u,pyramidResolutions:p,blockBoundary:d}),b=new L.A({x:(w.xmax-w.xmin)/i,y:(w.ymax-w.ymin)/s,spatialReference:g}),I=y?{BandProperties:y.bandProperties,DataType:y.dataType}:{};let R=null;const S=mt(e[0],"PHOTOMETRICINTERPRETATION"),T=dt(e[0],"COLORMAP");if(S<=3&&T?.length>3&&T.length%3==0){R=[];const e=T.length/3;for(let t=0;t<e;t++)R.push([t,T[t]>>>8,T[t+e]>>>8,T[t+2*e]>>>8])}const A=new Ce.A({width:i,height:s,bandCount:a,pixelType:o,pixelSize:b,storageInfo:v,spatialReference:g,isPseudoSpatialReference:x,keyProperties:I,extent:w,colormap:R,statistics:y?y.statistics:null});if(m?.length&&(A.nativeExtent=new K.A({xmin:-.5,ymin:.5-s,xmax:i-.5,ymax:.5,spatialReference:g}),A.transform=new We.A({polynomialOrder:1,forwardCoefficients:[m[2]+m[0]/2,m[5]-m[3]/2,m[0],m[3],-m[1],-m[4]]}),A.extent=A.transform.forwardTransform(A.nativeExtent),A.pixelSize=new L.A({x:(w.xmax-w.xmin)/i,y:(w.ymax-w.ymin)/s,spatialReference:g}),v.origin.x=-.5,v.origin.y=.5),p){const{x:e,y:t}=A.pixelSize;p.forEach((i=>{i.x*=e,i.y*=t}))}return{imageInfo:t,rasterInfo:A}}(l),h=(0,ft.zS)(l),f=(0,ft.r9)(l);if(this._headerInfo={littleEndian:s,isBigTiff:r,ifds:l,pyramidIFDs:h,maskIFDs:f,...c},this._set("rasterInfo",u),!c.isSupported)throw new a.A("tiffraster:open","this tiff is not supported: "+c.message);if(!c.tileWidth)throw new a.A("tiffraster:open","none-tiled tiff is not optimized for access, convert to COG and retry.");u.isPseudoSpatialReference&&o.A.getLogger(this).warn("The spatial reference for this tiff is unsupported. Only EPSG spatial reference codes and Esri WKTs are supported.");const p=l[0].get("PREDICTOR")?.values?.[0],d=l[0].get("SAMPLEFORMAT")?.values?.[0];if(3===d&&2===p)throw new a.A("tiffraster:open","unsupported horizontal difference encoding. Predictor=3 is supported for floating point data");const{skipMapInfo:m,skipExtensions:y=[]}=this.ioConfig;if(!y.includes("aux.xml")&&!m){const t=await this._fetchAuxiliaryMetaData(e);null!=t&&function(e,t){if(t.statistics=e.statistics??t.statistics,t.histograms=e.histograms,e.histograms&&null==t.statistics&&(t.statistics=(0,ue.Pg)(e.histograms)),e.transform&&null==t.transform){t.transform=e.transform,t.nativeExtent=t.extent;const i=t.transform.forwardTransform(t.nativeExtent);t.pixelSize=new L.A({x:(i.xmax-i.xmin)/t.width,y:(i.ymax-i.ymin)/t.height,spatialReference:t.spatialReference}),t.extent=i}t.isPseudoSpatialReference&&e.spatialReference&&(t.spatialReference=e.spatialReference,t.extent.spatialReference=t.nativeExtent.spatialReference=t.storageInfo.origin.spatialReference=t.spatialReference)}(t,u)}y.includes("vat.dbf")||1!==u.bandCount||"u8"!==u.pixelType||m||(u.attributeTable=await this._fetchAuxiliaryTable(e),null!=u.attributeTable&&(u.keyProperties.DataType="thematic")),m&&this.updateImageSpaceRasterInfo(u),this.updateTileInfo()}async _readIFDs(e,t,i,s,n,r=4,a){if(!s)return null;(s>=t.byteLength||s<0)&&(t=(await this.request(this.url,{range:{from:s+n,to:s+n+this._bufferSize},responseType:"array-buffer",signal:a})).data,n=s+n,s=0);const o=await this._readIFD(t,i,s,n,pt.A.tiffTags,r,a);if(e.push(o.ifd),!o.nextIFD)return null;await this._readIFDs(e,t,i,o.nextIFD-n,n,r,a)}async _readIFD(e,t,i,s,n=pt.A.tiffTags,r=4,a){if(!e)return null;const o=(0,ft.JM)(e,t,i,s,n,r);if(o.success){const i=[];if(o.ifd?.forEach((e=>{e.values||i.push(e)})),i.length>0){const n=i.map((e=>e.offlineOffsetSize)).filter(Be.Ru),r=Math.min.apply(null,n.map((e=>e[0])));if(Math.min.apply(null,n.map((e=>e[0]+e[1])))-r<=this._bufferSize){const{data:n}=await this.request(this.url,{range:{from:r,to:r+this._bufferSize},responseType:"array-buffer",signal:a});e=n,s=r,i.forEach((i=>(0,ft.Cr)(e,t,i,s)))}}if(o.ifd?.has("GEOKEYDIRECTORY")){const i=o.ifd.get("GEOKEYDIRECTORY"),n=i?.values;if(n&&n.length>4){const r=n[0]+"."+n[1]+"."+n[2],o=await this._readIFD(e,t,i.valueOffset+6-s,s,pt.A.geoKeys,2,a);i.data=o.ifd,i.data&&i.data.set("GEOTIFFVersion",{id:0,type:2,valueCount:1,valueOffset:null,values:[r]})}}return o}if(o.requiredBufferSize&&o.requiredBufferSize!==e.byteLength){const i=await this.request(this.url,{range:{from:s,to:s+o.requiredBufferSize+4},responseType:"array-buffer",signal:a});return(e=i.data).byteLength<o.requiredBufferSize?null:this._readIFD(e,t,0,s,pt.A.tiffTags,4,a)}}async _fetchRawTiffTile(e,t,i,s,n={}){const r=this._getTileLocation(e,t,i,s);if(!r)return null;const{ranges:a,actualTileWidth:o,actualTileHeight:l,ifd:c}=r,u=a.map((e=>this.request(this.url,{range:e,responseType:"array-buffer",signal:n.signal}))),h=await Promise.all(u),f=h.map((e=>e.data.byteLength)).reduce(((e,t)=>e+t)),p=1===h.length?h[0].data:new ArrayBuffer(f),d=[0],m=[0];if(h.length>1){const e=new Uint8Array(p);for(let t=0,i=0;t<h.length;t++){const s=h[t].data;e.set(new Uint8Array(s),i),d[t]=i,i+=s.byteLength,m[t]=s.byteLength}}const{blockWidth:y,blockHeight:g}=this.getBlockWidthHeight(e),x=await this.decodePixelBlock(p,{format:"tiff",customOptions:{headerInfo:this._headerInfo,ifd:c,offsets:d,sizes:m},width:y,height:g,planes:null,pixelType:null});if(null==x)return null;let w,_,v;if(o!==y||l!==g){let e=x.mask;if(e)for(w=0;w<g;w++)if(v=w*y,w<l)for(_=o;_<y;_++)e[v+_]=0;else for(_=0;_<y;_++)e[v+_]=0;else for(e=new Uint8Array(y*g),x.mask=e,w=0;w<l;w++)for(v=w*y,_=0;_<o;_++)e[v+_]=1}return x}_getTileLocation(e,t,i,s=!1){const{firstPyramidLevel:n,blockBoundary:r}=this.rasterInfo.storageInfo,a=0===e?0:e-(n-1),{_headerInfo:o}=this;if(!o)return null;const l=s?o.maskIFDs[a]:0===a?o?.ifds[0]:o?.pyramidIFDs[a-1];if(!l)return null;const c=(0,ft.XO)(l,o),u=dt(l,"TILEOFFSETS");if(void 0===u)return null;const h=dt(l,"TILEBYTECOUNTS"),{minRow:f,minCol:p,maxRow:d,maxCol:m}=r[a];if(t>d||i>m||t<f||i<p)return null;const y=mt(l,"IMAGEWIDTH"),g=mt(l,"IMAGELENGTH"),x=mt(l,"TILEWIDTH"),w=mt(l,"TILELENGTH"),_=[];if(c){const{bandCount:e}=this.rasterInfo;for(let s=0;s<e;s++){const e=s*(d+1)*(m+1)+t*(m+1)+i;_[s]={from:u[e],to:u[e]+h[e]-1}}}else{const e=t*(m+1)+i;_.push({from:u[e],to:u[e]+h[e]-1})}for(let e=0;e<_.length;e++)if(null==_[e].from||!_[e].to||_[e].to<0)return null;return{ranges:_,ifd:l,actualTileWidth:i===m&&y%x||x,actualTileHeight:t===d&&g%w||w}}async _fetchAuxiliaryMetaData(e){try{const{data:t}=await this.request(this.url+".aux.xml",{responseType:"xml",signal:e?.signal});return Ue(t)}catch{return null}}async _fetchAuxiliaryTable(e){try{const{data:t}=await this.request(this.url+".vat.dbf",{responseType:"array-buffer",signal:e?.signal}),i=ht.parse(t);return i?.recordSet?ae.A.fromJSON(i.recordSet):null}catch{return null}}};(0,s._)([(0,h.MZ)()],yt.prototype,"_files",void 0),(0,s._)([(0,h.MZ)()],yt.prototype,"_headerInfo",void 0),(0,s._)([(0,h.MZ)()],yt.prototype,"_bufferSize",void 0),(0,s._)([(0,h.MZ)({type:String,json:{write:!0}})],yt.prototype,"datasetFormat",void 0),yt=(0,s._)([(0,d.$)("esri.layers.support.rasterDatasets.TIFFRaster")],yt);const gt=yt,xt=new Map;xt.set("MRF",{desc:"Meta Raster Format",constructor:lt}),xt.set("TIFF",{desc:"GeoTIFF",constructor:gt}),xt.set("RasterTileServer",{desc:"Raster Tile Server",constructor:st}),xt.set("JPG",{desc:"JPG Raster Format",constructor:Ye}),xt.set("PNG",{desc:"PNG Raster Format",constructor:Ye}),xt.set("GIF",{desc:"GIF Raster Format",constructor:Ye}),xt.set("BMP",{desc:"BMP Raster Format",constructor:Ye}),xt.set("CovJSON",{desc:"COVJSON Raster Format",constructor:Ee}),xt.set("MEMORY",{desc:"In Memory Raster Format",constructor:Ne});class wt{static get supportedFormats(){const e=new Set;return xt.forEach(((t,i)=>e.add(i))),e}static async open(e){const{url:t,ioConfig:i,source:s,sourceJSON:n}=e;let r=e.datasetFormat??i?.datasetFormat;null==r&&(t.includes(".")?r=t.slice(t.lastIndexOf(".")+1).toUpperCase():"coverage"===s?.type?.toLowerCase()?r="CovJSON":s?.extent&&s.pixelblocks&&(r="MEMORY")),"OVR"===r||"TIF"===r?r="TIFF":"JPG"===r||"JPEG"===r||"JFIF"===r?r="JPG":"COVJSON"===r&&(r="CovJSON"),t.toLowerCase().includes("/imageserver")&&!t.toLowerCase().includes("/wcsserver")&&(r="RasterTileServer");const o={url:t,source:s,sourceJSON:n,datasetFormat:r,ioConfig:i??{bandIds:null,sampling:null}};if(Object.keys(o).forEach((e=>{null==o[e]&&delete o[e]})),r){if(!this.supportedFormats.has(r))throw new a.A("rasterfactory:open","not a supported format "+r);if("CRF"===r)throw new a.A("rasterfactory:open",`cannot open raster: ${t}`);const i=new(0,xt.get(r).constructor)(o);return await i.open({signal:e.signal}),i}const l=Array.from(xt.keys()).filter((e=>"CovJSON"!==e&&"Memory"!==e));let c=0;const u=()=>{if(r=l[c++],!r)return null;if("CRF"===r)return null;const t=new(0,xt.get(r).constructor)(o);return t.open({signal:e.signal}).then((()=>t)).catch((()=>u()))};return u()}static register(e,t,i){xt.has(e.toUpperCase())||xt.set(e.toUpperCase(),{desc:t,constructor:i})}}var _t=i(30291),vt=i(92935);let bt=class extends((0,g.dM)((0,_e.j)((0,ye.q)((0,ge.A)((0,xe.H)((0,x.d)(me((0,ve.e)((0,y.b)((0,we.J)((0,l.P)((0,r.O)(m.A))))))))))))){constructor(...e){super(...e),this._primaryRasters=[],this.legendEnabled=!0,this.isReference=null,this.listMode="show",this.sourceJSON=null,this.version=null,this.type="imagery-tile",this.operationalLayerType="ArcGISTiledImageServiceLayer",this.popupEnabled=!0,this.popupTemplate=null,this.fields=null,this.source=void 0,this._debouncedSaveOperations=(0,c.sg)((async(e,t,s)=>{const{save:n,saveAs:r}=await i.e(9838).then(i.bind(i,59838));switch(e){case vt.X.SAVE:return n(this,t);case vt.X.SAVE_AS:return r(this,s,t)}}))}normalizeCtorArgs(e,t){return"string"==typeof e?{url:e,...t}:e}load(e){const t=null!=e?e.signal:null;return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["Image Service"]},e).catch(c.QP).then((()=>this._openRaster(t)))),Promise.resolve(this)}get defaultPopupTemplate(){return this.createPopupTemplate()}get rasterFields(){const e=[new be.A({name:"Raster.ServicePixelValue",alias:"Pixel Value",domain:null,editable:!1,length:50,type:"string"}),new be.A({name:"Raster.ServicePixelValue.Raw",alias:"Raw Pixel Value",domain:null,editable:!1,length:50,type:"string"})],t=this.raster?.rasterInfo??this.serviceRasterInfo,i=t?.attributeTable,s=null!=i?i.fields:null;if(s){const t=s.filter((e=>"oid"!==e.type&&"value"!==e.name.toLowerCase())).map((e=>{const t=e.clone();return t.name="Raster."+e.name,t}));e.push(...t)}const n=t?.dataType,r=t?.multidimensionalInfo;if(("vector-magdir"===n||"vector-uv"===n)&&null!=r){const t=r.variables[0].unit?.trim(),i="Magnitude"+(t?` (${t})`:"");e.push(new be.A({name:"Raster.Magnitude",alias:i,domain:null,editable:!1,type:"double"})),e.push(new be.A({name:"Raster.Direction",alias:"Direction (°)",domain:null,editable:!1,type:"double"}))}return e}createPopupTemplate(e){const{rasterFields:t}=this,i=e?.visibleFieldNames??new Set(t.map((({name:e})=>e)).filter((e=>"raster.servicepixelvalue.raw"!==e.toLowerCase()))),s=(0,_t.tn)({fields:t,title:this.title},{...e,visibleFieldNames:i}),{rasterInfo:n}=this.raster;return s?.fieldInfos&&n?.pixelType.startsWith("f")&&s.fieldInfos.forEach((({format:e,fieldName:t})=>{e&&t&&/^raster\.(item|service)pixelvalue/i.test(t)&&(e.places=2)})),s}async generateRasterInfo(e,t){if(e=(0,f.PZ)(O.A,e),await this.load(),!e||"none"===e.functionName?.toLowerCase())return this.serviceRasterInfo;try{const{rasterInfo:i}=await this._openFunctionRaster(e,t);return i}catch(e){if(e instanceof a.A)throw e;throw new a.A("imagery-tile-layer","the given raster function is not supported")}}async save(e){return this._debouncedSaveOperations(vt.X.SAVE,e)}async saveAs(e,t){return this._debouncedSaveOperations(vt.X.SAVE_AS,t,e)}write(e,t){const i=this._primaryRasters[0]??this.raster;if(this.loaded?"RasterTileServer"===i.datasetFormat&&("Raster"===i.tileType||"Map"===i.tileType):this.url&&/\/ImageServer(\/|\/?$)/i.test(this.url))return super.write(e,t);if(t?.messages){const e=`${t.origin}/${t.layerContainerType||"operational-layers"}`;t.messages.push(new a.A("layer:unsupported",`Layers (${this.title}, ${this.id}) of type '${this.declaredClass}' are not supported in the context of '${e}'`,{layer:this}))}return null}async _openRaster(e){let t=!1;if(this.raster)await this._openFromRaster(this.raster,e),t="Function"===this.raster.datasetFormat,!t&&this.rasterFunction&&(this._primaryRasters=[this.raster],await this._initializeWithFunctionRaster(this.rasterFunction));else{const{url:t,rasterFunction:i,source:s}=this;if(!t&&!s)throw new a.A("imagery-tile-layer:open","missing url or source parameter");s?await this._openFromSource(s,e):i?await this._openFromUrlWithRasterFunction(t,i,e):await this._openFromUrl(t,e)}const i=this.raster.rasterInfo;if(!i)throw new a.A("imagery-tile-layer:load","cannot load resources on "+this.url);if(this._set("serviceRasterInfo",t?i:this._primaryRasters[0].rasterInfo),this._set("spatialReference",i.spatialReference),this.sourceJSON=this.sourceJSON||this.raster.sourceJSON,null!=this.sourceJSON){const e="Map"===this.raster.tileType&&null!=this.sourceJSON.minLOD&&null!=this.sourceJSON.maxLOD?this.sourceJSON:{...this.sourceJSON,minScale:0,maxScale:0};this.read(e,{origin:"service"})}else this.read({tileInfo:this.serviceRasterInfo?.storageInfo.tileInfo.toJSON()},{origin:"service"});this.title||(this.title=this.raster.datasetName),"Map"===this.raster.tileType&&(this.popupEnabled=!1),this._configDefaultSettings(),this.addHandles((0,u.wB)((()=>this.customParameters),(e=>{this.raster&&(this.raster.ioConfig.customFetchParameters=e)})))}async _openFromRaster(e,t){e.rasterInfo||await e.open({signal:t}),this._primaryRasters="Function"===e.datasetFormat?e.primaryRasters.rasters:[e],this.url||(this.url=this._primaryRasters[0].url)}async _openFromUrlWithRasterFunction(e,t,i){const s=[e];t&&(0,ce.UD)(t.toJSON(),s);const n=await Promise.all(s.map((e=>wt.open({url:e,sourceJSON:this.sourceJSON,ioConfig:{sampling:"closest",...this.ioConfig,customFetchParameters:this.customParameters},signal:i})))),r=n.findIndex((e=>null==e));if(r>-1)throw new a.A("imagery-tile-layer:open",`cannot open raster: ${s[r]}`);return this._primaryRasters=n,this._initializeWithFunctionRaster(t)}async _openFromUrl(e,t){const i=await wt.open({url:e,sourceJSON:this.sourceJSON,ioConfig:{sampling:"closest",...this.ioConfig,customFetchParameters:this.customParameters},signal:t});if(null==i)throw new a.A("imagery-tile-layer:open",`cannot open raster: ${e}`);this._primaryRasters=[i],this.raster=i}async _openFromSource(e,t){const i="the tiled imagery data source is not supported",s="coverage"===e.type?.toLowerCase()?"CovJSON":e.extent&&e.pixelBlock?"MEMORY":null;if(!s)throw new a.A("imagery-tile-layer:open",i);"MEMORY"===s&&(e={...e,pixelBlock:void 0,pixelBlocks:[e.pixelBlock]});const n=await wt.open({url:"",source:e,datasetFormat:s,ioConfig:{sampling:"closest",...this.ioConfig,customFetchParameters:this.customParameters},signal:t});if(null==n)throw new a.A("imagery-tile-layer:open",i);this._primaryRasters=[n],this.rasterFunction?await this._initializeWithFunctionRaster(this.rasterFunction):this.raster=n}async _openFunctionRaster(e,t){const i={raster:this._primaryRasters[0]};this._primaryRasters.length>1&&this._primaryRasters.forEach((e=>i[e.url]=e));const s=(0,ce.vt)(e.functionDefinition?.toJSON()??e.toJSON(),i),n=new le({rasterFunction:s});return await n.open(t),n}async _initializeWithFunctionRaster(e,t){try{this.raster=await this._openFunctionRaster(e,t)}catch(e){e instanceof a.A&&o.A.getLogger(this).error("imagery-tile-layer:open",e.message),o.A.getLogger(this).warn("imagery-tile-layer:open","the raster function cannot be applied and is removed"),this._set("rasterFunction",null),this.raster=this._primaryRasters[0]}}};(0,s._)([(0,h.MZ)({clonable:!1})],bt.prototype,"_primaryRasters",void 0),(0,s._)([(0,h.MZ)(T.fV)],bt.prototype,"legendEnabled",void 0),(0,s._)([(0,h.MZ)({type:Boolean,json:{read:!1,write:{enabled:!0,overridePolicy:()=>({enabled:!1})}}})],bt.prototype,"isReference",void 0),(0,s._)([(0,h.MZ)({type:["show","hide"]})],bt.prototype,"listMode",void 0),(0,s._)([(0,h.MZ)({json:{read:!0,write:!0}})],bt.prototype,"blendMode",void 0),(0,s._)([(0,h.MZ)()],bt.prototype,"sourceJSON",void 0),(0,s._)([(0,h.MZ)({readOnly:!0,json:{origins:{service:{read:{source:"currentVersion"}}}}})],bt.prototype,"version",void 0),(0,s._)([(0,h.MZ)({readOnly:!0,json:{read:!1}})],bt.prototype,"type",void 0),(0,s._)([(0,h.MZ)({type:["ArcGISTiledImageServiceLayer"]})],bt.prototype,"operationalLayerType",void 0),(0,s._)([(0,h.MZ)({type:Boolean,value:!0,json:{read:{source:"disablePopup",reader:(e,t)=>!t.disablePopup},write:{target:"disablePopup",overridePolicy(){return{enabled:!this.loaded||"Raster"===this.raster.tileType}},writer(e,t,i){t[i]=!e}}}})],bt.prototype,"popupEnabled",void 0),(0,s._)([(0,h.MZ)({type:n.A,json:{read:{source:"popupInfo"},write:{target:"popupInfo",overridePolicy(){return{enabled:!this.loaded||"Raster"===this.raster.tileType}}}}})],bt.prototype,"popupTemplate",void 0),(0,s._)([(0,h.MZ)({readOnly:!0})],bt.prototype,"defaultPopupTemplate",null),(0,s._)([(0,h.MZ)({readOnly:!0,type:[be.A]})],bt.prototype,"fields",void 0),(0,s._)([(0,h.MZ)({readOnly:!0,type:[be.A]})],bt.prototype,"rasterFields",null),(0,s._)([(0,h.MZ)({constructOnly:!0})],bt.prototype,"source",void 0),bt=(0,s._)([(0,d.$)("esri.layers.ImageryTileLayer")],bt);const It=bt},91806:(e,t,i)=>{i.d(t,{A:()=>u});var s,n=i(90237),r=i(25482),a=i(10107),o=i(56507),l=(i(87811),i(44208),i(40608));let c=s=class extends r.oY{constructor(e){super(e),this.cols=null,this.level=0,this.levelValue=null,this.origin=null,this.resolution=0,this.rows=null,this.scale=0}clone(){return new s({cols:this.cols,level:this.level,levelValue:this.levelValue,resolution:this.resolution,rows:this.rows,scale:this.scale})}};(0,n._)([(0,a.MZ)({json:{write:!0,origins:{"web-document":{read:!1,write:!1},"portal-item":{read:!1,write:!1}}}})],c.prototype,"cols",void 0),(0,n._)([(0,a.MZ)({type:o.jz,json:{write:!0}})],c.prototype,"level",void 0),(0,n._)([(0,a.MZ)({type:String,json:{write:!0}})],c.prototype,"levelValue",void 0),(0,n._)([(0,a.MZ)({json:{write:!0,origins:{"web-document":{read:!1,write:!1},"portal-item":{read:!1,write:!1}}}})],c.prototype,"origin",void 0),(0,n._)([(0,a.MZ)({type:Number,json:{write:!0}})],c.prototype,"resolution",void 0),(0,n._)([(0,a.MZ)({json:{write:!0,origins:{"web-document":{read:!1,write:!1},"portal-item":{read:!1,write:!1}}}})],c.prototype,"rows",void 0),(0,n._)([(0,a.MZ)({type:Number,json:{write:!0}})],c.prototype,"scale",void 0),c=s=(0,n._)([(0,l.$)("esri.layers.support.LOD")],c);const u=c},87045:(e,t,i)=>{i.d(t,{A:()=>R});var s,n=i(90237),r=i(66552),a=i(25482),o=i(83047),l=i(10107),c=i(56507),u=(i(87811),i(44208),i(36005)),h=i(40608),f=i(43937),p=i(86738),d=i(16930),m=i(19419),y=i(21325),g=i(28735),x=i(91806),w=i(72802);const _=new r.J({PNG:"png",PNG8:"png8",PNG24:"png24",PNG32:"png32",JPEG:"jpg",JPG:"jpg",DIB:"dib",TIFF:"tiff",EMF:"emf",PS:"ps",PDF:"pdf",GIF:"gif",SVG:"svg",SVGZ:"svgz",Mixed:"mixed",MIXED:"mixed",LERC:"lerc",LERC2D:"lerc2d",RAW:"raw",pbf:"pbf"});let v=s=class extends a.oY{static create(e={}){const{resolutionFactor:t=1,scales:i,size:n=256,spatialReference:r=d.A.WebMercator,numLODs:a=24}=e;if(!(0,y.fn)(r)){const e=[];if(i)for(let t=0;t<i.length;t++){const s=i[t];e.push(new x.A({level:t,scale:s,resolution:s}))}else{let t=5e-4;for(let i=a-1;i>=0;i--)e.unshift(new x.A({level:i,scale:t,resolution:t})),t*=2}return new s({dpi:96,lods:e,origin:new p.A(0,0,r),size:[n,n],spatialReference:r})}const l=(0,y.Vp)(r),c=e.origin?new p.A({x:e.origin.x,y:e.origin.y,spatialReference:r}):new p.A(l?{x:l.origin[0],y:l.origin[1],spatialReference:r}:{x:0,y:0,spatialReference:r}),u=1/(39.37*(0,o.GA)(r)*96),h=[];if(i)for(let e=0;e<i.length;e++){const t=i[e],s=t*u;h.push(new x.A({level:e,scale:t,resolution:s}))}else{let e=(0,y.EA)(r)?512/n*591657527.5917094:256/n*591657527.591555;const i=Math.ceil(a/t);h.push(new x.A({level:0,scale:e,resolution:e*u}));for(let s=1;s<i;s++){const i=e/2**t,n=i*u;h.push(new x.A({level:s,scale:i,resolution:n})),e=i}}return new s({dpi:96,lods:h,origin:c,size:[n,n],spatialReference:r})}constructor(e){super(e),this.dpi=96,this.format=null,this.origin=null,this.size=null,this.spatialReference=null}get isWrappable(){const{spatialReference:e,origin:t}=this;if(e&&t){const i=(0,y.Vp)(e);return e.isWrappable&&!!i&&Math.abs(i.origin[0]-t.x)<=i.dx}return!1}readOrigin(e,t){return p.A.fromJSON({spatialReference:t.spatialReference,...e})}set lods(e){let t=0,i=0;const s=[],n=this._levelToLOD={};e&&(t=-1/0,i=1/0,e.forEach((e=>{s.push(e.scale),t=e.scale>t?e.scale:t,i=e.scale<i?e.scale:i,n[e.level]=e}))),this._set("scales",s),this._set("lods",e),this._initializeUpsampleLevels()}readSize(e,t){return[t.cols,t.rows]}writeSize(e,t){t.cols=e[0],t.rows=e[1]}zoomToScale(e){const t=this.scales;if(e<=0)return t[0];if(e>=t.length-1)return t[t.length-1];const i=Math.floor(e),s=i+1;return t[i]/(t[i]/t[s])**(e-i)}scaleToZoom(e){const t=this.scales,i=t.length-1;let s=0;for(;s<i;s++){const i=t[s],n=t[s+1];if(i<=e)return s;if(n===e)return s+1;if(i>e&&n<e)return s+Math.log(i/e)/Math.log(i/n)}return s}tileAt(e,t,i,s){const n=this.lodAt(e);if(!n)return null;let r,a;if("number"==typeof t)r=t,a=i;else if((0,y.aI)(t.spatialReference,this.spatialReference))r=t.x,a=t.y,s=i;else{const e=(0,g.Cv)(t,this.spatialReference);if(null==e)return null;r=e.x,a=e.y,s=i}const o=n.resolution*this.size[0],l=n.resolution*this.size[1];return s||(s=new w.U(null,0,0,0,(0,m.vt)())),s.level=e,s.row=Math.floor((this.origin.y-a)/l+.001),s.col=Math.floor((r-this.origin.x)/o+.001),this.updateTileInfo(s),s}updateTileInfo(e,t=s.ExtrapolateOptions.NONE){let i=this.lodAt(e.level);if(!i&&t===s.ExtrapolateOptions.POWER_OF_TWO){const t=this.lods[this.lods.length-1];t.level<e.level&&(i=t)}if(!i)return;const n=e.level-i.level,r=i.resolution*this.size[0]/2**n,a=i.resolution*this.size[1]/2**n;e.id=`${e.level}/${e.row}/${e.col}`,e.extent||(e.extent=(0,m.vt)()),e.extent[0]=this.origin.x+e.col*r,e.extent[1]=this.origin.y-(e.row+1)*a,e.extent[2]=e.extent[0]+r,e.extent[3]=e.extent[1]+a}upsampleTile(e){const t=this._upsampleLevels[e.level];return!(!t||-1===t.parentLevel||(e.level=t.parentLevel,e.row=Math.floor(e.row/t.factor+.001),e.col=Math.floor(e.col/t.factor+.001),this.updateTileInfo(e),0))}getTileBounds(e,t){const i=this.lodAt(t.level);if(null==i)return null;const{resolution:s}=i,n=s*this.size[0],r=s*this.size[1];return e[0]=this.origin.x+t.col*n,e[1]=this.origin.y-(t.row+1)*r,e[2]=e[0]+n,e[3]=e[1]+r,e}lodAt(e){return this._levelToLOD?.[e]??null}clone(){return s.fromJSON(this.write({}))}getCompatibleForVTL(e){if(this.size[0]!==this.size[1]||256===this.size[0]&&512===e)return null;const t=(512===this.size[0]&&256===e?-1:0)+(this.spatialReference.isGeographic?1:0);if(this.size[0]===e&&0===t)return this;const i=[],n=this.lods.length-t;for(let e=0;e<n;e++){const s=e+t,{scale:n,resolution:r}=s>=0?this.lods[s]:{scale:2*this.lods[0].scale,resolution:2*this.lods[0].resolution};i.push(new x.A({level:e,scale:n,resolution:r}))}return new s({size:[e,e],dpi:this.dpi,format:this.format,compressionQuality:this.compressionQuality,origin:this.origin,spatialReference:this.spatialReference,lods:i})}_initializeUpsampleLevels(){const e=this.lods;this._upsampleLevels=[];let t=null;for(let i=0;i<e.length;i++){const s=e[i];this._upsampleLevels[s.level]={parentLevel:t?t.level:-1,factor:t?t.resolution/s.resolution:0},t=s}}};var b,I;(0,n._)([(0,l.MZ)({type:Number,json:{write:!0}})],v.prototype,"compressionQuality",void 0),(0,n._)([(0,l.MZ)({type:Number,json:{write:!0}})],v.prototype,"dpi",void 0),(0,n._)([(0,l.MZ)({type:String,json:{read:_.read,write:_.write,origins:{"web-scene":{read:!1,write:!1}}}})],v.prototype,"format",void 0),(0,n._)([(0,l.MZ)({readOnly:!0})],v.prototype,"isWrappable",null),(0,n._)([(0,l.MZ)({type:p.A,json:{write:!0}})],v.prototype,"origin",void 0),(0,n._)([(0,u.w)("origin")],v.prototype,"readOrigin",null),(0,n._)([(0,l.MZ)({type:[x.A],value:null,json:{write:!0}})],v.prototype,"lods",null),(0,n._)([(0,l.MZ)({readOnly:!0})],v.prototype,"scales",void 0),(0,n._)([(0,l.MZ)({cast:e=>Array.isArray(e)?e:"number"==typeof e?[e,e]:[256,256]})],v.prototype,"size",void 0),(0,n._)([(0,u.w)("size",["rows","cols"])],v.prototype,"readSize",null),(0,n._)([(0,f.K)("size",{cols:{type:c.jz},rows:{type:c.jz}})],v.prototype,"writeSize",null),(0,n._)([(0,l.MZ)({type:d.A,json:{write:!0}})],v.prototype,"spatialReference",void 0),v=s=(0,n._)([(0,h.$)("esri.layers.support.TileInfo")],v),b=v||(v={}),(I=b.ExtrapolateOptions||(b.ExtrapolateOptions={}))[I.NONE=0]="NONE",I[I.POWER_OF_TWO=1]="POWER_OF_TWO";const R=v},72802:(e,t,i)=>{i.d(t,{U:()=>s});class s{constructor(e,t,i,s,n=void 0){this.id=e,this.level=t,this.row=i,this.col=s,this.extent=n}}},25943:(e,t,i)=>{i.d(t,{d:()=>R});var s,n=i(90237),r=i(78888),a=i(69622),o=i(71903),l=i(49186),c=i(36563),u=(i(44208),i(66344)),h=i(3694),f=i(74887),p=i(36708),d=i(11932),m=i(84952),y=i(10107),g=(i(53966),i(87811),i(40608)),x=i(72802),w=i(4718),_=i(34275);class v{constructor(e){!function(e){if(!e?.location)throw new l.A("tilemap:missing-location","Location missing from tilemap response");if(!1===e.valid)throw new l.A("tilemap:invalid","Tilemap response was marked as invalid");if(!e.data)throw new l.A("tilemap:missing-data","Data missing from tilemap response");if(!Array.isArray(e.data))throw new l.A("tilemap:data-mismatch","Data must be an array of numbers");if(e.data.length!==e.location.width*e.location.height)throw new l.A("tilemap:data-mismatch","Number of data items does not match width/height of tilemap")}(e);const{location:t,data:i}=e;this.location=Object.freeze((0,w.o8)(t));const s=this.location.width,n=this.location.height;let r=!0,a=!0;const o=function(e,t=!1){return e<=_.y9?t?new Array(e).fill(0):new Array(e):new Uint32Array(e)}(Math.ceil(s*n/32));let c=0;for(let e=0;e<i.length;e++){const t=e%32;i[e]?(a=!1,o[c]|=1<<t):r=!1,31===t&&++c}a?(this._availability="unavailable",this.byteSize=40):r?(this._availability="available",this.byteSize=40):(this._availability=o,this.byteSize=40+(0,_.Ek)(o))}getAvailability(e,t){if("unavailable"===this._availability||"available"===this._availability)return this._availability;const i=(e-this.location.top)*this.location.width+(t-this.location.left),s=i%32,n=i>>5,r=this._availability;return n<0||n>r.length?"unknown":r[n]&1<<s?"available":"unavailable"}static fromDefinition(e,t){const i=e.service.request||r.A,{row:s,col:n,width:a,height:o}=e,c={query:{f:"json"}};return t=t?{...c,...t}:c,i(function(e){let t;if(e.service.tileServers?.length){const i=e.service.tileServers;t=`${i&&i.length?i[e.row%i.length]:e.service.url}/tilemap/${e.level}/${e.row}/${e.col}/${e.width}/${e.height}`}else t=`${e.service.url}/tilemap/${e.level}/${e.row}/${e.col}/${e.width}/${e.height}`;const i=e.service.query;return i&&(t=`${t}?${i}`),t}(e),t).then((e=>e.data)).catch((e=>{if(422===e?.details?.httpStatus)return{location:{top:s,left:n,width:a,height:o},valid:!0,data:new Array(a*o).fill(0)};throw e})).then((e=>{if(e.location&&(e.location.top!==s||e.location.left!==n||e.location.width!==a||e.location.height!==o))throw new l.A("tilemap:location-mismatch","Tilemap response for different location than requested",{response:e,definition:{top:s,left:n,width:a,height:o}});return v.fromJSON(e)}))}static fromJSON(e){return Object.freeze(new v(e))}}function b(e){return`${e.level}/${e.row}/${e.col}/${e.width}/${e.height}`}function I(e,t,i){return new l.A("tile-map:tile-unavailable","Tile is not available",{level:e,row:t,col:i})}let R=s=class extends a.A{constructor(e){super(e),this._pendingTilemapRequests={},this.request=r.A,this.size=32,this._prefetchingEnabled=!0}initialize(){this._tilemapCache=new u.q(2*o.u.MEGABYTES),this.addHandles((0,p.wB)((()=>{const{layer:e}=this;return[e?.parsedUrl,e?.tileServers,e?.apiKey,e?.customParameters]}),(()=>this._initializeTilemapDefinition()),p.Vh))}get effectiveMinLOD(){return this.minLOD??this.layer.tileInfo.lods[0].level}get effectiveMaxLOD(){return this.maxLOD??this.layer.tileInfo.lods[this.layer.tileInfo.lods.length-1].level}getAvailability(e,t,i){if(!this.layer.tileInfo.lodAt(e)||e<this.effectiveMinLOD||e>this.effectiveMaxLOD)return"unavailable";const s=this._tilemapFromCache(e,t,i,this._tmpTilemapDefinition);return s?s.getAvailability(t,i):"unknown"}fetchAvailability(e,t,i,s){return!this.layer.tileInfo.lodAt(e)||e<this.effectiveMinLOD||e>this.effectiveMaxLOD?Promise.reject(I(e,t,i)):this._fetchTilemap(e,t,i,s).catch((e=>e)).then((s=>{if(s instanceof v){const n=s.getAvailability(t,i);if("unavailable"===n)throw I(e,t,i);return n}if((0,f.zf)(s))throw s;return"unknown"}))}fetchAvailabilityUpsample(e,t,i,s,n){s.level=e,s.row=t,s.col=i;const r=this.layer.tileInfo;r.updateTileInfo(s);const a=this.fetchAvailability(e,t,i,n).catch((e=>{if((0,f.zf)(e))throw e;if(r.upsampleTile(s))return this.fetchAvailabilityUpsample(s.level,s.row,s.col,s,n);throw e}));return this._fetchAvailabilityUpsamplePrefetch(s.id,e,t,i,n,a),a}async _fetchAvailabilityUpsamplePrefetch(e,t,i,n,r,a){if(!this._prefetchingEnabled||null==e)return;const o=`prefetch-${e}`;if(this.hasHandles(o))return;const l=new AbortController;a.then((()=>l.abort()),(()=>l.abort()));let u=!1;const h=(0,c.hA)((()=>{u||(u=!0,l.abort())}));if(this.addHandles(h,o),await(0,d.md)(10,l.signal).catch((()=>{})),u||(u=!0,this.removeHandles(o)),(0,f.G4)(l))return;const p=new x.U(e,t,i,n),m={...r,signal:l.signal},y=this.layer.tileInfo;for(let e=0;s._prefetches.length<s._maxPrefetch&&y.upsampleTile(p);++e){const e=this.fetchAvailability(p.level,p.row,p.col,m);s._prefetches.push(e);const t=()=>{s._prefetches.removeUnordered(e)};e.then(t,t)}}_fetchTilemap(e,t,i,s){if(!this.layer.tileInfo.lodAt(e)||e<this.effectiveMinLOD||e>this.effectiveMaxLOD)return Promise.reject(new l.A("tilemap-cache:level-unavailable",`Level ${e} is unavailable in the service`));const n=this._tmpTilemapDefinition,r=this._tilemapFromCache(e,t,i,n);if(r)return Promise.resolve(r);const a=s?.signal;return s={...s,signal:null},new Promise(((e,t)=>{(0,f.u7)(a,(()=>t((0,f.NK)())));const i=b(n);let r=this._pendingTilemapRequests[i];if(!r){r=v.fromDefinition(n,s).then((e=>(this._tilemapCache.put(i,e,e.byteSize),e)));const e=()=>{delete this._pendingTilemapRequests[i]};this._pendingTilemapRequests[i]=r,r.then(e,e)}r.then(e,t)}))}_initializeTilemapDefinition(){if(!this.layer.parsedUrl)return;const{parsedUrl:e,apiKey:t,customParameters:i}=this.layer;this._tilemapCache.clear(),this._tmpTilemapDefinition={service:{url:e.path,query:(0,m.x0)({...e.query,...i,token:t??e.query?.token}),tileServers:this.layer.tileServers,request:this.request},width:this.size,height:this.size,level:0,row:0,col:0}}_tilemapFromCache(e,t,i,s){s.level=e,s.row=t-t%this.size,s.col=i-i%this.size;const n=b(s);return this._tilemapCache.get(n)}get test(){}};R._maxPrefetch=4,R._prefetches=new h.A({initialSize:s._maxPrefetch}),(0,n._)([(0,y.MZ)({constructOnly:!0})],R.prototype,"layer",void 0),(0,n._)([(0,y.MZ)({constructOnly:!0})],R.prototype,"minLOD",void 0),(0,n._)([(0,y.MZ)({constructOnly:!0})],R.prototype,"maxLOD",void 0),(0,n._)([(0,y.MZ)({constructOnly:!0})],R.prototype,"request",void 0),(0,n._)([(0,y.MZ)({constructOnly:!0})],R.prototype,"size",void 0),R=s=(0,n._)([(0,g.$)("esri.layers.support.TilemapCache")],R)},92300:(e,t,i)=>{i.d(t,{V:()=>r,X:()=>n});var s=i(65864);function n(e){return{geometryType:(0,s.$B)(e[0]),geometries:e.map((e=>e.toJSON()))}}function r(e,t,i){const n=(0,s.xD)(t);return e.map((e=>{const t=n.fromJSON(e);return t.spatialReference=i,t}))}},2272:(e,t,i)=>{i.d(t,{Dl:()=>a,jV:()=>r,lF:()=>o}),i(92602),i(70333);var s=i(4718),n=i(84952);function r(e,t){return t?{...t,query:{...e??{},...t.query}}:{query:e}}function a(e){return"string"==typeof e?(0,n.An)(e):(0,s.o8)(e)}function o(e,t,i){const s={};for(const n in e){if("declaredClass"===n)continue;const r=e[n];if(null!=r&&"function"!=typeof r)if(Array.isArray(r))s[n]=r.map((e=>o(e)));else if("object"==typeof r)if(r.toJSON){const e=r.toJSON(i?.[n]);s[n]=t?e:JSON.stringify(e)}else s[n]=t?r:JSON.stringify(r);else s[n]=r}return s}i(926)},79677:(e,t,i)=>{i.d(t,{A:()=>p});var s,n=i(90237),r=i(25482),a=i(88930),o=i(10107),l=(i(44208),i(53966),i(87811),i(36005)),c=i(40608),u=i(43937),h=i(56400);let f=s=class extends r.oY{static get allTime(){return d}static get empty(){return m}static fromArray(e){return new s({start:null!=e[0]?new Date(e[0]):e[0],end:null!=e[1]?new Date(e[1]):e[1]})}constructor(e){super(e),this.end=null,this.start=null}readEnd(e,t){return null!=t.end?new Date(t.end):null}writeEnd(e,t){t.end=e?.getTime()??null}get isAllTime(){return this.equals(s.allTime)}get isEmpty(){return this.equals(s.empty)}readStart(e,t){return null!=t.start?new Date(t.start):null}writeStart(e,t){t.start=e?.getTime()??null}clone(){return new s({end:this.end,start:this.start})}equals(e){if(!e)return!1;const t=this.start?.getTime()??this.start,i=this.end?.getTime()??this.end,s=e.start?.getTime()??e.start,n=e.end?.getTime()??e.end;return t===s&&i===n}expandTo(e,t=h.qU){if(this.isEmpty||this.isAllTime)return this.clone();let i=this.start;i&&(i=(0,a.lL)(i,e,t));let n=this.end;if(n){const i=(0,a.lL)(n,e,t);n=n.getTime()===i.getTime()?i:(0,a.S1)(i,1,e,t)}return new s({start:i,end:n})}intersection(e){if(!e)return this.clone();if(this.isEmpty||e.isEmpty)return s.empty;if(this.isAllTime)return e.clone();if(e.isAllTime)return this.clone();const t=this.start?.getTime()??-1/0,i=this.end?.getTime()??1/0,n=e.start?.getTime()??-1/0,r=e.end?.getTime()??1/0;let a,o;return n>=t&&n<=i?a=n:t>=n&&t<=r&&(a=t),i>=n&&i<=r?o=i:r>=t&&r<=i&&(o=r),null==a||null==o||isNaN(a)||isNaN(o)?s.empty:new s({start:a===-1/0?null:new Date(a),end:o===1/0?null:new Date(o)})}offset(e,t,i=h.qU){if(this.isEmpty||this.isAllTime)return this.clone();const n=new s,{start:r,end:o}=this;return null!=r&&(n.start=(0,a.S1)(r,e,t,i)),null!=o&&(n.end=(0,a.S1)(o,e,t,i)),n}toArray(){return this.isEmpty?[void 0,void 0]:[this.start?.getTime()??null,this.end?.getTime()??null]}union(e){if(!e||e.isEmpty)return this.clone();if(this.isEmpty)return e.clone();if(this.isAllTime||e.isAllTime)return d.clone();const t=null!=this.start&&null!=e.start?new Date(Math.min(this.start.getTime(),e.start.getTime())):null,i=null!=this.end&&null!=e.end?new Date(Math.max(this.end.getTime(),e.end.getTime())):null;return new s({start:t,end:i})}};(0,n._)([(0,o.MZ)({type:Date,json:{write:{allowNull:!0}}})],f.prototype,"end",void 0),(0,n._)([(0,l.w)("end")],f.prototype,"readEnd",null),(0,n._)([(0,u.K)("end")],f.prototype,"writeEnd",null),(0,n._)([(0,o.MZ)({readOnly:!0,json:{read:!1}})],f.prototype,"isAllTime",null),(0,n._)([(0,o.MZ)({readOnly:!0,json:{read:!1}})],f.prototype,"isEmpty",null),(0,n._)([(0,o.MZ)({type:Date,json:{write:{allowNull:!0}}})],f.prototype,"start",void 0),(0,n._)([(0,l.w)("start")],f.prototype,"readStart",null),(0,n._)([(0,u.K)("start")],f.prototype,"writeStart",null),f=s=(0,n._)([(0,c.$)("esri.time.TimeExtent")],f);const p=f,d=new f,m=new f({start:void 0,end:void 0})},89738:(e,t,i)=>{i.d(t,{e:()=>u}),i(44208);var s=i(97768),n=i(74887),r=i(9775),a=i(32587),o=i(11932),l=i(44794);class c{constructor(e,t){this.item=e,this.controller=t,this.promise=null}}class u{constructor(e){this._schedule=null,this._task=null,this._deferreds=new a.A,this._controllers=new a.A,this._processingItems=new a.A,this._pausedSignal=(0,l.v)(!1),this.concurrency=1,e.concurrency&&(this.concurrency=e.concurrency),this._queue=new r.A(e.peeker),this.process=e.process;const t=e.scheduler;e.priority&&t&&(this._task=t.registerTask(e.priority,this))}destroy(){this.clear(),this._schedule=(0,s.xt)(this._schedule),this._task=(0,s.xt)(this._task)}get updating(){return!!this._task?.updating||this.running}get length(){return this._processingItems.size+this._queue.length}abort(e){const t=this._controllers.get(e);t&&t.abort()}clear(){this._queue.clear();const e=[];this._controllers.forEach((t=>e.push(t))),this._controllers.clear(),e.forEach((e=>e.abort())),this._processingItems.clear(),this._cancelNext()}forEach(e){this._deferreds.forEach(((t,i)=>e(i)))}get(e){const t=this._deferreds.get(e);return t?t.promise:void 0}isOngoing(e){return this._processingItems.has(e)}has(e){return this._deferreds.has(e)}pause(){this._pausedSignal.value||(this._pausedSignal.value=!0,this._cancelNext())}push(e,t){const i=this.get(e);if(i)return i;const s=new AbortController;let r=null;t&&(r=(0,n.u7)(t,(()=>s.abort())));const a=()=>{o.remove(),null!=r&&r.remove(),this._removeItem(e),this._queue.remove(e),this._scheduleNext()},o=(0,n.NY)(s.signal,(()=>{const t=this._processingItems.get(e);t&&t.controller.abort(),a(),l.reject((0,n.NK)())})),l=(0,n.Tw)();return this._deferreds.set(e,l),this._controllers.set(e,s),l.promise.then(a,a),this._queue.push(e),this._scheduleNext(),l.promise}last(){return this._queue.last()}lastPromise(){const e=this.last();return e?this.get(e):null}peek(){return this._queue.peek()}popLast(){const e=this._queue.popLast();return e&&(this._deferreds.get(e)?.reject((0,n.NK)()),this._removeItem(e)),e}reset(){const e=Array.from(this._processingItems.values());this._processingItems.clear();for(const t of e)this._queue.push(t.item),t.controller.abort();this._scheduleNext()}resume(){this._pausedSignal.value&&(this._pausedSignal.value=!1,this._scheduleNext())}takeAll(){const e=[];for(;this._queue.length;)e.push(this._queue.pop());return this.clear(),e}get running(){return!this._pausedSignal.value&&this._queue.length>0&&this._processingItems.size<this.concurrency}runTask(e){for(;!e.done&&this._queue.length>0&&this._processingItems.size<this.concurrency;)this._process(this._queue.pop()),e.madeProgress()}_removeItem(e){this._deferreds.delete(e),this._controllers.delete(e),this._processingItems.delete(e)}_scheduleNext(){this._task||this._pausedSignal.value||this._schedule||(this._schedule=(0,o._)((()=>{this._schedule=null,this._next()})))}_next(){for(;this._queue.length>0&&this._processingItems.size<this.concurrency;)this._process(this._queue.pop())}_cancelNext(){this._schedule&&(this._schedule.remove(),this._schedule=null)}_processResult(e,t){this._canProcessFulfillment(e)&&(this._scheduleNext(),this._deferreds.get(e.item).resolve(t))}_processError(e,t){this._canProcessFulfillment(e)&&(this._scheduleNext(),this._deferreds.get(e.item).reject(t))}_canProcessFulfillment(e){return!!this._deferreds.get(e.item)&&this._processingItems.get(e.item)===e}_process(e){if(null==e)return;let t;const i=new AbortController,s=new c(e,i);this._processingItems.set(e,s);try{t=this.process(e,i.signal)}catch(e){this._processError(s,e)}(0,n.$X)(t)?(s.promise=t,t.then((e=>this._processResult(s,e)),(e=>this._processError(s,e)))):this._processResult(s,t)}get test(){}}}}]);
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[7367],{21818:(e,t,r)=>{function n(e){}r.d(t,{Xb:()=>n}),r(44208)},51624:(e,t,r)=>{r.d(t,{A:()=>c});var n,s,o=r(44208),i=r(93687);(s=n||(n={}))[s.varint=0]="varint",s[s.fixed64=1]="fixed64",s[s.delimited=2]="delimited",s[s.fixed32=5]="fixed32",s[s.unknown=99]="unknown";const a=4294967296,l=new TextDecoder("utf-8"),u=(0,o.A)("safari")||(0,o.A)("ios")?6:(0,o.A)("ff")?12:32;class c{constructor(e,t,r=0,s=(e?e.byteLength:0)){this._tag=0,this._dataType=n.unknown,this._init(e,t,r,s)}_init(e,t,r,n){this._data=e,this._dataView=t,this._pos=r,this._end=n}asUnsafe(){return this}clone(){return new c(this._data,this._dataView,this._pos,this._end)}pos(){return this._pos}move(e){this._pos=e}nextTag(e){for(;;){if(this._pos===this._end)return!1;const t=this._decodeVarint();if(this._tag=t>>3,this._dataType=7&t,!e||e===this._tag)break;this.skip()}return!0}next(){if(this._pos===this._end)return!1;const e=this._decodeVarint();return this._tag=e>>3,this._dataType=7&e,!0}empty(){return this._pos>=this._end}tag(){return this._tag}getInt32(){return this._decodeVarint()}getInt64(){return this._decodeVarint()}getUInt32(){let e=4294967295;if(e=(127&this._data[this._pos])>>>0,this._data[this._pos++]<128)return e;if(e=(e|(127&this._data[this._pos])<<7)>>>0,this._data[this._pos++]<128)return e;if(e=(e|(127&this._data[this._pos])<<14)>>>0,this._data[this._pos++]<128)return e;if(e=(e|(127&this._data[this._pos])<<21)>>>0,this._data[this._pos++]<128)return e;if(e=(e|(15&this._data[this._pos])<<28)>>>0,this._data[this._pos++]<128)return e;throw new Error("Varint overflow")}getUInt64(){return this._decodeVarint()}getSInt32(){const e=this.getUInt32();return e>>>1^-(1&e)}getSInt64(){return this._decodeSVarint()}getBool(){const e=0!==this._data[this._pos];return this._skip(1),e}getEnum(){return this._decodeVarint()}getFixed64(){const e=this._dataView,t=this._pos,r=e.getUint32(t,!0)+e.getUint32(t+4,!0)*a;return this._skip(8),r}getSFixed64(){const e=this._dataView,t=this._pos,r=e.getUint32(t,!0)+e.getInt32(t+4,!0)*a;return this._skip(8),r}getDouble(){const e=this._dataView.getFloat64(this._pos,!0);return this._skip(8),e}getFixed32(){const e=this._dataView.getUint32(this._pos,!0);return this._skip(4),e}getSFixed32(){const e=this._dataView.getInt32(this._pos,!0);return this._skip(4),e}getFloat(){const e=this._dataView.getFloat32(this._pos,!0);return this._skip(4),e}getString(){const e=this._getLength(),t=this._pos,r=this._toString(this._data,t,t+e);return this._skip(e),r}getBytes(){const e=this._getLength(),t=this._pos,r=this._toBytes(this._data,t,t+e);return this._skip(e),r}getLength(){return this._getLengthUnsafe()}processMessageWithArgs(e,t,r,n){const s=this.getMessage(),o=e(s,t,r,n);return s.release(),o}processMessage(e){const t=this.getMessage(),r=e(t);return t.release(),r}getMessage(){const e=this._getLength(),t=c.pool.acquire();return t._init(this._data,this._dataView,this._pos,this._pos+e),this._skip(e),t}release(){c.pool.release(this)}dataType(){return this._dataType}skip(){switch(this._dataType){case n.varint:this._decodeVarint();break;case n.fixed64:this._skip(8);break;case n.delimited:this._skip(this._getLength());break;case n.fixed32:this._skip(4);break;default:throw new Error("Invalid data type!")}}skipLen(e){this._skip(e)}_skip(e){if(this._pos+e>this._end)throw new Error("Attempt to skip past the end of buffer!");this._pos+=e}_decodeVarint(){const e=this._data;let t=this._pos,r=0,n=0;if(this._end-t>=10)do{if(n=e[t++],r|=127&n,!(128&n))break;if(n=e[t++],r|=(127&n)<<7,!(128&n))break;if(n=e[t++],r|=(127&n)<<14,!(128&n))break;if(n=e[t++],r|=(127&n)<<21,!(128&n))break;if(n=e[t++],r+=268435456*(127&n),!(128&n))break;if(n=e[t++],r+=34359738368*(127&n),!(128&n))break;if(n=e[t++],r+=4398046511104*(127&n),!(128&n))break;if(n=e[t++],r+=562949953421312*(127&n),!(128&n))break;if(n=e[t++],r+=72057594037927940*(127&n),!(128&n))break;if(n=e[t++],r+=0x8000000000000000*(127&n),!(128&n))break;throw new Error("Varint too long!")}while(0);else{let s=1;for(;t!==this._end&&(n=e[t],128&n);)++t,r+=(127&n)*s,s*=128;if(t===this._end)throw new Error("Varint overrun!");++t,r+=n*s}return this._pos=t,r}_decodeSVarint(){const e=this._data;let t,r=0,n=0;const s=1&e[this._pos];if(n=e[this._pos++],r|=127&n,!(128&n))return s?-(r+1)/2:r/2;if(n=e[this._pos++],r|=(127&n)<<7,!(128&n))return s?-(r+1)/2:r/2;if(n=e[this._pos++],r|=(127&n)<<14,!(128&n))return s?-(r+1)/2:r/2;if(n=e[this._pos++],r|=(127&n)<<21,!(128&n))return s?-(r+1)/2:r/2;if(n=e[this._pos++],r+=268435456*(127&n),!(128&n))return s?-(r+1)/2:r/2;if(n=e[this._pos++],r+=34359738368*(127&n),!(128&n))return s?-(r+1)/2:r/2;if(n=e[this._pos++],r+=4398046511104*(127&n),!(128&n))return s?-(r+1)/2:r/2;if(t=BigInt(r),n=e[this._pos++],t+=0x2000000000000n*BigInt(127&n),!(128&n))return Number(s?-(t+1n)/2n:t/2n);if(n=e[this._pos++],t+=0x100000000000000n*BigInt(127&n),!(128&n))return Number(s?-(t+1n)/2n:t/2n);if(n=e[this._pos++],t+=0x8000000000000000n*BigInt(127&n),!(128&n))return Number(s?-(t+1n)/2n:t/2n);throw new Error("Varint too long!")}_getLength(){if(this._dataType!==n.delimited)throw new Error("Not a delimited data type!");return this._decodeVarint()}_getLengthUnsafe(){return this.getUInt32()}_toString(e,t,r){if((r=Math.min(this._end,r))-t>u){const n=e.subarray(t,r);return l.decode(n)}let n="",s="";for(let o=t;o<r;++o){const t=e[o];128&t?s+="%"+t.toString(16):(n+=decodeURIComponent(s)+String.fromCharCode(t),s="")}return s.length&&(n+=decodeURIComponent(s)),n}_toBytes(e,t,r){return r=Math.min(this._end,r),new Uint8Array(e.buffer,t,r-t)}}c.pool=new i.A(c,void 0,(e=>{e._data=null,e._dataView=null}))},4197:(e,t,r)=>{r.d(t,{jh:()=>s,l5:()=>i,xm:()=>o});var n=r(34275);function s(e,t=!1){return e<=n.y9?t?new Array(e).fill(0):new Array(e):new Float64Array(e)}function o(e){return((0,n.cy)(e)?e.length:e.byteLength/8)<=n.y9?Array.from(e):new Float64Array(e)}function i(e,t,r){return Array.isArray(e)?e.slice(t,t+r):e.subarray(t,t+r)}},70328:(e,t,r)=>{r.d(t,{BI:()=>I,Ej:()=>m,Ie:()=>T,Jt:()=>k,Ne:()=>_,RF:()=>c,_F:()=>y,aI:()=>x,fA:()=>i,gE:()=>l,gX:()=>g,hZ:()=>w,iT:()=>h,is:()=>M,qv:()=>v,vI:()=>b,vY:()=>a,v_:()=>F,vt:()=>o,w1:()=>u});var n=r(5443),s=(r(19419),r(4197));function o(e=F){return[e[0],e[1],e[2],e[3],e[4],e[5]]}function i(e,t,r,n,s,i,a=o()){return a[0]=e,a[1]=t,a[2]=r,a[3]=n,a[4]=s,a[5]=i,a}function a(e,t=o()){return function(e,t,r,n=o()){return w(n,v),function(e,t,r=0,n=t.length/3){let s=e[0],o=e[1],i=e[2],a=e[3],l=e[4],u=e[5];for(let e=0;e<n;e++)s=Math.min(s,t[r+3*e]),o=Math.min(o,t[r+3*e+1]),i=Math.min(i,t[r+3*e+2]),a=Math.max(a,t[r+3*e]),l=Math.max(l,t[r+3*e+1]),u=Math.max(u,t[r+3*e+2]);e[0]=s,e[1]=o,e[2]=i,e[3]=a,e[4]=l,e[5]=u}(n,e,t,r),n}(e,0,e.length/3,t)}function l(e,t=(0,s.jh)(24)){const[r,n,o,i,a,l]=e;return t[0]=r,t[1]=n,t[2]=o,t[3]=r,t[4]=n,t[5]=l,t[6]=r,t[7]=a,t[8]=o,t[9]=r,t[10]=a,t[11]=l,t[12]=i,t[13]=n,t[14]=o,t[15]=i,t[16]=n,t[17]=l,t[18]=i,t[19]=a,t[20]=o,t[21]=i,t[22]=a,t[23]=l,t}function u(e,t){const r=isFinite(e[2])||isFinite(e[5]);return new n.A(r?{xmin:e[0],xmax:e[3],ymin:e[1],ymax:e[4],zmin:e[2],zmax:e[5],spatialReference:t}:{xmin:e[0],xmax:e[3],ymin:e[1],ymax:e[4],spatialReference:t})}function c(e,t){e[0]=Math.min(e[0],t[0]),e[1]=Math.min(e[1],t[1]),e[2]=Math.min(e[2],t[2]),e[3]=Math.max(e[3],t[3]),e[4]=Math.max(e[4],t[4]),e[5]=Math.max(e[5],t[5])}function h(e,t){e[0]=Math.min(e[0],t[0]),e[1]=Math.min(e[1],t[1]),e[2]=Math.min(e[2],t[2]),e[3]=Math.max(e[3],t[0]),e[4]=Math.max(e[4],t[1]),e[5]=Math.max(e[5],t[2])}function d(e){return e[0]>=e[3]?0:e[3]-e[0]}function f(e){return e[1]>=e[4]?0:e[4]-e[1]}function p(e){return e[2]>=e[5]?0:e[5]-e[2]}function y(e){const t=d(e),r=p(e),n=f(e);return Math.sqrt(t*t+r*r+n*n)}function g(e,t=[0,0,0]){return t[0]=e[0]+d(e)/2,t[1]=e[1]+f(e)/2,t[2]=e[2]+p(e)/2,t}function m(e,t=[0,0,0]){return t[0]=d(e),t[1]=f(e),t[2]=p(e),t}function _(e,t,r=e){return r[0]=t[0],r[1]=t[1],r[2]=t[2],r!==e&&(r[3]=e[3],r[4]=e[4],r[5]=e[5]),r}function b(e,t,r=e){return r[3]=t[0],r[4]=t[1],r[5]=t[2],r!==e&&(r[0]=e[0],r[1]=e[1],r[2]=e[2]),e}function w(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e}function T(e){return e?w(e,v):o(v)}function k(e,t){return e[0]=t[0],e[1]=t[1],e[2]=Number.NEGATIVE_INFINITY,e[3]=t[2],e[4]=t[3],e[5]=Number.POSITIVE_INFINITY,e}function I(e,t,r,n,s){return e[0]=t,e[1]=r,e[2]=Number.NEGATIVE_INFINITY,e[3]=n,e[4]=s,e[5]=Number.POSITIVE_INFINITY,e}function M(e){return 6===e.length}function x(e,t,r){if(null==e||null==t)return e===t;if(!M(e)||!M(t))return!1;if(r){for(let n=0;n<e.length;n++)if(!r(e[n],t[n]))return!1}else for(let r=0;r<e.length;r++)if(e[r]!==t[r])return!1;return!0}const v=[1/0,1/0,1/0,-1/0,-1/0,-1/0],F=[0,0,0,0,0,0];o()},65864:(e,t,r)=>{r.d(t,{$B:()=>y,Bi:()=>f,Rg:()=>d,U9:()=>c,ZC:()=>u,fT:()=>h,rS:()=>p,xD:()=>m});var n=r(5443),s=r(91075),o=r(48526),i=r(86738),a=r(39829),l=r(82799);function u(e){return void 0!==e.xmin&&void 0!==e.ymin&&void 0!==e.xmax&&void 0!==e.ymax}function c(e){return void 0!==e.points}function h(e){return void 0!==e.x&&void 0!==e.y}function d(e){return void 0!==e.paths}function f(e){return void 0!==e.rings}function p(e){return null==e?null:e instanceof s.A?e:h(e)?i.A.fromJSON(e):d(e)?l.A.fromJSON(e):f(e)?a.A.fromJSON(e):c(e)?o.A.fromJSON(e):u(e)?n.A.fromJSON(e):null}function y(e){return e?h(e)?"esriGeometryPoint":d(e)?"esriGeometryPolyline":f(e)?"esriGeometryPolygon":u(e)?"esriGeometryEnvelope":c(e)?"esriGeometryMultipoint":null:null}const g={esriGeometryPoint:i.A,esriGeometryPolyline:l.A,esriGeometryPolygon:a.A,esriGeometryEnvelope:n.A,esriGeometryMultipoint:o.A,esriGeometryMultiPatch:a.A};function m(e){return e&&g[e]||null}},62577:(e,t,r)=>{function n(e){return e?{originPosition:"upper-left"===e.originPosition?"upperLeft":"lower-left"===e.originPosition?"lowerLeft":e.originPosition,scale:e.tolerance?[e.tolerance,e.tolerance,1,1]:[1,1,1,1],translate:null!=e.extent?[e.extent.xmin,e.extent.ymax,e.extent.zmin??0,e.extent.mmin??0]:[0,0,0,0]}:null}function s(e){if(function(e){return"lowerLeft"===e.originPosition&&4===e.scale.length&&4===e.translate.length}(e))return e;const{originPosition:t,scale:r,translate:n}=e,s=r[0]??1,o=r[1]??1;return{originPosition:"lowerLeft",scale:[s,"lowerLeft"===t?o:-o,r[2]??1,r[3]??1],translate:[n[0]??0,n[1]??0,n[2]??0,n[3]??0]}}function o({scale:e,translate:t},r){return r*e[0]+t[0]}function i({scale:e,translate:t},r){return r*e[1]+t[1]}function a({scale:e,translate:t},r){return(r??0)*e[2]+t[2]}function l({scale:e,translate:t},r){return r?r*e[3]+t[3]:0}function u(e,t){return e&&t?f:e&&!t?h:!e&&t?d:c}r.d(t,{$X:()=>_,Gy:()=>y,P5:()=>b,Q1:()=>s,SW:()=>g,Tr:()=>m,VV:()=>n}),r(65864);const c=(e,t)=>{const r=new Array(t.length);if(!t.length)return r;const n=t[0];let s=o(e,n[0]),a=i(e,n[1]);r[0]=[s,a];const{scale:l,originPosition:u}=e,c=l[0],h="lowerLeft"===u?l[1]:-l[1];for(let e=1;e<t.length;e++){const[n,o]=t[e];s+=c*n,a+=h*o,r[e]=[s,a]}return r},h=(e,t)=>{const r=new Array(t.length);if(!t.length)return r;const n=t[0];let s=o(e,n[0]),l=i(e,n[1]);r[0]=[s,l,a(e,n[2])];const{scale:u,originPosition:c}=e,h=u[0],d="lowerLeft"===c?u[1]:-u[1];for(let n=1;n<t.length;n++){const[o,i,u]=t[n];s+=h*o,l+=d*i,r[n]=[s,l,a(e,u)]}return r},d=(e,t)=>{const r=new Array(t.length);if(!t.length)return r;const n=t[0];let s=o(e,n[0]),a=i(e,n[1]);r[0]=[s,a,l(e,n[2])];const{scale:u,originPosition:c}=e,h=u[0],d="lowerLeft"===c?u[1]:-u[1];for(let n=1;n<t.length;n++){const[o,i,u]=t[n];s+=h*o,a+=d*i,r[n]=[s,a,l(e,u)]}return r},f=(e,t)=>{const r=new Array(t.length);if(!t.length)return r;const n=t[0];let s=o(e,n[0]),u=i(e,n[1]);r[0]=[s,u,a(e,n[2]),l(e,n[3])];const{scale:c,originPosition:h}=e,d=c[0],f="lowerLeft"===h?c[1]:-c[1];for(let n=1;n<t.length;n++){const[o,i,c,h]=t[n];s+=d*o,u+=f*i,r[n]=[s,u,a(e,c),l(e,h)]}return r};function p(e,t,r){const n=new Array(r.length);for(let s=0;s<r.length;s++)n[s]=t(e,r[s]);return n}function y(e,t,r){const n=s(e);return t.x=function({scale:e,translate:t},r){return Math.round((r-t[0])/e[0])}(n,r.x),t.y=function({scale:e,translate:t},r){return Math.round((r-t[1])/e[1])}(n,r.y),null!=r.z&&(t.z=function({scale:e,translate:t},r){return Math.round(((r??0)-t[2])/e[2])}(n,r.z)),null!=r.m&&(t.m=function({scale:e,translate:t},r){return r?Math.round((r-t[3])/e[3]):0}(n,r.m)),t}function g(e,t,r,n=r?.hasZ??!1,o=r?.hasM??!1){if(null!=r){const i=s(e);t.points=u(n,o)(i,r.points),t.hasZ=n,t.hasM=o}return t}function m(e,t,r,n=null!=r?.z,u=null!=r?.m){if(null==r)return t;const c=s(e);return t.x=o(c,r.x),t.y=i(c,r.y),n&&(t.z=a(c,r.z)),u&&(t.m=l(c,r.m)),t}function _(e,t,r,n=r?.hasZ??!1,o=r?.hasM??!1){if(null!=r){const i=s(e);t.rings=p(i,u(n,o),r.rings),t.hasZ=n,t.hasM=o}return t}function b(e,t,r,n=r?.hasZ??!1,o=r?.hasM??!1){if(null!=r){const i=s(e);t.paths=p(i,u(n,o),r.paths),t.hasZ=n,t.hasM=o}return t}},50498:(e,t,r)=>{r.d(t,{Y:()=>o,g:()=>s});var n=r(66552);const s=(0,n.O)()({esriGeometryPoint:"point",esriGeometryMultipoint:"multipoint",esriGeometryPolyline:"polyline",esriGeometryPolygon:"polygon"}),o=(0,n.O)()({esriGeometryPoint:"point",esriGeometryMultipoint:"multipoint",esriGeometryPolyline:"polyline",esriGeometryPolygon:"polygon",esriGeometryEnvelope:"extent",mesh:"mesh"})},62815:(e,t,r)=>{r.d(t,{N:()=>i});var n=r(83047),s=r(73941),o=r(21325);function i(e,t,r){if(null==t||null==r||r.vcsWkid||(0,o.aI)(t,r)||(0,s.xP)(t)||(0,s.xP)(r))return null;const i=(0,n.G9)(t)/(0,n.G9)(r);if(1===i)return null;switch(e){case"point":case"esriGeometryPoint":return e=>function(e,t){null!=e?.z&&(e.z*=t)}(e,i);case"polyline":case"esriGeometryPolyline":return e=>function(e,t){if(e)for(const r of e.paths)for(const e of r)e.length>2&&(e[2]*=t)}(e,i);case"polygon":case"esriGeometryPolygon":return e=>function(e,t){if(e)for(const r of e.rings)for(const e of r)e.length>2&&(e[2]*=t)}(e,i);case"multipoint":case"esriGeometryMultipoint":return e=>function(e,t){if(e)for(const r of e.points)r.length>2&&(r[2]*=t)}(e,i);case"extent":case"esriGeometryEnvelope":return e=>function(e,t){e&&null!=e.zmin&&null!=e.zmax&&(e.zmin*=t,e.zmax*=t)}(e,i);default:return null}}},43334:(e,t,r)=>{r.d(t,{N3:()=>o,Om:()=>s});var n=r(92722);class s{constructor(e=null,t={},r,n){this.geometry=e,this.attributes=t,this.centroid=r,this.objectId=n,this.displayId=0,this.geohashX=0,this.geohashY=0}static fromJSON(e,t){const r=e.geometry?n.A.fromJSON(e.geometry):null,o=e.centroid?n.A.fromJSON(e.centroid):null,i=e.attributes[t];return new s(r,e.attributes,o,i)}weakClone(){const e=new s(this.geometry,this.attributes,this.centroid,this.objectId);return e.displayId=this.displayId,e.geohashX=this.geohashX,e.geohashY=this.geohashY,e}clone(){const e=this.geometry?.clone(),t=new s(e,{...this.attributes},this.centroid?.clone(),this.objectId);return t.displayId=this.displayId,t.geohashX=this.geohashX,t.geohashY=this.geohashY,t}}function o(e){return!!e.geometry?.coords?.length}},58512:(e,t,r)=>{r.d(t,{A:()=>n});class n{constructor(){this.objectIdFieldName=null,this.globalIdFieldName=null,this.geohashFieldName=null,this.geometryProperties=null,this.geometryType=null,this.spatialReference=null,this.hasZ=!1,this.hasM=!1,this.features=[],this.fields=[],this.transform=null,this.exceededTransferLimit=!1,this.uniqueIdField=null,this.queryGeometryType=null,this.queryGeometry=null}weakClone(){const e=new n;return e.objectIdFieldName=this.objectIdFieldName,e.globalIdFieldName=this.globalIdFieldName,e.geohashFieldName=this.geohashFieldName,e.geometryProperties=this.geometryProperties,e.geometryType=this.geometryType,e.spatialReference=this.spatialReference,e.hasZ=this.hasZ,e.hasM=this.hasM,e.features=this.features,e.fields=this.fields,e.transform=this.transform,e.exceededTransferLimit=this.exceededTransferLimit,e.uniqueIdField=this.uniqueIdField,e.queryGeometry=this.queryGeometry,e.queryGeometryType=this.queryGeometryType,e}}},92722:(e,t,r)=>{r.d(t,{A:()=>n});class n{constructor(e=[],t=[]){this.lengths=e??[],this.coords=t??[]}static fromJSON(e){return new n(e.lengths,e.coords)}static fromRect(e){const[t,r,s,o]=e,i=s-t,a=o-r;return new n([5],[t,r,i,0,0,a,-i,0,0,-a])}get isPoint(){return 0===this.lengths.length}get maxLength(){return Math.max(...this.lengths)}get size(){return this.lengths.reduce(((e,t)=>e+t))}forEachVertex(e){let t=0;this.lengths.length||e(this.coords[0],this.coords[1]);for(let r=0;r<this.lengths.length;r++){const n=this.lengths[r];for(let r=0;r<n;r++)e(this.coords[2*(r+t)],this.coords[2*(r+t)+1]);t+=n}}deltaDecode(){const e=this.clone(),{coords:t,lengths:r}=e;let n=0;for(const e of r){for(let r=1;r<e;r++)t[2*(n+r)]+=t[2*(n+r)-2],t[2*(n+r)+1]+=t[2*(n+r)-1];n+=e}return e}clone(e){if(0===this.lengths.length)return new n([],[this.coords[0],this.coords[1]]);const t=2*(0===this.lengths.length?1:this.lengths.reduce(((e,t)=>e+t))),r=this.coords.slice(0,t);return e?(e.set(r),new n(this.lengths,e)):new n(Array.from(this.lengths),Array.from(r))}}},90708:(e,t,r)=>{r.d(t,{B2:()=>T,BW:()=>R,Ch:()=>ne,DF:()=>I,Di:()=>E,E2:()=>j,IE:()=>w,Nl:()=>H,Q4:()=>se,Rk:()=>ie,Ux:()=>z,Ye:()=>U,ZF:()=>W,eY:()=>$,jH:()=>Q,jQ:()=>re,kz:()=>K,oN:()=>B,q3:()=>X,qK:()=>q,qN:()=>V,z5:()=>L,zv:()=>J});var n=r(49186),s=r(53966),o=r(97768),i=r(70328),a=r(19419),l=r(65864),u=r(43334),c=r(58512),h=r(92722);function d(e,t){return e?t?4:3:t?3:2}const f=()=>s.A.getLogger("esri.layers.graphics.featureConversionUtils"),p={esriGeometryPoint:0,esriGeometryPolyline:2,esriGeometryPolygon:3,esriGeometryMultipoint:0,esriGeometryMultiPatch:3,esriGeometryEnvelope:0},y=(e,t,r,n,s,o)=>{e[r]=s,e[r+1]=o},g=(e,t,r,n,s,o)=>{e[r]=s,e[r+1]=o,e[r+2]=t[n+2]},m=(e,t,r,n,s,o)=>{e[r]=s,e[r+1]=o,e[r+2]=t[n+3]},_=(e,t,r,n,s,o)=>{e[r]=s,e[r+1]=o,e[r+2]=t[n+2],e[r+3]=t[n+3]};function b(e,t,r,n){if(e){if(r)return t&&n?_:g;if(t&&n)return m}else if(t&&n)return g;return y}function w({scale:e,translate:t},r){return Math.round((r-t[0])/e[0])}function T({scale:e,translate:t},r){return Math.round((t[1]-r)/e[1])}function k({scale:e,translate:t},r,n){return r*e[n]+t[n]}function I(e,t,r){return e?t?r?P(e):v(e):r?G(e):M(e):null}function M(e){const t=e.coords;return{x:t[0],y:t[1]}}function x(e,t){return e.coords[0]=t.x,e.coords[1]=t.y,e}function v(e){const t=e.coords;return{x:t[0],y:t[1],z:t[2]}}function F(e,t){return e.coords[0]=t.x,e.coords[1]=t.y,e.coords[2]=t.z,e}function G(e){const t=e.coords;return{x:t[0],y:t[1],m:t[2]}}function A(e,t){return e.coords[0]=t.x,e.coords[1]=t.y,e.coords[2]=t.m,e}function P(e){const t=e.coords;return{x:t[0],y:t[1],z:t[2],m:t[3]}}function N(e,t){return e.coords[0]=t.x,e.coords[1]=t.y,e.coords[2]=t.z,e.coords[3]=t.m,e}function S(e,t){return e&&t?N:e?F:t?A:x}function V(e,t,r=S(null!=t.z,null!=t.m)){return r(e,t)}function q(e,t,r){if(null==e)return null;const n=d(t,r),s=[];for(let t=0;t<e.coords.length;t+=n){const r=[];for(let s=0;s<n;s++)r.push(e.coords[t+s]);s.push(r)}return t?r?{points:s,hasZ:t,hasM:r}:{points:s,hasZ:t}:r?{points:s,hasM:r}:{points:s}}function Z(e,t,r=d(t.hasZ,t.hasM)){e.lengths[0]=t.points.length;const n=e.coords;let s=0;for(const e of t.points)for(let t=0;t<r;t++)n[s++]=e[t];return e}function R(e,t,r){if(!e)return null;const n=d(t,r),{coords:s,lengths:o}=e,i=[];let a=0;for(const e of o){const t=[];for(let r=0;r<e;r++){const e=[];for(let t=0;t<n;t++)e.push(s[a++]);t.push(e)}i.push(t)}return t?r?{paths:i,hasZ:t,hasM:r}:{paths:i,hasZ:t}:r?{paths:i,hasM:r}:{paths:i}}function C(e,t,r=d(t.hasZ,t.hasM)){const{lengths:n,coords:s}=e;let o=0;for(const e of t.paths){for(const t of e)for(let e=0;e<r;e++)s[o++]=t[e];n.push(e.length)}return e}function L(e,t,r){if(!e)return null;const n=d(t,r),{coords:s,lengths:o}=e,i=[];let a=0;for(const e of o){const t=[];for(let r=0;r<e;r++){const e=[];for(let t=0;t<n;t++)e.push(s[a++]);t.push(e)}i.push(t)}return t?r?{rings:i,hasZ:t,hasM:r}:{rings:i,hasZ:t}:r?{rings:i,hasM:r}:{rings:i}}function U(e,t,r=t.hasZ,n=t.hasM){return function(e,t,r,n){const s=d(r,n),{lengths:o,coords:i}=e;let a=0;ae(e);for(const e of t){for(const t of e)for(let e=0;e<s;e++)i[a++]=t[e];o.push(e.length)}return e}(e,t.rings,r,n)}const D=[],O=[];function j(e,t,r,n,s){D[0]=e;const[o]=E(O,D,t,r,n,s);return le(D),le(O),o}function E(e,t,r,s,o,i){if(le(e),!r){for(const r of t){const t=i?r.attributes[i]:void 0;e.push(new u.Om(null,r.attributes,null,t))}return e}switch(r){case"esriGeometryPoint":return function(e,t,r,n,s){const o=S(r,n);for(const{geometry:r,attributes:n}of t){const t=null!=r?o(new h.A,r):null;e.push(new u.Om(t,n,null,s?n[s]:void 0))}return e}(e,t,s,o,i);case"esriGeometryMultipoint":return function(e,t,r,n,s){const o=d(r,n);for(const{geometry:r,attributes:n}of t){const t=null!=r?Z(new h.A,r,o):null;e.push(new u.Om(t,n,null,s?n[s]:void 0))}return e}(e,t,s,o,i);case"esriGeometryPolyline":return function(e,t,r,n,s){const o=d(r,n);for(const{geometry:r,attributes:n,centroid:i}of t){const t=null!=r?C(new h.A,r,o):null,a=null!=i?V(new h.A,i):null;e.push(new u.Om(t,n,a,s?n[s]:void 0))}return e}(e,t,s,o,i);case"esriGeometryPolygon":case"esriGeometryMultiPatch":return function(e,t,r,n,s){for(const{geometry:o,centroid:i,attributes:a}of t){const t=null!=o?U(new h.A,o,r,n):null,l=s?a[s]:void 0;null!=i?e.push(new u.Om(t,a,x(new h.A,i),l)):e.push(new u.Om(t,a,null,l))}return e}(e,t,s,o,i);default:f().error("convertToFeatureSet:unknown-geometry",new n.A(`Unable to parse unknown geometry type '${r}'`)),le(e)}return e}function B(e,t,r,n){O[0]=e,Y(D,O,t,r,n);const s=D[0];return le(D),le(O),s}function z(e,t,r){if(null==e)return null;const s=new h.A;return"hasZ"in e&&null==t&&(t=e.hasZ),"hasM"in e&&null==r&&(r=e.hasM),(0,l.fT)(e)?S(null!=t?t:null!=e.z,null!=r?r:null!=e.m)(s,e):(0,l.Bi)(e)?U(s,e,t,r):(0,l.Rg)(e)?C(s,e,d(t,r)):(0,l.U9)(e)?Z(s,e,d(t,r)):void f().error("convertFromGeometry:unknown-geometry",new n.A(`Unable to parse unknown geometry type '${e}'`))}function J(e,t,r,s){const o=e&&("coords"in e?e:e.geometry);if(null==o)return null;switch(t){case"esriGeometryPoint":{let e=M;return r&&s?e=P:r?e=v:s&&(e=G),e(o)}case"esriGeometryMultipoint":return q(o,r,s);case"esriGeometryPolyline":return R(o,r,s);case"esriGeometryPolygon":return L(o,r,s);default:return f().error("convertToGeometry:unknown-geometry",new n.A(`Unable to parse unknown geometry type '${t}'`)),null}}function Y(e,t,r,s,o){if(le(e),null==r)return function(e,t){for(const r of t)e.push({attributes:r.attributes});return e}(e,t);switch(r){case"esriGeometryPoint":return function(e,t,r,n){let s=M;r&&n?s=P:r?s=v:n&&(s=G);for(const r of t){const{geometry:t,attributes:n}=r,o=null!=t?s(t):null;e.push({attributes:n,geometry:o})}return e}(e,t,s,o);case"esriGeometryMultipoint":return function(e,t,r,n){for(const{geometry:s,attributes:o}of t)e.push({attributes:o,geometry:null!=s?q(s,r,n):null});return e}(e,t,s,o);case"esriGeometryPolyline":return function(e,t,r,n){for(const{geometry:s,attributes:o}of t)e.push({attributes:o,geometry:null!=s?R(s,r,n):null});return e}(e,t,s,o);case"esriGeometryPolygon":return function(e,t,r,n){for(const{geometry:s,attributes:o,centroid:i}of t){const t=null!=s?L(s,r,n):null;if(null!=i){const r=M(i);e.push({attributes:o,centroid:r,geometry:t})}else e.push({attributes:o,geometry:t})}return e}(e,t,s,o);default:f().error("convertToFeatureSet:unknown-geometry",new n.A(`Unable to parse unknown geometry type '${r}'`))}return e}function W(e){const{objectIdFieldName:t,spatialReference:r,transform:n,fields:s,hasM:o,hasZ:i,features:a,geometryType:l,exceededTransferLimit:u,uniqueIdField:c,queryGeometry:h,queryGeometryType:d}=e,f={features:Y([],a,l,i,o),fields:s,geometryType:l,objectIdFieldName:t,spatialReference:r,uniqueIdField:c,queryGeometry:J(h,d,!1,!1)};return n&&(f.transform=n),u&&(f.exceededTransferLimit=u),o&&(f.hasM=o),i&&(f.hasZ=i),f}function X(e,t){const r=new c.A,{hasM:s,hasZ:o,features:i,objectIdFieldName:a,spatialReference:l,geometryType:u,exceededTransferLimit:h,transform:d,fields:p}=e;return p&&(r.fields=p),r.geometryType=u??null,r.objectIdFieldName=a??t??null,r.spatialReference=l??null,r.objectIdFieldName?(i&&E(r.features,i,u,o,s,r.objectIdFieldName),h&&(r.exceededTransferLimit=h),s&&(r.hasM=s),o&&(r.hasZ=o),d&&(r.transform=d),r):(f().error(new n.A("optimized-features:invalid-objectIdFieldName","objectIdFieldName is missing")),r)}function $(e){const{transform:t,features:r,hasM:n,hasZ:s}=e;if(!t)return e;for(const e of r)null!=e.geometry&&ne(e.geometry,e.geometry,n,s,t),null!=e.centroid&&ne(e.centroid,e.centroid,n,s,t);return e.transform=null,e}function Q(e,t){const{geometryType:r,features:n,hasM:s,hasZ:o}=t;if(!e)return t;for(let t=0;t<n.length;t++){const i=n[t],a=i.weakClone();a.geometry=new h.A,H(a.geometry,i.geometry,s,o,r,e),i.centroid&&(a.centroid=new h.A,H(a.centroid,i.centroid,s,o,"esriGeometryPoint",e)),n[t]=a}return t.transform=e,t}function H(e,t,r,n,s,o,i=r,a=n){if(ae(e),!t?.coords.length)return null;const l=p[s],{coords:u,lengths:c}=t,h=d(r,n),f=d(r&&i,n&&a),y=b(r,n,i,a);if(!c.length)return y(e.coords,u,0,0,w(o,u[0]),T(o,u[1])),ae(e,h,0),e;let g,m,_,k,I=0,M=0,x=M;for(const t of c){if(t<l)continue;let r=0;M=x,_=g=w(o,u[I]),k=m=T(o,u[I+1]),y(e.coords,u,M,I,_,k),r++,I+=h,M+=f;for(let n=1;n<t;n++,I+=h)_=w(o,u[I]),k=T(o,u[I+1]),_===g&&k===m||(y(e.coords,u,M,I,_-g,k-m),M+=f,r++,g=_,m=k);r>=l&&(e.lengths.push(r),x=M)}return le(e.coords,x),e.coords.length?e:null}function K(e,t,r,n,s,o,i=r,a=n){if(ae(e),!t?.coords.length)return null;const l=p[s],{coords:u,lengths:c}=t,h=d(r,n),f=d(r&&i,n&&a),y=b(r,n,i,a);if(!c.length)return y(e.coords,u,0,0,u[0],u[1]),ae(e,h,0),e;let g=0;const m=o*o;for(const t of c){if(t<l){g+=t*h;continue}const r=e.coords.length/f,n=g,s=g+(t-1)*h;y(e.coords,u,e.coords.length,n,u[n],u[n+1]),te(e.coords,u,h,m,y,n,s),y(e.coords,u,e.coords.length,s,u[s],u[s+1]);const o=e.coords.length/f-r;o>=l?e.lengths.push(o):le(e.coords,r*f),g+=t*h}return e.coords.length?e:null}function ee(e,t,r,n){const s=e[t],o=e[t+1],i=e[r],a=e[r+1],l=e[n],u=e[n+1];let c=i,h=a,d=l-c,f=u-h;if(0!==d||0!==f){const e=((s-c)*d+(o-h)*f)/(d*d+f*f);e>1?(c=l,h=u):e>0&&(c+=d*e,h+=f*e)}return d=s-c,f=o-h,d*d+f*f}function te(e,t,r,n,s,o,i){let a,l=n,u=0;for(let e=o+r;e<i;e+=r)a=ee(t,e,o,i),a>l&&(u=e,l=a);l>n&&(u-o>r&&te(e,t,r,n,s,o,u),s(e,t,e.length,u,t[u],t[u+1]),i-u>r&&te(e,t,r,n,s,u,i))}function re(e,t,r,n){if(!t?.coords?.length)return null;const s=d(r,n);let o=Number.POSITIVE_INFINITY,l=Number.POSITIVE_INFINITY,u=Number.NEGATIVE_INFINITY,c=Number.NEGATIVE_INFINITY;if(t&&t.coords){const e=t.coords;for(let t=0;t<e.length;t+=s){const r=e[t],n=e[t+1];o=Math.min(o,r),u=Math.max(u,r),l=Math.min(l,n),c=Math.max(c,n)}}return(0,i.is)(e)?(0,i.BI)(e,o,l,u,c):(0,a.fA)(o,l,u,c,e),e}function ne(e,t,r,n,s){const{coords:i,lengths:a}=t,l=d(r,n);if(!i.length)return e!==t&&ae(e),e;(0,o.Lw)(s);const{originPosition:u,scale:c,translate:h}=s,f=ue;f.originPosition=u;const p=f.scale;p[0]=c[0]??1,p[1]=-(c[1]??1),p[2]=c[2]??1,p[3]=c[3]??1;const y=f.translate;if(y[0]=h[0]??0,y[1]=h[1]??0,y[2]=h[2]??0,y[3]=h[3]??0,!a.length){for(let t=0;t<l;++t)e.coords[t]=k(f,i[t],t);return e!==t&&ae(e,l,0),e}let g=0;for(let t=0;t<a.length;t++){const r=a[t];e.lengths[t]=r;for(let t=0;t<l;++t)e.coords[g+t]=k(f,i[g+t],t);let n=e.coords[g],s=e.coords[g+1];g+=l;for(let t=1;t<r;t++,g+=l){n+=i[g]*p[0],s+=i[g+1]*p[1],e.coords[g]=n,e.coords[g+1]=s;for(let t=2;t<l;++t)e.coords[g+t]=k(f,i[g+t],t)}}return e!==t&&ae(e,i.length,a.length),e}function se(e,t,r,n,s,o){if(ae(e),e.lengths.push(...t.lengths),r===s&&n===o)for(let r=0;r<t.coords.length;r++)e.coords.push(t.coords[r]);else{const i=d(r,n),a=b(r,n,s,o),l=t.coords;for(let t=0;t<l.length;t+=i)a(e.coords,l,e.coords.length,t,l[t],l[t+1])}return e}function oe(e,t,r,n){let s=0,o=e[n*t],i=e[n*(t+1)];for(let a=1;a<r;a++){const r=o+e[n*(t+a)],l=i+e[n*(t+a)+1],u=(r-o)*(l+i);o=r,i=l,s+=u}return.5*s}function ie(e,t){const{coords:r,lengths:n}=e;let s=0,o=0;for(let e=0;e<n.length;e++){const i=n[e];o+=oe(r,s,i,t),s+=i}return Math.abs(o)}function ae(e,t=0,r=0){le(e.lengths,r),le(e.coords,t)}function le(e,t=0){e.length!==t&&(e.length=t)}const ue={originPosition:"lowerLeft",scale:[1,1,1,1],translate:[0,0,0,0]}},39357:(e,t,r)=>{r.d(t,{H:()=>l});var n,s=r(90237),o=r(25482),i=r(10107),a=(r(44208),r(53966),r(87811),r(40608));let l=n=class extends o.oY{constructor(e){super(e),this.name=null,this.code=null}clone(){return new n({name:this.name,code:this.code})}};(0,s._)([(0,i.MZ)({type:String,json:{write:!0}})],l.prototype,"name",void 0),(0,s._)([(0,i.MZ)({type:[String,Number],json:{write:!0}})],l.prototype,"code",void 0),l=n=(0,s._)([(0,a.$)("esri.layers.support.CodedValue")],l)},53177:(e,t,r)=>{r.d(t,{A:()=>d});var n,s=r(90237),o=r(4718),i=r(10107),a=(r(44208),r(53966),r(93223)),l=r(40608),u=r(39357),c=r(76357);let h=n=class extends c.A{constructor(e){super(e),this.codedValues=null,this.type="coded-value"}getName(e){let t=null;if(this.codedValues){const r=String(e);this.codedValues.some((e=>(String(e.code)===r&&(t=e.name),!!t)))}return t}clone(){return new n({codedValues:(0,o.o8)(this.codedValues),name:this.name})}};(0,s._)([(0,i.MZ)({type:[u.H],json:{write:!0}})],h.prototype,"codedValues",void 0),(0,s._)([(0,a.e)({codedValue:"coded-value"})],h.prototype,"type",void 0),h=n=(0,s._)([(0,l.$)("esri.layers.support.CodedValueDomain")],h);const d=h},76357:(e,t,r)=>{r.d(t,{A:()=>h});var n=r(90237),s=r(66552),o=r(25482),i=r(10107),a=(r(44208),r(53966),r(87811),r(93223)),l=r(40608);const u=new s.J({inherited:"inherited",codedValue:"coded-value",range:"range"});let c=class extends o.oY{constructor(e){super(e),this.name=null,this.type=null}};(0,n._)([(0,i.MZ)({type:String,json:{write:!0}})],c.prototype,"name",void 0),(0,n._)([(0,a.e)(u)],c.prototype,"type",void 0),c=(0,n._)([(0,l.$)("esri.layers.support.Domain")],c);const h=c},20437:(e,t,r)=>{r.d(t,{A:()=>g});var n,s=r(90237),o=r(66552),i=r(25482),a=r(10107),l=r(56507),u=(r(87811),r(44208),r(93223)),c=r(36005),h=r(40608),d=r(80451),f=r(98453);const p=new o.J({binary:"binary",coordinate:"coordinate",countOrAmount:"count-or-amount",dateAndTime:"date-and-time",description:"description",locationOrPlaceName:"location-or-place-name",measurement:"measurement",nameOrTitle:"name-or-title",none:"none",orderedOrRanked:"ordered-or-ranked",percentageOrRatio:"percentage-or-ratio",typeOrCategory:"type-or-category",uniqueIdentifier:"unique-identifier"});let y=n=class extends i.oY{constructor(e){super(e),this.alias=null,this.defaultValue=void 0,this.description=null,this.domain=null,this.editable=!0,this.length=void 0,this.name=null,this.nullable=!0,this.type=null,this.valueType=null,this.visible=!0}readDescription(e,{description:t}){let r=null;try{r=t?JSON.parse(t):null}catch(e){}return r?.value??null}readValueType(e,{description:t}){let r=null;try{r=t?JSON.parse(t):null}catch(e){}return r?p.fromJSON(r.fieldValueType):null}clone(){return new n({alias:this.alias,defaultValue:this.defaultValue,description:this.description,domain:this.domain?.clone()??null,editable:this.editable,length:this.length,name:this.name,nullable:this.nullable,type:this.type,valueType:this.valueType,visible:this.visible})}};(0,s._)([(0,a.MZ)({type:String,json:{write:!0}})],y.prototype,"alias",void 0),(0,s._)([(0,a.MZ)({type:[String,Number],json:{write:{allowNull:!0}}})],y.prototype,"defaultValue",void 0),(0,s._)([(0,a.MZ)()],y.prototype,"description",void 0),(0,s._)([(0,c.w)("description")],y.prototype,"readDescription",null),(0,s._)([(0,a.MZ)({types:d.gK,json:{read:{reader:d.rS},write:!0}})],y.prototype,"domain",void 0),(0,s._)([(0,a.MZ)({type:Boolean,json:{write:!0}})],y.prototype,"editable",void 0),(0,s._)([(0,a.MZ)({type:l.jz,json:{write:{overridePolicy:e=>({enabled:Number.isFinite(e)})}}})],y.prototype,"length",void 0),(0,s._)([(0,a.MZ)({type:String,json:{write:!0}})],y.prototype,"name",void 0),(0,s._)([(0,a.MZ)({type:Boolean,json:{write:!0}})],y.prototype,"nullable",void 0),(0,s._)([(0,u.e)(f.m)],y.prototype,"type",void 0),(0,s._)([(0,a.MZ)()],y.prototype,"valueType",void 0),(0,s._)([(0,c.w)("valueType",["description"])],y.prototype,"readValueType",null),(0,s._)([(0,a.MZ)({type:Boolean,json:{read:!1}})],y.prototype,"visible",void 0),y=n=(0,s._)([(0,h.$)("esri.layers.support.Field")],y);const g=y},80451:(e,t,r)=>{r.d(t,{rS:()=>g,gK:()=>y}),r(44208);var n,s=r(53177),o=r(76357),i=r(90237),a=(r(53966),r(87811),r(49186),r(93223)),l=r(40608);let u=n=class extends o.A{constructor(e){super(e),this.type="inherited"}clone(){return new n}};(0,i._)([(0,a.e)({inherited:"inherited"})],u.prototype,"type",void 0),u=n=(0,i._)([(0,l.$)("esri.layers.support.InheritedDomain")],u);const c=u;var h,d=r(10107);let f=h=class extends o.A{constructor(e){super(e),this.maxValue=null,this.minValue=null,this.type="range"}clone(){return new h({maxValue:this.maxValue,minValue:this.minValue,name:this.name})}};(0,i._)([(0,d.MZ)({json:{type:[Number],read:{source:"range",reader:(e,t)=>t.range?.[1]},write:{enabled:!1,overridePolicy(){return{enabled:null!=this.maxValue&&null==this.minValue}},target:"range",writer(e,t,r){t[r]=[this.minValue||0,e]}}}})],f.prototype,"maxValue",void 0),(0,i._)([(0,d.MZ)({json:{type:[Number],read:{source:"range",reader:(e,t)=>t.range?.[0]},write:{target:"range",writer(e,t,r){t[r]=[e,this.maxValue||0]}}}})],f.prototype,"minValue",void 0),(0,i._)([(0,a.e)({range:"range"})],f.prototype,"type",void 0),f=h=(0,i._)([(0,l.$)("esri.layers.support.RangeDomain")],f);const p=f,y={key:"type",base:o.A,typeMap:{range:p,"coded-value":s.A,inherited:c}};function g(e){if(!e?.type)return null;switch(e.type){case"range":return p.fromJSON(e);case"codedValue":return s.A.fromJSON(e);case"inherited":return c.fromJSON(e)}return null}},98453:(e,t,r)=>{r.d(t,{m:()=>n});const n=new(r(66552).J)({esriFieldTypeSmallInteger:"small-integer",esriFieldTypeInteger:"integer",esriFieldTypeSingle:"single",esriFieldTypeDouble:"double",esriFieldTypeLong:"long",esriFieldTypeString:"string",esriFieldTypeDate:"date",esriFieldTypeOID:"oid",esriFieldTypeGeometry:"geometry",esriFieldTypeBlob:"blob",esriFieldTypeRaster:"raster",esriFieldTypeGUID:"guid",esriFieldTypeGlobalID:"global-id",esriFieldTypeXML:"xml",esriFieldTypeBigInteger:"big-integer",esriFieldTypeDateOnly:"date-only",esriFieldTypeTimeOnly:"time-only",esriFieldTypeTimestampOffset:"timestamp-offset"})},53655:(e,t,r)=>{r.d(t,{SH:()=>G,ae:()=>I,cn:()=>_});var n=r(49186),s=r(51624),o=r(92722),i=r(69418);const a=["esriFieldTypeSmallInteger","esriFieldTypeInteger","esriFieldTypeSingle","esriFieldTypeDouble","esriFieldTypeString","esriFieldTypeDate","esriFieldTypeOID","esriFieldTypeGeometry","esriFieldTypeBlob","esriFieldTypeRaster","esriFieldTypeGUID","esriFieldTypeGlobalID","esriFieldTypeXML","esriFieldTypeBigInteger","esriFieldTypeDateOnly","esriFieldTypeTimeOnly","esriFieldTypeTimestampOffset"],l=["sqlTypeBigInt","sqlTypeBinary","sqlTypeBit","sqlTypeChar","sqlTypeDate","sqlTypeDecimal","sqlTypeDouble","sqlTypeFloat","sqlTypeGeometry","sqlTypeGUID","sqlTypeInteger","sqlTypeLongNVarchar","sqlTypeLongVarbinary","sqlTypeLongVarchar","sqlTypeNChar","sqlTypeNVarchar","sqlTypeOther","sqlTypeReal","sqlTypeSmallInt","sqlTypeSqlXml","sqlTypeTime","sqlTypeTimestamp","sqlTypeTimestamp2","sqlTypeTinyInt","sqlTypeVarbinary","sqlTypeVarchar"],u=["upperLeft","lowerLeft"];function c(e){return e>=a.length?null:a[e]}function h(e){return e>=l.length?null:l[e]}function d(e){return e>=u.length?null:u[e]}function f(e,t){return t>=e.geometryTypes.length?null:e.geometryTypes[t]}function p(e,t,r){const n=e.asUnsafe(),s=t.createPointGeometry(r);for(;n.next();)switch(n.tag()){case 3:{const e=n.getUInt32(),r=n.pos()+e;let o=0;for(;n.pos()<r;)t.addCoordinatePoint(s,n.getSInt64(),o++);break}default:n.skip()}return s}function y(e,t,r){const n=e.asUnsafe(),s=t.createGeometry(r),o=2+(r.hasZ?1:0)+(r.hasM?1:0);for(;n.next();)switch(n.tag()){case 2:{const e=n.getUInt32(),r=n.pos()+e;let o=0;for(;n.pos()<r;)t.addLength(s,n.getUInt32(),o++);break}case 3:{const e=n.getUInt32(),r=n.pos()+e;let i=0;for(t.allocateCoordinates(s);n.pos()<r;)t.addCoordinate(s,n.getSInt64(),i),i++,i===o&&(i=0);break}default:n.skip()}return s}function g(e){const t=e.asUnsafe(),r=new o.A;let n="esriGeometryPoint";for(;t.next();)switch(t.tag()){case 2:{const e=t.getUInt32(),n=t.pos()+e;for(;t.pos()<n;)r.lengths.push(t.getUInt32());break}case 3:{const e=t.getUInt32(),n=t.pos()+e;for(;t.pos()<n;)r.coords.push(t.getSInt64());break}case 1:n=i.z[t.getEnum()];break;default:t.skip()}return{queryGeometry:r,queryGeometryType:n}}function m(e){const t=e.asUnsafe();for(;t.next();)switch(t.tag()){case 1:return t.getString();case 2:return t.getFloat();case 3:return t.getDouble();case 4:return t.getSInt32();case 5:return t.getUInt32();case 6:return t.getInt64();case 7:return t.getUInt64();case 8:return t.getSInt64();case 9:return t.getBool();default:return t.skip(),null}return null}function _(e){const t=e.asUnsafe(),r={type:c(0)};for(;t.next();)switch(t.tag()){case 1:r.name=t.getString();break;case 2:r.type=c(t.getEnum());break;case 3:r.alias=t.getString();break;case 4:r.sqlType=h(t.getEnum());break;case 5:default:t.skip();break;case 6:r.defaultValue=t.getString()}return r}function b(e){const t={},r=e.asUnsafe();for(;r.next();)switch(r.tag()){case 1:t.name=r.getString();break;case 2:t.isSystemMaintained=r.getBool();break;default:r.skip()}return t}function w(e,t,r,n){const s=t.createFeature(r);let o=0;for(;e.next();)switch(e.tag()){case 1:{const t=n[o++].name;s.attributes[t]=e.processMessage(m);break}case 2:s.geometry=e.processMessageWithArgs(y,t,r);break;case 4:s.centroid=e.processMessageWithArgs(p,t,r);break;default:e.skip()}return s}function T(e){const t=[1,1,1,1],r=e.asUnsafe();for(;r.next();)switch(r.tag()){case 1:t[0]=r.getDouble();break;case 2:t[1]=r.getDouble();break;case 4:t[2]=r.getDouble();break;case 3:t[3]=r.getDouble();break;default:r.skip()}return t}function k(e){const t=[0,0,0,0],r=e.asUnsafe();for(;r.next();)switch(r.tag()){case 1:t[0]=r.getDouble();break;case 2:t[1]=r.getDouble();break;case 4:t[2]=r.getDouble();break;case 3:t[3]=r.getDouble();break;default:r.skip()}return t}function I(e){const t={originPosition:d(0)},r=e.asUnsafe();for(;r.next();)switch(r.tag()){case 1:t.originPosition=d(r.getEnum());break;case 2:t.scale=r.processMessage(T);break;case 3:t.translate=r.processMessage(k);break;default:r.skip()}return t}function M(e){const t={},r=e.asUnsafe();for(;r.next();)switch(r.tag()){case 1:t.shapeAreaFieldName=r.getString();break;case 2:t.shapeLengthFieldName=r.getString();break;case 3:t.units=r.getString();break;default:r.skip()}return t}function x(e,t){const r=t.createSpatialReference();for(;e.next();)switch(e.tag()){case 1:r.wkid=e.getUInt32();break;case 5:r.wkt=e.getString();break;case 2:r.latestWkid=e.getUInt32();break;case 3:r.vcsWkid=e.getUInt32();break;case 4:r.latestVcsWkid=e.getUInt32();break;default:e.skip()}return r}function v(e,t){const r=t.createFeatureResult(),n=e.asUnsafe();r.geometryType=f(t,0);let s=!1;for(;n.next();)switch(n.tag()){case 1:r.objectIdFieldName=n.getString();break;case 3:r.globalIdFieldName=n.getString();break;case 4:r.geohashFieldName=n.getString();break;case 5:r.geometryProperties=n.processMessage(M);break;case 7:r.geometryType=f(t,n.getEnum());break;case 8:r.spatialReference=n.processMessageWithArgs(x,t);break;case 10:r.hasZ=n.getBool();break;case 11:r.hasM=n.getBool();break;case 12:r.transform=n.processMessage(I);break;case 9:r.exceededTransferLimit=n.getBool();break;case 13:t.addField(r,n.processMessage(_));break;case 15:s||(t.prepareFeatures(r),s=!0),t.addFeature(r,n.processMessageWithArgs(w,t,r,r.fields));break;case 2:r.uniqueIdField=n.processMessage(b);break;default:n.skip()}return t.finishFeatureResult(r),r}function F(e,t){const r={};let n=null;for(;e.next();)switch(e.tag()){case 4:n=e.processMessageWithArgs(g);break;case 1:r.featureResult=e.processMessageWithArgs(v,t);break;default:e.skip()}return null!=n&&r.featureResult&&t.addQueryGeometry(r,n),r}function G(e,t){try{const r=2,n=new s.A(new Uint8Array(e),new DataView(e)),o={};for(;n.next();)n.tag()===r?o.queryResult=n.processMessageWithArgs(F,t):n.skip();return o}catch(e){throw new n.A("query:parsing-pbf","Error while parsing FeatureSet PBF payload",{error:e})}}},69418:(e,t,r)=>{r.d(t,{S:()=>u,z:()=>l});var n=r(83047),s=r(21325),o=r(43334),i=r(58512),a=r(92722);const l=["esriGeometryPoint","esriGeometryMultipoint","esriGeometryPolyline","esriGeometryPolygon"];class u{constructor(e){this._options=e,this.geometryTypes=l,this._coordinatePtr=0,this._vertexDimension=0}createFeatureResult(){return new i.A}prepareFeatures(e){this._vertexDimension=2,e.hasZ&&this._vertexDimension++,e.hasM&&this._vertexDimension++}finishFeatureResult(e){if(!e?.features||!e.hasZ||!this._options.sourceSpatialReference||!e.spatialReference||(0,s.aI)(e.spatialReference,this._options.sourceSpatialReference)||e.spatialReference.vcsWkid)return;const t=(0,n.G9)(this._options.sourceSpatialReference)/(0,n.G9)(e.spatialReference);if(1!==t)for(const r of e.features){if(!(0,o.N3)(r))continue;const e=r.geometry.coords;for(let r=2;r<e.length;r+=3)e[r]*=t}}addFeature(e,t){e.features.push(t)}createFeature(){return new o.Om}createSpatialReference(){return{wkid:0}}createGeometry(){return new a.A}addField(e,t){e.fields.push(t)}allocateCoordinates(e){e.coords.length=e.lengths.reduce(((e,t)=>e+t),0)*this._vertexDimension,this._coordinatePtr=0}addCoordinate(e,t){e.coords[this._coordinatePtr++]=t}addCoordinatePoint(e,t){e.coords.push(t)}addLength(e,t){e.lengths.push(t)}addQueryGeometry(e,t){e.queryGeometry=t.queryGeometry,e.queryGeometryType=t.queryGeometryType}createPointGeometry(){return new a.A}}},66208:(e,t,r)=>{r.d(t,{m:()=>s});var n=r(53655);function s(e,t){const r=(0,n.SH)(e,t),s=r.queryResult.featureResult,o=r.queryResult.queryGeometry,i=r.queryResult.queryGeometryType;if(s&&s.features&&s.features.length&&s.objectIdFieldName){const e=s.objectIdFieldName;for(const t of s.features)t.attributes&&(t.objectId=t.attributes[e])}return s&&(s.queryGeometry=o,s.queryGeometryType=i),s}},97367:(e,t,r)=>{r.r(t),r.d(t,{default:()=>w});var n=r(21818),s=r(24326),o=r(16930),i=r(62815),a=(r(44208),r(34275),r(70328),r(19419),r(62577),r(50498),r(20437));r(34727),r(21325);class l{constructor(e,t,r){this.uid=e,this.geometry=t,this.attributes=r,this.visible=!0,this.objectId=null,this.centroid=null}}class u{constructor(){this.exceededTransferLimit=!1,this.features=[],this.fields=[],this.hasM=!1,this.hasZ=!1,this.geometryType=null,this.objectIdFieldName=null,this.globalIdFieldName=null,this.geometryProperties=null,this.geohashFieldName=null,this.spatialReference=null,this.transform=null}}var c=r(90708);function h(e,t){return t}function d(e,t,r,n){switch(r){case 0:return g(e,t+n,0);case 1:return"lowerLeft"===e.originPosition?g(e,t+n,1):function({translate:e,scale:t},r,n){return e[n]-r*t[n]}(e,t+n,1)}}function f(e,t,r,n){return 2===r?g(e,t,2):d(e,t,r,n)}function p(e,t,r,n){return 2===r?g(e,t,3):d(e,t,r,n)}function y(e,t,r,n){return 3===r?g(e,t,3):f(e,t,r,n)}function g({translate:e,scale:t},r,n){return e[n]+r*t[n]}class m{constructor(e){this._options=e,this.geometryTypes=["point","multipoint","polyline","polygon"],this._previousCoordinate=[0,0],this._transform=null,this._applyTransform=h,this._lengths=[],this._currentLengthIndex=0,this._toAddInCurrentPath=0,this._vertexDimension=0,this._coordinateBuffer=null,this._coordinateBufferPtr=0,this._attributesConstructor=class{},this._missingAttributes=[]}get missingAttributes(){return this._missingAttributes}createFeatureResult(){return new u}finishFeatureResult(e){if(this._options.applyTransform&&(e.transform=null),this._attributesConstructor=class{},this._coordinateBuffer=null,this._lengths.length=0,!e.hasZ)return;const t=(0,i.N)(e.geometryType,this._options.sourceSpatialReference,e.spatialReference);if(null!=t)for(const r of e.features)t(r.geometry)}createSpatialReference(){return new o.A}addField(e,t){e.fields.push(a.A.fromJSON(t));const r=e.fields.map((e=>e.name));this._attributesConstructor=function(){for(const e of r)this[e]=null}}addFeature(e,t){const r=this._options.maxStringAttributeLength,n=this._options.maxStringAttributeFields;(function(e,t,r,n){if(t?.size&&null!=r&&e)for(const s in e){if(!t.has(s))continue;const o=e[s];"string"==typeof o&&o.length>r&&(n(s),e[s]="")}})(t.attributes,n,r,(r=>{const n=t.attributes[e.objectIdFieldName];null!=n&&this._missingAttributes.push({objectId:n,attribute:r})})),e.features.push(t)}addQueryGeometry(e,t){const{queryGeometry:r,queryGeometryType:n}=t,s=(0,c.Ch)(r.clone(),r,!1,!1,this._transform),o=(0,c.zv)(s,n,!1,!1);let i=null;switch(n){case"esriGeometryPoint":i="point";break;case"esriGeometryPolygon":i="polygon";break;case"esriGeometryPolyline":i="polyline";break;case"esriGeometryMultipoint":i="multipoint"}o.type=i,e.queryGeometryType=n,e.queryGeometry=o}prepareFeatures(e){switch(this._transform=e.transform??null,this._options.applyTransform&&e.transform&&(this._applyTransform=this._deriveApplyTransform(e)),this._vertexDimension=2,e.hasZ&&this._vertexDimension++,e.hasM&&this._vertexDimension++,e.geometryType){case"point":this.addCoordinate=(e,t,r)=>this.addCoordinatePoint(e,t,r),this.createGeometry=e=>this.createPointGeometry(e);break;case"polygon":this.addCoordinate=(e,t,r)=>this._addCoordinatePolygon(e,t,r),this.createGeometry=e=>this._createPolygonGeometry(e);break;case"polyline":this.addCoordinate=(e,t,r)=>this._addCoordinatePolyline(e,t,r),this.createGeometry=e=>this._createPolylineGeometry(e);break;case"multipoint":this.addCoordinate=(e,t,r)=>this._addCoordinateMultipoint(e,t,r),this.createGeometry=e=>this._createMultipointGeometry(e);break;case"mesh":case"extent":break;default:(0,n.Xb)(e.geometryType)}}createFeature(){return this._lengths.length=0,this._currentLengthIndex=0,this._previousCoordinate[0]=0,this._previousCoordinate[1]=0,new l((0,s.c)(),null,new this._attributesConstructor)}allocateCoordinates(){const e=this._lengths.reduce(((e,t)=>e+t),0);this._coordinateBuffer=new Float64Array(e*this._vertexDimension),this._coordinateBufferPtr=0}addLength(e,t){0===this._lengths.length&&(this._toAddInCurrentPath=t),this._lengths.push(t)}createPointGeometry(e){const t={type:"point",x:0,y:0,spatialReference:e.spatialReference,hasZ:!!e.hasZ,hasM:!!e.hasM};return t.hasZ&&(t.z=0),t.hasM&&(t.m=0),t}addCoordinatePoint(e,t,r){const n=this._transform?this._applyTransform(this._transform,t,r,0):t;if(null!=n)switch(r){case 0:e.x=n;break;case 1:e.y=n;break;case 2:e.hasZ?e.z=n:e.m=n;break;case 3:e.m=n}}_transformPathLikeValue(e,t){let r=0;return t<=1&&(r=this._previousCoordinate[t],this._previousCoordinate[t]+=e),this._transform?this._applyTransform(this._transform,e,t,r):e}_addCoordinatePolyline(e,t,r){this._dehydratedAddPointsCoordinate(e.paths,t,r)}_addCoordinatePolygon(e,t,r){this._dehydratedAddPointsCoordinate(e.rings,t,r)}_addCoordinateMultipoint(e,t,r){0===r&&e.points.push([]);const n=this._transformPathLikeValue(t,r);e.points[e.points.length-1].push(n)}_createPolygonGeometry(e){return{type:"polygon",rings:[[]],spatialReference:e.spatialReference,hasZ:!!e.hasZ,hasM:!!e.hasM}}_createPolylineGeometry(e){return{type:"polyline",paths:[[]],spatialReference:e.spatialReference,hasZ:!!e.hasZ,hasM:!!e.hasM}}_createMultipointGeometry(e){return{type:"multipoint",points:[],spatialReference:e.spatialReference,hasZ:!!e.hasZ,hasM:!!e.hasM}}_dehydratedAddPointsCoordinate(e,t,r){0===r&&0==this._toAddInCurrentPath--&&(e.push([]),this._toAddInCurrentPath=this._lengths[++this._currentLengthIndex]-1,this._previousCoordinate[0]=0,this._previousCoordinate[1]=0);const n=this._transformPathLikeValue(t,r),s=e[e.length-1],o=this._coordinateBuffer;if(o){if(0===r){const e=this._coordinateBufferPtr*Float64Array.BYTES_PER_ELEMENT;s.push(new Float64Array(o.buffer,e,this._vertexDimension))}o[this._coordinateBufferPtr++]=n}}_deriveApplyTransform(e){const{hasZ:t,hasM:r}=e;return t&&r?y:t?f:r?p:d}}var _=r(66208);class b{_parseFeatureQuery(e){const t=new m(e.options),r=(0,_.m)(e.buffer,t),n={...r,spatialReference:r.spatialReference?.toJSON(),fields:r.fields?r.fields.map((e=>e.toJSON())):void 0,missingAttributes:t.missingAttributes};return Promise.resolve(n)}}function w(){return new b}}}]);
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[9899],{11868:(_,E,A)=>{A.d(E,{oe:()=>R});var T=A(34275);function R(_,E=!1){return _<=T.y9?E?new Array(_).fill(0):new Array(_):new Float32Array(_)}},97146:(_,E,A)=>{A.d(E,{Dg:()=>R,my:()=>N,tM:()=>C});var T=A(34275);function R(_){if((0,T.cy)(_)){if(_.length<T.y9)return _}else if(_.length<T.y9)return Array.from(_);let E=!0,A=!0;return _.some(((_,T)=>(E=E&&0===_,A=A&&_===T,!E&&!A))),E?function(_){if(1===_)return e;if(_<T.y9)return new Array(_).fill(0);if(_>O.length){const E=Math.max(2*O.length,_);O=new Uint8Array(E)}return new Uint8Array(O.buffer,0,_)}(_.length):A?C(_.length):(0,T.cy)(_)||_.BYTES_PER_ELEMENT!==Uint16Array.BYTES_PER_ELEMENT?function(_){let E=!0;for(const A of _){if(A>=65536)return(0,T.cy)(_)?new Uint32Array(_):_;A>=256&&(E=!1)}return E?new Uint8Array(_):new Uint16Array(_)}(_):_}function N(_){return _<=T.y9?new Array(_):_<=65536?new Uint16Array(_):new Uint32Array(_)}let t=(()=>{const _=new Uint32Array(131072);for(let E=0;E<_.length;++E)_[E]=E;return _})();const e=[0],S=(()=>{const _=new Uint16Array(65536);for(let E=0;E<_.length;++E)_[E]=E;return _})();function C(_){if(1===_)return e;if(_<T.y9)return Array.from(new Uint16Array(S.buffer,0,_));if(_<S.length)return new Uint16Array(S.buffer,0,_);if(_>t.length){const E=Math.max(2*t.length,_);t=new Uint32Array(E);for(let _=0;_<t.length;_++)t[_]=_}return new Uint32Array(t.buffer,0,_)}let O=new Uint8Array(65536)},90239:(_,E,A)=>{function T(_){switch(_){case"u8":case"i8":return 1;case"u16":case"i16":return 2;case"u32":case"i32":case"f32":return 4;case"f64":return 8}}A.d(E,{GJ:()=>T})},1843:(_,E,A)=>{A.d(E,{BP:()=>S,l5:()=>C});var T=A(13030),R=A(90239),N=A(620);class t{constructor(_,E){this.layout=_,this.buffer="number"==typeof E?new ArrayBuffer(E*_.stride):E;for(const E of _.fields.keys()){const A=_.fields.get(E);this[E]=new A.constructor(this.buffer,A.offset,this.stride)}}get stride(){return this.layout.stride}get count(){return this.buffer.byteLength/this.stride}get byteLength(){return this.buffer.byteLength}getField(_,E){const A=this[_];return A&&A.elementCount===E.ElementCount&&A.elementType===E.ElementType?A:null}slice(_,E){return new t(this.layout,this.buffer.slice(_*this.stride,E*this.stride))}copyFrom(_,E=0,A=0,T=_.count){const R=this.stride;if(R%4==0){const N=new Uint32Array(_.buffer,E*R,T*R/4);new Uint32Array(this.buffer,A*R,T*R/4).set(N)}else{const N=new Uint8Array(_.buffer,E*R,T*R);new Uint8Array(this.buffer,A*R,T*R).set(N)}return this}get usedMemory(){return this.byteLength}dispose(){}}class e{constructor(_){this._stride=0,this._lastAligned=0,this._fields=new Map,_&&(this._stride=_.stride,_.fields.forEach((_=>this._fields.set(_[0],{..._[1],constructor:r(_[1].constructor)}))))}freeze(){return this}vec2f(_,E){return this._appendField(_,T.gH,E),this}vec2f64(_,E){return this._appendField(_,T.si,E),this}vec3f(_,E){return this._appendField(_,T.xs,E),this}vec3f64(_,E){return this._appendField(_,T.Xm,E),this}vec4f(_,E){return this._appendField(_,T.Eq,E),this}vec4f64(_,E){return this._appendField(_,T.Aj,E),this}mat3f(_,E){return this._appendField(_,T.jZ,E),this}mat3f64(_,E){return this._appendField(_,T.j0,E),this}mat4f(_,E){return this._appendField(_,T.Sx,E),this}mat4f64(_,E){return this._appendField(_,T.E$,E),this}vec4u8(_,E){return this._appendField(_,T.XP,E),this}f32(_,E){return this._appendField(_,T.Y$,E),this}f64(_,E){return this._appendField(_,T.qB,E),this}u8(_,E){return this._appendField(_,T.SL,E),this}u16(_,E){return this._appendField(_,T.h,E),this}i8(_,E){return this._appendField(_,T.bf,E),this}vec2i8(_,E){return this._appendField(_,T.D6,E),this}vec2i16(_,E){return this._appendField(_,T.mJ,E),this}vec2u8(_,E){return this._appendField(_,T.LC,E),this}vec4u16(_,E){return this._appendField(_,T.Uz,E),this}u32(_,E){return this._appendField(_,T.P,E),this}_appendField(_,E,A){if(this._fields.has(_))return void(0,N.vA)(!1,`${_} already added to vertex buffer layout`);const T=E.ElementCount*(0,R.GJ)(E.ElementType),t=this._stride;this._stride+=T,this._fields.set(_,{size:T,constructor:E,offset:t,optional:A})}createBuffer(_){return new t(this,_)}createView(_){return new t(this,_)}clone(){const _=new e;return _._stride=this._stride,_._fields=new Map,this._fields.forEach(((E,A)=>_._fields.set(A,E))),_.BufferType=this.BufferType,_}get stride(){if(this._lastAligned!==this._fields.size){let _=1;this._fields.forEach((E=>_=Math.max(_,(0,R.GJ)(E.constructor.ElementType)))),this._stride=Math.floor((this._stride+_-1)/_)*_,this._lastAligned=this._fields.size}return this._stride}get fields(){return this._fields}}function S(){return new e}class C{constructor(_){this.fields=new Array,_.fields.forEach(((_,E)=>{const A={..._,constructor:n(_.constructor)};this.fields.push([E,A])})),this.stride=_.stride}}const O=[T.Y$,T.gH,T.xs,T.Eq,T.jZ,T.Sx,T.qB,T.si,T.Xm,T.Aj,T.j0,T.E$,T.SL,T.LC,T.eI,T.XP,T.h,T.Yi,T.nS,T.Uz,T.P,T.An,T.H$,T.ml,T.bf,T.D6,T.m8,T.TX,T.Qt,T.mJ,T.Vp,T.E7,T.My,T.UL,T.zD,T.Y4];function n(_){return`${_.ElementType}_${_.ElementCount}`}function r(_){return I.get(_)}const I=new Map;O.forEach((_=>I.set(n(_),_)))},620:(_,E,A)=>{A.d(E,{O_:()=>N,vA:()=>R}),A(48163),A(87317),(0,A(91829).vt)();class T{constructor(_){this.message=_}toString(){return`AssertException: ${this.message}`}}function R(_,E="Assertion"){if(!_){const _=new Error(E).stack;throw new T(`${E} at ${_}`)}}function N(_,E,A,T){let R,N=(A[0]-_[0])/E[0],t=(T[0]-_[0])/E[0];N>t&&(R=N,N=t,t=R);let e=(A[1]-_[1])/E[1],S=(T[1]-_[1])/E[1];if(e>S&&(R=e,e=S,S=R),N>S||e>t)return!1;e>N&&(N=e),S<t&&(t=S);let C=(A[2]-_[2])/E[2],O=(T[2]-_[2])/E[2];return C>O&&(R=C,C=O,O=R),!(N>O||C>t||(O<t&&(t=O),t<0))}},63907:(_,E,A)=>{var T,R,N,t,e,S,C,O,n,r,I,i,L,M,D,s,U,P,G,F,B,f,u;A.d(E,{Ab:()=>M,Ac:()=>C,Ap:()=>L,CQ:()=>c,Cj:()=>I,Co:()=>G,H0:()=>D,Hr:()=>u,MT:()=>n,NV:()=>T,NZ:()=>e,Nm:()=>f,R:()=>F,Tb:()=>t,WR:()=>R,Y7:()=>S,_U:()=>P,dn:()=>N,eA:()=>r,ld:()=>s,nI:()=>o,pF:()=>i,pe:()=>O,vt:()=>B,yQ:()=>U}),function(_){_[_.DEPTH=256]="DEPTH",_[_.STENCIL=1024]="STENCIL",_[_.COLOR=16384]="COLOR"}(T||(T={})),function(_){_[_.POINTS=0]="POINTS",_[_.LINES=1]="LINES",_[_.LINE_LOOP=2]="LINE_LOOP",_[_.LINE_STRIP=3]="LINE_STRIP",_[_.TRIANGLES=4]="TRIANGLES",_[_.TRIANGLE_STRIP=5]="TRIANGLE_STRIP",_[_.TRIANGLE_FAN=6]="TRIANGLE_FAN"}(R||(R={})),function(_){_[_.ZERO=0]="ZERO",_[_.ONE=1]="ONE",_[_.SRC_COLOR=768]="SRC_COLOR",_[_.ONE_MINUS_SRC_COLOR=769]="ONE_MINUS_SRC_COLOR",_[_.SRC_ALPHA=770]="SRC_ALPHA",_[_.ONE_MINUS_SRC_ALPHA=771]="ONE_MINUS_SRC_ALPHA",_[_.DST_ALPHA=772]="DST_ALPHA",_[_.ONE_MINUS_DST_ALPHA=773]="ONE_MINUS_DST_ALPHA",_[_.DST_COLOR=774]="DST_COLOR",_[_.ONE_MINUS_DST_COLOR=775]="ONE_MINUS_DST_COLOR",_[_.SRC_ALPHA_SATURATE=776]="SRC_ALPHA_SATURATE",_[_.CONSTANT_COLOR=32769]="CONSTANT_COLOR",_[_.ONE_MINUS_CONSTANT_COLOR=32770]="ONE_MINUS_CONSTANT_COLOR",_[_.CONSTANT_ALPHA=32771]="CONSTANT_ALPHA",_[_.ONE_MINUS_CONSTANT_ALPHA=32772]="ONE_MINUS_CONSTANT_ALPHA"}(N||(N={})),function(_){_[_.ADD=32774]="ADD",_[_.MIN=32775]="MIN",_[_.MAX=32776]="MAX",_[_.SUBTRACT=32778]="SUBTRACT",_[_.REVERSE_SUBTRACT=32779]="REVERSE_SUBTRACT"}(t||(t={})),function(_){_[_.ARRAY_BUFFER=34962]="ARRAY_BUFFER",_[_.ELEMENT_ARRAY_BUFFER=34963]="ELEMENT_ARRAY_BUFFER",_[_.UNIFORM_BUFFER=35345]="UNIFORM_BUFFER",_[_.PIXEL_PACK_BUFFER=35051]="PIXEL_PACK_BUFFER",_[_.PIXEL_UNPACK_BUFFER=35052]="PIXEL_UNPACK_BUFFER",_[_.COPY_READ_BUFFER=36662]="COPY_READ_BUFFER",_[_.COPY_WRITE_BUFFER=36663]="COPY_WRITE_BUFFER",_[_.TRANSFORM_FEEDBACK_BUFFER=35982]="TRANSFORM_FEEDBACK_BUFFER"}(e||(e={})),function(_){_[_.FRONT=1028]="FRONT",_[_.BACK=1029]="BACK",_[_.FRONT_AND_BACK=1032]="FRONT_AND_BACK"}(S||(S={})),function(_){_[_.CW=2304]="CW",_[_.CCW=2305]="CCW"}(C||(C={})),function(_){_[_.BYTE=5120]="BYTE",_[_.UNSIGNED_BYTE=5121]="UNSIGNED_BYTE",_[_.SHORT=5122]="SHORT",_[_.UNSIGNED_SHORT=5123]="UNSIGNED_SHORT",_[_.INT=5124]="INT",_[_.UNSIGNED_INT=5125]="UNSIGNED_INT",_[_.FLOAT=5126]="FLOAT",_[_.HALF_FLOAT=5131]="HALF_FLOAT"}(O||(O={})),function(_){_[_.NEVER=512]="NEVER",_[_.LESS=513]="LESS",_[_.EQUAL=514]="EQUAL",_[_.LEQUAL=515]="LEQUAL",_[_.GREATER=516]="GREATER",_[_.NOTEQUAL=517]="NOTEQUAL",_[_.GEQUAL=518]="GEQUAL",_[_.ALWAYS=519]="ALWAYS"}(n||(n={})),function(_){_[_.ZERO=0]="ZERO",_[_.KEEP=7680]="KEEP",_[_.REPLACE=7681]="REPLACE",_[_.INCR=7682]="INCR",_[_.DECR=7683]="DECR",_[_.INVERT=5386]="INVERT",_[_.INCR_WRAP=34055]="INCR_WRAP",_[_.DECR_WRAP=34056]="DECR_WRAP"}(r||(r={})),function(_){_[_.NEAREST=9728]="NEAREST",_[_.LINEAR=9729]="LINEAR",_[_.NEAREST_MIPMAP_NEAREST=9984]="NEAREST_MIPMAP_NEAREST",_[_.LINEAR_MIPMAP_NEAREST=9985]="LINEAR_MIPMAP_NEAREST",_[_.NEAREST_MIPMAP_LINEAR=9986]="NEAREST_MIPMAP_LINEAR",_[_.LINEAR_MIPMAP_LINEAR=9987]="LINEAR_MIPMAP_LINEAR"}(I||(I={})),function(_){_[_.CLAMP_TO_EDGE=33071]="CLAMP_TO_EDGE",_[_.REPEAT=10497]="REPEAT",_[_.MIRRORED_REPEAT=33648]="MIRRORED_REPEAT"}(i||(i={})),function(_){_[_.TEXTURE_2D=3553]="TEXTURE_2D",_[_.TEXTURE_CUBE_MAP=34067]="TEXTURE_CUBE_MAP",_[_.TEXTURE_3D=32879]="TEXTURE_3D",_[_.TEXTURE_CUBE_MAP_POSITIVE_X=34069]="TEXTURE_CUBE_MAP_POSITIVE_X",_[_.TEXTURE_CUBE_MAP_NEGATIVE_X=34070]="TEXTURE_CUBE_MAP_NEGATIVE_X",_[_.TEXTURE_CUBE_MAP_POSITIVE_Y=34071]="TEXTURE_CUBE_MAP_POSITIVE_Y",_[_.TEXTURE_CUBE_MAP_NEGATIVE_Y=34072]="TEXTURE_CUBE_MAP_NEGATIVE_Y",_[_.TEXTURE_CUBE_MAP_POSITIVE_Z=34073]="TEXTURE_CUBE_MAP_POSITIVE_Z",_[_.TEXTURE_CUBE_MAP_NEGATIVE_Z=34074]="TEXTURE_CUBE_MAP_NEGATIVE_Z",_[_.TEXTURE_2D_ARRAY=35866]="TEXTURE_2D_ARRAY"}(L||(L={})),function(_){_[_.DEPTH_COMPONENT=6402]="DEPTH_COMPONENT",_[_.DEPTH_STENCIL=34041]="DEPTH_STENCIL",_[_.DEPTH24_STENCIL8=35056]="DEPTH24_STENCIL8",_[_.ALPHA=6406]="ALPHA",_[_.RGB=6407]="RGB",_[_.RGBA=6408]="RGBA",_[_.LUMINANCE=6409]="LUMINANCE",_[_.LUMINANCE_ALPHA=6410]="LUMINANCE_ALPHA",_[_.RED=6403]="RED",_[_.RG=33319]="RG",_[_.RED_INTEGER=36244]="RED_INTEGER",_[_.RG_INTEGER=33320]="RG_INTEGER",_[_.RGB_INTEGER=36248]="RGB_INTEGER",_[_.RGBA_INTEGER=36249]="RGBA_INTEGER"}(M||(M={})),function(_){_[_.RGBA4=32854]="RGBA4",_[_.R16F=33325]="R16F",_[_.RG16F=33327]="RG16F",_[_.RGB32F=34837]="RGB32F",_[_.RGBA16F=34842]="RGBA16F",_[_.R32F=33326]="R32F",_[_.RG32F=33328]="RG32F",_[_.RGBA32F=34836]="RGBA32F",_[_.R11F_G11F_B10F=35898]="R11F_G11F_B10F",_[_.RGB8=32849]="RGB8",_[_.RGBA8=32856]="RGBA8",_[_.RGB5_A1=32855]="RGB5_A1",_[_.R8=33321]="R8",_[_.RG8=33323]="RG8",_[_.R8I=33329]="R8I",_[_.R8UI=33330]="R8UI",_[_.R16I=33331]="R16I",_[_.R16UI=33332]="R16UI",_[_.R32I=33333]="R32I",_[_.R32UI=33334]="R32UI",_[_.RG8I=33335]="RG8I",_[_.RG8UI=33336]="RG8UI",_[_.RG16I=33337]="RG16I",_[_.RG16UI=33338]="RG16UI",_[_.RG32I=33339]="RG32I",_[_.RG32UI=33340]="RG32UI",_[_.RGB16F=34843]="RGB16F",_[_.RGB9_E5=35901]="RGB9_E5",_[_.SRGB8=35905]="SRGB8",_[_.SRGB8_ALPHA8=35907]="SRGB8_ALPHA8",_[_.RGB565=36194]="RGB565",_[_.RGBA32UI=36208]="RGBA32UI",_[_.RGB32UI=36209]="RGB32UI",_[_.RGBA16UI=36214]="RGBA16UI",_[_.RGB16UI=36215]="RGB16UI",_[_.RGBA8UI=36220]="RGBA8UI",_[_.RGB8UI=36221]="RGB8UI",_[_.RGBA32I=36226]="RGBA32I",_[_.RGB32I=36227]="RGB32I",_[_.RGBA16I=36232]="RGBA16I",_[_.RGB16I=36233]="RGB16I",_[_.RGBA8I=36238]="RGBA8I",_[_.RGB8I=36239]="RGB8I",_[_.R8_SNORM=36756]="R8_SNORM",_[_.RG8_SNORM=36757]="RG8_SNORM",_[_.RGB8_SNORM=36758]="RGB8_SNORM",_[_.RGBA8_SNORM=36759]="RGBA8_SNORM",_[_.RGB10_A2=32857]="RGB10_A2",_[_.RGB10_A2UI=36975]="RGB10_A2UI"}(D||(D={})),function(_){_[_.FLOAT=5126]="FLOAT",_[_.UNSIGNED_BYTE=5121]="UNSIGNED_BYTE",_[_.UNSIGNED_INT_24_8=34042]="UNSIGNED_INT_24_8",_[_.UNSIGNED_SHORT_4_4_4_4=32819]="UNSIGNED_SHORT_4_4_4_4",_[_.UNSIGNED_SHORT_5_5_5_1=32820]="UNSIGNED_SHORT_5_5_5_1",_[_.UNSIGNED_SHORT_5_6_5=33635]="UNSIGNED_SHORT_5_6_5",_[_.BYTE=5120]="BYTE",_[_.UNSIGNED_SHORT=5123]="UNSIGNED_SHORT",_[_.SHORT=5122]="SHORT",_[_.UNSIGNED_INT=5125]="UNSIGNED_INT",_[_.INT=5124]="INT",_[_.HALF_FLOAT=5131]="HALF_FLOAT",_[_.UNSIGNED_INT_2_10_10_10_REV=33640]="UNSIGNED_INT_2_10_10_10_REV",_[_.UNSIGNED_INT_10F_11F_11F_REV=35899]="UNSIGNED_INT_10F_11F_11F_REV",_[_.UNSIGNED_INT_5_9_9_9_REV=35902]="UNSIGNED_INT_5_9_9_9_REV",_[_.FLOAT_32_UNSIGNED_INT_24_8_REV=36269]="FLOAT_32_UNSIGNED_INT_24_8_REV"}(s||(s={})),function(_){_[_.DEPTH_COMPONENT16=33189]="DEPTH_COMPONENT16",_[_.STENCIL_INDEX8=36168]="STENCIL_INDEX8",_[_.DEPTH_STENCIL=34041]="DEPTH_STENCIL",_[_.DEPTH_COMPONENT24=33190]="DEPTH_COMPONENT24",_[_.DEPTH_COMPONENT32F=36012]="DEPTH_COMPONENT32F",_[_.DEPTH24_STENCIL8=35056]="DEPTH24_STENCIL8",_[_.DEPTH32F_STENCIL8=36013]="DEPTH32F_STENCIL8"}(U||(U={})),function(_){_[_.STATIC_DRAW=35044]="STATIC_DRAW",_[_.DYNAMIC_DRAW=35048]="DYNAMIC_DRAW",_[_.STREAM_DRAW=35040]="STREAM_DRAW",_[_.STATIC_READ=35045]="STATIC_READ",_[_.DYNAMIC_READ=35049]="DYNAMIC_READ",_[_.STREAM_READ=35041]="STREAM_READ",_[_.STATIC_COPY=35046]="STATIC_COPY",_[_.DYNAMIC_COPY=35050]="DYNAMIC_COPY",_[_.STREAM_COPY=35042]="STREAM_COPY"}(P||(P={})),function(_){_[_.FRAGMENT_SHADER=35632]="FRAGMENT_SHADER",_[_.VERTEX_SHADER=35633]="VERTEX_SHADER"}(G||(G={})),function(_){_[_.FRAMEBUFFER=36160]="FRAMEBUFFER",_[_.READ_FRAMEBUFFER=36008]="READ_FRAMEBUFFER",_[_.DRAW_FRAMEBUFFER=36009]="DRAW_FRAMEBUFFER"}(F||(F={})),function(_){_[_.Texture=0]="Texture",_[_.BufferObject=1]="BufferObject",_[_.VertexArrayObject=2]="VertexArrayObject",_[_.Shader=3]="Shader",_[_.Program=4]="Program",_[_.FramebufferObject=5]="FramebufferObject",_[_.Renderbuffer=6]="Renderbuffer",_[_.TransformFeedback=7]="TransformFeedback",_[_.Sync=8]="Sync",_[_.UNCOUNTED=9]="UNCOUNTED",_[_.LinesOfCode=9]="LinesOfCode",_[_.Uniform=10]="Uniform",_[_.COUNT=11]="COUNT"}(B||(B={})),function(_){_[_.COLOR_ATTACHMENT0=36064]="COLOR_ATTACHMENT0",_[_.COLOR_ATTACHMENT1=36065]="COLOR_ATTACHMENT1",_[_.COLOR_ATTACHMENT2=36066]="COLOR_ATTACHMENT2",_[_.COLOR_ATTACHMENT3=36067]="COLOR_ATTACHMENT3",_[_.COLOR_ATTACHMENT4=36068]="COLOR_ATTACHMENT4",_[_.COLOR_ATTACHMENT5=36069]="COLOR_ATTACHMENT5",_[_.COLOR_ATTACHMENT6=36070]="COLOR_ATTACHMENT6",_[_.COLOR_ATTACHMENT7=36071]="COLOR_ATTACHMENT7",_[_.COLOR_ATTACHMENT8=36072]="COLOR_ATTACHMENT8",_[_.COLOR_ATTACHMENT9=36073]="COLOR_ATTACHMENT9",_[_.COLOR_ATTACHMENT10=36074]="COLOR_ATTACHMENT10",_[_.COLOR_ATTACHMENT11=36075]="COLOR_ATTACHMENT11",_[_.COLOR_ATTACHMENT12=36076]="COLOR_ATTACHMENT12",_[_.COLOR_ATTACHMENT13=36077]="COLOR_ATTACHMENT13",_[_.COLOR_ATTACHMENT14=36078]="COLOR_ATTACHMENT14",_[_.COLOR_ATTACHMENT15=36079]="COLOR_ATTACHMENT15"}(f||(f={})),function(_){_[_.NONE=0]="NONE",_[_.BACK=1029]="BACK"}(u||(u={}));const o=33306;var c,h,H,a,d,l,p;!function(_){_[_.COMPRESSED_RGB_S3TC_DXT1_EXT=33776]="COMPRESSED_RGB_S3TC_DXT1_EXT",_[_.COMPRESSED_RGBA_S3TC_DXT1_EXT=33777]="COMPRESSED_RGBA_S3TC_DXT1_EXT",_[_.COMPRESSED_RGBA_S3TC_DXT3_EXT=33778]="COMPRESSED_RGBA_S3TC_DXT3_EXT",_[_.COMPRESSED_RGBA_S3TC_DXT5_EXT=33779]="COMPRESSED_RGBA_S3TC_DXT5_EXT",_[_.COMPRESSED_R11_EAC=37488]="COMPRESSED_R11_EAC",_[_.COMPRESSED_SIGNED_R11_EAC=37489]="COMPRESSED_SIGNED_R11_EAC",_[_.COMPRESSED_RG11_EAC=37490]="COMPRESSED_RG11_EAC",_[_.COMPRESSED_SIGNED_RG11_EAC=37491]="COMPRESSED_SIGNED_RG11_EAC",_[_.COMPRESSED_RGB8_ETC2=37492]="COMPRESSED_RGB8_ETC2",_[_.COMPRESSED_SRGB8_ETC2=37493]="COMPRESSED_SRGB8_ETC2",_[_.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2=37494]="COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2",_[_.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2=37495]="COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2",_[_.COMPRESSED_RGBA8_ETC2_EAC=37496]="COMPRESSED_RGBA8_ETC2_EAC",_[_.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC=37497]="COMPRESSED_SRGB8_ALPHA8_ETC2_EAC"}(c||(c={})),function(_){_[_.FLOAT=5126]="FLOAT",_[_.FLOAT_VEC2=35664]="FLOAT_VEC2",_[_.FLOAT_VEC3=35665]="FLOAT_VEC3",_[_.FLOAT_VEC4=35666]="FLOAT_VEC4",_[_.INT=5124]="INT",_[_.INT_VEC2=35667]="INT_VEC2",_[_.INT_VEC3=35668]="INT_VEC3",_[_.INT_VEC4=35669]="INT_VEC4",_[_.BOOL=35670]="BOOL",_[_.BOOL_VEC2=35671]="BOOL_VEC2",_[_.BOOL_VEC3=35672]="BOOL_VEC3",_[_.BOOL_VEC4=35673]="BOOL_VEC4",_[_.FLOAT_MAT2=35674]="FLOAT_MAT2",_[_.FLOAT_MAT3=35675]="FLOAT_MAT3",_[_.FLOAT_MAT4=35676]="FLOAT_MAT4",_[_.SAMPLER_2D=35678]="SAMPLER_2D",_[_.SAMPLER_CUBE=35680]="SAMPLER_CUBE",_[_.UNSIGNED_INT=5125]="UNSIGNED_INT",_[_.UNSIGNED_INT_VEC2=36294]="UNSIGNED_INT_VEC2",_[_.UNSIGNED_INT_VEC3=36295]="UNSIGNED_INT_VEC3",_[_.UNSIGNED_INT_VEC4=36296]="UNSIGNED_INT_VEC4",_[_.FLOAT_MAT2x3=35685]="FLOAT_MAT2x3",_[_.FLOAT_MAT2x4=35686]="FLOAT_MAT2x4",_[_.FLOAT_MAT3x2=35687]="FLOAT_MAT3x2",_[_.FLOAT_MAT3x4=35688]="FLOAT_MAT3x4",_[_.FLOAT_MAT4x2=35689]="FLOAT_MAT4x2",_[_.FLOAT_MAT4x3=35690]="FLOAT_MAT4x3",_[_.SAMPLER_3D=35679]="SAMPLER_3D",_[_.SAMPLER_2D_SHADOW=35682]="SAMPLER_2D_SHADOW",_[_.SAMPLER_2D_ARRAY=36289]="SAMPLER_2D_ARRAY",_[_.SAMPLER_2D_ARRAY_SHADOW=36292]="SAMPLER_2D_ARRAY_SHADOW",_[_.SAMPLER_CUBE_SHADOW=36293]="SAMPLER_CUBE_SHADOW",_[_.INT_SAMPLER_2D=36298]="INT_SAMPLER_2D",_[_.INT_SAMPLER_3D=36299]="INT_SAMPLER_3D",_[_.INT_SAMPLER_CUBE=36300]="INT_SAMPLER_CUBE",_[_.INT_SAMPLER_2D_ARRAY=36303]="INT_SAMPLER_2D_ARRAY",_[_.UNSIGNED_INT_SAMPLER_2D=36306]="UNSIGNED_INT_SAMPLER_2D",_[_.UNSIGNED_INT_SAMPLER_3D=36307]="UNSIGNED_INT_SAMPLER_3D",_[_.UNSIGNED_INT_SAMPLER_CUBE=36308]="UNSIGNED_INT_SAMPLER_CUBE",_[_.UNSIGNED_INT_SAMPLER_2D_ARRAY=36311]="UNSIGNED_INT_SAMPLER_2D_ARRAY"}(h||(h={})),function(_){_[_.OBJECT_TYPE=37138]="OBJECT_TYPE",_[_.SYNC_CONDITION=37139]="SYNC_CONDITION",_[_.SYNC_STATUS=37140]="SYNC_STATUS",_[_.SYNC_FLAGS=37141]="SYNC_FLAGS"}(H||(H={})),function(_){_[_.UNSIGNALED=37144]="UNSIGNALED",_[_.SIGNALED=37145]="SIGNALED"}(a||(a={})),function(_){_[_.ALREADY_SIGNALED=37146]="ALREADY_SIGNALED",_[_.TIMEOUT_EXPIRED=37147]="TIMEOUT_EXPIRED",_[_.CONDITION_SATISFIED=37148]="CONDITION_SATISFIED",_[_.WAIT_FAILED=37149]="WAIT_FAILED"}(d||(d={})),function(_){_[_.SYNC_GPU_COMMANDS_COMPLETE=37143]="SYNC_GPU_COMMANDS_COMPLETE"}(l||(l={})),function(_){_[_.SYNC_FLUSH_COMMANDS_BIT=1]="SYNC_FLUSH_COMMANDS_BIT"}(p||(p={}))}}]);
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[4322],{67482:(e,t,n)=>{function r(e){return null!=a(e)||null!=i(e)}function o(e){return u.test(e)}function s(e){return a(e)??i(e)}function i(e){const t=new Date(e);return function(e,t){if(Number.isNaN(e.getTime()))return!1;let n=!0;if(l&&/\d+\W*$/.test(t)){const e=t.match(/[a-zA-Z]{2,}/);if(e){let t=!1,r=0;for(;!t&&r<=e.length;)t=!c.test(e[r]),r++;n=!t}}return n}(t,e)?Number.isNaN(t.getTime())?null:t.getTime()-6e4*t.getTimezoneOffset():null}function a(e){const t=u.exec(e);if(!t?.groups)return null;const n=t.groups,r=+n.year,o=+n.month-1,s=+n.day,i=+(n.hours??"0"),a=+(n.minutes??"0"),c=+(n.seconds??"0");if(i>23)return null;if(a>59)return null;if(c>59)return null;const l=n.ms??"0",p=l?+l.padEnd(3,"0").slice(0,3):0;let f;if(n.isUTC||!n.offsetSign)f=Date.UTC(r,o,s,i,a,c,p);else{const e=+n.offsetHours,t=+n.offsetMinutes;f=6e4*("+"===n.offsetSign?-1:1)*(60*e+t)+Date.UTC(r,o,s,i,a,c,p)}return Number.isNaN(f)?null:f}n.d(t,{Br:()=>o,Cq:()=>r,_U:()=>s});const u=/^(?:(?<year>-?\d{4,})-(?<month>\d{2})-(?<day>\d{2}))(?:T(?<hours>\d{2}):(?<minutes>\d{2}):(?<seconds>\d{2})(?:\.(?<ms>\d+))?)?(?:(?<isUTC>Z)|(?:(?<offsetSign>\+|-)(?<offsetHours>\d{2}):(?<offsetMinutes>\d{2})))?$/,c=/^((jan(uary)?)|(feb(ruary)?)|(mar(ch)?)|(apr(il)?)|(may)|(jun(e)?)|(jul(y)?)|(aug(ust)?)|(sep(tember)?)|(oct(ober)?)|(nov(ember)?)|(dec(ember)?)|(am)|(pm)|(gmt)|(utc))$/i,l=!Number.isNaN(new Date("technology 10").getTime())},43334:(e,t,n)=>{n.d(t,{N3:()=>s,Om:()=>o});var r=n(92722);class o{constructor(e=null,t={},n,r){this.geometry=e,this.attributes=t,this.centroid=n,this.objectId=r,this.displayId=0,this.geohashX=0,this.geohashY=0}static fromJSON(e,t){const n=e.geometry?r.A.fromJSON(e.geometry):null,s=e.centroid?r.A.fromJSON(e.centroid):null,i=e.attributes[t];return new o(n,e.attributes,s,i)}weakClone(){const e=new o(this.geometry,this.attributes,this.centroid,this.objectId);return e.displayId=this.displayId,e.geohashX=this.geohashX,e.geohashY=this.geohashY,e}clone(){const e=this.geometry?.clone(),t=new o(e,{...this.attributes},this.centroid?.clone(),this.objectId);return t.displayId=this.displayId,t.geohashX=this.geohashX,t.geohashY=this.geohashY,t}}function s(e){return!!e.geometry?.coords?.length}},92722:(e,t,n)=>{n.d(t,{A:()=>r});class r{constructor(e=[],t=[]){this.lengths=e??[],this.coords=t??[]}static fromJSON(e){return new r(e.lengths,e.coords)}static fromRect(e){const[t,n,o,s]=e,i=o-t,a=s-n;return new r([5],[t,n,i,0,0,a,-i,0,0,-a])}get isPoint(){return 0===this.lengths.length}get maxLength(){return Math.max(...this.lengths)}get size(){return this.lengths.reduce(((e,t)=>e+t))}forEachVertex(e){let t=0;this.lengths.length||e(this.coords[0],this.coords[1]);for(let n=0;n<this.lengths.length;n++){const r=this.lengths[n];for(let n=0;n<r;n++)e(this.coords[2*(n+t)],this.coords[2*(n+t)+1]);t+=r}}deltaDecode(){const e=this.clone(),{coords:t,lengths:n}=e;let r=0;for(const e of n){for(let n=1;n<e;n++)t[2*(r+n)]+=t[2*(r+n)-2],t[2*(r+n)+1]+=t[2*(r+n)-1];r+=e}return e}clone(e){if(0===this.lengths.length)return new r([],[this.coords[0],this.coords[1]]);const t=2*(0===this.lengths.length?1:this.lengths.reduce(((e,t)=>e+t))),n=this.coords.slice(0,t);return e?(e.set(n),new r(this.lengths,e)):new r(Array.from(this.lengths),Array.from(n))}}},85113:(e,t,n)=>{n.d(t,{BM:()=>x,bd:()=>P,sO:()=>A,xD:()=>l});var r=n(67482),o=n(49186),s=n(21325),i=n(43334),a=n(92722),u=n(30524);const c={LineString:"esriGeometryPolyline",MultiLineString:"esriGeometryPolyline",MultiPoint:"esriGeometryMultipoint",Point:"esriGeometryPoint",Polygon:"esriGeometryPolygon",MultiPolygon:"esriGeometryPolygon"};function l(e){return c[e]}function*p(e){switch(e.type){case"Feature":yield e;break;case"FeatureCollection":for(const t of e.features)t&&(yield t)}}function*f(e){if(e)switch(e.type){case"Point":yield e.coordinates;break;case"LineString":case"MultiPoint":yield*e.coordinates;break;case"MultiLineString":case"Polygon":for(const t of e.coordinates)yield*t;break;case"MultiPolygon":for(const t of e.coordinates)for(const e of t)yield*e}}function d(e){for(const t of e)if(t.length>2)return!0;return!1}function y(e){let t=0;for(let n=0;n<e.length;n++){const r=e[n],o=e[(n+1)%e.length];t+=r[0]*o[1]-o[0]*r[1]}return t<=0}function m(e){const t=e[0],n=e[e.length-1];return t[0]===n[0]&&t[1]===n[1]&&t[2]===n[2]||e.push(t),e}function g(e,t,n){switch(t.type){case"LineString":case"MultiPoint":return function(e,t,n){return b(e,t.coordinates,n),e}(e,t,n);case"MultiLineString":return function(e,t,n){for(const r of t.coordinates)b(e,r,n);return e}(e,t,n);case"MultiPolygon":return function(e,t,n){for(const r of t.coordinates){h(e,r[0],n);for(let t=1;t<r.length;t++)w(e,r[t],n)}return e}(e,t,n);case"Point":return function(e,t,n){return S(e,t.coordinates,n),e}(e,t,n);case"Polygon":return function(e,t,n){const r=t.coordinates;h(e,r[0],n);for(let t=1;t<r.length;t++)w(e,r[t],n);return e}(e,t,n)}}function h(e,t,n){const r=m(t);!function(e){return!y(e)}(r)?b(e,r,n):T(e,r,n)}function w(e,t,n){const r=m(t);!function(e){return y(e)}(r)?b(e,r,n):T(e,r,n)}function b(e,t,n){for(const r of t)S(e,r,n);e.lengths.push(t.length)}function T(e,t,n){for(let r=t.length-1;r>=0;r--)S(e,t[r],n);e.lengths.push(t.length)}function S(e,t,n){const[r,o,s]=t;e.coords.push(r,o),n.hasZ&&e.coords.push(s||0)}function F(e){switch(typeof e){case"string":return(0,r.Br)(e)?"esriFieldTypeDate":"esriFieldTypeString";case"number":return"esriFieldTypeDouble";default:return"unknown"}}function A(e,t=4326){if(!e)throw new o.A("geojson-layer:empty","GeoJSON data is empty");if("Feature"!==e.type&&"FeatureCollection"!==e.type)throw new o.A("geojson-layer:unsupported-geojson-object","missing or not supported GeoJSON object type",{data:e});const{crs:n}=e;if(!n)return;const r="string"==typeof n?n:"name"===n.type?n.properties.name:"EPSG"===n.type?n.properties.code:null,i=(0,s.oT)({wkid:t})?new RegExp(".*(CRS84H?|4326)$","i"):new RegExp(`.*(${t})$`,"i");if(!r||!i.test(r))throw new o.A("geojson:unsupported-crs","unsupported GeoJSON 'crs' member",{crs:n})}function x(e,t={}){const n=[],r=new Set,o=new Set;let s,i=!1,a=null,c=!1,{geometryType:y=null}=t;for(const t of p(e)){const{geometry:e,properties:p,id:m}=t;if((!e||(y||(y=l(e.type)),l(e.type)===y))&&(i||(i=d(f(e))),c||(c=null!=m,c&&(s=typeof m,p&&(a=Object.keys(p).filter((e=>p[e]===m))))),p&&a&&c&&null!=m&&(a.length>1?a=a.filter((e=>p[e]===m)):1===a.length&&(a=p[a[0]]===m?a:[])),p))for(const e in p){if(r.has(e))continue;const t=F(p[e]);if("unknown"===t){o.add(e);continue}o.delete(e),r.add(e);const s=(0,u.rS)(e);s&&n.push({name:s,alias:e,type:t})}}const m=(0,u.rS)(1===a?.length&&a[0]||null)??void 0;if(m)for(const e of n)if(e.name===m&&(0,u.WA)(e)){e.type="esriFieldTypeOID";break}return{fields:n,geometryType:y,hasZ:i,objectIdFieldName:m,objectIdFieldType:s,unknownFields:Array.from(o)}}function P(e,t){return Array.from(function*(e,t={}){const{geometryType:n,objectIdField:r}=t;for(const o of e){const{geometry:e,properties:s,id:u}=o;if(e&&l(e.type)!==n)continue;const c=s||{};let p;r&&(p=c[r],null==u||p||(c[r]=p=u));const f=new i.Om(e?g(new a.A,e,t):null,c,null,p??void 0);yield f}}(p(e),t))}},34322:(e,t,n)=>{n.d(t,{E:()=>Y,Fu:()=>R,O8:()=>O,UH:()=>_,YW:()=>D,i5:()=>b,mG:()=>v,x$:()=>V}),n(59456);var r=n(78888),o=n(49186),s=n(5479),i=n(84952),a=n(57251),u=n(21325),c=n(50498),l=n(85113),p=n(13043),f=n(60694),d=n(20437),y=n(30524),m=n(5443),g=n(16930);const h="xlink:href",w="2.0.0",b="__esri_wfs_id__",T="wfs-layer:getWFSLayerTypeInfo-error",S="wfs-layer:empty-service",F="wfs-layer:feature-type-not-found",A="wfs-layer:geojson-not-supported",x="wfs-layer:kvp-encoding-not-supported",P="wfs-layer:malformed-json",C="wfs-layer:unknown-geometry-type",k="wfs-layer:unknown-field-type",N="wfs-layer:unsupported-spatial-reference",E="wfs-layer:unsupported-wfs-version";async function R(e,t){const n=function(e){const t=W(e);(function(e){const t=e.firstElementChild?.getAttribute("version");if(t&&t!==w)throw new o.A(E,`Unsupported WFS version ${t}. Supported version: ${w}`)})(t),J(t);const n=t.firstElementChild,r=(0,s.PP)(function(e){return(0,p.i)(e,{FeatureTypeList:{FeatureType:e=>{const t={typeName:"undefined:undefined",name:"",title:"",description:"",extent:null,namespacePrefix:"",namespaceUri:"",defaultSpatialReference:4326,supportedSpatialReferences:[]},n=new Set;return(0,p.p)(e,{Name:e=>{const{name:n,prefix:r}=z(e.textContent);t.typeName=`${r}:${n}`,t.name=n,t.namespacePrefix=r,t.namespaceUri=e.lookupNamespaceURI(r)},Abstract:e=>{t.description=e.textContent},Title:e=>{t.title=e.textContent},WGS84BoundingBox:e=>{t.extent=m.A.fromJSON(function(e){let t,n,r,o;for(const s of e.children)switch(s.localName){case"LowerCorner":[t,n]=s.textContent.split(" ").map((e=>Number.parseFloat(e)));break;case"UpperCorner":[r,o]=s.textContent.split(" ").map((e=>Number.parseFloat(e)))}return{xmin:t,ymin:n,xmax:r,ymax:o,spatialReference:u.KK}}(e))},DefaultCRS:e=>{const r=M(e);r&&(t.defaultSpatialReference=r,n.add(r))},OtherCRS:e=>{const t=M(e);t&&n.add(t)}}),t.title||(t.title=t.name),n.add(4326),t.supportedSpatialReferences.push(...n),t}}})}(n));return{operations:j(n),get featureTypes(){return Array.from(r())},readFeatureTypes:r}}((await(0,r.A)(e,{responseType:"text",query:{SERVICE:"WFS",REQUEST:"GetCapabilities",VERSION:w,...t?.customParameters},signal:t?.signal})).data);return function(e,t){(0,i.m3)(e)&&((0,i.FX)(e,t.operations.DescribeFeatureType.url,!0)&&(t.operations.DescribeFeatureType.url=(0,i.lM)(t.operations.DescribeFeatureType.url)),(0,i.FX)(e,t.operations.GetFeature.url,!0)&&(t.operations.GetFeature.url=(0,i.lM)(t.operations.GetFeature.url)))}(e,n),n}const G=["json","application/json","geojson","application/json; subtype=geojson","application/geo+json"];function I(e){for(const t of G){const n=e.findIndex((e=>e.toLowerCase()===t));if(n>=0)return e[n]}return null}function j(e){let t=!1;const n={GetCapabilities:{url:""},DescribeFeatureType:{url:""},GetFeature:{url:"",outputFormat:null,supportsPagination:!1}},r=[],s=[];if((0,p.p)(e,{OperationsMetadata:{Parameter:e=>{if("outputFormat"===e.getAttribute("name"))return{AllowedValues:{Value:({textContent:e})=>{e&&r.push(e)}}}},Operation:e=>{switch(e.getAttribute("name")){case"GetCapabilities":return{DCP:{HTTP:{Get:e=>{n.GetCapabilities.url=e.getAttribute(h)}}}};case"DescribeFeatureType":return{DCP:{HTTP:{Get:e=>{n.DescribeFeatureType.url=e.getAttribute(h)}}}};case"GetFeature":return{DCP:{HTTP:{Get:e=>{n.GetFeature.url=e.getAttribute(h)}}},Parameter:e=>{if("outputFormat"===e.getAttribute("name"))return{AllowedValues:{Value:({textContent:e})=>{e&&s.push(e)}}}}}}},Constraint:e=>{switch(e.getAttribute("name")){case"KVPEncoding":return{DefaultValue:e=>{t="true"===e.textContent.toLowerCase()}};case"ImplementsResultPaging":return{DefaultValue:e=>{n.GetFeature.supportsPagination="true"===e.textContent.toLowerCase()}}}}}}),n.GetFeature.outputFormat=I(s)??I(r),!t)throw new o.A(x,"WFS service doesn't support key/value pair (KVP) encoding");if(null==n.GetFeature.outputFormat)throw new o.A(A,"WFS service doesn't support GeoJSON output format");return n}function M(e){const t=parseInt(e.textContent?.match(/(?<wkid>\d+$)/i)?.groups?.wkid??"",10);if(!Number.isNaN(t))return t}function v(e,t,n){return(0,s.I6)(e,(e=>n?e.name===t&&e.namespaceUri===n:e.typeName===t||e.name===t))}async function O(e,t,n,r={}){const{featureType:s,extent:i}=await async function(e,t,n,r={}){const s=e.readFeatureTypes(),i=t?v(s,t,n):s.next().value,{spatialReference:c=new g.A({wkid:i?.defaultSpatialReference})}=r;if(null==i)throw t?new o.A(F,`The type '${t}' could not be found in the service`):new o.A(S,"The service is empty");let l=i.extent;if(l&&!(0,u.aI)(l.spatialReference,c))try{await(0,a.initializeProjection)(l.spatialReference,c,void 0,r),l=(0,a.project)(l,c)}catch{throw new o.A(N,"Projection not supported")}return{extent:l,spatialReference:c,featureType:i}}(e,t,n,r),{spatialReference:c}=_(e.operations.GetFeature.url,s,r.spatialReference),{fields:l,geometryType:p,swapXY:f,objectIdField:d,geometryField:y}=await async function(e,t,n,r={}){const{typeName:s}=t,[i,a]=await Promise.allSettled([L(e.operations.DescribeFeatureType.url,s,r),U(e,s,n,r)]),u=e=>new o.A(T,`An error occurred while getting info about the feature type '${s}'`,{error:e});if("rejected"===i.status)throw u(i.reason);if("rejected"===a.status)throw u(a.reason);const{fields:c,errors:l}=i.value??{},p=i.value?.geometryType||a.value?.geometryType,f=a.value?.swapXY??!1;if(null==p)throw new o.A(C,`The geometry type could not be determined for type '${s}`,{typeName:s,geometryType:p,fields:c,errors:l});return{...D(c??[]),geometryType:p,swapXY:f}}(e,s,c,r);return{url:e.operations.GetCapabilities.url,name:s.name,namespaceUri:s.namespaceUri,fields:l,geometryField:y,geometryType:p,objectIdField:d,spatialReference:r.spatialReference??new g.A({wkid:s.defaultSpatialReference}),extent:i,swapXY:f,wfsCapabilities:e,customParameters:r.customParameters}}function D(e){const t=e.find((e=>"geometry"===e.type));let n=e.find((e=>"oid"===e.type));return e=e.filter((e=>"geometry"!==e.type)),n||(n=new d.A({name:b,type:"oid",alias:b}),e.unshift(n)),{geometryField:t?.name??null,objectIdField:n.name,fields:e}}async function U(e,t,n,o={}){let s,i=!1;const[a,u]=await Promise.all([V(e.operations.GetFeature.url,t,n,e.operations.GetFeature.outputFormat,{...o,count:1}),(0,r.A)(e.operations.GetFeature.url,{responseType:"text",query:X(t,n,void 0,{...o,count:1}),signal:o?.signal})]),p="FeatureCollection"===a.type&&a.features[0]?.geometry;if(p){let e;switch(s=c.g.fromJSON((0,l.xD)(p.type)),p.type){case"Point":e=p.coordinates;break;case"LineString":case"MultiPoint":e=p.coordinates[0];break;case"MultiLineString":case"Polygon":e=p.coordinates[0][0];break;case"MultiPolygon":e=p.coordinates[0][0][0]}const t=/<[^>]*pos[^>]*> *(-?\d+(?:\.\d+)?) (-?\d+(?:\.\d+)?)/.exec(u.data);if(t){const n=e[0].toFixed(3),r=e[1].toFixed(3),o=parseFloat(t[1]).toFixed(3);n===parseFloat(t[2]).toFixed(3)&&r===o&&(i=!0)}}return{geometryType:s,swapXY:i}}async function L(e,t,n){return function(e,t){const{name:n}=z(e),r=W(t);J(r);const i=(0,s.I6)((0,p.i)(r.firstElementChild,{element:e=>e}),(e=>e.getAttribute("name")===n));if(null!=i){const e=i.getAttribute("type"),t=e?(0,s.I6)((0,p.i)(r.firstElementChild,{complexType:e=>e}),(t=>t.getAttribute("name")===z(e).name)):(0,s.I6)((0,p.i)(i,{complexType:e=>e}),(()=>!0));if(t)return function(e){const t=[],n=[];let r;const s=(0,p.i)(e,{complexContent:{extension:{sequence:{element:e=>e}}}});for(const i of s){const s=i.getAttribute("name");if(!s)continue;let a,u;if(i.hasAttribute("type")?a=z(i.getAttribute("type")).name:(0,p.p)(i,{simpleType:{restriction:e=>(a=z(e.getAttribute("base")).name,{maxLength:e=>{u=+e.getAttribute("value")}})}}),!a)continue;const c="true"===i.getAttribute("nillable");let l=!1;switch(a.toLowerCase()){case"integer":case"nonpositiveinteger":case"negativeinteger":case"long":case"int":case"short":case"byte":case"nonnegativeinteger":case"unsignedlong":case"unsignedint":case"unsignedshort":case"unsignedbyte":case"positiveinteger":n.push(new d.A({name:s,alias:s,type:"integer",nullable:c,length:(0,y._b)("integer")}));break;case"float":case"double":case"decimal":n.push(new d.A({name:s,alias:s,type:"double",nullable:c,length:(0,y._b)("double")}));break;case"boolean":case"string":case"gyearmonth":case"gyear":case"gmonthday":case"gday":case"gmonth":case"anyuri":case"qname":case"notation":case"normalizedstring":case"token":case"language":case"idrefs":case"entities":case"nmtoken":case"nmtokens":case"name":case"ncname":case"id":case"idref":case"entity":case"duration":case"time":n.push(new d.A({name:s,alias:s,type:"string",nullable:c,length:u??(0,y._b)("string")}));break;case"datetime":case"date":n.push(new d.A({name:s,alias:s,type:"date",nullable:c,length:u??(0,y._b)("date")}));break;case"pointpropertytype":r="point",l=!0;break;case"multipointpropertytype":r="multipoint",l=!0;break;case"curvepropertytype":case"multicurvepropertytype":case"multilinestringpropertytype":r="polyline",l=!0;break;case"surfacepropertytype":case"multisurfacepropertytype":case"multipolygonpropertytype":r="polygon",l=!0;break;case"geometrypropertytype":case"multigeometrypropertytype":l=!0,t.push(new o.A(C,`geometry type '${a}' is not supported`,{type:(new XMLSerializer).serializeToString(e)}));break;default:t.push(new o.A(k,`Unknown field type '${a}'`,{type:(new XMLSerializer).serializeToString(e)}))}l&&n.push(new d.A({name:s,alias:s,type:"geometry",nullable:c}))}for(const e of n)if("integer"===e.type&&!e.nullable&&$.has(e.name.toLowerCase())){e.type="oid";break}return{geometryType:r,fields:n,errors:t}}(t)}throw new o.A(F,`Type '${e}' not found in document`,{document:(new XMLSerializer).serializeToString(r)})}(t,(await(0,r.A)(e,{responseType:"text",query:{SERVICE:"WFS",REQUEST:"DescribeFeatureType",VERSION:w,TYPENAME:t,TYPENAMES:t,...n?.customParameters},signal:n?.signal})).data)}const $=new Set(["objectid","fid"]);async function V(e,t,n,s,i){let{data:a}=await(0,r.A)(e,{responseType:"text",query:X(t,n,s,i),signal:i?.signal});a=a.replaceAll(/": +(-?\d+),(\d+)(,)?/g,'": $1.$2$3');try{return JSON.parse(a)}catch(e){throw new o.A(P,"Error while parsing the response",{response:a,error:e})}}function X(e,t,n,r){const o="number"==typeof t?t:t.wkid;return{SERVICE:"WFS",REQUEST:"GetFeature",VERSION:w,TYPENAMES:e,OUTPUTFORMAT:n,SRSNAME:"EPSG:"+o,STARTINDEX:r?.startIndex,COUNT:r?.count,...r?.customParameters}}async function Y(e,t,n){const o=await(0,r.A)(e,{responseType:"text",query:{SERVICE:"WFS",REQUEST:"GetFeature",VERSION:w,TYPENAMES:t,RESULTTYPE:"hits",...n?.customParameters},signal:n?.signal}),s=/numberMatched=["'](?<numberMatched>\d+)["']/gi.exec(o.data);if(s?.groups)return+s.groups.numberMatched}function W(e){return(new DOMParser).parseFromString(e.trim(),"text/xml")}function z(e){const[t,n]=e.split(":");return{prefix:n?t:"",name:n??t}}function J(e){let t="",n="";if((0,p.p)(e.firstElementChild,{Exception:e=>(t=e.getAttribute("exceptionCode"),{ExceptionText:e=>{n=e.textContent}})}),t)throw new o.A(`wfs-layer:${t}`,n)}function _(e,t,n){const r={wkid:t.defaultSpatialReference},o=null!=n?.wkid?{wkid:n.wkid}:r;return{spatialReference:o,getFeatureSpatialReference:(0,f.Fi)(e)||o.wkid&&t.supportedSpatialReferences.includes(o.wkid)?{wkid:o.wkid}:{wkid:t.defaultSpatialReference}}}},13043:(e,t,n)=>{function r(e,t){if(e&&t)for(const n of e.children)if(n.localName in t){const e=t[n.localName];if("function"==typeof e){const t=e(n);t&&r(n,t)}else r(n,e)}}function*o(e,t){for(const n of e.children)if(n.localName in t){const e=t[n.localName];"function"==typeof e?yield e(n):yield*o(n,e)}}n.d(t,{i:()=>o,p:()=>r})}}]);