@arcgis/core 4.34.0-next.92 → 4.34.0-next.94

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 (348) hide show
  1. package/Color.js +1 -1
  2. package/Ground.js +1 -1
  3. package/WebScene.js +1 -1
  4. package/analysis/ElevationProfile/ElevationProfileDisplayUnits.d.ts +4 -0
  5. package/analysis/ElevationProfile/{ElevationProfileUnits.js → ElevationProfileDisplayUnits.js} +1 -1
  6. package/analysis/ElevationProfile/ElevationProfileUnits.d.ts +1 -1
  7. package/analysis/ElevationProfile/ElevationProfileViewOptions.js +1 -1
  8. package/analysis/ElevationProfileAnalysis.js +1 -1
  9. package/assets/esri/core/workers/RemoteClient.js +1 -1
  10. package/assets/esri/core/workers/chunks/004b13c1db79c9e668b1.js +1 -0
  11. package/assets/esri/core/workers/chunks/{700b5a536f97233bc4af.js → 03b455e9405a8b6fec68.js} +1 -1
  12. package/assets/esri/core/workers/chunks/{a244afea77127e54dd3a.js → 08b0fc6bfe9640ee2525.js} +1 -1
  13. package/assets/esri/core/workers/chunks/0a981061df08da19372c.js +1 -0
  14. package/assets/esri/core/workers/chunks/{db5a985ccc6b7d0ad855.js → 176f56de787bf486be9f.js} +1 -1
  15. package/assets/esri/core/workers/chunks/1fc7df018c8f802565a6.js +1 -0
  16. package/assets/esri/core/workers/chunks/20003728a679479b14dc.js +1 -0
  17. package/assets/esri/core/workers/chunks/20f4c6d8b310ecab97be.js +1 -0
  18. package/assets/esri/core/workers/chunks/25639559336109ff3df1.js +1 -0
  19. package/assets/esri/core/workers/chunks/26081b6486c623735657.js +1 -0
  20. package/assets/esri/core/workers/chunks/2698f656405876f4bd20.js +1 -0
  21. package/assets/esri/core/workers/chunks/{4660798b3b45dcb5cecb.js → 2b9c9a35a6e1f56920b5.js} +2 -2
  22. package/assets/esri/core/workers/chunks/352511dbc67166face40.js +1 -0
  23. package/assets/esri/core/workers/chunks/3acd79a6a0572926a799.js +1 -0
  24. package/assets/esri/core/workers/chunks/3d7923d25734d03a4d27.js +1 -0
  25. package/assets/esri/core/workers/chunks/48133effac2eacc2196e.js +1 -0
  26. package/assets/esri/core/workers/chunks/4dfcd03082be83600f3a.js +1 -0
  27. package/assets/esri/core/workers/chunks/503c81dda242e6077317.js +1 -0
  28. package/assets/esri/core/workers/chunks/{06aed0a5464965be8d52.js → 56b3bb68b61b77138186.js} +1 -1
  29. package/assets/esri/core/workers/chunks/5746c4861af83c1d57a8.js +1 -0
  30. package/assets/esri/core/workers/chunks/5aacd1c6b171c99b41f5.js +1 -0
  31. package/assets/esri/core/workers/chunks/6810ecdeccf4b7eae5e2.js +1 -0
  32. package/assets/esri/core/workers/chunks/6b208f5d423da64c8559.js +1 -0
  33. package/assets/esri/core/workers/chunks/{7a240ab31d9ff2d2c5af.js → 73db6c070b049fe05147.js} +1 -1
  34. package/assets/esri/core/workers/chunks/801451fb572bc5f1f270.js +1 -0
  35. package/assets/esri/core/workers/chunks/82e0d22619dc26920ca9.js +1 -0
  36. package/assets/esri/core/workers/chunks/8f426cb210a4250517d5.js +1 -0
  37. package/assets/esri/core/workers/chunks/94ddf029698991d853b9.js +1 -0
  38. package/assets/esri/core/workers/chunks/97eb2cfc1f036feea9a9.js +1 -0
  39. package/assets/esri/core/workers/chunks/98381404f2d99a1f9341.js +1 -0
  40. package/assets/esri/core/workers/chunks/9adecee0ed2f1df3b0d2.js +1 -0
  41. package/assets/esri/core/workers/chunks/a0fab8cd791c33d3895d.js +1 -0
  42. package/assets/esri/core/workers/chunks/{a85acb948cc7d22be592.js → a410dcf80d17a2383337.js} +1 -1
  43. package/assets/esri/core/workers/chunks/{d9d86cf0500fa29d1d43.js → a98b284b147258629947.js} +1 -1
  44. package/assets/esri/core/workers/chunks/b1ccbc2fef7f7e5e04f7.js +1 -0
  45. package/assets/esri/core/workers/chunks/b5c829e904bc9cb5347d.js +1 -0
  46. package/assets/esri/core/workers/chunks/bec9ddd38c9ab9f2561b.js +1 -0
  47. package/assets/esri/core/workers/chunks/bf9031749d10e7d457b6.js +1 -0
  48. package/assets/esri/core/workers/chunks/bf9d09493fd849ea69fd.js +1 -0
  49. package/assets/esri/core/workers/chunks/c4641c2c130c7b8bcdee.js +1 -0
  50. package/assets/esri/core/workers/chunks/{58e2652810143f509fe1.js → c473b15d4d52f0a63d20.js} +1 -1
  51. package/assets/esri/core/workers/chunks/c8e4fe0e3b109eb80e8e.js +1 -0
  52. package/assets/esri/core/workers/chunks/c9159ebf930af3f336f3.js +1 -0
  53. package/assets/esri/core/workers/chunks/cd0c222a36caa7f80860.js +1 -0
  54. package/assets/esri/core/workers/chunks/ce2fcaa21d6efcdf4da5.js +1 -0
  55. package/assets/esri/core/workers/chunks/d2df6e685d6cffc5f486.js +1 -0
  56. package/assets/esri/core/workers/chunks/{c27783ce7ea51a5e49c5.js → e153b61560a7a869db63.js} +1 -1
  57. package/assets/esri/core/workers/chunks/e2c293331515f3bd0355.js +1 -0
  58. package/assets/esri/core/workers/chunks/{100a0041ee42b0b2fa32.js → e5d974593043d5e2b502.js} +1 -1
  59. package/assets/esri/core/workers/chunks/ec7b156425f25d231078.js +1 -0
  60. package/assets/esri/core/workers/chunks/{1194c2432c31def87db1.js → f71b76c9506178124fa3.js} +1 -1
  61. package/assets/esri/core/workers/chunks/fb456e7425e09df17d8c.js +1 -0
  62. package/assets/esri/core/workers/chunks/{f6806780ca2aa591475a.js → fe1dcf9f81da4adbb1fe.js} +1 -1
  63. package/assets/esri/libs/parquet/pkg/bundle_bg.wasm +0 -0
  64. package/assets/esri/themes/base/_core.scss +0 -2
  65. package/assets/esri/themes/base/widgets/_OrientedImageryViewerNavigationUI.scss +10 -7
  66. package/assets/esri/themes/dark/main.css +1 -1
  67. package/assets/esri/themes/light/main.css +1 -1
  68. package/assets/esri/themes/light/view.css +1 -1
  69. package/chunks/CutFillComposition.glsl.js +15 -3
  70. package/chunks/CutFillMask.glsl.js +1 -1
  71. package/chunks/WaterSurface.glsl.js +0 -1
  72. package/chunks/bundle.js +1 -1
  73. package/chunks/languageUtils.js +1 -1
  74. package/colorUtils.js +1 -1
  75. package/config.js +1 -1
  76. package/core/CollectionFlattener.js +1 -1
  77. package/editing/sharedTemplates/executor/support/createPresetServiceEdit.js +1 -1
  78. package/geometry/operators/json/graphicBufferOperator.js +1 -1
  79. package/geometry/support/aaBoundingRect.js +1 -1
  80. package/geometry/support/geometryUtils.js +1 -1
  81. package/geometry/support/meshUtils/elevationSampler.js +1 -1
  82. package/geometry/support/meshUtils.js +1 -1
  83. package/geometry/support/triangle.js +1 -1
  84. package/interfaces.d.ts +262 -339
  85. package/kernel.js +1 -1
  86. package/layers/BaseElevationLayer.js +1 -1
  87. package/layers/BaseTileLayer.js +1 -1
  88. package/layers/ElevationLayer.js +1 -1
  89. package/layers/FeatureLayer.js +1 -1
  90. package/layers/GaussianSplatLayer.js +1 -1
  91. package/layers/ImageryTileLayer.js +1 -1
  92. package/layers/ParquetLayer.js +1 -1
  93. package/layers/graphics/controllers/I3SOnDemandController.js +1 -1
  94. package/layers/graphics/dehydratedFeatureComparison.js +1 -1
  95. package/layers/graphics/sources/ParquetSource.js +1 -1
  96. package/layers/graphics/sources/support/ParquetSourceWorker.js +1 -1
  97. package/layers/orientedImagery/transformations/imageToWorld.js +1 -1
  98. package/layers/orientedImagery/transformations/updateElevationUtils.js +1 -1
  99. package/layers/support/ElevationQuery.js +1 -1
  100. package/layers/support/ElevationQueryContext.js +5 -0
  101. package/layers/support/ElevationSampler.js +1 -1
  102. package/layers/support/ElevationTile.js +1 -1
  103. package/layers/support/GeometryDescriptor.js +1 -1
  104. package/layers/support/ParquetEncodingLocation.js +1 -1
  105. package/layers/support/ParquetEncodingWkb.js +1 -1
  106. package/layers/support/RasterBandInfo.js +1 -1
  107. package/layers/support/TileElevationSampler.js +5 -0
  108. package/layers/support/TileInfo.js +1 -1
  109. package/layers/support/TileKey.js +1 -1
  110. package/layers/support/TilemapCache.js +1 -1
  111. package/layers/support/layerUtils.js +1 -1
  112. package/layers/support/parquetEncodingUtils.js +5 -0
  113. package/layers/support/parquetUtils.js +1 -1
  114. package/layers/support/rasterDatasets/InMemoryRaster.js +1 -1
  115. package/networks/UtilityNetwork.js +1 -1
  116. package/networks/support/NetworkSystemLayers.js +1 -1
  117. package/networks/support/typeUtils.js +1 -1
  118. package/package.json +3 -2
  119. package/popup/FieldInfo.js +1 -1
  120. package/popup/content/AttachmentsContent.js +1 -1
  121. package/portal/schemas/definitions.js +1 -1
  122. package/rest/knowledgeGraphService.js +1 -1
  123. package/rest/networks/support/Association.js +1 -1
  124. package/rest/print.js +1 -1
  125. package/support/revision.js +1 -1
  126. package/symbols/cim/CIMSymbolHelper.js +1 -1
  127. package/symbols/cim/cimAnalyzer.js +1 -1
  128. package/symbols/cim/effects/EffectOffset.js +1 -1
  129. package/views/2d/analysis/ElevationProfile/ElevationProfileInputVisualization2D.js +1 -1
  130. package/views/2d/analysis/ElevationProfile/ElevationProfileLineVisualization2D.js +1 -1
  131. package/views/2d/analysis/ElevationProfileAnalysisView2D.js +1 -1
  132. package/views/2d/engine/Stage.js +1 -1
  133. package/views/2d/engine/flow/BrushFlow.js +1 -1
  134. package/views/2d/engine/vectorTiles/VectorTileRendererHelper3D.js +1 -1
  135. package/views/2d/engine/webgl/Overlay.js +1 -1
  136. package/views/2d/engine/webgl/OverlayMultipoint.js +1 -1
  137. package/views/2d/engine/webgl/SpriteMosaic.js +1 -1
  138. package/views/2d/engine/webgl/TextureManager.js +1 -1
  139. package/views/2d/engine/webgl/animatedFormats/AnimatableTextureResource.js +1 -1
  140. package/views/2d/engine/webgl/animatedFormats/utils.js +1 -1
  141. package/views/2d/engine/webgl/shaderGraph/techniques/animated/AnimatedMarkerMeshWriter.js +1 -1
  142. package/views/2d/engine/webgl/shaderGraph/techniques/animated/AnimatedTechnique.js +1 -1
  143. package/views/2d/engine/webgl/shaderGraph/techniques/fill/ComplexFillTechnique.js +1 -1
  144. package/views/2d/engine/webgl/shaderGraph/techniques/fill/ComplexOutlineFillTechnique.js +1 -1
  145. package/views/2d/engine/webgl/shaderGraph/techniques/fill/GradientFillTechnique.js +1 -1
  146. package/views/2d/engine/webgl/shaderGraph/techniques/fill/PatternFillTechnique.js +1 -1
  147. package/views/2d/engine/webgl/shaderGraph/techniques/fill/PatternOutlineFillTechnique.js +1 -1
  148. package/views/2d/engine/webgl/shaderGraph/techniques/labels/LabelTechnique.js +1 -1
  149. package/views/2d/engine/webgl/shaderGraph/techniques/line/GradientStrokeTechnique.js +1 -1
  150. package/views/2d/engine/webgl/shaderGraph/techniques/line/TexturedLineTechnique.js +1 -1
  151. package/views/2d/engine/webgl/shaderGraph/techniques/markers/MarkerTechnique.js +1 -1
  152. package/views/2d/engine/webgl/shaderGraph/techniques/text/TextTechnique.js +1 -1
  153. package/views/2d/engine/webgl/shaderGraph/utils.js +1 -1
  154. package/views/2d/interactive/snapping/featureSources/featureServiceSource/FeatureServiceTiles2D.js +1 -1
  155. package/views/2d/layers/VideoLayerView2D.js +1 -1
  156. package/views/2d/layers/imagery/BaseImageryTileSubView2D.js +1 -1
  157. package/views/2d/layers/imagery/ImageryTileView2D.js +1 -1
  158. package/views/2d/navigation/actions/Pan.js +1 -1
  159. package/views/3d/analysis/ElevationProfile/ElevationProfileInputVisualization3D.js +1 -1
  160. package/views/3d/analysis/ElevationProfile/ElevationProfileLineSceneComputation.js +1 -1
  161. package/views/3d/analysis/ElevationProfile/ElevationProfileLineVisualization3D.js +1 -1
  162. package/views/3d/analysis/ElevationProfile/ElevationProfileVisualization3D.js +1 -1
  163. package/views/3d/analysis/ElevationProfileAnalysisView3D.js +1 -1
  164. package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementCutFillVisualization.js +1 -1
  165. package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementTool.js +1 -1
  166. package/views/3d/interactive/snapping/featureSources/featureServiceSource/FeatureServiceTiles3D.js +1 -1
  167. package/views/3d/layers/FlowSubView3D.js +1 -1
  168. package/views/3d/layers/graphics/Graphics3DMeshFillSymbolLayer.js +1 -1
  169. package/views/3d/layers/graphics/objectResourceUtils.js +1 -1
  170. package/views/3d/support/GaussianSplatSortWorker.js +1 -1
  171. package/views/3d/support/flow/FlowSubViewTiles3D.js +1 -1
  172. package/views/3d/support/gaussianSplatting/GaussianSplatDataStore.js +1 -1
  173. package/views/3d/support/hitTest.js +1 -1
  174. package/views/3d/support/pointsOfInterest/StableSurfaceCenter.js +1 -1
  175. package/views/3d/support/popupHitTest.js +1 -1
  176. package/views/3d/terrain/ExtentHelper.js +1 -1
  177. package/views/3d/webgl-engine/core/shaderTechnique/ShaderTechnique.js +1 -1
  178. package/views/3d/webgl-engine/effects/blit/Blit.js +1 -1
  179. package/views/3d/webgl-engine/effects/transparency/OITBlendTechnique.js +1 -1
  180. package/views/3d/webgl-engine/lib/CompositingHelper.js +1 -1
  181. package/views/3d/webgl-engine/lib/CutFillColor.js +1 -1
  182. package/views/3d/webgl-engine/shaders/CutFillComposition.glsl.js +1 -1
  183. package/views/3d/webgl-engine/shaders/GaussianSplatDepthCompositionTechnique.js +1 -1
  184. package/views/PopupView.js +1 -1
  185. package/views/SceneView.js +1 -1
  186. package/views/View.js +1 -1
  187. package/views/View2D.js +1 -1
  188. package/views/Viewport2DMixin.js +1 -1
  189. package/views/analysis/ElevationProfile/ElevationProfileChart.js +1 -1
  190. package/views/analysis/ElevationProfile/ElevationProfileController.js +1 -1
  191. package/views/analysis/ElevationProfile/ElevationProfileHoveredPointsVisualization.js +1 -1
  192. package/views/analysis/ElevationProfile/ElevationProfileLineComputation.js +1 -1
  193. package/views/analysis/ElevationProfile/ElevationProfileLineInputComputation.js +1 -1
  194. package/views/analysis/ElevationProfile/ElevationProfileLineQueryComputation.js +1 -1
  195. package/views/analysis/ElevationProfile/ElevationProfileResult.js +1 -1
  196. package/views/analysis/ElevationProfile/ElevationProfileTool.js +1 -1
  197. package/views/analysis/ElevationProfile/elevationProfileGeometryUtils.js +1 -1
  198. package/views/analysis/ElevationProfile/elevationProfileInputVisualizationUtils.js +1 -1
  199. package/views/analysis/ExclusiveOperationManager.js +5 -0
  200. package/views/interactive/snapping/LineSnapper.js +1 -1
  201. package/views/interactive/snapping/ParallelLineSnapper.js +1 -1
  202. package/views/interactive/snapping/RightAngleSnapper.js +1 -1
  203. package/views/interactive/snapping/RightAngleTriangleSnapper.js +1 -1
  204. package/views/interactive/snapping/featureSources/FeatureServiceSnappingSource.js +1 -1
  205. package/views/interactive/snapping/featureSources/WorkerTileTreeDebugger.js +1 -1
  206. package/views/interactive/snapping/featureSources/featureServiceSource/FeatureServiceSnappingSourceWorker.js +1 -1
  207. package/views/interactive/snapping/featureSources/featureServiceSource/FeatureServiceSnappingSourceWorkerHandle.js +1 -1
  208. package/views/interactive/snapping/featureSources/featureServiceSource/FeatureServiceTileStore.js +1 -1
  209. package/views/interactive/snapping/featureSources/featureServiceSource/FeatureServiceTiledFetcher.js +1 -1
  210. package/views/interactive/snapping/featureSources/featureServiceSource/FeatureServiceTilesSimple.js +1 -1
  211. package/views/interactive/snapping/featureSources/featureServiceSource/PendingFeatureTile.js +1 -1
  212. package/views/interactive/snapping/featureSources/queryEngineUtils.js +1 -1
  213. package/views/interactive/snapping/snappingUtils.js +1 -1
  214. package/views/navigation/Navigation.js +1 -1
  215. package/views/popupAdapter.js +5 -0
  216. package/views/support/GroundViewElevationSampler.js +1 -1
  217. package/views/video/VideoOperationalDataView.js +1 -1
  218. package/views/webgl/ContextState.js +1 -1
  219. package/views/webgl/RenderingContext.js +1 -1
  220. package/views/webgl/enums.js +1 -1
  221. package/widgets/Attachments/AttachmentsViewModel.js +1 -1
  222. package/widgets/Attachments.js +1 -1
  223. package/widgets/BasemapGallery/support/basemapCompatibilityUtils.js +1 -1
  224. package/widgets/ElevationProfile/support/chartUtils.js +1 -1
  225. package/widgets/Feature/FeatureExpression.js +1 -1
  226. package/widgets/Feature/FeatureMedia/chartCommon.js +1 -1
  227. package/widgets/Feature/FeatureMedia/pieChart.js +1 -1
  228. package/widgets/Feature/FeatureMedia/xyChart.js +1 -1
  229. package/widgets/Feature/FeatureMedia.js +1 -1
  230. package/widgets/Feature/FeatureViewModel.js +1 -1
  231. package/widgets/Feature.js +1 -1
  232. package/widgets/FeatureTable/FeatureTableViewModel.js +1 -1
  233. package/widgets/FeatureTable/support/ColumnTemplateBase.js +1 -1
  234. package/widgets/FeatureTable/support/TableTemplate.js +1 -1
  235. package/widgets/FeatureTable.js +1 -1
  236. package/widgets/Features/FeaturesViewModel.js +1 -1
  237. package/widgets/Legend/LegendViewModel.js +1 -1
  238. package/widgets/Legend/support/ActiveLayerInfo.js +1 -1
  239. package/widgets/Legend.js +1 -1
  240. package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
  241. package/widgets/OrientedImageryViewer/components/ImageViewer.js +1 -1
  242. package/widgets/OrientedImageryViewer/components/NavigationUI360.js +1 -1
  243. package/widgets/OrientedImageryViewer/components/NavigationUIPanoramicViewModel.js +1 -1
  244. package/widgets/OrientedImageryViewer/services/DepthImageService.js +5 -0
  245. package/widgets/PanoramicViewer.js +1 -1
  246. package/widgets/Search/SearchResultRenderer.js +1 -1
  247. package/widgets/Search/SearchViewModel.js +1 -1
  248. package/widgets/Search.js +1 -1
  249. package/widgets/Sketch/SketchViewModel.js +1 -1
  250. package/widgets/support/chartUtilsAm5.js +1 -1
  251. package/assets/esri/core/workers/chunks/08374e5805fcedc1cb57.js +0 -1
  252. package/assets/esri/core/workers/chunks/0b24a6c06d1becbb6815.js +0 -1
  253. package/assets/esri/core/workers/chunks/14114be3afd6d292f89c.js +0 -1
  254. package/assets/esri/core/workers/chunks/19f1bfe815896d4983af.js +0 -1
  255. package/assets/esri/core/workers/chunks/22c3a21bc9f32c429c48.js +0 -1
  256. package/assets/esri/core/workers/chunks/2605062e44f2d4e73f14.js +0 -1
  257. package/assets/esri/core/workers/chunks/282c4f3484c605ce7d5e.js +0 -1
  258. package/assets/esri/core/workers/chunks/2e1cc11462846febb3b2.js +0 -1
  259. package/assets/esri/core/workers/chunks/37b5007660535f1c91c6.js +0 -1
  260. package/assets/esri/core/workers/chunks/393274af1804e5b6046a.js +0 -1
  261. package/assets/esri/core/workers/chunks/3b2ef975831eb75b40fb.js +0 -1
  262. package/assets/esri/core/workers/chunks/3ff3e1507220d3869c76.js +0 -1
  263. package/assets/esri/core/workers/chunks/4133ab8720e7e4afa9a6.js +0 -1
  264. package/assets/esri/core/workers/chunks/4d807bfe75108438db83.js +0 -1
  265. package/assets/esri/core/workers/chunks/5ad1985a9e66fb2232ae.js +0 -1
  266. package/assets/esri/core/workers/chunks/5b7a2ee44883b1fb2a5f.js +0 -1
  267. package/assets/esri/core/workers/chunks/614a00a3179f8fe23f45.js +0 -1
  268. package/assets/esri/core/workers/chunks/6aa349e1adf844df4b5b.js +0 -1
  269. package/assets/esri/core/workers/chunks/83065bef261314f9b2c5.js +0 -1
  270. package/assets/esri/core/workers/chunks/8bdbd94a59269e216fba.js +0 -1
  271. package/assets/esri/core/workers/chunks/8cae725e631d922853c8.js +0 -1
  272. package/assets/esri/core/workers/chunks/8f4cfef97716c3502b0f.js +0 -1
  273. package/assets/esri/core/workers/chunks/8ff2daef892881ff2019.js +0 -1
  274. package/assets/esri/core/workers/chunks/9bb6984f24cd5461a754.js +0 -1
  275. package/assets/esri/core/workers/chunks/9f2a3f37fe9b19ef1209.js +0 -1
  276. package/assets/esri/core/workers/chunks/a1196637268b89281780.js +0 -1
  277. package/assets/esri/core/workers/chunks/a6a2d4602dfeb62e0ecc.js +0 -1
  278. package/assets/esri/core/workers/chunks/b240298b8b643a323d34.js +0 -1
  279. package/assets/esri/core/workers/chunks/b47f26d6aa9a2848a677.js +0 -1
  280. package/assets/esri/core/workers/chunks/b661ea374fe38c8e29ca.js +0 -1
  281. package/assets/esri/core/workers/chunks/b8997ae5893afa0298d1.js +0 -1
  282. package/assets/esri/core/workers/chunks/baa48614d9567d5f240d.js +0 -1
  283. package/assets/esri/core/workers/chunks/c20862fe15295a294bbd.js +0 -1
  284. package/assets/esri/core/workers/chunks/c3020747f9001ca6a6e7.js +0 -1
  285. package/assets/esri/core/workers/chunks/c7c76a8a1c47eb62bef1.js +0 -1
  286. package/assets/esri/core/workers/chunks/c95e6bef8c97cf647869.js +0 -1
  287. package/assets/esri/core/workers/chunks/d71836cf70b9604832f1.js +0 -1
  288. package/assets/esri/core/workers/chunks/e99fc64b67bb0c71dc34.js +0 -1
  289. package/assets/esri/core/workers/chunks/eea9d49d55c2d1355497.js +0 -1
  290. package/assets/esri/core/workers/chunks/fb6ebb780bb59e252887.js +0 -1
  291. package/assets/esri/core/workers/chunks/ff6d189ba78980d40bb5.js +0 -1
  292. package/assets/esri/themes/base/widgets/_ButtonMenu.scss +0 -87
  293. package/chunks/Button.js +0 -5
  294. package/chunks/ColorSet.js +0 -5
  295. package/chunks/DefaultTheme.js +0 -5
  296. package/chunks/LineSeries.js +0 -5
  297. package/chunks/ResponsiveTheme.js +0 -5
  298. package/chunks/Theme.js +0 -5
  299. package/chunks/Tick.js +0 -5
  300. package/chunks/Tooltip.js +0 -5
  301. package/chunks/ar.js +0 -5
  302. package/chunks/bg_BG.js +0 -5
  303. package/chunks/bs_BA.js +0 -5
  304. package/chunks/ca_ES.js +0 -5
  305. package/chunks/chartUtilsAm5.js +0 -5
  306. package/chunks/cs_CZ.js +0 -5
  307. package/chunks/da_DK.js +0 -5
  308. package/chunks/de_CH.js +0 -5
  309. package/chunks/de_DE.js +0 -5
  310. package/chunks/el_GR.js +0 -5
  311. package/chunks/en_CA.js +0 -5
  312. package/chunks/en_US.js +0 -5
  313. package/chunks/es_ES.js +0 -5
  314. package/chunks/et_EE.js +0 -5
  315. package/chunks/fi_FI.js +0 -5
  316. package/chunks/fr_FR.js +0 -5
  317. package/chunks/he_IL.js +0 -5
  318. package/chunks/hr_HR.js +0 -5
  319. package/chunks/hu_HU.js +0 -5
  320. package/chunks/id_ID.js +0 -5
  321. package/chunks/it_IT.js +0 -5
  322. package/chunks/ja_JP.js +0 -5
  323. package/chunks/ko_KR.js +0 -5
  324. package/chunks/lt_LT.js +0 -5
  325. package/chunks/lv_LV.js +0 -5
  326. package/chunks/nb_NO.js +0 -5
  327. package/chunks/nl_NL.js +0 -5
  328. package/chunks/pl_PL.js +0 -5
  329. package/chunks/pt_BR.js +0 -5
  330. package/chunks/pt_PT.js +0 -5
  331. package/chunks/ro_RO.js +0 -5
  332. package/chunks/ru_RU.js +0 -5
  333. package/chunks/sk_SK.js +0 -5
  334. package/chunks/sl_SL.js +0 -5
  335. package/chunks/sr_RS.js +0 -5
  336. package/chunks/sv_SE.js +0 -5
  337. package/chunks/th_TH.js +0 -5
  338. package/chunks/tr_TR.js +0 -5
  339. package/chunks/uk_UA.js +0 -5
  340. package/chunks/vi_VN.js +0 -5
  341. package/chunks/zh_Hans.js +0 -5
  342. package/chunks/zh_Hant.js +0 -5
  343. package/widgets/FeatureTable/Grid/support/ButtonMenu.d.ts +0 -4
  344. package/widgets/FeatureTable/Grid/support/ButtonMenu.js +0 -5
  345. package/widgets/FeatureTable/Grid/support/ButtonMenuItem.d.ts +0 -4
  346. package/widgets/FeatureTable/Grid/support/ButtonMenuItem.js +0 -5
  347. package/widgets/FeatureTable/Grid/support/ButtonMenuViewModel.d.ts +0 -4
  348. package/widgets/FeatureTable/Grid/support/ButtonMenuViewModel.js +0 -5
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{__addDisposableResource as e,__disposeResources as t}from"tslib";import{toConst as r}from"../../../../core/compilerUtils.js";import s from"../../../../core/Error.js";import{assertIsSome as o}from"../../../../core/maybe.js";import{QueueProcessor as n}from"../../../../core/QueueProcessor.js";import a from"../../../../geometry/SpatialReference.js";import{set as i,create as u,expandWithRect as l,expandWithAABB as f,negativeInfinity as c,fromRect as d}from"../../../../geometry/support/aaBoundingBox.js";import{getQueryResultExtent as m,QueryEngine as h}from"../../data/QueryEngine.js";import{QueryEngineResult as y}from"../../data/QueryEngineResult.js";import p from"../../../support/FieldsIndex.js";import{collectSQLFieldNames as _}from"../../../support/fieldUtils.js";import{createParquetFile as g,readGeoMetadata as I}from"../../../../libs/parquet/parquet.js";import{FeatureStoreQueryAdapter as w}from"../../../../views/2d/layers/features/FeatureStoreQueryAdapter.js";import{FeatureSnapshotSourceChunk as x}from"../../../../views/2d/layers/features/sources/strategies/chunks/FeatureSnapshotSourceChunk.js";import{FeatureSourceChunkStore as R}from"../../../../views/2d/layers/features/sources/strategies/chunks/SourceChunkStore.js";import{FeatureMetadata as F}from"../../../../views/2d/layers/features/support/FeatureMetadata.js";import{FeatureSetReaderParquet as C}from"../../../../views/2d/layers/features/support/FeatureSetReaderParquet.js";const q=new w,j=8e3;class b{constructor(){this._fileInfos=new Map,this._queue=new n({concurrency:1,process:(e,t)=>this._executeQuery(e,t)})}async load(r){this.setCustomParameters(r.customParameters),this._geometryInfo=r.geometryInfo;for(const e of r.urls){const t=await g(e,{geometryInfo:r.geometryInfo,outSpatialReference:null,getCustomParameters:()=>this._customParameters});this._fileInfos.set(e,{index:this._fileInfos.size,file:t})}this._metadata=F.createFeature(r.metadata),this._queryEngineParams={fieldsIndex:this._metadata.fieldsIndex,geometryType:r.geometryInfo?.geometryType??"esriGeometryPoint",featureIdInfo:{type:"object-id",fieldName:"rowId"},hasM:!1,hasZ:!1,spatialReference:a.fromJSON(r.geometryInfo?.spatialReference),aggregateAdapter:null,timeInfo:null,definitionExpression:null};const s=this._fileInfos.values().next().value;if(!s)return{extent:null};const{fields:o,timeZoneByFieldName:n}=r.metadata.fieldsIndex,f=o.map(e=>({...e,column:s.file.columnForFieldName(e.name)})),d=p.fromJSON({fields:f,timeZoneByFieldName:n});if(this._fieldsIndex=d,r.metadata.spatialReference&&(this._fullExtent=E(this._fileInfos.values(),r.metadata.spatialReference)),null==this._fullExtent&&"location"===r.geometryInfo?.encoding.type){const{latitudeFieldName:s,longitudeFieldName:o}=r.geometryInfo.encoding,n=this._fieldsIndex.get(s)?.column,a=this._fieldsIndex.get(o)?.column,f=i(u(),c);for(const r of this._fileInfos.values())for(const s of r.file.rowGroups()){const r={stack:[],error:void 0,hasError:!1};try{const t=e(r,s.columnDescriptorForAttribute(n),!1),o=e(r,s.columnDescriptorForAttribute(a),!1),i=[o.minValue(),t.minValue(),o.maxValue(),t.maxValue()];l(f,i),s.free()}catch(m){r.error=m,r.hasError=!0}finally{t(r)}}this._fullExtent={xmin:f[0],ymin:f[1],xmax:f[3],ymax:f[4],spatialReference:r.metadata.spatialReference}}return{extent:this._fullExtent}}destroy(){for(const e of this._fileInfos.values())e.file.free();this._fileInfos.clear(),this._queue.destroy()}setCustomParameters(e){this._customParameters=e}async updateFiles(e){const t=new Set(e);for(const[r,s]of this._fileInfos.entries())t.has(r)?t.delete(r):(s.file.free(),this._fileInfos.delete(r));for(const r of t){const e=await g(r,{geometryInfo:this._geometryInfo,outSpatialReference:null,getCustomParameters:()=>this._customParameters});this._fileInfos.set(r,{index:this._fileInfos.size,file:e})}}async queryFeatures(e,t){if(this._validateQuery(e),e.objectIds?.length){return(await this._enqueueQuery(e,t)).createQueryResponse()}e.resultRecordCount=e.resultRecordCount?Math.min(e.resultRecordCount,8e3):8e3,e.resultOffset=e.resultOffset??0;return(await this._enqueueQuery(e,t)).createQueryResponse()}async queryFeatureCount(e,t){if(this._validateQuery(e),!Q(e))return this._getFeatureCount();e.resultRecordCount=e.resultRecordCount??this._getFeatureCount(),e.resultOffset=e.resultOffset??0,delete e.outFields,delete e.returnGeometry;return(await this._enqueueQuery(e,t)).createQueryResponseForCount()}async queryObjectIds(e,t){if(this._validateQuery(e),!Q(e))return Array.from({length:this._getFeatureCount()},(e,t)=>t);e.resultRecordCount=e.resultRecordCount?Math.min(e.resultRecordCount,8e3):8e3,e.resultOffset=e.resultOffset??0,delete e.returnGeometry,delete e.outFields;return(await this._enqueueQuery(e,t)).items.map(e=>e.getObjectId())}async queryExtent(e,t){if(this._validateQuery(e),this._fullExtent&&!Q(e))return{count:this._getFeatureCount(),extent:this._fullExtent};const s=r(this._metadata.spatialReference);e.resultOffset=e.resultOffset??0,e.resultRecordCount=e.resultRecordCount??this._getFeatureCount(),e.returnGeometry=!0,delete e.outFields;const o=i(u(),c),n=u(),a=await this._enqueueQuery(e,t);let l=0;for(const r of a.items)r.getBounds(n)&&(f(o,n),l+=1);return{count:l,extent:m(o,s,e.outSR?r(e.outSR):s,s,!1)}}_getFeatureCount(){return Array.from(this._fileInfos.values()).reduce((e,t)=>e+t.file.numRows(),0)}_validateQuery(e){if(e.outStatistics)throw new s("parquet:unsupported","Statistics queries are not supported",{query:e});if(e.orderByFields?.length)throw new s("parquet:unsupported","Queries using orderBy are not supported",{query:e})}async*_fetchChunks(e,t){for(const r of this._fileInfos.values()){const s=r.file.numRows(),o=Math.ceil(s/j);for(let n=0;n<o;n++){const s=n*j,o=await r.file.readChunk(s,j,e.fields,e.returnGeometry,t);for(const e of o){const t=new C(this._metadata,this._fieldsIndex,e,0,r.index),s=new x(t,null,0,!1),o=S(this._metadata,[s],this._queryEngineParams);yield o}}}}_enqueueQuery(e,t){return this._queue.push(e,t)}async _executeQuery(e,t){const r=await this._getReadParams(e);if(e.objectIds?.length)for(const o of this._fileInfos.values()){const s=[],n=(await o.file.readChunksByRowId(new Uint32Array(e.objectIds),r.fields,r.returnGeometry,t)).map((e,t)=>new C(this._metadata,this._fieldsIndex,e,t,o.index)).map((e,t)=>new x(e,null,t,!1)),a=S(this._metadata,n,this._queryEngineParams),i=await a.executeQueryForOpaqueFeatures(e,t);for(const e of i)s.push(e);return new y(s,e,{fieldsIndex:this._fieldsIndex,geometryType:this._metadata.geometryType,spatialReference:this._metadata.spatialReference,objectIdField:"rowId",hasM:!1,hasZ:!1,featureAdapter:q})}let s=e.resultRecordCount,n=e.resultOffset;o(s),o(n),delete e.resultRecordCount,delete e.resultOffset;const a=[];for await(const o of this._fetchChunks(r,t)){const r=await o.executeQueryForOpaqueFeatures(e,t);if(r.length>n){const t=r.slice(n,Math.min(n+s,r.length));for(const e of t)a.push(e);if(n=0,s-=t.length,0===s)return new y(a,e,{fieldsIndex:this._fieldsIndex,geometryType:this._metadata.geometryType,spatialReference:this._metadata.spatialReference,objectIdField:"rowId",hasM:!1,hasZ:!1,featureAdapter:q})}else n-=r.length}return new y(a,e,{fieldsIndex:this._fieldsIndex,geometryType:this._metadata.geometryType,spatialReference:this._metadata.spatialReference,objectIdField:"rowId",hasM:!1,hasZ:!1,featureAdapter:q})}async _getReadParams(e){const t=new Set;if(e.where&&await _(t,this._fieldsIndex,e.where),e.outStatistics)for(const r of e.outStatistics)null!=r.onStatisticField&&t.add(r.onStatisticField);if(e.outFields)for(const r of e.outFields)t.add(r);return{fields:this._getAttributeIds(Array.from(t)),returnGeometry:!!e.returnGeometry||!!e.geometry}}_getAttributeIds(e){if(null==e)return new Uint32Array;if(e.includes("*"))return new Uint32Array(this._fieldsIndex.fields.map(e=>e.column).filter(e=>null!=e));const t=[];for(const r of e){const e=this._fieldsIndex.get(r);if(null==e)throw new s("unknown-field",`Field ${r} does not exist`);null==e.column||t.push(e.column)}return new Uint32Array(t)}}function Q(e){return Object.keys(e).some(e=>v(e))}function v(e){switch(e){case"resultOffset":case"resultRecordCount":case"aggregateIds":case"distance":case"gdbVersion":case"geometry":case"having":case"timeExtent":case"where":case"objectIds":case"historicMoment":return!0;default:return!1}}function S(e,t,r){const s=new R(()=>e);for(const o of t)s.insert(o);return new h({...r,featureStore:s})}function O(e){switch(e.length){case 4:return d(u(),e);case 6:return e;default:throw new s("parquet:protocol-violation","Invalid Geoparquet file. BoundingBox size must be 4 or 6.",{bbox:e})}}function E(e,t){const r=i(u(),c);for(const s of e){const e=I(s.file);if(!e)return null;const t=e.columns[e.primary_column];if(!t.bbox)return null;const o=O(t.bbox);f(r,o)}return{xmin:r[0],ymin:r[1],xmax:r[3],ymax:r[4],spatialReference:t}}export{b as default};
5
+ import{__addDisposableResource as e,__disposeResources as t}from"tslib";import r from"../../../../core/Collection.js";import{toConst as s}from"../../../../core/compilerUtils.js";import o from"../../../../core/Error.js";import n from"../../../../core/Logger.js";import{assertIsSome as i}from"../../../../core/maybe.js";import{QueueProcessor as a}from"../../../../core/QueueProcessor.js";import u from"../../../../geometry/SpatialReference.js";import{set as l,create as f,expandWithRect as c,expandWithAABB as d,negativeInfinity as m,fromRect as p}from"../../../../geometry/support/aaBoundingBox.js";import{getQueryResultExtent as h,QueryEngine as y}from"../../data/QueryEngine.js";import{QueryEngineResult as g}from"../../data/QueryEngineResult.js";import{createDrawingInfo as _}from"./clientSideDefaults.js";import w from"../../../support/Field.js";import I from"../../../support/FieldsIndex.js";import{collectSQLFieldNames as R}from"../../../support/fieldUtils.js";import{fromParquetEncodingJSON as x}from"../../../support/parquetEncodingUtils.js";import{completeParquetLayerInfo as F,fromParquetJSONGeometryType as S,toParquetJSONGeometryType as j}from"../../../support/parquetUtils.js";import{createParquetFile as b,readGeoMetadata as q}from"../../../../libs/parquet/parquet.js";import{FeatureStoreQueryAdapter as C}from"../../../../views/2d/layers/features/FeatureStoreQueryAdapter.js";import{FeatureSnapshotSourceChunk as O}from"../../../../views/2d/layers/features/sources/strategies/chunks/FeatureSnapshotSourceChunk.js";import{FeatureSourceChunkStore as v}from"../../../../views/2d/layers/features/sources/strategies/chunks/SourceChunkStore.js";import{FeatureMetadata as Q}from"../../../../views/2d/layers/features/support/FeatureMetadata.js";import{FeatureSetReaderParquet as E}from"../../../../views/2d/layers/features/support/FeatureSetReaderParquet.js";const G=new C,T=8e3,P="__OBJECTID";class N{constructor(){this._fileInfos=new Map,this._queue=new a({concurrency:1,process:(e,t)=>this._executeQuery(e,t)})}async load(s){const i=s.spatialReference?u.fromJSON(s.spatialReference):void 0;if(i&&!i.isWGS84&&!i.isWebMercator)throw new o("parquet:unsupported-projection","Only WGS84 and Web Mercator are supported");const a=await F({urls:new r(s.urls),fields:s.fields?.map(e=>w.fromJSON(e)),encoding:s.encoding?x(s.encoding):s.encoding,geometryType:s.geometryType?S(s.geometryType):null,spatialReference:i},{customParameters:s.customParameters});let d;if(a.geometryType&&a.encoding){if(!a.spatialReference)throw new o("parquet:unsupported","SpatialReference must be defined");if(!a.spatialReference.isGeographic&&!a.spatialReference.isWebMercator)throw new o("parquet:unsupported-projection","Only WGS84 and Web Mercator are supported");a.spatialReference.isGeographic&&!a.spatialReference.isWGS84&&(n.getLogger("parquet:unsupported-projection").warn("Found a geographic projection that is not WGS84. Handling as WGS84.",{spatialReference:a.spatialReference}),a.spatialReference=u.WGS84),d={geometryType:j(a.geometryType),spatialReference:a.spatialReference.toJSON(),encoding:a.encoding.toJSON(),displayOptimization:a.displayOptimization}}this.setCustomParameters(s.customParameters),this._geometryInfo=d;for(const e of s.urls){const t=await b(e,{geometryInfo:d,outSpatialReference:null,getCustomParameters:()=>this._customParameters});this._fileInfos.set(e,{index:this._fileInfos.size,file:t})}const p=this._fileInfos.values().next().value?.file;if(!p)return{layerDefinition:{}};const{fields:h}=a;if(null==h)throw new o("parquet-layer:missing-metadata","Unable to create parquet source: cannot infer fields",h);h.push(new w({name:P,type:"oid",alias:P}));const y={fields:h.map(e=>({...e.toJSON(),column:p.columnForFieldName(e.name)})),timeZoneByFieldName:null},g=I.fromJSON(y);this._fieldsIndex=g;const R=j(a.geometryType??"point");if(this._metadata=Q.createFeature({fieldsIndex:y,geometryType:R,featureIdInfo:{type:"object-id",fieldName:"rowId"},subtypes:null,subtypeField:null,types:null,typeIdField:null,globalIdField:null,spatialReference:a.spatialReference,outSpatialReference:null,timeInfo:null,timeReferenceUnknownClient:null,dateFieldsTimeZone:null}),this._queryEngineParams={fieldsIndex:this._metadata.fieldsIndex,geometryType:d?.geometryType??"esriGeometryPoint",featureIdInfo:{type:"object-id",fieldName:"rowId"},hasM:!1,hasZ:!1,spatialReference:u.fromJSON(d?.spatialReference),aggregateAdapter:null,timeInfo:null,definitionExpression:null},a.spatialReference&&(this._fullExtent=W(this._fileInfos.values(),a.spatialReference.toJSON())),null==this._fullExtent&&"location"===a.encoding?.type){const{latitudeFieldName:r,longitudeFieldName:s}=a.encoding,o=this._fieldsIndex.get(r)?.column,n=this._fieldsIndex.get(s)?.column,i=l(f(),m);for(const a of this._fileInfos.values())for(const r of a.file.rowGroups()){const s={stack:[],error:void 0,hasError:!1};try{const t=e(s,r.columnDescriptorForAttribute(o),!1),a=e(s,r.columnDescriptorForAttribute(n),!1),u=[a.minValue(),t.minValue(),a.maxValue(),t.maxValue()];c(i,u),r.free()}catch(q){s.error=q,s.hasError=!0}finally{t(s)}}this._fullExtent={xmin:i[0],ymin:i[1],xmax:i[3],ymax:i[4],spatialReference:a.spatialReference?.toJSON()}}return{layerDefinition:{fields:a.fields?.map(e=>e.toJSON()),drawingInfo:_(R),extent:this._fullExtent??void 0,geometryType:R,encoding:a.encoding?.toJSON(),displayOptimization:a.displayOptimization}}}destroy(){for(const e of this._fileInfos.values())e.file.free();this._fileInfos.clear(),this._queue.destroy()}setCustomParameters(e){this._customParameters=e}async updateFiles(e){const t=new Set(e);for(const[r,s]of this._fileInfos.entries())t.has(r)?t.delete(r):(s.file.free(),this._fileInfos.delete(r));for(const r of t){const e=await b(r,{geometryInfo:this._geometryInfo,outSpatialReference:null,getCustomParameters:()=>this._customParameters});this._fileInfos.set(r,{index:this._fileInfos.size,file:e})}}async queryFeatures(e,t){if(this._validateQuery(e),e.objectIds?.length){return(await this._enqueueQuery(e,t)).createQueryResponse()}e.resultRecordCount=e.resultRecordCount?Math.min(e.resultRecordCount,8e3):8e3,e.resultOffset=e.resultOffset??0;return(await this._enqueueQuery(e,t)).createQueryResponse()}async queryFeatureCount(e,t){if(this._validateQuery(e),!A(e))return this._getFeatureCount();e.resultRecordCount=e.resultRecordCount??this._getFeatureCount(),e.resultOffset=e.resultOffset??0,delete e.outFields,delete e.returnGeometry;return(await this._enqueueQuery(e,t)).createQueryResponseForCount()}async queryObjectIds(e,t){if(this._validateQuery(e),!A(e))return Array.from({length:this._getFeatureCount()},(e,t)=>t);e.resultRecordCount=e.resultRecordCount?Math.min(e.resultRecordCount,8e3):8e3,e.resultOffset=e.resultOffset??0,delete e.returnGeometry,delete e.outFields;return(await this._enqueueQuery(e,t)).items.map(e=>e.getObjectId())}async queryExtent(e,t){if(this._validateQuery(e),this._fullExtent&&!A(e))return{count:this._getFeatureCount(),extent:this._fullExtent};const r=s(this._metadata.spatialReference);e.resultOffset=e.resultOffset??0,e.resultRecordCount=e.resultRecordCount??this._getFeatureCount(),e.returnGeometry=!0,delete e.outFields;const o=l(f(),m),n=f(),i=await this._enqueueQuery(e,t);let a=0;for(const s of i.items)s.getBounds(n)&&(d(o,n),a+=1);return{count:a,extent:h(o,r,e.outSR?s(e.outSR):r,r,!1)}}_getFeatureCount(){return Array.from(this._fileInfos.values()).reduce((e,t)=>e+t.file.numRows(),0)}_validateQuery(e){if(e.outStatistics)throw new o("parquet:unsupported","Statistics queries are not supported",{query:e});if(e.orderByFields?.length)throw new o("parquet:unsupported","Queries using orderBy are not supported",{query:e})}async*_fetchChunks(e,t){for(const r of this._fileInfos.values()){const s=r.file.numRows(),o=Math.ceil(s/T);for(let n=0;n<o;n++){const s=n*T,o=await r.file.readChunk(s,T,e.fields,e.returnGeometry,t);for(const e of o){const t=new E(this._metadata,this._fieldsIndex,e,0,r.index),s=new O(t,null,0,!1),o=k(this._metadata,[s],this._queryEngineParams);yield o}}}}_enqueueQuery(e,t){return this._queue.push(e,t)}async _executeQuery(e,t){const r=await this._getReadParams(e);if(e.objectIds?.length)for(const i of this._fileInfos.values()){const s=[],o=(await i.file.readChunksByRowId(new Uint32Array(e.objectIds),r.fields,r.returnGeometry,t)).map((e,t)=>new E(this._metadata,this._fieldsIndex,e,t,i.index)).map((e,t)=>new O(e,null,t,!1)),n=k(this._metadata,o,this._queryEngineParams),a=await n.executeQueryForOpaqueFeatures(e,t);for(const e of a)s.push(e);return new g(s,e,{fieldsIndex:this._fieldsIndex,geometryType:this._metadata.geometryType,spatialReference:this._metadata.spatialReference,objectIdField:"rowId",hasM:!1,hasZ:!1,featureAdapter:G})}let s=e.resultRecordCount,o=e.resultOffset;i(s),i(o),delete e.resultRecordCount,delete e.resultOffset;const n=[];for await(const i of this._fetchChunks(r,t)){const r=await i.executeQueryForOpaqueFeatures(e,t);if(r.length>o){const t=r.slice(o,Math.min(o+s,r.length));for(const e of t)n.push(e);if(o=0,s-=t.length,0===s)return new g(n,e,{fieldsIndex:this._fieldsIndex,geometryType:this._metadata.geometryType,spatialReference:this._metadata.spatialReference,objectIdField:"rowId",hasM:!1,hasZ:!1,featureAdapter:G})}else o-=r.length}return new g(n,e,{fieldsIndex:this._fieldsIndex,geometryType:this._metadata.geometryType,spatialReference:this._metadata.spatialReference,objectIdField:"rowId",hasM:!1,hasZ:!1,featureAdapter:G})}async _getReadParams(e){const t=new Set;if(e.where&&await R(t,this._fieldsIndex,e.where),e.outStatistics)for(const r of e.outStatistics)null!=r.onStatisticField&&t.add(r.onStatisticField);if(e.outFields)for(const r of e.outFields)t.add(r);return{fields:this._getAttributeIds(Array.from(t)),returnGeometry:!!e.returnGeometry||!!e.geometry}}_getAttributeIds(e){if(null==e)return new Uint32Array;if(e.includes("*"))return new Uint32Array(this._fieldsIndex.fields.map(e=>e.column).filter(e=>null!=e));const t=[];for(const r of e){const e=this._fieldsIndex.get(r);if(null==e)throw new o("unknown-field",`Field ${r} does not exist`);null==e.column||t.push(e.column)}return new Uint32Array(t)}}function A(e){return Object.keys(e).some(e=>M(e))}function M(e){switch(e){case"resultOffset":case"resultRecordCount":case"aggregateIds":case"distance":case"gdbVersion":case"geometry":case"having":case"timeExtent":case"where":case"objectIds":case"historicMoment":return!0;default:return!1}}function k(e,t,r){const s=new v(()=>e);for(const o of t)s.insert(o);return new y({...r,featureStore:s})}function J(e){switch(e.length){case 4:return p(f(),e);case 6:return e;default:throw new o("parquet:protocol-violation","Invalid Geoparquet file. BoundingBox size must be 4 or 6.",{bbox:e})}}function W(e,t){const r=l(f(),m);for(const s of e){const e=q(s.file);if(!e)return null;const t=e.columns[e.primary_column];if(!t.bbox)return null;const o=J(t.bbox);d(r,o)}return{xmin:r[0],ymin:r[1],xmax:r[3],ymax:r[4],spatialReference:t}}export{N as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{isArrayLike as e}from"../../../core/arrayUtils.js";import{deg2rad as r}from"../../../core/mathUtils.js";import{clone as a,zeros as t}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{a as i}from"../../../chunks/vec32.js";import o from"../../../geometry/Point.js";import{isElevationSource as n}from"../core/ElevationSourceDefinitions.js";import{rectifyMapPointPanoramic as c,rectifyMapPoint as s}from"./rectifyMapPoint.js";import{getWebMercatorScalingFactor as f,hasAngles as l,convertPixelToHeadingPitch as m,isElevationSampler as p,reducerFn as y,validatePixelsToTransform as u,validateRotationMatrix as h,computeFarplaneVertices as d,computeHFOVAndVFOV as g,vecToPoint as w,or as v,isUpdateElevationWithElevationSource as x,scaleWithFactor as M,scaleAndAddWithFactor as A,computeNewReferenceCoordinates as P,projectiveTransform as j}from"./utils.js";import{worldToImage as R}from"./worldToImage.js";import{viewingLimit as V}from"../../../widgets/OrientedImageryViewer/constants.js";async function F(e,r,a){const{verticalFieldOfView:t,imageBoundaries:i,scalingFactor:o,farPlaneVertices:n,cameraLocation:c,pixelsToTransform:s,vecToPoint:f}=q(e,r),l=new Array;return await T(s,n,i,f,r,l,c,o,t,a),Array.isArray(e)?l:l[0]}async function T(e,r,a,t,i,o,n,c,f,l){let m=i.averageElevation;for(const y of e){const e=L(r,a,y,t,i);if(l&&v(p(l.elevationSample),x(l))){m=(await s(t(e),{x:y[0],y:y[1]},{...i,...l,farPlaneVertices:r.map(t)}))[2]}o.push(t(O(e,n,c,m,i.cameraPitch,f)))}}function O(e,r,o,n,c,s){let f=a(e);const l=Math.sqrt((e[2]-r[2])**2+(Math.sqrt((e[0]-r[0])**2+(e[1]-r[1])**2)/o)**2)*o,m=M(i(t(),e,r),1/l,1/o);if(b(e[2],n,c,s)){const e=Math.abs((r[2]-n)/-m[2])*o;f=A(r,m,e,o)}else f[2]=n;return f}function b(e,r,a,t){return e<r||a+t/2<V}function L(e,r,a,t,i){let o=null;const n=9;let c,s=0,f=e,l=r;for(;s<=n;){const e=S(a,l,f,i);if(c=e.error,o=e.transformedPoint,v(c<=1,s===n))break;f=P(f,c,a,r),l=E(f,t,i),s++}return o}function E(e,r,a){return R(e.map(r),a).map(({x:e,y:r})=>[e,r,1])}function S(e,r,a,t){const{cameraLocation:i}=t,n=j(e,r,a),{x:c,y:s}=R(new o(n,i.spatialReference),t);return{transformedPoint:n,error:k(e,[c,s,1])}}function k(e,r){return Math.abs(e[0]-r[0])+Math.abs(e[1]-r[1])}function q(r,a){const t=e(r)||"items"in r?r:[r],{cameraLocation:i,rotationMatrix:n}=a;if(u(t,i),h(n),9!==n?.length)throw new Error("Rotation matrix is not provided or is not a valid 3x3 matrix");const c=f(i.y,i.spatialReference),s=d({...a,scalingFactor:c}),l=R(s.map(e=>new o(e,i.spatialReference)),a),{vfov:m}=g(a.horizontalFieldOfView,a.verticalFieldOfView,a.cameraRoll);return{cameraLocation:i.toArray(),imageBoundaries:l.map(({x:e,y:r})=>[e,r,1]),verticalFieldOfView:m,farPlaneVertices:s,scalingFactor:c,pixelsToTransform:t.map(e=>[e.x,e.y,1]),vecToPoint:w(i.spatialReference)}}async function B(e,a,t){const{cameraHeading:i,cameraLocation:s,farDistance:u,imageHeight:h,imageWidth:d,verticalFieldOfView:g}=a,w=f(s.y,s.spatialReference),v=u*w,x=new Array,[M,A,P]=s.toArray(),j=Array.isArray(e)?e:[e];for(const f of j){let e,j;if(l(f))e=f.heading,j=f.pitch;else{const r=m({x:f.x,y:f.y},d,h);e=r.heading,j=r.pitch}e=(e+i)%360;const R=[M+Math.sin(r(e))*Math.sin(r(j))*v,A+Math.cos(r(e))*Math.sin(r(j))*v,P+-Math.cos(r(j))*u];let V=a.averageElevation;if(t&&(n(t)||p(t.elevationSample))){V=(await c(new o(R,s.spatialReference),{heading:e,pitch:j},{...a,...t,farPlaneVertices:y(u,u).map(([e,r])=>new o([s.x+e,s.y+r],s.spatialReference))}))[2]}x.push(new o(O(R,s.toArray(),w,V,j,g),s.spatialReference))}return Array.isArray(e)?x:x[0]}export{F as imageToWorld,B as imageToWorldPanoramic};
5
+ import{isArrayLike as e}from"../../../core/arrayUtils.js";import{deg2rad as t}from"../../../core/mathUtils.js";import{clone as a,zeros as r}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import i from"../../../geometry/Point.js";import{isElevationSource as n}from"../core/ElevationSourceDefinitions.js";import{rectifyMapPointPanoramic as o,rectifyMapPoint as c}from"./rectifyMapPoint.js";import{getWebMercatorScalingFactor as s,hasAngles as f,convertPixelToHeadingPitch as l,isElevationSampler as m,reducerFn as p,validatePixelsToTransform as h,validateRotationMatrix as u,computeFarplaneVertices as y,computeHFOVAndVFOV as d,vecToPoint as w,or as g,isUpdateElevationWithElevationSource as v,scaleAndAddWithFactor as x,computeNewReferenceCoordinates as M,projectiveTransform as R}from"./utils.js";import{worldToImage as A}from"./worldToImage.js";import{viewingLimit as P}from"../../../widgets/OrientedImageryViewer/constants.js";async function V(e,t,a){const{verticalFieldOfView:r,imageBoundaries:i,scalingFactor:n,farPlaneVertices:o,cameraLocation:c,pixelsToTransform:s,vecToPoint:f,pixelDepths:l}=S(e,t),m=new Array;return await j(s,o,i,f,t,m,c,n,r,a,l),Array.isArray(e)?m:m[0]}async function j(e,t,a,r,n,o,s,f,l,p,h){let u=n.averageElevation,y=0;for(const d of e){const e=L(t,a,d,r,n),w=h?.at(y);if("number"==typeof w){const t=F(e,s,f),a=w*f,r=[s[0]+t[0]*a,s[1]+t[1]*a,s[2]+t[2]*w];o.push(new i(r,n.cameraLocation.spatialReference));continue}if(y+=1,p&&g(m(p.elevationSample),v(p))){u=(await c(r(e),{x:d[0],y:d[1]},{...n,...p,farPlaneVertices:t.map(r)}))[2]}o.push(r(b(e,s,f,u,n.cameraPitch,l)))}}function F(e,t,a){const i=e[0]-t[0],n=e[1]-t[1],o=e[2]-t[2],c=Math.hypot(i,n)/a,s=Math.hypot(o,c)*a,f=r();return f[0]=i/s,f[1]=n/s,f[2]=o/s,f[2]=f[2]*a,f}function b(e,t,r,i,n,o){let c=a(e);const s=F(e,t,r);if(T(e[2],i,n,o)){const e=Math.abs((t[2]-i)/-s[2])*r;c=x(t,s,e,r)}else c[2]=i;return c}function T(e,t,a,r){return e<t||a+r/2<P}function L(e,t,a,r,i){let n=null;const o=9;let c,s=0,f=e,l=t;for(;s<=o;){const e=D(a,l,f,i);if(c=e.error,n=e.transformedPoint,g(c<=1,s===o))break;f=M(f,c,a,t),l=O(f,r,i),s++}return n}function O(e,t,a){return A(e.map(t),a).map(({x:e,y:t})=>[e,t,1])}function D(e,t,a,r){const{cameraLocation:n}=r,o=R(e,t,a),{x:c,y:s}=A(new i(o,n.spatialReference),r);return{transformedPoint:o,error:E(e,[c,s,1])}}function E(e,t){return Math.abs(e[0]-t[0])+Math.abs(e[1]-t[1])}function S(t,a){const r=e(t)||"items"in t?t:[t],{cameraLocation:n,rotationMatrix:o}=a;if(h(r,n),u(o),9!==o?.length)throw new Error("Rotation matrix is not provided or is not a valid 3x3 matrix");const c=s(n.y,n.spatialReference),f=y({...a,scalingFactor:c}),l=A(f.map(e=>new i(e,n.spatialReference)),a),{vfov:m}=d(a.horizontalFieldOfView,a.verticalFieldOfView,a.cameraRoll);return{cameraLocation:n.toArray(),imageBoundaries:l.map(({x:e,y:t})=>[e,t,1]),verticalFieldOfView:m,farPlaneVertices:f,scalingFactor:c,pixelsToTransform:r.map(e=>[e.x,e.y,1]),vecToPoint:w(n.spatialReference),pixelDepths:r.map(e=>B(e)?e.depth:void 0)}}function B(e){return"depth"in e&&"number"==typeof e.depth}async function H(e,a,r){const{cameraHeading:c,cameraLocation:h,farDistance:u,imageHeight:y,imageWidth:d,verticalFieldOfView:w}=a,g=s(h.y,h.spatialReference),v=u*g,x=new Array,[M,R,A]=h.toArray(),P=Array.isArray(e)?e:[e];for(const s of P){let e,P;const V=B(s),j=V?s.depth*g:v;if(f(s))e=s.heading,P=s.pitch;else{const t=l({x:s.x,y:s.y},d,y);e=t.heading,P=t.pitch}e=(e+c)%360;const F=[M+Math.sin(t(e))*Math.sin(t(P))*j,R+Math.cos(t(e))*Math.sin(t(P))*j,A+-Math.cos(t(P))*(V?s.depth:u)];if(V){x.push(new i(F,h.spatialReference));continue}let T=a.averageElevation;if(r&&(n(r)||m(r.elevationSample))){T=(await o(new i(F,h.spatialReference),{heading:e,pitch:P},{...a,...r,farPlaneVertices:p(u,u).map(([e,t])=>new i([h.x+e,h.y+t],h.spatialReference))}))[2]}x.push(new i(b(F,h.toArray(),g,T,P,w),h.spatialReference))}return Array.isArray(e)?x:x[0]}export{V as imageToWorld,H as imageToWorldPanoramic};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import e from"../../../core/Error.js";import t from"../../../core/Logger.js";import{isAbortError as r,waitTick as a}from"../../../core/promiseUtils.js";import o from"../../../geometry/Extent.js";import{projectWithZConversion as n}from"../../../geometry/projectionUtils.js";import{load as i,execute as s}from"../../../geometry/operators/projectOperator.js";import{fromExtent as l}from"../../../geometry/support/aaBoundingRect.js";import c from"../../ElevationLayer.js";import p from"../../ImageryLayer.js";import{getMetersPerUnitOfSR as m}from"../core/utils.js";import{defaultOptions as u}from"../../support/ElevationQuery.js";import{TileElevationSampler as f}from"../../support/ElevationSampler.js";import{ElevationTile as y}from"../../support/ElevationTile.js";import{ElevationTileData as w}from"../../support/ElevationTileData.js";import g from"../../support/RasterFunction.js";import d from"../../support/TileInfo.js";import{TileKey as v}from"../../support/TileKey.js";import{fetchArcGISServiceJSON as j}from"../../../support/requestPresets.js";import{logAndThrow as R}from"../../../widgets/OrientedImageryViewer/utils.js";async function h(t,r,a){if(!r.extent||!r.url)throw R("esri.layer.orientedImagery.transformations",new e("update-elevation:missing-property","both extent and url are required to create a sampler",r));const o=await E(r);if(!o)throw R("esri.layers.orientedImagery.transformations",new e("update-elevation:elevation-source","could not create a sampler using provided elevation source",r));return x(t,o,a)}async function x(e,t,r){await a(r);const o=z(t,r),n=Array.isArray(e)?e:[e];return await Promise.all(n.map(o))}async function E(e,a){let o;const{extent:n,rasterFunction:i,url:s,lod:l}=e;try{o=await q(s)}catch(c){if(r(c))return;t.getLogger("esri.layers.orientedImagery.transformations").error("updateElevationUsingElevationSource",c)}switch(o){case 0:return await L(s,n,i,a);case 1:return await I(s,n,l,a);default:return}}async function I(e,a,o,n){const i=new c(e);let s;try{const{tileInfo:e}=await i.load(),t=(o&&e.lodAt(Math.min(e.lods.length-1,o))?.resolution)??"finest-contiguous";s=await i.createElevationSampler(a,{...n,demResolution:t})}catch(l){if(r(l))return;t.getLogger(i).error(l)}finally{i.destroy()}return s}async function L(e,t,r,a){const n=r?new g({functionName:r}):void 0,c=new p({url:e,rasterFunction:n,format:"lerc"});await c.load(a);const m=512,j=t.center,R=Math.max(t.width,t.height);let h=new o({xmin:j.x-R/2,ymin:j.y-R/2,xmax:j.x+R/2,ymax:j.y+R/2,spatialReference:t.spatialReference});c.spatialReference.equals(h.spatialReference)||(await i(),h=s(h,c.spatialReference));const x=await c.fetchPixels(h,m,m,a),E=d.create({scales:[R/m],size:m,spatialReference:h.spatialReference}),I=new v(null,0,0,0,l(h)),L=new w(x.pixelBlock.pixels[0],m,m,0),q=new y(I,L);return new f(q,E,u.noDataValue)}async function q(t,r){await a(r);const o=await j(t),{tileInfo:n,cacheType:i}=o;if(!o.hasOwnProperty("bandCount")||!o.hasOwnProperty("pixelSizeX"))throw new e("elevation-source:invalid-service-url",`ElevationSource URL expects an elevation 3D image service but given ${t}`);return n?"LERC"!==n?.format?.toUpperCase()||i&&"elevation"!==i.toLowerCase()?2:1:0}function z(e,t){return async r=>{let a=r.clone();const o=r.spatialReference.equals(e.spatialReference)?a:await n(r,e.spatialReference,t),i=e.queryElevation(o);if(i){a=r.spatialReference.equals(e.spatialReference)?i.clone():await n(i,r.spatialReference,t)}return a.z=a.z??1,a}}async function P(e,t,r){return await a(r),e.map(e=>(e.z=t,e))}function U(e,t){const{averageGroundElevation:r,spatialReference:a}=t,o=m(a);return e.map(e=>{const t=e.clone();return t.z=r*o/e.spatialReference.metersPerUnit,t})}export{E as getElevationSampler,L as getElevationSamplerFromDynamicImageService,U as updateUsingAverageGroundElevation,P as updateUsingConstant,x as updateUsingElevationSampler,h as updateUsingElevationSource,q as validateElevationSourceURL};
5
+ import e from"../../../core/Error.js";import t from"../../../core/Logger.js";import{isAbortError as r,waitTick as a}from"../../../core/promiseUtils.js";import o from"../../../geometry/Extent.js";import{projectWithZConversion as n}from"../../../geometry/projectionUtils.js";import{load as i,execute as s}from"../../../geometry/operators/projectOperator.js";import{fromExtent as l}from"../../../geometry/support/aaBoundingRect.js";import c from"../../ElevationLayer.js";import p from"../../ImageryLayer.js";import{getMetersPerUnitOfSR as m}from"../core/utils.js";import{defaultOptions as u}from"../../support/ElevationQuery.js";import{ElevationTile as f}from"../../support/ElevationTile.js";import{ElevationTileData as y}from"../../support/ElevationTileData.js";import w from"../../support/RasterFunction.js";import{TileElevationSampler as g}from"../../support/TileElevationSampler.js";import d from"../../support/TileInfo.js";import{TileKey as v}from"../../support/TileKey.js";import{fetchArcGISServiceJSON as j}from"../../../support/requestPresets.js";import{logAndThrow as R}from"../../../widgets/OrientedImageryViewer/utils.js";async function h(t,r,a){if(!r.extent||!r.url)throw R("esri.layer.orientedImagery.transformations",new e("update-elevation:missing-property","both extent and url are required to create a sampler",r));const o=await E(r);if(!o)throw R("esri.layers.orientedImagery.transformations",new e("update-elevation:elevation-source","could not create a sampler using provided elevation source",r));return x(t,o,a)}async function x(e,t,r){await a(r);const o=z(t,r),n=Array.isArray(e)?e:[e];return await Promise.all(n.map(o))}async function E(e,a){let o;const{extent:n,rasterFunction:i,url:s,lod:l}=e;try{o=await q(s)}catch(c){if(r(c))return;t.getLogger("esri.layers.orientedImagery.transformations").error("updateElevationUsingElevationSource",c)}switch(o){case 0:return await L(s,n,i,a);case 1:return await I(s,n,l,a);default:return}}async function I(e,a,o,n){const i=new c(e);let s;try{const{tileInfo:e}=await i.load(),t=(o&&e.lodAt(Math.min(e.lods.length-1,o))?.resolution)??"finest-contiguous";s=await i.createElevationSampler(a,{...n,demResolution:t})}catch(l){if(r(l))return;t.getLogger(i).error(l)}finally{i.destroy()}return s}async function L(e,t,r,a){const n=r?new w({functionName:r}):void 0,c=new p({url:e,rasterFunction:n,format:"lerc"});await c.load(a);const m=512,j=t.center,R=Math.max(t.width,t.height);let h=new o({xmin:j.x-R/2,ymin:j.y-R/2,xmax:j.x+R/2,ymax:j.y+R/2,spatialReference:t.spatialReference});c.spatialReference.equals(h.spatialReference)||(await i(),h=s(h,c.spatialReference));const x=await c.fetchPixels(h,m,m,a),E=d.create({scales:[R/m],size:m,spatialReference:h.spatialReference}),I=new v(0,0,0,l(h)),L=new y(x.pixelBlock.pixels[0],m,m,0),q=[new f(I,L)],z=u.noDataValue;return new g({tiles:q,tileInfo:E,noDataValue:z})}async function q(t,r){await a(r);const o=await j(t),{tileInfo:n,cacheType:i}=o;if(!o.hasOwnProperty("bandCount")||!o.hasOwnProperty("pixelSizeX"))throw new e("elevation-source:invalid-service-url",`ElevationSource URL expects an elevation 3D image service but given ${t}`);return n?"LERC"!==n?.format?.toUpperCase()||i&&"elevation"!==i.toLowerCase()?2:1:0}function z(e,t){return async r=>{let a=r.clone();const o=r.spatialReference.equals(e.spatialReference)?a:await n(r,e.spatialReference,t),i=e.queryElevation(o);if(i){a=r.spatialReference.equals(e.spatialReference)?i.clone():await n(i,r.spatialReference,t)}return a.z=a.z??1,a}}async function P(e,t,r){return await a(r),e.map(e=>(e.z=t,e))}function T(e,t){const{averageGroundElevation:r,spatialReference:a}=t,o=m(a);return e.map(e=>{const t=e.clone();return t.z=r*o/e.spatialReference.metersPerUnit,t})}export{E as getElevationSampler,L as getElevationSamplerFromDynamicImageService,T as updateUsingAverageGroundElevation,P as updateUsingConstant,x as updateUsingElevationSampler,h as updateUsingElevationSource,q as validateElevationSourceURL};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{result as e}from"../../core/asyncUtils.js";import t from"../../core/Error.js";import{assertIsSome as i}from"../../core/maybe.js";import{whenOrAbort as l,throwIfAbortError as n}from"../../core/promiseUtils.js";import{getMetersPerUnitForSR as o}from"../../core/unitUtils.js";import{initializeProjection as a,project as s}from"../../geometry/projectionUtils.js";import{fromExtent as r,create as c,contains as u}from"../../geometry/support/aaBoundingRect.js";import{MultiTileElevationSampler as m}from"./ElevationSampler.js";import{ElevationTile as f}from"./ElevationTile.js";import{GeometryDescriptor as h}from"./GeometryDescriptor.js";import{TileKey as p}from"./TileKey.js";class d{async queryAll(e,i,l){if(!(e=l?.ignoreInvisibleLayers?e.filter(e=>e.visible):e.slice()).length)throw new t(L,"Elevation queries require at least one elevation layer to fetch tiles from");const n=h.fromGeometry(i);let o=!1;l?.returnSampleInfo||(o=!0);const a={...w,...l,returnSampleInfo:!0},s=await this.query(e[e.length-1],n,a),r=await this._queryAllContinue(e,s,a);return r.geometry=r.geometry.export(),o&&delete r.sampleInfo,r}async query(e,i,l){if(!e)throw new t(L,"Elevation queries require an elevation layer to fetch tiles from");if(!i||!(i instanceof h)&&"point"!==i.type&&"multipoint"!==i.type&&"polyline"!==i.type)throw new t("elevation-query:invalid-geometry","Only point, polyline and multipoint geometries can be used to query elevation");const n={...w,...l},o=new T(e,i.spatialReference,n),a=n.signal;return await e.load({signal:a}),await x(o,i,a),await this._selectTiles(o,a),await C(o,a),D(o),S(o,a)}async createSampler(e,i,l){if(!e)throw new t(L,"Elevation queries require an elevation layer to fetch tiles from");if(!i||"extent"!==i.type)throw new t("elevation-query:invalid-extent","Invalid or undefined extent");const n={...w,...l};return this._createSampler(e,i,n)}async createSamplerAll(e,i,l){if(!(e=l?.ignoreInvisibleLayers?e.filter(e=>e.visible):e.slice()).length)throw new t(L,"Elevation queries require at least one elevation layer to fetch tiles from");if(!i||"extent"!==i.type)throw new t("elevation-query:invalid-extent","Invalid or undefined extent");const n={...w,...l,returnSampleInfo:!0},o=await this._createSampler(e[e.length-1],i,n);return this._createSamplerAllContinue(e,i,o,n)}async _createSampler(e,t,i,l){const n=i.signal;await e.load({signal:n});const o=t.spatialReference,r=e.tileInfo.spatialReference;o.equals(r)||(await a([{source:o,dest:r}],{signal:n}),t=s(t,r));const c=new v(e,t,i,l);return await this._selectTiles(c,n),await C(c,n),new m(c.elevationTiles,c.layer.tileInfo,c.parameters.noDataValue)}async _createSamplerAllContinue(e,t,i,l){if(e.pop(),!e.length)return i;const n=i.samplers.filter(e=>!e.tile.hasNoDataValues).map(e=>r(e.extent)),o=await this._createSampler(e[e.length-1],t,l,n);if(0===o.samplers.length)return i;const a=i.samplers.concat(o.samplers),s=new m(a,l.noDataValue);return this._createSamplerAllContinue(e,t,s,l)}async _queryAllContinue(e,t,l){const n=e.pop(),o=t.geometry.coordinates,a=t.sampleInfo;i(a);const s=[],r=[];for(let i=0;i<o.length;i++){const t=a[i];t.demResolution>=0?t.source||(t.source=n):e.length&&(s.push(o[i]),r.push(i))}if(!e.length||0===s.length)return t;const c=t.geometry.clone(s),u=await this.query(e[e.length-1],c,l),m=u.sampleInfo;if(!m)throw new Error("no sampleInfo");return r.forEach((e,t)=>{o[e].z=u.geometry.coordinates[t].z,a[e].demResolution=m[t].demResolution}),this._queryAllContinue(e,t,l)}async _selectTiles(e,i){"geometry"===e.type&&_(e);const l=e.parameters.demResolution;if("number"==typeof l)I(e,l);else if("finest-contiguous"===l)await this._selectTilesFinestContiguous(e,i);else{if("auto"!==l)throw new t("elevation-query:invalid-dem-resolution",`Invalid dem resolution value '${l}', expected a number, "finest-contiguous" or "auto"`);await this._selectTilesAuto(e,i)}}async _selectTilesFinestContiguous(e,t){const{tileInfo:i,tilemapCache:l}=e.layer,n=g(i,l,e.parameters.minDemResolution);await this._selectTilesFinestContiguousAt(e,n,t)}async _selectTilesFinestContiguousAt(e,i,o){const a=e.layer;if(e.selectTilesAtLOD(i),i<0)return;const s=a.tilemapCache,r=e.getTilesToFetch();try{if(s&&!j(s))await l(Promise.all(r.map(e=>s.fetchAvailability(e.level,e.row,e.col,{signal:o}))),o);else if(await C(e,o),!e.allElevationTilesFetched())throw e.clearElevationTiles(),new t("elevation-query:has-unavailable-tiles","Some elevation tiles are unavailable")}catch(c){n(c),await this._selectTilesFinestContiguousAt(e,i-1,o)}}async _selectTilesAuto(t,i){A(t),R(t);const o=t.layer.tilemapCache;if(!o||j(o))return this._selectTilesAutoPrefetchUpsample(t,i);const a=t.getTilesToFetch(),s={},r=a.map(async t=>{const l=new p(null,0,0,0,c()),a=await e(o.fetchAvailabilityUpsample(t.level,t.row,t.col,l,{signal:i}));!1!==a.ok?null!=t.id&&(s[t.id]=l):n(a.error)});await l(Promise.all(r),i),t.remapTiles(s)}async _selectTilesAutoPrefetchUpsample(e,t){const i=e.layer.tileInfo;await C(e,t);let l=!1;e.forEachTileToFetch((e,t)=>{i.upsampleTile(e)?l=!0:t()}),l&&await this._selectTilesAutoPrefetchUpsample(e,t)}}class y{constructor(e,t){this.layer=e,this.parameters=t}}class T extends y{constructor(e,t,i){super(e,i),this.outSpatialReference=t,this.type="geometry"}selectTilesAtLOD(e){if(e<0)this.geometry.coordinates.forEach(e=>e.tile=null);else{const{tileInfo:t,tilemapCache:i}=this.layer,l=q(t,i)[e].level;this.geometry.coordinates.forEach(e=>e.tile=t.tileAt(l,e.x,e.y))}}allElevationTilesFetched(){return!this.geometry.coordinates.some(e=>!e.elevationTile)}clearElevationTiles(){for(const e of this.geometry.coordinates)e.elevationTile!==this.outsideExtentTile&&(e.elevationTile=null)}populateElevationTiles(e){for(const t of this.geometry.coordinates)!t.elevationTile&&t.tile?.id&&(t.elevationTile=e[t.tile.id])}remapTiles(e){for(const t of this.geometry.coordinates){const i=t.tile?.id;t.tile=i?e[i]:null}}getTilesToFetch(){const e={},t=[];for(const i of this.geometry.coordinates){const l=i.tile;if(!l)continue;const n=i.tile?.id;i.elevationTile||!n||e[n]||(e[n]=l,t.push(l))}return t}forEachTileToFetch(e){for(const t of this.geometry.coordinates)t.tile&&!t.elevationTile&&e(t.tile,()=>t.tile=null)}}class v extends y{constructor(e,t,i,l){super(e,i),this.type="extent",this.elevationTiles=[],this._candidateTiles=[],this._fetchedCandidates=new Set,this.extent=t.clone().intersection(e.fullExtent),this.maskExtents=l}selectTilesAtLOD(e,t){const i=this._maximumLodForRequests(t),l=Math.min(i,e);l<0?this._candidateTiles.length=0:this._selectCandidateTilesCoveringExtentAt(l)}_maximumLodForRequests(e){const{tileInfo:t,tilemapCache:i}=this.layer,l=q(t,i);if(!e)return l.length-1;const n=this.extent;if(null==n)return-1;for(let o=l.length-1;o>=0;o--){const i=l[o],a=i.resolution*t.size[0],s=i.resolution*t.size[1];if(Math.ceil(n.width/a)*Math.ceil(n.height/s)<=e)return o}return-1}allElevationTilesFetched(){return this._candidateTiles.length===this.elevationTiles.length}clearElevationTiles(){this.elevationTiles.length=0,this._fetchedCandidates.clear()}populateElevationTiles(e){for(const t of this._candidateTiles){const i=t.id&&e[t.id];i&&(this._fetchedCandidates.add(t),this.elevationTiles.push(i))}}remapTiles(e){this._candidateTiles=F(this._candidateTiles.map(t=>e[t.id]))}getTilesToFetch(){return this._candidateTiles}forEachTileToFetch(e,t){const i=this._candidateTiles;this._candidateTiles=[],i.forEach(i=>{if(this._fetchedCandidates.has(i))return void t?.(i);let l=!1;e(i,()=>l=!0),l?t?.(i):this._candidateTiles.push(i)}),this._candidateTiles=F(this._candidateTiles,t)}_selectCandidateTilesCoveringExtentAt(e){this._candidateTiles.length=0;const t=this.extent;if(null==t)return;const{tileInfo:i,tilemapCache:l}=this.layer,n=q(i,l)[e],o=i.tileAt(n.level,t.xmin,t.ymin),a=o.extent;if(null==a)return;const s=n.resolution*i.size[0],r=n.resolution*i.size[1],c=Math.ceil((t.xmax-a[0])/s),u=Math.ceil((t.ymax-a[1])/r);for(let m=0;m<u;m++)for(let e=0;e<c;e++){const t=new p(null,o.level,o.row-m,o.col+e);i.updateTileInfo(t),this._tileIsMasked(t)||this._candidateTiles.push(t)}}_tileIsMasked(e){return!!this.maskExtents&&this.maskExtents.some(t=>e.extent&&u(t,e.extent))}}function g(e,t,i=0){const l=q(e,t);let n=l.length-1;if(i>0){const t=i/o(e.spatialReference),a=l.findIndex(e=>e.resolution<t);0===a?n=0:a>0&&(n=a-1)}return n}const w={maximumAutoTileRequests:20,noDataValue:0,returnSampleInfo:!1,demResolution:"auto",minDemResolution:0,signal:null};async function x(e,i,l){let n;const o=e.layer.tileInfo.spatialReference;if(i instanceof h?n=await i.project(o,l):(await a([{source:i.spatialReference,dest:o}],{signal:l}),n=s(i,o)),!n)throw new t("elevation-query:spatial-reference-mismatch",`Cannot query elevation in '${i.spatialReference.wkid}' on an elevation service in '${o.wkid}'`);e.geometry=h.fromGeometry(n)}function _(e){if(null==e.layer.fullExtent)return;const t=new f(null);t.sample=()=>e.parameters.noDataValue,e.outsideExtentTile=t;const i=e.layer.fullExtent;e.geometry.coordinates.forEach(e=>{const l=e.x,n=e.y;(l<i.xmin||l>i.xmax||n<i.ymin||n>i.ymax)&&(e.elevationTile=t)})}function E(e,t){const{tileInfo:i,tilemapCache:l}=e.layer,n=t/o(i.spatialReference),a=q(i,l);let s=a[0],r=0;for(let o=1;o<a.length;o++){const e=a[o];Math.abs(e.resolution-n)<Math.abs(s.resolution-n)&&(s=e,r=o)}return r}function I(e,t){const i=E(e,t);e.selectTilesAtLOD(i)}function A(e){const{tileInfo:t,tilemapCache:i}=e.layer,l=g(t,i,e.parameters.minDemResolution);e.selectTilesAtLOD(l,e.parameters.maximumAutoTileRequests)}function q(e,t){const i=e.lods;if(j(t)){const{effectiveMinLOD:e,effectiveMaxLOD:l}=t;return i.filter(t=>t.level>=e&&t.level<=l)}return i}async function C(e,t){const i=e.getTilesToFetch(),n={},o=e.parameters.cache,a=e.parameters.noDataValue,s=i.map(async i=>{if(null==i.id)return;const l=`${e.layer.uid}:${i.id}:${a}`,s=null!=o?o.get(l):null,r=null!=s?s:await e.layer.fetchTile(i.level,i.row,i.col,{noDataValue:a,signal:t});null!=o&&o.put(l,r),n[i.id]=new f(i,r)});await l(Promise.allSettled(s),t),e.populateElevationTiles(n)}function R(e){const t=e.layer.tileInfo;let i=0;const l={},n=e=>{null!=e.id&&(e.id in l?l[e.id]++:(l[e.id]=1,i++))},o=e=>{if(null==e.id)return;const t=l[e.id];1===t?(delete l[e.id],i--):l[e.id]=t-1};e.forEachTileToFetch(n,o);let a=!0;for(;a&&(a=!1,e.forEachTileToFetch(l=>{i<=e.parameters.maximumAutoTileRequests||(o(l),t.upsampleTile(l)&&(a=!0),n(l))},o),a););}function D(e){e.geometry.coordinates.forEach(t=>{const i=t.elevationTile;let l=e.parameters.noDataValue;if(i){const e=i.sample(t.x,t.y);null!=e?l=e:t.elevationTile=null}t.z=l})}function F(e,t){const i={},l=[];for(const o of e){const e=o.id;e&&!i[e]?(i[e]=o,l.push(o)):t?.(o)}const n=l.sort((e,t)=>e.level-t.level);return n.filter((e,i)=>{for(let l=0;l<i;l++){const i=n[l].extent;if(i&&e.extent&&u(i,e.extent))return t?.(e),!1}return!0})}async function S(e,t){const l=await e.geometry.project(e.outSpatialReference,t);i(l);const n={geometry:l.export(),noDataValue:e.parameters.noDataValue};return e.parameters.returnSampleInfo&&(n.sampleInfo=b(e)),e.geometry.coordinates.forEach(e=>{e.tile=null,e.elevationTile=null}),n}function b(e){const t=e.layer.tileInfo,i=o(t.spatialReference);return e.geometry.coordinates.map(l=>{let n=-1;if(l.elevationTile&&l.elevationTile!==e.outsideExtentTile){n=t.lodAt(l.elevationTile.tile.level).resolution*i}return{demResolution:n}})}function j(e){return null!=e?.tileInfo}const L="elevation-query:invalid-layer";export{d as ElevationQuery,L as InvalidLayerError,w as defaultOptions,g as getFinestLodIndex};
5
+ import{result as e}from"../../core/asyncUtils.js";import t from"../../core/Error.js";import{assertIsSome as n}from"../../core/maybe.js";import{whenOrAbort as a,throwIfAbortError as o}from"../../core/promiseUtils.js";import{getMetersPerUnitForSR as i}from"../../core/unitUtils.js";import{initializeProjection as l,project as r}from"../../geometry/projectionUtils.js";import{fromExtent as s}from"../../geometry/support/aaBoundingRect.js";import{GeometryQueryContext as c,ExtentQueryContext as u,isTileInfoTilemapCache as m,getLods as f}from"./ElevationQueryContext.js";import{ElevationTile as p}from"./ElevationTile.js";import{GeometryDescriptor as y}from"./GeometryDescriptor.js";import{TileElevationSampler as w}from"./TileElevationSampler.js";import{TileKey as d}from"./TileKey.js";async function h(e,n,a){if(e=a?.ignoreInvisibleLayers?e.filter(e=>e.visible):e.slice(),!e.length)throw new t(G,"Elevation queries require at least one elevation layer to fetch tiles from");const o=y.fromGeometry(n),i={...A,...a,returnSampleInfo:!0},l=e.pop(),r=await v(l,o,i),s=await x(e,r,i);return s.geometry=s.geometry.export(),a?.returnSampleInfo||delete s.sampleInfo,s}async function v(e,n,a){if(!e)throw new t(G,"Elevation queries require an elevation layer to fetch tiles from");if(!n||!(n instanceof y)&&"point"!==n.type&&"multipoint"!==n.type&&"polyline"!==n.type)throw new t("elevation-query:invalid-geometry","Only point, polyline and multipoint geometries can be used to query elevation");const o={...A,...a},i=new c(e,n.spatialReference,o),l=o.signal;return await e.load({signal:l}),await V(i,n,l),await R(i,l),await L(i,l),k(i),O(i,l)}async function g(e,n,a){if(e=Array.isArray(e)?e:[e],0===(e=a?.ignoreInvisibleLayers?e.filter(e=>e.visible):e.slice()).length)throw new t(G,"Elevation queries require at least one elevation layer to fetch tiles from");if(!n||"extent"!==n.type)throw new t("elevation-query:invalid-extent","Invalid or undefined extent");const o={...A,...a,returnSampleInfo:!0},i=T(e[e.length-1],n,o);if(1===e.length)return i;return I(e,n,await i,o)}async function T(e,t,n,a){const o=n.signal;await e.load({signal:o});const i=t.spatialReference,s=e.tileInfo.spatialReference;i.equals(s)||(await l([{source:i,dest:s}],{signal:o}),t=r(t,s));const c=new u(e,t,n,a);await R(c,o),await L(c,o);const m=c.elevationTiles,f=c.layer.tileInfo,p=c.parameters.noDataValue;return new w({noDataValue:p,tiles:m,tileInfo:f})}async function I(e,t,n,a){if(e.pop(),!e.length)return n;const o=n.samplers.filter(e=>!e.tile.hasNoDataValues).map(e=>s(e.extent)),i=await T(e[e.length-1],t,a,o);if(0===i.samplers.length)return n;const l=n.samplers.concat(i.samplers),r=a.noDataValue;return I(e,t,new w({samplers:l,noDataValue:r}),a)}async function x(e,t,a){const o=t.geometry.coordinates,i=t.sampleInfo;n(i);const l=new Array,r=new Array;for(let n=0;n<o.length;n++){i[n].demResolution<0&&e.length&&(l.push(o[n]),r.push(n))}const s=e.pop();if(null==s||0===l.length)return t;const c=t.geometry.clone(l),u=await v(s,c,a),m=u.sampleInfo;if(!m)throw new Error("no sampleInfo");return r.forEach((e,t)=>{o[e].z=u.geometry.coordinates[t].z,i[e].demResolution=m[t].demResolution,i[e].source=m[t].source}),x(e,t,a)}async function R(e,n){"geometry"===e.type&&S(e);const a=e.parameters.demResolution;if("number"==typeof a)F(e,a);else if("finest-contiguous"===a)await E(e,n);else{if("auto"!==a)throw new t("elevation-query:invalid-dem-resolution",`Invalid dem resolution value '${a}', expected a number, "finest-contiguous" or "auto"`);await q(e,n)}}async function E(e,t){const{tileInfo:n,tilemapCache:a}=e.layer,o=b(n,a,e.parameters.minDemResolution);await D(e,o,t)}async function D(e,n,i){const l=e.layer;if(e.selectTilesAtLOD(n),n<0)return;const r=l.tilemapCache,s=e.getTilesToFetch();try{if(r&&!m(r))await a(Promise.all(s.map(e=>r.fetchAvailability(e.level,e.row,e.col,{signal:i}))),i);else if(await L(e,i),!e.allElevationTilesFetched())throw e.clearElevationTiles(),new t("elevation-query:has-unavailable-tiles","Some elevation tiles are unavailable")}catch(c){o(c),await D(e,n-1,i)}}async function q(t,n){$(t),U(t);const i=t.layer.tilemapCache;if(!i||m(i))return j(t,n);const l=t.getTilesToFetch(),r={},s=l.map(async t=>{const a=new d(0,0,0),l=await e(i.fetchAvailabilityUpsample(t.level,t.row,t.col,a,{signal:n}));!1!==l.ok?null!=t.id&&(r[t.id]=a):o(l.error)});await a(Promise.all(s),n),t.remapTiles(r)}async function j(e,t){const n=e.layer.tileInfo;await L(e,t);let a=!1;e.forEachTileToFetch((e,t)=>{n.upsampleTile(e)?a=!0:t()}),a&&await j(e,t)}function b(e,t,n=0){const a=f(e,t);let o=a.length-1;if(n>0){const t=n/i(e.spatialReference),l=a.findIndex(e=>e.resolution<t);0===l?o=0:l>0&&(o=l-1)}return o}const A={maximumAutoTileRequests:20,noDataValue:0,returnSampleInfo:!1,demResolution:"auto",minDemResolution:0,signal:null};async function V(e,n,a){let o;const i=e.layer.tileInfo.spatialReference;if(n instanceof y?o=await n.project(i,a):(await l([{source:n.spatialReference,dest:i}],{signal:a}),o=r(n,i)),!o)throw new t("elevation-query:spatial-reference-mismatch",`Cannot query elevation in '${n.spatialReference.wkid}' on an elevation service in '${i.wkid}'`);e.geometry=y.fromGeometry(o)}function S(e){if(null==e.layer.fullExtent)return;const t=new p(new d(-1,-1,-1));t.sample=()=>e.parameters.noDataValue,e.outsideExtentTile=t;const n=e.layer.fullExtent;e.geometry.coordinates.forEach(e=>{const a=e.x,o=e.y;(a<n.xmin||a>n.xmax||o<n.ymin||o>n.ymax)&&(e.elevationTile=t)})}function C(e,t){const{tileInfo:n,tilemapCache:a}=e.layer,o=t/i(n.spatialReference),l=f(n,a);let r=l[0],s=0;for(let i=1;i<l.length;i++){const e=l[i];Math.abs(e.resolution-o)<Math.abs(r.resolution-o)&&(r=e,s=i)}return s}function F(e,t){const n=C(e,t);e.selectTilesAtLOD(n)}function $(e){const{tileInfo:t,tilemapCache:n}=e.layer,a=b(t,n,e.parameters.minDemResolution);e.selectTilesAtLOD(a,e.parameters.maximumAutoTileRequests)}async function L(e,t){const n=e.getTilesToFetch(),o={},i=e.parameters.cache,l=e.parameters.noDataValue,r={noDataValue:l,signal:t},s=n.map(async t=>{if(null==t.id)return;const n=`${e.layer.uid}:${t.id}:${l}`,a=i?.get(n),s=a??await e.layer.fetchTile(t.level,t.row,t.col,r);i?.put(n,s),o[t.id]=new p(t,s)});await a(Promise.allSettled(s),t),e.populateElevationTiles(o)}function U(e){const t=e.layer.tileInfo;let n=0;const a={},o=e=>{null!=e.id&&(e.id in a?a[e.id]++:(a[e.id]=1,n++))},i=e=>{if(null==e.id)return;const t=a[e.id];1===t?(delete a[e.id],n--):a[e.id]=t-1};e.forEachTileToFetch(o,i);let l=!0;for(;l&&(l=!1,e.forEachTileToFetch(a=>{n<=e.parameters.maximumAutoTileRequests||(i(a),t.upsampleTile(a)&&(l=!0),o(a))},i),l););}function k(e){e.geometry.coordinates.forEach(t=>{const n=t.elevationTile;let a=e.parameters.noDataValue;if(n){const e=n.sample(t.x,t.y);null==e?t.elevationTile=null:a=e}t.z=a})}async function O(e,t){const a=await e.geometry.project(e.outSpatialReference,t);n(a);const o={geometry:a.export(),noDataValue:e.parameters.noDataValue};return e.parameters.returnSampleInfo&&(o.sampleInfo=z(e)),e.geometry.coordinates.forEach(e=>{e.tile=null,e.elevationTile=null}),o}function z(e){const t=e.layer.tileInfo,n=i(t.spatialReference);return e.geometry.coordinates.map(a=>{let o=-1;if(a.elevationTile&&a.elevationTile!==e.outsideExtentTile){o=t.lodAt(a.elevationTile.key.level).resolution*n}return{demResolution:o,source:-1===o?void 0:e.layer}})}const G="elevation-query:invalid-layer";export{G as InvalidLayerError,g as createSampler,A as defaultOptions,b as getFinestLodIndex,v as query,h as queryAll};
@@ -0,0 +1,5 @@
1
+ /*
2
+ All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
+ See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
+ */
5
+ import{unique as e}from"../../core/arrayUtils.js";import{contains as t}from"../../geometry/support/aaBoundingRect.js";import{TileKey as i}from"./TileKey.js";class s{constructor(e,t){this.layer=e,this.parameters=t}}class l extends s{constructor(e,t,i){super(e,i),this.outSpatialReference=t,this.type="geometry"}selectTilesAtLOD(e){if(e<0)this.geometry.coordinates.forEach(e=>e.tile=null);else{const{tileInfo:t,tilemapCache:i}=this.layer,s=a(t,i)[e].level;this.geometry.coordinates.forEach(e=>e.tile=t.tileAt(s,e.x,e.y))}}allElevationTilesFetched(){return!this.geometry.coordinates.some(e=>!e.elevationTile)}clearElevationTiles(){for(const e of this.geometry.coordinates)e.elevationTile!==this.outsideExtentTile&&(e.elevationTile=null)}populateElevationTiles(e){for(const t of this.geometry.coordinates)!t.elevationTile&&t.tile?.id&&(t.elevationTile=e[t.tile.id])}remapTiles(e){for(const t of this.geometry.coordinates){const i=t.tile?.id;t.tile=i?e[i]:null}}getTilesToFetch(){return e(this.geometry.coordinates.filter(({tile:e,elevationTile:t})=>e?.id&&!t),(e,t)=>e.tile?.id===t.tile?.id).map(({tile:e})=>e)}forEachTileToFetch(e){for(const t of this.geometry.coordinates)t.tile&&!t.elevationTile&&e(t.tile,()=>t.tile=null)}}class n extends s{constructor(e,t,i,s){super(e,i),this.maskExtents=s,this.type="extent",this.elevationTiles=[],this._candidateTiles=[],this._fetchedCandidates=new Set,this.extent=t.clone().intersection(e.fullExtent)}selectTilesAtLOD(e,t){const i=this._maximumLodForRequests(t),s=Math.min(i,e);s<0?this._candidateTiles.length=0:this._selectCandidateTilesCoveringExtentAt(s)}_maximumLodForRequests(e){const{tileInfo:t,tilemapCache:i}=this.layer,s=a(t,i);if(!e)return s.length-1;const l=this.extent;if(null==l)return-1;for(let n=s.length-1;n>=0;n--){const i=s[n],o=i.resolution*t.size[0],a=i.resolution*t.size[1];if(Math.ceil(l.width/o)*Math.ceil(l.height/a)<=e)return n}return-1}allElevationTilesFetched(){return this._candidateTiles.length===this.elevationTiles.length}clearElevationTiles(){this.elevationTiles.length=0,this._fetchedCandidates.clear()}populateElevationTiles(e){for(const t of this._candidateTiles){const i=t.id&&e[t.id];i&&(this._fetchedCandidates.add(t),this.elevationTiles.push(i))}}remapTiles(e){this._candidateTiles=r(this._candidateTiles.map(t=>e[t.id]))}getTilesToFetch(){return this._candidateTiles}forEachTileToFetch(e,t){const i=this._candidateTiles;this._candidateTiles=[],i.forEach(i=>{if(this._fetchedCandidates.has(i))return void t?.(i);let s=!1;e(i,()=>s=!0),s?t?.(i):this._candidateTiles.push(i)}),this._candidateTiles=r(this._candidateTiles,t)}_selectCandidateTilesCoveringExtentAt(e){this._candidateTiles.length=0;const t=this.extent;if(null==t)return;const{tileInfo:s,tilemapCache:l}=this.layer,n=a(s,l)[e],o=s.tileAt(n.level,t.xmin,t.ymin),r=o.extent,c=n.resolution*s.size[0],h=n.resolution*s.size[1],d=Math.ceil((t.xmax-r[0])/c),f=Math.ceil((t.ymax-r[1])/h);for(let a=0;a<f;a++)for(let e=0;e<d;e++){const t=new i(o.level,o.row-a,o.col+e);s.updateTileInfo(t),this._tileIsMasked(t)||this._candidateTiles.push(t)}}_tileIsMasked(e){return this.maskExtents?.some(i=>t(i,e.extent))??!1}}function o(e){return null!=e?.tileInfo}function a(e,t){const i=e.lods;if(o(t)){const{effectiveMinLOD:e,effectiveMaxLOD:s}=t;return i.filter(t=>t.level>=e&&t.level<=s)}return i}function r(e,i){const s={},l=[];for(const t of e){const e=t.id;e&&!s[e]?(s[e]=t,l.push(t)):i?.(t)}const n=l.sort((e,t)=>e.level-t.level);return n.filter((e,s)=>{for(let l=0;l<s;l++){const s=n[l].extent;if(s&&t(s,e.extent))return i?.(e),!1}return!0})}export{n as ExtentQueryContext,l as GeometryQueryContext,a as getLods,o as isTileInfoTilemapCache};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import"../../core/has.js";import{Evented as e}from"../../core/Evented.js";import t from"../../core/Logger.js";import{getMetersPerUnitForSR as n}from"../../core/unitUtils.js";import s from"../../geometry/Point.js";import i from"../../geometry/SpatialReference.js";import{toExtent as o,create as a,containsXY as r}from"../../geometry/support/aaBoundingRect.js";import{project as l}from"../../geometry/support/webMercatorUtils.js";const m=()=>t.getLogger("esri.layers.support.ElevationSampler");class u extends e{queryElevation(e){return h(e.clone(),this)}}class c extends u{get spatialReference(){return this.extent.spatialReference}constructor(e,t,s){super(),this.tile=e,this.noDataValue=s;const i=e.tile.extent;this.extent=o(i,t.spatialReference),this.extent.zmin=e.zmin,this.extent.zmax=e.zmax,this._aaExtent=i;const a=n(t.spatialReference),r=t.lodAt(e.tile.level).resolution*a;this.demResolution={min:r,max:r}}contains(e){const t=f(e,this.spatialReference);return null!=t&&this.containsAt(t.x,t.y)}containsAt(e,t){return r(this._aaExtent,e,t)}elevationAt(e,t){if(!this.containsAt(e,t)){const n=this.extent,s=`${n.xmin}, ${n.ymin}, ${n.xmax}, ${n.ymax}`;return m().warn("#elevationAt()",`Point used to sample elevation (${e}, ${t}) is outside of the sampler extent (${s})`),this.noDataValue}return this.tile.sample(e,t)??this.noDataValue}}class p extends u{get spatialReference(){return this.extent.spatialReference}constructor(e,t,n){let s;super(),"number"==typeof t?(this.noDataValue=t,this.samplers=e):(s=t,this.noDataValue=n,this.samplers=e.map(e=>new c(e,s,this.noDataValue)));const r=this.samplers[0];if(r){this.extent=r.extent.clone();const{min:e,max:t}=r.demResolution;this.demResolution={min:e,max:t};for(let n=1;n<this.samplers.length;n++){const e=this.samplers[n];this.extent.union(e.extent),this.demResolution.min=Math.min(this.demResolution.min,e.demResolution.min),this.demResolution.max=Math.max(this.demResolution.max,e.demResolution.max)}}else this.extent=o(a(),s?.spatialReference??i.WGS84),this.demResolution={min:0,max:0}}elevationAt(e,t){let n;for(const s of this.samplers)if(s.containsAt(e,t)&&(n=s.elevationAt(e,t),n!==s.noDataValue))return n;return null!=n?n:(m().warn("#elevationAt()",`Point used to sample elevation (${e}, ${t}) is outside of the sampler`),this.noDataValue)}}function h(e,t){const n=f(e,t.spatialReference);if(!n)return null;switch(e.type){case"point":return x(e,n,t);case"polyline":return R(e,n,t);case"multipoint":return d(e,n,t);default:return null}}function f(e,t){if(null==e)return null;const n=e.spatialReference;if(n.equals(t))return e;const s=l(e,t);return s||m().error(`Cannot project geometry spatial reference (wkid:${n.wkid}) to elevation sampler spatial reference (wkid:${t.wkid})`),s}function x(e,t,n){return e.hasZ=!0,e.z=n.elevationAt(t.x,t.y),e}function R(e,t,n){y.spatialReference=t.spatialReference;const s=e.hasM&&!e.hasZ;for(let i=0;i<e.paths.length;i++){const o=e.paths[i],a=t.paths[i];for(let e=0;e<o.length;e++){const t=o[e],i=a[e];y.x=i[0],y.y=i[1],s&&(t[3]=t[2]),t[2]=n.elevationAt(y.x,y.y)}}return e.hasZ=!0,e}function d(e,t,n){y.spatialReference=t.spatialReference;const s=e.hasM&&!e.hasZ;for(let i=0;i<e.points.length;i++){const o=e.points[i],a=t.points[i];y.x=a[0],y.y=a[1],s&&(o[3]=o[2]),o[2]=n.elevationAt(y.x,y.y)}return e.hasZ=!0,e}const y=new s;export{u as ElevationSamplerBase,p as MultiTileElevationSampler,c as TileElevationSampler,h as updateGeometryElevation};
5
+ import{__decorate as e}from"tslib";import"../../core/has.js";import{EventedAccessor as t}from"../../core/Evented.js";import r from"../../core/Logger.js";import"../../core/RandomLCG.js";import"../../core/Error.js";import{subclass as o}from"../../core/accessorSupport/decorators/subclass.js";import s from"../../geometry/Point.js";import{project as n}from"../../geometry/support/webMercatorUtils.js";let i=class extends t{queryElevation(e){const t=this.projectIfRequired(e,this.spatialReference);if(!t)return null;switch(e.type){case"point":return a(e,t,this);case"polyline":return l(e,t,this);case"multipoint":return c(e,t,this);default:return null}}projectIfRequired(e,t){if(null==e)return null;const o=e.spatialReference;if(o.equals(t))return e;const s=n(e,t);return s||r.getLogger(this).error(`Cannot project geometry spatial reference (wkid:${o.wkid}) to elevation sampler spatial reference (wkid:${t.wkid})`),s}};function a(e,t,r){return e.hasZ=!0,e.z=r.elevationAt(t.x,t.y),e}function l(e,t,r){p.spatialReference=t.spatialReference;const o=e.hasM&&!e.hasZ;for(let s=0;s<e.paths.length;s++){const n=e.paths[s],i=t.paths[s];for(let e=0;e<n.length;e++){const t=n[e],s=i[e];p.x=s[0],p.y=s[1],o&&(t[3]=t[2]),t[2]=r.elevationAt(p.x,p.y)}}return e.hasZ=!0,e}function c(e,t,r){p.spatialReference=t.spatialReference;const o=e.hasM&&!e.hasZ;for(let s=0;s<e.points.length;s++){const n=e.points[s],i=t.points[s];p.x=i[0],p.y=i[1],o&&(n[3]=n[2]),n[2]=r.elevationAt(p.x,p.y)}return e.hasZ=!0,e}i=e([o("esri.layers.support.ElevationSampler")],i);const p=new s;export{i as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{ElevationSamplerData as a}from"./ElevationSamplerData.js";class t{constructor(t,l=null){if(this.tile=t,null!=l&&null!=t){const e=t.extent;this._samplerData=new a(l,e)}}get zmin(){return null!=this._samplerData?this._samplerData.data.minValue:0}get zmax(){return null!=this._samplerData?this._samplerData.data.maxValue:0}get hasNoDataValues(){return!!this._samplerData?.data.hasNoDataValues}sample(a,t){if(null==this._samplerData)return;const{safeWidth:e,data:s,dx:r,dy:n,y1:i,x0:u}=this._samplerData,{width:o,values:m,noDataValue:h}=s,p=l(n*(i-t),0,e),D=l(r*(a-u),0,e),d=Math.floor(p),f=Math.floor(D),_=d*o+f,c=_+o,x=m[_],V=m[c],g=m[_+1],v=m[c+1];if(x!==h&&V!==h&&g!==h&&v!==h){const a=D-f,t=x+(g-x)*a;return t+(V+(v-V)*a-t)*(p-d)}}}function l(a,t,l){return a<t?t:a>l?l:a}export{t as ElevationTile};
5
+ import{ElevationSamplerData as a}from"./ElevationSamplerData.js";class t{constructor(t,e=null){if(this.key=t,null!=e){const s=t.extent;this._samplerData=new a(e,s)}}get zmin(){return null!=this._samplerData?this._samplerData.data.minValue:0}get zmax(){return null!=this._samplerData?this._samplerData.data.maxValue:0}get hasNoDataValues(){return!!this._samplerData?.data.hasNoDataValues}sample(a,t){if(null==this._samplerData)return;const{safeWidth:s,data:l,dx:r,dy:n,y1:i,x0:u}=this._samplerData,{width:o,values:m,noDataValue:h}=l,p=e(n*(i-t),0,s),D=e(r*(a-u),0,s),d=Math.floor(p),f=Math.floor(D),_=d*o+f,c=_+o,x=m[_],V=m[c],g=m[_+1],y=m[c+1];if(x!==h&&V!==h&&g!==h&&y!==h){const a=D-f,t=x+(g-x)*a;return t+(V+(y-V)*a-t)*(p-d)}}}function e(a,t,e){return a<t?t:a>e?e:a}export{t as ElevationTile};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import e from"../../geometry/Multipoint.js";import t from"../../geometry/Point.js";import s from"../../geometry/Polyline.js";import{initializeProjection as n,project as o}from"../../geometry/projectionUtils.js";class r{export(){return this._exporter(this.coordinates,this.spatialReference)}clone(e){const t=new r;return t.geometry=this.geometry,t.spatialReference=this.spatialReference,t.coordinates=e||this.coordinates.map(e=>e.clone()),t._exporter=this._exporter,t}async project(t,s){if(this.spatialReference.equals(t))return this.clone();await n([{source:this.spatialReference,dest:t}],{signal:s});const r=new e({spatialReference:this.spatialReference,points:this.coordinates.map(e=>[e.x,e.y])}),i=o(r,t);if(!i)return null;const a=this.coordinates.map((e,t)=>{const s=e.clone(),n=i.points[t];return s.x=n[0],s.y=n[1],s}),c=this.clone(a);return c.spatialReference=t,c}static fromGeometry(n){const o=new r;if(o.geometry=n,o.spatialReference=n.spatialReference,n instanceof r)o.coordinates=n.coordinates.map(e=>e.clone()),o._exporter=(e,t)=>{const s=n.clone(e);return s.spatialReference=t,s};else switch(n.type){case"point":{const e=n,{hasZ:s,hasM:r}=e;o.coordinates=s&&r?[new i(e.x,e.y,e.z,e.m)]:s?[new i(e.x,e.y,e.z)]:r?[new i(e.x,e.y,null,e.m)]:[new i(e.x,e.y)],o._exporter=(e,s)=>n.hasM?new t(e[0].x,e[0].y,e[0].z,e[0].m,s):new t(e[0].x,e[0].y,e[0].z,s);break}case"multipoint":{const t=n,{hasZ:s,hasM:r}=t;o.coordinates=s&&r?t.points.map(e=>new i(e[0],e[1],e[2],e[3])):s?t.points.map(e=>new i(e[0],e[1],e[2])):r?t.points.map(e=>new i(e[0],e[1],null,e[2])):t.points.map(e=>new i(e[0],e[1])),o._exporter=(t,s)=>n.hasM?new e({points:t.map(e=>[e.x,e.y,e.z??0,e.m??0]),hasZ:!0,hasM:!0,spatialReference:s}):new e({points:t.map(e=>[e.x,e.y,e.z??0]),spatialReference:s});break}case"polyline":{const e=n,t=[],r=[],{hasZ:a,hasM:c}=n;let p=0;for(const s of e.paths)if(r.push([p,p+s.length]),p+=s.length,a&&c)for(const e of s)t.push(new i(e[0],e[1],e[2],e[3]));else if(a)for(const e of s)t.push(new i(e[0],e[1],e[2]));else if(c)for(const e of s)t.push(new i(e[0],e[1],null,e[2]));else for(const e of s)t.push(new i(e[0],e[1]));o.coordinates=t,o._exporter=(e,t)=>{const o=n.hasM?e.map(e=>[e.x,e.y,e.z??0,e.m??0]):e.map(e=>[e.x,e.y,e.z??0]),i=r.map(e=>o.slice(e[0],e[1]));return new s({paths:i,hasM:n.hasM,hasZ:!0,spatialReference:t})};break}}return o}}class i{constructor(e,t,s=null,n=null,o=null,r=null){this.x=e,this.y=t,this.z=s,this.m=n,this.tile=o,this.elevationTile=r}clone(){return new i(this.x,this.y,this.z,this.m)}}export{i as Coordinate,r as GeometryDescriptor};
5
+ import e from"../../geometry/Multipoint.js";import t from"../../geometry/Point.js";import s from"../../geometry/Polyline.js";import{initializeProjection as n,project as o}from"../../geometry/projectionUtils.js";class r{constructor(e){this.geometry=e,this.spatialReference=e.spatialReference}export(){return this._exporter(this.coordinates,this.spatialReference)}clone(e){const t=new r(this.geometry);return t.spatialReference=this.spatialReference,t.coordinates=e??this.coordinates.map(e=>e.clone()),t._exporter=this._exporter,t}async project(t,s){if(this.spatialReference.equals(t))return this.clone();await n([{source:this.spatialReference,dest:t}],{signal:s});const r=new e({spatialReference:this.spatialReference,points:this.coordinates.map(e=>[e.x,e.y])}),i=o(r,t);if(!i)return null;const a=this.coordinates.map((e,t)=>{const s=e.clone(),n=i.points[t];return s.x=n[0],s.y=n[1],s}),c=this.clone(a);return c.spatialReference=t,c}static fromGeometry(n){const o=new r(n);if(n instanceof r)return o.coordinates=n.coordinates.map(e=>e.clone()),o._exporter=(e,t)=>{const s=n.clone(e);return s.spatialReference=t,s},o;switch(n.type){case"point":{const e=n,{hasZ:s,hasM:r}=e;return o.coordinates=s&&r?[new i(e.x,e.y,e.z,e.m)]:s?[new i(e.x,e.y,e.z)]:r?[new i(e.x,e.y,null,e.m)]:[new i(e.x,e.y)],o._exporter=(e,s)=>n.hasM?new t(e[0].x,e[0].y,e[0].z,e[0].m,s):new t(e[0].x,e[0].y,e[0].z,s),o}case"multipoint":{const t=n,{hasZ:s,hasM:r}=t;return o.coordinates=s&&r?t.points.map(e=>new i(e[0],e[1],e[2],e[3])):s?t.points.map(e=>new i(e[0],e[1],e[2])):r?t.points.map(e=>new i(e[0],e[1],null,e[2])):t.points.map(e=>new i(e[0],e[1])),o._exporter=(t,s)=>n.hasM?new e({points:t.map(e=>[e.x,e.y,e.z??0,e.m??0]),hasZ:!0,hasM:!0,spatialReference:s}):new e({points:t.map(e=>[e.x,e.y,e.z??0]),spatialReference:s}),o}case"polyline":{const e=n,t=[],r=[],{hasZ:a,hasM:c}=n;let p=0;for(const s of e.paths)if(r.push([p,p+s.length]),p+=s.length,a&&c)for(const e of s)t.push(new i(e[0],e[1],e[2],e[3]));else if(a)for(const e of s)t.push(new i(e[0],e[1],e[2]));else if(c)for(const e of s)t.push(new i(e[0],e[1],null,e[2]));else for(const e of s)t.push(new i(e[0],e[1]));return o.coordinates=t,o._exporter=(e,t)=>{const o=n.hasM?e.map(e=>[e.x,e.y,e.z??0,e.m??0]):e.map(e=>[e.x,e.y,e.z??0]),i=r.map(e=>o.slice(e[0],e[1]));return new s({paths:i,hasM:n.hasM,hasZ:!0,spatialReference:t})},o}}}}class i{constructor(e,t,s=null,n=null,o=null,r=null){this.x=e,this.y=t,this.z=s,this.m=n,this.tile=o,this.elevationTile=r}clone(){return new i(this.x,this.y,this.z,this.m)}}export{i as Coordinate,r as GeometryDescriptor};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as o}from"tslib";import{JSONSupport as t}from"../../core/JSONSupport.js";import{property as r}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{subclass as e}from"../../core/accessorSupport/decorators/subclass.js";let s=class extends t{constructor(o){super(o),this.type="location",this.latitudeFieldName=null,this.longitudeFieldName=null}};o([r({type:["location"],readOnly:!0,json:{write:!0}})],s.prototype,"type",void 0),o([r({json:{write:!0}})],s.prototype,"latitudeFieldName",void 0),o([r({json:{write:!0}})],s.prototype,"longitudeFieldName",void 0),s=o([e("esri.layers.support.ParquetEncodingLocation")],s);const i=s;export{i as default};
5
+ import{__decorate as o}from"tslib";import{JSONSupport as t}from"../../core/JSONSupport.js";import{property as r}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{subclass as e}from"../../core/accessorSupport/decorators/subclass.js";let s=class extends t{constructor(o){super(o),this.type="location",this.latitudeFieldName=null,this.longitudeFieldName=null}};o([r({type:["location"],readOnly:!0,json:{write:!0}})],s.prototype,"type",void 0),o([r({json:{write:!0}})],s.prototype,"latitudeFieldName",void 0),o([r({json:{write:!0}})],s.prototype,"longitudeFieldName",void 0),s=o([e("esri.layers.support.ParquetEncodingLocation")],s);export{s as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as o}from"tslib";import{JSONSupport as r}from"../../core/JSONSupport.js";import{property as t}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{subclass as e}from"../../core/accessorSupport/decorators/subclass.js";let s=class extends r{constructor(o){super(o),this.type="wkb",this.primaryFieldName=null}};o([t({type:["wkb"],readOnly:!0,json:{write:!0}})],s.prototype,"type",void 0),o([t({json:{write:!0}})],s.prototype,"orientation",void 0),o([t({json:{write:!0}})],s.prototype,"primaryFieldName",void 0),s=o([e("esri.layers.support.ParquetEncodingWkb")],s);const p=s;export{p as default};
5
+ import{__decorate as r}from"tslib";import{JSONSupport as o}from"../../core/JSONSupport.js";import{property as t}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{subclass as e}from"../../core/accessorSupport/decorators/subclass.js";let s=class extends o{constructor(r){super(r),this.type="wkb",this.primaryFieldName=null}};r([t({type:["wkb"],readOnly:!0,json:{write:!0}})],s.prototype,"type",void 0),r([t({json:{write:!0}})],s.prototype,"orientation",void 0),r([t({json:{write:!0}})],s.prototype,"primaryFieldName",void 0),s=r([e("esri.layers.support.ParquetEncodingWkb")],s);export{s as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import{JSONSupport as a}from"../../core/JSONSupport.js";import{property as r}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{subclass as i}from"../../core/accessorSupport/decorators/subclass.js";var t;function n(e){return e=Number(e),isNaN(e)?void 0:e}let o=t=class extends a{constructor(){super(...arguments),this.name=null,this.minWavelength=void 0,this.maxWavelength=void 0,this.radianceBias=void 0,this.radianceGain=void 0,this.reflectanceBias=void 0,this.reflectanceGain=void 0,this.solarIrradiance=void 0}clone(){return new t({name:this.name,minWavelength:this.minWavelength,maxWavelength:this.maxWavelength,radianceBias:this.radianceBias,radianceGain:this.radianceGain,reflectanceBias:this.reflectanceBias,reflectanceGain:this.reflectanceGain,solarIrradiance:this.solarIrradiance})}};e([r({json:{name:"BandName",write:!0}})],o.prototype,"name",void 0),e([r({json:{name:"WavelengthMin",read:{reader:n},write:!0}})],o.prototype,"minWavelength",void 0),e([r({json:{name:"WavelengthMax",read:{reader:n},write:!0}})],o.prototype,"maxWavelength",void 0),e([r({json:{name:"RadianceBias",read:{reader:n},write:!0}})],o.prototype,"radianceBias",void 0),e([r({json:{name:"RadianceGain",read:{reader:n},write:!0}})],o.prototype,"radianceGain",void 0),e([r({json:{name:"ReflectanceBias",read:{reader:n},write:!0}})],o.prototype,"reflectanceBias",void 0),e([r({json:{name:"ReflectanceGain",read:{reader:n},write:!0}})],o.prototype,"reflectanceGain",void 0),e([r({json:{name:"SolarIrradiance",read:{reader:n},write:!0}})],o.prototype,"solarIrradiance",void 0),o=t=e([i("esri.layers.support.RasterBandInfo")],o);export{o as default};
5
+ import{__decorate as e}from"tslib";import{JSONSupport as a}from"../../core/JSONSupport.js";import{property as r}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{subclass as i}from"../../core/accessorSupport/decorators/subclass.js";var t;function n(e){return e=Number(e),isNaN(e)?void 0:e}let o=class extends a{constructor(){super(...arguments),this.name=null,this.minWavelength=void 0,this.maxWavelength=void 0,this.radianceBias=void 0,this.radianceGain=void 0,this.reflectanceBias=void 0,this.reflectanceGain=void 0,this.solarIrradiance=void 0}static{t=this}clone(){return new t({name:this.name,minWavelength:this.minWavelength,maxWavelength:this.maxWavelength,radianceBias:this.radianceBias,radianceGain:this.radianceGain,reflectanceBias:this.reflectanceBias,reflectanceGain:this.reflectanceGain,solarIrradiance:this.solarIrradiance})}};e([r({json:{name:"BandName",write:!0}})],o.prototype,"name",void 0),e([r({json:{read:{source:["WavelengthMin","Wavelength"],reader:(e,a)=>n(a.WavelengthMin??a.Wavelength)},write:{target:"WavelengthMin"}}})],o.prototype,"minWavelength",void 0),e([r({json:{name:"WavelengthMax",read:{reader:n},write:!0}})],o.prototype,"maxWavelength",void 0),e([r({json:{name:"RadianceBias",read:{reader:n},write:!0}})],o.prototype,"radianceBias",void 0),e([r({json:{name:"RadianceGain",read:{reader:n},write:!0}})],o.prototype,"radianceGain",void 0),e([r({json:{name:"ReflectanceBias",read:{reader:n},write:!0}})],o.prototype,"reflectanceBias",void 0),e([r({json:{name:"ReflectanceGain",read:{reader:n},write:!0}})],o.prototype,"reflectanceGain",void 0),e([r({json:{name:"SolarIrradiance",read:{reader:n},write:!0}})],o.prototype,"solarIrradiance",void 0),o=t=e([i("esri.layers.support.RasterBandInfo")],o);export{o as default};
@@ -0,0 +1,5 @@
1
+ /*
2
+ All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
+ See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
+ */
5
+ import{__decorate as t}from"tslib";import e from"../../core/Logger.js";import{getMetersPerUnitForSR as o}from"../../core/unitUtils.js";import{property as n}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/RandomLCG.js";import{subclass as i}from"../../core/accessorSupport/decorators/subclass.js";import s from"../../geometry/SpatialReference.js";import{toExtent as r,create as l,containsXY as a}from"../../geometry/support/aaBoundingRect.js";import m from"./ElevationSampler.js";let p=class extends m{get spatialReference(){return this.extent.spatialReference}constructor(t){const e=t.noDataValue,o="tiles"in t?t.tiles.map(o=>new c({tile:o,tileInfo:t.tileInfo,noDataValue:e})):t.samplers;super({noDataValue:e,samplers:o});const n=o[0];if(n){this.extent=n.extent.clone();const{min:t,max:e}=n.demResolution;this.demResolution={min:t,max:e};for(let n=1;n<o.length;n++){const t=o[n];this.extent.union(t.extent),this.demResolution.min=Math.min(this.demResolution.min,t.demResolution.min),this.demResolution.max=Math.max(this.demResolution.max,t.demResolution.max)}}else{const e="tileInfo"in t?t.tileInfo:null;this.extent=r(l(),e?.spatialReference??s.WGS84),this.demResolution={min:0,max:0}}}elevationAt(t,o){let n;for(const e of this.samplers)if(e.containsAt(t,o)&&(n=e.elevationAt(t,o),n!==e.noDataValue))return n;return null!=n?n:(e.getLogger(this).warn("#elevationAt()",`Point used to sample elevation (${t}, ${o}) is outside of the sampler`),this.noDataValue)}};t([n({constructOnly:!0})],p.prototype,"noDataValue",void 0),t([n({constructOnly:!0})],p.prototype,"samplers",void 0),p=t([i("esri.layers.support.TileElevationSampler")],p);let c=class extends m{get spatialReference(){return this.extent.spatialReference}constructor(t){super(t);const e=t.tile.key.extent;this.extent=r(e,t.tileInfo.spatialReference),this.extent.zmin=t.tile.zmin,this.extent.zmax=t.tile.zmax;const n=o(t.tileInfo.spatialReference),i=t.tileInfo.lodAt(t.tile.key.level).resolution*n;this.demResolution={min:i,max:i}}contains(t){const e=this.projectIfRequired(t,this.spatialReference);return null!=e&&this.containsAt(e.x,e.y)}containsAt(t,e){return a(this.tile.key.extent,t,e)}elevationAt(t,e){return this.containsAt(t,e)?this.tile.sample(t,e)??this.noDataValue:this.noDataValue}};t([n({constructOnly:!0})],c.prototype,"tile",void 0),t([n({constructOnly:!0})],c.prototype,"noDataValue",void 0),t([n({constructOnly:!0})],c.prototype,"tileInfo",void 0),c=t([i("esri.layers.support.TileElevationSampler.SingleTileElevationSampler")],c);export{p as TileElevationSampler};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import{JSONMap as t}from"../../core/jsonMap.js";import{JSONSupport as o}from"../../core/JSONSupport.js";import{getMetersPerUnitForSR as s}from"../../core/unitUtils.js";import{property as r}from"../../core/accessorSupport/decorators/property.js";import{Integer as i}from"../../core/accessorSupport/ensureType.js";import"../../core/has.js";import"../../core/RandomLCG.js";import{reader as l}from"../../core/accessorSupport/decorators/reader.js";import{subclass as n}from"../../core/accessorSupport/decorators/subclass.js";import{writer as p}from"../../core/accessorSupport/decorators/writer.js";import a from"../../geometry/Point.js";import c from"../../geometry/SpatialReference.js";import{create as u}from"../../geometry/support/aaBoundingRect.js";import{isValid as f,getInfo as h,isGeographic as m,equals as d}from"../../geometry/support/spatialReferenceUtils.js";import{project as g}from"../../geometry/support/webMercatorUtils.js";import y from"./LOD.js";import{TileKey as v}from"./TileKey.js";var w;const z=new t({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 j=class extends o{static{w=this}static create(e={}){const{resolutionFactor:t=1,scales:o,size:r=256,spatialReference:i=c.WebMercator,numLODs:l=24}=e;if(!f(i)){const e=[];if(o)for(let t=0;t<o.length;t++){const s=o[t];e.push(new y({level:t,scale:s,resolution:s}))}else{let t=5e-4;for(let o=l-1;o>=0;o--)e.unshift(new y({level:o,scale:t,resolution:t})),t*=2}return new w({dpi:96,lods:e,origin:new a(0,0,i),size:[r,r],spatialReference:i})}const n=h(i),p=e.origin?new a({x:e.origin.x,y:e.origin.y,spatialReference:i}):new a(n?{x:n.origin[0],y:n.origin[1],spatialReference:i}:{x:0,y:0,spatialReference:i}),u=96,d=1/(s(i)*39.37*u),g=[];if(o)for(let s=0;s<o.length;s++){const e=o[s],t=e*d;g.push(new y({level:s,scale:e,resolution:t}))}else{let e=m(i)?512/r*591657527.5917094:256/r*591657527.591555;const o=Math.ceil(l/t);g.push(new y({level:0,scale:e,resolution:e*d}));for(let s=1;s<o;s++){const o=e/2**t,r=o*d;g.push(new y({level:s,scale:o,resolution:r})),e=o}}return new w({dpi:u,lods:g,origin:p,size:[r,r],spatialReference:i})}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 o=h(e);return e.isWrappable&&!!o&&Math.abs(o.origin[0]-t.x)<=o.dx}return!1}readOrigin(e,t){return a.fromJSON({spatialReference:t.spatialReference,...e})}set lods(e){let t=0,o=0;const s=[],r=this._levelToLOD={};e&&(t=-1/0,o=1/0,e.forEach(e=>{s.push(e.scale),t=e.scale>t?e.scale:t,o=e.scale<o?e.scale:o,r[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 o=Math.floor(e),s=o+1;return t[o]/(t[o]/t[s])**(e-o)}scaleToZoom(e){const t=this.scales,o=t.length-1;let s=0;for(;s<o;s++){const o=t[s],r=t[s+1];if(o<=e)return s;if(r===e)return s+1;if(o>e&&r<e)return s+Math.log(o/e)/Math.log(o/r)}return s}tileAt(e,t,o,s){const r=this.lodAt(e);if(!r)return null;let i,l;if("number"==typeof t)i=t,l=o;else if(d(t.spatialReference,this.spatialReference))i=t.x,l=t.y,s=o;else{const e=g(t,this.spatialReference);if(null==e)return null;i=e.x,l=e.y,s=o}const n=r.resolution*this.size[0],p=r.resolution*this.size[1];return s||(s=new v(null,0,0,0,u())),s.level=e,s.row=Math.floor((this.origin.y-l)/p+.001),s.col=Math.floor((i-this.origin.x)/n+.001),this.updateTileInfo(s),s}updateTileInfo(e,t=0){let o=this.lodAt(e.level);if(!o&&1===t){const t=this.lods[this.lods.length-1];t.level<e.level&&(o=t)}if(!o)return;const s=e.level-o.level,r=o.resolution*this.size[0]/2**s,i=o.resolution*this.size[1]/2**s;e.id=`${e.level}/${e.row}/${e.col}`,e.extent||(e.extent=u()),e.extent[0]=this.origin.x+e.col*r,e.extent[1]=this.origin.y-(e.row+1)*i,e.extent[2]=e.extent[0]+r,e.extent[3]=e.extent[1]+i}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 o=this.lodAt(t.level);if(null==o)return null;const{resolution:s}=o,r=s*this.size[0],i=s*this.size[1];return e[0]=this.origin.x+t.col*r,e[1]=this.origin.y-(t.row+1)*i,e[2]=e[0]+r,e[3]=e[1]+i,e}lodAt(e){return this._levelToLOD?.[e]??null}clone(){return w.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 o=[],s=this.lods.length-t;for(let r=0;r<s;r++){const e=r+t,{scale:s,resolution:i}=e>=0?this.lods[e]:{scale:2*this.lods[0].scale,resolution:2*this.lods[0].resolution};o.push(new y({level:r,scale:s,resolution:i}))}return new w({size:[e,e],dpi:this.dpi,format:this.format,compressionQuality:this.compressionQuality,origin:this.origin,spatialReference:this.spatialReference,lods:o})}_initializeUpsampleLevels(){const e=this.lods;this._upsampleLevels=[];let t=null;for(let o=0;o<e.length;o++){const s=e[o];this._upsampleLevels[s.level]={parentLevel:t?t.level:-1,factor:t?t.resolution/s.resolution:0},t=s}}};e([r({type:Number,json:{write:!0}})],j.prototype,"compressionQuality",void 0),e([r({type:Number,json:{write:!0}})],j.prototype,"dpi",void 0),e([r({type:String,json:{read:z.read,write:z.write,origins:{"web-scene":{read:!1,write:!1}}}})],j.prototype,"format",void 0),e([r({readOnly:!0})],j.prototype,"isWrappable",null),e([r({type:a,json:{write:!0}})],j.prototype,"origin",void 0),e([l("origin")],j.prototype,"readOrigin",null),e([r({type:[y],value:null,json:{write:!0}})],j.prototype,"lods",null),e([r({readOnly:!0})],j.prototype,"scales",void 0),e([r({cast:e=>Array.isArray(e)?e:"number"==typeof e?[e,e]:[256,256]})],j.prototype,"size",void 0),e([l("size",["rows","cols"])],j.prototype,"readSize",null),e([p("size",{cols:{type:i},rows:{type:i}})],j.prototype,"writeSize",null),e([r({type:c,json:{write:!0}})],j.prototype,"spatialReference",void 0),j=w=e([n("esri.layers.support.TileInfo")],j);export{j as default};
5
+ import{__decorate as e}from"tslib";import{JSONMap as t}from"../../core/jsonMap.js";import{JSONSupport as s}from"../../core/JSONSupport.js";import{getMetersPerUnitForSR as o}from"../../core/unitUtils.js";import{property as r}from"../../core/accessorSupport/decorators/property.js";import{Integer as i}from"../../core/accessorSupport/ensureType.js";import"../../core/has.js";import"../../core/RandomLCG.js";import{reader as l}from"../../core/accessorSupport/decorators/reader.js";import{subclass as n}from"../../core/accessorSupport/decorators/subclass.js";import{writer as p}from"../../core/accessorSupport/decorators/writer.js";import a from"../../geometry/Point.js";import c from"../../geometry/SpatialReference.js";import{isValid as u,getInfo as f,isGeographic as h,equals as m}from"../../geometry/support/spatialReferenceUtils.js";import{project as d}from"../../geometry/support/webMercatorUtils.js";import g from"./LOD.js";import{TileKey as y}from"./TileKey.js";var v;const w=new t({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 z=class extends s{static{v=this}static create(e={}){const{resolutionFactor:t=1,scales:s,size:r=256,spatialReference:i=c.WebMercator,numLODs:l=24}=e;if(!u(i)){const e=[];if(s)for(let t=0;t<s.length;t++){const o=s[t];e.push(new g({level:t,scale:o,resolution:o}))}else{let t=5e-4;for(let s=l-1;s>=0;s--)e.unshift(new g({level:s,scale:t,resolution:t})),t*=2}return new v({dpi:96,lods:e,origin:new a(0,0,i),size:[r,r],spatialReference:i})}const n=f(i),p=e.origin?new a({x:e.origin.x,y:e.origin.y,spatialReference:i}):new a(n?{x:n.origin[0],y:n.origin[1],spatialReference:i}:{x:0,y:0,spatialReference:i}),m=96,d=1/(o(i)*39.37*m),y=[];if(s)for(let o=0;o<s.length;o++){const e=s[o],t=e*d;y.push(new g({level:o,scale:e,resolution:t}))}else{let e=h(i)?512/r*591657527.5917094:256/r*591657527.591555;const s=Math.ceil(l/t);y.push(new g({level:0,scale:e,resolution:e*d}));for(let o=1;o<s;o++){const s=e/2**t,r=s*d;y.push(new g({level:o,scale:s,resolution:r})),e=s}}return new v({dpi:m,lods:y,origin:p,size:[r,r],spatialReference:i})}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 s=f(e);return e.isWrappable&&!!s&&Math.abs(s.origin[0]-t.x)<=s.dx}return!1}readOrigin(e,t){return a.fromJSON({spatialReference:t.spatialReference,...e})}set lods(e){let t=0,s=0;const o=[],r=this._levelToLOD={};e&&(t=-1/0,s=1/0,e.forEach(e=>{o.push(e.scale),t=e.scale>t?e.scale:t,s=e.scale<s?e.scale:s,r[e.level]=e})),this._set("scales",o),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 s=Math.floor(e),o=s+1;return t[s]/(t[s]/t[o])**(e-s)}scaleToZoom(e){const t=this.scales,s=t.length-1;let o=0;for(;o<s;o++){const s=t[o],r=t[o+1];if(s<=e)return o;if(r===e)return o+1;if(s>e&&r<e)return o+Math.log(s/e)/Math.log(s/r)}return o}tileAt(e,t,s,o){const r=this.lodAt(e);if(!r)return null;let i,l;if("number"==typeof t)i=t,l=s;else if(m(t.spatialReference,this.spatialReference))i=t.x,l=t.y,o=s;else{const e=d(t,this.spatialReference);if(null==e)return null;i=e.x,l=e.y,o=s}const n=r.resolution*this.size[0],p=r.resolution*this.size[1];return o??=new y(0,0,0),o.level=e,o.row=Math.floor((this.origin.y-l)/p+.001),o.col=Math.floor((i-this.origin.x)/n+.001),this.updateTileInfo(o),o}updateTileInfo(e,t=0){if(!("extent"in e))return!1;let s=this.lodAt(e.level);if(!s&&1===t){const t=this.lods[this.lods.length-1];t.level<e.level&&(s=t)}if(!s)return!1;const o=e.level-s.level,r=s.resolution*this.size[0]/2**o,i=s.resolution*this.size[1]/2**o;return e.extent[0]=this.origin.x+e.col*r,e.extent[1]=this.origin.y-(e.row+1)*i,e.extent[2]=e.extent[0]+r,e.extent[3]=e.extent[1]+i,!0}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 s=this.lodAt(t.level);if(null==s)return null;const{resolution:o}=s,r=o*this.size[0],i=o*this.size[1];return e[0]=this.origin.x+t.col*r,e[1]=this.origin.y-(t.row+1)*i,e[2]=e[0]+r,e[3]=e[1]+i,e}lodAt(e){return this._levelToLOD?.[e]??null}clone(){return v.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 s=[],o=this.lods.length-t;for(let r=0;r<o;r++){const e=r+t,{scale:o,resolution:i}=e>=0?this.lods[e]:{scale:2*this.lods[0].scale,resolution:2*this.lods[0].resolution};s.push(new g({level:r,scale:o,resolution:i}))}return new v({size:[e,e],dpi:this.dpi,format:this.format,compressionQuality:this.compressionQuality,origin:this.origin,spatialReference:this.spatialReference,lods:s})}_initializeUpsampleLevels(){const e=this.lods;this._upsampleLevels=[];let t=null;for(let s=0;s<e.length;s++){const o=e[s];this._upsampleLevels[o.level]={parentLevel:t?t.level:-1,factor:t?t.resolution/o.resolution:0},t=o}}};e([r({type:Number,json:{write:!0}})],z.prototype,"compressionQuality",void 0),e([r({type:Number,json:{write:!0}})],z.prototype,"dpi",void 0),e([r({type:String,json:{read:w.read,write:w.write,origins:{"web-scene":{read:!1,write:!1}}}})],z.prototype,"format",void 0),e([r({readOnly:!0})],z.prototype,"isWrappable",null),e([r({type:a,json:{write:!0}})],z.prototype,"origin",void 0),e([l("origin")],z.prototype,"readOrigin",null),e([r({type:[g],value:null,json:{write:!0}})],z.prototype,"lods",null),e([r({readOnly:!0})],z.prototype,"scales",void 0),e([r({cast:e=>Array.isArray(e)?e:"number"==typeof e?[e,e]:[256,256]})],z.prototype,"size",void 0),e([l("size",["rows","cols"])],z.prototype,"readSize",null),e([p("size",{cols:{type:i},rows:{type:i}})],z.prototype,"writeSize",null),e([r({type:c,json:{write:!0}})],z.prototype,"spatialReference",void 0),z=v=e([n("esri.layers.support.TileInfo")],z);export{z as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- class t{constructor(t,s,i,o,e=void 0){this.id=t,this.level=s,this.row=i,this.col=o,this.extent=e}}export{t as TileKey};
5
+ import{create as t}from"../../geometry/support/aaBoundingRect.js";class e{constructor(e,l,i,s=t()){this._level=e,this._row=l,this._col=i,this.extent=s}get id(){return this._id??=`${this.level}/${this.row}/${this.col}`,this._id}get level(){return this._level}set level(t){this._level=t,this._id=null}get row(){return this._row}set row(t){this._row=t,this._id=null}get col(){return this._col}set col(t){this._col=t,this._id=null}toJSON(){return{level:this._level,row:this._row,col:this._col,extent:this.extent}}static fromJSON(t){return new e(t.level,t.row,t.col,t.extent)}}export{e as TileKey};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import t from"../../request.js";import i from"../../core/Accessor.js";import r from"../../core/Error.js";import{makeHandle as s}from"../../core/handleUtils.js";import"../../core/has.js";import{LRUCache as l}from"../../core/LRUCache.js";import o from"../../core/PooledArray.js";import{isAbortError as a,isAborted as n,onAbort as c,createAbortError as h}from"../../core/promiseUtils.js";import{watch as p,initial as m}from"../../core/reactiveUtils.js";import{waitTicks as f}from"../../core/scheduling.js";import{objectToQuery as u}from"../../core/urlUtils.js";import{property as v}from"../../core/accessorSupport/decorators/property.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{subclass as y}from"../../core/accessorSupport/decorators/subclass.js";import{TileKey as d}from"./TileKey.js";import{Tilemap as _,tilemapDefinitionId as b}from"./Tilemap.js";var g;function w(e,t,i){return new r("tile-map:tile-unavailable","Tile is not available",{level:e,row:t,col:i})}let j=class extends i{static{g=this}constructor(e){super(e),this._pendingTilemapRequests={},this.request=t,this.size=32,this._prefetchingEnabled=!0}initialize(){this._tilemapCache=new l(2097152),this.addHandles(p(()=>{const{layer:e}=this;return[e?.parsedUrl,e?.tileServers,e?.apiKey,e?.customParameters]},()=>this._initializeTilemapDefinition(),m))}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 r=this._tilemapFromCache(e,t,i,this._tmpTilemapDefinition);return r?r.getAvailability(t,i):"unknown"}fetchAvailability(e,t,i,r){return!this.layer.tileInfo.lodAt(e)||e<this.effectiveMinLOD||e>this.effectiveMaxLOD?Promise.reject(w(e,t,i)):this._fetchTilemap(e,t,i,r).catch(e=>e).then(r=>{if(r instanceof _){const s=r.getAvailability(t,i);if("unavailable"===s)throw w(e,t,i);return s}if(a(r))throw r;return"unknown"})}fetchAvailabilityUpsample(e,t,i,r,s){r.level=e,r.row=t,r.col=i;const l=this.layer.tileInfo;l.updateTileInfo(r);const o=this.fetchAvailability(e,t,i,s).catch(e=>{if(a(e))throw e;if(l.upsampleTile(r))return this.fetchAvailabilityUpsample(r.level,r.row,r.col,r,s);throw e});return this._fetchAvailabilityUpsamplePrefetch(r.id,e,t,i,s,o),o}async _fetchAvailabilityUpsamplePrefetch(e,t,i,r,l,o){if(!this._prefetchingEnabled||null==e)return;const a=`prefetch-${e}`;if(this.hasHandles(a))return;const c=new AbortController;o.then(()=>c.abort(),()=>c.abort());let h=!1;const p=s(()=>{h||(h=!0,c.abort())});if(this.addHandles(p,a),await f(10,c.signal).catch(()=>{}),h||(h=!0,this.removeHandles(a)),n(c))return;const m=new d(e,t,i,r),u={...l,signal:c.signal},v=this.layer.tileInfo;for(let s=0;g._prefetches.length<g._maxPrefetch&&v.upsampleTile(m);++s){const e=this.fetchAvailability(m.level,m.row,m.col,u);g._prefetches.push(e);const t=()=>{g._prefetches.removeUnordered(e)};e.then(t,t)}}static{this._maxPrefetch=4}static{this._prefetches=new o({initialSize:g._maxPrefetch})}static cleanupTilemapCache(){this._prefetches.prune()}_fetchTilemap(e,t,i,s){if(!this.layer.tileInfo.lodAt(e)||e<this.effectiveMinLOD||e>this.effectiveMaxLOD)return Promise.reject(new r("tilemap-cache:level-unavailable",`Level ${e} is unavailable in the service`));const l=this._tmpTilemapDefinition,o=this._tilemapFromCache(e,t,i,l);if(o)return Promise.resolve(o);const a=s?.signal;return s={...s,signal:null},new Promise((e,t)=>{c(a,()=>t(h()));const i=b(l);let r=this._pendingTilemapRequests[i];if(!r){r=_.fromDefinition(l,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:u({...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,r){r.level=e,r.row=t-t%this.size,r.col=i-i%this.size;const s=b(r);return this._tilemapCache.get(s)}get test(){}};e([v({constructOnly:!0})],j.prototype,"layer",void 0),e([v({constructOnly:!0})],j.prototype,"minLOD",void 0),e([v({constructOnly:!0})],j.prototype,"maxLOD",void 0),e([v({constructOnly:!0})],j.prototype,"request",void 0),e([v({constructOnly:!0})],j.prototype,"size",void 0),j=g=e([y("esri.layers.support.TilemapCache")],j);export{j as TilemapCache};
5
+ import{__decorate as e}from"tslib";import t from"../../request.js";import i from"../../core/Accessor.js";import r from"../../core/Error.js";import{makeHandle as s}from"../../core/handleUtils.js";import"../../core/has.js";import{LRUCache as l}from"../../core/LRUCache.js";import o from"../../core/PooledArray.js";import{isAbortError as a,isAborted as n,onAbort as c,createAbortError as h}from"../../core/promiseUtils.js";import{watch as p,initial as m}from"../../core/reactiveUtils.js";import{waitTicks as f}from"../../core/scheduling.js";import{objectToQuery as u}from"../../core/urlUtils.js";import{property as v}from"../../core/accessorSupport/decorators/property.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{subclass as y}from"../../core/accessorSupport/decorators/subclass.js";import{TileKey as d}from"./TileKey.js";import{Tilemap as _,tilemapDefinitionId as b}from"./Tilemap.js";var g;function w(e,t,i){return new r("tile-map:tile-unavailable","Tile is not available",{level:e,row:t,col:i})}let j=class extends i{static{g=this}constructor(e){super(e),this._pendingTilemapRequests={},this.request=t,this.size=32,this._prefetchingEnabled=!0}initialize(){this._tilemapCache=new l(2097152),this.addHandles(p(()=>{const{layer:e}=this;return[e?.parsedUrl,e?.tileServers,e?.apiKey,e?.customParameters]},()=>this._initializeTilemapDefinition(),m))}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 r=this._tilemapFromCache(e,t,i,this._tmpTilemapDefinition);return r?r.getAvailability(t,i):"unknown"}fetchAvailability(e,t,i,r){return!this.layer.tileInfo.lodAt(e)||e<this.effectiveMinLOD||e>this.effectiveMaxLOD?Promise.reject(w(e,t,i)):this._fetchTilemap(e,t,i,r).catch(e=>e).then(r=>{if(r instanceof _){const s=r.getAvailability(t,i);if("unavailable"===s)throw w(e,t,i);return s}if(a(r))throw r;return"unknown"})}fetchAvailabilityUpsample(e,t,i,r,s){r.level=e,r.row=t,r.col=i;const l=this.layer.tileInfo;l.updateTileInfo(r);const o=this.fetchAvailability(e,t,i,s).catch(e=>{if(a(e))throw e;if(l.upsampleTile(r))return this.fetchAvailabilityUpsample(r.level,r.row,r.col,r,s);throw e});return this._fetchAvailabilityUpsamplePrefetch(e,t,i,s,o),o}async _fetchAvailabilityUpsamplePrefetch(e,t,i,r,l){if(!this._prefetchingEnabled)return;const o=`prefetch-${e}-${t}-${i}`;if(this.hasHandles(o))return;const a=new AbortController;l.then(()=>a.abort(),()=>a.abort());let c=!1;const h=s(()=>{c||(c=!0,a.abort())});if(this.addHandles(h,o),await f(10,a.signal).catch(()=>{}),c||(c=!0,this.removeHandles(o)),n(a))return;const p=new d(e,t,i),m={...r,signal:a.signal},u=this.layer.tileInfo;for(let s=0;g._prefetches.length<g._maxPrefetch&&u.upsampleTile(p);++s){const e=this.fetchAvailability(p.level,p.row,p.col,m);g._prefetches.push(e);const t=()=>{g._prefetches.removeUnordered(e)};e.then(t,t)}}static{this._maxPrefetch=4}static{this._prefetches=new o({initialSize:g._maxPrefetch})}static cleanupTilemapCache(){this._prefetches.prune()}_fetchTilemap(e,t,i,s){if(!this.layer.tileInfo.lodAt(e)||e<this.effectiveMinLOD||e>this.effectiveMaxLOD)return Promise.reject(new r("tilemap-cache:level-unavailable",`Level ${e} is unavailable in the service`));const l=this._tmpTilemapDefinition,o=this._tilemapFromCache(e,t,i,l);if(o)return Promise.resolve(o);const a=s?.signal;return s={...s,signal:null},new Promise((e,t)=>{c(a,()=>t(h()));const i=b(l);let r=this._pendingTilemapRequests[i];if(!r){r=_.fromDefinition(l,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:u({...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,r){r.level=e,r.row=t-t%this.size,r.col=i-i%this.size;const s=b(r);return this._tilemapCache.get(s)}get test(){}};e([v({constructOnly:!0})],j.prototype,"layer",void 0),e([v({constructOnly:!0})],j.prototype,"minLOD",void 0),e([v({constructOnly:!0})],j.prototype,"maxLOD",void 0),e([v({constructOnly:!0})],j.prototype,"request",void 0),e([v({constructOnly:!0})],j.prototype,"size",void 0),j=g=e([y("esri.layers.support.TilemapCache")],j);export{j as TilemapCache};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{id as e}from"../../kernel.js";import t from"../../request.js";import n from"../../core/Collection.js";import"../../core/urlUtils.js";import{isLayerFromCatalog as r}from"../catalog/catalogUtils.js";import{isBasemap as i}from"../../support/userTypeGuards/isBasemap.js";function u(e){return d(e)||y(e)}function o(e){return null!=e&&"object"==typeof e&&"type"in e&&"feature"===e.type}function s(e){return null!=e&&"object"==typeof e&&"type"in e&&"graphics"===e.type}function c(e){return null!=e&&"object"==typeof e&&"type"in e&&"map-image"===e.type}function a(e){return null!=e&&"object"==typeof e&&"type"in e&&"map-notes"===e.type&&"sublayers"in e}function l(e){return null!=e&&"object"==typeof e&&"type"in e&&"knowledge-graph"===e.type&&"layers"in e}function f(e){return null!=e&&"object"==typeof e&&"type"in e&&"knowledge-graph-sublayer"===e.type}function p(e){return null!=e&&"object"==typeof e&&"type"in e&&"link-chart"===e.type&&"layers"in e}function y(e){return"scene"===e?.type}function g(e){return null!=e&&"object"==typeof e&&"type"in e&&"subtype-group"===e.type&&"sublayers"in e}function b(e){return"subtype-sublayer"===e?.type}function d(e){const t=e?.type;return"imagery-tile"===t||"tile"===t||"open-street-map"===t||"vector-tile"===t||"web-tile"===t||"wmts"===t}function m(e){const t=e?.type;return"base-tile"===t||"tile"===t||"elevation"===t||"imagery-tile"===t||"base-elevation"===t||"open-street-map"===t||"wcs"===t||"web-tile"===t||"wmts"===t||"vector-tile"===t}function h(e){return null!=e&&"type"in e&&"group"===e.type}const j={Point:"SceneLayer","3DObject":"SceneLayer",IntegratedMesh:"IntegratedMeshLayer",PointCloud:"PointCloudLayer",Building:"BuildingSceneLayer"};function v(e){const t=e?.type;return"building-scene"===t||"integrated-mesh"===t||"point-cloud"===t||"scene"===t}function w(e){return"IntegratedMeshLayer"===e||"IntegratedMesh3DTilesLayer"===e}function L(e){return"integrated-mesh"===e||"integrated-mesh-3dtiles"===e}function S(e){return"integrated-mesh-3dtiles"===e}function E(e){return"voxel"===e?.type}function C(e){return"imagery-tile"===e?.type}function M(e,t){return i(e?.parent)&&e.parent[t].includes(e)}function T(e){return M(e,"baseLayers")}function k(e){return M(e,"referenceLayers")}function x(e){return"feature"===e?.type&&!e.url&&"memory"===e.source?.type}function I(e){const t=e?.type;return("feature"===t||"subtype-group"===t||"oriented-imagery"===t)&&"feature-layer"===e?.source?.type}function U(e){return"feature"===e?.type&&"feature-layer"===e.source?.type}function O(e){const t=/[:;]/,n=[];let r=!1;if(e&&(e.forEach((e,i)=>{n.push([i,e]),!r&&t.test(e)&&(r=!0)}),n.length>0)){let e;if(r){const t={};n.forEach(e=>{t[e[0]]=e[1]}),e=JSON.stringify(t)}else{const t=[];n.forEach(e=>{t.push(e[0]+":"+e[1])}),e=t.join(";")}return e}return null}function B(e){if(!e)return;const t=[];return e.forEach((e,n)=>{t.push('"'+n+'":'+JSON.stringify(e))}),t.length?"{"+t.join(",")+"}":void 0}function P(e){if(e.activeLayer){const t=e.activeLayer.tileMatrixSet;if(t)return t;const n=e.activeLayer.tileMatrixSets;if(n)return n}return null}async function q(n,r){const i=e?.findServerInfo(n);if(null!=i?.currentVersion)return i.owningSystemUrl||null;const u=n.toLowerCase().indexOf("/rest/services");if(-1===u)return null;const o=`${n.slice(0,u)}/rest/info`,s=null!=r?r.signal:null,{data:c}=await t(o,{query:{f:"json"},responseType:"json",signal:s});return c?.owningSystemUrl||null}function D(e){if(!("capabilities"in e))return!1;switch(e.type){case"catalog":case"catalog-footprint":case"csv":case"feature":case"geojson":case"imagery":case"knowledge-graph-sublayer":case"ogc-feature":case"oriented-imagery":case"scene":case"sublayer":case"subtype-group":case"subtype-sublayer":case"wfs":return!0;default:return!1}}function J(e){return null!=e&&"object"==typeof e&&"isTable"in e&&!!e.isTable}function N(e){return D(e)?"effectiveCapabilities"in e?e.effectiveCapabilities:e.capabilities:null}function F(e){if(!("editingEnabled"in e))return!1;switch(e.type){case"csv":case"feature":case"geojson":case"oriented-imagery":case"scene":case"subtype-group":case"subtype-sublayer":return!0;default:return!1}}function G(e){return!!F(e)&&("effectiveEditingEnabled"in e?e.effectiveEditingEnabled:e.editingEnabled)}function V(e){if(!e)return[];return("subtypes"in e?e.subtypes:g(e.parent)?e.parent.subtypes:[])??[]}function $(e){return("imagery"===e.type||"imagery-tile"===e.type)&&"flow"===e.renderer?.type}function z(e){const t=new n;for(const n of e.allLayers.concat(e.allTables))"csv"===n.type||r(n)||("charts"in n&&t.push(n),"subtype-group"===n.type&&t.push(...n.sublayers));return t}function A(e,t){return null}function H(e){return null}function K(e){return!e||"Feature Service"===e.type&&!e.sourceUrl}function Q(e,t){if(!t||!K(e))return;const n=A(e.url);n&&(e.url=n)}export{Q as applyPreferredHostToPortalItem,G as getEffectiveEditingEnabled,N as getEffectiveLayerCapabilities,z as getLayersWithChartSupport,q as getOwningPortalUrl,H as getPreferredHost,A as getPreferredUrl,V as getSubtypesFromLayer,P as getTileMaxtrixSetFromActiveLayer,T as isBaseLayer,u as isBasemap3DSupportedLayer,d as isBasemapSupportedTiledLayer,x as isFeatureCollectionLayer,o as isFeatureLayer,U as isFeatureServiceLayer,s as isGraphicsLayer,h as isGroupLayer,C as isImageryTileLayer,S as isIntegratedMesh3DTilesLayer,L as isIntegratedMeshLayer,w as isIntegratedMeshOperationalLayer,l as isKnowledgeGraphLayer,f as isKnowledgeGraphSublayer,D as isLayerWithFeatureCapabilities,I as isLayerWithFeatureLayerSource,$ as isLayerWithFlowRenderer,p as isLinkChartLayer,c as isMapImageLayer,a as isMapNotesLayer,K as isPreferredUrlApplicable,k as isReferenceLayer,y as isSceneLayer,v as isSceneServiceLayer,g as isSubtypeGroupLayer,b as isSubtypeSublayer,J as isTable,m as isTiledLayer,E as isVoxelLayer,j as sceneServiceLayerTypeToClassName,O as serializeLayerDefinitions,B as serializeTimeOptions};
5
+ import{id as e}from"../../kernel.js";import t from"../../request.js";import n from"../../core/Collection.js";import"../../core/urlUtils.js";import{isLayerFromCatalog as r}from"../catalog/catalogUtils.js";import{isBasemap as i}from"../../support/userTypeGuards/isBasemap.js";function u(e){return h(e)||y(e)}function o(e){return null!=e&&"object"==typeof e&&"type"in e&&"feature"===e.type}function s(e){return null!=e&&"object"==typeof e&&"type"in e&&"graphics"===e.type}function c(e){return null!=e&&"object"==typeof e&&"type"in e&&"map-image"===e.type}function a(e){return null!=e&&"object"==typeof e&&"type"in e&&"map-notes"===e.type&&"sublayers"in e}function l(e){return null!=e&&"object"==typeof e&&"type"in e&&"knowledge-graph"===e.type&&"layers"in e}function p(e){return null!=e&&"object"==typeof e&&"type"in e&&"knowledge-graph-sublayer"===e.type}function f(e){return null!=e&&"object"==typeof e&&"type"in e&&"link-chart"===e.type&&"layers"in e}function y(e){return"scene"===e?.type}function g(e){return b(e)||S(e)}function b(e){return"elevation"===e.type||"base-elevation"===e.type}function d(e){return null!=e&&"object"==typeof e&&"type"in e&&"subtype-group"===e.type&&"sublayers"in e}function m(e){return"subtype-sublayer"===e?.type}function h(e){const t=e?.type;return"imagery-tile"===t||"tile"===t||"open-street-map"===t||"vector-tile"===t||"web-tile"===t||"wmts"===t}function j(e){const t=e?.type;return"base-tile"===t||"tile"===t||"elevation"===t||"imagery-tile"===t||"base-elevation"===t||"open-street-map"===t||"wcs"===t||"web-tile"===t||"wmts"===t||"vector-tile"===t}function v(e){return null!=e&&"type"in e&&"group"===e.type}const w={Point:"SceneLayer","3DObject":"SceneLayer",IntegratedMesh:"IntegratedMeshLayer",PointCloud:"PointCloudLayer",Building:"BuildingSceneLayer"};function L(e){const t=e?.type;return"building-scene"===t||"integrated-mesh"===t||"point-cloud"===t||"scene"===t}function S(e){return"integrated-mesh"===e.type||"integrated-mesh-3dtiles"===e.type}function E(e){return"integrated-mesh-3dtiles"===e.type}function C(e){return"voxel"===e?.type}function k(e){return"imagery-tile"===e?.type}function x(e,t){return i(e?.parent)&&e.parent[t].includes(e)}function T(e){return x(e,"baseLayers")}function U(e){return x(e,"referenceLayers")}function M(e){return"feature"===e?.type&&!e.url&&"memory"===e.source?.type}function O(e){const t=e?.type;return("feature"===t||"subtype-group"===t||"oriented-imagery"===t)&&"feature-layer"===e?.source?.type}function B(e){return"feature"===e?.type&&"feature-layer"===e.source?.type}function I(e){return o(e)&&B(e)}function P(e){const t=/[:;]/,n=[];let r=!1;if(e&&(e.forEach((e,i)=>{n.push([i,e]),!r&&t.test(e)&&(r=!0)}),n.length>0)){let e;if(r){const t={};n.forEach(e=>{t[e[0]]=e[1]}),e=JSON.stringify(t)}else{const t=[];n.forEach(e=>{t.push(e[0]+":"+e[1])}),e=t.join(";")}return e}return null}function q(e){if(!e)return;const t=[];return e.forEach((e,n)=>{t.push('"'+n+'":'+JSON.stringify(e))}),t.length?"{"+t.join(",")+"}":void 0}function J(e){if(e.activeLayer){const t=e.activeLayer.tileMatrixSet;if(t)return t;const n=e.activeLayer.tileMatrixSets;if(n)return n}return null}async function N(n,r){const i=e?.findServerInfo(n);if(null!=i?.currentVersion)return i.owningSystemUrl||null;const u=n.toLowerCase().indexOf("/rest/services");if(-1===u)return null;const o=`${n.slice(0,u)}/rest/info`,s=null!=r?r.signal:null,{data:c}=await t(o,{query:{f:"json"},responseType:"json",signal:s});return c?.owningSystemUrl||null}function D(e){if(!("capabilities"in e))return!1;switch(e.type){case"catalog":case"catalog-footprint":case"csv":case"feature":case"geojson":case"imagery":case"knowledge-graph-sublayer":case"ogc-feature":case"oriented-imagery":case"scene":case"sublayer":case"subtype-group":case"subtype-sublayer":case"wfs":return!0;default:return!1}}function F(e){return null!=e&&"object"==typeof e&&"isTable"in e&&!!e.isTable}function G(e){return D(e)?"effectiveCapabilities"in e?e.effectiveCapabilities:e.capabilities:null}function V(e){if(!("editingEnabled"in e))return!1;switch(e.type){case"csv":case"feature":case"geojson":case"oriented-imagery":case"scene":case"subtype-group":case"subtype-sublayer":return!0;default:return!1}}function $(e){return!!V(e)&&("effectiveEditingEnabled"in e?e.effectiveEditingEnabled:e.editingEnabled)}function z(e){if(!e)return[];return("subtypes"in e?e.subtypes:d(e.parent)?e.parent.subtypes:[])??[]}function A(e){return("imagery"===e.type||"imagery-tile"===e.type)&&"flow"===e.renderer?.type}function H(e){const t=new n;for(const n of e.allLayers.concat(e.allTables))"csv"===n.type||r(n)||("charts"in n&&t.push(n),"subtype-group"===n.type&&t.push(...n.sublayers));return t}function K(e,t){return null}function Q(e){return null}function R(e){return!e||"Feature Service"===e.type&&!e.sourceUrl}function W(e,t){if(!t||!R(e))return;const n=K(e.url);n&&(e.url=n)}export{W as applyPreferredHostToPortalItem,$ as getEffectiveEditingEnabled,G as getEffectiveLayerCapabilities,H as getLayersWithChartSupport,N as getOwningPortalUrl,Q as getPreferredHost,K as getPreferredUrl,z as getSubtypesFromLayer,J as getTileMaxtrixSetFromActiveLayer,T as isBaseLayer,u as isBasemap3DSupportedLayer,h as isBasemapSupportedTiledLayer,b as isElevationLayer,M as isFeatureCollectionLayer,o as isFeatureLayer,B as isFeatureServiceLayer,s as isGraphicsLayer,g as isGroundElevationLayer,v as isGroupLayer,k as isImageryTileLayer,E as isIntegratedMesh3DTilesLayer,S as isIntegratedMeshLayer,l as isKnowledgeGraphLayer,p as isKnowledgeGraphSublayer,D as isLayerWithFeatureCapabilities,O as isLayerWithFeatureLayerSource,A as isLayerWithFlowRenderer,f as isLinkChartLayer,c as isMapImageLayer,a as isMapNotesLayer,R as isPreferredUrlApplicable,U as isReferenceLayer,y as isSceneLayer,L as isSceneServiceLayer,d as isSubtypeGroupLayer,m as isSubtypeSublayer,F as isTable,j as isTiledLayer,C as isVoxelLayer,w as sceneServiceLayerTypeToClassName,P as serializeLayerDefinitions,q as serializeTimeOptions,I as supportsFieldConfiguration};
@@ -0,0 +1,5 @@
1
+ /*
2
+ All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
+ See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
+ */
5
+ import o from"./ParquetEncodingLocation.js";import r from"./ParquetEncodingWkb.js";function t(t){switch(t.type){case"wkb":return r.fromJSON(t);case"location":return o.fromJSON(t)}}export{t as fromParquetEncodingJSON};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import e from"../../core/Collection.js";import t from"../../core/Error.js";import{JSONMap as o}from"../../core/jsonMap.js";import i from"../../geometry/SpatialReference.js";import n from"./Field.js";import{inferLocationInfo as r}from"./locationUtils.js";import l from"./ParquetEncodingLocation.js";import s from"./ParquetEncodingWkb.js";import{createParquetFile as a,readGeoMetadata as m,readEsriMetadata as u}from"../../libs/parquet/parquet.js";const c=new o({esriGeometryPoint:"point",esriGeometryPolygon:"polygon",esriGeometryPolyline:"polyline",esriGeometryMultipoint:"multipoint"});function p(e){return c.toJSON(e)}function f(t,o={}){return d({urls:new e(t)},o)}async function d(e,o={}){if(e.geometryType&&e.spatialReference&&e.encoding&&e.fields)return e;if(e.urls.length<1)throw new t("parquet:bad-input","At least one url must be specified",e);const r=await a(e.urls.getItemAt(0),{getCustomParameters:()=>o.customParameters}),l=m(r),s={...e,file:r};null==s.fields&&(s.fields=r.fields().map(e=>n.fromJSON({name:e.name,type:e.type}))),null==s.encoding&&(s.encoding=y(l,s.fields));const c=u(r);if(c)switch(c.mode){case"z":s.displayOptimization={mode:"z"};break;case"xz":{const e=c.multiscale;if(!e)throw new t("bad-format","XZ display optimization requires multiscale geometries");s.displayOptimization={mode:"xz",multiscale:e};break}}if(!s.encoding)return s;switch(s.encoding.type){case"location":null==s.spatialReference&&(s.spatialReference=i.WGS84),null==s.geometryType&&(s.geometryType="point");break;case"wkb":{if(!l)return s;const e=l.primary_column,t=l.columns[e];if(s.geometryType||(s.geometryType=w(t)),s.spatialReference||(s.spatialReference=P(t)),s.fields)for(const o of Object.keys(l.columns))s.fields=s.fields.filter(e=>e.name!==o)}}return s}function y(e,t){if(null!=e){const t=e.primary_column,o=e.columns[t];return new s({primaryFieldName:t,orientation:o.orientation??null})}const o=r(t.map(e=>e.name));return o.latitudeFieldName&&o.latitudeFieldName?new l({latitudeFieldName:o.latitudeFieldName,longitudeFieldName:o.longitudeFieldName}):null}function g(e){switch(e){case"Point":return"point";case"Polygon":case"MultiPolygon":return"polygon";case"LineString":return"polyline";case"MultiPoint":return"multipoint";default:return null}}function w(e){const{geometry_types:o}=e,i=new Set;for(const t of o){const e=g(t);e&&i.add(e)}if(i.size>1)throw new t("unsupported","Parquet mixed geometry types are not support",{geometryTypes:i});return 1===i.size?i.values().next().value:void 0}function P(e){const t=e.crs?.id?.code;return t&&"number"==typeof t?new i({wkid:t}):void 0}export{d as completeParquetLayerInfo,f as getParquetLayerInfo,c as parquetGeometryTypeKebabDict,p as toParquetJSONGeometryType};
5
+ import e from"../../core/Collection.js";import t from"../../core/Error.js";import{JSONMap as o}from"../../core/jsonMap.js";import n from"../../geometry/SpatialReference.js";import i from"./Field.js";import{inferLocationInfo as r}from"./locationUtils.js";import l from"./ParquetEncodingLocation.js";import s from"./ParquetEncodingWkb.js";import{createParquetFile as a,readGeoMetadata as m,readEsriMetadata as u}from"../../libs/parquet/parquet.js";const c=new o({esriGeometryPoint:"point",esriGeometryPolygon:"polygon",esriGeometryPolyline:"polyline",esriGeometryMultipoint:"multipoint"});function p(e){return c.toJSON(e)}function f(e){return c.fromJSON(e)}function d(t,o={}){return y({urls:new e(t)},o)}async function y(e,o={}){if(e.geometryType&&e.spatialReference&&e.encoding&&e.fields)return e;if(e.urls.length<1)throw new t("parquet:bad-input","At least one url must be specified",e);const r=await a(e.urls.getItemAt(0),{getCustomParameters:()=>o.customParameters}),l=m(r),s={...e,file:r};null==s.fields&&(s.fields=r.fields().map(e=>i.fromJSON({name:e.name,type:e.type}))),null==s.encoding&&(s.encoding=g(l,s.fields));const c=u(r);if(c)switch(c.mode){case"z":s.displayOptimization={mode:"z"};break;case"xz":{const e=c.multiscale;if(!e)throw new t("bad-format","XZ display optimization requires multiscale geometries");s.displayOptimization={mode:"xz",multiscale:e};break}}if(!s.encoding)return s;switch(s.encoding.type){case"location":null==s.spatialReference&&(s.spatialReference=n.WGS84),null==s.geometryType&&(s.geometryType="point");break;case"wkb":{if(!l)return s;const e=l.primary_column,t=l.columns[e];if(s.geometryType||(s.geometryType=P(t)),s.spatialReference||(s.spatialReference=b(t)),s.fields)for(const o of Object.keys(l.columns))s.fields=s.fields.filter(e=>e.name!==o)}}return s}function g(e,t){if(null!=e){const t=e.primary_column,o=e.columns[t];return new s({primaryFieldName:t,orientation:o.orientation??null})}const o=r(t.map(e=>e.name));return o.latitudeFieldName&&o.latitudeFieldName?new l({latitudeFieldName:o.latitudeFieldName,longitudeFieldName:o.longitudeFieldName}):null}function w(e){switch(e){case"Point":return"point";case"Polygon":case"MultiPolygon":return"polygon";case"LineString":return"polyline";case"MultiPoint":return"multipoint";default:return null}}function P(e){const{geometry_types:o}=e,n=new Set;for(const t of o){const e=w(t);e&&n.add(e)}if(n.size>1)throw new t("unsupported","Parquet mixed geometry types are not support",{geometryTypes:n});return 1===n.size?n.values().next().value:void 0}function b(e){const t=e.crs?.id?.code;return t&&"number"==typeof t?new n({wkid:t}):void 0}export{y as completeParquetLayerInfo,f as fromParquetJSONGeometryType,d as getParquetLayerInfo,c as parquetGeometryTypeKebabDict,p as toParquetJSONGeometryType};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as t}from"tslib";import e from"../../../core/Error.js";import{eachAlways as s}from"../../../core/promiseUtils.js";import{property as i}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as r}from"../../../core/accessorSupport/decorators/subclass.js";import o from"../../../geometry/Extent.js";import a from"../../../geometry/SpatialReference.js";import l from"../DimensionalDefinition.js";import n from"../RasterInfo.js";import m from"./BaseRaster.js";import{getSliceIndex as c}from"./multidimensionalUtils.js";import{clipTile as p,split as u}from"../rasterFunctions/pixelUtils.js";import{estimateStatisticsHistograms as h,computeStatisticsHistograms as d}from"../rasterFunctions/stretchUtils.js";let f=class extends m{constructor(){super(...arguments),this.datasetFormat="MEMORY",this.source=null}get url(){return""}fetchRawTile(t,e,s,i={}){if(!this._pixelBlockTiles){const{rasterInfo:r}=this,[o,a]=r.storageInfo.tileInfo.size,{sliceId:l}=i,{pixelBlocks:n}=this.source,m={pixelBlock:null==l?n[0]:n[l],useBilinear:"thematic"!==r.dataType,tileSize:{width:o,height:a},level:t,row:e,col:s},c=this.rasterJobHandler?this.rasterJobHandler.clipTile(m,i):p(m);return Promise.resolve(c)}const r=this._pixelBlockTiles.get(`${t}/${e}/${s}`);return Promise.resolve(r)}async _open(t){const e=this.source,{pixelBlocks:s,attributeTable:i,statistics:r,histograms:l,name:m,nativeExtent:c,transform:p}=e,u=s[0],{width:h,height:d,pixelType:f}=u,g=e.extent??new o({xmin:-.5,ymin:.5,xmax:h-.5,ymax:d-.5,spatialReference:new a({wkid:3857})}),x=e.isPseudoSpatialReference??!e.extent,y={x:g.width/h,y:g.height/d},b={...e.keyProperties};i&&(b.DataType="Thematic");const v=new n({width:h,height:d,pixelType:f,extent:g,nativeExtent:c,attributeTable:i,transform:p,pixelSize:y,spatialReference:g.spatialReference,bandCount:u.pixels.length,keyProperties:b,multidimensionalInfo:e.multidimensionalInfo,statistics:r,isPseudoSpatialReference:x,histograms:l});this.ioConfig.skipMapInfo&&this.updateImageSpaceRasterInfo(v),this.createRemoteDatasetStorageInfo(v,512,512),this._set("rasterInfo",v),this.updateTileInfo(),v.multidimensionalInfo?await this._buildMDimStats(e.pixelBlocks,v.multidimensionalInfo):await this._buildInMemoryRaster(u,{width:512,height:512},t),v.multidimensionalInfo||(this.source=null),this.datasetName=m}async _buildInMemoryRaster(t,i,r){const{rasterInfo:o}=this,a=o.storageInfo.maximumPyramidLevel??0,l="thematic"!==o.dataType,n=this.rasterJobHandler?this.rasterJobHandler.split({pixelBlock:t,tileSize:i,maximumPyramidLevel:a,useBilinear:l},r):Promise.resolve(u(t,i,a,l)),m=null!=o.statistics,c=null!=o.histograms,p=this.ioConfig.skipStatistics||m?Promise.resolve({statistics:null,histograms:null}):this.rasterJobHandler?this.rasterJobHandler.estimateStatisticsHistograms({pixelBlock:t},r):Promise.resolve(h(t)),d=await s([n,p]);if(!d[0].value&&d[1].value)throw new e("inmemory-raster:open","failed to build in memory raster");this._pixelBlockTiles=d[0].value,m||(o.statistics=d[1].value?.statistics),c||(o.histograms=d[1].value?.histograms)}async _buildMDimStats(t,e,s){for(let i=0;i<e.variables.length;i++){const r=e.variables[i];if(r.statistics)continue;const o=r.dimensions.map(t=>new l({variableName:r.name,dimensionName:t.name,values:[t.values?.[0]??t.extent?.[0]],isSlice:!0})),a=c(o,e),n=null==a?null:t[a];if(null==n)continue;const m=this.rasterJobHandler?await this.rasterJobHandler.computeStatisticsHistograms({pixelBlock:n},s):d(n);r.statistics=m.statistics,r.histograms||(r.histograms=m.histograms)}}};t([i({type:String,json:{write:!0}})],f.prototype,"datasetFormat",void 0),t([i()],f.prototype,"source",void 0),t([i()],f.prototype,"url",null),f=t([r("esri.layers.support.rasterDatasets.InMemoryRaster")],f);const g=f;export{g as default};
5
+ import{__decorate as t}from"tslib";import e from"../../../core/Error.js";import{eachAlways as s}from"../../../core/promiseUtils.js";import{property as i}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as r}from"../../../core/accessorSupport/decorators/subclass.js";import o from"../../../geometry/Extent.js";import a from"../../../geometry/SpatialReference.js";import l from"../DimensionalDefinition.js";import n from"../RasterInfo.js";import m from"./BaseRaster.js";import{getSliceIndex as p}from"./multidimensionalUtils.js";import{clipTile as c,split as u}from"../rasterFunctions/pixelUtils.js";import{estimateStatisticsHistograms as h,computeStatisticsHistograms as d}from"../rasterFunctions/stretchUtils.js";let f=class extends m{constructor(){super(...arguments),this.datasetFormat="MEMORY",this.source=null}get url(){return""}fetchRawTile(t,e,s,i={}){if(!this._pixelBlockTiles){const{rasterInfo:r}=this,[o,a]=r.storageInfo.tileInfo.size,{sliceId:l}=i,{pixelBlocks:n}=this.source,m={pixelBlock:null==l?n[0]:n[l],useBilinear:"thematic"!==r.dataType,tileSize:{width:o,height:a},level:t,row:e,col:s},p=this.rasterJobHandler?this.rasterJobHandler.clipTile(m,i):c(m);return Promise.resolve(p)}const r=this._pixelBlockTiles.get(`${t}/${e}/${s}`);return Promise.resolve(r)}async _open(t){const e=this.source,{pixelBlocks:s,attributeTable:i,statistics:r,histograms:l,name:m,nativeExtent:p,transform:c,colormap:u}=e,h=s[0],{width:d,height:f,pixelType:g}=h,x=e.extent??new o({xmin:-.5,ymin:.5,xmax:d-.5,ymax:f-.5,spatialReference:new a({wkid:3857})}),y=e.isPseudoSpatialReference??!e.extent,b={x:x.width/d,y:x.height/f},I={...e.keyProperties};e.dataType&&(I.DataType=e.dataType),e.bandInfos&&(I.BandProperties=e.bandInfos.map(t=>t.toJSON())),i&&(I.DataType="Thematic");const v=new n({width:d,height:f,pixelType:g,extent:x,nativeExtent:p,attributeTable:i,colormap:u,transform:c,pixelSize:b,spatialReference:x.spatialReference,bandCount:h.pixels.length,keyProperties:I,multidimensionalInfo:e.multidimensionalInfo,statistics:r,isPseudoSpatialReference:y,histograms:l});this.ioConfig.skipMapInfo&&this.updateImageSpaceRasterInfo(v),this.createRemoteDatasetStorageInfo(v,512,512),this._set("rasterInfo",v),this.updateTileInfo(),v.multidimensionalInfo?await this._buildMDimStats(e.pixelBlocks,v.multidimensionalInfo):await this._buildInMemoryRaster(h,{width:512,height:512},t),v.multidimensionalInfo||(this.source=null),this.datasetName=m}async _buildInMemoryRaster(t,i,r){const{rasterInfo:o}=this,a=o.storageInfo.maximumPyramidLevel??0,l="thematic"!==o.dataType,n=this.rasterJobHandler?this.rasterJobHandler.split({pixelBlock:t,tileSize:i,maximumPyramidLevel:a,useBilinear:l},r):Promise.resolve(u(t,i,a,l)),m=null!=o.statistics,p=null!=o.histograms,c=this.ioConfig.skipStatistics||m?Promise.resolve({statistics:null,histograms:null}):this.rasterJobHandler?this.rasterJobHandler.estimateStatisticsHistograms({pixelBlock:t},r):Promise.resolve(h(t)),d=await s([n,c]);if(!d[0].value&&d[1].value)throw new e("inmemory-raster:open","failed to build in memory raster");this._pixelBlockTiles=d[0].value,m||(o.statistics=d[1].value?.statistics),p||(o.histograms=d[1].value?.histograms)}async _buildMDimStats(t,e,s){for(let i=0;i<e.variables.length;i++){const r=e.variables[i];if(r.statistics)continue;const o=r.dimensions.map(t=>new l({variableName:r.name,dimensionName:t.name,values:[t.values?.[0]??t.extent?.[0]],isSlice:!0})),a=p(o,e),n=null==a?null:t[a];if(null==n)continue;const m=this.rasterJobHandler?await this.rasterJobHandler.computeStatisticsHistograms({pixelBlock:n},s):d(n);r.statistics=m.statistics,r.histograms||(r.histograms=m.histograms)}}};t([i({type:String,json:{write:!0}})],f.prototype,"datasetFormat",void 0),t([i()],f.prototype,"source",void 0),t([i()],f.prototype,"url",null),f=t([r("esri.layers.support.rasterDatasets.InMemoryRaster")],f);const g=f;export{g as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import t from"../Graphic.js";import{unique as r}from"../core/arrayUtils.js";import s from"../core/Error.js";import{getOrCreateMapValue as o}from"../core/MapUtils.js";import{watch as i}from"../core/reactiveUtils.js";import{property as a}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/Logger.js";import{subclass as n}from"../core/accessorSupport/decorators/subclass.js";import l from"../layers/FeatureLayer.js";import{queryAllJSON as u}from"../layers/support/featureQueryAll.js";import d from"./Network.js";import m from"./RulesTable.js";import c from"./support/NamedTraceConfiguration.js";import{getAssociationsTableFields as y}from"./support/networkFieldUtils.js";import h from"./support/NetworkSystemLayers.js";import p from"./support/TerminalConfiguration.js";import f from"./support/TraceJobInfo.js";import{AssociationTypeEnum as I,associationTypeKebabDict as w}from"./support/typeUtils.js";import{doesRuleAllowAssociation as g}from"./support/utils.js";import b from"../rest/networks/support/TelecomNetworkElement.js";import T from"../rest/support/Query.js";let k=class extends d{constructor(e){super(e),this.sharedNamedTraceConfigurations=[],this.type="utility",this._circuitManagerMap=new Map,this._terminalById=new Map,this._unitIdentifierManager=null}initialize(){this.addHandles(i(()=>[this.gdbVersion,this.historicMoment],()=>{this.networkSystemLayers.associationsTable&&(this.networkSystemLayers.associationsTable.gdbVersion!==this.gdbVersion&&(this.networkSystemLayers.associationsTable.gdbVersion=this.gdbVersion),this.networkSystemLayers.associationsTable.historicMoment!==this.historicMoment&&(this.networkSystemLayers.associationsTable.historicMoment=this.historicMoment))}))}get _rulesLayer(){const{gdbVersion:e,historicMoment:t}=this,r=this.networkSystemLayers.rulesTableUrl;return new l({url:r,gdbVersion:e,historicMoment:t})}get _utilityLayerList(){const e=new Set;return this.dataElement?.domainNetworks?.map(t=>{t?.edgeSources?.map(({layerId:t,sourceId:r})=>{this._layerIdBySourceId.set(r,t),this._sourceIdByLayerId.set(t,r),e.add(t)}),t?.junctionSources?.map(({layerId:t,sourceId:r})=>{this._layerIdBySourceId.set(r,t),this._sourceIdByLayerId.set(t,r),e.add(t)})}),e}get serviceTerritoryFeatureLayerId(){return this.dataElement?.serviceTerritoryFeatureLayerId??null}get networkSystemLayers(){return new h({rulesTableId:this.sourceJSON?.systemLayers.rulesTableId,rulesTableUrl:this.sourceJSON?`${this.featureServiceUrl}/${this.sourceJSON?.systemLayers.rulesTableId}`:null,subnetworksTableId:this.sourceJSON?.systemLayers.subnetworksTableId,subnetworksTableUrl:this.sourceJSON?`${this.featureServiceUrl}/${this.sourceJSON?.systemLayers.subnetworksTableId}`:null,dirtyAreasLayerId:this.sourceJSON?.systemLayers.dirtyAreasLayerId,dirtyAreasLayerUrl:this.sourceJSON?`${this.featureServiceUrl}/${this.sourceJSON?.systemLayers.dirtyAreasLayerId}`:null,associationsTableId:this.sourceJSON?.systemLayers.associationsTableId,associationsTableUrl:this.sourceJSON?`${this.featureServiceUrl}/${this.sourceJSON?.systemLayers.associationsTableId}`:null})}get terminalConfigurations(){return this.dataElement?.terminalConfigurations.map(e=>p.fromJSON(e))||[]}get domainNetworkNames(){return this.dataElement?.domainNetworks.map(e=>e.domainNetworkName)||[]}get hasTelecomNetwork(){return this.dataElement?.domainNetworks.some(e=>e.isTelecomNetwork)??!1}get associationsTable(){return this.networkSystemLayers.associationsTable}async load(e){return this.addResolvingPromise(this._load(e)),this}async _load(e){await super._load(e),await Promise.all([this._loadNamedTraceConfigurationsFromNetwork(e),this.networkSystemLayers.loadAssociationsTable(e)])}getTerminalConfiguration(e){let t=null,r=null;const s=e.sourceLayer;let o=null;if("feature"===s?.type){if(o=s.layerId,null===o)return null}else{if("subtype-sublayer"!==s?.type)return null;if(o=s?.parent?.layerId??null,null===o)return null}const i=e.attributes;if(null==i)return null;for(const l of Object.keys(i))"ASSETGROUP"===l.toUpperCase()&&(t=e.getAttribute(l)),"ASSETTYPE"===l.toUpperCase()&&(r=e.getAttribute(l));if(!this.dataElement)return null;let a=null;const n=this.dataElement.domainNetworks;for(const l of n){const e=l.junctionSources?.find(e=>e.layerId===o);if(e){const s=e.assetGroups?.find(e=>e.assetGroupCode===t);if(s){const e=s.assetTypes?.find(e=>e.assetTypeCode===r);if(e?.isTerminalConfigurationSupported){a=e.terminalConfigurationId;break}}}}if(null!=a){const e=this.dataElement.terminalConfigurations,t=e?.find(e=>e.terminalConfigurationId===a);return t?p.fromJSON(t):null}return null}getTierNames(e){const t=this.dataElement?.domainNetworks.find(t=>t.domainNetworkName===e);return t?.tiers?.map(e=>e.name)||[]}async getRulesTable(){const e=this._rulesLayer;e.loaded||await e.load();const t=this.dataElement?.domainNetworks;if(!t)return null;const r=t.flatMap(e=>[...e.edgeSources||[],...e.junctionSources||[]]),s=(await this._queryRulesTable(e)).map(t=>this._hydrateRuleInfo(e,r,t));return new m({rulesLayer:e,rules:s})}async getCircuitManager(e){if(!this.hasTelecomNetwork)return null;const t=this.dataElement?.domainNetworks.find(t=>t.domainNetworkName===e&&t.isTelecomNetwork);if(!t)return null;const{default:r}=await import("./CircuitManager.js");return o(this._circuitManagerMap,e,()=>new r({utilityNetwork:this,telecomDomainNetwork:t}))}async getUnitIdentifierManager(){if(!this.hasTelecomNetwork)return null;if(this._unitIdentifierManager)return this._unitIdentifierManager;const{default:e}=await import("./UnitIdentifierManager.js");return this._unitIdentifierManager=new e({utilityNetwork:this}),this._unitIdentifierManager}getTerminalById(e){if(!this.dataElement||null==e)return null;const t=this._terminalById.get(e);return null!=t?t:(this.terminalConfigurations.forEach(e=>{e.terminals.forEach(e=>{this._terminalById.set(e.id,e)})}),this._terminalById.get(e))}isUtilityLayer(e){return"layerId"in e?null!=e.layerId&&this._utilityLayerList.has(e.layerId)&&(e.url?.startsWith(this.featureServiceUrl)??!1):!("subtype-sublayer"!==e.type||!e.parent)&&(this._utilityLayerList.has(e.parent.layerId)&&(e.parent.url?.startsWith(this.featureServiceUrl)??!1))}async queryAssociations(e,t){const[{queryAssociations:r},{default:s}]=await Promise.all([import("../rest/networks/queryAssociations.js"),import("../rest/networks/support/QueryAssociationsParameters.js")]),o=s.from(e);o.gdbVersion=this.gdbVersion,o.moment=this.historicMoment;return(await r(this.networkServiceUrl,o,t)).associations}async synthesizeAssociationGeometries(e){const[{synthesizeAssociationGeometries:t},{default:r}]=await Promise.all([import("../rest/networks/synthesizeAssociationGeometries.js"),import("../rest/networks/support/SynthesizeAssociationGeometriesParameters.js")]),s=r.from(e);return s.gdbVersion=this.gdbVersion,s.moment=this.historicMoment,t(this.networkServiceUrl,s)}async trace(e){const[{trace:t},{default:r}]=await Promise.all([import("../rest/networks/trace.js"),import("../rest/networks/support/TraceParameters.js")]),s=r.from(e);return s.gdbVersion=this.gdbVersion,s.moment=this.historicMoment,t(this.networkServiceUrl,s)}async submitTraceJob(e){const[{submitTraceJob:t},{default:r}]=await Promise.all([import("../rest/networks/trace.js"),import("../rest/networks/support/TraceParameters.js")]),s=r.from(e);s.gdbVersion=this.gdbVersion,s.moment=this.historicMoment;const o=await t(this.networkServiceUrl,s);return new f({statusUrl:o})}async canAddAssociation(e){const t=await this.getRulesTable();if(!t)return!1;const{fromNetworkElement:r,toNetworkElement:s}=e;if(!r||!s)return!1;await t.load();let o=null;switch(e.associationType){case"containment":o=t.rulesCategorized.containment;break;case"attachment":o=t.rulesCategorized.attachment;break;default:o=t.rulesCategorized.connectivity}return o.some(e=>g(e,r,s))}generateAddAssociations(e){const{associationsTable:r}=this.networkSystemLayers,{fromNetworkSourceId:s,fromGlobalId:o,fromTerminalId:i,fromFirstUnit:a,fromNumUnits:n,toNetworkSourceId:l,toGlobalId:u,toTerminalId:d,toFirstUnit:m,toNumUnits:c,associationType:h,isContentVisible:p,percentAlong:f,globalId:w}=y(r);return{addFeatures:e.map(e=>{const r=new t({attributes:{[s]:e.fromNetworkElement?.networkSourceId,[o]:e.fromNetworkElement?.globalId,[i]:e.fromNetworkElement?.terminalId,[l]:e.toNetworkElement?.networkSourceId,[u]:e.toNetworkElement?.globalId,[d]:e.toNetworkElement?.terminalId,[h]:I[e.associationType],[p]:null==e.isContentVisible?void 0:e.isContentVisible?1:0,[f]:e.percentAlong,[w]:e.globalId}});return e.fromNetworkElement instanceof b&&(r.attributes[a]=e.fromNetworkElement?.firstUnit,r.attributes[n]=e.fromNetworkElement?.numUnits),e.toNetworkElement instanceof b&&(r.attributes[m]=e.toNetworkElement?.firstUnit,r.attributes[c]=e.toNetworkElement?.numUnits),r}),id:this.networkSystemLayers.associationsTableId,identifierFields:{globalIdField:r?.globalIdField??"globalid",objectIdField:r?.objectIdField??"objectid"}}}generateDeleteAssociations(e){const{associationsTable:t,associationsTableId:r}=this.networkSystemLayers,s={id:r,identifierFields:{globalIdField:t?.globalIdField??"globalid",objectIdField:t?.objectIdField??"objectid"}};if(-8===this.dataElement?.schemaGeneration){const t=this._generateDeleteTelecomAssociationPayload(e);return{...s,deleteAssociations:t}}const o=e.map(e=>({globalId:e.globalId}));return{...s,deleteFeatures:o}}generateCombineNetworkElements(e){return{id:this._ensureSingleSourceIdAsValidLayerId(e),combineGroupedObjects:[{globalIds:e.map(e=>e.globalId)}]}}generateDivideNetworkElements(e,t){return{id:this._ensureSingleSourceIdAsValidLayerId([e]),divideGroupedObjects:[{globalId:e.globalId,numUnits:t}]}}async loadAssociationsTable(){return this.networkSystemLayers.loadAssociationsTable()}async _loadNamedTraceConfigurationsFromNetwork(e){if(0===this.sharedNamedTraceConfigurations?.length)return;const t=this.sharedNamedTraceConfigurations.map(e=>e.globalId),r=await this.queryNamedTraceConfigurations({globalIds:t},e);for(const s of this.sharedNamedTraceConfigurations){const e=r?.find(e=>e.globalId===s.globalId);if(e){const t=e.write({},{origin:"service"});s.read(t,{origin:"service"})}}}_hydrateRuleInfo(e,t,r){const s=e.fieldsIndex,o=s.get("RULETYPE"),i=s.get("CREATIONDATE"),a=s.get("FROMNETWORKSOURCEID"),n=s.get("FROMASSETGROUP"),l=s.get("FROMASSETTYPE"),u=s.get("FROMTERMINALID"),d=s.get("TONETWORKSOURCEID"),m=s.get("TOASSETGROUP"),c=s.get("TOASSETTYPE"),y=s.get("TOTERMINALID"),h=s.get("VIANETWORKSOURCEID"),p=s.get("VIAASSETGROUP"),f=s.get("VIAASSETTYPE"),I=s.get("VIATERMINALID"),w=r.attributes[o.name],g=new Date(r.attributes[i.name]),b=[{networkSourceId:r.attributes[a.name],assetGroupId:r.attributes[n.name],assetTypeId:r.attributes[l.name],terminalId:r.attributes[u.name]},{networkSourceId:r.attributes[d.name],assetGroupId:r.attributes[m.name],assetTypeId:r.attributes[c.name],terminalId:r.attributes[y.name]},{networkSourceId:r.attributes[h.name],assetGroupId:r.attributes[p.name],assetTypeId:r.attributes[f.name],terminalId:r.attributes[I.name]}],T={ruleType:w,creationDate:g};for(const k of[0,1,2]){if(5!==w&&2===k)continue;const e=b[k],r=t.find(t=>t.sourceId===e.networkSourceId),s=r?.assetGroups.find(t=>t.assetGroupCode===e.assetGroupId),o=s?.assetTypes.find(t=>t.assetTypeCode===e.assetTypeId),i=this._getTerminal(o,e);let a="";switch(k){case 0:a="from";break;case 1:a="to";break;case 2:a="via"}T[`${a}NetworkSource`]=r,T[`${a}AssetGroup`]=s,T[`${a}AssetType`]=o,T[`${a}Terminal`]=i?.toJSON()}return T}_getTerminal(e,t){const r=e?.terminalConfigurationId,s=this.terminalConfigurations?.find(e=>e.id===r);return s?.terminals?.find(e=>e.id===t.terminalId)??null}async _queryRulesTable(e){const{gdbVersion:t,historicMoment:r}=this,s=new T({where:"1=1",outFields:["*"],gdbVersion:t,historicMoment:r});return(await u(e,s)).features}_generateDeleteTelecomAssociationPayload(e){return e.map(e=>({globalId:e.globalId??"{00000000-0000-0000-0000-000000000000}",associationType:w.toJSON(e.associationType),fromSourceId:e.fromNetworkElement.networkSourceId,fromGlobalId:e.fromNetworkElement.globalId,fromTerminalId:e.fromNetworkElement.terminalId,toSourceId:e.toNetworkElement.networkSourceId,toGlobalId:e.toNetworkElement.globalId,toTerminalId:e.toNetworkElement.terminalId}))}_ensureSingleSourceIdAsValidLayerId(e){const t=r(e.map(e=>e.networkSourceId));if(t.length>1)throw new s("utility-network:invalid-source-id","'networkSourceId' is not valid. Ensure that all network elements have the same 'networkSourceId' and that it corresponds to a valid layer in the utility network.");const o=t[0],i=this.getLayerIdBySourceId(o);if(null==i)throw new s("utility-network:invalid-source-id","'networkSourceId' is not valid. Ensure that all network elements have the same 'networkSourceId' and that it corresponds to a valid layer in the utility network.");return i}};e([a({readOnly:!0})],k.prototype,"_rulesLayer",null),e([a({type:[c],json:{origins:{"web-map":{read:{source:"traceConfigurations"},write:{target:"traceConfigurations"}},service:{read:{source:"traceConfigurations"}}},read:!1}})],k.prototype,"sharedNamedTraceConfigurations",void 0),e([a({type:["utility"],readOnly:!0,json:{read:!1,write:!1}})],k.prototype,"type",void 0),e([a({readOnly:!0})],k.prototype,"serviceTerritoryFeatureLayerId",null),e([a({readOnly:!0})],k.prototype,"networkSystemLayers",null),e([a({readOnly:!0})],k.prototype,"terminalConfigurations",null),e([a({readOnly:!0})],k.prototype,"domainNetworkNames",null),e([a({readOnly:!0})],k.prototype,"hasTelecomNetwork",null),e([a({readOnly:!0,json:{read:!1}})],k.prototype,"associationsTable",null),k=e([n("esri.networks.UtilityNetwork")],k);const S=k;export{S as default};
5
+ import{__decorate as e}from"tslib";import t from"../Graphic.js";import{unique as r}from"../core/arrayUtils.js";import s from"../core/Error.js";import{getOrCreateMapValue as o}from"../core/MapUtils.js";import{watch as i}from"../core/reactiveUtils.js";import{property as a}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/Logger.js";import{subclass as n}from"../core/accessorSupport/decorators/subclass.js";import l from"../layers/FeatureLayer.js";import{queryAllJSON as u}from"../layers/support/featureQueryAll.js";import d from"./Network.js";import m from"./RulesTable.js";import c from"./support/NamedTraceConfiguration.js";import{getAssociationsTableFields as y}from"./support/networkFieldUtils.js";import h from"./support/NetworkSystemLayers.js";import p from"./support/TerminalConfiguration.js";import f from"./support/TraceJobInfo.js";import{AssociationTypeEnum as w,associationTypeKebabDict as I,nullGuid as b}from"./support/typeUtils.js";import{doesRuleAllowAssociation as g}from"./support/utils.js";import k from"../rest/networks/support/TelecomNetworkElement.js";import T from"../rest/support/Query.js";let S=class extends d{constructor(e){super(e),this.sharedNamedTraceConfigurations=[],this.type="utility",this._circuitManagerMap=new Map,this._terminalById=new Map,this._unitIdentifierManager=null}initialize(){this.addHandles(i(()=>[this.gdbVersion,this.historicMoment],()=>{this.networkSystemLayers.associationsTable&&(this.networkSystemLayers.associationsTable.gdbVersion!==this.gdbVersion&&(this.networkSystemLayers.associationsTable.gdbVersion=this.gdbVersion),this.networkSystemLayers.associationsTable.historicMoment!==this.historicMoment&&(this.networkSystemLayers.associationsTable.historicMoment=this.historicMoment))}))}get _rulesLayer(){const{gdbVersion:e,historicMoment:t}=this,r=this.networkSystemLayers.rulesTableUrl;return new l({url:r,gdbVersion:e,historicMoment:t})}get _utilityLayerList(){const e=new Set;return this.dataElement?.domainNetworks?.map(t=>{t?.edgeSources?.map(({layerId:t,sourceId:r})=>{this._layerIdBySourceId.set(r,t),this._sourceIdByLayerId.set(t,r),e.add(t)}),t?.junctionSources?.map(({layerId:t,sourceId:r})=>{this._layerIdBySourceId.set(r,t),this._sourceIdByLayerId.set(t,r),e.add(t)})}),e}get serviceTerritoryFeatureLayerId(){return this.dataElement?.serviceTerritoryFeatureLayerId??null}get networkSystemLayers(){return new h({rulesTableId:this.sourceJSON?.systemLayers.rulesTableId,rulesTableUrl:this.sourceJSON?`${this.featureServiceUrl}/${this.sourceJSON?.systemLayers.rulesTableId}`:null,subnetworksTableId:this.sourceJSON?.systemLayers.subnetworksTableId,subnetworksTableUrl:this.sourceJSON?`${this.featureServiceUrl}/${this.sourceJSON?.systemLayers.subnetworksTableId}`:null,dirtyAreasLayerId:this.sourceJSON?.systemLayers.dirtyAreasLayerId,dirtyAreasLayerUrl:this.sourceJSON?`${this.featureServiceUrl}/${this.sourceJSON?.systemLayers.dirtyAreasLayerId}`:null,associationsTableId:this.sourceJSON?.systemLayers.associationsTableId,associationsTableUrl:this.sourceJSON?`${this.featureServiceUrl}/${this.sourceJSON?.systemLayers.associationsTableId}`:null})}get terminalConfigurations(){return this.dataElement?.terminalConfigurations.map(e=>p.fromJSON(e))||[]}get domainNetworkNames(){return this.dataElement?.domainNetworks.map(e=>e.domainNetworkName)||[]}get hasTelecomNetwork(){return this.dataElement?.domainNetworks.some(e=>e.isTelecomNetwork)??!1}get associationsTable(){return this.networkSystemLayers.associationsTable}async load(e){return this.addResolvingPromise(this._load(e)),this}async _load(e){await super._load(e),await Promise.all([this._loadNamedTraceConfigurationsFromNetwork(e),this.networkSystemLayers.loadAssociationsTable(e)])}getTerminalConfiguration(e){let t=null,r=null;const s=e.sourceLayer;let o=null;if("feature"===s?.type){if(o=s.layerId,null===o)return null}else{if("subtype-sublayer"!==s?.type)return null;if(o=s?.parent?.layerId??null,null===o)return null}const i=e.attributes;if(null==i)return null;for(const l of Object.keys(i))"ASSETGROUP"===l.toUpperCase()&&(t=e.getAttribute(l)),"ASSETTYPE"===l.toUpperCase()&&(r=e.getAttribute(l));if(!this.dataElement)return null;let a=null;const n=this.dataElement.domainNetworks;for(const l of n){const e=l.junctionSources?.find(e=>e.layerId===o);if(e){const s=e.assetGroups?.find(e=>e.assetGroupCode===t);if(s){const e=s.assetTypes?.find(e=>e.assetTypeCode===r);if(e?.isTerminalConfigurationSupported){a=e.terminalConfigurationId;break}}}}if(null!=a){const e=this.dataElement.terminalConfigurations,t=e?.find(e=>e.terminalConfigurationId===a);return t?p.fromJSON(t):null}return null}getTierNames(e){const t=this.dataElement?.domainNetworks.find(t=>t.domainNetworkName===e);return t?.tiers?.map(e=>e.name)||[]}async getRulesTable(){const e=this._rulesLayer;e.loaded||await e.load();const t=this.dataElement?.domainNetworks;if(!t)return null;const r=t.flatMap(e=>[...e.edgeSources||[],...e.junctionSources||[]]),s=(await this._queryRulesTable(e)).map(t=>this._hydrateRuleInfo(e,r,t));return new m({rulesLayer:e,rules:s})}async getCircuitManager(e){if(!this.hasTelecomNetwork)return null;const t=this.dataElement?.domainNetworks.find(t=>t.domainNetworkName===e&&t.isTelecomNetwork);if(!t)return null;const{default:r}=await import("./CircuitManager.js");return o(this._circuitManagerMap,e,()=>new r({utilityNetwork:this,telecomDomainNetwork:t}))}async getUnitIdentifierManager(){if(!this.hasTelecomNetwork)return null;if(this._unitIdentifierManager)return this._unitIdentifierManager;const{default:e}=await import("./UnitIdentifierManager.js");return this._unitIdentifierManager=new e({utilityNetwork:this}),this._unitIdentifierManager}getTerminalById(e){if(!this.dataElement||null==e)return null;const t=this._terminalById.get(e);return null!=t?t:(this.terminalConfigurations.forEach(e=>{e.terminals.forEach(e=>{this._terminalById.set(e.id,e)})}),this._terminalById.get(e))}isUtilityLayer(e){return"layerId"in e?null!=e.layerId&&this._utilityLayerList.has(e.layerId)&&(e.url?.startsWith(this.featureServiceUrl)??!1):!("subtype-sublayer"!==e.type||!e.parent)&&(this._utilityLayerList.has(e.parent.layerId)&&(e.parent.url?.startsWith(this.featureServiceUrl)??!1))}async queryAssociations(e,t){const[{queryAssociations:r},{default:s}]=await Promise.all([import("../rest/networks/queryAssociations.js"),import("../rest/networks/support/QueryAssociationsParameters.js")]),o=s.from(e);o.gdbVersion=this.gdbVersion,o.moment=this.historicMoment;return(await r(this.networkServiceUrl,o,t)).associations}async synthesizeAssociationGeometries(e){const[{synthesizeAssociationGeometries:t},{default:r}]=await Promise.all([import("../rest/networks/synthesizeAssociationGeometries.js"),import("../rest/networks/support/SynthesizeAssociationGeometriesParameters.js")]),s=r.from(e);return s.gdbVersion=this.gdbVersion,s.moment=this.historicMoment,t(this.networkServiceUrl,s)}async trace(e){const[{trace:t},{default:r}]=await Promise.all([import("../rest/networks/trace.js"),import("../rest/networks/support/TraceParameters.js")]),s=r.from(e);return s.gdbVersion=this.gdbVersion,s.moment=this.historicMoment,t(this.networkServiceUrl,s)}async submitTraceJob(e){const[{submitTraceJob:t},{default:r}]=await Promise.all([import("../rest/networks/trace.js"),import("../rest/networks/support/TraceParameters.js")]),s=r.from(e);s.gdbVersion=this.gdbVersion,s.moment=this.historicMoment;const o=await t(this.networkServiceUrl,s);return new f({statusUrl:o})}async canAddAssociation(e){const t=await this.getRulesTable();if(!t)return!1;const{fromNetworkElement:r,toNetworkElement:s}=e;if(!r||!s)return!1;await t.load();let o=null;switch(e.associationType){case"containment":o=t.rulesCategorized.containment;break;case"attachment":o=t.rulesCategorized.attachment;break;default:o=t.rulesCategorized.connectivity}return o.some(e=>g(e,r,s))}generateAddAssociations(e){const{associationsTable:r}=this.networkSystemLayers,{fromNetworkSourceId:s,fromGlobalId:o,fromTerminalId:i,fromFirstUnit:a,fromNumUnits:n,toNetworkSourceId:l,toGlobalId:u,toTerminalId:d,toFirstUnit:m,toNumUnits:c,associationType:h,isContentVisible:p,percentAlong:f,globalId:I}=y(r);return{addFeatures:e.map(e=>{const r=new t({attributes:{[s]:e.fromNetworkElement?.networkSourceId,[o]:e.fromNetworkElement?.globalId,[i]:e.fromNetworkElement?.terminalId,[l]:e.toNetworkElement?.networkSourceId,[u]:e.toNetworkElement?.globalId,[d]:e.toNetworkElement?.terminalId,[h]:w[e.associationType],[p]:null==e.isContentVisible?void 0:e.isContentVisible?1:0,[f]:e.percentAlong,[I]:e.globalId}});return e.fromNetworkElement instanceof k&&(r.attributes[a]=e.fromNetworkElement?.firstUnit,r.attributes[n]=e.fromNetworkElement?.numUnits),e.toNetworkElement instanceof k&&(r.attributes[m]=e.toNetworkElement?.firstUnit,r.attributes[c]=e.toNetworkElement?.numUnits),r}),id:this.networkSystemLayers.associationsTableId,identifierFields:{globalIdField:r?.globalIdField??"globalid",objectIdField:r?.objectIdField??"objectid"}}}generateDeleteAssociations(e){const{associationsTable:t,associationsTableId:r}=this.networkSystemLayers,s={id:r,identifierFields:{globalIdField:t?.globalIdField??"globalid",objectIdField:t?.objectIdField??"objectid"}};if(-8===this.dataElement?.schemaGeneration){const t=this._generateDeleteTelecomAssociationPayload(e);return{...s,deleteAssociations:t}}const o=e.map(e=>({globalId:e.globalId}));return{...s,deleteFeatures:o}}generateCombineNetworkElements(e){return{id:this._ensureSingleSourceIdAsValidLayerId(e),combineGroupedObjects:[{globalIds:e.map(e=>e.globalId)}]}}generateDivideNetworkElements(e,t){return{id:this._ensureSingleSourceIdAsValidLayerId([e]),divideGroupedObjects:[{globalId:e.globalId,numUnits:t}]}}async loadAssociationsTable(){return this.networkSystemLayers.loadAssociationsTable()}async loadSubnetworksTable(){return this.networkSystemLayers.loadSubnetworksTable()}async _loadNamedTraceConfigurationsFromNetwork(e){if(0===this.sharedNamedTraceConfigurations?.length)return;const t=this.sharedNamedTraceConfigurations.map(e=>e.globalId),r=await this.queryNamedTraceConfigurations({globalIds:t},e);for(const s of this.sharedNamedTraceConfigurations){const e=r?.find(e=>e.globalId===s.globalId);if(e){const t=e.write({},{origin:"service"});s.read(t,{origin:"service"})}}}_hydrateRuleInfo(e,t,r){const s=e.fieldsIndex,o=s.get("RULETYPE"),i=s.get("CREATIONDATE"),a=s.get("FROMNETWORKSOURCEID"),n=s.get("FROMASSETGROUP"),l=s.get("FROMASSETTYPE"),u=s.get("FROMTERMINALID"),d=s.get("TONETWORKSOURCEID"),m=s.get("TOASSETGROUP"),c=s.get("TOASSETTYPE"),y=s.get("TOTERMINALID"),h=s.get("VIANETWORKSOURCEID"),p=s.get("VIAASSETGROUP"),f=s.get("VIAASSETTYPE"),w=s.get("VIATERMINALID"),I=r.attributes[o.name],b=new Date(r.attributes[i.name]),g=[{networkSourceId:r.attributes[a.name],assetGroupId:r.attributes[n.name],assetTypeId:r.attributes[l.name],terminalId:r.attributes[u.name]},{networkSourceId:r.attributes[d.name],assetGroupId:r.attributes[m.name],assetTypeId:r.attributes[c.name],terminalId:r.attributes[y.name]},{networkSourceId:r.attributes[h.name],assetGroupId:r.attributes[p.name],assetTypeId:r.attributes[f.name],terminalId:r.attributes[w.name]}],k={ruleType:I,creationDate:b};for(const T of[0,1,2]){if(5!==I&&2===T)continue;const e=g[T],r=t.find(t=>t.sourceId===e.networkSourceId),s=r?.assetGroups.find(t=>t.assetGroupCode===e.assetGroupId),o=s?.assetTypes.find(t=>t.assetTypeCode===e.assetTypeId),i=this._getTerminal(o,e);let a="";switch(T){case 0:a="from";break;case 1:a="to";break;case 2:a="via"}k[`${a}NetworkSource`]=r,k[`${a}AssetGroup`]=s,k[`${a}AssetType`]=o,k[`${a}Terminal`]=i?.toJSON()}return k}_getTerminal(e,t){const r=e?.terminalConfigurationId,s=this.terminalConfigurations?.find(e=>e.id===r);return s?.terminals?.find(e=>e.id===t.terminalId)??null}async _queryRulesTable(e){const{gdbVersion:t,historicMoment:r}=this,s=new T({where:"1=1",outFields:["*"],gdbVersion:t,historicMoment:r});return(await u(e,s)).features}_generateDeleteTelecomAssociationPayload(e){return e.map(e=>({globalId:e.globalId??b,associationType:I.toJSON(e.associationType),fromSourceId:e.fromNetworkElement.networkSourceId,fromGlobalId:e.fromNetworkElement.globalId,fromTerminalId:e.fromNetworkElement.terminalId,toSourceId:e.toNetworkElement.networkSourceId,toGlobalId:e.toNetworkElement.globalId,toTerminalId:e.toNetworkElement.terminalId}))}_ensureSingleSourceIdAsValidLayerId(e){const t=r(e.map(e=>e.networkSourceId));if(t.length>1)throw new s("utility-network:invalid-source-id","'networkSourceId' is not valid. Ensure that all network elements have the same 'networkSourceId' and that it corresponds to a valid layer in the utility network.");const o=t[0],i=this.getLayerIdBySourceId(o);if(null==i)throw new s("utility-network:invalid-source-id","'networkSourceId' is not valid. Ensure that all network elements have the same 'networkSourceId' and that it corresponds to a valid layer in the utility network.");return i}};e([a({readOnly:!0})],S.prototype,"_rulesLayer",null),e([a({type:[c],json:{origins:{"web-map":{read:{source:"traceConfigurations"},write:{target:"traceConfigurations"}},service:{read:{source:"traceConfigurations"}}},read:!1}})],S.prototype,"sharedNamedTraceConfigurations",void 0),e([a({type:["utility"],readOnly:!0,json:{read:!1,write:!1}})],S.prototype,"type",void 0),e([a({readOnly:!0})],S.prototype,"serviceTerritoryFeatureLayerId",null),e([a({readOnly:!0})],S.prototype,"networkSystemLayers",null),e([a({readOnly:!0})],S.prototype,"terminalConfigurations",null),e([a({readOnly:!0})],S.prototype,"domainNetworkNames",null),e([a({readOnly:!0})],S.prototype,"hasTelecomNetwork",null),e([a({readOnly:!0,json:{read:!1}})],S.prototype,"associationsTable",null),S=e([n("esri.networks.UtilityNetwork")],S);const N=S;export{N as default};