@arcgis/core 5.0.0-next.59 → 5.0.0-next.60

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 (347) hide show
  1. package/analysis/Analysis.d.ts +2 -3
  2. package/analysis/ElevationProfile/ElevationProfileLine.d.ts +1 -1
  3. package/analysis/ElevationProfile/ElevationProfileLineQuery.d.ts +1 -3
  4. package/analysis/ElevationProfile/{elevationProfileLineTypes.d.ts → types.d.ts} +2 -2
  5. package/analysis/ElevationProfileAnalysis.d.ts +1 -1
  6. package/analysis/LengthDimension.d.ts +1 -1
  7. package/analysis/LineOfSightAnalysisObserver.d.ts +1 -1
  8. package/analysis/LineOfSightAnalysisTarget.d.ts +1 -1
  9. package/analysis/Slice/SliceAnalysisExcludedLayer.js +5 -0
  10. package/analysis/Slice/types.d.ts +4 -0
  11. package/analysis/SliceAnalysis.d.ts +1 -4
  12. package/analysis/SliceAnalysis.js +1 -1
  13. package/analysis/Viewshed.d.ts +1 -1
  14. package/analysis/VolumeMeasurementAnalysis.d.ts +1 -1
  15. package/analysis/VolumeMeasurementAnalysis.js +1 -1
  16. package/analysis/types.d.ts +22 -1
  17. package/applications/KnowledgeStudio/generalSdkInternalAccess.d.ts +6 -0
  18. package/applications/KnowledgeStudio/generalSharedKgUtils.d.ts +4 -1
  19. package/applications/KnowledgeStudio/layerInternalAccessUtils.d.ts +11 -1
  20. package/applications/KnowledgeStudio/layerInternalAccessUtils.js +1 -1
  21. package/arcade/functions/featuresetbase.js +1 -1
  22. package/arcade.d.ts +27 -4
  23. package/arcade.js +1 -1
  24. package/assets/esri/core/workers/RemoteClient.js +1 -1
  25. package/assets/esri/core/workers/chunks/02cd179176fee25d09a8.js +1 -0
  26. package/assets/esri/core/workers/chunks/0367a8580fede8f804f9.js +1 -0
  27. package/assets/esri/core/workers/chunks/0483a2cfdb8c7158e73a.js +1 -0
  28. package/assets/esri/core/workers/chunks/{73f9cbf0f919b6adc2d5.js → 05ab54b81c366e98138f.js} +1 -1
  29. package/assets/esri/core/workers/chunks/108a4ab28b6586e281d9.js +1 -0
  30. package/assets/esri/core/workers/chunks/14f4f5b7549cea7b5a6a.js +1 -0
  31. package/assets/esri/core/workers/chunks/1b475593c80d7bccdda5.js +1 -0
  32. package/assets/esri/core/workers/chunks/{de05c59da6d67716795d.js → 1c350a2c4014146dbcd9.js} +1 -1
  33. package/assets/esri/core/workers/chunks/{b2425f6af7df6902dfc4.js → 1e8ceed33a3657ac02b3.js} +1 -1
  34. package/assets/esri/core/workers/chunks/{2d61b6efa17e8c5832da.js → 21ebd234cf32ae52b3ea.js} +1 -1
  35. package/assets/esri/core/workers/chunks/27ec8688f72130239b98.js +1 -0
  36. package/assets/esri/core/workers/chunks/{087cf25ca211836a084a.js → 2a6231db5ee6cbfd59a5.js} +1 -1
  37. package/assets/esri/core/workers/chunks/2d8dca9a4a58469ddd05.js +1 -0
  38. package/assets/esri/core/workers/chunks/2e6bd743b88e83d43137.js +1 -0
  39. package/assets/esri/core/workers/chunks/2f6fa33692478e99d24b.js +1 -0
  40. package/assets/esri/core/workers/chunks/31eda00e6842005d0ec8.js +1 -0
  41. package/assets/esri/core/workers/chunks/{ce90e8489143228262e7.js → 33a13e80badd20ed8de2.js} +1 -1
  42. package/assets/esri/core/workers/chunks/{01d38a9ca9e88c38aab9.js → 34178ace79e8dea3567d.js} +1 -1
  43. package/assets/esri/core/workers/chunks/37a3e91791a18ed8b8da.js +1 -0
  44. package/assets/esri/core/workers/chunks/{47338472f5a8e004a671.js → 37e46461da3000949a26.js} +1 -1
  45. package/assets/esri/core/workers/chunks/{c531c0e3d420a1be0ad2.js → 3d1a5a3467f3a6585b3e.js} +1 -1
  46. package/assets/esri/core/workers/chunks/{be6a05d5375e80968877.js → 47e5149765beee46f208.js} +1 -1
  47. package/assets/esri/core/workers/chunks/{44fb1184eeed0636704a.js → 4b088260252787734c00.js} +1 -1
  48. package/assets/esri/core/workers/chunks/4cbe78d6a5ff617e15d6.js +1 -0
  49. package/assets/esri/core/workers/chunks/509065a27bd07bd32475.js +1 -0
  50. package/assets/esri/core/workers/chunks/{c09cba77ee60a3d765e2.js → 522a6787d9e0f520ac79.js} +1 -1
  51. package/assets/esri/core/workers/chunks/5686220aed9a74dbd2b1.js +1 -0
  52. package/assets/esri/core/workers/chunks/584c4602d97a008afb83.js +1 -0
  53. package/assets/esri/core/workers/chunks/{60954ab810dbbf36e5e1.js → 5a66b7f1f4da75da8e7f.js} +1 -1
  54. package/assets/esri/core/workers/chunks/{10094eb2b94e98dd4a8a.js → 5dc2f2e28c30386efadf.js} +1 -1
  55. package/assets/esri/core/workers/chunks/668a868fe2dcb6384ac9.js +1 -0
  56. package/assets/esri/core/workers/chunks/68cb43f2fa8cc826e99b.js +1 -0
  57. package/assets/esri/core/workers/chunks/68ee11589de0da7fed08.js +1 -0
  58. package/assets/esri/core/workers/chunks/{d42273394f575e71dd55.js → 73bee5659414b3687cfc.js} +1 -1
  59. package/assets/esri/core/workers/chunks/{090dad5579f0148d6486.js → 76dbaef0d0794913f36f.js} +1 -1
  60. package/assets/esri/core/workers/chunks/{09bd9bd37a339802907a.js → 7bf30c254228f9b7f224.js} +1 -1
  61. package/assets/esri/core/workers/chunks/7c5218eae13d3bd30598.js +1 -0
  62. package/assets/esri/core/workers/chunks/7fc09382f934e9223a9b.js +1 -0
  63. package/assets/esri/core/workers/chunks/{472d290f8eb1c1a85724.js → 8195310b4c53db902fc1.js} +1 -1
  64. package/assets/esri/core/workers/chunks/831b8282380844a7c4d5.js +1 -0
  65. package/assets/esri/core/workers/chunks/83c5dea24e36ac2e3497.js +1 -0
  66. package/assets/esri/core/workers/chunks/{49df576f0215618aa651.js → 84440efe2cc337dab81f.js} +1 -1
  67. package/assets/esri/core/workers/chunks/852007720e3bc29532db.js +1 -0
  68. package/assets/esri/core/workers/chunks/87c6470ee295d736b06d.js +1 -0
  69. package/assets/esri/core/workers/chunks/89853fccdf2bfcc290c0.js +1 -0
  70. package/assets/esri/core/workers/chunks/{1e152a34e368bd810a0f.js → 8d58e59ea13ecafdd45c.js} +1 -1
  71. package/assets/esri/core/workers/chunks/{a2442549c5daf3653eb4.js → 8d6641d0f7c93f83c414.js} +1 -1
  72. package/assets/esri/core/workers/chunks/8db723b8468e408dda46.js +1 -0
  73. package/assets/esri/core/workers/chunks/92a4f56232f81ca457fa.js +1 -0
  74. package/assets/esri/core/workers/chunks/{8a132d91077ecf849248.js → 92ef6071ea87b7f940e2.js} +1 -1
  75. package/assets/esri/core/workers/chunks/{bb4aefaf9b0327dda738.js → 942c80c425b1f13cced5.js} +1 -1
  76. package/assets/esri/core/workers/chunks/980313a6c35e79812d17.js +1 -0
  77. package/assets/esri/core/workers/chunks/{e6bab7b739bfbb39f6cd.js → 988f5e003377d734d282.js} +1 -1
  78. package/assets/esri/core/workers/chunks/{7364fb5e99933533890d.js → 9ba8a2e1c0fb4e1efc7c.js} +1 -1
  79. package/assets/esri/core/workers/chunks/9c157c0eeadb824ad01e.js +1 -0
  80. package/assets/esri/core/workers/chunks/a39ac9127a215d14d412.js +1 -0
  81. package/assets/esri/core/workers/chunks/{63cf702cde83692126be.js → a6f29d1a6356e2de5a79.js} +1 -1
  82. package/assets/esri/core/workers/chunks/a94dd0f5839b6e2bb2d2.js +1 -0
  83. package/assets/esri/core/workers/chunks/ab0275669e28e7a34c38.js +1 -0
  84. package/assets/esri/core/workers/chunks/abc8015e13b1395b8d64.js +1 -0
  85. package/assets/esri/core/workers/chunks/abcee7cfd53cfe1d91e9.js +1 -0
  86. package/assets/esri/core/workers/chunks/acdbe0299024d58e1421.js +1 -0
  87. package/assets/esri/core/workers/chunks/{63c91421a71ae3b3599e.js → adff1791ae44631ad34a.js} +1 -1
  88. package/assets/esri/core/workers/chunks/{0eb6b9c638a5fcfe9bab.js → b4a59dd11d75df7bd510.js} +1 -1
  89. package/assets/esri/core/workers/chunks/{224f01b11fdba9250b1e.js → b64cfd86d9204be743c6.js} +1 -1
  90. package/assets/esri/core/workers/chunks/b7f2fb6684cf684b0bce.js +1 -0
  91. package/assets/esri/core/workers/chunks/b9f0d313f59fc7c43560.js +1 -0
  92. package/assets/esri/core/workers/chunks/bb5373ff7cdad7270095.js +1 -0
  93. package/assets/esri/core/workers/chunks/bb92a9daa0c5b019561f.js +1 -0
  94. package/assets/esri/core/workers/chunks/bbe2eaef7edfa33b6eea.js +1 -0
  95. package/assets/esri/core/workers/chunks/bddaa83fcb9fdb1e1856.js +1 -0
  96. package/assets/esri/core/workers/chunks/bfdf646d4c8f175a4236.js +1 -0
  97. package/assets/esri/core/workers/chunks/{0000781c850b1b4828b3.js → bfe052b386ec4874f350.js} +1 -1
  98. package/assets/esri/core/workers/chunks/{aa297e0931213341f51b.js → c3272b09bff886b08ce1.js} +1 -1
  99. package/assets/esri/core/workers/chunks/c38a07e936226b361b63.js +1 -0
  100. package/assets/esri/core/workers/chunks/{0d9904ba62558686c289.js → c743e561e7d73a100576.js} +1 -1
  101. package/assets/esri/core/workers/chunks/{b907d16e82ac908bb896.js → c96083838f919a8f64cd.js} +1 -1
  102. package/assets/esri/core/workers/chunks/{be80ed6e2955eabe912f.js → ca761dc5f45cafef313e.js} +1 -1
  103. package/assets/esri/core/workers/chunks/{8a6e50d95539b46f629c.js → cad1d7e5ce89f51b3ac9.js} +1 -1
  104. package/assets/esri/core/workers/chunks/{dbe55d4731227d6e9571.js → ccc743e41854eb225c23.js} +1 -1
  105. package/assets/esri/core/workers/chunks/cf3a9ead26629f3508b3.js +1 -0
  106. package/assets/esri/core/workers/chunks/{3a612f873e29348370b2.js → d129a5a34e9ad09bd39e.js} +1 -1
  107. package/assets/esri/core/workers/chunks/{461093ce28ceadd7853d.js → d14e75b160aa432233c6.js} +1 -1
  108. package/assets/esri/core/workers/chunks/{e668ddc7332e5e560e78.js → d2abfcb0c8bf894c7f72.js} +1 -1
  109. package/assets/esri/core/workers/chunks/d749aa62ad694147aebe.js +1 -0
  110. package/assets/esri/core/workers/chunks/{f142c5cbdd16f1768275.js → d77f56576a49a998164a.js} +1 -1
  111. package/assets/esri/core/workers/chunks/{044a0ccd89741c1ae770.js → d79d29b52a65fb6bf94d.js} +1 -1
  112. package/assets/esri/core/workers/chunks/da7685ec2b6eaf00fd2d.js +1 -0
  113. package/assets/esri/core/workers/chunks/dae09fb8da0faa6dede4.js +1 -0
  114. package/assets/esri/core/workers/chunks/e16e88de4e93b0f48b2c.js +1 -0
  115. package/assets/esri/core/workers/chunks/e8bf362b2631f977b1cb.js +1 -0
  116. package/assets/esri/core/workers/chunks/ec5f83aa752c39a96609.js +1 -0
  117. package/assets/esri/core/workers/chunks/ed7e353e290b3a272457.js +1 -0
  118. package/assets/esri/core/workers/chunks/ef9a23d41acb5ad36426.js +1 -0
  119. package/assets/esri/core/workers/chunks/{33154a245eeca4ba38c6.js → f3437ae6bba846b524d3.js} +1 -1
  120. package/assets/esri/core/workers/chunks/{cfd2839e218610a222e5.js → f54ec21fa67db6fef5a6.js} +1 -1
  121. package/assets/esri/core/workers/chunks/{58242447b72cc60a5040.js → f91e63d7842c427c7f72.js} +1 -1
  122. package/assets/esri/core/workers/chunks/{914746077017fa50933f.js → fa0bbf0d7eadb924c473.js} +1 -1
  123. package/assets/esri/core/workers/chunks/fbd577f56529063ce491.js +1 -0
  124. package/assets/esri/core/workers/chunks/fe33b11ec3f58a0f541a.js +1 -0
  125. package/assets/esri/core/workers/chunks/fe5d2735f057c7789f4b.js +1 -0
  126. package/assets/esri/core/workers/chunks/ff7df6fb78fa2c0e9247.js +1 -0
  127. package/assets/esri/libs/parquet/pkg/bundle_bg.wasm +0 -0
  128. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/UtilityNetworkValidateTopology.json +1 -1
  129. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/UtilityNetworkValidateTopology_en.json +1 -1
  130. package/chunks/bundle.js +1 -1
  131. package/config.js +1 -1
  132. package/core/memoryEstimations.js +1 -1
  133. package/core/promiseUtils.d.ts +1 -1
  134. package/core/units.d.ts +2 -0
  135. package/geometry/FlatGeometry.js +1 -1
  136. package/geometry/operators/support/jsonConverter.js +1 -1
  137. package/interfaces.d.ts +29 -31
  138. package/kernel.js +1 -1
  139. package/layers/FeatureLayer.d.ts +3 -3
  140. package/layers/GeoJSONLayer.d.ts +1 -1
  141. package/layers/ImageryTileLayer.d.ts +1 -1
  142. package/layers/OGCFeatureLayer.d.ts +1 -1
  143. package/layers/ParquetLayer.d.ts +1 -1
  144. package/layers/ParquetLayer.js +1 -1
  145. package/layers/SceneLayer.d.ts +1 -1
  146. package/layers/StreamLayer.d.ts +8 -7
  147. package/layers/VoxelWasmPerSceneView.js +1 -1
  148. package/layers/WCSLayer.d.ts +1 -1
  149. package/layers/WFSLayer.d.ts +1 -1
  150. package/layers/buildingSublayers/BuildingComponentSublayer.d.ts +1 -1
  151. package/layers/catalog/CatalogFootprintLayer.d.ts +1 -1
  152. package/layers/graphics/FlatFeature.js +5 -0
  153. package/layers/graphics/FlatFeatureSet.js +5 -0
  154. package/layers/graphics/data/FlatFeatureStore.js +5 -0
  155. package/layers/graphics/data/QueryEngine.js +1 -1
  156. package/layers/graphics/data/QueryEngineResult.js +1 -1
  157. package/layers/graphics/data/flatFeatureQueryEngineAdapter.js +5 -0
  158. package/layers/graphics/data/optimizedFeatureQueryEngineAdapter.js +1 -1
  159. package/layers/graphics/featureConversionUtils.js +1 -1
  160. package/layers/graphics/sources/OGCFeatureSource.js +1 -1
  161. package/layers/graphics/sources/support/ParquetSourceWorker.js +1 -1
  162. package/layers/knowledgeGraph/KnowledgeGraphSublayer.d.ts +1 -1
  163. package/layers/mixins/ArcGISImageService.d.ts +1 -1
  164. package/layers/mixins/ImageryTileMixin.d.ts +1 -1
  165. package/layers/ogc/ogcFeatureUtils.d.ts +57 -0
  166. package/layers/ogc/ogcFeatureUtils.js +1 -1
  167. package/layers/ogc/types.d.ts +73 -0
  168. package/layers/raster/functions/creators/createDataManagementFunctions.d.ts +1 -1
  169. package/layers/raster/functions/creators/createSurfaceFunctions.d.ts +1 -1
  170. package/layers/support/FeatureReductionBinning.d.ts +1 -1
  171. package/layers/support/FeatureReductionCluster.d.ts +1 -1
  172. package/layers/support/StreamConnection.d.ts +37 -4
  173. package/layers/support/Sublayer.d.ts +1 -1
  174. package/layers/support/TrackPartInfo.d.ts +1 -1
  175. package/layers/support/fieldUtils.d.ts +1 -1
  176. package/layers/support/parquetUtils.js +1 -1
  177. package/libs/parquet/parquet.js +1 -1
  178. package/package.json +1 -1
  179. package/pointCloudRenderers.d.ts +1 -1
  180. package/portal/jsonTypes.d.ts +6 -0
  181. package/renderers/DictionaryRenderer.d.ts +2 -5
  182. package/renderers/PointCloudClassBreaksRenderer.d.ts +2 -1
  183. package/renderers/PointCloudRenderer.d.ts +3 -6
  184. package/renderers/PointCloudStretchRenderer.d.ts +2 -1
  185. package/renderers/PointCloudUniqueValueRenderer.d.ts +2 -1
  186. package/renderers/RasterShadedReliefRenderer.d.ts +2 -3
  187. package/renderers/RasterStretchRenderer.d.ts +1 -1
  188. package/renderers/Renderer.d.ts +2 -2
  189. package/renderers/VectorFieldRenderer.d.ts +4 -3
  190. package/renderers/support/AuthoringInfo.d.ts +2 -25
  191. package/renderers/support/AuthoringInfoVisualVariable.d.ts +2 -17
  192. package/renderers/support/RasterPresetRenderer.d.ts +1 -1
  193. package/renderers/support/RendererLegendOptions.d.ts +1 -4
  194. package/renderers/support/jsonUtils.d.ts +1 -1
  195. package/renderers/support/pointCloud/types.d.ts +10 -0
  196. package/renderers/support/raster/types.d.ts +54 -0
  197. package/renderers/support/types.d.ts +44 -0
  198. package/renderers/support/utils.d.ts +1 -1
  199. package/renderers/types.d.ts +16 -6
  200. package/renderers.d.ts +1 -1
  201. package/rest/knowledgeGraph/GraphObject.d.ts +1 -1
  202. package/rest/knowledgeGraph/GraphObject.js +1 -1
  203. package/smartMapping/labels/bins.d.ts +1 -1
  204. package/smartMapping/popup/clusters.d.ts +1 -1
  205. package/smartMapping/popup/templates.d.ts +1 -1
  206. package/smartMapping/raster/renderers/classBreaks.d.ts +1 -1
  207. package/smartMapping/raster/renderers/rgb.d.ts +1 -1
  208. package/smartMapping/raster/renderers/stretch.d.ts +1 -1
  209. package/smartMapping/raster/support/utils.d.ts +1 -1
  210. package/smartMapping/renderers/color.d.ts +1 -2
  211. package/smartMapping/renderers/pieChart.d.ts +1 -1
  212. package/smartMapping/renderers/predominance.d.ts +1 -1
  213. package/smartMapping/renderers/size.d.ts +1 -2
  214. package/smartMapping/renderers/support/rendererUtils.d.ts +1 -1
  215. package/smartMapping/renderers/univariateColorSize.d.ts +1 -1
  216. package/support/revision.js +1 -1
  217. package/unionTypes.d.ts +23 -7
  218. package/views/2d/engine/Stage.js +1 -1
  219. package/views/2d/engine/vectorTiles/VectorTileContainer.js +1 -1
  220. package/views/2d/engine/vectorTiles/shaders/sources/shaderRepository.js +1 -1
  221. package/views/2d/engine/webgl/Painter.js +1 -1
  222. package/views/2d/engine/webgl/TileContainer.js +1 -1
  223. package/views/2d/engine/webgl/WGLContainer.js +1 -1
  224. package/views/2d/engine/webgl/mesh/templates/templateUtils.js +1 -1
  225. package/views/2d/engine/webgl/shaderGraph/techniques/Technique.js +1 -1
  226. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/BloomShader.js +1 -1
  227. package/views/2d/engine/webgl/shaders/sources/shaderRepository.js +1 -1
  228. package/views/2d/layers/FeatureLayerView2D.js +1 -1
  229. package/views/2d/layers/features/FeaturePipelineWorkerProxy.d.ts +2 -2
  230. package/views/2d/layers/features/FeatureStoreQueryAdapter.js +1 -1
  231. package/views/2d/layers/features/layerAdapters/ParquetLayerAdapter.js +1 -1
  232. package/views/2d/layers/features/sources/FeatureSourceQueryInfo.js +1 -1
  233. package/views/2d/layers/features/sources/strategies/ParquetSnapshotLoadStrategy.js +1 -1
  234. package/views/2d/layers/features/sources/strategies/ParquetTileLoadStrategy.js +1 -1
  235. package/views/2d/layers/features/sources/strategies/chunks/ASourceChunk.js +1 -1
  236. package/views/2d/layers/features/sources/strategies/chunks/FeatureSnapshotSourceChunk.js +1 -1
  237. package/views/2d/layers/features/sources/strategies/chunks/ParquetSourceChunk.js +1 -1
  238. package/views/2d/layers/features/support/FeatureSetReaderParquet.js +1 -1
  239. package/views/2d/layers/features/support/Tile.js +1 -1
  240. package/views/2d/layers/graphics/AGraphicContainer.js +1 -1
  241. package/views/2d/layers/graphics/GraphicContainer.js +1 -1
  242. package/views/2d/layers/support/DebouncedFeatureOverride.js +1 -1
  243. package/views/2d/layers/support/DebugOverlay.js +1 -1
  244. package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementResult.d.ts +1 -1
  245. package/views/3d/environment/ChapmanAtmosphere.js +1 -1
  246. package/views/3d/environment/Fog.js +1 -1
  247. package/views/3d/layers/PointCloudLayerView3D.js +1 -1
  248. package/views/3d/layers/graphics/Graphics3DFeatureStore.js +1 -1
  249. package/views/3d/layers/graphics/pipeline/featureSet/TiledFeatureStore.js +1 -1
  250. package/views/3d/layers/i3s/I3SQueryFeatureAdapter.js +1 -1
  251. package/views/3d/state/ViewStateManager.js +1 -1
  252. package/views/3d/webgl-engine/effects/haze/Haze.js +1 -1
  253. package/views/3d/webgl-engine/lib/RenderFeature.js +1 -1
  254. package/views/3d/webgl-engine/lib/Renderer.js +1 -1
  255. package/views/3d/webgl-engine/lib/Viewshed.js +1 -1
  256. package/views/BreakpointsOwner.d.ts +26 -21
  257. package/views/DOMContainer.d.ts +2 -1
  258. package/views/MapView.d.ts +3 -3
  259. package/views/SceneView.d.ts +3 -3
  260. package/views/View.d.ts +2 -2
  261. package/views/View2D.js +1 -1
  262. package/views/Viewport2DMixin.d.ts +3 -2
  263. package/views/analysis/ElevationProfile/ElevationProfileResult.d.ts +1 -1
  264. package/views/interactive/snapping/LineSnapper.js +1 -1
  265. package/views/interactive/snapping/ParallelLineSnapper.js +1 -1
  266. package/views/interactive/snapping/RightAngleSnapper.js +1 -1
  267. package/views/interactive/snapping/RightAngleTriangleSnapper.js +1 -1
  268. package/views/interactive/snapping/featureSources/featureServiceSource/FeatureServiceSnappingSourceWorker.js +1 -1
  269. package/views/interactive/snapping/featureSources/featureServiceSource/FeatureServiceTileStore.js +1 -1
  270. package/views/interactive/snapping/featureSources/featureServiceSource/FeatureServiceTiledFetcher.js +1 -1
  271. package/views/layers/BuildingSceneLayerView.d.ts +1 -1
  272. package/widgets/Feature/support/arcadeFeatureUtils.js +1 -1
  273. package/widgets/FeatureForm/FeatureFormViewModel.d.ts +2 -2
  274. package/widgets/Features/FeaturesViewModel.d.ts +1 -1
  275. package/widgets/Home/HomeViewModel.d.ts +1 -1
  276. package/widgets/Locate/LocateViewModel.d.ts +2 -2
  277. package/widgets/Slice/SliceViewModel.d.ts +2 -1
  278. package/widgets/TimeSlider/TimeSliderViewModel.d.ts +1 -1
  279. package/widgets/UtilityNetworkValidateTopology/UtilityNetworkValidateTopologyViewModel.js +1 -1
  280. package/widgets/types.d.ts +1 -1
  281. package/analysis/FeatureReference.d.ts +0 -19
  282. package/analysis/VolumeMeasurement/volumeMeasurementUtils.js +0 -5
  283. package/analysis/support/SliceAnalysisExcludedLayer.js +0 -5
  284. package/assets/esri/core/workers/chunks/00f044370bf3bb6b24d7.js +0 -1
  285. package/assets/esri/core/workers/chunks/0136cd1a5da204b6daeb.js +0 -1
  286. package/assets/esri/core/workers/chunks/097001462d93b78b64f4.js +0 -1
  287. package/assets/esri/core/workers/chunks/0fcb40204db8ee5571c3.js +0 -1
  288. package/assets/esri/core/workers/chunks/13167bdd486b41163147.js +0 -1
  289. package/assets/esri/core/workers/chunks/1363345f31f4f5051132.js +0 -1
  290. package/assets/esri/core/workers/chunks/13be94357dcf5afc4fcb.js +0 -1
  291. package/assets/esri/core/workers/chunks/1693f19f1c37e0a2087e.js +0 -1
  292. package/assets/esri/core/workers/chunks/18c4cd160a4052b05831.js +0 -1
  293. package/assets/esri/core/workers/chunks/18ce7b1559a45d017c45.js +0 -1
  294. package/assets/esri/core/workers/chunks/1dc3ab52fcde7bff0f23.js +0 -1
  295. package/assets/esri/core/workers/chunks/27794d48c04a5875fd22.js +0 -1
  296. package/assets/esri/core/workers/chunks/2a66841243975cac3e3c.js +0 -1
  297. package/assets/esri/core/workers/chunks/2c12848e4934e9bb2bd0.js +0 -1
  298. package/assets/esri/core/workers/chunks/311c4914a4f69f3c1525.js +0 -1
  299. package/assets/esri/core/workers/chunks/35cbc61a006351620ead.js +0 -1
  300. package/assets/esri/core/workers/chunks/36a04be40369111a633d.js +0 -1
  301. package/assets/esri/core/workers/chunks/3b5e71b156244789f624.js +0 -1
  302. package/assets/esri/core/workers/chunks/3dd0db77a05263000bd8.js +0 -1
  303. package/assets/esri/core/workers/chunks/5047acfd66539eefe353.js +0 -1
  304. package/assets/esri/core/workers/chunks/51fd6662245b920af652.js +0 -1
  305. package/assets/esri/core/workers/chunks/58419d362f24b35003c1.js +0 -1
  306. package/assets/esri/core/workers/chunks/58cf5b9a6aa685fc3367.js +0 -1
  307. package/assets/esri/core/workers/chunks/5ffeb8fb58d59bad68c3.js +0 -1
  308. package/assets/esri/core/workers/chunks/6d09965ab2bff9da88b6.js +0 -1
  309. package/assets/esri/core/workers/chunks/700122f775b98a7ed353.js +0 -1
  310. package/assets/esri/core/workers/chunks/7353d78feba7e6302b6e.js +0 -1
  311. package/assets/esri/core/workers/chunks/7737e69da604d2521da8.js +0 -1
  312. package/assets/esri/core/workers/chunks/7ba31425caa404f86424.js +0 -1
  313. package/assets/esri/core/workers/chunks/7cd0ab01933bfb2c6e43.js +0 -1
  314. package/assets/esri/core/workers/chunks/80c36f1786ae0be00962.js +0 -1
  315. package/assets/esri/core/workers/chunks/81c2cc77c275a5b555c0.js +0 -1
  316. package/assets/esri/core/workers/chunks/8892bf3d2367e35de001.js +0 -1
  317. package/assets/esri/core/workers/chunks/8d941204425571b656ec.js +0 -1
  318. package/assets/esri/core/workers/chunks/973bf2ed34d57f299472.js +0 -1
  319. package/assets/esri/core/workers/chunks/9b6e2099aabf67b9f9f2.js +0 -1
  320. package/assets/esri/core/workers/chunks/a6b1e3ec30f6d641aea9.js +0 -1
  321. package/assets/esri/core/workers/chunks/a8f7e44657083f6aa3fd.js +0 -1
  322. package/assets/esri/core/workers/chunks/b648a1e641cf5c772d67.js +0 -1
  323. package/assets/esri/core/workers/chunks/b91c13f44f4d1bac5799.js +0 -1
  324. package/assets/esri/core/workers/chunks/be6cc8a1485961f22372.js +0 -1
  325. package/assets/esri/core/workers/chunks/c91201b37d1cb3875fb4.js +0 -1
  326. package/assets/esri/core/workers/chunks/d22e0d733bfe821c0510.js +0 -1
  327. package/assets/esri/core/workers/chunks/d54988c21ea5667d00b7.js +0 -1
  328. package/assets/esri/core/workers/chunks/d62193323c67b379dee3.js +0 -1
  329. package/assets/esri/core/workers/chunks/d65ca3b8fccae8c3c3fa.js +0 -1
  330. package/assets/esri/core/workers/chunks/d8dc130ea559be1f68c6.js +0 -1
  331. package/assets/esri/core/workers/chunks/dcf6f7001f470f76bd3e.js +0 -1
  332. package/assets/esri/core/workers/chunks/e00d56ae5e68267fe269.js +0 -1
  333. package/assets/esri/core/workers/chunks/e2c7c269be93c552dc5b.js +0 -1
  334. package/assets/esri/core/workers/chunks/e4d593ddcbcf06010ab0.js +0 -1
  335. package/assets/esri/core/workers/chunks/f286f13686f003c5eec5.js +0 -1
  336. package/assets/esri/core/workers/chunks/fb6670a929b7333f1764.js +0 -1
  337. package/assets/esri/core/workers/chunks/fbdf553253cf8f22c022.js +0 -1
  338. package/assets/esri/core/workers/chunks/fc10c738bae304721ab2.js +0 -1
  339. package/assets/esri/core/workers/chunks/ff79c2cb28db7e0a1fc4.js +0 -1
  340. package/assets/esri/core/workers/chunks/ffdf1cbc1e54414d0f96.js +0 -1
  341. package/renderers/support/colorRampUtils.d.ts +0 -4
  342. package/renderers/support/pointCloudTypeUtils.d.ts +0 -6
  343. package/renderers/support/rasterRendererHelper.d.ts +0 -37
  344. package/renderers/support/rasterTypeUtils.d.ts +0 -9
  345. package/renderers/support/typeUtils.d.ts +0 -11
  346. /package/analysis/{dimensionUtils.d.ts → Dimension/types.d.ts} +0 -0
  347. /package/analysis/VolumeMeasurement/{volumeMeasurementUtils.d.ts → types.d.ts} +0 -0
@@ -1,4 +1,4 @@
1
- import type { IMessage } from "../../../../layers/support/StreamConnection.js";
1
+ import type { Message } from "../../../../layers/support/StreamConnection.js";
2
2
  import type { Feature } from "../../../../portal/jsonTypes.js";
3
3
 
4
4
  export interface IProxyClientEvents {
@@ -12,7 +12,7 @@ export interface IProxyClientEvents {
12
12
  *
13
13
  * @since 4.26
14
14
  */
15
- "message-received": IMessage;
15
+ "message-received": Message;
16
16
  /**
17
17
  * Fires after the layer starts receiving updates from the stream service. It will return the websocket and the client update rates per second.
18
18
  * The update rate indicates number of features are being pushed from the server and being processed on the client side.
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{OptimizedFeature as t}from"../../../../layers/graphics/OptimizedFeature.js";import{FeatureSetReaderJSON as e}from"./support/FeatureSetReaderJSON.js";class r{static{this.Shared=new r}getObjectId(t){return t.getObjectId()}getAttributes(t){return t.readAttributes()}getAttribute(t,e){return t.readAttribute(e)}getAttributeAsTimestamp(t,e){return t.readAttributeAsTimestamp(e)}cloneWithGeometry(r,a){const i=r.readAttributes(),s=new t(a,i,null,r.getObjectId(),r.getDisplayId()),d=e.fromOptimizedFeatures([s],r.metadata);return d.setIndex(0),d}getGeometry(t){return t.readGeometryWorldSpace()}getCentroid(t,e){return t.readCentroidForDisplay()}}export{r as FeatureStoreQueryAdapter};
5
+ import{OptimizedFeature as t}from"../../../../layers/graphics/OptimizedFeature.js";import{FeatureSetReaderJSON as e}from"./support/FeatureSetReaderJSON.js";class r{static{this.Shared=new r}getObjectId(t){return t.getObjectId()}getAttributes(t){return t.readAttributes()}getAttribute(t,e){return t.readAttribute(e)}getAttributeAsTimestamp(t,e){return t.readAttributeAsTimestamp(e)}cloneWithGeometry(r,a,i){const s=r.readAttributes(),d=new t(a,s,null,r.getObjectId(),r.getDisplayId()),u=e.fromOptimizedFeatures([d],r.metadata);return u.setIndex(0),u}getGeometry(t){return t.readGeometryWorldSpace()}getCentroid(t,e){return t.readCentroidForDisplay()}}export{r as FeatureStoreQueryAdapter};
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import e from"../../../../../core/Error.js";import{toParquetJSONGeometryType as r}from"../../../../../layers/support/parquetUtils.js";import{getEffectiveFeatureReduction as t}from"./featureReductionUtils.js";import{getServiceGeometryType as i}from"./geometryUtils.js";import{getFeatureReductionDeconflictionEnabled as l,getLayerDeconflictionEnabled as a,createLabelVVEvaluator as s}from"./labelingUtils.js";import{createSimpleProcessorSchema as o}from"../schema/processor/SimpleProcessorSchema.js";import{isRendererSupported as n}from"../support/rendererUtils.js";class y{constructor(e){this.layer=e}get hasRequiredSupport(){return n(this.layer.renderer)}get timeOptions(){return null}getLabelingDeconflictionInfo(e){const r=this.layer,i=l(r,e)??a(r),o=t(r,e),n=[...r.labelingInfo||[],...o?.labelingInfo||[]];return[{vvEvaluators:{0:s(r.renderer)},deconflictionEnabled:i,labelingInfo:n}]}getUpdateHashProperties(e){return[()=>this.layer.urls.join(","),()=>this.layer.outFields,()=>this.layer.labelsVisible?this.layer.labelingInfo:null,()=>t(this.layer,e),()=>this.layer.customParameters,()=>this.layer.orderBy,()=>this.layer.renderer,()=>this.layer.popupTemplate]}async createSourceSchema(e,r){const t=this._createServiceInfo(e),i=e.availableFields.includes("*")?this.layer.fields.map(e=>e.name):e.availableFields,l={partial:{urls:[...this.layer.urls.items],availableFields:i},full:{definitionExpression:null,sourceRefreshVersion:r,customParameters:this.layer.customParameters??null}};return{type:"parquet",service:t,strategy:this._createStrategy(t,l)}}_createStrategy(e,r){return e.geometryInfo.displayOptimization?{type:"xz",...r}:{type:"snapshot",...r}}createProcessorSchema(e,r,i){const l={fields:this.layer.fields.map(e=>e.toJSON()),renderer:this.layer.renderer?.clone(),labelingInfoSource:this.layer.id,featureReduction:t(this.layer,r),geometryType:this.layer.geometryType,labelingInfo:this.layer.labelingInfo,labelsVisible:this.layer.labelsVisible,objectIdField:this.layer.objectIdField,orderBy:this.layer.orderBy};return o(e,r,l,i)}setGraphicOrigin(e){e.origin=this.layer.graphicOrigin}setAggregateGraphicOrigin(e){e.origin=this.layer.aggregateGraphicOrigin}_createServiceInfo(t){const l=i(this.layer),a=t.spatialReference.toJSON(),s=this.layer.geometryEncoding;if(null==s)throw new e("parquet-layer:unsupported","creating a parquet layer view requires a geometry encoding",{layer:this.layer});return{type:"parquet",outSpatialReference:a,geometryInfo:{geometryType:r(this.layer.geometryType),spatialReference:this.layer.spatialReference.toJSON(),geometryEncoding:s.toJSON(),displayOptimization:this.layer.displayOptimization},metadata:{spatialReference:this.layer.spatialReference.toJSON(),outSpatialReference:a,fieldsIndex:this.layer.fieldsIndex.toJSON(),featureIdInfo:{type:"object-id",fieldName:this.layer.objectIdField},geometryType:l,types:null,subtypes:null,timeInfo:null,typeIdField:null,subtypeField:null,globalIdField:null,timeReferenceUnknownClient:null,dateFieldsTimeZone:null}}}}export{y as ParquetLayerAdapter};
5
+ import e from"../../../../../core/Error.js";import{toParquetJSONGeometryType as r}from"../../../../../layers/support/parquetUtils.js";import{getEffectiveFeatureReduction as t}from"./featureReductionUtils.js";import{getServiceGeometryType as i}from"./geometryUtils.js";import{getFeatureReductionDeconflictionEnabled as l,getLayerDeconflictionEnabled as a,createLabelVVEvaluator as s}from"./labelingUtils.js";import{createSimpleProcessorSchema as n}from"../schema/processor/SimpleProcessorSchema.js";import{isRendererSupported as o}from"../support/rendererUtils.js";class y{constructor(e){this.layer=e}get hasRequiredSupport(){return o(this.layer.renderer)}get timeOptions(){return null}getLabelingDeconflictionInfo(e){const r=this.layer,i=l(r,e)??a(r),n=t(r,e),o=[...r.labelingInfo||[],...n?.labelingInfo||[]];return[{vvEvaluators:{0:s(r.renderer)},deconflictionEnabled:i,labelingInfo:o}]}getUpdateHashProperties(e){return[()=>this.layer.urls.join(","),()=>this.layer.outFields,()=>this.layer.labelsVisible?this.layer.labelingInfo:null,()=>t(this.layer,e),()=>this.layer.customParameters,()=>this.layer.orderBy,()=>this.layer.renderer,()=>this.layer.popupTemplate]}async createSourceSchema(e,r){const t=this._createServiceInfo(e),i=e.availableFields.includes("*")?this.layer.fields.map(e=>e.name):e.availableFields,l={partial:{urls:[...this.layer.urls.items],availableFields:i},full:{definitionExpression:null,sourceRefreshVersion:r,customParameters:this.layer.customParameters??null}};return{type:"parquet",service:t,strategy:this._createStrategy(t,l)}}_createStrategy(e,r){return e.geometryInfo.displayOptimization?{type:"xz",...r}:{type:"snapshot",...r}}createProcessorSchema(e,r,i){const l={fields:this.layer.fields.map(e=>e.toJSON()),renderer:this.layer.renderer?.clone(),labelingInfoSource:this.layer.id,featureReduction:t(this.layer,r),geometryType:this.layer.geometryType,labelingInfo:this.layer.labelingInfo,labelsVisible:this.layer.labelsVisible,objectIdField:this.layer.objectIdField,orderBy:this.layer.orderBy};return n(e,r,l,i)}setGraphicOrigin(e){e.origin=this.layer.graphicOrigin}setAggregateGraphicOrigin(e){e.origin=this.layer.aggregateGraphicOrigin}_createServiceInfo(t){const l=i(this.layer),a=t.spatialReference.toJSON(),s=this.layer.geometryEncoding;if(null==s&&null==this.layer.displayOptimization)throw new e("parquet-layer:unsupported","creating a parquet layer view requires an encoding",{layer:this.layer});return{type:"parquet",outSpatialReference:a,geometryInfo:{geometry:s?{geometryType:r(this.layer.geometryType),spatialReference:this.layer.spatialReference.toJSON(),encoding:s.toJSON()}:null,displayOptimization:this.layer.displayOptimization},metadata:{spatialReference:this.layer.spatialReference.toJSON(),outSpatialReference:a,fieldsIndex:this.layer.fieldsIndex.toJSON(),featureIdInfo:{type:"object-id",fieldName:this.layer.objectIdField},geometryType:l,types:null,subtypes:null,timeInfo:null,typeIdField:null,subtypeField:null,globalIdField:null,timeReferenceUnknownClient:null,dateFieldsTimeZone:null}}}}export{y as ParquetLayerAdapter};
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import has from"../../../../../core/has.js";import{sqlAnd as e}from"../../../../../core/sql.js";import t from"../../../../../geometry/SpatialReference.js";import{getClauseForScaleRange as r}from"../../../../../layers/support/displayFilterUtils.js";import a from"../../../../../rest/support/Query.js";import i from"../../../../../time/TimeExtent.js";const s=4;function o(e){switch(e.type){case"object-id":case"unique-id-simple":return`${e.fieldName} ASC`;case"unique-id-composite":return`${e.fieldNames.join(",")} ASC`}}function n(e,r,a){const s=o(a.featureIdInfo);return{returnCentroid:"esriGeometryPolygon"===a.serviceGeometryType&&!e.queryMetadata.supportsCentroidOnDegeneratedQuantizedGeometry&&!e.queryMetadata.supportsDegeneratedQuantizedGeometry,returnGeometry:!0,timeReferenceUnknownClient:a.timeReferenceUnknownClient??void 0,outSpatialReference:t.fromJSON(e.outSpatialReference),orderByFields:"memory"===e.type?[]:[s],where:r.definitionExpression??"1=1",outFields:r.availableFields,multipatchOption:"esriGeometryMultiPatch"===a.serviceGeometryType?"xyFootprint":null,gdbVersion:r.gdbVersion,historicMoment:r.historicMoment?new Date(r.historicMoment):null,timeExtent:r.timeExtent?i.fromJSON(r.timeExtent):null}}class u{static create(e,t,r){const a=t.queryScaleRanges,i=t.displayFilterInfo;return new u(n(e,t,r),i,a,r.subtypeField,t.customParameters,r.geometryType,e.queryMetadata)}constructor(e,t,r,a,i,s,o){this._queryParams=e,this._displayFilter=t,this._queryScaleRanges=r,this._subtypeField=a,this._customParameters=i,this._geometryType=s,this._queryMetadata=o}get pageSize(){if(null==this._queryMetadata)throw new Error("InternalError: Service does not support paged queries");const e=this._queryMetadata.supportsMaxRecordCountFactor?s:null,t=(this._queryMetadata.maxRecordCount??8e3)*(e??1);return Math.min(8e3,t)}get objectIdsQueryPageSize(){return this._queryMetadata?.maxRecordCount??2e3}updateHistoricMoment(e){this._queryParams.historicMoment=e}updateFields(e){this._queryParams.outFields=e}createPatchFieldsQuery(e,t,r){if(!t.getSize())return null;const a=e.clone();if("*"===this._queryParams.outFields[0]){if("*"===(a.outFields??[])[0])return null;a.outFields=this._queryParams.outFields}else{const e=new Set(this._queryParams.outFields),r=[];for(const a of e)t.hasField(a)||r.push(a);if(0===r.length)return null;a.outFields=r}a.returnGeometry=!1,a.returnCentroid=!1,a.quantizationParameters=null,a.cacheHint=!0;const i={inner:a,customParameters:this._customParameters};if(has("esri-tiles-debug")&&null!=r){const e=r.chunkId.toString().replaceAll("/",".");i.customParameters=i.customParameters?{...i.customParameters,chunkId:e}:{chunkId:e}}return i}createQuery(e={}){if(!this._queryParams)throw new Error("InternalError: queryInfo should be defined");return{inner:new a({...this._queryParams,...e}),customParameters:this._customParameters}}createTileQuery(t,a){if(null==this._queryMetadata)throw new Error("InternalError: Service does not support tile queries");const i=this.createQuery(a),o=i.inner;if(this._queryScaleRanges?.length){const r=this._queryScaleRanges.filter(e=>(!e.minScale||e.minScale>=t.maxScale)&&(!e.maxScale||e.maxScale<=t.minScale)).map(e=>e.subtypeCode);if(r.length){const t=`${this._subtypeField} IN (${r})`;o.where=e(o.where,t)}}if(this._displayFilter&&(o.where=e(o.where,r(this._displayFilter,t.minScale,t.maxScale))),o.quantizationParameters=a.quantizationParameters??t.getQuantizationParameters(),o.resultType="tile",o.geometry=t.extent,this._queryMetadata.supportsQuantization?"esriGeometryPolyline"===this._geometryType&&(o.maxAllowableOffset=t.resolution*has("feature-polyline-generalization-factor")):"esriGeometryPolyline"!==this._geometryType&&"esriGeometryPolygon"!==this._geometryType||(o.maxAllowableOffset=t.resolution,"esriGeometryPolyline"===this._geometryType&&(o.maxAllowableOffset*=has("feature-polyline-generalization-factor"))),o.defaultSpatialReferenceEnabled=this._queryMetadata.supportsDefaultSpatialReference,o.compactGeometryEnabled=this._queryMetadata.supportsCompactGeometry,this._queryMetadata.supportsMaxRecordCountFactor&&(o.maxRecordCountFactor=s),has("esri-tiles-debug")){const e=t.id.replaceAll("/",".");i.customParameters=i.customParameters?{...i.customParameters,tileId:e}:{tileId:e}}return i}createPagedTileQuery(e,t){const r=this.pageSize;return this.createTileQuery(e,{start:r*t,num:r,returnExceededLimitFeatures:!0})}createPagedQuery(e,t){const r=this.pageSize;return this.createQuery({start:r*e,num:r,returnExceededLimitFeatures:!0,maxRecordCountFactor:s,quantizationParameters:t,cacheHint:!0})}createObjectIdsQuery(e){return this.createQuery({objectIds:e,outFields:["*"]})}}export{u as FeatureSourceQueryInfo};
5
+ import has from"../../../../../core/has.js";import{sqlAnd as e}from"../../../../../core/sql.js";import t from"../../../../../geometry/SpatialReference.js";import{getClauseForScaleRange as r}from"../../../../../layers/support/displayFilterUtils.js";import a from"../../../../../rest/support/Query.js";import i from"../../../../../time/TimeExtent.js";const s=4;function o(e){switch(e.type){case"object-id":case"unique-id-simple":return`${e.fieldName} ASC`;case"unique-id-composite":return`${e.fieldNames.join(",")} ASC`}}function n(e,r,a){const s=o(a.featureIdInfo);return{returnCentroid:"esriGeometryPolygon"===a.serviceGeometryType&&!e.queryMetadata.supportsCentroidOnDegeneratedQuantizedGeometry&&!e.queryMetadata.supportsDegeneratedQuantizedGeometry,returnGeometry:!0,timeReferenceUnknownClient:a.timeReferenceUnknownClient??void 0,outSpatialReference:t.fromJSON(e.outSpatialReference),orderByFields:"memory"===e.type?[]:[s],where:r.definitionExpression??"1=1",outFields:r.availableFields,multipatchOption:"esriGeometryMultiPatch"===a.serviceGeometryType?"xyFootprint":null,gdbVersion:r.gdbVersion,historicMoment:r.historicMoment?new Date(r.historicMoment):null,timeExtent:r.timeExtent?i.fromJSON(r.timeExtent):null}}class u{static create(e,t,r){const a=t.queryScaleRanges,i=t.displayFilterInfo;return new u(n(e,t,r),i,a,r.subtypeField,t.customParameters,r.geometryType,e.queryMetadata)}constructor(e,t,r,a,i,s,o){this._queryParams=e,this._displayFilter=t,this._queryScaleRanges=r,this._subtypeField=a,this._customParameters=i,this._geometryType=s,this._queryMetadata=o}get pageSize(){if(null==this._queryMetadata)throw new Error("InternalError: Service does not support paged queries");const e=this._queryMetadata.supportsMaxRecordCountFactor?s:null,t=(this._queryMetadata.maxRecordCount??8e3)*(e??1);return Math.min(8e3,t)}get objectIdsQueryPageSize(){return this._queryMetadata?.maxRecordCount??2e3}updateHistoricMoment(e){this._queryParams.historicMoment=e}updateFields(e){this._queryParams.outFields=e}createPatchFieldsQuery(e,t,r){if(!t.getSize())return null;const a=e.clone();if("*"===this._queryParams.outFields[0]){if("*"===(a.outFields??[])[0])return null;a.outFields=this._queryParams.outFields}else{const e=new Set(this._queryParams.outFields),r=[];for(const a of e)t.hasField(a)||r.push(a);if(0===r.length)return null;a.outFields=r}a.returnGeometry=!1,a.returnCentroid=!1,a.quantizationParameters=null,a.cacheHint=!0;const i={inner:a,customParameters:this._customParameters};if(has("esri-tiles-debug")&&null!=r){const e=r.chunkId.toString().replaceAll("/",".");i.customParameters=i.customParameters?{...i.customParameters,chunkId:e}:{chunkId:e}}return i}createQuery(e={}){if(!this._queryParams)throw new Error("InternalError: queryInfo should be defined");return{inner:new a({...this._queryParams,...e}),customParameters:this._customParameters}}createTileQuery(t,a){if(null==this._queryMetadata)throw new Error("InternalError: Service does not support tile queries");const i=this.createQuery(a),o=i.inner;if(this._queryScaleRanges?.length){const r=this._queryScaleRanges.filter(e=>(!e.minScale||e.minScale>=t.maxScale)&&(!e.maxScale||e.maxScale<=t.minScale)).map(e=>e.subtypeCode);if(r.length){const t=`${this._subtypeField} IN (${r})`;o.where=e(o.where,t)}}if(this._displayFilter&&(o.where=e(o.where,r(this._displayFilter,t.minScale,t.maxScale))),o.quantizationParameters=a.quantizationParameters??t.getQuantizationParameters(),o.resultType="tile",o.geometry=t.hydratedExtent,this._queryMetadata.supportsQuantization?"esriGeometryPolyline"===this._geometryType&&(o.maxAllowableOffset=t.resolution*has("feature-polyline-generalization-factor")):"esriGeometryPolyline"!==this._geometryType&&"esriGeometryPolygon"!==this._geometryType||(o.maxAllowableOffset=t.resolution,"esriGeometryPolyline"===this._geometryType&&(o.maxAllowableOffset*=has("feature-polyline-generalization-factor"))),o.defaultSpatialReferenceEnabled=this._queryMetadata.supportsDefaultSpatialReference,o.compactGeometryEnabled=this._queryMetadata.supportsCompactGeometry,this._queryMetadata.supportsMaxRecordCountFactor&&(o.maxRecordCountFactor=s),has("esri-tiles-debug")){const e=t.id.replaceAll("/",".");i.customParameters=i.customParameters?{...i.customParameters,tileId:e}:{tileId:e}}return i}createPagedTileQuery(e,t){const r=this.pageSize;return this.createTileQuery(e,{start:r*t,num:r,returnExceededLimitFeatures:!0})}createPagedQuery(e,t){const r=this.pageSize;return this.createQuery({start:r*e,num:r,returnExceededLimitFeatures:!0,maxRecordCountFactor:s,quantizationParameters:t,cacheHint:!0})}createObjectIdsQuery(e){return this.createQuery({objectIds:e,outFields:["*"]})}}export{u as FeatureSourceQueryInfo};
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import e from"../../../../../../core/Error.js";import{notDeepEqual as s}from"../../../../../../core/object.js";import{throwIfAborted as t}from"../../../../../../core/promiseUtils.js";import{difference as i}from"../../../../../../core/SetUtils.js";import r from"../../../../../../layers/support/FieldsIndex.js";import{createParquetFile as a}from"../../../../../../libs/parquet/parquet.js";import{ALoadStrategy as o}from"./ALoadStrategy.js";import{FeatureSnapshotSourceChunk as l}from"./chunks/FeatureSnapshotSourceChunk.js";import{FeatureSetReaderJSON as n}from"../../support/FeatureSetReaderJSON.js";import{FeatureSetReaderParquet as m}from"../../support/FeatureSetReaderParquet.js";class u extends o{constructor(e,s,t){super(e.metadata,s,t),this._service=e,this._chunkId=0,this._files=new Map}destroy(){super.destroy();for(const e of this._files.values())e.free();this._files.clear()}get about(){return{willQueryAllFeatures:!0,willQueryFullResolutionGeometry:!0}}get availableFields(){return this._schema.partial.availableFields}get definitionExpression(){return this._schema.full.definitionExpression}async tryUpdate(t,i){if(s(this.availableFields,i.availableFields)&&await this._updateFields(i.availableFields),s(this._schema.partial.urls,i.urls)){for(const e of i.urls)this._files.has(e)||await this._insert(e);for(const s of this._files.keys())if(!i.urls.includes(s))throw new e("unsupported","Removing parquet files is not supported",{previous:this._schema.partial.urls,next:i.urls})}return this._schema.partial=i,!0}async load(e){return null==this._promise&&(this._promise=this._download()),this._promise}unload(e){}_onOverride(){}async _updateFields(e){await this._promise;const s=new Set(e),t=i(s,new Set(this.availableFields)),r=this._fieldsIndex;if(null==r)return;const a=Array.from(t).map(e=>r.get(e)?.column);if(t.size)for(const i of this._files.values())await i.ensureFields(new Uint32Array(a))}async _insert(e){const s=await a(e,{geometryInfo:this._service.geometryInfo,outSpatialReference:this._service.outSpatialReference,getCustomParameters:()=>this._schema.full.customParameters}),i=this._files.size;this._files.set(e,s),t(this._options);const o=s.fields().map(e=>({name:e.name,alias:e.name,type:e.type,column:s.columnForFieldName(e.name)})),{timeZoneByFieldName:n}=this._service.metadata.fieldsIndex,u=r.fromJSON({fields:o,timeZoneByFieldName:n});this._fieldsIndex=u;const h=new Uint32Array(Array.from(this.availableFields.values()).map(e=>u.get(e)?.column).filter(e=>null!=e));await s.readAllChunks(h,this._signal,e=>{if(this._signal.aborted)return;const s=this._chunkId++,t=new m(this.metadata,u,e,s,i),r=new l(t,null,s,!1);this.store.insert(r)})}async _download(){try{await Promise.all(this._schema.partial.urls.map(e=>this._insert(e)));const e=new l(n.empty(this.metadata),null,-1,!0);this.store.insert(e)}catch(e){throw console.error(e),e}}}export{u as ParquetSnapshotLoadStrategy};
5
+ import e from"../../../../../../core/Error.js";import{notDeepEqual as s}from"../../../../../../core/object.js";import{throwIfAborted as t}from"../../../../../../core/promiseUtils.js";import{difference as i}from"../../../../../../core/SetUtils.js";import r from"../../../../../../layers/support/FieldsIndex.js";import{loadParquetModule as a}from"../../../../../../libs/parquet/loadParquetModule.js";import{createParquetFile as l}from"../../../../../../libs/parquet/parquet.js";import{ALoadStrategy as o}from"./ALoadStrategy.js";import{FeatureSnapshotSourceChunk as n}from"./chunks/FeatureSnapshotSourceChunk.js";import{FeatureSetReaderJSON as u}from"../../support/FeatureSetReaderJSON.js";import{FeatureSetReaderParquet as h}from"../../support/FeatureSetReaderParquet.js";const m=12;class d extends o{constructor(e,s,t){super(e.metadata,s,t),this._service=e,this._chunkId=0,this._files=new Map,this._chunksByFile=new Map}destroy(){super.destroy();for(const{file:e}of this._files.values())e.free();this._files.clear()}get about(){return{willQueryAllFeatures:!0,willQueryFullResolutionGeometry:!0}}get availableFields(){return this._schema.partial.availableFields}get definitionExpression(){return this._schema.full.definitionExpression}async tryUpdate(t,i){if(s(this.availableFields,i.availableFields)&&await this._updateFields(i.availableFields),s(this._schema.partial.urls,i.urls)){for(const e of i.urls)this._files.has(e)||await this._insert(e);for(const s of this._files.keys())if(!i.urls.includes(s))throw new e("unsupported","Removing parquet files is not supported",{previous:this._schema.partial.urls,next:i.urls})}return this._schema.partial=i,!0}async load(e){return null==this._promise&&(this._promise=this._download()),this._promise}unload(e){}_onOverride(){}async _updateFields(e){await this._promise;const s=new Set(e),t=i(s,new Set(this.availableFields));if(null!=this._fieldsIndex&&t.size){const e=Array.from(t),s=[];for(const[t,i]of this._chunksByFile.entries()){const{file:r}=this._files.get(t);for(const t of i)s.push(r.updateChunkFields(t,e))}await Promise.all(s)}}_ensureFieldsIndex(e){if(!this._fieldsIndex){const s=e.fields(!1).map(s=>({name:s.name,alias:s.name,type:s.type,column:e.columnForFieldName(s.name)})),{timeZoneByFieldName:t}=this._service.metadata.fieldsIndex,i=r.fromJSON({fields:s,timeZoneByFieldName:t});this._fieldsIndex=i}return this._fieldsIndex}async _insert(e){const s=await a(),i=await l(e,{geometryInfo:this._service.geometryInfo,getCustomParameters:()=>this._schema.full.customParameters}),r=this._files.size;this._files.set(e,{file:i,fileId:r}),t(this._options);const o=this._ensureFieldsIndex(i),u=s.Query.new();u.setOutFields(this.availableFields.filter(e=>null!=o.get(e)?.column)),u.setReturnGeometry(!0),u.setOutSpatialReference(this.metadata.outSpatialReference.toJSON().wkid);const d=await i.executeQuery(u,this._signal);t(this._signal);const c=[],f=d.next(this._signal);for(let t=0;t<m;t++)c.push(d.next(this._signal));const p=[];this._chunksByFile.set(e,p);let _=await f;for(;null!=_;){t(this._signal),p.push(_);const e=this._chunkId++,s=new h(this.metadata,o,_,r),i=new n(s,null,e,!1);this.store.insert(i);const a=c.shift();c.push(d.next(this._signal)),_=await a}}async _download(){try{await Promise.all(this._schema.partial.urls.map(e=>this._insert(e)));const e=new n(u.empty(this.metadata),null,-1,!0);this.store.insert(e)}catch(e){throw console.error(e),e}}}export{d as ParquetSnapshotLoadStrategy};
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{notDeepEqual as e}from"../../../../../../core/object.js";import{QueueProcessor as t}from"../../../../../../core/QueueProcessor.js";import{difference as i,union as a}from"../../../../../../core/SetUtils.js";import s from"../../../../../../geometry/Polygon.js";import r from"../../../../../../geometry/SpatialReference.js";import{toExtent as n}from"../../../../../../geometry/support/aaBoundingRect.js";import{convertFromPolygon as o}from"../../../../../../layers/graphics/featureConversionUtils.js";import{project as l}from"../../../../../../layers/graphics/data/projectionSupport.js";import d from"../../../../../../layers/support/FieldsIndex.js";import{createParquetFile as m}from"../../../../../../libs/parquet/parquet.js";import{ALoadStrategy as u}from"./ALoadStrategy.js";import{fetchQueueConcurrency as h}from"./constants.js";import{ParquetSourceChunk as p}from"./chunks/ParquetSourceChunk.js";import{FeatureSetReaderParquet as f}from"../../support/FeatureSetReaderParquet.js";class c extends u{constructor(e,t,i){if(super(e.metadata,t,i),this._files=[],!e.geometryInfo.displayOptimization)throw new Error("InternalError: ParquetTileLoadStrategy only supports XZ-enabled parquet files");this._index=_.create(t.partial.urls,this.metadata,e,new Set(t.partial.availableFields),this.store,()=>t.full.customParameters)}destroy(){super.destroy();for(const e of this._files)e.free()}get about(){return{willQueryAllFeatures:!0,willQueryFullResolutionGeometry:!0}}get availableFields(){return this._schema.partial.availableFields}get definitionExpression(){return this._schema.full.definitionExpression}async tryUpdate(t,i){return e(this.availableFields,i.availableFields)&&await this._updateFields(i.availableFields),this._schema.partial=i,!0}async load(e){const t=await this._index;await t.ensureLoaded(e)}unload(e){this._index.then(t=>t.unload(e.tile))}_onOverride(){}async _updateFields(e){return(await this._index).updateFields(e)}}class _{static async create(e,t,i,a,s,r){const n=await Promise.all(e.map(e=>m(e,{geometryInfo:i.geometryInfo,outSpatialReference:i.outSpatialReference,getCustomParameters:r})));if(1!==n.length)throw new Error("InternalError: experimental parquet XZ display optimization only supports a single file.");const[o]=n,l=o.fields().map(e=>({name:e.name,alias:e.name,type:e.type,column:o.columnForFieldName(e.name)})),{timeZoneByFieldName:u}=i.metadata.fieldsIndex,h=d.fromJSON({fields:l,timeZoneByFieldName:u}),p=new Uint32Array(Array.from(a.values()).map(e=>h.get(e)?.column).filter(e=>null!=e)),f=i.geometryInfo.displayOptimization;if(!f)throw new Error("InternalError: tiled parquet load requires display optimization");return new _(t,await Promise.all(n),h,p,s,a,f)}constructor(e,i,a,s,r,n,o){this._metadata=e,this._files=i,this._fieldsIndex=a,this._fieldIndices=s,this._store=r,this._availableFields=n,this._displayOptimization=o,this.fileIndex=0,this._queue=new t({concurrency:h,process:e=>this._ensureLoaded(e)}),this._tileIdToChunkId=new Map}get file(){return this._files[0]}async ensureLoaded(e){return this._queue.push(e)}unload(e){const t=this._tileIdToChunkId.get(e.id);if(null!=t){for(const e of t)this._store.removeById(e);this._tileIdToChunkId.delete(e.id)}}async _ensureLoaded(e){const t=this._metadata.outSpatialReference,i=e.tile,{xmin:a,ymin:s,xmax:r,ymax:n}=y(i.extent,t);let o=0;const l={extent:i.extent,extent_lat_lng:{xmin:a,ymin:s,xmax:r,ymax:n},tile_level:i.level,attributes:this._fieldIndices};if("z"===this._displayOptimization.mode?await this.file.queryZChunks(l.extent_lat_lng,this._fieldIndices,e.signal,t=>{if(e.signal.aborted)return;const a=new f(this._metadata,this._fieldsIndex,t,o,this.fileIndex),s=new p(this._metadata,a,i,o++,!1);this._insertChunk(i,s)}):await this.file.queryXZChunks(l,e.signal,t=>{if(e.signal.aborted)return;const a=new f(this._metadata,this._fieldsIndex,t,o,this.fileIndex),s=new p(this._metadata,a,i,o++,!1);this._insertChunk(i,s)}),e.signal.aborted)return;const d=new p(this._metadata,null,i,o++,!0);this._insertChunk(i,d)}_insertChunk(e,t){let i=this._tileIdToChunkId.get(e.id);null==i&&(i=[],this._tileIdToChunkId.set(e.id,i)),i.push(t.chunkId),this._store.insert(t)}async updateFields(e){const t=new Set(e),s=i(t,this._availableFields);if(this._availableFields=a(s,this._availableFields),s.size)for(const i of this._files){const e=Array.from(s).map(e=>this._fieldsIndex.get(e)?.column);await i.ensureFields(new Uint32Array(e))}}}function y(e,t){const i=[e.xmin,e.ymin,e.xmax,e.ymax],a=s.fromExtent(n(i,t)),d=l(a,t,r.WGS84);if(!d)return null;const m=o(d,!1,!1),u=m.coords.filter((e,t)=>!(t%2)),h=m.coords.filter((e,t)=>t%2);return{xmin:Math.min(...u),ymin:Math.min(...h),xmax:Math.max(...u),ymax:Math.max(...h)}}export{c as ParquetTileLoadStrategy};
5
+ import e from"../../../../../../core/Error.js";import{handlesGroup as t}from"../../../../../../core/handleUtils.js";import{getOrCreateMapValue as s}from"../../../../../../core/MapUtils.js";import{notDeepEqual as i}from"../../../../../../core/object.js";import{throwIfAborted as a,onAbort as r}from"../../../../../../core/promiseUtils.js";import{QueueProcessor as o}from"../../../../../../core/QueueProcessor.js";import{difference as l}from"../../../../../../core/SetUtils.js";import n from"../../../../../../layers/support/FieldsIndex.js";import{loadParquetModule as d}from"../../../../../../libs/parquet/loadParquetModule.js";import{createParquetFile as u}from"../../../../../../libs/parquet/parquet.js";import{ALoadStrategy as h}from"./ALoadStrategy.js";import{fetchQueueConcurrency as c}from"./constants.js";import{ParquetSourceChunk as f}from"./chunks/ParquetSourceChunk.js";import{FeatureSetReaderParquet as m}from"../../support/FeatureSetReaderParquet.js";const p=4;class _{constructor(e,s){this.subscription=e,this.chunks=[],this.ids=[],this._controller=new AbortController,this._handles=t([r(e.signal,()=>this._controller.abort()),r(s,()=>this._controller.abort())])}destroy(){this._controller.abort(),this._handles.remove()}get options(){return{signal:this._controller.signal}}addBinaryData(e){this.chunks.push(e)}addSourceChunkId(e){this.ids.push(e)}}class y extends h{constructor(e,t,s){if(super(e.metadata,t,s),this._service=e,this._loadStates=new Map,this._files=new Map,this._queue=new o({concurrency:c,process:e=>this._loadTile(e)}),!e.geometryInfo.displayOptimization)throw new Error("InternalError: ParquetTileLoadStrategy only supports XZ-enabled parquet files");this._loaded=this._load()}destroy(){super.destroy();for(const{file:e}of this._files.values())e.free()}get about(){return{willQueryAllFeatures:!0,willQueryFullResolutionGeometry:!0}}get availableFields(){return this._schema.partial.availableFields}get definitionExpression(){return this._schema.full.definitionExpression}async tryUpdate(t,s){await this._loaded;let a=!0;if(i(this.availableFields,s.availableFields)&&await this._updateFields(s.availableFields),i(this._schema.partial.urls,s.urls)){for(const e of s.urls)this._files.has(e)||(a=!1,await this._insert(e));for(const t of this._files.keys())if(!s.urls.includes(t))throw new e("unsupported","Removing parquet files is not supported",{previous:this._schema.partial.urls,next:s.urls})}return this._schema.partial=s,a}async load(e){return await this._loaded,s(this._loadStates,e.key.id,()=>new _(e,this._options)),this._queue.push(e)}unload(e){const t=this._loadStates.get(e.tile.id);if(null!=t){for(const e of t.ids)this.store.removeById(e);t.destroy(),this._loadStates.delete(e.tile.id)}}async _load(){const e=this._schema.partial.urls;await Promise.all(e.map(e=>this._insert(e)))}async _insert(e){const t=await u(e,{geometryInfo:this._service.geometryInfo,getCustomParameters:()=>this._schema.full.customParameters}),s=this._files.size;this._ensureFieldsIndex(t),this._files.set(e,{file:t,fileId:s})}_onOverride(){}async _updateFields(e){const t=new Set(e),s=l(t,new Set(this.availableFields));if(null!=this._fieldsIndex&&s.size){const e=Array.from(s),t=[];for(const s of this._loadStates.values())for(const{fileUrl:i,data:a}of s.chunks){const{file:r}=this._files.get(i);t.push(r.updateChunkFields(a,e,s.options.signal))}await Promise.all(t)}}_ensureFieldsIndex(e){if(!this._fieldsIndex){const t=e.fields(!1).map(t=>({name:t.name,alias:t.name,type:t.type,column:e.columnForFieldName(t.name)})),{timeZoneByFieldName:s}=this._service.metadata.fieldsIndex,i=n.fromJSON({fields:t,timeZoneByFieldName:s});this._fieldsIndex=i}return this._fieldsIndex}async _loadTile(e){const t=await d(),s=e.tile,i=e.signal,{scale:r,translate:o}=s.normalizedTransform,l=t.Query.new();l.setExtent(s.extent),l.setQuantizationTransform({scale:r,translate:o}),l.setScale(s.scale),l.setOutFields(Array.from(this.availableFields).filter(e=>null!=this._fieldsIndex.get(e)?.column)),l.setOutSpatialReference(this.metadata.outSpatialReference.toJSON().wkid),l.setReturnGeometry(!0);const n=this._loadStates.get(s.id);let u=0;for(const[d,{file:c,fileId:_}]of this._files.entries()){const e=await c.executeQuery(l,i),t=[],r=e.next(i);for(let s=0;s<p;s++)t.push(e.next(i));let o=await r;for(;null!=o;){a(i);const r=new m(this.metadata,this._fieldsIndex,o,_),l=new f(this.metadata,r,s,u++,!1);n.addBinaryData({data:o,fileUrl:d}),n.addSourceChunkId(l.chunkId),this.store.insert(l);const h=t.shift();t.push(e.next(i)),o=await h}}a(i);const h=new f(this.metadata,null,s,u++,!0);n.addSourceChunkId(h.chunkId),this.store.insert(h)}}export{y as ParquetTileLoadStrategy};
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{FeatureSpatialIndex as e}from"../../../FeatureSpatialIndex.js";import{GeohashSpatialIndex as t}from"../../../aggregation/GeohashSpatialIndex.js";import{GridSpatialIndex as r}from"../../../aggregation/GridSpatialIndex.js";import{FeatureSetReaderIndirect as a}from"../../../support/FeatureSetReaderIndirect.js";class i{size(){return this.reader.getSize()}get fields(){return this.reader.fields}invalidate(){this._aggregateIndex=null,this._aggregateIndexHash=null,this._spatialIndex=null}get usedMemory(){let e=0;return e+=this.reader.underlyingMemory,this._aggregateIndex&&(e+=this._aggregateIndex.usedMemory),this._spatialIndex&&(e+=this._spatialIndex.usedMemory),e}registerOverrides(e){this.reader.registerOverrides(e),this.invalidate()}queryFeaturesInBounds(e){const t=this._getSpatialIndex().search(e);return a.from(this.reader,t)}getAggregateIndex(e){const a=JSON.stringify(e);if(a!==this._aggregateIndexHash){switch(this._aggregateIndexHash=a,e.type){case"grid":this._aggregateIndex=new r(e);break;case"geohash":this._aggregateIndex=new t(e)}this._aggregateIndex.insert(this.reader,this.isTiled)}return this._aggregateIndex}_getSpatialIndex(){return this._spatialIndex||(this._spatialIndex=e.fromReader(this.reader)),this._spatialIndex}}export{i as ASourceChunk};
5
+ import{FeatureSpatialIndex as e}from"../../../FeatureSpatialIndex.js";import{GeohashSpatialIndex as t}from"../../../aggregation/GeohashSpatialIndex.js";import{GridSpatialIndex as r}from"../../../aggregation/GridSpatialIndex.js";import{FeatureSetReaderIndirect as a}from"../../../support/FeatureSetReaderIndirect.js";class s{size(){return this.reader.getSize()}get fields(){return this.reader.fields}invalidate(){this._aggregateIndex=null,this._aggregateIndexHash=null,this._spatialIndex=null}get usedMemory(){let e=0;return e+=this.reader.underlyingMemory,this._aggregateIndex&&(e+=this._aggregateIndex.usedMemory),this._spatialIndex&&(e+=this._spatialIndex.usedMemory),e}getObjectIds(){const e=this.reader.getCursor(),t=[];for(;e.next();)t.push(e.getObjectId());return t}registerOverrides(e){this.reader.registerOverrides(e),this.invalidate()}queryFeaturesInBounds(e){const t=this._getSpatialIndex().search(e);return a.from(this.reader,t)}getAggregateIndex(e){const a=JSON.stringify(e);if(a!==this._aggregateIndexHash){switch(this._aggregateIndexHash=a,e.type){case"grid":this._aggregateIndex=new r(e);break;case"geohash":this._aggregateIndex=new t(e)}this._aggregateIndex.insert(this.reader,this.isTiled)}return this._aggregateIndex}_getSpatialIndex(){return this._spatialIndex||(this._spatialIndex=e.fromReader(this.reader)),this._spatialIndex}}export{s as ASourceChunk};
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{ASourceChunk as e}from"./ASourceChunk.js";class t extends e{constructor(e,t,s,r,i=0){super(),this._reader=e,this._queryJSON=t,this._page=s,this._end=r,this._fileIndex=i,this.chunkId=`${this._fileIndex}.${this._page}${this.end?"e":""}`,this.normalizedChunkId=this.chunkId}get reader(){return this._reader}get first(){return 0===this._page}get end(){return this._end}get queryInfo(){return{type:"snapshot",chunkId:this.chunkId,queryJSON:this._queryJSON,page:this._page,size:this.size(),end:this.end}}get isTiled(){return!1}getTileReader(e){const t=this.queryFeaturesInBounds(e.bounds);return t.setTransformForDisplay(e.transform),t}}export{t as FeatureSnapshotSourceChunk};
5
+ import{ASourceChunk as e}from"./ASourceChunk.js";class t extends e{constructor(e,t,s,r,i=0){super(),this._reader=e,this._queryJSON=t,this._page=s,this._end=r,this.fileIndex=i,this.chunkId=`${this.fileIndex}.${this._page}${this.end?"e":""}`,this.normalizedChunkId=this.chunkId}get reader(){return this._reader}get first(){return 0===this._page}get end(){return this._end}get queryInfo(){return{type:"snapshot",chunkId:this.chunkId,queryJSON:this._queryJSON,page:this._page,size:this.size(),end:this.end}}get isTiled(){return!1}getTileReader(e){const t=this.queryFeaturesInBounds(e.bounds);return t.setTransformForDisplay(e.transform),t}}export{t as FeatureSnapshotSourceChunk};
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{ASourceChunk as e}from"./ASourceChunk.js";import{FeatureSetReaderIndirect as t}from"../../../support/FeatureSetReaderIndirect.js";import{FeatureSetReaderJSON as r}from"../../../support/FeatureSetReaderJSON.js";class i extends e{constructor(e,t,r,i,s){super(),this._metadata=e,this._reader=t,this._tile=r,this._page=i,this._end=s,this.chunkId=`${this._tile.key.id}.${this._page}${this.end?"e":""}`,this.normalizedChunkId=`${this._tile.key.normalizedId}.${this._page}${this.end?"e":""}`}get reader(){return this._reader??r.empty(this._metadata)}get first(){return 0===this._page}get end(){return this._end}get tile(){return this._tile}get queryInfo(){return{type:"parquet",chunkId:this.chunkId,queryJSON:null,page:this._page,size:this.size(),tileId:this._tile.id,end:this.end}}get isTiled(){return!0}getTileReader(e){if(this._tile.key.id===e.key.id){const r=[];for(let e=0;e<this.reader.getSize();e++)r.push(e);const i=t.from(this.reader,r);return i.setTransformForDisplay(e.transform),i}return null}}export{i as ParquetSourceChunk};
5
+ import{ASourceChunk as e}from"./ASourceChunk.js";import{FeatureSetReaderJSON as t}from"../../../support/FeatureSetReaderJSON.js";class i extends e{constructor(e,t,i,r,s){super(),this._metadata=e,this._reader=t,this._tile=i,this._page=r,this._end=s,this.chunkId=`${this._tile.key.id}.${this._page}${this.end?"e":""}`,this.normalizedChunkId=`${this._tile.key.normalizedId}.${this._page}${this.end?"e":""}`}get reader(){return this._reader??t.empty(this._metadata)}get first(){return 0===this._page}get end(){return this._end}get tile(){return this._tile}get queryInfo(){return{type:"parquet",chunkId:this.chunkId,queryJSON:null,page:this._page,size:this.size(),tileId:this._tile.id,end:this.end}}get isTiled(){return!0}getTileReader(e){return this._tile.key.id===e.key.id?this.reader:null}}export{i as ParquetSourceChunk};
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import"../../../../../core/has.js";import{baseObjectMemory as e}from"../../../../../core/memoryEstimations.js";import t from"../../../../../layers/graphics/OptimizedGeometry.js";import{QuantizedGeometryBuffer as r}from"../../../../../chunks/bundle.js";import{FeatureSetReader as n}from"./FeatureSetReader.js";let s;class i extends n{constructor(t,r,n,s,i,d=new Uint32Array(n.size())){super(t),this._fields=r,this._inner=n,this._chunkId=s,this._fileIndex=i,this._displayIds=d,this._index=-1,this.usedMemory=e,this._size=this._inner.size();t.featureIdInfo.type,this._chunkId>65535&&console.error("Exceeded max allowed parquet reader size")}destroy(){super.destroy(),this._inner.free()}get fields(){return this._fields}get geometryType(){return this.metadata.geometryType}get hasFeatures(){return!0}get hasNext(){throw new Error("Method not implemented.")}get exceededTransferLimit(){return!1}get hasZ(){return!1}get hasM(){return!1}getInTransform(){return null}getSize(){return this._size}getCursor(){return this.copy()}getAttributeHash(){let e="";for(const t of this.fields.fields)e+=this._readAttribute(t.name,!1)+".";return e}getObjectId(){return this._fileIndex<<24|this._inner.rowId(this._index)}getDisplayId(){return this._displayIds[this._index]}setDisplayId(e){this._displayIds[this._index]=e}setIndex(e){this._index=e}getBoundsXMin(){return this._inner.boundsXMin(this._index)}getBoundsYMin(){return this._inner.boundsYMin(this._index)}getBoundsXMax(){return this._inner.boundsXMax(this._index)}getBoundsYMax(){return this._inner.boundsYMax(this._index)}setBoundsXMin(e){throw new Error("InternalError: Setting bounds is unsupported")}setBoundsYMin(e){throw new Error("InternalError: Setting bounds is unsupported")}setBoundsXMax(e){throw new Error("InternalError: Setting bounds is unsupported")}setBoundsYMax(e){throw new Error("InternalError: Setting bounds is unsupported")}getIndex(){return this._index}next(){for(;++this._index<this._size&&!this._getExists(););return this._index<this._size}readGeometryArea(){return this.readGeometryForDisplay()?.area()??0}copy(){const e=new i(this.metadata,this._fields,this._inner,this._chunkId,this._fileIndex,this._displayIds);return this.copyInto(e),e}copyInto(e){super.copyInto(e),e._index=this._index}readGeometryForDisplayTransformed(e){const[n,i]=e.translate,[d,o]=e.scale;s||(s=r.new());return this._inner.transformGeometry(s,n,i,d,o,this._index)?new t(s.readLengthsUnsafe(),s.readCoordsUnsafe(),this.hasZ,this.hasM):null}_readGeometry(e){const r=this._inner.readCoords(this._index),n=this._inner.readLengths(this._index);return r&&n?new t(n,r,this.hasZ,this.hasM):null}_readX(){return this._inner.readX(this._index)}_readY(){return this._inner.readY(this._index)}_readServerCentroid(){return null}_readAttribute(e,t){const r=this.fields.get(e);if(!r)return;if(null==r.column)return this.getObjectId();const n=this._inner.readAttribute(this._index,r.column);if(null==n)return n;const s=this.fields.isDateField(r.name);return t?null==n?n:s?new Date(n):n:n}_readAttributes(){const e={};for(const t of this._fields.fields)null!=t.column&&(this._inner.isEmpty(t.column)||(e[t.name]=this._readAttribute(t.name,!1)));return e.__OBJECTID=this.getObjectId(),e}}export{i as FeatureSetReaderParquet};
5
+ import"../../../../../core/has.js";import{baseObjectMemory as e}from"../../../../../core/memoryEstimations.js";import t from"../../../../../layers/graphics/OptimizedGeometry.js";import{QuantizedGeometryBuffer as r}from"../../../../../chunks/bundle.js";import{FeatureSetReader as n}from"./FeatureSetReader.js";let s;const i=new TextDecoder;class d extends n{constructor(t,r,n,s,i=new Uint32Array(n.size())){super(t),this._fields=r,this._inner=n,this._fileIndex=s,this._displayIds=i,this._index=-1,this.usedMemory=e,this._size=this._inner.size();t.featureIdInfo.type}destroy(){super.destroy(),this._inner.free()}get fields(){return this._fields}get geometryType(){return this.metadata.geometryType}get hasFeatures(){return!0}get hasNext(){throw new Error("Method not implemented.")}get exceededTransferLimit(){return!1}get hasZ(){return!1}get hasM(){return!1}getInTransform(){return null}getSize(){return this._size}getCursor(){return this.copy()}getAttributeHash(){let e="";for(const t of this.fields.fields)e+=this._readAttribute(t.name,!1)+".";return e}getObjectId(){return this._fileIndex<<24|this._inner.rowId(this._index)}getDisplayId(){return this._displayIds[this._index]}setDisplayId(e){this._displayIds[this._index]=e}setIndex(e){this._index=e}getBoundsXMin(){return this._inner.boundsXMin(this._index)}getBoundsYMin(){return this._inner.boundsYMin(this._index)}getBoundsXMax(){return this._inner.boundsXMax(this._index)}getBoundsYMax(){return this._inner.boundsYMax(this._index)}setBoundsXMin(e){throw new Error("InternalError: Setting bounds is unsupported")}setBoundsYMin(e){throw new Error("InternalError: Setting bounds is unsupported")}setBoundsXMax(e){throw new Error("InternalError: Setting bounds is unsupported")}setBoundsYMax(e){throw new Error("InternalError: Setting bounds is unsupported")}getIndex(){return this._index}next(){for(;++this._index<this._size&&!this._getExists(););return this._index<this._size}readGeometryArea(){return this.readGeometryForDisplay()?.area()??0}copy(){const e=new d(this.metadata,this._fields,this._inner,this._fileIndex,this._displayIds);return this.copyInto(e),e}copyInto(e){super.copyInto(e),e._index=this._index}readGeometryForDisplayTransformed(e){const[n,i]=e.translate,[d,o]=e.scale;s||(s=r.new());return this._inner.transformGeometry(s,n,i,d,o,this._index)?new t(s.readLengthsUnsafe(),s.readCoordsUnsafe(),this.hasZ,this.hasM):null}_readGeometry(e){const r=this._inner.readCoordsUnsafe(this._index),n=this._inner.readLengthsUnsafe(this._index);return r&&n?new t(n,r,this.hasZ,this.hasM):null}_readX(){return this._inner.readX(this._index)}_readY(){return this._inner.readY(this._index)}_readServerCentroid(){return null}_readAttribute(e,t){const r=this.fields.get(e);if(!r)return;if(null==r.column)return this.getObjectId();const n=this._inner.readAttribute(this._index,r.column);if(null==n)return n;if("esriFieldTypeString"===r.type){const e=this._inner.readAttribute(this._index,r.column);return i.decode(e)}const s=this.fields.isDateField(r.name);return t?null==n?n:s?new Date(n):n:n}_readAttributes(){const e={};for(const t of this._fields.fields)if(null!=t.column&&null!=t.column){const r=this._readAttribute(t.name,!1);void 0!==r&&(e[t.name]=r)}return e.__OBJECTID=this.getObjectId(),e}}export{d as FeatureSetReaderParquet};
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import e from"../../../../../core/ArrayPool.js";import{create as t,toExtent as i}from"../../../../../geometry/support/aaBoundingRect.js";import s from"../../../../../rest/support/QuantizationParameters.js";import{createArcadeEvaluationOptions as o}from"./arcadeUtils.js";import n from"../../../tiling/TileKey.js";class r{constructor(e,i){this.key=new n(0,0,0,0),this.bounds=t(),this.objectIds=new Set,this.key.set(i);const s=e.getLODInfoAt(this.key);this.tileInfoView=e,this.tileInfoView.getTileBounds(this.bounds,this.key,!0),this.resolution=s.resolution,this.level=s.level,this.scale=s.scale,this.minScale=e.zoomToScale(s.level-1),this.maxScale=e.zoomToScale(s.level+1)}get lod(){return this.tileInfoView.getLODInfoAt(this.key)}get id(){return this.key.id}get extent(){return i(this.bounds,this.tileInfoView.tileInfo.spatialReference)}get transform(){return{originPosition:"upperLeft",scale:[this.resolution,this.resolution],translate:[this.bounds[0],this.bounds[3]]}}createArcadeEvaluationOptions(e){return o(this.scale,e)}createChildTiles(){const t=this.key.getChildKeys(),i=e.acquire();for(let e=0;e<t.length;e++)i[e]=new r(this.tileInfoView,t[e]);return i}getQuantizationParameters(){return s.fromJSON({mode:"view",originPosition:"upperLeft",tolerance:this.resolution,extent:{xmin:this.bounds[0],ymin:this.bounds[1],xmax:this.bounds[2],ymax:this.bounds[3],spatialReference:this.tileInfoView.tileInfo.spatialReference}})}}export{r as Tile};
5
+ import t from"../../../../../core/ArrayPool.js";import{create as e,toExtent as i}from"../../../../../geometry/support/aaBoundingRect.js";import{normalizeTransform as s}from"../../../../../geometry/support/quantizationUtils.js";import o from"../../../../../rest/support/QuantizationParameters.js";import{createArcadeEvaluationOptions as n}from"./arcadeUtils.js";import r from"../../../tiling/TileKey.js";class a{constructor(t,i){this.key=new r(0,0,0,0),this.bounds=e(),this.objectIds=new Set,this.key.set(i);const s=t.getLODInfoAt(this.key);this.tileInfoView=t,this.tileInfoView.getTileBounds(this.bounds,this.key,!0),this.resolution=s.resolution,this.level=s.level,this.scale=s.scale,this.minScale=t.zoomToScale(s.level-1),this.maxScale=t.zoomToScale(s.level+1)}get lod(){return this.tileInfoView.getLODInfoAt(this.key)}get id(){return this.key.id}get extent(){const[t,e,i,s]=this.bounds;return{xmin:t,ymin:e,xmax:i,ymax:s}}get hydratedExtent(){return i(this.bounds,this.tileInfoView.tileInfo.spatialReference)}get transform(){return{originPosition:"upperLeft",scale:[this.resolution,this.resolution],translate:[this.bounds[0],this.bounds[3]]}}get normalizedTransform(){return s(this.transform)}createArcadeEvaluationOptions(t){return n(this.scale,t)}createChildTiles(){const e=this.key.getChildKeys(),i=t.acquire();for(let t=0;t<e.length;t++)i[t]=new a(this.tileInfoView,e[t]);return i}getQuantizationParameters(){return o.fromJSON({mode:"view",originPosition:"upperLeft",tolerance:this.resolution,extent:{xmin:this.bounds[0],ymin:this.bounds[1],xmax:this.bounds[2],ymax:this.bounds[3],spatialReference:this.tileInfoView.tileInfo.spatialReference}})}}export{a as Tile};
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{destroyMaybe as e}from"../../../../core/maybe.js";import{AFeatureContainer as t}from"../../engine/AFeatureContainer.js";import{GraphicInstanceStore as r}from"../../engine/webgl/shaderGraph/techniques/GraphicInstanceStore.js";import n from"./GraphicBoundsRenderer.js";class s extends t{constructor(e){super(e),this._instanceStore=new r,this.checkHighlight=()=>!0}destroy(){super.destroy(),this._boundsRenderer=e(this._boundsRenderer)}get instanceStore(){return this._instanceStore}enableRenderingBounds(e){this._boundsRenderer=new n(e),this.requestRender()}get hasHighlight(){return this.checkHighlight()}onTileData(e,t){e.onMessage(t),this.contains(e)||this.addChild(e),this.requestRender()}_renderChildren(e,t){e.selection=t;for(const r of this.children){if(!r.visible)continue;const t=r.getDisplayList(this._instanceStore,1);t?.render(e)}}}export{s as AGraphicContainer};
5
+ import{destroyMaybe as e}from"../../../../core/maybe.js";import{AFeatureContainer as t}from"../../engine/AFeatureContainer.js";import{GraphicInstanceStore as r}from"../../engine/webgl/shaderGraph/techniques/GraphicInstanceStore.js";import n from"./GraphicBoundsRenderer.js";class s extends t{constructor(e,t=!1){super(e),this.drawOnTop=t,this._instanceStore=new r,this.checkHighlight=()=>!0}destroy(){super.destroy(),this._boundsRenderer=e(this._boundsRenderer)}get instanceStore(){return this._instanceStore}enableRenderingBounds(e){this._boundsRenderer=new n(e),this.requestRender()}get hasHighlight(){return this.checkHighlight()}onTileData(e,t){e.onMessage(t),this.contains(e)||this.addChild(e),this.requestRender()}_renderChildren(e,t){e.selection=t;for(const r of this.children){if(!r.visible)continue;const t=r.getDisplayList(this._instanceStore,1);t?.render(e)}}}export{s as AGraphicContainer};
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{AGraphicContainer as e}from"./AGraphicContainer.js";import{renderHighlight as r}from"../support/util.js";class i extends e{renderChildren(e){for(const r of this.children)r.setTransform(e.state);if(super.renderChildren(e),this._updateAttributeView(),this.children.some(e=>e.hasData)){switch(e.drawPhase){case 1:this._renderChildren(e,0);break;case 16:this.hasHighlight&&this._renderHighlight(e)}this._boundsRenderer&&this._boundsRenderer.doRender(e)}}_renderHighlight(e){r(e,!1,e=>{this._renderChildren(e,1)})}}export{i as default};
5
+ import{AGraphicContainer as e}from"./AGraphicContainer.js";import{renderHighlight as r}from"../support/util.js";class i extends e{renderChildren(e){for(const r of this.children)r.setTransform(e.state);if(super.renderChildren(e),this._updateAttributeView(),this.children.some(e=>e.hasData)){if(this.drawOnTop){if(128===e.drawPhase)this._renderChildren(e,0)}else switch(e.drawPhase){case 1:this._renderChildren(e,0);break;case 16:this.hasHighlight&&this._renderHighlight(e)}this._boundsRenderer&&this._boundsRenderer.doRender(e)}}_renderHighlight(e){r(e,!1,e=>{this._renderChildren(e,1)})}}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/5.0/esri/copyright.txt for details.
4
4
  */
5
- class e{constructor(){this._commands=new Map,this._historicMoment=null}add(e){switch(e.type){case"override":return this._addOverride(e);case"override-by-id":return this._addOverrideById(e)}}toMessage(){const e={historicMoment:this._historicMoment,commands:{updateByIdWeak:[],updateWeak:[],removeWeak:[],update:[],remove:[],release:[]}};for(const[s,r]of this._commands.entries())switch(r.type){case"override-update-by-id":e.commands.updateByIdWeak.push(s);break;case"override-update":r.isWeak?e.commands.updateWeak.push(r.feature):e.commands.update.push(r.feature);break;case"override-remove":r.isWeak?e.commands.removeWeak.push(s):e.commands.remove.push(s);break;case"override-release":e.commands.release.push(s)}return e}_addOverrideById(e){this._historicMoment=e.historicMoment;for(const s of e.updates)this._commands.set(s,{type:"override-update-by-id",isWeak:e.isWeak});for(const s of e.removed)this._commands.set(s,{type:"override-remove",isWeak:e.isWeak})}_addOverride(e){this._historicMoment=e.historicMoment;for(const s of e.updates)this._commands.set(s.objectId,{type:"override-update",feature:s,isWeak:e.isWeak});for(const s of e.removed)this._commands.set(s,{type:"override-remove",isWeak:e.isWeak});for(const s of e.release)this._commands.set(s,{type:"override-release"})}}export{e as DebouncedFeatureOverride};
5
+ class e{constructor(){this._commands=new Map,this._historicMoment=null}tryAdd(e){if(!this._canDebounce(e))return!1;switch(e.type){case"override":return this._addOverride(e),!0;case"override-by-id":return this._addOverrideById(e),!0}}toMessage(){const e={historicMoment:this._historicMoment,commands:{updateByIdWeak:[],updateWeak:[],removeWeak:[],update:[],remove:[],release:[]}};for(const[s,o]of this._commands.entries())switch(o.type){case"override-update-by-id":e.commands.updateByIdWeak.push(s);break;case"override-update":o.isWeak?e.commands.updateWeak.push(o.feature):e.commands.update.push(o.feature);break;case"override-remove":o.isWeak?e.commands.removeWeak.push(s):e.commands.remove.push(s);break;case"override-release":e.commands.release.push(s)}return e}_canDebounce(e){switch(e.type){case"override":{const{updates:s,removed:o,release:t}=e;return!s.some(e=>this._commands.has(e.objectId))&&!o.some(e=>this._commands.has(e))&&!t.some(e=>this._commands.has(e))}case"override-by-id":{const{updates:s,removed:o}=e;return!s.some(e=>this._commands.has(e))&&!o.some(e=>this._commands.has(e))}}}_addOverrideById(e){this._historicMoment=e.historicMoment;for(const s of e.updates)this._commands.set(s,{type:"override-update-by-id",isWeak:e.isWeak});for(const s of e.removed)this._commands.set(s,{type:"override-remove",isWeak:e.isWeak})}_addOverride(e){this._historicMoment=e.historicMoment;for(const s of e.updates)this._commands.set(s.objectId,{type:"override-update",feature:s,isWeak:e.isWeak});for(const s of e.removed)this._commands.set(s,{type:"override-remove",isWeak:e.isWeak});for(const s of e.release)this._commands.set(s,{type:"override-release"})}}export{e as DebouncedFeatureOverride};
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{disposeMaybe as e}from"../../../../core/maybe.js";import{identity as t,translate as r,scale as s}from"../../../../core/libs/gl-matrix-2/math/mat3.js";import{create as a}from"../../../../core/libs/gl-matrix-2/factories/mat3f32.js";import{BufferObject as i}from"../../../webgl/BufferObject.js";import"../../../webgl/FramebufferObject.js";import"../../../webgl/Program.js";import"../../../../core/has.js";import"../../../webgl/Renderbuffer.js";import"../../../webgl/Texture.js";import{VertexArrayObject as o}from"../../../webgl/VertexArrayObject.js";import{DisplayObject as n}from"../../engine/DisplayObject.js";import{DataType as m,PrimitiveType as f}from"../../../webgl/enums.js";import{fromLayout as c}from"../../../webgl/VertexAttributeLocations.js";import{VertexBuffer as l}from"../../../webgl/VertexBuffer.js";import{VertexElementDescriptor as p}from"../../../webgl/VertexElementDescriptor.js";const h=[new p("a_PositionAndFlags",3,m.SHORT,0,6)],g={vsPath:"debug/overlay",fsPath:"debug/overlay",locations:c(h)};class u extends n{constructor(e){super(),this._conf=e}static makeFlags(e,t){return e|t<<2}_createTransforms(){return{displayViewScreenMat3:a()}}doRender(e){this._updateTransforms(e),this._ensureResources(e);const{context:t}=e;t.useProgram(this._program),this._program.setUniformMatrix3fv("u_dvsMat3",this.transforms.displayViewScreenMat3),this._program.setUniform4fv("u_colors",this._conf.getColors(e)),this._program.setUniform1fv("u_opacities",this._conf.getOpacities(e));const{vertexData:r,indexData:s}=this._conf.getMesh(e);this._vertexBuffer.setData(r),this._indexBuffer.setData(s),t.bindVAO(this._vertexArray),t.setBlendingEnabled(!0),t.setBlendFunction(1,771),t.setDepthTestEnabled(!1),t.setStencilTestEnabled(!1),t.setColorMask(!0,!0,!0,!0),t.drawElements(f.TRIANGLES,s.length,m.UNSIGNED_INT,0)}onDetach(){this._vertexArray=e(this._vertexArray)}_updateTransforms(e){t(this.transforms.displayViewScreenMat3),r(this.transforms.displayViewScreenMat3,this.transforms.displayViewScreenMat3,[-1,1]),s(this.transforms.displayViewScreenMat3,this.transforms.displayViewScreenMat3,[2/e.state.size[0],-2/e.state.size[1],1])}_ensureResources(e){const{context:t}=e;this._program??=e.painter.materialManager.getProgram(g),this._vertexBuffer??=new l(t,h,null,35040),this._indexBuffer??=i.createIndex(t,35040),this._vertexArray??=new o(t,this._vertexBuffer,this._indexBuffer)}}export{u as default};
5
+ import{disposeMaybe as e}from"../../../../core/maybe.js";import{identity as t,translate as r,scale as s}from"../../../../core/libs/gl-matrix-2/math/mat3.js";import{create as a}from"../../../../core/libs/gl-matrix-2/factories/mat3f32.js";import{BufferObject as i}from"../../../webgl/BufferObject.js";import"../../../webgl/FramebufferObject.js";import"../../../webgl/Program.js";import"../../../../core/has.js";import"../../../webgl/Renderbuffer.js";import"../../../webgl/Texture.js";import{VertexArrayObject as o}from"../../../webgl/VertexArrayObject.js";import{DisplayObject as n}from"../../engine/DisplayObject.js";import{DataType as m,PrimitiveType as f}from"../../../webgl/enums.js";import{fromLayout as c}from"../../../webgl/VertexAttributeLocations.js";import{VertexBuffer as l}from"../../../webgl/VertexBuffer.js";import{VertexElementDescriptor as p}from"../../../webgl/VertexElementDescriptor.js";const h=[new p("a_PositionAndFlags",3,m.SHORT,0,6)],u={vsPath:"debug/overlay",fsPath:"debug/overlay",locations:c(h)};class g extends n{constructor(e){super(),this._conf=e}static makeFlags(e,t){return e|t<<2}_createTransforms(){return{displayViewScreenMat3:a()}}doRender(e){if(1!==e.drawPhase)return;this._updateTransforms(e),this._ensureResources(e);const{context:t}=e;t.useProgram(this._program),this._program.setUniformMatrix3fv("u_dvsMat3",this.transforms.displayViewScreenMat3),this._program.setUniform4fv("u_colors",this._conf.getColors(e)),this._program.setUniform1fv("u_opacities",this._conf.getOpacities(e));const{vertexData:r,indexData:s}=this._conf.getMesh(e);this._vertexBuffer.setData(r),this._indexBuffer.setData(s),t.bindVAO(this._vertexArray),t.setBlendingEnabled(!0),t.setBlendFunction(1,771),t.setDepthTestEnabled(!1),t.setStencilTestEnabled(!1),t.setColorMask(!0,!0,!0,!0),t.drawElements(f.TRIANGLES,s.length,m.UNSIGNED_INT,0)}onDetach(){this._vertexArray=e(this._vertexArray)}_updateTransforms(e){t(this.transforms.displayViewScreenMat3),r(this.transforms.displayViewScreenMat3,this.transforms.displayViewScreenMat3,[-1,1]),s(this.transforms.displayViewScreenMat3,this.transforms.displayViewScreenMat3,[2/e.state.size[0],-2/e.state.size[1],1])}_ensureResources(e){const{context:t}=e;this._program??=e.painter.materialManager.getProgram(u),this._vertexBuffer??=new l(t,h,null,35040),this._indexBuffer??=i.createIndex(t,35040),this._vertexArray??=new o(t,this._vertexBuffer,this._indexBuffer)}}export{g as default};
@@ -1,5 +1,5 @@
1
1
  import type Accessor from "../../../../core/Accessor.js";
2
- import type { VolumeMeasureType } from "../../../../analysis/VolumeMeasurement/volumeMeasurementUtils.js";
2
+ import type { VolumeMeasureType } from "../../../../analysis/VolumeMeasurement/types.js";
3
3
  import type { Volume } from "../../../../core/quantity.js";
4
4
 
5
5
  export interface VolumeMeasurementResultProperties {
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import{lerp as t}from"../../../core/mathUtils.js";import{disposeMaybe as r}from"../../../core/maybe.js";import{watch as s,syncAndInitial as i,initial as o}from"../../../core/reactiveUtils.js";import{subclass as a}from"../../../core/accessorSupport/decorators.js";import{set as n}from"../../../core/libs/gl-matrix-2/math/vec2.js";import{h as m,b as h}from"../../../chunks/vec32.js";import{ZEROS as c}from"../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{earth as p}from"../../../geometry/support/Ellipsoid.js";import{InternalRenderCategory as d}from"../webgl.js";import{computeInnerAltitudeFade as u,innerAtmosphereDepth as l}from"./atmosphereUtils.js";import{ChapmanAtmospherePassParameters as f,ChapmanAtmosphereTechnique as g}from"./ChapmanAtmosphereTechnique.js";import{ChapmanAtmosphereTechniqueConfiguration as b}from"./ChapmanAtmosphereTechniqueConfiguration.js";import{OpaqueEnvironment as _}from"../webgl-engine/effects/OpaqueEnvironment.js";import{createQuadVAO as w}from"../webgl-engine/lib/glUtil3D.js";import{applyTextureResizeModulo as P}from"../webgl-engine/lib/textureUtils.js";import{A as v}from"../../../chunks/AtmosphereCompositing.glsl.js";import{AtmosphereCompositingTechnique as j}from"../webgl-engine/shaders/AtmosphereCompositingTechnique.js";import{DepthStencilAttachment as q,PrimitiveType as A}from"../../webgl/enums.js";import T from"../../../webscene/background/ColorBackground.js";let x=class extends _{constructor(){super(...arguments),this.requireGeometryDepth=!0,this._compositingPassParameters=new v,this._vao=null,this._passParameters=new f,this._configuration=new b}initialize(){this.addHandles([s(()=>this.view.environment.background,e=>{const t=e instanceof T?e.color.toUnitRGBA():c;m(this._passParameters.backgroundColor,t[0]*t[3],t[1]*t[3],t[2]*t[3])},i),s(()=>this.view.stage?.renderer?.highResolutionAtmosphere,e=>this._configuration.reduced=!e,i),s(()=>this.view.map.ground.undergroundColor,e=>{this._passParameters.undergroundColor=e?.toUnitRGBA()??c,this.requestRender(1)},o),s(()=>this.view.environment.atmosphereEnabled,e=>e?this._enable():this._disable(),i)])}destroy(){this._vao=r(this._vao)}precompile(){this.techniques.precompile(g,this._configuration),this.techniques.precompile(j)}render(e){const r=e.find(({name:e})=>e===d.OPAQUE_ENVIRONMENT);if(!this.bindParameters.mainDepth)return r;const s=this.renderingContext;this._vao??=w(s,1);const i=r.getAttachment(q);this._update();const o=this.techniques.get(g,this._configuration);if(!o.compiled)return this.requestRender(1),r;if(!this._configuration.reduced)return r.detachDepth(),s.bindFramebuffer(r.fbo),s.bindTechnique(o,this.bindParameters,this._passParameters),s.bindVAO(this._vao),s.drawArrays(A.TRIANGLE_STRIP,0,4),r.attachDepth(i),r;const a=this.techniques.get(j);if(!a.compiled)return this.requestRender(1),r;const n=s.getViewport(),m=this.bindParameters.camera,c=h(m.eye)-p.radius;let u;const l=p.atmosphereHeight;if(c<l){const e=Math.min(1,Math.max(0,c/l));u=t(.2,.3,e)}else{const e=Math.min(1,Math.max(0,(c-l)/(15*l)));u=t(.3,.6,e)}const f=this.renderingContext.parameters.maxTextureSize,b=P(Math.round(u*m.fullViewport[2]),f),_=P(Math.round(u*m.fullViewport[3]),f);s.setViewport(0,0,b,_);const v=this.fboCache.acquire(b,_,"chapman",5);return s.bindFramebuffer(v.fbo),s.clearFramebuffer([0,0,0,1],!0,!0),s.bindTechnique(o,this.bindParameters,this._passParameters),s.bindVAO(this._vao),s.drawArrays(A.TRIANGLE_STRIP,0,4),s.setViewport(n.x,n.y,n.width,n.height),this._compositingPassParameters.color=v.getTexture(),r.detachDepth(),s.bindFramebuffer(r.fbo),s.bindTechnique(a,this.bindParameters,this._compositingPassParameters),s.screen.draw(),r.attachDepth(i),v.release(),r}_update(){const e=this.view.basemapTerrain?.getLowerBoundRadius()??0;n(this._passParameters.radii,e,e+p.atmosphereHeight);const t=h(this.bindParameters.camera.eye);this._passParameters.altitudeFade=u(t-e),this._passParameters.innerFadeDistance=2*Math.sqrt((2*e-l)*l)}};x=e([a("esri.views.3d.environment.ChapmanAtmosphere")],x);export{x as ChapmanAtmosphere};
5
+ import{__decorate as e}from"tslib";import{lerp as t}from"../../../core/mathUtils.js";import{disposeMaybe as r}from"../../../core/maybe.js";import{watch as s,syncAndInitial as i,initial as o}from"../../../core/reactiveUtils.js";import{subclass as a}from"../../../core/accessorSupport/decorators.js";import{set as n}from"../../../core/libs/gl-matrix-2/math/vec2.js";import{h as m,b as h}from"../../../chunks/vec32.js";import{ZEROS as c}from"../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{earth as p}from"../../../geometry/support/Ellipsoid.js";import{InternalRenderCategory as d}from"../webgl.js";import{computeInnerAltitudeFade as u,innerAtmosphereDepth as l}from"./atmosphereUtils.js";import{ChapmanAtmospherePassParameters as f,ChapmanAtmosphereTechnique as g}from"./ChapmanAtmosphereTechnique.js";import{ChapmanAtmosphereTechniqueConfiguration as b}from"./ChapmanAtmosphereTechniqueConfiguration.js";import{OpaqueEnvironment as _}from"../webgl-engine/effects/OpaqueEnvironment.js";import{createQuadVAO as w}from"../webgl-engine/lib/glUtil3D.js";import{applyTextureResizeModulo as P}from"../webgl-engine/lib/textureUtils.js";import{A as v}from"../../../chunks/AtmosphereCompositing.glsl.js";import{AtmosphereCompositingTechnique as j}from"../webgl-engine/shaders/AtmosphereCompositingTechnique.js";import{DepthStencilAttachment as A,PrimitiveType as q}from"../../webgl/enums.js";import T from"../../../webscene/background/ColorBackground.js";let x=class extends _{constructor(){super(...arguments),this._compositingPassParameters=new v,this._vao=null,this._passParameters=new f,this._configuration=new b}initialize(){this.addHandles([s(()=>this.view.environment.background,e=>{const t=e instanceof T?e.color.toUnitRGBA():c;m(this._passParameters.backgroundColor,t[0]*t[3],t[1]*t[3],t[2]*t[3])},i),s(()=>this.view.stage?.renderer?.highResolutionAtmosphere,e=>this._configuration.reduced=!e,i),s(()=>this.view.map.ground.undergroundColor,e=>{this._passParameters.undergroundColor=e?.toUnitRGBA()??c,this.requestRender(1)},o),s(()=>this.view.environment.atmosphereEnabled,e=>e?this._enable():this._disable(),i)])}destroy(){this._vao=r(this._vao)}precompile(){this.techniques.precompile(g,this._configuration),this.techniques.precompile(j)}render(e){const r=e.find(({name:e})=>e===d.OPAQUE_ENVIRONMENT);if(!this.bindParameters.mainDepth)return r;const s=this.renderingContext;this._vao??=w(s,1);const i=r.getAttachment(A);this._update();const o=this.techniques.get(g,this._configuration);if(!o.compiled)return this.requestRender(1),r;if(!this._configuration.reduced)return r.detachDepth(),s.bindFramebuffer(r.fbo),s.bindTechnique(o,this.bindParameters,this._passParameters),s.bindVAO(this._vao),s.drawArrays(q.TRIANGLE_STRIP,0,4),r.attachDepth(i),r;const a=this.techniques.get(j);if(!a.compiled)return this.requestRender(1),r;const n=s.getViewport(),m=this.bindParameters.camera,c=h(m.eye)-p.radius;let u;const l=p.atmosphereHeight;if(c<l){const e=Math.min(1,Math.max(0,c/l));u=t(.2,.3,e)}else{const e=Math.min(1,Math.max(0,(c-l)/(15*l)));u=t(.3,.6,e)}const f=this.renderingContext.parameters.maxTextureSize,b=P(Math.round(u*m.fullViewport[2]),f),_=P(Math.round(u*m.fullViewport[3]),f);s.setViewport(0,0,b,_);const v=this.fboCache.acquire(b,_,"chapman",5);return s.bindFramebuffer(v.fbo),s.clearFramebuffer([0,0,0,1],!0,!0),s.bindTechnique(o,this.bindParameters,this._passParameters),s.bindVAO(this._vao),s.drawArrays(q.TRIANGLE_STRIP,0,4),s.setViewport(n.x,n.y,n.width,n.height),this._compositingPassParameters.color=v.getTexture(),r.detachDepth(),s.bindFramebuffer(r.fbo),s.bindTechnique(a,this.bindParameters,this._compositingPassParameters),s.screen.draw(),r.attachDepth(i),v.release(),r}_update(){const e=this.view.basemapTerrain?.getLowerBoundRadius()??0;n(this._passParameters.radii,e,e+p.atmosphereHeight);const t=h(this.bindParameters.camera.eye);this._passParameters.altitudeFade=u(t-e),this._passParameters.innerFadeDistance=2*Math.sqrt((2*e-l)*l)}};x=e([a("esri.views.3d.environment.ChapmanAtmosphere")],x);export{x as ChapmanAtmosphere};
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import{lerp as t,smoothstep as s}from"../../../core/mathUtils.js";import{watch as r,syncAndInitial as i}from"../../../core/reactiveUtils.js";import{property as a,subclass as o}from"../../../core/accessorSupport/decorators.js";import{d as n,n as h,g as m,j as c,l as p,b as l}from"../../../chunks/vec32.js";import{fromValues as u,create as d}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{getReferenceEllipsoid as _}from"../../../geometry/ellipsoidUtils.js";import{InternalRenderCategory as g}from"../webgl.js";import{F as f}from"../../../chunks/Fog.glsl.js";import{FogTechnique as w}from"./FogTechnique.js";import{FogTechniqueConfiguration as P}from"./FogTechniqueConfiguration.js";import{heightLimit as b}from"./weather.js";import{TransparentEnvironment as y}from"../webgl-engine/effects/TransparentEnvironment.js";import{Blit as v}from"../webgl-engine/effects/blit/Blit.js";import{ColorAttachment1 as j,DepthStencilAttachment as F}from"../../webgl/enums.js";const E=.95,R=1;let T=class extends y{constructor(e){super(e),this.consumes={required:[g.TRANSPARENT_ENVIRONMENT]},this._configuration=new P,this.requireGeometryDepth=!0,this._newParameters=new q,this._oldParameters=new q,this._fadedParameters=new q,this._parameters=this._newParameters,this._passParameters=new f,this._blit=null;const t=_(e.view.spatialReference);this._planetRadius=t.radius,this._atmosphereRadius=t.radius+t.atmosphereHeight;const s=e.view.stage.renderView.techniques;s.precompile(w,this._configuration),this._configuration.hasEmissive=!this._configuration.hasEmissive,s.precompile(w,this._configuration),this._configuration.hasEmissive=!this._configuration.hasEmissive}toogle(){this.view.environment.atmosphereEnabled&&this.view.environment.weather?this._enable():this._disable()}initialize(){this.addHandles([r(()=>this.view.environment.atmosphereEnabled,()=>this.toogle(),i),r(()=>this.view.environment.weather,()=>this.toogle(),i),r(()=>this._updateFogParameters(),()=>{},i)]),this.addHandles(r(()=>this._fadeFactor,e=>this._fade(e),i))}get _fadeFactor(){return this.view.stage?.renderer.renderContext.bind.clouds.fadeFactor??1}_fade(e){const{_newParameters:t,_oldParameters:s}=this;e>=1?(this._parameters=t,this._oldParameters.copyFrom(this._newParameters)):e<=0?this._parameters=s:(this._fadedParameters.lerp(s,t,e),this._parameters=this._fadedParameters)}_updateFogParameters(){const e=this.view.environment.weather,s="foggy"===e.type||"snowy"===e.type||"rainy"===e.type;this._newParameters.strength="foggy"===e.type?t(3e-5,.005,e.fogStrength**3):"snowy"===e.type||"rainy"===e.type?t(4e-6,2e-4,(e.precipitation??0)**3):0,this._newParameters.amount=s?1:0,"foggy"!==e.type&&"snowy"!==e.type||n(this._newParameters.color,C),"rainy"===e.type&&n(this._newParameters.color,A),this._fadeFactor>=1&&this._oldParameters.copyFrom(this._newParameters),this.requestRender(2)}render(e){const t=e.find(({name:e})=>e===g.TRANSPARENT_ENVIRONMENT);if(0===this._parameters.amount)return t;if(this._update(),this._passParameters.amount<=0)return t;const s=t.getAttachment(j);this._configuration.hasEmissive=null!=s;const r=this.techniques.get(w,this._configuration);if(!r.compiled)return this.requestRender(1),t;const i=t.getAttachment(F),a=this.renderingContext,{fullWidth:o,fullHeight:n}=this.bindParameters.camera,h=o,m=n;let c=null;return s&&(c=this.fboCache.acquire(h,m,"glow horizontal",8),this._blit??=new v(this.techniques),this._blit.blitTexture(a,s?.attachment,c,this.bindParameters)),t.attachDepth(null),a.bindFramebuffer(t.fbo),s&&(this._passParameters.emission=c?.getTexture()),a.bindTechnique(r,this.bindParameters,this._passParameters),a.screen.draw(),t.attachDepth(i),c?.release(),t}_update(){const e=this.bindParameters.camera;h(N,e.eye);const t=Math.max(0,m(N,this.bindParameters.lighting.mainLight.direction)),r=this._parameters.color;c(x,r,.1),p(this._passParameters.color,x,r,t);const i=l(e.eye);this._passParameters.atmosphereC=i**2-this._atmosphereRadius**2,this._passParameters.amount=(1-s(E*b,R*b,Math.abs(i-this._planetRadius)))*this._parameters.amount,this._passParameters.strength=this._parameters.strength}get test(){return{parameters:this._passParameters}}};e([a()],T.prototype,"consumes",void 0),T=e([o("esri.views.3d.environment.Fog")],T);class q{constructor(){this.color=d(),this.strength=0,this.amount=0}copyFrom(e){this.amount=e.amount,this.strength=e.strength,n(this.color,e.color)}lerp(e,s,r){this.amount=t(e.amount,s.amount,r),this.strength=t(e.strength,s.strength,r),p(this.color,e.color,s.color,r)}}const N=d(),x=d(),A=u(.5,.5,.5),C=u(1.5,1.5,1.5);export{T as Fog,q as FogParameters};
5
+ import{__decorate as e}from"tslib";import{lerp as t,smoothstep as s}from"../../../core/mathUtils.js";import{watch as r,syncAndInitial as i}from"../../../core/reactiveUtils.js";import{property as a,subclass as o}from"../../../core/accessorSupport/decorators.js";import{d as n,n as h,g as m,j as c,l as p,b as l}from"../../../chunks/vec32.js";import{fromValues as u,create as d}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{getReferenceEllipsoid as _}from"../../../geometry/ellipsoidUtils.js";import{InternalRenderCategory as g}from"../webgl.js";import{F as f}from"../../../chunks/Fog.glsl.js";import{FogTechnique as w}from"./FogTechnique.js";import{FogTechniqueConfiguration as P}from"./FogTechniqueConfiguration.js";import{heightLimit as b}from"./weather.js";import{TransparentEnvironment as v}from"../webgl-engine/effects/TransparentEnvironment.js";import{Blit as y}from"../webgl-engine/effects/blit/Blit.js";import{ColorAttachment1 as j,DepthStencilAttachment as F}from"../../webgl/enums.js";const E=.95,R=1;let T=class extends v{constructor(e){super(e),this.consumes={required:[g.TRANSPARENT_ENVIRONMENT]},this._configuration=new P,this._newParameters=new q,this._oldParameters=new q,this._fadedParameters=new q,this._parameters=this._newParameters,this._passParameters=new f,this._blit=null;const t=_(e.view.spatialReference);this._planetRadius=t.radius,this._atmosphereRadius=t.radius+t.atmosphereHeight;const s=e.view.stage.renderView.techniques;s.precompile(w,this._configuration),this._configuration.hasEmissive=!this._configuration.hasEmissive,s.precompile(w,this._configuration),this._configuration.hasEmissive=!this._configuration.hasEmissive}toogle(){this.view.environment.atmosphereEnabled&&this.view.environment.weather?this._enable():this._disable()}initialize(){this.addHandles([r(()=>this.view.environment.atmosphereEnabled,()=>this.toogle(),i),r(()=>this.view.environment.weather,()=>this.toogle(),i),r(()=>this._updateFogParameters(),()=>{},i)]),this.addHandles(r(()=>this._fadeFactor,e=>this._fade(e),i))}get _fadeFactor(){return this.view.stage?.renderer.renderContext.bind.clouds.fadeFactor??1}_fade(e){const{_newParameters:t,_oldParameters:s}=this;e>=1?(this._parameters=t,this._oldParameters.copyFrom(this._newParameters)):e<=0?this._parameters=s:(this._fadedParameters.lerp(s,t,e),this._parameters=this._fadedParameters)}_updateFogParameters(){const e=this.view.environment.weather,s="foggy"===e.type||"snowy"===e.type||"rainy"===e.type;this._newParameters.strength="foggy"===e.type?t(3e-5,.005,e.fogStrength**3):"snowy"===e.type||"rainy"===e.type?t(4e-6,2e-4,(e.precipitation??0)**3):0,this._newParameters.amount=s?1:0,"foggy"!==e.type&&"snowy"!==e.type||n(this._newParameters.color,C),"rainy"===e.type&&n(this._newParameters.color,A),this._fadeFactor>=1&&this._oldParameters.copyFrom(this._newParameters),this.requestRender(2)}render(e){const t=e.find(({name:e})=>e===g.TRANSPARENT_ENVIRONMENT);if(0===this._parameters.amount)return t;if(this._update(),this._passParameters.amount<=0)return t;const s=t.getAttachment(j);this._configuration.hasEmissive=null!=s;const r=this.techniques.get(w,this._configuration);if(!r.compiled)return this.requestRender(1),t;const i=t.getAttachment(F),a=this.renderingContext,{fullWidth:o,fullHeight:n}=this.bindParameters.camera,h=o,m=n;let c=null;return s&&(c=this.fboCache.acquire(h,m,"glow horizontal",8),this._blit??=new y(this.techniques),this._blit.blitTexture(a,s?.attachment,c,this.bindParameters)),t.attachDepth(null),a.bindFramebuffer(t.fbo),s&&(this._passParameters.emission=c?.getTexture()),a.bindTechnique(r,this.bindParameters,this._passParameters),a.screen.draw(),t.attachDepth(i),c?.release(),t}_update(){const e=this.bindParameters.camera;h(N,e.eye);const t=Math.max(0,m(N,this.bindParameters.lighting.mainLight.direction)),r=this._parameters.color;c(x,r,.1),p(this._passParameters.color,x,r,t);const i=l(e.eye);this._passParameters.atmosphereC=i**2-this._atmosphereRadius**2,this._passParameters.amount=(1-s(E*b,R*b,Math.abs(i-this._planetRadius)))*this._parameters.amount,this._passParameters.strength=this._parameters.strength}get test(){return{parameters:this._passParameters}}};e([a()],T.prototype,"consumes",void 0),T=e([o("esri.views.3d.environment.Fog")],T);class q{constructor(){this.color=d(),this.strength=0,this.amount=0}copyFrom(e){this.amount=e.amount,this.strength=e.strength,n(this.color,e.color)}lerp(e,s,r){this.amount=t(e.amount,s.amount,r),this.strength=t(e.strength,s.strength,r),p(this.color,e.color,s.color,r)}}const N=d(),x=d(),A=u(.5,.5,.5),C=u(1.5,1.5,1.5);export{T as Fog,q as FogParameters};
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import t from"../../../Graphic.js";import i from"../../../request.js";import{isSome as r}from"../../../core/arrayUtils.js";import{result as s,forEach as o}from"../../../core/asyncUtils.js";import"../../../core/has.js";import n from"../../../core/Logger.js";import{destroyMaybe as a,abortMaybe as d}from"../../../core/maybe.js";import{estimateNumberArrayMemory as l,baseObjectMemory as u,estimateNumberMemory as h,estimateFixedArrayMemory as p,baseArrayMemory as c}from"../../../core/memoryEstimations.js";import{isAbortError as _,allSettledValues as m,throwIfAborted as g}from"../../../core/promiseUtils.js";import{initial as f,watch as y,sync as b,syncAndInitial as w}from"../../../core/reactiveUtils.js";import{pt2px as P}from"../../../core/screenUtils.js";import{isArrayBuffer as N}from"../../../core/typedArrayUtil.js";import{property as v,subclass as x}from"../../../core/accessorSupport/decorators.js";import{b as C,i as S,g as I,d as A}from"../../../chunks/vec32.js";import{clone as j}from"../../../core/libs/gl-matrix-2/factories/vec3f32.js";import{fromValues as R}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import k from"../../../geometry/Extent.js";import V from"../../../geometry/Point.js";import{projectBoundingSphere as Q}from"../../../geometry/projection/projectBoundingSphere.js";import{projectVectorToVector as F}from"../../../geometry/projection/projectVectorToVector.js";import{create as E,fromMinMax as O}from"../../../geometry/support/aaBoundingBox.js";import{fromNormalAndOffset as D,create as L}from"../../../geometry/support/plane.js";import{Sphere as U}from"../../../geometry/support/sphere.js";import W from"../../../layers/graphics/OptimizedGeometry.js";import{QueryEngine as G}from"../../../layers/graphics/data/QueryEngine.js";import{CodedValue as M}from"../../../layers/support/CodedValue.js";import q from"../../../layers/support/CodedValueDomain.js";import"../../../layers/support/Domain.js";import"../../../layers/support/InheritedDomain.js";import"../../../layers/support/RangeDomain.js";import{unpackFieldNames as z}from"../../../layers/support/fieldUtils.js";import{queueAutoPriority as H}from"../../../request/queue.js";import T from"../../../rest/support/FeatureSet.js";import B from"../../../rest/support/Query.js";import{getElevationOffset as $}from"../../../support/elevationInfoUtils.js";import{LayerView3D as J}from"./LayerView3D.js";import{PointCloudLayerViewPerformanceInfo as K,QueuePerformanceInfo as Z}from"./PointCloudLayerViewPerformanceInfo.js";import{PointCloudWorkerHandle as Y}from"./PointCloudWorkerHandle.js";import{I3SQueryFeatureStore as X}from"./i3s/I3SQueryFeatureStore.js";import{checkPointCloudLayerValid as ee,checkPointCloudLayerCompatibleWithView as te}from"./i3s/I3SUtil.js";import{nodeDiff as ie,sortFrontToBack as re,splitWorkEntries as se}from"./i3s/LoDUtil.js";import{PagedNodeIndex as oe}from"./i3s/PagedNodeIndex.js";import{PointCloudGraphic as ne}from"./i3s/PointCloudGraphic.js";import{PointCloudRenderer as ae}from"./i3s/PointCloudRenderer.js";import{isPointRendererNode as de,PointCloudRendererNode as le}from"./i3s/PointCloudRendererNode.js";import{getSplatSizeAlgorithm as ue,getFixedSizeAlgorithm as he,getRendererInfo as pe,getFilterInfo as ce,rendererUsesFixedSizes as _e,getAttributeInfo as me}from"./i3s/PointCloudRendererUtil.js";import{getAttributeValues as ge,readGeometry as fe,elevationFromPositions as ye}from"./i3s/PointCloudWorkerUtil.js";import{normalizeHighlightTarget as be,emptyHighlightHandle as we}from"./support/highlightUtils.js";import{PopupSceneLayerView as Pe}from"./support/PopupSceneLayerView.js";import{projectToBoundingBox as Ne}from"../support/extentUtils.js";import{computeMapPointFromVec3d as ve}from"../support/hitTest.js";import{Obb as xe}from"../support/orientedBoundingBox.js";import{updatingProgress as Ce}from"../support/updatingProperties.js";import Se from"../../layers/LayerView.js";import{PointCloudLayerViewMixin as Ie}from"../../layers/PointCloudLayerView.js";import{getHighlightName as Ae}from"../../support/highlightOptionsUtils.js";import{isInEffectiveScaleRange as je}from"../../support/layerViewUtils.js";import{PromiseQueue as Re}from"../../support/PromiseQueue.js";import{TaskPriority as ke}from"../../support/Scheduler.js";const Ve=8,Qe=L();let Fe=class extends(Ie(Pe(J(Se)))){constructor(){super(...arguments),this.type="point-cloud-3d",this.maximumPointCount=4e6,this.slicePlaneEnabled=!1,this._renderer=null,this._rendererAdded=!1,this._renderedNodes=new Set,this._updateViewNeeded=!0,this._lodFactor=1,this._maxLoggedBoxWarnings=5,this._pageMultiplier=1,this._nodeLoadEpoch=0,this._indexQueue=[],this._workQueue=new Array,this._idleQueue=new Re,this._loadingPages=new Map,this._loadingNodes=new Map,this._recalcWork=!0,this._layerIsVisible=!1,this._codedDomainPopulationPromise=null,this._codedDomainPopulationAbortController=null,this._totalWork=0,this._index=null,this._loadingInitNodePage=!1,this._nodeIdArray=[],this.ignoresMemoryFactor=!1}get baseUrl(){return this.layer.parsedUrl?.path??""}get pointScale(){const e=ue(this.layer?.renderer),t=1;return null!=e?.scaleFactor?e.scaleFactor:t}get useRealWorldSymbolSizes(){const e=he(this.layer?.renderer),t=!1;return null!=e?.useRealWorldSymbolSizes?e.useRealWorldSymbolSizes:t}get pointSize(){const e=he(this.layer?.renderer),t=0;return null!=e?.size?e.size:t}get inverseDensity(){const e=96;return this.layer?.renderer?1*e/this.layer.renderer.pointsPerInch:5}get availableFields(){const e=pe(this.layer),t=new Set;e.primaryAttribute&&t.add(e.primaryAttribute.name),e.modulationAttribute&&t.add(e.modulationAttribute.name);const i=ce(this.layer);if(i)for(const r of i)r.attributeInfo&&t.add(r.attributeInfo.name);if(this.layer.outFields)for(const r of z(this.layer.fieldsIndex,this.layer.outFields))t.add(r);return Array.from(t)}get _clippingBox(){if(!this.view||!this.view.clippingArea)return null;const e=E(),t=this.view.renderSpatialReference;return Ne(this.view.clippingArea,e,t)?e:null}get _elevationOffset(){const e=this.layer&&this.layer.elevationInfo;return"absolute-height"===e?.mode?$(e,this.layer.spatialReference):0}get _graphicOrigin(){return this.layer.graphicOrigin}initialize(){const e=this.view.resourceController,t=Ue(e);this._worker=new Y(t),this.addResolvingPromise(this._worker.promise),this.addResolvingPromise(this.layer.rootPagePromise),ee(this.layer),te(this.layer,this.view),this._initRenderer();const i=this._initNodePages(),r=this.view.resourceController.memoryController;this._memCache=r.newCache(`pcl-${this.layer.uid}`),this._queryFeaturesCache=r.newCache(`pcl-query-features-${this.layer.uid};`),this._updatingHandles.add(()=>this._clippingBox,()=>this._setUpdateViewNeeded(),f),this._updatingHandles.add(()=>this._elevationOffset,()=>this._elevationOffsetChanged(),f),this._updatingHandles.add(()=>this.layer.renderer,()=>this._rendererChanged(),f),this._updatingHandles.add(()=>this.layer.filters,()=>this._reload(),f),this._updatingHandles.add(()=>this.layer.outFields,()=>this._reload(),f),this._updatingHandles.add(()=>this.layer.effectiveScaleRange,()=>this._setUpdateViewNeeded()),this._updatingHandles.add(()=>this.view.state.contentCamera,()=>this._setUpdateViewNeeded()),this.addHandles([y(()=>this.view.quality,()=>this._setUpdateViewNeeded(),b)]),this.addResolvingPromise(i),this.when(()=>{this.addHandles([e.scheduler.registerTask(ke.POINT_CLOUD_LAYER,this),y(()=>2===this.view.state.mode,()=>this._setUpdateViewNeeded(),w),this._updatingHandles.add(()=>this.suspended,e=>{e?this._clearNodeState():this._setUpdateViewNeeded()},f)])},()=>{this._updatingHandles.removeAll(),this.removeAllHandles()})}_setUpdateViewNeeded(){this._updateViewNeeded=!0,this._updateLoading()}destroy(){this.cancelLoading(),this._worker=a(this._worker),this._destroyRenderer(),this._memCache=a(this._memCache),this._queryFeaturesCache=a(this._queryFeaturesCache),this._queryEngine=a(this._queryEngine),this._codedDomainPopulationAbortController=d(this._codedDomainPopulationAbortController),this._codedDomainPopulationPromise=null}_initRenderer(){this._renderer=new ae({createGraphic:(e,t,i)=>this._createGraphic(e,t,i)}),this._renderer.layerViewUid=this.uid,this._updatingHandles.add(()=>this._clippingBox,e=>this._renderer.clippingBox=e,f),this._updatingHandles.add(()=>this.suspended,e=>this._setPointsVisible(!e),f),this._updatingHandles.add(()=>this.pointScale,e=>this._renderer.scaleFactor=e,f),this._renderer.minSizePx=Math.sqrt(2),this._updatingHandles.add(()=>this.useRealWorldSymbolSizes,e=>this._renderer.useRealWorldSymbolSizes=e,f),this._updatingHandles.add(()=>this.pointSize,e=>{const t=P(e);this._renderer.size=e,this._renderer.sizePx=t},f),this._updatingHandles.add(()=>this.slicePlaneEnabled,e=>this._renderer.slicePlaneEnabled=e,f),this._updatingHandles.add(()=>this.inverseDensity,()=>this._setUpdateViewNeeded(),f),this._updatingHandles.add(()=>this.maximumPointCount,()=>this._setUpdateViewNeeded(),f),this._updatingHandles.add(()=>this.view.qualitySettings.sceneService.pointCloudLoDFactor,e=>{this._lodFactor=e,this._setUpdateViewNeeded()},f)}_destroyRenderer(){this._renderer.removeAll(),this._setPointsVisible(!1)}_createGraphic(e,t,i,r){const s=null!=e.pointIdFilterMap?e.pointIdFilterMap[t]:t,o=i?"declaredClass"in i?i:ve(this.view,i):null;return r??=this._createGraphicAttributes(e,s),new ne({pointCloudMetadata:{nodeId:e.id,pointIndexInNode:t,attributePointIndexInNode:s,epoch:this._nodeLoadEpoch},geometry:o,attributes:r,layer:this.layer,sourceLayer:this.layer,origin:this._graphicOrigin})}_createGraphicAttributes(e,t){const i={};for(const r of e.attributes)this._encodeGraphicAttribute(r.attributeInfo,r.values,t,i);return i}_getGraphicAttribute(e,t,i){const r=e.storageInfo?.attributeValues,s=r?.valuesPerElement??1;if(1===s)return t[i];if("UInt8"===r?.valueType&&s<=4){let e=0;const r=i*s;for(let i=r;i<r+s;i++)e=(e<<8)+t[i];return e}}_encodeGraphicAttribute(e,t,i,r){r[e.name]=this._getGraphicAttribute(e,t,i)}_setPointsVisible(e){e&&!this._rendererAdded?(this.view.stage.addRenderPlugin(this._renderer),this._rendererAdded=!0):!e&&this._rendererAdded&&(this.view.stage.removeRenderPlugin(this._renderer),this._rendererAdded=!1)}_rendererChanged(){this._renderer.useFixedSizes=_e(this.layer.renderer),this._reload()}_reload(){this._clearNodeState(),this._memCache.clear(),this._setUpdateViewNeeded()}_elevationOffsetChanged(){this._clearNodeState(),this._memCache.clear(),this._initNodePages()}_displayNodes(e){this._workQueue=ie([...this._renderedNodes],e,this._index),re(this._workQueue,this.view.state.contentCamera.viewForward,this._index),se(this._workQueue,Ve,this._index),this._updateQueues(),this._totalWork=this._computeWork(),this._updateLoading(),this._layerIsVisible=e.length>0||this._loadingInitNodePage,this.notifyChange("suspended")}cancelLoading(){this._cancelNodeLoading(),this._cancelIndexLoading()}_cancelNodeLoading(){[...this._loadingNodes.values()].forEach(e=>e.abort()),this._workQueue=[],this._idleQueue.cancelAll(),this._totalWork=this._computeWork(),this._updateLoading()}_updateQueues(){const e=new Set;this._workQueue.forEach(t=>t.load.forEach(t=>e.add(t)));const t=new Array;this._loadingNodes.forEach((i,r)=>{e.has(r)||(this._loadingNodes.delete(r),t.push(i))}),t.forEach(e=>e.abort()),this._workQueue=this._workQueue.filter(e=>{for(const t of e.load)if(this._loadingNodes.has(t))return this._recalcWork=!0,!1;return!0}),this._totalWork=this._computeWork(),this._updateLoading()}_cancelIndexLoading(){this._indexQueue=[],this._loadingPages.forEach(e=>e.abort()),this._loadingPages.clear(),this._totalWork=this._computeWork(),this._updateLoading()}_clearNodeState(){this._nodeLoadEpoch++,this._renderedNodes.forEach(e=>this._removeFromRenderer(e)),this._cancelNodeLoading()}get readyToRun(){return this.suspended?this._updateViewNeeded:this._updateViewNeeded||this._indexQueue.length>0||this._workQueue.length>0||this._idleQueue.readyToRun}runTask(e){if(this.suspended){if(this._updateViewNeeded){this._updateViewNeeded=!1;const e=this._isRootNodeVisible();e!==this._layerIsVisible&&(this._layerIsVisible=e,this.notifyChange("suspended")),this._updateLoading()}}else{for(e.run(()=>this._updateWorkQueues());this._indexQueue.length>0&&!e.done;)this._processIndexQueue(),e.madeProgress();this._processWorkQueue(e),this._idleQueue.runTask(e)}}async _processIndexQueue(){const e=this._indexQueue.shift(),t=new AbortController;this._loadingPages.set(e,t);try{const i=await this._loadNodePage(e,t.signal);this._index.addPage(e,i,this._elevationOffset),this._setUpdateViewNeeded(),this._loadingPages.delete(e)}catch(i){this._loadingPages.get(e)===t&&this._loadingPages.delete(e)}}_processWorkQueue(e){for(;!e.done;){const t=this._scheduleWorkEntry();if(null==t)return void e.madeProgress();this._processWorkEntry(t),e.madeProgress()}}_scheduleWorkEntry(){let e=this._workQueue.length;for(;e--;){const e=this._workQueue.shift();if(!e.remove.find(e=>!this._renderedNodes.has(e)))return e;this._workQueue.push(e)}return null}async _processWorkEntry(e){if(0===e.load.length){for(const t of e.remove)this._removeFromRenderer(t);return}const t=e.load.map(e=>{const t=new AbortController;return this._loadingNodes.set(e,t),t});this._updateLoading();try{const i=await Promise.all(e.load.map((e,i)=>this._memCache.pop(`${e}`)??this._loadNode(e,t[i].signal)));for(let t=0;t<e.load.length;t++)if(i[t]){const r=this._setupRendererData(e.load[t],i[t]);this._addToRenderer(r)}for(const t of e.remove)this._removeFromRenderer(t);for(const t of e.load)this._loadingNodes.delete(t)}catch(i){e.load.forEach((e,i)=>{this._loadingNodes.get(e)===t[i]&&this._loadingNodes.delete(e)})}this._updateLoading(),this._recalcWork&&!this._idleQueue.updating&&0===this._indexQueue.length&&0===this._loadingNodes.size&&(this._recalcWork=!1,this._setUpdateViewNeeded())}async _populateClassCodeCodedDomain(e,t){const i="CLASS_CODE",r=this.layer.fieldsIndex.get(i);if(!r||r.domain)return;if(!e.includes(r.name))return;const o=await s(this.layer.queryCachedStatistics(i,{signal:t}));if(!1===o.ok)return;const n=o.value?.stats?.labels?.labels;n&&Array.isArray(n)&&(r.domain=new q({name:"CLASS_CODE",codedValues:n.map(e=>new M({code:e.value,name:e.label}))}))}async prepareFetchPopupFeatures(e){return this._codedDomainPopulationPromise||(this._codedDomainPopulationAbortController=new AbortController,this._codedDomainPopulationPromise=this._populateClassCodeCodedDomain(e,this._codedDomainPopulationAbortController.signal).then(()=>{this._codedDomainPopulationAbortController=null})),this._codedDomainPopulationPromise}async whenGraphicAttributes(e,t){const i=this._splitGraphicsPerNode(e),s=this.layer.attributeStorageInfo,n=t.map(e=>me(s,e)).filter(r),a=async(e,t)=>{const i=this._index.getNode(t);await o(n,async t=>{const r=t.useElevation?await this._loadElevationAttributeFromGeometry(i.resourceId):await this._loadAndParseAttribute(i,t);if(r)for(const i of e)if(this._isValidPointGraphic(i)){const e=i.pointCloudMetadata.attributePointIndexInNode;this._encodeGraphicAttribute(t,r,e,i.attributes)}})},d=[];return i.forEach((e,t)=>{d.push(a(e,t))}),await Promise.allSettled(d),e}_isValidPointGraphic(e){return e instanceof ne&&e.pointCloudMetadata?.epoch===this._nodeLoadEpoch}_splitGraphicsPerNode(e){const t=new Map;for(const i of e){if(!this._isValidPointGraphic(i))continue;const e=i.pointCloudMetadata,r=t.get(e.nodeId);r?r.push(i):t.set(e.nodeId,[i])}return t}async _loadAndParseAttribute(e,t){const i=await this._loadAttribute(e.resourceId,t,null);return i?ge({attributeInfo:t,buffer:i},null,e.vertexCount):null}async _loadElevationAttributeFromGeometry(e){const t=this.layer.store.defaultGeometrySchema,i=fe(t,await this._loadGeometry(e,null));return ye(i,i.length/3)}highlight(e,i){const r=be(e);if(0===r.length)return we;if(!(r[0]instanceof t))return we;const s=r;return this._renderer.highlight(s.map(e=>this._graphicToPointDefinition(e)),Ae(i))}_graphicToPointDefinition(e){if(!this._isValidPointGraphic(e))return null;const{nodeId:t,pointIndexInNode:i}=e.pointCloudMetadata;return null!=t&&null!=i?{nodeId:t,pointId:i}:null}_computeWork(){let e=0;for(const t of this._workQueue)e+=t.load.length+t.remove.length;return e+=this._loadingNodes.size,e+=(this._indexQueue.length+this._loadingPages.size)*this._index.pageSize,e+=this._loadingInitNodePage?100:0,e+=this._updateViewNeeded?100:0,e}get updatingProgressValue(){if(this.suspended)return this._updateViewNeeded?0:1;const e=this._computeWork();return 1-Math.min(this._totalWork,e)/this._totalWork}_updateLoading(){this.notifyChange("updating"),this.notifyChange("updatingProgressValue")}canResume(){return super.canResume()&&this._layerIsVisible}isUpdating(){return this.suspended?this._updateViewNeeded:this._computeWork()>0}get visibleAtCurrentScale(){return je(this.layer.effectiveScaleRange,this.view.scale)}async queryFeatures(e,i){const r=await this._ensureQueryEngine().executeQuery(this._ensureQueryJSON(e),i?.signal),s=r.features;r.features=[];const o=T.fromJSON(r),n=this.view.spatialReference;return o.features=s.map(e=>{const{attributes:i,metadata:r}=e;if(!r){const i=t.fromJSON(e);return i.geometry&&(i.geometry.spatialReference=o.spatialReference??n),i.layer=this.layer,i.sourceLayer=this.layer,i.origin=this._graphicOrigin,i}const s=e.geometry?V.fromJSON(e.geometry):void 0;return s&&(s.spatialReference=o.spatialReference??n),this._createGraphic(r.node,r.pointId,s,i)}),o}createQuery(){const e={outFields:["*"],returnGeometry:!0,outSpatialReference:this.view.spatialReference,returnZ:!0};return new B(e)}async queryFeatureCount(e,t){return await this._ensureQueryEngine().executeQueryForCount(this._ensureQueryJSON(e),t?.signal)}async queryExtent(e,t){const{count:i,extent:r}=await this._ensureQueryEngine().executeQueryForExtent(this._ensureQueryJSON(e),t?.signal);return{count:i,extent:k.fromJSON(r)}}_ensureQueryJSON(e){return null==e?new B({outSpatialReference:this.view.spatialReference}).toJSON():B.from(e).toJSON()}_ensureQueryEngine(){if(this._queryEngine)return this._queryEngine;const{spatialReference:e}=this.view;return this._queryEngine=new G({fieldsIndex:this.layer.fieldsIndex.toJSON(),geometryType:"esriGeometryPoint",spatialReference:e,featureIdInfo:{type:"object-id",fieldName:"objectId"},hasZ:!0,featureStore:new X({sourceSpatialReference:e,viewSpatialReference:e,forAllFeatures:(e,t)=>{this._renderer.forEachNode(i=>{if(t){const e=i.obb,r=new U(e.center,C(e.halfSize));Q(r,this.view.renderSpatialReference,r,this.view.spatialReference);if(1===t(r))return}let r=this._queryFeaturesCache.get(`${i.id}`);r||(r=this._createQueryPointFeatures(i),this._queryFeaturesCache.put(`${i.id}`,r)),r.features.forEach(e)})},getFeatureExtent:({point:e},t)=>O(e,e,t),featureAdapter:{cloneWithGeometry:(e,t)=>new Oe(e.node,e.pointId,t.coords),getAttribute:({node:e,attributePointId:t},i)=>{for(const r of e.attributes)if(r.attributeInfo.name===i)return this._getGraphicAttribute(r.attributeInfo,r.values,t)},getAttributes:({node:e,attributePointId:t})=>this._createGraphicAttributes(e,t),getCentroid:e=>e.getGeometry(),getGeometry:e=>e.getGeometry(),getObjectId:()=>{},getMetadata:e=>e}})}),this._queryEngine}_createQueryPointFeatures(e){const t=e.coordinates,i=new Array;for(let r=0;r<t.length/3;r++){const s=3*r,o=R(t[s+0],t[s+1],t[s+2]);S(o,o,e.origin),F(o,this.view.renderSpatialReference,o,this.view.spatialReference);const n=new Oe(e,r,o);i.push(n)}return new De(i)}async _initNodePages(){const e=this.layer.store.index,t=e.nodesPerPage||e.nodePerIndexBlock;this._index=new oe(this.layer.spatialReference,this.view.renderCoordsHelper.spatialReference,t),this._cancelIndexLoading(),this._traverseVisible=this._index.createVisibilityTraverse(),this._loadingInitNodePage=!0,this._layerIsVisible=!0,this.notifyChange("suspended"),this._updateLoading(),this._pageMultiplier=null!=e.nodesPerPage?1:e.nodePerIndexBlock;const i=await this.layer.rootPagePromise;this._loadingInitNodePage=!1,i?(this._index.addPage(0,this._processJSONNodes(i,0),this._elevationOffset),this._setUpdateViewNeeded()):n.getLogger(this).error("Point cloud layer root page not loaded")}_loadNodePage(e,t){const i=`${this.baseUrl}/nodepages/${e*this._pageMultiplier}`;return this._requestNodePage(i,t).then(t=>this._processJSONNodes(t,e))}_processJSONNodes(e,t){const i=t*this._index.pageSize;return e.nodes.map((e,t)=>({resourceId:e.resourceId??i+t,obb:xe.fromJSON(e.obb),obbInRenderSR:new xe,firstChild:e.firstChild,childCount:e.childCount,vertexCount:e.vertexCount??e.pointCount,lodThreshold:e.lodThreshold??e.effectiveArea}))}_updateWorkQueues(){if(!this._updateViewNeeded)return!1;const e=this.view.quality;let t=this.inverseDensity/this._lodFactor*e;const i=this.maximumPointCount*this._lodFactor*e;let r=this._computeNodesForMinimumDensity(t),s=this._computePointCount(r),o=Math.sqrt(s/(.75*i));for(;s>i;)t*=o,r=this._computeNodesForMinimumDensity(t),s=this._computePointCount(r),o=Math.sqrt(2);return this._displayNodes(r),this._updateViewNeeded=!1,this._updateLoading(),!0}_computePointCount(e){let t=0;for(let i=0;i<e.length;i++){const r=this._index.getNode(e[i]);r&&(t+=r.vertexCount)}return t}_isRootNodeVisible(){let e=!1;return this._traverseVisible({frustum:this.view.state.contentCamera.frustum,clippingBox:this._clippingBox},{predicate:(t,i,r)=>(e=r,!1),pageMiss:()=>{}}),e}_computeNodesForMinimumDensity(e){const t=this.view.state.contentCamera,i=t.frustum,r=this._clippingBox,s=t.viewForward,o=I(s,t.eye),n=D(s,-o,Qe),a=t.perScreenPixelRatio/2,d=e*e,l=this._nodeIdArray;l.length=0;const u=e=>l.push(e);return this._traverseVisible({frustum:i,clippingBox:r},{predicate:(e,t,i)=>{if(!i)return!1;if(0===t.childCount)return u(e),!1;const r=this._index.getRenderObb(e);return!(this._computeAveragePixelArea(r,t.lodThreshold,t.vertexCount,n,a)<=d)||(u(e),!1)},pageMiss:(e,t)=>{u(e),this._indexQueue.includes(t)||this._indexQueue.push(t)}}),l}_computeAveragePixelArea(e,t,i,r,s){const o=1e-7,n=Math.max(o,e.minimumDistancePlane(r));return t/(n*n)/(4*s*s)/i}_loadNode(e,t){try{return this._loadNodeAsync(e,t)}catch(i){throw _(i)||n.getLogger(this).error(i),i}}async _loadAdditionalUserAttributes(e,t,i){const s=this.layer.outFields;if(!s)return[];const o=z(this.layer.fieldsIndex,s),n=new Set(e.map(e=>null!=e?e.name:null)),a=this.layer.attributeStorageInfo,d=[];for(const r of o){if(n.has(r))continue;const e=me(a,r);e&&d.push(t(e))}const l=await m(d);return g(i),l.filter(r)}async _loadNodeAsync(e,t){const i=this._index.getNode(e),r=pe(this.layer),s=ce(this.layer),o=i.resourceId,n=async e=>{if(!e)return null;if(e.useElevation)return{attributeInfo:e,buffer:null};const i=await this._loadAttribute(o,e,t);return null!=i?{attributeInfo:e,buffer:i}:null};return this._idleQueue.push(async()=>{const i=this._loadGeometry(o,t),{primaryAttribute:a,modulationAttribute:d}=r,l=n(a),u=n(d),h=s.map(e=>e.attributeInfo),p=h.map(e=>n(e)),c=this._loadAdditionalUserAttributes([a,d,...h],n,t),[_,m,f,y,b]=await Promise.all([i,l,u,Promise.all(p),c]);g(t);const w={geometryBuffer:_,primaryAttributeData:m,modulationAttributeData:f,filterAttributesData:y,userAttributesData:b,schema:this.layer.store.defaultGeometrySchema,rendererInfo:r,filterInfo:s,obbData:this._index.getRenderObb(e).data,elevationOffset:this._elevationOffset,inSR:this.layer.spatialReference.toJSON(),outSR:this.view.renderCoordsHelper.spatialReference.toJSON()};return this._worker.invoke(w,t)},t)}async _loadGeometry(e,t){return this._requestData(`${this.baseUrl}/nodes/${e}/geometries/0`,t)}async _loadAttribute(e,t,i){if(!t?.storageInfo)return null;const r=t.storageInfo.key;return this._requestData(`${this.baseUrl}/nodes/${e}/attributes/${r}`,i)}async _requestNodePage(e,t){const r={f:"json",...this.layer.customParameters,token:this.layer.apiKey},s={...H,query:r,responseType:"json",signal:t};return(await i(e,s)).data}async _requestData(e,t){const r={...this.layer.customParameters,token:this.layer.apiKey},s={...H,query:r,responseType:"array-buffer",signal:t};return(await i(e,s)).data}_removeFromRenderer(e){if(this._renderedNodes.has(e)){const t=this._renderer.removeNode(e);this._renderedNodes.delete(e),this._memCache.put(`${t.id}`,t)}}_addToRenderer(e){this._renderedNodes.has(e.id)||(this._renderedNodes.add(e.id),this._renderer.addNode(e))}_setupRendererData(e,t){const i=this._index.getNode(e),r=Math.sqrt(i.lodThreshold/i.vertexCount),s=this._index.getRenderObb(e);if(de(t))return t.splatSize=r,t.obb=s,A(t.origin,t.obb.center),t;const o=xe.fromData(t.obbData),a=o.halfSize,d=s.halfSize,l=.01*Math.max(d[0],d[1],d[2]);if(a[0]>d[0]+l||a[1]>d[1]+l||a[2]>d[2]+l){if(this._maxLoggedBoxWarnings>0){const t=e=>`[${e.halfSize[0]}, ${e.halfSize[1]}, ${e.halfSize[2]}]`;n.getLogger(this).warn(`Node ${e} reported bounding box too small. got ${t(s)} but points cover ${t(o)}`),0===--this._maxLoggedBoxWarnings&&n.getLogger(this).warn(" Too many bounding box errors, stopping reporting for this layer.")}this._index.setRenderObb(e,o)}return new le(e,r,j(s.center),s,0===i.childCount,t.points,t.rgb,t.attributes,t.pointIdFilterMap)}get usedMemory(){let e=0;return this._renderer.forEachNode(t=>{e+=Le,e+=l(t.coordinates);for(const i of t.attributes){const t=i.values;N(t.buffer)&&(e+=l(t))}}),e}get unloadedMemory(){const e=this._renderedNodes.size;if(e<4)return 0;const t=[...this._renderedNodes].reduce((e,t)=>e+this._index.getNode(t).vertexCount);let i=this._loadingNodes.size;for(let r=0;r<this._workQueue.length;r++)i+=this._workQueue[r].load.length,i-=this._workQueue[r].remove.length;if(i<0)return 0;return i*t/e*((this.usedMemory-e*Le)/t)+i*Le}get performanceInfo(){return new K(this.usedMemory,this._renderedNodes.size,[...this._renderedNodes].reduce((e,t)=>e+this._index.getNode(t).vertexCount,0),this.maximumPointCount,new Z(this._loadingNodes.size,this._indexQueue.length,this._workQueue.length,this._idleQueue.length))}get test(){}};e([v()],Fe.prototype,"layer",void 0),e([v()],Fe.prototype,"baseUrl",null),e([v()],Fe.prototype,"pointScale",null),e([v()],Fe.prototype,"useRealWorldSymbolSizes",null),e([v()],Fe.prototype,"pointSize",null),e([v()],Fe.prototype,"inverseDensity",null),e([v()],Fe.prototype,"maximumPointCount",void 0),e([v({readOnly:!0})],Fe.prototype,"availableFields",null),e([v({readOnly:!0})],Fe.prototype,"_clippingBox",null),e([v({readOnly:!0})],Fe.prototype,"_elevationOffset",null),e([v({type:Boolean})],Fe.prototype,"slicePlaneEnabled",void 0),e([v()],Fe.prototype,"_graphicOrigin",null),e([v()],Fe.prototype,"updating",void 0),e([v(Ce)],Fe.prototype,"updatingProgress",void 0),e([v({readOnly:!0})],Fe.prototype,"updatingProgressValue",null),e([v({readOnly:!0})],Fe.prototype,"visibleAtCurrentScale",null),Fe=e([x("esri.views.3d.layers.PointCloudLayerView3D")],Fe);const Ee=Fe;class Oe{constructor(e,t,i){this.node=e,this.pointId=t,this.point=i}getGeometry(){return new W([],Array.from(this.point),!0,!1)}get attributePointId(){const{node:e,pointId:t}=this;return null!=e.pointIdFilterMap?e.pointIdFilterMap[t]:t}get usedMemory(){return u+u+h+p(this.point,h)}}class De{constructor(e){this.features=e}get usedMemory(){return this.features.reduce((e,t)=>e+t.usedMemory,u+c)}}const Le=160;function Ue(e){return t=>e.immediate.schedule(t)}export{Ee as default};
5
+ import{__decorate as e}from"tslib";import t from"../../../Graphic.js";import i from"../../../request.js";import{isSome as r}from"../../../core/arrayUtils.js";import{result as s,forEach as o}from"../../../core/asyncUtils.js";import"../../../core/has.js";import n from"../../../core/Logger.js";import{destroyMaybe as a,abortMaybe as d}from"../../../core/maybe.js";import{estimateNumberArrayMemory as l,baseObjectMemory as u,estimateNumberMemory as h,estimateFixedArrayMemory as p,baseArrayMemory as c}from"../../../core/memoryEstimations.js";import{isAbortError as _,allSettledValues as m,throwIfAborted as g}from"../../../core/promiseUtils.js";import{initial as f,watch as y,sync as b,syncAndInitial as w}from"../../../core/reactiveUtils.js";import{pt2px as P}from"../../../core/screenUtils.js";import{isArrayBuffer as N}from"../../../core/typedArrayUtil.js";import{property as v,subclass as x}from"../../../core/accessorSupport/decorators.js";import{b as C,i as S,g as I,d as A}from"../../../chunks/vec32.js";import{clone as j}from"../../../core/libs/gl-matrix-2/factories/vec3f32.js";import{fromValues as R}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import k from"../../../geometry/Extent.js";import V from"../../../geometry/Point.js";import{projectBoundingSphere as Q}from"../../../geometry/projection/projectBoundingSphere.js";import{projectVectorToVector as F}from"../../../geometry/projection/projectVectorToVector.js";import{create as E,fromMinMax as O}from"../../../geometry/support/aaBoundingBox.js";import{fromNormalAndOffset as D,create as L}from"../../../geometry/support/plane.js";import{Sphere as U}from"../../../geometry/support/sphere.js";import W from"../../../layers/graphics/OptimizedGeometry.js";import{QueryEngine as G}from"../../../layers/graphics/data/QueryEngine.js";import{CodedValue as M}from"../../../layers/support/CodedValue.js";import q from"../../../layers/support/CodedValueDomain.js";import"../../../layers/support/Domain.js";import"../../../layers/support/InheritedDomain.js";import"../../../layers/support/RangeDomain.js";import{unpackFieldNames as z}from"../../../layers/support/fieldUtils.js";import{queueAutoPriority as H}from"../../../request/queue.js";import T from"../../../rest/support/FeatureSet.js";import B from"../../../rest/support/Query.js";import{getElevationOffset as $}from"../../../support/elevationInfoUtils.js";import{LayerView3D as J}from"./LayerView3D.js";import{PointCloudLayerViewPerformanceInfo as K,QueuePerformanceInfo as Z}from"./PointCloudLayerViewPerformanceInfo.js";import{PointCloudWorkerHandle as Y}from"./PointCloudWorkerHandle.js";import{I3SQueryFeatureStore as X}from"./i3s/I3SQueryFeatureStore.js";import{checkPointCloudLayerValid as ee,checkPointCloudLayerCompatibleWithView as te}from"./i3s/I3SUtil.js";import{nodeDiff as ie,sortFrontToBack as re,splitWorkEntries as se}from"./i3s/LoDUtil.js";import{PagedNodeIndex as oe}from"./i3s/PagedNodeIndex.js";import{PointCloudGraphic as ne}from"./i3s/PointCloudGraphic.js";import{PointCloudRenderer as ae}from"./i3s/PointCloudRenderer.js";import{isPointRendererNode as de,PointCloudRendererNode as le}from"./i3s/PointCloudRendererNode.js";import{getSplatSizeAlgorithm as ue,getFixedSizeAlgorithm as he,getRendererInfo as pe,getFilterInfo as ce,rendererUsesFixedSizes as _e,getAttributeInfo as me}from"./i3s/PointCloudRendererUtil.js";import{getAttributeValues as ge,readGeometry as fe,elevationFromPositions as ye}from"./i3s/PointCloudWorkerUtil.js";import{normalizeHighlightTarget as be,emptyHighlightHandle as we}from"./support/highlightUtils.js";import{PopupSceneLayerView as Pe}from"./support/PopupSceneLayerView.js";import{projectToBoundingBox as Ne}from"../support/extentUtils.js";import{computeMapPointFromVec3d as ve}from"../support/hitTest.js";import{Obb as xe}from"../support/orientedBoundingBox.js";import{updatingProgress as Ce}from"../support/updatingProperties.js";import Se from"../../layers/LayerView.js";import{PointCloudLayerViewMixin as Ie}from"../../layers/PointCloudLayerView.js";import{getHighlightName as Ae}from"../../support/highlightOptionsUtils.js";import{isInEffectiveScaleRange as je}from"../../support/layerViewUtils.js";import{PromiseQueue as Re}from"../../support/PromiseQueue.js";import{TaskPriority as ke}from"../../support/Scheduler.js";const Ve=8,Qe=L();let Fe=class extends(Ie(Pe(J(Se)))){constructor(){super(...arguments),this.type="point-cloud-3d",this.maximumPointCount=4e6,this.slicePlaneEnabled=!1,this._renderer=null,this._rendererAdded=!1,this._renderedNodes=new Set,this._updateViewNeeded=!0,this._lodFactor=1,this._maxLoggedBoxWarnings=5,this._pageMultiplier=1,this._nodeLoadEpoch=0,this._indexQueue=[],this._workQueue=new Array,this._idleQueue=new Re,this._loadingPages=new Map,this._loadingNodes=new Map,this._recalcWork=!0,this._layerIsVisible=!1,this._codedDomainPopulationPromise=null,this._codedDomainPopulationAbortController=null,this._totalWork=0,this._index=null,this._loadingInitNodePage=!1,this._nodeIdArray=[],this.ignoresMemoryFactor=!1}get baseUrl(){return this.layer.parsedUrl?.path??""}get pointScale(){const e=ue(this.layer?.renderer),t=1;return null!=e?.scaleFactor?e.scaleFactor:t}get useRealWorldSymbolSizes(){const e=he(this.layer?.renderer),t=!1;return null!=e?.useRealWorldSymbolSizes?e.useRealWorldSymbolSizes:t}get pointSize(){const e=he(this.layer?.renderer),t=0;return null!=e?.size?e.size:t}get inverseDensity(){const e=96;return this.layer?.renderer?1*e/this.layer.renderer.pointsPerInch:5}get availableFields(){const e=pe(this.layer),t=new Set;e.primaryAttribute&&t.add(e.primaryAttribute.name),e.modulationAttribute&&t.add(e.modulationAttribute.name);const i=ce(this.layer);if(i)for(const r of i)r.attributeInfo&&t.add(r.attributeInfo.name);if(this.layer.outFields)for(const r of z(this.layer.fieldsIndex,this.layer.outFields))t.add(r);return Array.from(t)}get _clippingBox(){if(!this.view||!this.view.clippingArea)return null;const e=E(),t=this.view.renderSpatialReference;return Ne(this.view.clippingArea,e,t)?e:null}get _elevationOffset(){const e=this.layer&&this.layer.elevationInfo;return"absolute-height"===e?.mode?$(e,this.layer.spatialReference):0}get _graphicOrigin(){return this.layer.graphicOrigin}initialize(){const e=this.view.resourceController,t=Ue(e);this._worker=new Y(t),this.addResolvingPromise(this._worker.promise),this.addResolvingPromise(this.layer.rootPagePromise),ee(this.layer),te(this.layer,this.view),this._initRenderer();const i=this._initNodePages(),r=this.view.resourceController.memoryController;this._memCache=r.newCache(`pcl-${this.layer.uid}`),this._queryFeaturesCache=r.newCache(`pcl-query-features-${this.layer.uid};`),this._updatingHandles.add(()=>this._clippingBox,()=>this._setUpdateViewNeeded(),f),this._updatingHandles.add(()=>this._elevationOffset,()=>this._elevationOffsetChanged(),f),this._updatingHandles.add(()=>this.layer.renderer,()=>this._rendererChanged(),f),this._updatingHandles.add(()=>this.layer.filters,()=>this._reload(),f),this._updatingHandles.add(()=>this.layer.outFields,()=>this._reload(),f),this._updatingHandles.add(()=>this.layer.effectiveScaleRange,()=>this._setUpdateViewNeeded()),this._updatingHandles.add(()=>this.view.state.contentCamera,()=>this._setUpdateViewNeeded()),this.addHandles([y(()=>this.view.quality,()=>this._setUpdateViewNeeded(),b)]),this.addResolvingPromise(i),this.when(()=>{this.addHandles([e.scheduler.registerTask(ke.POINT_CLOUD_LAYER,this),y(()=>2===this.view.state.mode,()=>this._setUpdateViewNeeded(),w),this._updatingHandles.add(()=>this.suspended,e=>{e?this._clearNodeState():this._setUpdateViewNeeded()},f)])},()=>{this._updatingHandles.removeAll(),this.removeAllHandles()})}_setUpdateViewNeeded(){this._updateViewNeeded=!0,this._updateLoading()}destroy(){this.cancelLoading(),this._worker=a(this._worker),this._destroyRenderer(),this._memCache=a(this._memCache),this._queryFeaturesCache=a(this._queryFeaturesCache),this._queryEngine=a(this._queryEngine),this._codedDomainPopulationAbortController=d(this._codedDomainPopulationAbortController),this._codedDomainPopulationPromise=null}_initRenderer(){this._renderer=new ae({createGraphic:(e,t,i)=>this._createGraphic(e,t,i)}),this._renderer.layerViewUid=this.uid,this._updatingHandles.add(()=>this._clippingBox,e=>this._renderer.clippingBox=e,f),this._updatingHandles.add(()=>this.suspended,e=>this._setPointsVisible(!e),f),this._updatingHandles.add(()=>this.pointScale,e=>this._renderer.scaleFactor=e,f),this._renderer.minSizePx=Math.sqrt(2),this._updatingHandles.add(()=>this.useRealWorldSymbolSizes,e=>this._renderer.useRealWorldSymbolSizes=e,f),this._updatingHandles.add(()=>this.pointSize,e=>{const t=P(e);this._renderer.size=e,this._renderer.sizePx=t},f),this._updatingHandles.add(()=>this.slicePlaneEnabled,e=>this._renderer.slicePlaneEnabled=e,f),this._updatingHandles.add(()=>this.inverseDensity,()=>this._setUpdateViewNeeded(),f),this._updatingHandles.add(()=>this.maximumPointCount,()=>this._setUpdateViewNeeded(),f),this._updatingHandles.add(()=>this.view.qualitySettings.sceneService.pointCloudLoDFactor,e=>{this._lodFactor=e,this._setUpdateViewNeeded()},f)}_destroyRenderer(){this._renderer.removeAll(),this._setPointsVisible(!1)}_createGraphic(e,t,i,r){const s=null!=e.pointIdFilterMap?e.pointIdFilterMap[t]:t,o=i?"declaredClass"in i?i:ve(this.view,i):null;return r??=this._createGraphicAttributes(e,s),new ne({pointCloudMetadata:{nodeId:e.id,pointIndexInNode:t,attributePointIndexInNode:s,epoch:this._nodeLoadEpoch},geometry:o,attributes:r,layer:this.layer,sourceLayer:this.layer,origin:this._graphicOrigin})}_createGraphicAttributes(e,t){const i={};for(const r of e.attributes)this._encodeGraphicAttribute(r.attributeInfo,r.values,t,i);return i}_getGraphicAttribute(e,t,i){const r=e.storageInfo?.attributeValues,s=r?.valuesPerElement??1;if(1===s)return t[i];if("UInt8"===r?.valueType&&s<=4){let e=0;const r=i*s;for(let i=r;i<r+s;i++)e=(e<<8)+t[i];return e}}_encodeGraphicAttribute(e,t,i,r){r[e.name]=this._getGraphicAttribute(e,t,i)}_setPointsVisible(e){e&&!this._rendererAdded?(this.view.stage.addRenderPlugin(this._renderer),this._rendererAdded=!0):!e&&this._rendererAdded&&(this.view.stage.removeRenderPlugin(this._renderer),this._rendererAdded=!1)}_rendererChanged(){this._renderer.useFixedSizes=_e(this.layer.renderer),this._reload()}_reload(){this._clearNodeState(),this._memCache.clear(),this._setUpdateViewNeeded()}_elevationOffsetChanged(){this._clearNodeState(),this._memCache.clear(),this._initNodePages()}_displayNodes(e){this._workQueue=ie([...this._renderedNodes],e,this._index),re(this._workQueue,this.view.state.contentCamera.viewForward,this._index),se(this._workQueue,Ve,this._index),this._updateQueues(),this._totalWork=this._computeWork(),this._updateLoading(),this._layerIsVisible=e.length>0||this._loadingInitNodePage,this.notifyChange("suspended")}cancelLoading(){this._cancelNodeLoading(),this._cancelIndexLoading()}_cancelNodeLoading(){[...this._loadingNodes.values()].forEach(e=>e.abort()),this._workQueue=[],this._idleQueue.cancelAll(),this._totalWork=this._computeWork(),this._updateLoading()}_updateQueues(){const e=new Set;this._workQueue.forEach(t=>t.load.forEach(t=>e.add(t)));const t=new Array;this._loadingNodes.forEach((i,r)=>{e.has(r)||(this._loadingNodes.delete(r),t.push(i))}),t.forEach(e=>e.abort()),this._workQueue=this._workQueue.filter(e=>{for(const t of e.load)if(this._loadingNodes.has(t))return this._recalcWork=!0,!1;return!0}),this._totalWork=this._computeWork(),this._updateLoading()}_cancelIndexLoading(){this._indexQueue=[],this._loadingPages.forEach(e=>e.abort()),this._loadingPages.clear(),this._totalWork=this._computeWork(),this._updateLoading()}_clearNodeState(){this._nodeLoadEpoch++,this._renderedNodes.forEach(e=>this._removeFromRenderer(e)),this._cancelNodeLoading()}get readyToRun(){return this.suspended?this._updateViewNeeded:this._updateViewNeeded||this._indexQueue.length>0||this._workQueue.length>0||this._idleQueue.readyToRun}runTask(e){if(this.suspended){if(this._updateViewNeeded){this._updateViewNeeded=!1;const e=this._isRootNodeVisible();e!==this._layerIsVisible&&(this._layerIsVisible=e,this.notifyChange("suspended")),this._updateLoading()}}else{for(e.run(()=>this._updateWorkQueues());this._indexQueue.length>0&&!e.done;)this._processIndexQueue(),e.madeProgress();this._processWorkQueue(e),this._idleQueue.runTask(e)}}async _processIndexQueue(){const e=this._indexQueue.shift(),t=new AbortController;this._loadingPages.set(e,t);try{const i=await this._loadNodePage(e,t.signal);this._index.addPage(e,i,this._elevationOffset),this._setUpdateViewNeeded(),this._loadingPages.delete(e)}catch(i){this._loadingPages.get(e)===t&&this._loadingPages.delete(e)}}_processWorkQueue(e){for(;!e.done;){const t=this._scheduleWorkEntry();if(null==t)return void e.madeProgress();this._processWorkEntry(t),e.madeProgress()}}_scheduleWorkEntry(){let e=this._workQueue.length;for(;e--;){const e=this._workQueue.shift();if(!e.remove.find(e=>!this._renderedNodes.has(e)))return e;this._workQueue.push(e)}return null}async _processWorkEntry(e){if(0===e.load.length){for(const t of e.remove)this._removeFromRenderer(t);return}const t=e.load.map(e=>{const t=new AbortController;return this._loadingNodes.set(e,t),t});this._updateLoading();try{const i=await Promise.all(e.load.map((e,i)=>this._memCache.pop(`${e}`)??this._loadNode(e,t[i].signal)));for(let t=0;t<e.load.length;t++)if(i[t]){const r=this._setupRendererData(e.load[t],i[t]);this._addToRenderer(r)}for(const t of e.remove)this._removeFromRenderer(t);for(const t of e.load)this._loadingNodes.delete(t)}catch(i){e.load.forEach((e,i)=>{this._loadingNodes.get(e)===t[i]&&this._loadingNodes.delete(e)})}this._updateLoading(),this._recalcWork&&!this._idleQueue.updating&&0===this._indexQueue.length&&0===this._loadingNodes.size&&(this._recalcWork=!1,this._setUpdateViewNeeded())}async _populateClassCodeCodedDomain(e,t){const i="CLASS_CODE",r=this.layer.fieldsIndex.get(i);if(!r||r.domain)return;if(!e.includes(r.name))return;const o=await s(this.layer.queryCachedStatistics(i,{signal:t}));if(!1===o.ok)return;const n=o.value?.stats?.labels?.labels;n&&Array.isArray(n)&&(r.domain=new q({name:"CLASS_CODE",codedValues:n.map(e=>new M({code:e.value,name:e.label}))}))}async prepareFetchPopupFeatures(e){return this._codedDomainPopulationPromise||(this._codedDomainPopulationAbortController=new AbortController,this._codedDomainPopulationPromise=this._populateClassCodeCodedDomain(e,this._codedDomainPopulationAbortController.signal).then(()=>{this._codedDomainPopulationAbortController=null})),this._codedDomainPopulationPromise}async whenGraphicAttributes(e,t){const i=this._splitGraphicsPerNode(e),s=this.layer.attributeStorageInfo,n=t.map(e=>me(s,e)).filter(r),a=async(e,t)=>{const i=this._index.getNode(t);await o(n,async t=>{const r=t.useElevation?await this._loadElevationAttributeFromGeometry(i.resourceId):await this._loadAndParseAttribute(i,t);if(r)for(const i of e)if(this._isValidPointGraphic(i)){const e=i.pointCloudMetadata.attributePointIndexInNode;this._encodeGraphicAttribute(t,r,e,i.attributes)}})},d=[];return i.forEach((e,t)=>{d.push(a(e,t))}),await Promise.allSettled(d),e}_isValidPointGraphic(e){return e instanceof ne&&e.pointCloudMetadata?.epoch===this._nodeLoadEpoch}_splitGraphicsPerNode(e){const t=new Map;for(const i of e){if(!this._isValidPointGraphic(i))continue;const e=i.pointCloudMetadata,r=t.get(e.nodeId);r?r.push(i):t.set(e.nodeId,[i])}return t}async _loadAndParseAttribute(e,t){const i=await this._loadAttribute(e.resourceId,t,null);return i?ge({attributeInfo:t,buffer:i},null,e.vertexCount):null}async _loadElevationAttributeFromGeometry(e){const t=this.layer.store.defaultGeometrySchema,i=fe(t,await this._loadGeometry(e,null));return ye(i,i.length/3)}highlight(e,i){const r=be(e);if(0===r.length)return we;if(!(r[0]instanceof t))return we;const s=r;return this._renderer.highlight(s.map(e=>this._graphicToPointDefinition(e)),Ae(i))}_graphicToPointDefinition(e){if(!this._isValidPointGraphic(e))return null;const{nodeId:t,pointIndexInNode:i}=e.pointCloudMetadata;return null!=t&&null!=i?{nodeId:t,pointId:i}:null}_computeWork(){let e=0;for(const t of this._workQueue)e+=t.load.length+t.remove.length;return e+=this._loadingNodes.size,e+=(this._indexQueue.length+this._loadingPages.size)*this._index.pageSize,e+=this._loadingInitNodePage?100:0,e+=this._updateViewNeeded?100:0,e}get updatingProgressValue(){if(this.suspended)return this._updateViewNeeded?0:1;const e=this._computeWork();return 1-Math.min(this._totalWork,e)/this._totalWork}_updateLoading(){this.notifyChange("updating"),this.notifyChange("updatingProgressValue")}canResume(){return super.canResume()&&this._layerIsVisible}isUpdating(){return this.suspended?this._updateViewNeeded:this._computeWork()>0}get visibleAtCurrentScale(){return je(this.layer.effectiveScaleRange,this.view.scale)}async queryFeatures(e,i){const r=await this._ensureQueryEngine().executeQuery(this._ensureQueryJSON(e),i?.signal),s=r.features;r.features=[];const o=T.fromJSON(r),n=this.view.spatialReference;return o.features=s.map(e=>{const{attributes:i,metadata:r}=e;if(!r){const i=t.fromJSON(e);return i.geometry&&(i.geometry.spatialReference=o.spatialReference??n),i.layer=this.layer,i.sourceLayer=this.layer,i.origin=this._graphicOrigin,i}const s=e.geometry?V.fromJSON(e.geometry):void 0;return s&&(s.spatialReference=o.spatialReference??n),this._createGraphic(r.node,r.pointId,s,i)}),o}createQuery(){const e={outFields:["*"],returnGeometry:!0,outSpatialReference:this.view.spatialReference,returnZ:!0};return new B(e)}async queryFeatureCount(e,t){return await this._ensureQueryEngine().executeQueryForCount(this._ensureQueryJSON(e),t?.signal)}async queryExtent(e,t){const{count:i,extent:r}=await this._ensureQueryEngine().executeQueryForExtent(this._ensureQueryJSON(e),t?.signal);return{count:i,extent:k.fromJSON(r)}}_ensureQueryJSON(e){return null==e?new B({outSpatialReference:this.view.spatialReference}).toJSON():B.from(e).toJSON()}_ensureQueryEngine(){if(this._queryEngine)return this._queryEngine;const{spatialReference:e}=this.view;return this._queryEngine=new G({fieldsIndex:this.layer.fieldsIndex.toJSON(),geometryType:"esriGeometryPoint",spatialReference:e,featureIdInfo:{type:"object-id",fieldName:"objectId"},hasZ:!0,featureStore:new X({sourceSpatialReference:e,viewSpatialReference:e,forAllFeatures:(e,t)=>{this._renderer.forEachNode(i=>{if(t){const e=i.obb,r=new U(e.center,C(e.halfSize));Q(r,this.view.renderSpatialReference,r,this.view.spatialReference);if(1===t(r))return}let r=this._queryFeaturesCache.get(`${i.id}`);r||(r=this._createQueryPointFeatures(i),this._queryFeaturesCache.put(`${i.id}`,r)),r.features.forEach(e)})},getFeatureExtent:({point:e},t)=>O(e,e,t),featureAdapter:{cloneWithGeometry:(e,t,i)=>new Oe(e.node,e.pointId,t.coords),getAttribute:({node:e,attributePointId:t},i)=>{for(const r of e.attributes)if(r.attributeInfo.name===i)return this._getGraphicAttribute(r.attributeInfo,r.values,t)},getAttributes:({node:e,attributePointId:t})=>this._createGraphicAttributes(e,t),getCentroid:e=>e.getGeometry(),getGeometry:e=>e.getGeometry(),getObjectId:()=>{},getMetadata:e=>e}})}),this._queryEngine}_createQueryPointFeatures(e){const t=e.coordinates,i=new Array;for(let r=0;r<t.length/3;r++){const s=3*r,o=R(t[s+0],t[s+1],t[s+2]);S(o,o,e.origin),F(o,this.view.renderSpatialReference,o,this.view.spatialReference);const n=new Oe(e,r,o);i.push(n)}return new De(i)}async _initNodePages(){const e=this.layer.store.index,t=e.nodesPerPage||e.nodePerIndexBlock;this._index=new oe(this.layer.spatialReference,this.view.renderCoordsHelper.spatialReference,t),this._cancelIndexLoading(),this._traverseVisible=this._index.createVisibilityTraverse(),this._loadingInitNodePage=!0,this._layerIsVisible=!0,this.notifyChange("suspended"),this._updateLoading(),this._pageMultiplier=null!=e.nodesPerPage?1:e.nodePerIndexBlock;const i=await this.layer.rootPagePromise;this._loadingInitNodePage=!1,i?(this._index.addPage(0,this._processJSONNodes(i,0),this._elevationOffset),this._setUpdateViewNeeded()):n.getLogger(this).error("Point cloud layer root page not loaded")}_loadNodePage(e,t){const i=`${this.baseUrl}/nodepages/${e*this._pageMultiplier}`;return this._requestNodePage(i,t).then(t=>this._processJSONNodes(t,e))}_processJSONNodes(e,t){const i=t*this._index.pageSize;return e.nodes.map((e,t)=>({resourceId:e.resourceId??i+t,obb:xe.fromJSON(e.obb),obbInRenderSR:new xe,firstChild:e.firstChild,childCount:e.childCount,vertexCount:e.vertexCount??e.pointCount,lodThreshold:e.lodThreshold??e.effectiveArea}))}_updateWorkQueues(){if(!this._updateViewNeeded)return!1;const e=this.view.quality;let t=this.inverseDensity/this._lodFactor*e;const i=this.maximumPointCount*this._lodFactor*e;let r=this._computeNodesForMinimumDensity(t),s=this._computePointCount(r),o=Math.sqrt(s/(.75*i));for(;s>i;)t*=o,r=this._computeNodesForMinimumDensity(t),s=this._computePointCount(r),o=Math.sqrt(2);return this._displayNodes(r),this._updateViewNeeded=!1,this._updateLoading(),!0}_computePointCount(e){let t=0;for(let i=0;i<e.length;i++){const r=this._index.getNode(e[i]);r&&(t+=r.vertexCount)}return t}_isRootNodeVisible(){let e=!1;return this._traverseVisible({frustum:this.view.state.contentCamera.frustum,clippingBox:this._clippingBox},{predicate:(t,i,r)=>(e=r,!1),pageMiss:()=>{}}),e}_computeNodesForMinimumDensity(e){const t=this.view.state.contentCamera,i=t.frustum,r=this._clippingBox,s=t.viewForward,o=I(s,t.eye),n=D(s,-o,Qe),a=t.perScreenPixelRatio/2,d=e*e,l=this._nodeIdArray;l.length=0;const u=e=>l.push(e);return this._traverseVisible({frustum:i,clippingBox:r},{predicate:(e,t,i)=>{if(!i)return!1;if(0===t.childCount)return u(e),!1;const r=this._index.getRenderObb(e);return!(this._computeAveragePixelArea(r,t.lodThreshold,t.vertexCount,n,a)<=d)||(u(e),!1)},pageMiss:(e,t)=>{u(e),this._indexQueue.includes(t)||this._indexQueue.push(t)}}),l}_computeAveragePixelArea(e,t,i,r,s){const o=1e-7,n=Math.max(o,e.minimumDistancePlane(r));return t/(n*n)/(4*s*s)/i}_loadNode(e,t){try{return this._loadNodeAsync(e,t)}catch(i){throw _(i)||n.getLogger(this).error(i),i}}async _loadAdditionalUserAttributes(e,t,i){const s=this.layer.outFields;if(!s)return[];const o=z(this.layer.fieldsIndex,s),n=new Set(e.map(e=>null!=e?e.name:null)),a=this.layer.attributeStorageInfo,d=[];for(const r of o){if(n.has(r))continue;const e=me(a,r);e&&d.push(t(e))}const l=await m(d);return g(i),l.filter(r)}async _loadNodeAsync(e,t){const i=this._index.getNode(e),r=pe(this.layer),s=ce(this.layer),o=i.resourceId,n=async e=>{if(!e)return null;if(e.useElevation)return{attributeInfo:e,buffer:null};const i=await this._loadAttribute(o,e,t);return null!=i?{attributeInfo:e,buffer:i}:null};return this._idleQueue.push(async()=>{const i=this._loadGeometry(o,t),{primaryAttribute:a,modulationAttribute:d}=r,l=n(a),u=n(d),h=s.map(e=>e.attributeInfo),p=h.map(e=>n(e)),c=this._loadAdditionalUserAttributes([a,d,...h],n,t),[_,m,f,y,b]=await Promise.all([i,l,u,Promise.all(p),c]);g(t);const w={geometryBuffer:_,primaryAttributeData:m,modulationAttributeData:f,filterAttributesData:y,userAttributesData:b,schema:this.layer.store.defaultGeometrySchema,rendererInfo:r,filterInfo:s,obbData:this._index.getRenderObb(e).data,elevationOffset:this._elevationOffset,inSR:this.layer.spatialReference.toJSON(),outSR:this.view.renderCoordsHelper.spatialReference.toJSON()};return this._worker.invoke(w,t)},t)}async _loadGeometry(e,t){return this._requestData(`${this.baseUrl}/nodes/${e}/geometries/0`,t)}async _loadAttribute(e,t,i){if(!t?.storageInfo)return null;const r=t.storageInfo.key;return this._requestData(`${this.baseUrl}/nodes/${e}/attributes/${r}`,i)}async _requestNodePage(e,t){const r={f:"json",...this.layer.customParameters,token:this.layer.apiKey},s={...H,query:r,responseType:"json",signal:t};return(await i(e,s)).data}async _requestData(e,t){const r={...this.layer.customParameters,token:this.layer.apiKey},s={...H,query:r,responseType:"array-buffer",signal:t};return(await i(e,s)).data}_removeFromRenderer(e){if(this._renderedNodes.has(e)){const t=this._renderer.removeNode(e);this._renderedNodes.delete(e),this._memCache.put(`${t.id}`,t)}}_addToRenderer(e){this._renderedNodes.has(e.id)||(this._renderedNodes.add(e.id),this._renderer.addNode(e))}_setupRendererData(e,t){const i=this._index.getNode(e),r=Math.sqrt(i.lodThreshold/i.vertexCount),s=this._index.getRenderObb(e);if(de(t))return t.splatSize=r,t.obb=s,A(t.origin,t.obb.center),t;const o=xe.fromData(t.obbData),a=o.halfSize,d=s.halfSize,l=.01*Math.max(d[0],d[1],d[2]);if(a[0]>d[0]+l||a[1]>d[1]+l||a[2]>d[2]+l){if(this._maxLoggedBoxWarnings>0){const t=e=>`[${e.halfSize[0]}, ${e.halfSize[1]}, ${e.halfSize[2]}]`;n.getLogger(this).warn(`Node ${e} reported bounding box too small. got ${t(s)} but points cover ${t(o)}`),0===--this._maxLoggedBoxWarnings&&n.getLogger(this).warn(" Too many bounding box errors, stopping reporting for this layer.")}this._index.setRenderObb(e,o)}return new le(e,r,j(s.center),s,0===i.childCount,t.points,t.rgb,t.attributes,t.pointIdFilterMap)}get usedMemory(){let e=0;return this._renderer.forEachNode(t=>{e+=Le,e+=l(t.coordinates);for(const i of t.attributes){const t=i.values;N(t.buffer)&&(e+=l(t))}}),e}get unloadedMemory(){const e=this._renderedNodes.size;if(e<4)return 0;const t=[...this._renderedNodes].reduce((e,t)=>e+this._index.getNode(t).vertexCount);let i=this._loadingNodes.size;for(let r=0;r<this._workQueue.length;r++)i+=this._workQueue[r].load.length,i-=this._workQueue[r].remove.length;if(i<0)return 0;return i*t/e*((this.usedMemory-e*Le)/t)+i*Le}get performanceInfo(){return new K(this.usedMemory,this._renderedNodes.size,[...this._renderedNodes].reduce((e,t)=>e+this._index.getNode(t).vertexCount,0),this.maximumPointCount,new Z(this._loadingNodes.size,this._indexQueue.length,this._workQueue.length,this._idleQueue.length))}get test(){}};e([v()],Fe.prototype,"layer",void 0),e([v()],Fe.prototype,"baseUrl",null),e([v()],Fe.prototype,"pointScale",null),e([v()],Fe.prototype,"useRealWorldSymbolSizes",null),e([v()],Fe.prototype,"pointSize",null),e([v()],Fe.prototype,"inverseDensity",null),e([v()],Fe.prototype,"maximumPointCount",void 0),e([v({readOnly:!0})],Fe.prototype,"availableFields",null),e([v({readOnly:!0})],Fe.prototype,"_clippingBox",null),e([v({readOnly:!0})],Fe.prototype,"_elevationOffset",null),e([v({type:Boolean})],Fe.prototype,"slicePlaneEnabled",void 0),e([v()],Fe.prototype,"_graphicOrigin",null),e([v()],Fe.prototype,"updating",void 0),e([v(Ce)],Fe.prototype,"updatingProgress",void 0),e([v({readOnly:!0})],Fe.prototype,"updatingProgressValue",null),e([v({readOnly:!0})],Fe.prototype,"visibleAtCurrentScale",null),Fe=e([x("esri.views.3d.layers.PointCloudLayerView3D")],Fe);const Ee=Fe;class Oe{constructor(e,t,i){this.node=e,this.pointId=t,this.point=i}getGeometry(){return new W([],Array.from(this.point),!0,!1)}get attributePointId(){const{node:e,pointId:t}=this;return null!=e.pointIdFilterMap?e.pointIdFilterMap[t]:t}get usedMemory(){return u+u+h+p(this.point,h)}}class De{constructor(e){this.features=e}get usedMemory(){return this.features.reduce((e,t)=>e+t.usedMemory,u+c)}}const Le=160;function Ue(e){return t=>e.immediate.schedule(t)}export{Ee 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/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as t}from"tslib";import e from"../../../../core/Accessor.js";import{EventEmitter as r}from"../../../../core/Evented.js";import{property as o,subclass as i}from"../../../../core/accessorSupport/decorators.js";import{projectPoint as s}from"../../../../geometry/projectionUtils.js";import{create as a}from"../../../../geometry/support/aaBoundingBox.js";import{getObjectId as n}from"../../../../layers/graphics/dehydratedFeatures.js";import{OptimizedFeature as p}from"../../../../layers/graphics/OptimizedFeature.js";import c from"../../../../layers/graphics/OptimizedGeometry.js";import{optimizedFeatureQueryEngineAdapter as h}from"../../../../layers/graphics/data/optimizedFeatureQueryEngineAdapter.js";const u=a();let d=class extends e{constructor(t){super(t),this.events=new r,this.hasZ=null,this.hasM=null,this.objectIdField=null,this.featureAdapter={getAttribute:(t,e)=>"graphic"in t?t.graphic.attributes[e]:h.getAttribute(t,e),getAttributeAsTimestamp(t,e){const r=this.getAttribute(t,e);return"number"==typeof r?r:new Date(r).getTime()},getAttributes:t=>"graphic"in t?t.graphic.attributes:h.getAttributes(t),getObjectId:t=>"graphic"in t?n(t.graphic,this.objectIdField)??void 0:h.getObjectId(t),getGeometry:t=>"graphic"in t?t.getAsOptimizedGeometry(this.hasZ,this.hasM):h.getGeometry(t),getCentroid:(t,e)=>{if("graphic"in t){let r=null;null!=t.centroid?r=t.centroid:"point"===t.graphic.geometry.type&&s(t.graphic.geometry,l,this.viewSpatialReference)&&(r=l);const o=new Array(2+(e.hasZ?1:0)+(e.hasM?1:0));return null==r?(o[0]=0,o[1]=0,o[2]=0,o[3]=0):(o[0]=r.x,o[1]=r.y,e.hasZ&&(o[2]=r.hasZ?r.z:0),e.hasM&&(o[e.hasZ?3:2]=r.hasM?r.m:0)),new c([],o,e.hasZ,e.hasM)}return h.getCentroid(t,e)},cloneWithGeometry:(t,e)=>"graphic"in t?new p(e,this.featureAdapter.getAttributes(t),null,this.featureAdapter.getObjectId(t)):h.cloneWithGeometry(t,e)}}forEachInBounds(t,e){this.getSpatialIndex().forEachInBounds(t,e)}forEachBounds(t,e){const r=this.getSpatialIndex();for(const o of t){const t=this.featureAdapter.getObjectId(o);null!=r.getBounds(t,u)&&e(u)}}};t([o({constructOnly:!0})],d.prototype,"getSpatialIndex",void 0),t([o({constructOnly:!0})],d.prototype,"forEach",void 0),t([o({constructOnly:!0})],d.prototype,"hasZ",void 0),t([o({constructOnly:!0})],d.prototype,"hasM",void 0),t([o({constructOnly:!0})],d.prototype,"objectIdField",void 0),t([o({constructOnly:!0})],d.prototype,"viewSpatialReference",void 0),t([o({constructOnly:!0})],d.prototype,"featureSpatialReference",void 0),d=t([i("esri.views.3d.layers.graphics.Graphics3DFeatureStore")],d);const l={type:"point",x:0,y:0,hasZ:!1,hasM:!1,spatialReference:null};export{d as Graphics3DFeatureStore};
5
+ import{__decorate as t}from"tslib";import e from"../../../../core/Accessor.js";import{EventEmitter as r}from"../../../../core/Evented.js";import{property as o,subclass as i}from"../../../../core/accessorSupport/decorators.js";import{projectPoint as s}from"../../../../geometry/projectionUtils.js";import{create as a}from"../../../../geometry/support/aaBoundingBox.js";import{getObjectId as n}from"../../../../layers/graphics/dehydratedFeatures.js";import{OptimizedFeature as p}from"../../../../layers/graphics/OptimizedFeature.js";import c from"../../../../layers/graphics/OptimizedGeometry.js";import{optimizedFeatureQueryEngineAdapter as h}from"../../../../layers/graphics/data/optimizedFeatureQueryEngineAdapter.js";const u=a();let d=class extends e{constructor(t){super(t),this.events=new r,this.hasZ=null,this.hasM=null,this.objectIdField=null,this.featureAdapter={getAttribute:(t,e)=>"graphic"in t?t.graphic.attributes[e]:h.getAttribute(t,e),getAttributeAsTimestamp(t,e){const r=this.getAttribute(t,e);return"number"==typeof r?r:new Date(r).getTime()},getAttributes:t=>"graphic"in t?t.graphic.attributes:h.getAttributes(t),getObjectId:t=>"graphic"in t?n(t.graphic,this.objectIdField)??void 0:h.getObjectId(t),getGeometry:t=>"graphic"in t?t.getAsOptimizedGeometry(this.hasZ,this.hasM):h.getGeometry(t),getCentroid:(t,e)=>{if("graphic"in t){let r=null;null!=t.centroid?r=t.centroid:"point"===t.graphic.geometry.type&&s(t.graphic.geometry,l,this.viewSpatialReference)&&(r=l);const o=new Array(2+(e.hasZ?1:0)+(e.hasM?1:0));return null==r?(o[0]=0,o[1]=0,o[2]=0,o[3]=0):(o[0]=r.x,o[1]=r.y,e.hasZ&&(o[2]=r.hasZ?r.z:0),e.hasM&&(o[e.hasZ?3:2]=r.hasM?r.m:0)),new c([],o,e.hasZ,e.hasM)}return h.getCentroid(t,e)},cloneWithGeometry:(t,e,r)=>"graphic"in t?new p(e,this.featureAdapter.getAttributes(t),null,this.featureAdapter.getObjectId(t)):h.cloneWithGeometry(t,e,r)}}forEachInBounds(t,e){this.getSpatialIndex().forEachInBounds(t,e)}forEachBounds(t,e){const r=this.getSpatialIndex();for(const o of t){const t=this.featureAdapter.getObjectId(o);null!=r.getBounds(t,u)&&e(u)}}};t([o({constructOnly:!0})],d.prototype,"getSpatialIndex",void 0),t([o({constructOnly:!0})],d.prototype,"forEach",void 0),t([o({constructOnly:!0})],d.prototype,"hasZ",void 0),t([o({constructOnly:!0})],d.prototype,"hasM",void 0),t([o({constructOnly:!0})],d.prototype,"objectIdField",void 0),t([o({constructOnly:!0})],d.prototype,"viewSpatialReference",void 0),t([o({constructOnly:!0})],d.prototype,"featureSpatialReference",void 0),d=t([i("esri.views.3d.layers.graphics.Graphics3DFeatureStore")],d);const l={type:"point",x:0,y:0,hasZ:!1,hasM:!1,spatialReference:null};export{d as Graphics3DFeatureStore};
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{EventEmitter as t}from"../../../../../../core/Evented.js";import{baseObjectMemory as e,estimateNumberMemory as i}from"../../../../../../core/memoryEstimations.js";import{PooledRBush as r,BBox as s}from"../../../../../../core/libs/rbush/PooledRBush.js";import{getCentroidOptimizedGeometry as n}from"../../../../../../layers/graphics/centroid.js";class o{constructor(t,e){this._index=t,this._view=e}get usedMemory(){return e+i}getObjectId(){return this._view.getObjectId(this._index)}getAttribute(t){return this._view.getAttribute(this._index,t)}getAttributeAsTimestamp(t){return this._view.getAttributeAsTimestamp(this._index,t)}getAttributes(){return this._view.getAttributes(this._index)}getOptimizedGeometry(){return this._view.getOptimizedGeometry(this._index)}getCentroid(t){return this._view.getCentroid(this._index,t)}getBounds(){return this._view.getBounds(this._index)}getBoundingBox(){return this._view.getBoundingBox(this._index)}cloneWithGeometry(t){return new u(this._index,this._view,t)}}class u extends o{constructor(t,e,i){super(t,e),this._geometryOverride=i}getOptimizedGeometry(){return this._geometryOverride}getCentroid(t){return n(this._geometryOverride)}}class d{constructor(t,e){this.featureData=t,this.bounds=e}}class a{constructor(){this._tileBounds=new Map,this.events=new t,this.featureAdapter=h.shared}get usedMemory(){return e+e*this._tileBounds.size}addTile(t){const{featureCount:e}=t;if(0===e)return;const i=new r(9,e=>t.getBounds(e)),s=new Array;for(let r=0;r<e;++r)s[r]=r;i.load(s),this._tileBounds.set(t.id,new d(t,i)),this.events.emit("changed")}removeTile(t){this._tileBounds.delete(t),this.events.emit("changed")}clear(){this._tileBounds.clear(),this.events.emit("changed")}forEach(t){for(const{featureData:e,bounds:i}of this._tileBounds.values())i.all(i=>{e.getEnabled(i)&&t(new o(i,e))})}forEachInBounds(t,e){m.minX=t[0],m.minY=t[1],m.maxX=t[2],m.maxY=t[3];for(const{featureData:i,bounds:r}of this._tileBounds.values())r.search(m,t=>{i.getEnabled(t)&&e(new o(t,i))})}forEachBounds(t,e){for(const i of t)e(i.getBoundingBox())}getFullExtent(t){let e=1/0,i=1/0,r=-1/0,s=-1/0;for(const{bounds:n}of this._tileBounds.values()){const{minX:t,minY:o,maxX:u,maxY:d}=n.toJSON();e=Math.min(e,t),i=Math.min(i,o),r=Math.min(r,u),s=Math.min(s,d)}return{xmin:e,ymin:i,xmax:r,ymax:s,spatialReference:t}}}class h{static{this.shared=new h}getObjectId(t){return t.getObjectId()}getAttribute(t,e){return t.getAttribute(e)}getAttributeAsTimestamp(t,e){return t.getAttributeAsTimestamp(e)}getAttributes(t){return t.getAttributes()}getGeometry(t){return t.getOptimizedGeometry()}getCentroid(t,e){return t.getCentroid(e)}cloneWithGeometry(t,e){return t.cloneWithGeometry(e)}}const m=new s;export{o as FeatureHandle,a as TiledFeatureStore};
5
+ import{EventEmitter as t}from"../../../../../../core/Evented.js";import{baseObjectMemory as e,estimateNumberMemory as i}from"../../../../../../core/memoryEstimations.js";import{PooledRBush as r,BBox as s}from"../../../../../../core/libs/rbush/PooledRBush.js";import{getCentroidOptimizedGeometry as n}from"../../../../../../layers/graphics/centroid.js";class o{constructor(t,e){this._index=t,this._view=e}get usedMemory(){return e+i}getObjectId(){return this._view.getObjectId(this._index)}getAttribute(t){return this._view.getAttribute(this._index,t)}getAttributeAsTimestamp(t){return this._view.getAttributeAsTimestamp(this._index,t)}getAttributes(){return this._view.getAttributes(this._index)}getOptimizedGeometry(){return this._view.getOptimizedGeometry(this._index)}getCentroid(t){return this._view.getCentroid(this._index,t)}getBounds(){return this._view.getBounds(this._index)}getBoundingBox(){return this._view.getBoundingBox(this._index)}cloneWithGeometry(t){return new u(this._index,this._view,t)}}class u extends o{constructor(t,e,i){super(t,e),this._geometryOverride=i}getOptimizedGeometry(){return this._geometryOverride}getCentroid(t){return n(this._geometryOverride)}}class d{constructor(t,e){this.featureData=t,this.bounds=e}}class a{constructor(){this._tileBounds=new Map,this.events=new t,this.featureAdapter=h.shared}get usedMemory(){return e+e*this._tileBounds.size}addTile(t){const{featureCount:e}=t;if(0===e)return;const i=new r(9,e=>t.getBounds(e)),s=new Array;for(let r=0;r<e;++r)s[r]=r;i.load(s),this._tileBounds.set(t.id,new d(t,i)),this.events.emit("changed")}removeTile(t){this._tileBounds.delete(t),this.events.emit("changed")}clear(){this._tileBounds.clear(),this.events.emit("changed")}forEach(t){for(const{featureData:e,bounds:i}of this._tileBounds.values())i.all(i=>{e.getEnabled(i)&&t(new o(i,e))})}forEachInBounds(t,e){m.minX=t[0],m.minY=t[1],m.maxX=t[2],m.maxY=t[3];for(const{featureData:i,bounds:r}of this._tileBounds.values())r.search(m,t=>{i.getEnabled(t)&&e(new o(t,i))})}forEachBounds(t,e){for(const i of t)e(i.getBoundingBox())}getFullExtent(t){let e=1/0,i=1/0,r=-1/0,s=-1/0;for(const{bounds:n}of this._tileBounds.values()){const{minX:t,minY:o,maxX:u,maxY:d}=n.toJSON();e=Math.min(e,t),i=Math.min(i,o),r=Math.min(r,u),s=Math.min(s,d)}return{xmin:e,ymin:i,xmax:r,ymax:s,spatialReference:t}}}class h{static{this.shared=new h}getObjectId(t){return t.getObjectId()}getAttribute(t,e){return t.getAttribute(e)}getAttributeAsTimestamp(t,e){return t.getAttributeAsTimestamp(e)}getAttributes(t){return t.getAttributes()}getGeometry(t){return t.getOptimizedGeometry()}getCentroid(t,e){return t.getCentroid(e)}cloneWithGeometry(t,e,i){return t.cloneWithGeometry(e)}}const m=new s;export{o as FeatureHandle,a as TiledFeatureStore};
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{create as t}from"../../../../geometry/support/aaBoundingBox.js";import{getCentroidOptimizedGeometry as e}from"../../../../layers/graphics/centroid.js";import r from"../../../../layers/graphics/OptimizedGeometry.js";import{getCachedAttributeValue as i}from"./I3SBinaryReader.js";class o{constructor(t){this._objectIdField=t.objectIdField,this._getFeatureExtent=t.getFeatureExtent}getObjectId(t){return t.id}getAttributes(t){const{meta:e,index:r}=t,o={};this._objectIdField&&(o[this._objectIdField]=t.id);const n=e.attributeInfo?.attributeData;if(null!=n)for(const s of Object.keys(n))o[s]=i(n[s],r);return o}getAttribute(t,e){if(e===this._objectIdField)return t.id;const{meta:r,index:o}=t,n=r.attributeInfo?.attributeData;return null!=n?i(n[e],o):null}getGeometry(t){if(t.geometry)return t.geometry;const[e,i,o,n,u,a]=this._getFeatureExtent(t,s);return new r([5,5],[e,i,o,n,i,o,n,u,o,e,u,o,e,i,o,e,i,a,n,i,a,n,u,a,e,u,a,e,i,a],!0,!1)}getCentroid(t,i){if(t.geometry)return e(t.geometry);const[o,n,u,a,d,c]=this._getFeatureExtent(t,s);return new r([],[(o+a)/2,(n+d)/2,(u+c)/2],!0,!1)}cloneWithGeometry(t,e){const{id:r,index:i,meta:o}=t;return new n(r,i,o,e)}getMetadata(t){return t}}class n{constructor(t,e,r,i){this.id=t,this.index=e,this.meta=r,this.geometry=i}get usedMemory(){return 32+(this.geometry?.usedMemory??0)}}const s=t();export{n as I3SQueryFeature,o as I3SQueryFeatureAdapter};
5
+ import{create as t}from"../../../../geometry/support/aaBoundingBox.js";import{getCentroidOptimizedGeometry as e}from"../../../../layers/graphics/centroid.js";import r from"../../../../layers/graphics/OptimizedGeometry.js";import{getCachedAttributeValue as i}from"./I3SBinaryReader.js";class o{constructor(t){this._objectIdField=t.objectIdField,this._getFeatureExtent=t.getFeatureExtent}getObjectId(t){return t.id}getAttributes(t){const{meta:e,index:r}=t,o={};this._objectIdField&&(o[this._objectIdField]=t.id);const n=e.attributeInfo?.attributeData;if(null!=n)for(const s of Object.keys(n))o[s]=i(n[s],r);return o}getAttribute(t,e){if(e===this._objectIdField)return t.id;const{meta:r,index:o}=t,n=r.attributeInfo?.attributeData;return null!=n?i(n[e],o):null}getGeometry(t){if(t.geometry)return t.geometry;const[e,i,o,n,u,a]=this._getFeatureExtent(t,s);return new r([5,5],[e,i,o,n,i,o,n,u,o,e,u,o,e,i,o,e,i,a,n,i,a,n,u,a,e,u,a,e,i,a],!0,!1)}getCentroid(t,i){if(t.geometry)return e(t.geometry);const[o,n,u,a,d,c]=this._getFeatureExtent(t,s);return new r([],[(o+a)/2,(n+d)/2,(u+c)/2],!0,!1)}cloneWithGeometry(t,e,r){const{id:i,index:o,meta:s}=t;return new n(i,o,s,e)}getMetadata(t){return t}}class n{constructor(t,e,r,i){this.id=t,this.index=e,this.meta=r,this.geometry=i}get usedMemory(){return 32+(this.geometry?.usedMemory??0)}}const s=t();export{n as I3SQueryFeature,o as I3SQueryFeatureAdapter};