@arcgis/core 5.2.0-next.147 → 5.2.0-next.149

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 (317) hide show
  1. package/assets/esri/core/workers/RemoteClient.js +1 -1
  2. package/assets/esri/core/workers/chunks/03afeefb9d16b6f1d844.js +1 -0
  3. package/assets/esri/core/workers/chunks/09b9a886363bc1197785.js +1 -0
  4. package/assets/esri/core/workers/chunks/0ad0484ffcbe4ad21bd3.js +1 -0
  5. package/assets/esri/core/workers/chunks/{72019baeba520edb6bb0.js → 112befb3b5b406f29298.js} +1 -1
  6. package/assets/esri/core/workers/chunks/12a7997a40c77f5c9160.js +1 -0
  7. package/assets/esri/core/workers/chunks/18787aa685524b958561.js +1 -0
  8. package/assets/esri/core/workers/chunks/{776ae25a34352d3468bc.js → 19743dedaa40446259ec.js} +1 -1
  9. package/assets/esri/core/workers/chunks/{6dd0b79fa3a629ab4f27.js → 1bca39e0e651426bdbb5.js} +1 -1
  10. package/assets/esri/core/workers/chunks/{8b1c17cc52d989924313.js → 21f45a47708e6e43147f.js} +1 -1
  11. package/assets/esri/core/workers/chunks/2c626f525f3483c03477.js +1 -0
  12. package/assets/esri/core/workers/chunks/2d9a1f23ec6ce90723ac.js +1 -0
  13. package/assets/esri/core/workers/chunks/{7a05b18f655c1167ce0a.js → 2ef5237e4c876d6a4ee0.js} +1 -1
  14. package/assets/esri/core/workers/chunks/{79c83f4e066682543ca1.js → 320e5942a098dd104366.js} +1 -1
  15. package/assets/esri/core/workers/chunks/407f1e8176f3b0af73b4.js +1 -0
  16. package/assets/esri/core/workers/chunks/{1ba0dfbe0958cdbd7c9f.js → 42fd2a7b22b03dacc6a7.js} +1 -1
  17. package/assets/esri/core/workers/chunks/444e5f214abce3d607cd.js +1 -0
  18. package/assets/esri/core/workers/chunks/45367aa8e5c5d574de94.js +1 -0
  19. package/assets/esri/core/workers/chunks/47d074136a7f8e551a9a.js +1 -0
  20. package/assets/esri/core/workers/chunks/4a6b92ecbb1f1c55cc43.js +1 -0
  21. package/assets/esri/core/workers/chunks/4fc337240e7cddd0e988.js +1 -0
  22. package/assets/esri/core/workers/chunks/{24cc7b6b5e307a89cdd5.js → 50036a323c2e7f155311.js} +1 -1
  23. package/assets/esri/core/workers/chunks/5116b569a8dbda4910c8.js +1 -0
  24. package/assets/esri/core/workers/chunks/54b18559280a7d2a8d93.js +1 -0
  25. package/assets/esri/core/workers/chunks/{b2737120c5999b2f3909.js → 55dcbf296d8d0092e473.js} +1 -1
  26. package/assets/esri/core/workers/chunks/{5c855af73ee3c3e764fb.js → 5732fdf6d8b87739aeea.js} +1 -1
  27. package/assets/esri/core/workers/chunks/5924ec3167a2941ebb1f.js +1 -0
  28. package/assets/esri/core/workers/chunks/5fa1ec357c3ad1f91bc7.js +1 -0
  29. package/assets/esri/core/workers/chunks/606ea251075fe81a1206.js +1 -0
  30. package/assets/esri/core/workers/chunks/{ceb680688fe7e570a774.js → 608be1172a908e92b9f1.js} +1 -1
  31. package/assets/esri/core/workers/chunks/{6f358116f79021ff9687.js → 612104dff305ff062dfa.js} +2 -2
  32. package/assets/esri/core/workers/chunks/6299be5e7e26bf3c6859.js +1 -0
  33. package/assets/esri/core/workers/chunks/68be3fb88ca61f82fb90.js +1 -0
  34. package/assets/esri/core/workers/chunks/6b04285726b803b82564.js +1 -0
  35. package/assets/esri/core/workers/chunks/6c9266120d46e8c69dbf.js +1 -0
  36. package/assets/esri/core/workers/chunks/6c9acd9e4e201dc380e9.js +1 -0
  37. package/assets/esri/core/workers/chunks/6eb5cc8ddf772c0062e6.js +1 -0
  38. package/assets/esri/core/workers/chunks/709e019885822b1f6f3e.js +1 -0
  39. package/assets/esri/core/workers/chunks/731018c0deffc41ffc97.js +1 -0
  40. package/assets/esri/core/workers/chunks/7320a4913b6cad7cc5d7.js +1 -0
  41. package/assets/esri/core/workers/chunks/7449568eb2305bf2d650.js +1 -0
  42. package/assets/esri/core/workers/chunks/7572c2bc5062e66f6330.js +1 -0
  43. package/assets/esri/core/workers/chunks/7d212c415f2709037408.js +1 -0
  44. package/assets/esri/core/workers/chunks/7f0f9dddc44b1f1600f0.js +1 -0
  45. package/assets/esri/core/workers/chunks/8293600f94553afc8c38.js +1 -0
  46. package/assets/esri/core/workers/chunks/{c18189710d6198516175.js → 830ab9b8d000169da675.js} +1 -1
  47. package/assets/esri/core/workers/chunks/8414ffd937c1099e0bbc.js +1 -0
  48. package/assets/esri/core/workers/chunks/{700b1d5bc67b7e1b3ff3.js → 8aa80b892fde552577e8.js} +1 -1
  49. package/assets/esri/core/workers/chunks/900181f68449d8f82eeb.js +1 -0
  50. package/assets/esri/core/workers/chunks/925271bb763607a326ae.js +1 -0
  51. package/assets/esri/core/workers/chunks/937824bc7948f7bc7845.js +1 -0
  52. package/assets/esri/core/workers/chunks/939942b00ba380e2957e.js +1 -0
  53. package/assets/esri/core/workers/chunks/97d6ef9e34a43ad2e556.js +1 -0
  54. package/assets/esri/core/workers/chunks/{c76c42c74eedd43263d3.js → 9dd1fc56eb1ea6eb705e.js} +1 -1
  55. package/assets/esri/core/workers/chunks/a07cb6a2f5b66d4e9f15.js +1 -0
  56. package/assets/esri/core/workers/chunks/a40b6d8b5c73e06e14d4.js +1 -0
  57. package/assets/esri/core/workers/chunks/a7f3576208f295b670d6.js +1 -0
  58. package/assets/esri/core/workers/chunks/a80e49acc827dbf3b524.js +1 -0
  59. package/assets/esri/core/workers/chunks/aeaaff7a4b1a99540f52.js +1 -0
  60. package/assets/esri/core/workers/chunks/af349c7bc8ef41a0e1bd.js +1 -0
  61. package/assets/esri/core/workers/chunks/afc3b2af20e9d1dfd260.js +1 -0
  62. package/assets/esri/core/workers/chunks/b19b6102ed2d6f67b43b.js +1 -0
  63. package/assets/esri/core/workers/chunks/b1b4066e8d1c0c9656e5.js +1 -0
  64. package/assets/esri/core/workers/chunks/b4334713bacdfe40ce3d.js +1 -0
  65. package/assets/esri/core/workers/chunks/{6883a5c6883eccaddf64.js → b6ba66a05030d3815dfd.js} +1 -1
  66. package/assets/esri/core/workers/chunks/bbec9d2e3b75a5c59681.js +1 -0
  67. package/assets/esri/core/workers/chunks/{9ab25ee06041f907b9a2.js → c2c1f51a4668055c2838.js} +1 -1
  68. package/assets/esri/core/workers/chunks/c337fc0e6dc69c233e6d.js +1 -0
  69. package/assets/esri/core/workers/chunks/c598b22f78ccc57f9d6d.js +1 -0
  70. package/assets/esri/core/workers/chunks/c5d85be6e16bc895e7fb.js +1 -0
  71. package/assets/esri/core/workers/chunks/c62738f84c914671b143.js +1 -0
  72. package/assets/esri/core/workers/chunks/c8d178a0c82fffd7fed5.js +1 -0
  73. package/assets/esri/core/workers/chunks/c8d6bb5cca49926a0214.js +1 -0
  74. package/assets/esri/core/workers/chunks/cde4b044e013b9e41591.js +1 -0
  75. package/assets/esri/core/workers/chunks/{a7985d20fa6e8d4878e7.js → d0f5bee9db1ad51ae687.js} +1 -1
  76. package/assets/esri/core/workers/chunks/d2347d6aa1c57fd57029.js +1 -0
  77. package/assets/esri/core/workers/chunks/dca35dbe427605ef6fcc.js +1 -0
  78. package/assets/esri/core/workers/chunks/e0351753f6b4d1adf11e.js +1 -0
  79. package/assets/esri/core/workers/chunks/{534186fc921a0ccf58dc.js → e1f5d00878f27e1d413e.js} +1 -1
  80. package/assets/esri/core/workers/chunks/f1df76f098a3cc924832.js +1 -0
  81. package/assets/esri/core/workers/chunks/f4f9d08b2df856e3b694.js +1 -0
  82. package/assets/esri/core/workers/chunks/{711cfb84659cb4437679.js → f528ac5c648ca6a98582.js} +1 -1
  83. package/assets/esri/core/workers/chunks/f8a83d447b7aef051876.js +1 -0
  84. package/assets/esri/core/workers/chunks/fc44227c1756f65b95df.js +1 -0
  85. package/assets/esri/core/workers/chunks/fdbf6208df5c58746d9d.js +1 -0
  86. package/assets/esri/widgets/BatchAttributeForm/t9n/messages.ar.json +1 -1
  87. package/assets/esri/widgets/BatchAttributeForm/t9n/messages.bg.json +1 -1
  88. package/assets/esri/widgets/BatchAttributeForm/t9n/messages.bs.json +1 -1
  89. package/assets/esri/widgets/BatchAttributeForm/t9n/messages.ca.json +1 -1
  90. package/assets/esri/widgets/BatchAttributeForm/t9n/messages.cs.json +1 -1
  91. package/assets/esri/widgets/BatchAttributeForm/t9n/messages.da.json +1 -1
  92. package/assets/esri/widgets/BatchAttributeForm/t9n/messages.de.json +1 -1
  93. package/assets/esri/widgets/BatchAttributeForm/t9n/messages.el.json +1 -1
  94. package/assets/esri/widgets/BatchAttributeForm/t9n/messages.es.json +1 -1
  95. package/assets/esri/widgets/BatchAttributeForm/t9n/messages.et.json +1 -1
  96. package/assets/esri/widgets/BatchAttributeForm/t9n/messages.fi.json +1 -1
  97. package/assets/esri/widgets/BatchAttributeForm/t9n/messages.fr.json +1 -1
  98. package/assets/esri/widgets/BatchAttributeForm/t9n/messages.he.json +1 -1
  99. package/assets/esri/widgets/BatchAttributeForm/t9n/messages.hr.json +1 -1
  100. package/assets/esri/widgets/BatchAttributeForm/t9n/messages.hu.json +1 -1
  101. package/assets/esri/widgets/BatchAttributeForm/t9n/messages.id.json +1 -1
  102. package/assets/esri/widgets/BatchAttributeForm/t9n/messages.it.json +1 -1
  103. package/assets/esri/widgets/BatchAttributeForm/t9n/messages.ja.json +1 -1
  104. package/assets/esri/widgets/BatchAttributeForm/t9n/messages.ko.json +1 -1
  105. package/assets/esri/widgets/BatchAttributeForm/t9n/messages.lt.json +1 -1
  106. package/assets/esri/widgets/BatchAttributeForm/t9n/messages.lv.json +1 -1
  107. package/assets/esri/widgets/BatchAttributeForm/t9n/messages.nl.json +1 -1
  108. package/assets/esri/widgets/BatchAttributeForm/t9n/messages.no.json +1 -1
  109. package/assets/esri/widgets/BatchAttributeForm/t9n/messages.pl.json +1 -1
  110. package/assets/esri/widgets/BatchAttributeForm/t9n/messages.pt-BR.json +1 -1
  111. package/assets/esri/widgets/BatchAttributeForm/t9n/messages.pt-PT.json +1 -1
  112. package/assets/esri/widgets/BatchAttributeForm/t9n/messages.ro.json +1 -1
  113. package/assets/esri/widgets/BatchAttributeForm/t9n/messages.ru.json +1 -1
  114. package/assets/esri/widgets/BatchAttributeForm/t9n/messages.sk.json +1 -1
  115. package/assets/esri/widgets/BatchAttributeForm/t9n/messages.sl.json +1 -1
  116. package/assets/esri/widgets/BatchAttributeForm/t9n/messages.sr.json +1 -1
  117. package/assets/esri/widgets/BatchAttributeForm/t9n/messages.sv.json +1 -1
  118. package/assets/esri/widgets/BatchAttributeForm/t9n/messages.th.json +1 -1
  119. package/assets/esri/widgets/BatchAttributeForm/t9n/messages.tr.json +1 -1
  120. package/assets/esri/widgets/BatchAttributeForm/t9n/messages.uk.json +1 -1
  121. package/assets/esri/widgets/BatchAttributeForm/t9n/messages.vi.json +1 -1
  122. package/assets/esri/widgets/BatchAttributeForm/t9n/messages.zh-CN.json +1 -1
  123. package/assets/esri/widgets/BatchAttributeForm/t9n/messages.zh-HK.json +1 -1
  124. package/assets/esri/widgets/BatchAttributeForm/t9n/messages.zh-TW.json +1 -1
  125. package/config.js +1 -1
  126. package/core/Loadable.js +1 -1
  127. package/geometry/HeightModelInfo.js +1 -1
  128. package/geometry/support/TileClipper.js +1 -1
  129. package/geometry/support/meshUtils.d.ts +1 -1
  130. package/geometry/support/scaleUtils.js +1 -1
  131. package/kernel.js +1 -1
  132. package/layers/BaseDynamicLayer.d.ts +1 -0
  133. package/layers/BaseElevationLayer.d.ts +2 -0
  134. package/layers/BaseTileLayer.d.ts +12 -9
  135. package/layers/CSVLayer.d.ts +1 -16
  136. package/layers/CatalogLayer.d.ts +1 -1
  137. package/layers/FeatureLayer.d.ts +3 -16
  138. package/layers/GeoJSONLayer.d.ts +1 -53
  139. package/layers/GeoRSSLayer.d.ts +0 -44
  140. package/layers/OrientedImageryLayer.js +1 -1
  141. package/layers/ParquetLayer.d.ts +84 -5
  142. package/layers/ParquetLayer.js +1 -1
  143. package/layers/SceneLayer.d.ts +4 -5
  144. package/layers/SceneLayer.js +1 -1
  145. package/layers/SketchLayer.d.ts +0 -1
  146. package/layers/SubtypeGroupLayer.d.ts +1 -1
  147. package/layers/VectorTileLayer.d.ts +2 -12
  148. package/layers/WFSLayer.d.ts +1 -1
  149. package/layers/buildingSublayers/BuildingComponentSublayer.d.ts +1 -1
  150. package/layers/catalog/CatalogFootprintLayer.d.ts +1 -1
  151. package/layers/knowledgeGraph/KnowledgeGraphSublayer.d.ts +1 -1
  152. package/layers/mixins/ArcGISImageService.d.ts +1 -1
  153. package/layers/mixins/PortalLayer.js +1 -1
  154. package/layers/mixins/RefreshableLayer.d.ts +1 -3
  155. package/layers/mixins/ScaleRangeLayer.js +1 -1
  156. package/layers/mixins/SublayersOwner.js +1 -1
  157. package/layers/orientedImagery/core/ExposurePoint.js +1 -1
  158. package/layers/orientedImagery/core/utils.js +1 -1
  159. package/layers/raster/datasets/GeospatialPDFRaster.js +1 -1
  160. package/layers/support/FeatureFilter.d.ts +1 -1
  161. package/layers/support/ParquetPortalItemData.js +1 -1
  162. package/layers/support/PortalItemData.js +1 -1
  163. package/layers/support/Sublayer.js +1 -1
  164. package/layers/support/SubtypeSublayer.d.ts +1 -1
  165. package/layers/support/SubtypeSublayer.js +1 -1
  166. package/layers/support/layersLoader.js +1 -1
  167. package/package.json +2 -2
  168. package/popup/FeaturesModel.d.ts +27 -6
  169. package/popup/FeaturesModel.js +1 -1
  170. package/portal/support/layersLoader.js +1 -1
  171. package/portal/support/portalLayers.js +1 -1
  172. package/renderers/VectorFieldRenderer.d.ts +4 -4
  173. package/rest/print.js +1 -1
  174. package/rest/support/printTaskUtils.js +1 -1
  175. package/smartMapping/renderers/color.js +1 -1
  176. package/smartMapping/renderers/dotDensity.js +1 -1
  177. package/smartMapping/renderers/heatmap.js +1 -1
  178. package/smartMapping/renderers/pieChart.js +1 -1
  179. package/smartMapping/renderers/type.js +1 -1
  180. package/smartMapping/statistics/heatmapStatistics.js +1 -1
  181. package/smartMapping/statistics/histogram.js +1 -1
  182. package/smartMapping/statistics/summaryStatistics.js +1 -1
  183. package/smartMapping/statistics/summaryStatisticsForAttributes.js +1 -1
  184. package/smartMapping/statistics/uniqueValues.js +1 -1
  185. package/smartMapping/support/adapters/support/layerUtils.js +1 -1
  186. package/smartMapping/types.d.ts +3 -1
  187. package/symbols/cim/CIMSymbolHelper.js +1 -1
  188. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/hittestUtils.js +1 -1
  189. package/views/2d/engine/webgl/shaderGraph/techniques/text/TextShader.js +1 -1
  190. package/views/2d/interactive/snapping/featureSources/featureServiceSource/FeatureServiceTiles2D.js +1 -1
  191. package/views/2d/layers/FeatureLikeLayerView2D.js +1 -1
  192. package/views/2d/layers/LayerView2D.js +1 -1
  193. package/views/2d/layers/features/sources/FeatureSource.js +1 -1
  194. package/views/3d/analysis/Viewshed/ViewshedPlacementController.js +1 -1
  195. package/views/3d/analysis/Viewshed/types.d.ts +3 -1
  196. package/views/3d/layers/BuildingComponentSublayerView3D.js +1 -1
  197. package/views/3d/layers/BuildingSceneLayerView3D.js +1 -1
  198. package/views/3d/layers/DynamicLayerView3D.js +1 -1
  199. package/views/3d/layers/FeatureLikeLayerViewBase3D.js +1 -1
  200. package/views/3d/layers/FlowSubView3D.js +1 -1
  201. package/views/3d/layers/GaussianSplatLayerView3D.js +1 -1
  202. package/views/3d/layers/GraphicsLayerView3D.js +1 -1
  203. package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
  204. package/views/3d/layers/IntegratedMeshLayerView3D.js +1 -1
  205. package/views/3d/layers/MediaLayerView3D.js +1 -1
  206. package/views/3d/layers/PointCloudLayerView3D.js +1 -1
  207. package/views/3d/layers/RouteLayerView3D.js +1 -1
  208. package/views/3d/layers/SceneLayerGraphicsView3D.js +1 -1
  209. package/views/3d/layers/SceneLayerView3D.js +1 -1
  210. package/views/3d/layers/TiledLayerView3D.js +1 -1
  211. package/views/3d/layers/VoxelLayerView3D.js +1 -1
  212. package/views/3d/layers/graphics/Graphics3DScaleVisibility.js +1 -1
  213. package/views/3d/layers/graphics/Labeler.js +1 -1
  214. package/views/3d/layers/support/HeatmapFeatureProcessor.js +1 -1
  215. package/views/3d/support/popupHitTest.js +1 -1
  216. package/views/3d/terrain/TerrainData.js +1 -1
  217. package/views/3d/terrain/terrainUtils.js +1 -1
  218. package/views/3d/webgl-engine/lib/BindParameters.js +1 -1
  219. package/views/DOMContainer.d.ts +27 -9
  220. package/views/DOMContainer.js +1 -1
  221. package/views/PopupView.d.ts +6 -0
  222. package/views/VideoView.d.ts +27 -9
  223. package/views/View.d.ts +16 -7
  224. package/views/View.js +1 -1
  225. package/views/View2D.d.ts +1 -1
  226. package/views/draw/support/InteractiveHandle.js +1 -1
  227. package/views/interactive/snapping/FeatureSnappingSourceInfo.js +1 -1
  228. package/views/interactive/snapping/SnappingManagerPool.js +1 -1
  229. package/views/interactive/snapping/SnappingOptions.d.ts +1 -1
  230. package/views/interactive/tooltip/components/ElevationModeSelect.js +1 -1
  231. package/views/layers/FeatureLikeLayerView.d.ts +2 -3
  232. package/views/layers/LayerView.js +1 -1
  233. package/views/layers/LineOfSightLayerView.d.ts +3 -4
  234. package/views/layers/ParquetLayerView.d.ts +15 -0
  235. package/views/layers/PointCloudLayerView.d.ts +1 -1
  236. package/views/layers/SceneLayerView.d.ts +1 -1
  237. package/views/layers/ViewshedLayerView.d.ts +5 -6
  238. package/views/support/layerViewUtils.js +1 -1
  239. package/webdoc/support/saveUtils.js +1 -1
  240. package/webdoc/support/unsupportedErrors.js +1 -1
  241. package/widgets/Editor.d.ts +10 -0
  242. package/widgets/Legend.d.ts +1 -0
  243. package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
  244. package/widgets/OrientedImageryViewer/adapters/draw/HeightMeasurementAdapter.js +1 -1
  245. package/widgets/OrientedImageryViewer/adapters/sketch/MeasurementAdapter.js +1 -1
  246. package/widgets/OrientedImageryViewer/adapters/sketch/TriangulatedMeasurementAdapter.js +1 -1
  247. package/widgets/OrientedImageryViewer/components/ImageLocationViewModel.js +1 -1
  248. package/widgets/OrientedImageryViewer/services/ImageMeasurementService.js +1 -1
  249. package/widgets/support/SnappingControls.d.ts +1 -1
  250. package/assets/esri/core/workers/chunks/00a600c71ceebe7bfeee.js +0 -1
  251. package/assets/esri/core/workers/chunks/0193df3f9fb23633da87.js +0 -1
  252. package/assets/esri/core/workers/chunks/050c4b212f2b5691db34.js +0 -1
  253. package/assets/esri/core/workers/chunks/05963f57cbe5a5249496.js +0 -1
  254. package/assets/esri/core/workers/chunks/06e7400f5ebe0719b81c.js +0 -1
  255. package/assets/esri/core/workers/chunks/07aa6d36f1006b6ab7ff.js +0 -1
  256. package/assets/esri/core/workers/chunks/0bb11751efa2023ec937.js +0 -1
  257. package/assets/esri/core/workers/chunks/14a3808427deaaa85bf2.js +0 -1
  258. package/assets/esri/core/workers/chunks/1a6027f08893aba9e677.js +0 -1
  259. package/assets/esri/core/workers/chunks/2062d46f638eabfc9499.js +0 -1
  260. package/assets/esri/core/workers/chunks/2164fcaced72b0fda31f.js +0 -1
  261. package/assets/esri/core/workers/chunks/222af8522773c7dc80b1.js +0 -1
  262. package/assets/esri/core/workers/chunks/25b0885d3bc190b28c04.js +0 -1
  263. package/assets/esri/core/workers/chunks/303fde8f3459dde16555.js +0 -1
  264. package/assets/esri/core/workers/chunks/305a718719ef15fda90c.js +0 -1
  265. package/assets/esri/core/workers/chunks/347bf269c2b1583d2dca.js +0 -1
  266. package/assets/esri/core/workers/chunks/350540770781b281c39a.js +0 -1
  267. package/assets/esri/core/workers/chunks/392bcef780df52fb4cca.js +0 -1
  268. package/assets/esri/core/workers/chunks/3b017b718ea2d4ed498f.js +0 -1
  269. package/assets/esri/core/workers/chunks/3e81dfc9d621ece038fe.js +0 -1
  270. package/assets/esri/core/workers/chunks/4479a166b5ac8db1e12e.js +0 -1
  271. package/assets/esri/core/workers/chunks/46b2d4addfc73f9183a4.js +0 -1
  272. package/assets/esri/core/workers/chunks/4d82db661365daa513a6.js +0 -1
  273. package/assets/esri/core/workers/chunks/4ed8655770a3e018e366.js +0 -1
  274. package/assets/esri/core/workers/chunks/4f48d45baa8ada16f579.js +0 -1
  275. package/assets/esri/core/workers/chunks/50ca55ad2f5421acc492.js +0 -1
  276. package/assets/esri/core/workers/chunks/5450f339f97b2b042ee2.js +0 -1
  277. package/assets/esri/core/workers/chunks/55cc8581978c71b17998.js +0 -1
  278. package/assets/esri/core/workers/chunks/5ea8809b6519c05ad9f6.js +0 -1
  279. package/assets/esri/core/workers/chunks/62795a1573cbaa4b8e7a.js +0 -1
  280. package/assets/esri/core/workers/chunks/633a9051580c5302d2f7.js +0 -1
  281. package/assets/esri/core/workers/chunks/641d196a554bd07f729e.js +0 -1
  282. package/assets/esri/core/workers/chunks/655c3afda1eef01611dd.js +0 -1
  283. package/assets/esri/core/workers/chunks/6569797d3c22442e5e97.js +0 -1
  284. package/assets/esri/core/workers/chunks/70793967db45fb142962.js +0 -1
  285. package/assets/esri/core/workers/chunks/794e5a67a88cb10c1a19.js +0 -1
  286. package/assets/esri/core/workers/chunks/798a63653f82c0e842c5.js +0 -1
  287. package/assets/esri/core/workers/chunks/820f41d66b2056a3ebc8.js +0 -1
  288. package/assets/esri/core/workers/chunks/841f67baf6a1634ada48.js +0 -1
  289. package/assets/esri/core/workers/chunks/84fcbf7a1d04f01685d1.js +0 -1
  290. package/assets/esri/core/workers/chunks/8e511079918e2fd9261f.js +0 -1
  291. package/assets/esri/core/workers/chunks/8fcfd515ee1b18c902e5.js +0 -1
  292. package/assets/esri/core/workers/chunks/9001e9a1e81bce175ddd.js +0 -1
  293. package/assets/esri/core/workers/chunks/94c5f3bc07fe516dafbe.js +0 -1
  294. package/assets/esri/core/workers/chunks/956a40f40bde416efe93.js +0 -1
  295. package/assets/esri/core/workers/chunks/95b82cbbe355266c65d7.js +0 -1
  296. package/assets/esri/core/workers/chunks/97dbbedea9fe03bd1306.js +0 -1
  297. package/assets/esri/core/workers/chunks/9c0fd8baa00ee9733ba4.js +0 -1
  298. package/assets/esri/core/workers/chunks/9c1e69ac82e2bf746191.js +0 -1
  299. package/assets/esri/core/workers/chunks/a010d2e4e34eb7bc1fec.js +0 -1
  300. package/assets/esri/core/workers/chunks/a05790444115e4cf1bcc.js +0 -1
  301. package/assets/esri/core/workers/chunks/a52bf03bffb6ffac3b54.js +0 -1
  302. package/assets/esri/core/workers/chunks/a7edf7541569fef77cb3.js +0 -1
  303. package/assets/esri/core/workers/chunks/b2c29bc48c7b3b0c9357.js +0 -1
  304. package/assets/esri/core/workers/chunks/b7d77dd2abb255fd2e5a.js +0 -1
  305. package/assets/esri/core/workers/chunks/b8054adc45bca069b948.js +0 -1
  306. package/assets/esri/core/workers/chunks/ba46869e700ba1d2787f.js +0 -1
  307. package/assets/esri/core/workers/chunks/ba48045a81acc4cda927.js +0 -1
  308. package/assets/esri/core/workers/chunks/ca7fb75e2c62e7d37122.js +0 -1
  309. package/assets/esri/core/workers/chunks/d01381b548c204835509.js +0 -1
  310. package/assets/esri/core/workers/chunks/d21257d2e2a37266c0f7.js +0 -1
  311. package/assets/esri/core/workers/chunks/d270cc9807161033686e.js +0 -1
  312. package/assets/esri/core/workers/chunks/d4f038e04c42aed588c1.js +0 -1
  313. package/assets/esri/core/workers/chunks/e32b96c08cb272a59851.js +0 -1
  314. package/assets/esri/core/workers/chunks/e7c60bd85abbd36cdc64.js +0 -1
  315. package/assets/esri/core/workers/chunks/f05de08e194a3f9b96f2.js +0 -1
  316. package/assets/esri/core/workers/chunks/f0a68d2900d24f56afa0.js +0 -1
  317. package/assets/esri/core/workers/chunks/f511a304e9dea9eb3e01.js +0 -1
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import t from"../../../core/Error.js";import{whenOnce as n}from"../../../core/reactiveUtils.js";import{property as r,subclass as i}from"../../../core/accessorSupport/decorators.js";import{LayerViewPerformanceInfo as a}from"./support/LayerViewPerformanceInfo.js";import{updatingProgress as o,updatingProgressValue as s}from"../support/updatingProperties.js";import{checkIfTileInfoSupportedForView as c}from"../terrain/terrainUtils.js";import{isScaleRangeActive as l,validateScaleRange as u}from"../../support/layerViewUtils.js";const d=d=>{let f=d,p=class extends f{constructor(){super(...arguments),this.hasMixedImageFormats=!0}get imageFormatIsOpaque(){return!1}get fullExtent(){return this.layer.fullExtent}get isOpaque(){return this.fullOpacity>=1&&this.imageFormatIsOpaque}initialize(){this.addHandles(this.view.basemapTerrain.on(`tile-data-changed`,({layerClass:e,layerIndex:t})=>{e===1&&t===this.view.basemapTerrain.getLayerIndexByUID(1,this.uid)&&this.notifyChange(`visibleAtCurrentScale`)}))}tilesVisibleAtCurrentScale(){let{minScale:e,maxScale:t}=this.layer;if(!l(e,t))return!0;let{basemapTerrain:n}=this.view,r=n.getLayerIndexByUID(1,this.uid);if(r==null)return!1;let{tilingScheme:i}=n,a=e&&i.levelAtScale(e),o=t&&i.levelAtScale(t);return n.renderer.visibleTiles.some(e=>!!e.layerInfo[1][r]&&(!a||e.level>=a)&&(!o||e.level<=o))}get visibleAtCurrentScale(){return this.tilesVisibleAtCurrentScale()}get dataScaleRange(){let e=this.tileInfo.lods,t=e[0].scale,n=e[e.length-1].scale;if(`tilemapCache`in this.layer&&this.layer.tilemapCache){let{effectiveMinLOD:e,effectiveMaxLOD:r}=this.layer.tilemapCache;t=this.tileInfo.lodAt(e).scale,n=this.tileInfo.lodAt(r).scale}return{minScale:t,maxScale:n}}canResume(){let e=this.layer&&`effectiveScaleRange`in this.layer?this.layer.effectiveScaleRange:null;return this.visible&&this.layer?.loaded&&!this.parent?.suspended&&this.view?.ready&&u(e)&&this.visibleAtCurrentTimeExtent||!1}get dataLevelRange(){let{minScale:e,maxScale:t}=this.dataScaleRange;return this.levelRangeFromScaleRange(e,t)}get displayLevelRange(){let e=this.layer.minScale||this.dataScaleRange.minScale,t=this.layer.maxScale||this.dataScaleRange.maxScale,n=this.levelRangeFromScaleRange(e,t);return this.layer.maxScale&&n.maxLevel++,n}get performanceInfo(){return new a(this.view.basemapTerrain.getUsedMemoryForLayerView(this))}getTileUrl(e){return`getTileUrl`in this.layer?this.layer.getTileUrl(e[0],e[1],e[2]):null}_addTilingSchemeMatchPromise(){if(this.fullExtent==null)return this.addResolvingPromise(Promise.reject(new t(`tilingscheme:extent-not-defined`,`This layer doesn't define a fullExtent.`)));let e=this._getTileInfoSupportError(this.tileInfo,this.fullExtent);if(e)return this.addResolvingPromise(Promise.reject(e));this.addResolvingPromise(n(()=>this.view?.basemapTerrain?.tilingSchemeLocked).then(()=>{let e=this.view.basemapTerrain.tilingScheme,t=`tilemapCache`in this.layer?this.layer.tilemapCache?.effectiveMaxLOD:void 0,n=this._getTileInfoCompatibilityError(this.tileInfo,e,t);if(n)throw n}))}_getTileInfoSupportError(e,n){let r=c(e,n,this.view.spatialReference,this.view.state.viewingMode,`tilemapCache`in this.layer?this.layer.tilemapCache?.effectiveMaxLOD:void 0);if(!r)return;let i={layer:this.layer,error:r};switch(r.name){case`tilingscheme:spatial-reference-mismatch`:case`tilingscheme:global-unsupported-spatial-reference`:case`tilingscheme:local-unsupported-spatial-reference`:return new t(`layerview:spatial-reference-incompatible`,`The spatial reference of this layer does not meet the requirements of the view`,i);default:return new t(`layerview:tiling-scheme-unsupported`,`The tiling scheme of this layer is not supported by SceneView`,i)}}_getTileInfoCompatibilityError(e,n,r){return e==null||!n.compatibleWith(e,r)?new t(`layerview:tiling-scheme-incompatible`,`The tiling scheme of this layer is incompatible with the tiling scheme of the surface`):null}levelRangeFromScaleRange(e,t){let n={minLevel:0,maxLevel:1/0},r=this.view&&this.view.basemapTerrain&&this.view.basemapTerrain.tilingScheme;if(!r)return n;let i=r.levels[0],a=e=>{let t=Math.log(i.scale/e)/Math.LN2;return .5-Math.abs(.5-t%1)<1e-9?Math.round(t):Math.ceil(t)};return e!=null&&e>0&&(n.minLevel=Math.max(0,a(e))),t!=null&&t>0&&(n.maxLevel=Math.max(0,a(t))),n}isUpdating(){return!!(this.view&&this.view.basemapTerrain&&this.view.basemapTerrain.updating)}};return e([r({readOnly:!0})],p.prototype,`imageFormatIsOpaque`,null),e([r({readOnly:!0})],p.prototype,`updating`,void 0),e([r(o)],p.prototype,`updatingProgress`,void 0),e([r(s)],p.prototype,`updatingProgressValue`,void 0),e([r()],p.prototype,`hasMixedImageFormats`,void 0),e([r()],p.prototype,`fullExtent`,null),e([r({readOnly:!0})],p.prototype,`isOpaque`,null),e([r({readOnly:!0})],p.prototype,`visibleAtCurrentScale`,null),e([r()],p.prototype,`dataScaleRange`,null),e([r({readOnly:!0})],p.prototype,`dataLevelRange`,null),e([r({readOnly:!0})],p.prototype,`displayLevelRange`,null),e([r()],p.prototype,`layer`,void 0),p=e([i(`esri.views.3d.layers.TiledLayerView3D`)],p),p};export{d as TiledLayerView3D};
2
+ import{__decorate as e}from"tslib";import t from"../../../core/Error.js";import{whenOnce as n}from"../../../core/reactiveUtils.js";import{property as r,subclass as i}from"../../../core/accessorSupport/decorators.js";import{isScaleRangeActive as a,validateScaleRange as o}from"../../../geometry/support/scaleUtils.js";import{LayerViewPerformanceInfo as s}from"./support/LayerViewPerformanceInfo.js";import{updatingProgress as c,updatingProgressValue as l}from"../support/updatingProperties.js";import{checkIfTileInfoSupportedForView as u}from"../terrain/terrainUtils.js";const d=d=>{let f=d,p=class extends f{constructor(){super(...arguments),this.hasMixedImageFormats=!0}get imageFormatIsOpaque(){return!1}get fullExtent(){return this.layer.fullExtent}get isOpaque(){return this.fullOpacity>=1&&this.imageFormatIsOpaque}initialize(){this.addHandles(this.view.basemapTerrain.on(`tile-data-changed`,({layerClass:e,layerIndex:t})=>{e===1&&t===this.view.basemapTerrain.getLayerIndexByUID(1,this.uid)&&this.notifyChange(`visibleAtCurrentScale`)}))}tilesVisibleAtCurrentScale(){let{minScale:e,maxScale:t}=this.layer;if(!a(e,t))return!0;let{basemapTerrain:n}=this.view,r=n.getLayerIndexByUID(1,this.uid);if(r==null)return!1;let{tilingScheme:i}=n,o=e&&i.levelAtScale(e),s=t&&i.levelAtScale(t);return n.renderer.visibleTiles.some(e=>!!e.layerInfo[1][r]&&(!o||e.level>=o)&&(!s||e.level<=s))}get visibleAtCurrentScale(){return this.tilesVisibleAtCurrentScale()}get dataScaleRange(){let e=this.tileInfo.lods,t=e[0].scale,n=e[e.length-1].scale;if(`tilemapCache`in this.layer&&this.layer.tilemapCache){let{effectiveMinLOD:e,effectiveMaxLOD:r}=this.layer.tilemapCache;t=this.tileInfo.lodAt(e).scale,n=this.tileInfo.lodAt(r).scale}return{minScale:t,maxScale:n}}canResume(){let e=this.layer&&`effectiveScaleRange`in this.layer?this.layer.effectiveScaleRange:null;return this.visible&&this.layer?.loaded&&!this.parent?.suspended&&this.view?.ready&&o(e)&&this.visibleAtCurrentTimeExtent||!1}get dataLevelRange(){let{minScale:e,maxScale:t}=this.dataScaleRange;return this.levelRangeFromScaleRange(e,t)}get displayLevelRange(){let e=this.layer.minScale||this.dataScaleRange.minScale,t=this.layer.maxScale||this.dataScaleRange.maxScale,n=this.levelRangeFromScaleRange(e,t);return this.layer.maxScale&&n.maxLevel++,n}get performanceInfo(){return new s(this.view.basemapTerrain.getUsedMemoryForLayerView(this))}getTileUrl(e){return`getTileUrl`in this.layer?this.layer.getTileUrl(e[0],e[1],e[2]):null}_addTilingSchemeMatchPromise(){if(this.fullExtent==null)return this.addResolvingPromise(Promise.reject(new t(`tilingscheme:extent-not-defined`,`This layer doesn't define a fullExtent.`)));let e=this._getTileInfoSupportError(this.tileInfo,this.fullExtent);if(e)return this.addResolvingPromise(Promise.reject(e));this.addResolvingPromise(n(()=>this.view?.basemapTerrain?.tilingSchemeLocked).then(()=>{let e=this.view.basemapTerrain.tilingScheme,t=`tilemapCache`in this.layer?this.layer.tilemapCache?.effectiveMaxLOD:void 0,n=this._getTileInfoCompatibilityError(this.tileInfo,e,t);if(n)throw n}))}_getTileInfoSupportError(e,n){let r=u(e,n,this.view.spatialReference,this.view.state.viewingMode,`tilemapCache`in this.layer?this.layer.tilemapCache?.effectiveMaxLOD:void 0);if(!r)return;let i={layer:this.layer,error:r};switch(r.name){case`tilingscheme:spatial-reference-mismatch`:case`tilingscheme:global-unsupported-spatial-reference`:case`tilingscheme:local-unsupported-spatial-reference`:return new t(`layerview:spatial-reference-incompatible`,`The spatial reference of this layer does not meet the requirements of the view`,i);default:return new t(`layerview:tiling-scheme-unsupported`,`The tiling scheme of this layer is not supported by SceneView`,i)}}_getTileInfoCompatibilityError(e,n,r){return e==null||!n.compatibleWith(e,r)?new t(`layerview:tiling-scheme-incompatible`,`The tiling scheme of this layer is incompatible with the tiling scheme of the surface`):null}levelRangeFromScaleRange(e,t){let n={minLevel:0,maxLevel:1/0},r=this.view&&this.view.basemapTerrain&&this.view.basemapTerrain.tilingScheme;if(!r)return n;let i=r.levels[0],a=e=>{let t=Math.log(i.scale/e)/Math.LN2;return .5-Math.abs(.5-t%1)<1e-9?Math.round(t):Math.ceil(t)};return e!=null&&e>0&&(n.minLevel=Math.max(0,a(e))),t!=null&&t>0&&(n.maxLevel=Math.max(0,a(t))),n}isUpdating(){return!!(this.view&&this.view.basemapTerrain&&this.view.basemapTerrain.updating)}};return e([r({readOnly:!0})],p.prototype,`imageFormatIsOpaque`,null),e([r({readOnly:!0})],p.prototype,`updating`,void 0),e([r(c)],p.prototype,`updatingProgress`,void 0),e([r(l)],p.prototype,`updatingProgressValue`,void 0),e([r()],p.prototype,`hasMixedImageFormats`,void 0),e([r()],p.prototype,`fullExtent`,null),e([r({readOnly:!0})],p.prototype,`isOpaque`,null),e([r({readOnly:!0})],p.prototype,`visibleAtCurrentScale`,null),e([r()],p.prototype,`dataScaleRange`,null),e([r({readOnly:!0})],p.prototype,`dataLevelRange`,null),e([r({readOnly:!0})],p.prototype,`displayLevelRange`,null),e([r()],p.prototype,`layer`,void 0),p=e([i(`esri.views.3d.layers.TiledLayerView3D`)],p),p};export{d as TiledLayerView3D};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import t from"../../../core/Error.js";import n from"../../../core/Logger.js";import{watch as r,initial as i}from"../../../core/reactiveUtils.js";import{property as a,subclass as o}from"../../../core/accessorSupport/decorators.js";import{cross as s,normalize as c,set as l}from"../../../core/libs/gl-matrix-2/math/vec3.js";import{create as u}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import d from"../../../geometry/SpatialReference.js";import{projectVectorToVector as f}from"../../../geometry/projection/projectVectorToVector.js";import{empty as p,expandWithVec3 as m}from"../../../geometry/support/aaBoundingBox.js";import{equals as h}from"../../../geometry/support/spatialReferenceUtils.js";import{LayerView3D as g}from"./LayerView3D.js";import{VoxelGraphic as _}from"./VoxelGraphic.js";import{addLayerViewToWasm as v,getVoxelWasm as y,removeLayerViewFromWasm as b}from"./VoxelWasm.js";import{LayerViewPerformanceInfo as x}from"./support/LayerViewPerformanceInfo.js";import{PopupSceneLayerView as S}from"./support/PopupSceneLayerView.js";import C from"../../layers/LayerView.js";import{spatialReferenceIncompatibleError as w,isInEffectiveScaleRange as T}from"../../support/layerViewUtils.js";const E=u(),D=u();let O=class extends S(g(C)){constructor(){super(...arguments),this.type=`voxel-3d`,this.ignoresMemoryFactor=!0,this._suspendedHandle=null,this._usedMemory=0,this._futureMemory=0,this.slicePlaneEnabled=!1,this._wasmLayerId=-1,this._dbgFlags=new Set}initialize(){if(this._dbgFlags.add(3),this.view.viewingMode!==`local`)throw new t(`voxel:unsupported-viewingMode`,`Voxel layers support local viewingMode only.`,{});if(!this.view.stage.renderView.renderingContext.capabilities.colorBufferFloat?.textureFloat)throw new t(`voxel:missing-color-buffer-float`,`Voxel layers require the WebGL2 extension EXT_color_buffer_float`,{});let e=this.layer.spatialReference;if(!h(e,this.view.spatialReference))throw w(`voxel layer`,e.wkid,this.view.spatialReference.wkid);let n=this.layer.currentVariableId,a=this.layer.getVolume(n),o=this.layer.getVariable(n);if(a!=null&&o!=null){let e=a.dimensions[0],t=a.dimensions[1],n=a.zDimension;if(n>1){let r=a.dimensions[n],i=e.size*t.size*r.size,s=1;switch(o.renderingFormat.type){case`Int16`:case`UInt16`:s=2;break;case`Int32`:case`UInt32`:case`Float32`:s=4}this._futureMemory=s*i}}let s=v(this).then(e=>{this._wasmLayerId=e,this._suspendedHandle=r(()=>this.suspended,e=>{let t=y(this.view);t&&t.setEnabled(this,!e)},i),this.addHandles([r(()=>this.layer.renderMode,e=>this._pushRenderModeToWasm(e)),r(()=>this.layer.currentVariableId,e=>this._pushCurrentVariableIdToWasm(e)),r(()=>this.layer.getSections(),e=>this._pushSectionsToWasm(e)),r(()=>this.layer.getVariableStyles(),e=>this._pushVariableStylesToWasm(e)),r(()=>this.layer.getVolumeStyles(),e=>this._pushVolumeStylesToWasm(e)),r(()=>this.layer.enableDynamicSections,e=>this._pushEnableDynamicSectionsToWasm(e)),r(()=>this.layer.enableIsosurfaces,e=>this._pushEnableIsosurfacesToWasm(e)),r(()=>this.layer.enableSections,e=>this._pushEnableSectionsToWasm(e)),r(()=>this.layer.enableSlices,e=>this._pushEnableSlicesToWasm(e)),r(()=>[this.layer.timeOffset,this.layer.timeExtent,this.layer.useViewTime],()=>this._updateLayerTimeProperties()),r(()=>this.slicePlaneEnabled,e=>this._pushAnalysisSliceToWasm(e,this.view.slice.plane)),r(()=>this.view.slice.plane,e=>this._pushAnalysisSliceToWasm(this.slicePlaneEnabled,e))])}).catch(e=>{if(b(this),this._wasmLayerId=-1,e===-1)throw new t(`voxel:addLayer-failure`,`The voxel layer description was invalid.`,{});if(e===-2)throw new t(`voxel:addLayer-failure`,`The voxel layer web assembly module failed to download.`,{})});this.addResolvingPromise(s)}destroy(){b(this),this._suspendedHandle&&=(this._suspendedHandle.remove(),null)}isUpdating(){let e=y(this.view);return this._wasmLayerId<0||e==null?!1:e.isUpdating(this._wasmLayerId)}updatingFlagChanged(){this.notifyChange(`updating`)}get usedMemory(){return this._usedMemory}get unloadedMemory(){return this._futureMemory}get performanceInfo(){return new x(this.usedMemory)}get visibleAtCurrentScale(){return T(this.layer.effectiveScaleRange,this.view.scale)}whenGraphicBounds(e,t){let n=e.attributes[`Voxel.WorldPosition`];if(n){let e=p(),t=JSON.parse(n);if(f(t,this.view.renderSpatialReference,D,this.view.spatialReference||d.WGS84))return m(e,D),Promise.resolve({boundingBox:e,screenSpaceObjects:[]})}return Promise.reject()}async whenGraphicAttributes(e,t){let n=y(this.view);if(!n)return e;let r=[];for(let t of e)this._isValidVoxelGraphic(t)&&r.push(t);return r.length&&await n.getOtherFieldPopupValues(r,t),e}_isValidVoxelGraphic(e){return e instanceof _}setUsedMemory(e){this._usedMemory=e,this._futureMemory=0}captureFrustum(){y(this.view)?.captureFrustum()}toggleFullVolumeExtentDraw(){y(this.view)?.toggleFullVolumeExtentDraw(this)}getLayerTimes(){return y(this.view)?.getLayerTimes(this)??[]}getCurrentLayerTimeIndex(){return y(this.view)?.getCurrentLayerTimeIndex(this)??0}dropQueryRenderTarget(){y(this.view)?.dropQueryRenderTarget()}_pushRenderModeToWasm(e){let t=y(this.view);this._dbg(2,`VoxelLayerView3D._pushRenderModeToWasm() called, ${t?`have WASM`:`don't have WASM!!!`}`),t?.setRenderMode(this,e)||this._dbg(3,`VoxelLayerView3D._pushRenderModeToWasm() failed!`)}_pushSectionsToWasm(e){let t=y(this.view);this._dbg(2,`VoxelLayerView3D._pushSectionsToWasm() called, ${t?`have WASM`:`don't have WASM!!!`}`),t?.setStaticSections(this,e)||this._dbg(3,`VoxelLayerView3D._pushSectionsToWasm() failed!`)}_pushCurrentVariableIdToWasm(e){let t=y(this.view);this._dbg(2,`VoxelLayerView3D._pushCurrentVariableIdToWasm() called!, ${t?`have WASM`:`don't have WASM!!!`}`),t?.setCurrentVariable(this,e)||this._dbg(3,`VoxelLayerView3D._pushCurrentVariableIdToWasm() failed!`)}_pushVariableStylesToWasm(e){let t=y(this.view);this._dbg(2,`VoxelLayerView3D._pushVariableStylesToWasm() called, ${t?`have WASM`:`don't have WASM!!!`}`),t?.setVariableStyles(this,e)||this._dbg(3,`VoxelLayerView3D._pushVariableStylesToWasm() failed!`)}_accountForEnableSlices(e,t){let n=t??this.layer.enableSlices;for(let t=0;t<e.length;++t){let r=e[t];for(let e of r.slices)e.enabled=e.enabled&&n}}_pushVolumeStylesToWasm(e){let t=y(this.view);this._dbg(2,`VoxelLayerView3D._pushVolumeStylesToWasm() called, ${t?`have WASM`:`don't have WASM!!!`}`),t&&(this._accountForEnableSlices(e,null),t.setVolumeStyles(this,e)||this._dbg(3,`VoxelLayerView3D._pushVolumeStylesToWasm() failed!`))}_pushAnalysisSliceToWasm(e,t){let n=y(this.view);this._dbg(2,`VoxelLayerView3D._pushAnalysisSliceToWasm() called, ${n?`have WASM`:`don't have WASM!!!`}`);let r=!1;if(n){if(t){let i=t.origin;s(E,t.basis1,t.basis2),c(E,E),r=n.setAnalysisSlice(this,e,i,E)}else l(E,0,0,1),r=n.setAnalysisSlice(this,!1,E,E);r||this._dbg(3,`VoxelLayerView3D._pushAnalysisSliceToWasm() failed!`)}}_updateLayerTimeProperties(){let e=y(this.view);this._dbg(2,`VoxelLayerView3D._updateLayerTimeProperties() called, ${e?`have WASM`:`don't have WASM!!!`}`),e&&e.updateLayerTimeProperties(this)}_pushEnableDynamicSectionsToWasm(e){let t=y(this.view);this._dbg(2,`VoxelLayerView3D._pushEnableDynamicSectionsToWasm() called, ${t?`have WASM`:`don't have WASM!!!`}`),t?.setEnableDynamicSections(this,e)||this._dbg(3,`VoxelLayerView3D._pushEnableDynamicSectionsToWasm() failed!`)}_pushEnableSlicesToWasm(e){let t=y(this.view);if(this._dbg(2,`VoxelLayerView3D._pushEnableSlicesToWasm() called, ${t?`have WASM`:`don't have WASM!!!`}`),t){let n=this.layer.getVolumeStyles();this._accountForEnableSlices(n,e),t.setVolumeStyles(this,n)||this._dbg(3,`VoxelLayerView3D._pushEnableSlicesToWasm() failed!`)}}_pushEnableIsosurfacesToWasm(e){let t=y(this.view);this._dbg(2,`VoxelLayerView3D._pushEnableIsosurfacesToWasm() called, ${t?`have WASM`:`don't have WASM!!!`}`),t?.setEnableIsosurfaces(this,e)||this._dbg(3,`VoxelLayerView3D._pushEnableIsosurfacesToWasm() failed!`)}_pushEnableSectionsToWasm(e){let t=y(this.view);this._dbg(2,`VoxelLayerView3D._pushEnableSectionsToWasm() called, ${t?`have WASM`:`don't have WASM!!!`}`),t?.setEnableSections(this,e)||this._dbg(3,`VoxelLayerView3D._pushEnableSectionsToWasm() failed!`)}get baseUrl(){return this.layer.parsedUrl?.path??``}get wasmLayerId(){return this._wasmLayerId}_dbg(e,t){this._dbgFlags.has(e)&&(e===3?n.getLogger(this).error(t):n.getLogger(this).warn(t))}};e([a({readOnly:!0})],O.prototype,`visibleAtCurrentScale`,null),e([a()],O.prototype,`layer`,void 0),e([a()],O.prototype,`baseUrl`,null),e([a({type:Boolean})],O.prototype,`slicePlaneEnabled`,void 0),O=e([o(`esri.views.3d.layers.VoxelLayerView3D`)],O);const k=O;export{k as default};
2
+ import{__decorate as e}from"tslib";import t from"../../../core/Error.js";import n from"../../../core/Logger.js";import{watch as r,initial as i}from"../../../core/reactiveUtils.js";import{property as a,subclass as o}from"../../../core/accessorSupport/decorators.js";import{cross as s,normalize as c,set as l}from"../../../core/libs/gl-matrix-2/math/vec3.js";import{create as u}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import d from"../../../geometry/SpatialReference.js";import{projectVectorToVector as f}from"../../../geometry/projection/projectVectorToVector.js";import{empty as p,expandWithVec3 as m}from"../../../geometry/support/aaBoundingBox.js";import{isInEffectiveScaleRange as h}from"../../../geometry/support/scaleUtils.js";import{equals as g}from"../../../geometry/support/spatialReferenceUtils.js";import{LayerView3D as _}from"./LayerView3D.js";import{VoxelGraphic as v}from"./VoxelGraphic.js";import{addLayerViewToWasm as y,getVoxelWasm as b,removeLayerViewFromWasm as x}from"./VoxelWasm.js";import{LayerViewPerformanceInfo as S}from"./support/LayerViewPerformanceInfo.js";import{PopupSceneLayerView as C}from"./support/PopupSceneLayerView.js";import w from"../../layers/LayerView.js";import{spatialReferenceIncompatibleError as T}from"../../support/layerViewUtils.js";const E=u(),D=u();let O=class extends C(_(w)){constructor(){super(...arguments),this.type=`voxel-3d`,this.ignoresMemoryFactor=!0,this._suspendedHandle=null,this._usedMemory=0,this._futureMemory=0,this.slicePlaneEnabled=!1,this._wasmLayerId=-1,this._dbgFlags=new Set}initialize(){if(this._dbgFlags.add(3),this.view.viewingMode!==`local`)throw new t(`voxel:unsupported-viewingMode`,`Voxel layers support local viewingMode only.`,{});if(!this.view.stage.renderView.renderingContext.capabilities.colorBufferFloat?.textureFloat)throw new t(`voxel:missing-color-buffer-float`,`Voxel layers require the WebGL2 extension EXT_color_buffer_float`,{});let e=this.layer.spatialReference;if(!g(e,this.view.spatialReference))throw T(`voxel layer`,e.wkid,this.view.spatialReference.wkid);let n=this.layer.currentVariableId,a=this.layer.getVolume(n),o=this.layer.getVariable(n);if(a!=null&&o!=null){let e=a.dimensions[0],t=a.dimensions[1],n=a.zDimension;if(n>1){let r=a.dimensions[n],i=e.size*t.size*r.size,s=1;switch(o.renderingFormat.type){case`Int16`:case`UInt16`:s=2;break;case`Int32`:case`UInt32`:case`Float32`:s=4}this._futureMemory=s*i}}let s=y(this).then(e=>{this._wasmLayerId=e,this._suspendedHandle=r(()=>this.suspended,e=>{let t=b(this.view);t&&t.setEnabled(this,!e)},i),this.addHandles([r(()=>this.layer.renderMode,e=>this._pushRenderModeToWasm(e)),r(()=>this.layer.currentVariableId,e=>this._pushCurrentVariableIdToWasm(e)),r(()=>this.layer.getSections(),e=>this._pushSectionsToWasm(e)),r(()=>this.layer.getVariableStyles(),e=>this._pushVariableStylesToWasm(e)),r(()=>this.layer.getVolumeStyles(),e=>this._pushVolumeStylesToWasm(e)),r(()=>this.layer.enableDynamicSections,e=>this._pushEnableDynamicSectionsToWasm(e)),r(()=>this.layer.enableIsosurfaces,e=>this._pushEnableIsosurfacesToWasm(e)),r(()=>this.layer.enableSections,e=>this._pushEnableSectionsToWasm(e)),r(()=>this.layer.enableSlices,e=>this._pushEnableSlicesToWasm(e)),r(()=>[this.layer.timeOffset,this.layer.timeExtent,this.layer.useViewTime],()=>this._updateLayerTimeProperties()),r(()=>this.slicePlaneEnabled,e=>this._pushAnalysisSliceToWasm(e,this.view.slice.plane)),r(()=>this.view.slice.plane,e=>this._pushAnalysisSliceToWasm(this.slicePlaneEnabled,e))])}).catch(e=>{if(x(this),this._wasmLayerId=-1,e===-1)throw new t(`voxel:addLayer-failure`,`The voxel layer description was invalid.`,{});if(e===-2)throw new t(`voxel:addLayer-failure`,`The voxel layer web assembly module failed to download.`,{})});this.addResolvingPromise(s)}destroy(){x(this),this._suspendedHandle&&=(this._suspendedHandle.remove(),null)}isUpdating(){let e=b(this.view);return this._wasmLayerId<0||e==null?!1:e.isUpdating(this._wasmLayerId)}updatingFlagChanged(){this.notifyChange(`updating`)}get usedMemory(){return this._usedMemory}get unloadedMemory(){return this._futureMemory}get performanceInfo(){return new S(this.usedMemory)}get visibleAtCurrentScale(){return h(this.layer.effectiveScaleRange,this.view.scale)}whenGraphicBounds(e,t){let n=e.attributes[`Voxel.WorldPosition`];if(n){let e=p(),t=JSON.parse(n);if(f(t,this.view.renderSpatialReference,D,this.view.spatialReference||d.WGS84))return m(e,D),Promise.resolve({boundingBox:e,screenSpaceObjects:[]})}return Promise.reject()}async whenGraphicAttributes(e,t){let n=b(this.view);if(!n)return e;let r=[];for(let t of e)this._isValidVoxelGraphic(t)&&r.push(t);return r.length&&await n.getOtherFieldPopupValues(r,t),e}_isValidVoxelGraphic(e){return e instanceof v}setUsedMemory(e){this._usedMemory=e,this._futureMemory=0}captureFrustum(){b(this.view)?.captureFrustum()}toggleFullVolumeExtentDraw(){b(this.view)?.toggleFullVolumeExtentDraw(this)}getLayerTimes(){return b(this.view)?.getLayerTimes(this)??[]}getCurrentLayerTimeIndex(){return b(this.view)?.getCurrentLayerTimeIndex(this)??0}dropQueryRenderTarget(){b(this.view)?.dropQueryRenderTarget()}_pushRenderModeToWasm(e){let t=b(this.view);this._dbg(2,`VoxelLayerView3D._pushRenderModeToWasm() called, ${t?`have WASM`:`don't have WASM!!!`}`),t?.setRenderMode(this,e)||this._dbg(3,`VoxelLayerView3D._pushRenderModeToWasm() failed!`)}_pushSectionsToWasm(e){let t=b(this.view);this._dbg(2,`VoxelLayerView3D._pushSectionsToWasm() called, ${t?`have WASM`:`don't have WASM!!!`}`),t?.setStaticSections(this,e)||this._dbg(3,`VoxelLayerView3D._pushSectionsToWasm() failed!`)}_pushCurrentVariableIdToWasm(e){let t=b(this.view);this._dbg(2,`VoxelLayerView3D._pushCurrentVariableIdToWasm() called!, ${t?`have WASM`:`don't have WASM!!!`}`),t?.setCurrentVariable(this,e)||this._dbg(3,`VoxelLayerView3D._pushCurrentVariableIdToWasm() failed!`)}_pushVariableStylesToWasm(e){let t=b(this.view);this._dbg(2,`VoxelLayerView3D._pushVariableStylesToWasm() called, ${t?`have WASM`:`don't have WASM!!!`}`),t?.setVariableStyles(this,e)||this._dbg(3,`VoxelLayerView3D._pushVariableStylesToWasm() failed!`)}_accountForEnableSlices(e,t){let n=t??this.layer.enableSlices;for(let t=0;t<e.length;++t){let r=e[t];for(let e of r.slices)e.enabled=e.enabled&&n}}_pushVolumeStylesToWasm(e){let t=b(this.view);this._dbg(2,`VoxelLayerView3D._pushVolumeStylesToWasm() called, ${t?`have WASM`:`don't have WASM!!!`}`),t&&(this._accountForEnableSlices(e,null),t.setVolumeStyles(this,e)||this._dbg(3,`VoxelLayerView3D._pushVolumeStylesToWasm() failed!`))}_pushAnalysisSliceToWasm(e,t){let n=b(this.view);this._dbg(2,`VoxelLayerView3D._pushAnalysisSliceToWasm() called, ${n?`have WASM`:`don't have WASM!!!`}`);let r=!1;if(n){if(t){let i=t.origin;s(E,t.basis1,t.basis2),c(E,E),r=n.setAnalysisSlice(this,e,i,E)}else l(E,0,0,1),r=n.setAnalysisSlice(this,!1,E,E);r||this._dbg(3,`VoxelLayerView3D._pushAnalysisSliceToWasm() failed!`)}}_updateLayerTimeProperties(){let e=b(this.view);this._dbg(2,`VoxelLayerView3D._updateLayerTimeProperties() called, ${e?`have WASM`:`don't have WASM!!!`}`),e&&e.updateLayerTimeProperties(this)}_pushEnableDynamicSectionsToWasm(e){let t=b(this.view);this._dbg(2,`VoxelLayerView3D._pushEnableDynamicSectionsToWasm() called, ${t?`have WASM`:`don't have WASM!!!`}`),t?.setEnableDynamicSections(this,e)||this._dbg(3,`VoxelLayerView3D._pushEnableDynamicSectionsToWasm() failed!`)}_pushEnableSlicesToWasm(e){let t=b(this.view);if(this._dbg(2,`VoxelLayerView3D._pushEnableSlicesToWasm() called, ${t?`have WASM`:`don't have WASM!!!`}`),t){let n=this.layer.getVolumeStyles();this._accountForEnableSlices(n,e),t.setVolumeStyles(this,n)||this._dbg(3,`VoxelLayerView3D._pushEnableSlicesToWasm() failed!`)}}_pushEnableIsosurfacesToWasm(e){let t=b(this.view);this._dbg(2,`VoxelLayerView3D._pushEnableIsosurfacesToWasm() called, ${t?`have WASM`:`don't have WASM!!!`}`),t?.setEnableIsosurfaces(this,e)||this._dbg(3,`VoxelLayerView3D._pushEnableIsosurfacesToWasm() failed!`)}_pushEnableSectionsToWasm(e){let t=b(this.view);this._dbg(2,`VoxelLayerView3D._pushEnableSectionsToWasm() called, ${t?`have WASM`:`don't have WASM!!!`}`),t?.setEnableSections(this,e)||this._dbg(3,`VoxelLayerView3D._pushEnableSectionsToWasm() failed!`)}get baseUrl(){return this.layer.parsedUrl?.path??``}get wasmLayerId(){return this._wasmLayerId}_dbg(e,t){this._dbgFlags.has(e)&&(e===3?n.getLogger(this).error(t):n.getLogger(this).warn(t))}};e([a({readOnly:!0})],O.prototype,`visibleAtCurrentScale`,null),e([a()],O.prototype,`layer`,void 0),e([a()],O.prototype,`baseUrl`,null),e([a({type:Boolean})],O.prototype,`slicePlaneEnabled`,void 0),O=e([o(`esri.views.3d.layers.VoxelLayerView3D`)],O);const k=O;export{k as default};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import t from"../../../../core/Accessor.js";import n from"../../../../core/Logger.js";import{property as r,subclass as i}from"../../../../core/accessorSupport/decorators.js";import{UpdatingHandles as a}from"../../../../core/support/UpdatingHandles.js";import{projectBoundingRect as o}from"../../../../geometry/projection/projectBoundingRect.js";import{create as s}from"../../../../geometry/support/aaBoundingRect.js";import{scaleBoundsPredicate as c}from"../../../support/layerViewUtils.js";import{TaskPriority as l}from"../../../support/Scheduler.js";import{Yield as u}from"../../../support/Yield.js";let d=class extends t{constructor(e){super(e),this._scaleRangeActive=!1,this._layerScaleRangeVisibilityQuery=!1,this._extent=null,this._updatingHandles=new a,this.graphicsCoreOwner=null,this.layer=null,this.queryGraphicUIDsInExtent=null,this.graphicsCore=null,this.basemapTerrain=null,this.layerScaleEnabled=!0,this.suspended=!1,this._dirty=!0}initialize(){this.updateScaleRangeActive();let e=this.graphicsCoreOwner.view.resourceController.scheduler;this.addHandles(e.registerTask(l.SCALE_VISIBILITY,this)),this._updatingHandles.add(()=>this.layer.effectiveScaleRange,()=>this.layerMinMaxScaleChangeHandler())}destroy(){this._updatingHandles.destroy(),this.removeHandles(),this._dirty=!1,this._extent=null,this.graphicsCoreOwner=null,this.layer=null,this.queryGraphicUIDsInExtent=null,this.graphicsCore=null,this.basemapTerrain=null}get updating(){return this._dirty||this._updatingHandles.updating}_setDirty(){this._dirty=!0}setExtent(e){let t=this.graphicsCoreOwner.view.spatialReference,n=this.graphicsCoreOwner.view.groundView.spatialReference;if(t===n)this._extent=e??null;else{let r=s();this._extent=o(e,t,r,n)?r:null}this._setDirty()}scaleRangeActive(){return this._scaleRangeActive}updateScaleRangeActive(){let e=this.layer,t=e.effectiveScaleRange,n=this.layerScaleEnabled&&t!=null&&f(t.minScale,t.maxScale);e.labelingInfo&&!n&&(n=e.labelingInfo.some(e=>e&&f(e.minScale??0,e.maxScale??0)));let r=this._scaleRangeActive!==n;return this._scaleRangeActive=n,n&&!this.hasHandles(p)&&this.basemapTerrain?(this.addHandles(this.basemapTerrain.on(`scale-change`,e=>this._scaleUpdateHandler(e)),p),this.layerScaleEnabled&&this.addHandles(this.basemapTerrain.on(`tiles-visibility-changed`,()=>this._setDirty()),p)):!n&&this.hasHandles(p)&&this.removeHandles(p),r}get readyToRun(){return!!(this.graphicsCoreOwner.view.basemapTerrain&&this.updating)}runTask(e){let{groundView:t}=this.graphicsCoreOwner.view;if(!this._extent||!t||!t.ready||!this._scaleRangeActive||!this.layerScaleEnabled)this._finishUpdate(!0);else if(this._layerScaleRangeVisibilityQuery)return u;else{this._layerScaleRangeVisibilityQuery=!0;let{minScale:e,maxScale:t}=this.layer.effectiveScaleRange;this.graphicsCoreOwner.view.basemapTerrain.queryVisibleScaleRange(this._extent,e,t,e=>this._finishUpdate(e))}e.madeProgress()}_finishUpdate(e){this._layerScaleRangeVisibilityQuery=!1,this._set(`suspended`,!e),this._dirty=!1}_visibleAtLayerScale(e){let t=this.layer.effectiveScaleRange;return!this.layerScaleEnabled||c(e,t.minScale||0,t.maxScale||0)}_visibleAtLabelScale(e,t){return c(e,t.minScale||0,t.maxScale||0)}_graphicScale(e){let t;return e.centroid==null?e.graphic.geometry!=null&&e.graphic.geometry.type===`point`&&(t=e.graphic.geometry):t=e.centroid,t?this.graphicsCoreOwner.view.basemapTerrain?this.graphicsCoreOwner.view.basemapTerrain.getScale(t):1:null}_graphicVisible(e){if(!this.layerScaleEnabled)return!0;let t=this._graphicScale(e);return this._visibleAtLayerScale(t)}updateVisibility(e){if(!this._scaleRangeActive)return!1;let t=this._graphicVisible(e);return e.setVisibilityFlag(1,2,t)}updateGraphicLabelScaleVisibility(e){if(!this._scaleRangeActive||!e.labelLayers.length)return!1;let t=this._graphicScale(e),n=this._updateLabelScaleVisibility(e,t);return n&&(this.graphicsCore.deconflictor?.setDirty(),this.graphicsCore.labeler?.setDirty()),n}_updateLabelScaleVisibility(e,t){if(!e.labelLayers.length)return!1;let n=e.labelLayers[0].labelClass;if(n?.minScale!=null&&n.maxScale!=null){let r=this._visibleAtLabelScale(t,n);if(e.setVisibilityFlag(16,2,r))return!0}return!1}_scaleUpdateHandler(e){if(this._setDirty(),!this.graphicsCore.visible)return;let t=e.extent,r=e.scale,i=this._visibleAtLayerScale(r),a=!1,s=this.graphicsCoreOwner.view.spatialReference,c=e.spatialReference;if(c==null){n.getLogger(this).error(`scaleUpdate: Internal error, no SpatialReference given for tiles`);return}let l=!c.equals(s);if(l&&!o(t,c,m,s)){n.getLogger(this).error(`scaleUpdate: Internal error, cannot project AABR from `+c+` to wkid `+s);return}let u=l?m:t;this.queryGraphicUIDsInExtent(u,s,e=>{let n=this.graphicsCore.getGraphics3DGraphicById(e);if(n==null)return;let o=n.centroid;o!=null&&(t[0]>o.x||t[1]>o.y||t[2]<o.x||t[3]<o.y)||(n.setVisibilityFlag(1,2,i)&&(a=!0),this._updateLabelScaleVisibility(n,r)&&(a=!0))}),a&&(this.graphicsCore.deconflictor?.setDirty(),this.graphicsCore.labeler?.setDirty())}layerMinMaxScaleChangeHandler(){this.updateScaleRangeActive()&&!this._scaleRangeActive?this.graphicsCore.modifyGraphics3DGraphicVisibilities(e=>e.setVisibilityFlag(1,2,!0)):this._scaleRangeActive&&this.graphicsCore.updateGraphicsVisibilities(),this._setDirty()}};e([r()],d.prototype,`graphicsCoreOwner`,void 0),e([r()],d.prototype,`layer`,void 0),e([r()],d.prototype,`queryGraphicUIDsInExtent`,void 0),e([r()],d.prototype,`graphicsCore`,void 0),e([r()],d.prototype,`basemapTerrain`,void 0),e([r({constructOnly:!0})],d.prototype,`layerScaleEnabled`,void 0),e([r({readOnly:!0})],d.prototype,`suspended`,void 0),e([r({readOnly:!0})],d.prototype,`updating`,null),e([r()],d.prototype,`_dirty`,void 0),d=e([i(`esri.views.3d.layers.graphics.Graphics3DScaleVisibility`)],d);function f(e,t){return e>0||t>0}const p=`terrain-events`,m=s();export{d as Graphics3DScaleVisibility};
2
+ import{__decorate as e}from"tslib";import t from"../../../../core/Accessor.js";import n from"../../../../core/Logger.js";import{property as r,subclass as i}from"../../../../core/accessorSupport/decorators.js";import{UpdatingHandles as a}from"../../../../core/support/UpdatingHandles.js";import{projectBoundingRect as o}from"../../../../geometry/projection/projectBoundingRect.js";import{create as s}from"../../../../geometry/support/aaBoundingRect.js";import{scaleBoundsPredicate as c}from"../../../../geometry/support/scaleUtils.js";import{TaskPriority as l}from"../../../support/Scheduler.js";import{Yield as u}from"../../../support/Yield.js";let d=class extends t{constructor(e){super(e),this._scaleRangeActive=!1,this._layerScaleRangeVisibilityQuery=!1,this._extent=null,this._updatingHandles=new a,this.graphicsCoreOwner=null,this.layer=null,this.queryGraphicUIDsInExtent=null,this.graphicsCore=null,this.basemapTerrain=null,this.layerScaleEnabled=!0,this.suspended=!1,this._dirty=!0}initialize(){this.updateScaleRangeActive();let e=this.graphicsCoreOwner.view.resourceController.scheduler;this.addHandles(e.registerTask(l.SCALE_VISIBILITY,this)),this._updatingHandles.add(()=>this.layer.effectiveScaleRange,()=>this.layerMinMaxScaleChangeHandler())}destroy(){this._updatingHandles.destroy(),this.removeHandles(),this._dirty=!1,this._extent=null,this.graphicsCoreOwner=null,this.layer=null,this.queryGraphicUIDsInExtent=null,this.graphicsCore=null,this.basemapTerrain=null}get updating(){return this._dirty||this._updatingHandles.updating}_setDirty(){this._dirty=!0}setExtent(e){let t=this.graphicsCoreOwner.view.spatialReference,n=this.graphicsCoreOwner.view.groundView.spatialReference;if(t===n)this._extent=e??null;else{let r=s();this._extent=o(e,t,r,n)?r:null}this._setDirty()}scaleRangeActive(){return this._scaleRangeActive}updateScaleRangeActive(){let e=this.layer,t=e.effectiveScaleRange,n=this.layerScaleEnabled&&t!=null&&f(t.minScale,t.maxScale);e.labelingInfo&&!n&&(n=e.labelingInfo.some(e=>e&&f(e.minScale??0,e.maxScale??0)));let r=this._scaleRangeActive!==n;return this._scaleRangeActive=n,n&&!this.hasHandles(p)&&this.basemapTerrain?(this.addHandles(this.basemapTerrain.on(`scale-change`,e=>this._scaleUpdateHandler(e)),p),this.layerScaleEnabled&&this.addHandles(this.basemapTerrain.on(`tiles-visibility-changed`,()=>this._setDirty()),p)):!n&&this.hasHandles(p)&&this.removeHandles(p),r}get readyToRun(){return!!(this.graphicsCoreOwner.view.basemapTerrain&&this.updating)}runTask(e){let{groundView:t}=this.graphicsCoreOwner.view;if(!this._extent||!t||!t.ready||!this._scaleRangeActive||!this.layerScaleEnabled)this._finishUpdate(!0);else if(this._layerScaleRangeVisibilityQuery)return u;else{this._layerScaleRangeVisibilityQuery=!0;let{minScale:e,maxScale:t}=this.layer.effectiveScaleRange;this.graphicsCoreOwner.view.basemapTerrain.queryVisibleScaleRange(this._extent,e,t,e=>this._finishUpdate(e))}e.madeProgress()}_finishUpdate(e){this._layerScaleRangeVisibilityQuery=!1,this._set(`suspended`,!e),this._dirty=!1}_visibleAtLayerScale(e){let t=this.layer.effectiveScaleRange;return!this.layerScaleEnabled||c(e,t.minScale||0,t.maxScale||0)}_visibleAtLabelScale(e,t){return c(e,t.minScale||0,t.maxScale||0)}_graphicScale(e){let t;return e.centroid==null?e.graphic.geometry!=null&&e.graphic.geometry.type===`point`&&(t=e.graphic.geometry):t=e.centroid,t?this.graphicsCoreOwner.view.basemapTerrain?this.graphicsCoreOwner.view.basemapTerrain.getScale(t):1:null}_graphicVisible(e){if(!this.layerScaleEnabled)return!0;let t=this._graphicScale(e);return this._visibleAtLayerScale(t)}updateVisibility(e){if(!this._scaleRangeActive)return!1;let t=this._graphicVisible(e);return e.setVisibilityFlag(1,2,t)}updateGraphicLabelScaleVisibility(e){if(!this._scaleRangeActive||!e.labelLayers.length)return!1;let t=this._graphicScale(e),n=this._updateLabelScaleVisibility(e,t);return n&&(this.graphicsCore.deconflictor?.setDirty(),this.graphicsCore.labeler?.setDirty()),n}_updateLabelScaleVisibility(e,t){if(!e.labelLayers.length)return!1;let n=e.labelLayers[0].labelClass;if(n?.minScale!=null&&n.maxScale!=null){let r=this._visibleAtLabelScale(t,n);if(e.setVisibilityFlag(16,2,r))return!0}return!1}_scaleUpdateHandler(e){if(this._setDirty(),!this.graphicsCore.visible)return;let t=e.extent,r=e.scale,i=this._visibleAtLayerScale(r),a=!1,s=this.graphicsCoreOwner.view.spatialReference,c=e.spatialReference;if(c==null){n.getLogger(this).error(`scaleUpdate: Internal error, no SpatialReference given for tiles`);return}let l=!c.equals(s);if(l&&!o(t,c,m,s)){n.getLogger(this).error(`scaleUpdate: Internal error, cannot project AABR from `+c+` to wkid `+s);return}let u=l?m:t;this.queryGraphicUIDsInExtent(u,s,e=>{let n=this.graphicsCore.getGraphics3DGraphicById(e);if(n==null)return;let o=n.centroid;o!=null&&(t[0]>o.x||t[1]>o.y||t[2]<o.x||t[3]<o.y)||(n.setVisibilityFlag(1,2,i)&&(a=!0),this._updateLabelScaleVisibility(n,r)&&(a=!0))}),a&&(this.graphicsCore.deconflictor?.setDirty(),this.graphicsCore.labeler?.setDirty())}layerMinMaxScaleChangeHandler(){this.updateScaleRangeActive()&&!this._scaleRangeActive?this.graphicsCore.modifyGraphics3DGraphicVisibilities(e=>e.setVisibilityFlag(1,2,!0)):this._scaleRangeActive&&this.graphicsCore.updateGraphicsVisibilities(),this._setDirty()}};e([r()],d.prototype,`graphicsCoreOwner`,void 0),e([r()],d.prototype,`layer`,void 0),e([r()],d.prototype,`queryGraphicUIDsInExtent`,void 0),e([r()],d.prototype,`graphicsCore`,void 0),e([r()],d.prototype,`basemapTerrain`,void 0),e([r({constructOnly:!0})],d.prototype,`layerScaleEnabled`,void 0),e([r({readOnly:!0})],d.prototype,`suspended`,void 0),e([r({readOnly:!0})],d.prototype,`updating`,null),e([r()],d.prototype,`_dirty`,void 0),d=e([i(`esri.views.3d.layers.graphics.Graphics3DScaleVisibility`)],d);function f(e,t){return e>0||t>0}const p=`terrain-events`,m=s();export{d as Graphics3DScaleVisibility};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import t from"../../../../core/Accessor.js";import{forEach as n,result as r}from"../../../../core/asyncUtils.js";import"../../../../core/has.js";import i from"../../../../core/Logger.js";import{disposeMaybe as a,abortMaybe as o}from"../../../../core/maybe.js";import{throwIfAborted as s,isAbortError as c}from"../../../../core/promiseUtils.js";import l from"../../../../core/Queue.js";import{watch as u}from"../../../../core/reactiveUtils.js";import{property as d,subclass as f}from"../../../../core/accessorSupport/decorators.js";import{fromValues as p}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{hydrateGraphic as m}from"../../../../layers/graphics/hydratedFeatures.js";import{createLabelFunction as h}from"../../../../layers/support/labelFormatUtils.js";import{hasCalloutSupport as g}from"../../../../symbols/callouts/calloutUtils.js";import{make as _}from"./Graphics3DCalloutSymbolLayerFactory.js";import{LineCalloutCreationContext as v,LineCalloutSymbolLayerRenderingInfo as y}from"./Graphics3DLineCalloutSymbolLayer.js";import{getGraphics3DSymbol as b}from"./graphicSymbolUtils.js";import{LabelInfo as x}from"./LabelInfo.js";import{LabelParameters as S}from"./LabelParameters.js";import{horizontalPlacementFromAnchor as C,verticalPlacementFromAnchor as w,textRenderAlignmentFromHorizontalPlacement as T}from"./placementUtils.js";import{placePointOnGeometry as E}from"./pointUtils.js";import{TextRenderer as D}from"../../webgl-engine/lib/TextRenderer.js";import{TextRenderParameters as O}from"../../webgl-engine/lib/TextRenderParameters.js";import{TextTextureAtlas as k}from"../../webgl-engine/lib/TextTextureAtlas.js";import{WebGLLayer as A}from"../../webgl-engine/lib/WebGLLayer.js";import{hasLayerBasedScaleVisibility as j,isInEffectiveScaleRange as M}from"../../../support/layerViewUtils.js";import{TaskPriority as N}from"../../../support/Scheduler.js";import{Yield as P}from"../../../support/Yield.js";class F{constructor(e,t){this.labelingContext=e,this.graphics3DGraphic=t,this.hasGraphics3DResources=!1,this.visible=!1,this.textureAtlasHandles=[],this.textInitialized=!1,this.textRenderers=[],this.textLabelPlacements=[]}}class I{constructor(e,t,n,r,i){this.labelClass=e,this.graphics3DSymbol=t,this.graphics3DCalloutSymbolLayer=n,this.textRenderParameters=r,this.labelFunction=i,this.calloutSymbolLayerIndex=0,this.graphics=new Map,this.scaleVisibility=null}}class L{constructor(e,t,n,r,i,a,o,s){this.layer=t,this.graphics3DCore=n,this.scaleVisibility=r,this.emptySymbolLabelSupported=i,this.elevationInfoOverride=a,this.disablePlacement=o,this.active=s,this.labelClassAbortController=new AbortController,this._labelClassContexts=[],this.graphics=new Map,this.labelsToInitialize=new Map,this.stageLayer=new A(e,{pickable:!0},n.owner.layerViewUid)}destroy(){this.stageLayer.destroy()}get labelClassContexts(){return this._labelClassContexts}setLabelClassContext(e,t){this._labelClassContexts[e]=t}resetLabelClassContext(){this._labelClassContexts.length=0}}let R=class extends t{constructor(e){super(e),this._hudMaterials=new Map,this._calloutMaterials=new Map,this._dirty=!1,this._focusAreasLabelsQueue=new l,this._labels=new Map,this._labelingContexts=[]}setup(){this.dispose(),this.addHandles([u(()=>this.view.state?.camera,()=>this.setDirty()),u(()=>this.view.state?.rasterPixelRatio,()=>this._resetAllLabels()),u(()=>this.view.timeZone,()=>this._resetArcadeLabels()),u(()=>this.view.focusAreasView?.polygons,()=>this._updateFocus()),this.view.resourceController.scheduler.registerTask(N.LABELER,this)]),j()&&this.addHandles(u(()=>this.view.scale,()=>this._updateScaleVisibility())),this._textTextureAtlas=new k({view:this.view})}dispose(){this.removeAllHandles(),this._textTextureAtlas=a(this._textTextureAtlas),this._hudMaterials.clear(),this._calloutMaterials.clear(),this._labelingContexts.length=0,this._labels.clear()}destroy(){this.dispose(),G.graphic=null,G.renderingInfo=null,G.layer=null}_updateFocus(){this._focusAreasLabelsQueue.clear(),this._labelingContexts.forEach(e=>{e.graphics.forEach(t=>{this._focusAreasLabelsQueue.push({graphic3DGraphic:t,labelingContext:e})})})}_activateLabelingContext(e){e.graphics.forEach((t,n)=>{let r=new F(e,t);this._labels.set(n,r),e.labelsToInitialize.set(n,r),t.setVisibilityFlag(16,1,!0)}),e.active=!0}_deactivateLabelingContext(e){e.graphics.forEach((e,t)=>{e.setVisibilityFlag(16,1,!1),this.setLabelGraphicVisibility(e,!1),e.clearLabelGraphics(),this._labels.delete(t)}),e.active=!1}_addLabelTextureToAtlas(e){if(this._textTextureAtlas)for(let t of e.graphics3DGraphic.labelLayers){if(!t.labelClass)continue;let n=e.textRenderers[t.labelClassContextIndex];n&&(e.textureAtlasHandles.push(this._textTextureAtlas.addText(n,e=>B(t.stageObject,e))),z(t.stageObject,n))}}_removeLabelTextureFromAtlas(e){e.textureAtlasHandles.forEach(e=>e.remove()),e.textureAtlasHandles.length=0}get readyToRun(){return this.view.ready&&(this._dirty||this.deconflictor.readyToRun||this._focusAreasLabelsQueue.length>0)}runTask(e){return this._updateLabels(e),this._applyFocusAreasUpdates(e),!this._dirty&&this.deconflictor.readyToRun&&this.deconflictor.runTask(e),P}_updateLabels(e){if(this._dirty){this._dirty=!1;for(let t of this._labelingContexts)if(t.active){if(V(t)){this._dirty=!0;continue}if(H(t.labelClassContexts)){if(t.labelClassContexts===null){this._deactivateLabelingContext(t);continue}this._createLabelClassContext(t),this._dirty=!0;continue}for(let[n,r]of t.labelsToInitialize)if(this._ensureGraphics3DResources(r)&&(this._labels.set(n,r),this.deconflictor.setDirty(),e.madeProgress()),(r.visible&&r.textInitialized||!r.visible&&r.hasGraphics3DResources)&&(t.labelsToInitialize.delete(n),e.madeProgress()),e.done){this._dirty=!0;break}}this._dirty||this.notifyChange(`updating`)}}_applyFocusAreasUpdates(e){for(;this._focusAreasLabelsQueue.length>0&&!e.done;){e.madeProgress();let{graphic3DGraphic:t,labelingContext:n}=this._focusAreasLabelsQueue.pop();if(t.labelLayers.length===0||!n.active)continue;let r=E(t.graphic.geometry);if(r==null)continue;let i=this.view.focusAreasView?.containsGeometry(r)??!0;t.labelLayers.forEach(e=>{e.stageObject.geometries.some(e=>e.material.parameters.focusAreaStyle==null!==i)&&(this._removeGraphic(n,t),this._addGraphic(n,t),this.setDirty())})}this._focusAreasLabelsQueue.length===0&&(this.notifyChange(`readyToRun`),this.notifyChange(`updating`))}async _createLabelClassContextAsync(e){let t=e.labelClassAbortController?.signal;e.layer.when&&await e.layer.when(),s(t),e.scaleVisibility?.updateScaleRangeActive();let a=e.graphics3DCore,o=a.layer.labelingInfo?.filter(e=>!!e.symbol);o&&o.length!==0&&(await n(o,async(n,o)=>{let c=n.symbol,l=b(a.getOrCreateGraphics3DSymbol(c));if(l==null){i.getLogger(this).error(`Failed to create Graphics3DSymbol for label`);return}await l.load(),s(t);let u=null;g(c)&&c.hasVisibleCallout()&&(u=_(c,a.symbolCreationContext),await u.load(),s(t));let d=await r(h(n,e.layer.fieldsIndex,this.view.spatialReference));if(s(t),d.ok===!0){let r=await this._createTextRenderParameters(l.symbol);s(t);let i=new I(n,l,u,r,d.value);this._updateLabelClassContextVisibility(i),e.setLabelClassContext(o,i)}else i.getLogger(this).error(`Label expression failed to evaluate: ${d.error}`)}),s(t))}async _createLabelClassContext(e){return e.labelClassPromise??(e.labelClassPromise=this._createLabelClassContextAsync(e).catch(t=>{if(c(t))throw t;e.resetLabelClassContext()}).then(()=>{e.labelClassAbortController=null,this.notifyChange(`updating`)}).catch(()=>{}),this.notifyChange(`updating`)),e.labelClassPromise}async _createTextRenderParameters(e){let t=e.symbolLayers.at(0);return t?.type===`text`?O.fromSymbol(t,this.view.state.rasterPixelRatio):null}_destroyLabelClassContext(e){for(let t of e.labelClassContexts)t&&--t.graphics3DSymbol.referenced;let t=e.labelClassAbortController;e.labelClassAbortController=new AbortController,o(t),e.resetLabelClassContext(),e.labelClassPromise=null,this.notifyChange(`updating`)}_createTextSymbolGraphic(e,t,n,r,i,a){if(!this._textTextureAtlas)return null;let o=new S(n,C(n.anchor),w(n.anchor),e.text,p(e.displayWidth,e.displayHeight));return G.graphic=t,G.layer=r,G.renderingInfo=null,i.createLabel(G,o,this._hudMaterials,this._textTextureAtlas,()=>a.placement?.elevationOffset??null)}_createLineCalloutGraphic(e,t,n,r,i){G.graphic=e,G.layer=i;let a=r.screenOffset[0];return G.renderingInfo=new y(null,t,r.translation,r.centerOffset,r.groundDistance,a,r.centerOffsetUnits,r.elevationOffset),n.createGraphics3DGraphic(G,this._calloutMaterials)}_ensureGraphics3DResources(e){if(e.hasGraphics3DResources)return!1;let t=e.graphics3DGraphic;if(t.destroyed)return!1;this._ensureTextTextureResources(e);let n=e.labelingContext,r=n.labelClassContexts;if(H(r)||!n.emptySymbolLabelSupported&&t.layers.length===0)return!1;let i=!1,a=t.graphic,o=n.layer,s=W(n.layer);for(let c=0;c<r.length;c++){let l=e.textRenderers[c],u=e.textLabelPlacements[c],d=r[c];if(l==null||u==null||d==null)continue;let f=d.graphics3DSymbol,p=U(f),m=f.symbolLayers[0];if(!m)continue;m.setElevationInfoOverride(n.elevationInfoOverride);let h=new x(t,p,d.labelClass),g=this._createTextSymbolGraphic(l,a,u,o,m,h);if(g==null)return!1;g.labelClass=d.labelClass,g.labelClassContextIndex=c,t.addLabelGraphic(g,n.stageLayer),this.deconflictor.setPriority(t,d.textRenderParameters?.definition.size??0),t.setVisibilityFlag(16,1,s),t.setVisibilityFlag(16,2,d.scaleVisibility??!0),t.setVisibilityFlag(16,8,!1),j()&&d.graphics.set(a.uid,t),i=!0;let _=d.graphics3DCalloutSymbolLayer;if(_&&u.hasLabelVerticalOffset){_.setElevationInfoOverride(n.elevationInfoOverride);let e=this._createLineCalloutGraphic(a,p,_,u,o);e!=null&&(d.calloutSymbolLayerIndex=t.labelLayers.length,t.addLabelGraphic(e,n.stageLayer))}break}return i&&n.scaleVisibility?.updateGraphicLabelScaleVisibility(t),e.hasGraphics3DResources=!0,!0}_destroyGraphics3DResources(e){let t=e.labelingContext.labelClassContexts;for(let n of e.graphics3DGraphic.labelLayers)n.labelClass!=null&&t[n.labelClassContextIndex].graphics3DSymbol.symbolLayers[0]?.onRemoveGraphic(n);e.graphics3DGraphic.clearLabelGraphics(),e.hasGraphics3DResources=!1}_ensureTextTextureResources(e){if(e.textInitialized)return;let t=e.labelingContext,n=t.labelClassContexts;if(H(n))return;let r=e.graphics3DGraphic.graphic;for(let i=0;i<n.length;i++){let a=n[i];if(e.textRenderers[i]=null,e.textLabelPlacements[i]=null,a?.textRenderParameters==null)continue;let o=a.labelFunction,s;if(o.type===`arcade`)try{let e=o.needsHydrationToEvaluate()?m(r,t.layer,null):r;s=o.evaluate(e,this.view.timeZone)}catch{s=null}else s=o.evaluate(r);if(s==null||s===``||/^\s+$/.test(s))continue;let c=a.graphics3DSymbol;if(!c.symbolLayers[0])continue;let l=e.graphics3DGraphic,u=c.symbol?.type===`label-3d`?c.symbol:null,d=a.labelClass,f=t.disablePlacement,p=new x(l,u,d,f).placement;if(p==null)continue;let h=C(p.anchor),g=T(h);e.textRenderers[i]=new D(s,g,a.textRenderParameters,k.maxSize),e.textLabelPlacements[i]=p}e.textInitialized=!0}_destroyTextTextureResources(e){e.textInitialized=!1,e.textRenderers.length=0,e.textLabelPlacements.length=0}_addGraphic(e,t){let n=t.graphic.uid;if(e.graphics.set(n,t),e.active){let r=new F(e,t);this._labels.set(n,r),e.labelsToInitialize.set(n,r)}this.setDirty(),this.deconflictor.setDirty()}_updateGraphicGeometry(e,t){let n=t.graphic.uid,r=this._labels.get(n);if(!r)return!0;for(let n of r.graphics3DGraphic.labelLayers)if(n.labelClass!=null&&!e.labelClassContexts[n.labelClassContextIndex].graphics3DSymbol.symbolLayers[0].updateGeometry(t.graphic,n))return!1;return this.setDirty(),this.deconflictor.setDirty(),!0}_removeGraphic(e,t){let n=t.graphic.uid,r=this._labels.get(n);e.graphics.delete(n),e.labelClassContexts.forEach(e=>e?.graphics.delete(n)),r&&(this._destroyGraphic(r,n),e.labelsToInitialize.delete(n),this.setDirty(),this.deconflictor.setDirty())}_destroyGraphic(e,t){this._labels.delete(t),e.textureAtlasHandles.length&&this._removeLabelTextureFromAtlas(e),this._destroyTextTextureResources(e),e.hasGraphics3DResources&&this._destroyGraphics3DResources(e)}async _labelingInfoChange(e,t){if(t){for(let n of t){let t=e.graphics.get(n);t&&(this._removeGraphic(e,t),this._addGraphic(e,t))}return}return this._visibilityInfoChange(e),this._resetLabels(e),this._createLabelClassContext(e)}_globalPropertyChanged(e,t){for(let n of t.labelClassContexts){if(!n)continue;let r=new Map;t.graphics.forEach(e=>r.set(e.graphic.uid,e)),n.graphics3DSymbol.symbolLayers[0].globalPropertyChanged(e,r,e=>e.labelLayers[0]),n.graphics3DCalloutSymbolLayer&&n.graphics3DCalloutSymbolLayer.globalPropertyChanged(e,r,e=>e.labelLayers[n.calloutSymbolLayerIndex])}}_visibilityInfoChange(e){let t=W(e.layer);t&&!e.active&&this._activateLabelingContext(e),!t&&e.active&&this._deactivateLabelingContext(e),this.setDirty()}_resetAllLabels(){for(let e of this._labelingContexts)this._resetLabels(e)}_resetArcadeLabels(){for(let e of this._labelingContexts)e.labelClassContexts.some(e=>e?.labelFunction.type===`arcade`)&&this._resetLabels(e)}_resetLabels(e){e.graphics.forEach((t,n)=>{let r=this._labels.get(n);r&&(this._destroyGraphic(r,n),r.visible=!1,e.labelsToInitialize.set(n,r))}),this._destroyLabelClassContext(e),this.setDirty(),this.deconflictor.setDirty()}_findLabelingContext(e){for(let t of this._labelingContexts)if(t.graphics3DCore===e)return t;return null}addGraphicsOwner(e,t,n){let r=n?.emptySymbolLabelSupported||!1,i=n?.elevationInfoOverride||null,a=n?.disablePlacement||null;if(this._findLabelingContext(e))return;let o=e.layer,s=new L(this.view.stage,o,e,t,r,i,a,W(o));return this._labelingContexts.push(s),this.setDirty(),{addGraphic:e=>this._addGraphic(s,e),removeGraphic:e=>this._removeGraphic(s,e),updateGraphicGeometry:e=>this._updateGraphicGeometry(s,e),layerLabelsEnabled:()=>W(s.layer),labelingInfoChange:e=>this._labelingInfoChange(s,e),elevationInfoChange:()=>this._globalPropertyChanged(`elevationInfo`,s),screenSizePerspectiveEnabledChanged:()=>this._globalPropertyChanged(`screenSizePerspectiveEnabled`,s),slicePlaneEnabledChange:()=>this._globalPropertyChanged(`slicePlaneEnabled`,s),visibilityInfoChange:()=>this._visibilityInfoChange(s),reset:()=>this._resetLabels(s),remove:()=>this._removeGraphicsOwner(e),setDirty:()=>this.setDirty()}}_removeGraphicsOwner(e){let t=this._findLabelingContext(e);if(!t)return;let n=this._labelingContexts.indexOf(t);this._labelingContexts.splice(n,1),t.graphics.forEach(e=>this._removeGraphic(t,e)),t.destroy(),this.setDirty()}_updateScaleVisibility(){for(let e of this._labelingContexts)if(e.active&&!V(e))for(let t of e.labelClassContexts)this._updateLabelClassContextVisibility(t)}_updateLabelClassContextVisibility(e){if(!e||!j())return;let{labelClass:t,graphics:n}=e,r={minScale:t.minScale,maxScale:t.maxScale},i=M(r,this.view.scale),a=e.scaleVisibility==null||e.scaleVisibility!==i;e.scaleVisibility=i,a&&n.size&&(n.forEach(e=>e.setVisibilityFlag(16,2,i)),this.deconflictor.setDirty(),this.setDirty())}setLabelGraphicVisibility(e,t){let n=e.graphic.uid,r=this._labels.get(n);r&&r.visible!==t&&(t&&!r.textureAtlasHandles.length?(this._addLabelTextureToAtlas(r),r.textInitialized||r.labelingContext.labelsToInitialize.set(n,r)):!t&&r.textureAtlasHandles.length&&this._removeLabelTextureFromAtlas(r),r.visible=t,this.setDirty())}setDirty(){!this._dirty&&this._labelingContexts.length>0&&(this._dirty=!0,this.notifyChange(`updating`))}get updating(){return this._dirty||this._textTextureAtlas?.updating||this.deconflictor.updating||this._labelingContexts.some(e=>V(e))||this._focusAreasLabelsQueue.length>0}get updatingProgress(){if(!this.updating||!this._textTextureAtlas)return 1;let e=this._labelingContexts.length>0?this._labelingContexts.reduce((e,t)=>e+ +!V(t),0)/this._labelingContexts.length:1;return(this._dirty?0:.3)+(this._textTextureAtlas.updating?0:.1)+e*.1+this.deconflictor.updatingProgress*.5}get usedMemory(){return this._textTextureAtlas?.usedMemory??0}get test(){}};e([d({constructOnly:!0})],R.prototype,`view`,void 0),e([d({constructOnly:!0})],R.prototype,`deconflictor`,void 0),e([d()],R.prototype,`_textTextureAtlas`,void 0),e([d({type:Boolean,readOnly:!0})],R.prototype,`updating`,null),R=e([f(`esri.views.3d.layers.graphics.Labeler`)],R);function z(e,t){e.geometries[0].setAttributeData(`size`,[t.displayWidth,t.displayHeight]),e.geometryVertexAttributeUpdated(e.geometries[0],`size`)}function B(e,t){e.geometries[0].setAttributeData(`uvi`,t),e.geometryVertexAttributeUpdated(e.geometries[0],`uvi`,!0)}function V(e){return!!e.labelClassPromise&&!!e.labelClassAbortController}function H(e){return(e?.length??0)===0}function U(e){return e.symbol?.type===`label-3d`?e.symbol:null}function W(e){return!!e.labelsVisible&&!!e.labelingInfo?.some(e=>!!e.symbol)}const G=new v(null,null,null);export{R as Labeler,W as areLabelsVisible};
2
+ import{__decorate as e}from"tslib";import t from"../../../../core/Accessor.js";import{forEach as n,result as r}from"../../../../core/asyncUtils.js";import"../../../../core/has.js";import i from"../../../../core/Logger.js";import{disposeMaybe as a,abortMaybe as o}from"../../../../core/maybe.js";import{throwIfAborted as s,isAbortError as c}from"../../../../core/promiseUtils.js";import l from"../../../../core/Queue.js";import{watch as u}from"../../../../core/reactiveUtils.js";import{property as d,subclass as f}from"../../../../core/accessorSupport/decorators.js";import{fromValues as p}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{isInEffectiveScaleRange as m}from"../../../../geometry/support/scaleUtils.js";import{hydrateGraphic as h}from"../../../../layers/graphics/hydratedFeatures.js";import{createLabelFunction as g}from"../../../../layers/support/labelFormatUtils.js";import{hasCalloutSupport as _}from"../../../../symbols/callouts/calloutUtils.js";import{make as v}from"./Graphics3DCalloutSymbolLayerFactory.js";import{LineCalloutCreationContext as y,LineCalloutSymbolLayerRenderingInfo as b}from"./Graphics3DLineCalloutSymbolLayer.js";import{getGraphics3DSymbol as x}from"./graphicSymbolUtils.js";import{LabelInfo as S}from"./LabelInfo.js";import{LabelParameters as C}from"./LabelParameters.js";import{horizontalPlacementFromAnchor as w,verticalPlacementFromAnchor as T,textRenderAlignmentFromHorizontalPlacement as E}from"./placementUtils.js";import{placePointOnGeometry as D}from"./pointUtils.js";import{TextRenderer as O}from"../../webgl-engine/lib/TextRenderer.js";import{TextRenderParameters as k}from"../../webgl-engine/lib/TextRenderParameters.js";import{TextTextureAtlas as A}from"../../webgl-engine/lib/TextTextureAtlas.js";import{WebGLLayer as j}from"../../webgl-engine/lib/WebGLLayer.js";import{hasLayerBasedScaleVisibility as M}from"../../../support/layerViewUtils.js";import{TaskPriority as N}from"../../../support/Scheduler.js";import{Yield as P}from"../../../support/Yield.js";class F{constructor(e,t){this.labelingContext=e,this.graphics3DGraphic=t,this.hasGraphics3DResources=!1,this.visible=!1,this.textureAtlasHandles=[],this.textInitialized=!1,this.textRenderers=[],this.textLabelPlacements=[]}}class I{constructor(e,t,n,r,i){this.labelClass=e,this.graphics3DSymbol=t,this.graphics3DCalloutSymbolLayer=n,this.textRenderParameters=r,this.labelFunction=i,this.calloutSymbolLayerIndex=0,this.graphics=new Map,this.scaleVisibility=null}}class L{constructor(e,t,n,r,i,a,o,s){this.layer=t,this.graphics3DCore=n,this.scaleVisibility=r,this.emptySymbolLabelSupported=i,this.elevationInfoOverride=a,this.disablePlacement=o,this.active=s,this.labelClassAbortController=new AbortController,this._labelClassContexts=[],this.graphics=new Map,this.labelsToInitialize=new Map,this.stageLayer=new j(e,{pickable:!0},n.owner.layerViewUid)}destroy(){this.stageLayer.destroy()}get labelClassContexts(){return this._labelClassContexts}setLabelClassContext(e,t){this._labelClassContexts[e]=t}resetLabelClassContext(){this._labelClassContexts.length=0}}let R=class extends t{constructor(e){super(e),this._hudMaterials=new Map,this._calloutMaterials=new Map,this._dirty=!1,this._focusAreasLabelsQueue=new l,this._labels=new Map,this._labelingContexts=[]}setup(){this.dispose(),this.addHandles([u(()=>this.view.state?.camera,()=>this.setDirty()),u(()=>this.view.state?.rasterPixelRatio,()=>this._resetAllLabels()),u(()=>this.view.timeZone,()=>this._resetArcadeLabels()),u(()=>this.view.focusAreasView?.polygons,()=>this._updateFocus()),this.view.resourceController.scheduler.registerTask(N.LABELER,this)]),M()&&this.addHandles(u(()=>this.view.scale,()=>this._updateScaleVisibility())),this._textTextureAtlas=new A({view:this.view})}dispose(){this.removeAllHandles(),this._textTextureAtlas=a(this._textTextureAtlas),this._hudMaterials.clear(),this._calloutMaterials.clear(),this._labelingContexts.length=0,this._labels.clear()}destroy(){this.dispose(),G.graphic=null,G.renderingInfo=null,G.layer=null}_updateFocus(){this._focusAreasLabelsQueue.clear(),this._labelingContexts.forEach(e=>{e.graphics.forEach(t=>{this._focusAreasLabelsQueue.push({graphic3DGraphic:t,labelingContext:e})})})}_activateLabelingContext(e){e.graphics.forEach((t,n)=>{let r=new F(e,t);this._labels.set(n,r),e.labelsToInitialize.set(n,r),t.setVisibilityFlag(16,1,!0)}),e.active=!0}_deactivateLabelingContext(e){e.graphics.forEach((e,t)=>{e.setVisibilityFlag(16,1,!1),this.setLabelGraphicVisibility(e,!1),e.clearLabelGraphics(),this._labels.delete(t)}),e.active=!1}_addLabelTextureToAtlas(e){if(this._textTextureAtlas)for(let t of e.graphics3DGraphic.labelLayers){if(!t.labelClass)continue;let n=e.textRenderers[t.labelClassContextIndex];n&&(e.textureAtlasHandles.push(this._textTextureAtlas.addText(n,e=>B(t.stageObject,e))),z(t.stageObject,n))}}_removeLabelTextureFromAtlas(e){e.textureAtlasHandles.forEach(e=>e.remove()),e.textureAtlasHandles.length=0}get readyToRun(){return this.view.ready&&(this._dirty||this.deconflictor.readyToRun||this._focusAreasLabelsQueue.length>0)}runTask(e){return this._updateLabels(e),this._applyFocusAreasUpdates(e),!this._dirty&&this.deconflictor.readyToRun&&this.deconflictor.runTask(e),P}_updateLabels(e){if(this._dirty){this._dirty=!1;for(let t of this._labelingContexts)if(t.active){if(V(t)){this._dirty=!0;continue}if(H(t.labelClassContexts)){if(t.labelClassContexts===null){this._deactivateLabelingContext(t);continue}this._createLabelClassContext(t),this._dirty=!0;continue}for(let[n,r]of t.labelsToInitialize)if(this._ensureGraphics3DResources(r)&&(this._labels.set(n,r),this.deconflictor.setDirty(),e.madeProgress()),(r.visible&&r.textInitialized||!r.visible&&r.hasGraphics3DResources)&&(t.labelsToInitialize.delete(n),e.madeProgress()),e.done){this._dirty=!0;break}}this._dirty||this.notifyChange(`updating`)}}_applyFocusAreasUpdates(e){for(;this._focusAreasLabelsQueue.length>0&&!e.done;){e.madeProgress();let{graphic3DGraphic:t,labelingContext:n}=this._focusAreasLabelsQueue.pop();if(t.labelLayers.length===0||!n.active)continue;let r=D(t.graphic.geometry);if(r==null)continue;let i=this.view.focusAreasView?.containsGeometry(r)??!0;t.labelLayers.forEach(e=>{e.stageObject.geometries.some(e=>e.material.parameters.focusAreaStyle==null!==i)&&(this._removeGraphic(n,t),this._addGraphic(n,t),this.setDirty())})}this._focusAreasLabelsQueue.length===0&&(this.notifyChange(`readyToRun`),this.notifyChange(`updating`))}async _createLabelClassContextAsync(e){let t=e.labelClassAbortController?.signal;e.layer.when&&await e.layer.when(),s(t),e.scaleVisibility?.updateScaleRangeActive();let a=e.graphics3DCore,o=a.layer.labelingInfo?.filter(e=>!!e.symbol);o&&o.length!==0&&(await n(o,async(n,o)=>{let c=n.symbol,l=x(a.getOrCreateGraphics3DSymbol(c));if(l==null){i.getLogger(this).error(`Failed to create Graphics3DSymbol for label`);return}await l.load(),s(t);let u=null;_(c)&&c.hasVisibleCallout()&&(u=v(c,a.symbolCreationContext),await u.load(),s(t));let d=await r(g(n,e.layer.fieldsIndex,this.view.spatialReference));if(s(t),d.ok===!0){let r=await this._createTextRenderParameters(l.symbol);s(t);let i=new I(n,l,u,r,d.value);this._updateLabelClassContextVisibility(i),e.setLabelClassContext(o,i)}else i.getLogger(this).error(`Label expression failed to evaluate: ${d.error}`)}),s(t))}async _createLabelClassContext(e){return e.labelClassPromise??(e.labelClassPromise=this._createLabelClassContextAsync(e).catch(t=>{if(c(t))throw t;e.resetLabelClassContext()}).then(()=>{e.labelClassAbortController=null,this.notifyChange(`updating`)}).catch(()=>{}),this.notifyChange(`updating`)),e.labelClassPromise}async _createTextRenderParameters(e){let t=e.symbolLayers.at(0);return t?.type===`text`?k.fromSymbol(t,this.view.state.rasterPixelRatio):null}_destroyLabelClassContext(e){for(let t of e.labelClassContexts)t&&--t.graphics3DSymbol.referenced;let t=e.labelClassAbortController;e.labelClassAbortController=new AbortController,o(t),e.resetLabelClassContext(),e.labelClassPromise=null,this.notifyChange(`updating`)}_createTextSymbolGraphic(e,t,n,r,i,a){if(!this._textTextureAtlas)return null;let o=new C(n,w(n.anchor),T(n.anchor),e.text,p(e.displayWidth,e.displayHeight));return G.graphic=t,G.layer=r,G.renderingInfo=null,i.createLabel(G,o,this._hudMaterials,this._textTextureAtlas,()=>a.placement?.elevationOffset??null)}_createLineCalloutGraphic(e,t,n,r,i){G.graphic=e,G.layer=i;let a=r.screenOffset[0];return G.renderingInfo=new b(null,t,r.translation,r.centerOffset,r.groundDistance,a,r.centerOffsetUnits,r.elevationOffset),n.createGraphics3DGraphic(G,this._calloutMaterials)}_ensureGraphics3DResources(e){if(e.hasGraphics3DResources)return!1;let t=e.graphics3DGraphic;if(t.destroyed)return!1;this._ensureTextTextureResources(e);let n=e.labelingContext,r=n.labelClassContexts;if(H(r)||!n.emptySymbolLabelSupported&&t.layers.length===0)return!1;let i=!1,a=t.graphic,o=n.layer,s=W(n.layer);for(let c=0;c<r.length;c++){let l=e.textRenderers[c],u=e.textLabelPlacements[c],d=r[c];if(l==null||u==null||d==null)continue;let f=d.graphics3DSymbol,p=U(f),m=f.symbolLayers[0];if(!m)continue;m.setElevationInfoOverride(n.elevationInfoOverride);let h=new S(t,p,d.labelClass),g=this._createTextSymbolGraphic(l,a,u,o,m,h);if(g==null)return!1;g.labelClass=d.labelClass,g.labelClassContextIndex=c,t.addLabelGraphic(g,n.stageLayer),this.deconflictor.setPriority(t,d.textRenderParameters?.definition.size??0),t.setVisibilityFlag(16,1,s),t.setVisibilityFlag(16,2,d.scaleVisibility??!0),t.setVisibilityFlag(16,8,!1),M()&&d.graphics.set(a.uid,t),i=!0;let _=d.graphics3DCalloutSymbolLayer;if(_&&u.hasLabelVerticalOffset){_.setElevationInfoOverride(n.elevationInfoOverride);let e=this._createLineCalloutGraphic(a,p,_,u,o);e!=null&&(d.calloutSymbolLayerIndex=t.labelLayers.length,t.addLabelGraphic(e,n.stageLayer))}break}return i&&n.scaleVisibility?.updateGraphicLabelScaleVisibility(t),e.hasGraphics3DResources=!0,!0}_destroyGraphics3DResources(e){let t=e.labelingContext.labelClassContexts;for(let n of e.graphics3DGraphic.labelLayers)n.labelClass!=null&&t[n.labelClassContextIndex].graphics3DSymbol.symbolLayers[0]?.onRemoveGraphic(n);e.graphics3DGraphic.clearLabelGraphics(),e.hasGraphics3DResources=!1}_ensureTextTextureResources(e){if(e.textInitialized)return;let t=e.labelingContext,n=t.labelClassContexts;if(H(n))return;let r=e.graphics3DGraphic.graphic;for(let i=0;i<n.length;i++){let a=n[i];if(e.textRenderers[i]=null,e.textLabelPlacements[i]=null,a?.textRenderParameters==null)continue;let o=a.labelFunction,s;if(o.type===`arcade`)try{let e=o.needsHydrationToEvaluate()?h(r,t.layer,null):r;s=o.evaluate(e,this.view.timeZone)}catch{s=null}else s=o.evaluate(r);if(s==null||s===``||/^\s+$/.test(s))continue;let c=a.graphics3DSymbol;if(!c.symbolLayers[0])continue;let l=e.graphics3DGraphic,u=c.symbol?.type===`label-3d`?c.symbol:null,d=a.labelClass,f=t.disablePlacement,p=new S(l,u,d,f).placement;if(p==null)continue;let m=w(p.anchor),g=E(m);e.textRenderers[i]=new O(s,g,a.textRenderParameters,A.maxSize),e.textLabelPlacements[i]=p}e.textInitialized=!0}_destroyTextTextureResources(e){e.textInitialized=!1,e.textRenderers.length=0,e.textLabelPlacements.length=0}_addGraphic(e,t){let n=t.graphic.uid;if(e.graphics.set(n,t),e.active){let r=new F(e,t);this._labels.set(n,r),e.labelsToInitialize.set(n,r)}this.setDirty(),this.deconflictor.setDirty()}_updateGraphicGeometry(e,t){let n=t.graphic.uid,r=this._labels.get(n);if(!r)return!0;for(let n of r.graphics3DGraphic.labelLayers)if(n.labelClass!=null&&!e.labelClassContexts[n.labelClassContextIndex].graphics3DSymbol.symbolLayers[0].updateGeometry(t.graphic,n))return!1;return this.setDirty(),this.deconflictor.setDirty(),!0}_removeGraphic(e,t){let n=t.graphic.uid,r=this._labels.get(n);e.graphics.delete(n),e.labelClassContexts.forEach(e=>e?.graphics.delete(n)),r&&(this._destroyGraphic(r,n),e.labelsToInitialize.delete(n),this.setDirty(),this.deconflictor.setDirty())}_destroyGraphic(e,t){this._labels.delete(t),e.textureAtlasHandles.length&&this._removeLabelTextureFromAtlas(e),this._destroyTextTextureResources(e),e.hasGraphics3DResources&&this._destroyGraphics3DResources(e)}async _labelingInfoChange(e,t){if(t){for(let n of t){let t=e.graphics.get(n);t&&(this._removeGraphic(e,t),this._addGraphic(e,t))}return}return this._visibilityInfoChange(e),this._resetLabels(e),this._createLabelClassContext(e)}_globalPropertyChanged(e,t){for(let n of t.labelClassContexts){if(!n)continue;let r=new Map;t.graphics.forEach(e=>r.set(e.graphic.uid,e)),n.graphics3DSymbol.symbolLayers[0].globalPropertyChanged(e,r,e=>e.labelLayers[0]),n.graphics3DCalloutSymbolLayer&&n.graphics3DCalloutSymbolLayer.globalPropertyChanged(e,r,e=>e.labelLayers[n.calloutSymbolLayerIndex])}}_visibilityInfoChange(e){let t=W(e.layer);t&&!e.active&&this._activateLabelingContext(e),!t&&e.active&&this._deactivateLabelingContext(e),this.setDirty()}_resetAllLabels(){for(let e of this._labelingContexts)this._resetLabels(e)}_resetArcadeLabels(){for(let e of this._labelingContexts)e.labelClassContexts.some(e=>e?.labelFunction.type===`arcade`)&&this._resetLabels(e)}_resetLabels(e){e.graphics.forEach((t,n)=>{let r=this._labels.get(n);r&&(this._destroyGraphic(r,n),r.visible=!1,e.labelsToInitialize.set(n,r))}),this._destroyLabelClassContext(e),this.setDirty(),this.deconflictor.setDirty()}_findLabelingContext(e){for(let t of this._labelingContexts)if(t.graphics3DCore===e)return t;return null}addGraphicsOwner(e,t,n){let r=n?.emptySymbolLabelSupported||!1,i=n?.elevationInfoOverride||null,a=n?.disablePlacement||null;if(this._findLabelingContext(e))return;let o=e.layer,s=new L(this.view.stage,o,e,t,r,i,a,W(o));return this._labelingContexts.push(s),this.setDirty(),{addGraphic:e=>this._addGraphic(s,e),removeGraphic:e=>this._removeGraphic(s,e),updateGraphicGeometry:e=>this._updateGraphicGeometry(s,e),layerLabelsEnabled:()=>W(s.layer),labelingInfoChange:e=>this._labelingInfoChange(s,e),elevationInfoChange:()=>this._globalPropertyChanged(`elevationInfo`,s),screenSizePerspectiveEnabledChanged:()=>this._globalPropertyChanged(`screenSizePerspectiveEnabled`,s),slicePlaneEnabledChange:()=>this._globalPropertyChanged(`slicePlaneEnabled`,s),visibilityInfoChange:()=>this._visibilityInfoChange(s),reset:()=>this._resetLabels(s),remove:()=>this._removeGraphicsOwner(e),setDirty:()=>this.setDirty()}}_removeGraphicsOwner(e){let t=this._findLabelingContext(e);if(!t)return;let n=this._labelingContexts.indexOf(t);this._labelingContexts.splice(n,1),t.graphics.forEach(e=>this._removeGraphic(t,e)),t.destroy(),this.setDirty()}_updateScaleVisibility(){for(let e of this._labelingContexts)if(e.active&&!V(e))for(let t of e.labelClassContexts)this._updateLabelClassContextVisibility(t)}_updateLabelClassContextVisibility(e){if(!e||!M())return;let{labelClass:t,graphics:n}=e,r={minScale:t.minScale,maxScale:t.maxScale},i=m(r,this.view.scale),a=e.scaleVisibility==null||e.scaleVisibility!==i;e.scaleVisibility=i,a&&n.size&&(n.forEach(e=>e.setVisibilityFlag(16,2,i)),this.deconflictor.setDirty(),this.setDirty())}setLabelGraphicVisibility(e,t){let n=e.graphic.uid,r=this._labels.get(n);r&&r.visible!==t&&(t&&!r.textureAtlasHandles.length?(this._addLabelTextureToAtlas(r),r.textInitialized||r.labelingContext.labelsToInitialize.set(n,r)):!t&&r.textureAtlasHandles.length&&this._removeLabelTextureFromAtlas(r),r.visible=t,this.setDirty())}setDirty(){!this._dirty&&this._labelingContexts.length>0&&(this._dirty=!0,this.notifyChange(`updating`))}get updating(){return this._dirty||this._textTextureAtlas?.updating||this.deconflictor.updating||this._labelingContexts.some(e=>V(e))||this._focusAreasLabelsQueue.length>0}get updatingProgress(){if(!this.updating||!this._textTextureAtlas)return 1;let e=this._labelingContexts.length>0?this._labelingContexts.reduce((e,t)=>e+ +!V(t),0)/this._labelingContexts.length:1;return(this._dirty?0:.3)+(this._textTextureAtlas.updating?0:.1)+e*.1+this.deconflictor.updatingProgress*.5}get usedMemory(){return this._textTextureAtlas?.usedMemory??0}get test(){}};e([d({constructOnly:!0})],R.prototype,`view`,void 0),e([d({constructOnly:!0})],R.prototype,`deconflictor`,void 0),e([d()],R.prototype,`_textTextureAtlas`,void 0),e([d({type:Boolean,readOnly:!0})],R.prototype,`updating`,null),R=e([f(`esri.views.3d.layers.graphics.Labeler`)],R);function z(e,t){e.geometries[0].setAttributeData(`size`,[t.displayWidth,t.displayHeight]),e.geometryVertexAttributeUpdated(e.geometries[0],`size`)}function B(e,t){e.geometries[0].setAttributeData(`uvi`,t),e.geometryVertexAttributeUpdated(e.geometries[0],`uvi`,!0)}function V(e){return!!e.labelClassPromise&&!!e.labelClassAbortController}function H(e){return(e?.length??0)===0}function U(e){return e.symbol?.type===`label-3d`?e.symbol:null}function W(e){return!!e.labelsVisible&&!!e.labelingInfo?.some(e=>!!e.symbol)}const G=new y(null,null,null);export{R as Labeler,W as areLabelsVisible};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import{isSome as t}from"../../../../core/arrayUtils.js";import{makeHandle as n}from"../../../../core/handleUtils.js";import"../../../../core/has.js";import r from"../../../../core/Logger.js";import{estimateFixedArrayMemory as i,estimateNumberMemory as a,estimateAttributesMemory as o}from"../../../../core/memoryEstimations.js";import{EsriPromise as s}from"../../../../core/Promise.js";import{initial as c,sync as l,watch as u}from"../../../../core/reactiveUtils.js";import{pt2px as d}from"../../../../core/screenUtils.js";import{property as f,subclass as p}from"../../../../core/accessorSupport/decorators.js";import{create as m}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{UpdatingHandles as h}from"../../../../core/support/UpdatingHandles.js";import{projectPointToVector as g}from"../../../../geometry/projection/projectPointToVector.js";import{getContinuousIndexArray as _}from"../../../../geometry/support/Indices.js";import{getResolutionForScale as v}from"../../../../geometry/support/scaleUtils.js";import{getObjectId as y}from"../../../../layers/graphics/dehydratedFeatures.js";import{convertFromPoint as b}from"../../../../layers/graphics/featureConversionUtils.js";import{OptimizedFeature as x}from"../../../../layers/graphics/OptimizedFeature.js";import S from"../../../../layers/graphics/data/FeatureStore.js";import{isNumericField as C}from"../../../../layers/support/fieldUtils.js";import{generateGradient as w}from"../../../../renderers/support/heatmapUtils.js";import{DisplayFeatureLimit as T}from"../graphics/DisplayFeatureLimit.js";import{GraphicsCorePerformanceInfo as E}from"../graphics/GraphicsCorePerformanceInfo.js";import{FeatureVisibilityFilter as D}from"./FeatureVisibilityFilter.js";import{emptyHighlightHandle as O}from"./highlightUtils.js";import{Attribute as k}from"../../webgl-engine/lib/Attribute.js";import{DrapedHeatmapRenderer as A}from"../../webgl-engine/lib/DrapedHeatmapRenderer.js";import{Geometry as j}from"../../webgl-engine/lib/Geometry.js";import{GeometryBaseInstance as M}from"../../webgl-engine/lib/GeometryBaseInstance.js";import{RenderGeometry as N}from"../../webgl-engine/lib/RenderGeometry.js";import{HeatmapDensityMaterial as P}from"../../webgl-engine/materials/HeatmapDensityMaterial.js";import{scaleBoundsPredicate as F,isScaleRangeActive as I}from"../../../support/layerViewUtils.js";import{PixelType as L}from"../../../webgl/enums.js";import{loadHeatmapTextureConfiguration as R,fallBackHeatmapConfiguration as z}from"../../../webgl/heatmapTextureUtils.js";const B=112;let V=class extends s{constructor(e){super(e),this.type=`heatmap`,this.preferredUpdatePolicy=0,this.dataExtent=null,this.drapeSourceType=1,this._renderGeometries=new Map,this._fieldTotal=0,this._drapeSourceRenderer=null,this._dataType=L.HALF_FLOAT,this._pixelFormat=6408,this._baseInstance=new M([]),this._updatingHandles=new h}initialize(){let e;try{e=R(this._renderView.renderingContext,r.getLogger(this))}catch(t){this.addResolvingPromise(Promise.reject(t)),e=z}let{dataType:t,samplingMode:i,pixelFormat:a,internalFormat:o}=e;this._featureStore=new S({geometryType:`esriGeometryPoint`,hasZ:this.hasZ,hasM:this.hasM}),this._dataType=t,this._pixelFormat=a;let s=t!==L.FLOAT,d=this.view.overlayManager,f={...this._rendererParameters,stage:this.view.stage,dataType:t,samplingMode:i,pixelFormat:a,internalFormat:o,rendererContext:d.renderer,drapeSource:this};this._drapeSourceRenderer=new A(f),d.registerDrapeSource(this,this._drapeSourceRenderer),this._material=new P({usesHalfFloats:s}),this._materialWithField=new P({usesHalfFloats:s,isAttributeDriven:!0}),this._filterVisibility=new D({context:{configuration:this.owner,featureStore:this.featureStore,getFeatureCount:()=>this._loadedPointGraphics.length,setAllFeaturesVisibility:e=>this._setAllFeaturesVisibility(e),clearFeaturesVisibility:()=>this._setAllFeaturesVisibility(!0),updateFeatureVisibilities:e=>this._updateFeatureVisibilities(e)}}),this._updatingHandles.addOnCollectionChange(()=>this._loadedPointGraphics,e=>this._onLoadedFeaturesChange(e),c),this._updatingHandles.addWhen(()=>this._materialParameters,e=>this._forEachMaterial(t=>t.setParameters(e)),c),this._updatingHandles.add(()=>this._rendererParameters,e=>this._drapeSourceRenderer.set(e)),this._updatingHandles.add(()=>this._heatmapRendererField,()=>{this._recreate()},l),this._updatingHandles.add(()=>({fieldName:this._heatmapRendererFieldName,numeric:this._heatmapRendererFieldIsNumeric}),({fieldName:e,numeric:t})=>{if(e!=null&&t){let t=0;this._featureStore.forEach(n=>t+=n.attributes[e]??0),this._fieldTotal=t}else this._fieldTotal=this._featureStore.numFeatures},c),this.addHandles([u(()=>({fieldName:this._heatmapRendererFieldName,field:this._heatmapRendererField}),({fieldName:e,field:t})=>{e&&!t&&r.getLogger(this).warn(`Heatmap renderer field '${e}' for layer '${this.layer.title??this.layer.id}' not found`)}),u(()=>({field:this._heatmapRendererField,numeric:this._heatmapRendererFieldIsNumeric}),({field:e,numeric:t})=>{e!=null&&!t&&r.getLogger(this).warn(`Heatmap renderer field '${e.name}' for layer '${this.layer.title??this.layer.id}' does not contain numeric values and cannot be used to drive the heatmap density`)}),n(()=>this.view.overlayManager.unregisterDrapeSource(this))])}destroy(){this._renderGeometries.clear(),this._material=null,this._materialWithField=null,this._featureStore.clear(),this._featureStore=null,this._updatingHandles.destroy(),this._baseInstance=null}get layer(){return this.owner.layer}get featureStore(){return this._featureStore}get updating(){return this._updatingHandles.updating||this.filterVisibility.updating}get updatingRemaining(){return 0}get suspendInfo(){return{}}get legendEnabled(){return!0}get filterVisibility(){return this._filterVisibility}get displayFeatureLimit(){let e=this.owner?.view?.quality??1,t=this.owner?.view?.qualitySettings,n=t?Math.ceil(t.graphics3D.maxTotalNumberOfFeatures*e):0,r=n*6;return new T(r,n)}get hasZ(){return`hasZ`in this.layer&&this.layer.hasZ===!0}get hasM(){return`hasM`in this.layer&&this.layer.hasM}get view(){return this.owner.view}get fullOpacity(){return this.owner.fullOpacity}get updatePolicy(){return this.owner.updatePolicy}get scaleVisibilitySuspended(){if(!this._isScaleRangeActive)return!1;let{minScale:e,maxScale:t}=this.layer.effectiveScaleRange,{scale:n}=this.view;return!F(n,e??0,t??0)}get usedMemory(){let e=this.usedMemoryPerFeature*this._featureStore.numFeatures,t=this._pixelFormat===6403?1:4,n=this._dataType===L.FLOAT?4:2,r=Math.ceil((this._overlayRenderer?.overlays[0]?.resolution??0)*this._densityMapPixelRatio)??0;return r*r*t*n+e+H}get usedMemoryPerFeature(){let e=this._loadedPointGraphics.find(()=>!0);if(e==null)return 0;let t=o(e);return i([0,0],a)+(this._heatmapRendererFieldIsNumeric?a:0)+t}get loadedFeatures(){return this._featureStore.numFeatures}get unprocessedMemoryEstimate(){return 0}get performanceInfo(){return new E(this._renderGeometries.size,this._visibleFeatures,0,0)}get renderer(){return this._heatmapRenderer}get _overlayRenderer(){return this.view.overlayManager.renderer}get _overlaySpatialReference(){return this.view.overlayManager.spatialReference}get _rendererParameters(){return{...this._radiusParameter,...this._densityParameters,...this._colorRampParameter,...this._pixelRatioParameter}}get _materialParameters(){return{...this._radiusParameter,...this._resolutionForScaleParameter}}get _densityParameters(){let e=this._heatmapRenderer;if(e==null)return null;let{minDensity:t,maxDensity:n}=e;return{minDensity:t,maxDensity:n,fieldTotal:this._fieldTotal}}get _radiusParameter(){let e=this._heatmapRenderer;return e?{searchRadius:d(this._clampSearchRadius(e.radius))}:null}get _resolutionForScaleParameter(){let e=this._heatmapRenderer;if(!e)return null;let{referenceScale:t}=e;return{resolutionForScale:t===0?0:v(t,this.view.spatialReference)}}get _colorRampParameter(){let e=this._heatmapRenderer;return e?{colorRampData:w(e.colorStops)}:null}get _pixelRatioParameter(){return{pixelRatio:this._densityMapPixelRatio}}get _densityMapPixelRatio(){return this.owner?.view?.qualitySettings.heatmap.pixelRatio??1}get _renderView(){return this.view.stage.renderView}get _featuresArePoints(){return this.layer.geometryType===`point`}get _loadedPointGraphics(){return this.owner.loadedGraphics}get _heatmapRenderer(){let e=this.layer.renderer;return e?.type===`heatmap`?e:null}get _heatmapRendererFieldName(){return this._heatmapRenderer?.field}get _heatmapRendererField(){let e=this._heatmapRendererFieldName;return e==null?null:this.layer.fieldsIndex.get(e)}get _heatmapRendererFieldIsNumeric(){let e=this._heatmapRendererField;return e!=null&&C(e)}get _isScaleRangeActive(){let{layer:e}=this;if(!(`effectiveScaleRange`in e))return!1;let{minScale:t,maxScale:n}=e.effectiveScaleRange;return I(t,n)}get _visibleFeatures(){return this._renderGeometries.values().reduce((e,{visible:t})=>e+ +!!t,0)}async whenGraphicBounds(){return null}computeAttachmentOrigin(){return null}highlightByGraphics(){return O}highlightByObjectIds(){return O}maskOccludee(){return n()}setObjectIdVisibility(){}refreshFilter(){this.filterVisibility.reapply()}_onLoadedFeaturesChange(e){if(!this._featuresArePoints)return;let{objectIdField:n}=this.layer;this._featureStore.removeManyById(e.removed.map(e=>y(e,n))),this._featureStore.addMany(e.added.map(e=>{let{attributes:t,centroid:r,geometry:i}=e,a=new x(b(i),t,r?b(r):null,y(e,n));return a.displayId=e.uid,a}));let r=e.added,i=e.removed;this._fieldTotal+=this._computeFieldTotalChange(r,i);let a=i.map(({uid:e})=>{let t=this._renderGeometries.get(e);return this._renderGeometries.delete(e),t}).filter(t),o=r.map(e=>{let t=this._pointGraphicToRenderGeometry(e);return this._renderGeometries.set(e.uid,t),t});a.length>0&&this._drapeSourceRenderer.removeGeometries(a,2),o.length>0&&this._drapeSourceRenderer.addGeometries(o,0),(o.length>0||a.length>0)&&(this.filterVisibility.reapply(),this._renderView.requestRender())}_recreate(){if(!this._loadedPointGraphics)return;let e=this._loadedPointGraphics.toArray();this._onLoadedFeaturesChange({added:e,removed:e})}_pointGraphicToRenderGeometry(e){let t=this._heatmapRendererFieldName,n=t==null?this._material:this._materialWithField,r=m();g(e.geometry,r,this._overlaySpatialReference);let i=_(1),a=[[`position`,new k([r[0],r[1]],i,2)]],o=this._heatmapRendererFieldIsNumeric;t!=null&&a.push([`featureAttribute`,new k([o?e.attributes[t]??0:0],i,1)]);let s=new N(new j(n,a,null,void 0,this._baseInstance),{layerViewUid:this.owner.layerViewUid,graphicUid:e.uid});return s.visible=this.filterVisibility.defaultVisibility,s}_forEachMaterial(e){e(this._material),e(this._materialWithField)}_computeFieldTotalChange(e,t){if(this._heatmapRendererFieldName==null||!this._heatmapRendererFieldIsNumeric)return e.length-t.length;let n=this._heatmapRendererFieldName,r=(e,t)=>e+(t.attributes[n]??0);return e.reduce(r,0)-t.reduce(r,0)}_clampSearchRadius(e){return e>112&&r.getLogger(this).warnOnce(`SceneView supports a maximum radius of 112 pt for HeatmapRenderer.`),Math.min(e,112)}_updateFeatureVisibilities(e){let t=[];this._featureStore.forEach(({objectId:n,displayId:r})=>{let i=e(n),a=this._renderGeometries.get(r);a&&a.visible!==i&&(t.push(a),a.visible=i)}),this._drapeSourceRenderer.modifyGeometries(t,1)}_setAllFeaturesVisibility(e){let t=[];for(let n of this._renderGeometries.values())n.visible!==e&&(t.push(n),n.visible=e);this._drapeSourceRenderer.modifyGeometries(t,1)}get test(){}};e([f()],V.prototype,`type`,void 0),e([f({constructOnly:!0})],V.prototype,`owner`,void 0),e([f()],V.prototype,`layer`,null),e([f()],V.prototype,`featureStore`,null),e([f()],V.prototype,`updating`,null),e([f()],V.prototype,`updatingRemaining`,null),e([f()],V.prototype,`suspendInfo`,null),e([f()],V.prototype,`legendEnabled`,null),e([f()],V.prototype,`filterVisibility`,null),e([f()],V.prototype,`displayFeatureLimit`,null),e([f()],V.prototype,`preferredUpdatePolicy`,void 0),e([f()],V.prototype,`hasZ`,null),e([f()],V.prototype,`hasM`,null),e([f()],V.prototype,`dataExtent`,void 0),e([f()],V.prototype,`view`,null),e([f()],V.prototype,`fullOpacity`,null),e([f()],V.prototype,`updatePolicy`,null),e([f()],V.prototype,`drapeSourceType`,void 0),e([f()],V.prototype,`scaleVisibilitySuspended`,null),e([f()],V.prototype,`renderer`,null),e([f()],V.prototype,`_featureStore`,void 0),e([f()],V.prototype,`_filterVisibility`,void 0),e([f()],V.prototype,`_overlayRenderer`,null),e([f()],V.prototype,`_overlaySpatialReference`,null),e([f()],V.prototype,`_rendererParameters`,null),e([f()],V.prototype,`_materialParameters`,null),e([f()],V.prototype,`_densityParameters`,null),e([f()],V.prototype,`_radiusParameter`,null),e([f()],V.prototype,`_resolutionForScaleParameter`,null),e([f()],V.prototype,`_colorRampParameter`,null),e([f()],V.prototype,`_pixelRatioParameter`,null),e([f()],V.prototype,`_densityMapPixelRatio`,null),e([f()],V.prototype,`_renderGeometries`,void 0),e([f()],V.prototype,`_material`,void 0),e([f()],V.prototype,`_materialWithField`,void 0),e([f()],V.prototype,`_renderView`,null),e([f()],V.prototype,`_featuresArePoints`,null),e([f()],V.prototype,`_loadedPointGraphics`,null),e([f()],V.prototype,`_heatmapRenderer`,null),e([f()],V.prototype,`_heatmapRendererFieldName`,null),e([f()],V.prototype,`_heatmapRendererField`,null),e([f()],V.prototype,`_heatmapRendererFieldIsNumeric`,null),e([f()],V.prototype,`_fieldTotal`,void 0),e([f()],V.prototype,`_drapeSourceRenderer`,void 0),e([f()],V.prototype,`_isScaleRangeActive`,null),V=e([p(`esri.views.3d.layers.support.HeatmapFeatureProcessor`)],V);const H=i([0,0,0,0,0,0,0,0],a);export{V as HeatmapFeatureProcessor,B as maxRadiusPt};
2
+ import{__decorate as e}from"tslib";import{isSome as t}from"../../../../core/arrayUtils.js";import{makeHandle as n}from"../../../../core/handleUtils.js";import"../../../../core/has.js";import r from"../../../../core/Logger.js";import{estimateFixedArrayMemory as i,estimateNumberMemory as a,estimateAttributesMemory as o}from"../../../../core/memoryEstimations.js";import{EsriPromise as s}from"../../../../core/Promise.js";import{initial as c,sync as l,watch as u}from"../../../../core/reactiveUtils.js";import{pt2px as d}from"../../../../core/screenUtils.js";import{property as f,subclass as p}from"../../../../core/accessorSupport/decorators.js";import{create as m}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{UpdatingHandles as h}from"../../../../core/support/UpdatingHandles.js";import{projectPointToVector as g}from"../../../../geometry/projection/projectPointToVector.js";import{getContinuousIndexArray as _}from"../../../../geometry/support/Indices.js";import{scaleBoundsPredicate as v,getResolutionForScale as y,isScaleRangeActive as b}from"../../../../geometry/support/scaleUtils.js";import{getObjectId as x}from"../../../../layers/graphics/dehydratedFeatures.js";import{convertFromPoint as S}from"../../../../layers/graphics/featureConversionUtils.js";import{OptimizedFeature as C}from"../../../../layers/graphics/OptimizedFeature.js";import w from"../../../../layers/graphics/data/FeatureStore.js";import{isNumericField as T}from"../../../../layers/support/fieldUtils.js";import{generateGradient as E}from"../../../../renderers/support/heatmapUtils.js";import{DisplayFeatureLimit as D}from"../graphics/DisplayFeatureLimit.js";import{GraphicsCorePerformanceInfo as O}from"../graphics/GraphicsCorePerformanceInfo.js";import{FeatureVisibilityFilter as k}from"./FeatureVisibilityFilter.js";import{emptyHighlightHandle as A}from"./highlightUtils.js";import{Attribute as j}from"../../webgl-engine/lib/Attribute.js";import{DrapedHeatmapRenderer as M}from"../../webgl-engine/lib/DrapedHeatmapRenderer.js";import{Geometry as N}from"../../webgl-engine/lib/Geometry.js";import{GeometryBaseInstance as P}from"../../webgl-engine/lib/GeometryBaseInstance.js";import{RenderGeometry as F}from"../../webgl-engine/lib/RenderGeometry.js";import{HeatmapDensityMaterial as I}from"../../webgl-engine/materials/HeatmapDensityMaterial.js";import{PixelType as L}from"../../../webgl/enums.js";import{loadHeatmapTextureConfiguration as R,fallBackHeatmapConfiguration as z}from"../../../webgl/heatmapTextureUtils.js";const B=112;let V=class extends s{constructor(e){super(e),this.type=`heatmap`,this.preferredUpdatePolicy=0,this.dataExtent=null,this.drapeSourceType=1,this._renderGeometries=new Map,this._fieldTotal=0,this._drapeSourceRenderer=null,this._dataType=L.HALF_FLOAT,this._pixelFormat=6408,this._baseInstance=new P([]),this._updatingHandles=new h}initialize(){let e;try{e=R(this._renderView.renderingContext,r.getLogger(this))}catch(t){this.addResolvingPromise(Promise.reject(t)),e=z}let{dataType:t,samplingMode:i,pixelFormat:a,internalFormat:o}=e;this._featureStore=new w({geometryType:`esriGeometryPoint`,hasZ:this.hasZ,hasM:this.hasM}),this._dataType=t,this._pixelFormat=a;let s=t!==L.FLOAT,d=this.view.overlayManager,f={...this._rendererParameters,stage:this.view.stage,dataType:t,samplingMode:i,pixelFormat:a,internalFormat:o,rendererContext:d.renderer,drapeSource:this};this._drapeSourceRenderer=new M(f),d.registerDrapeSource(this,this._drapeSourceRenderer),this._material=new I({usesHalfFloats:s}),this._materialWithField=new I({usesHalfFloats:s,isAttributeDriven:!0}),this._filterVisibility=new k({context:{configuration:this.owner,featureStore:this.featureStore,getFeatureCount:()=>this._loadedPointGraphics.length,setAllFeaturesVisibility:e=>this._setAllFeaturesVisibility(e),clearFeaturesVisibility:()=>this._setAllFeaturesVisibility(!0),updateFeatureVisibilities:e=>this._updateFeatureVisibilities(e)}}),this._updatingHandles.addOnCollectionChange(()=>this._loadedPointGraphics,e=>this._onLoadedFeaturesChange(e),c),this._updatingHandles.addWhen(()=>this._materialParameters,e=>this._forEachMaterial(t=>t.setParameters(e)),c),this._updatingHandles.add(()=>this._rendererParameters,e=>this._drapeSourceRenderer.set(e)),this._updatingHandles.add(()=>this._heatmapRendererField,()=>{this._recreate()},l),this._updatingHandles.add(()=>({fieldName:this._heatmapRendererFieldName,numeric:this._heatmapRendererFieldIsNumeric}),({fieldName:e,numeric:t})=>{if(e!=null&&t){let t=0;this._featureStore.forEach(n=>t+=n.attributes[e]??0),this._fieldTotal=t}else this._fieldTotal=this._featureStore.numFeatures},c),this.addHandles([u(()=>({fieldName:this._heatmapRendererFieldName,field:this._heatmapRendererField}),({fieldName:e,field:t})=>{e&&!t&&r.getLogger(this).warn(`Heatmap renderer field '${e}' for layer '${this.layer.title??this.layer.id}' not found`)}),u(()=>({field:this._heatmapRendererField,numeric:this._heatmapRendererFieldIsNumeric}),({field:e,numeric:t})=>{e!=null&&!t&&r.getLogger(this).warn(`Heatmap renderer field '${e.name}' for layer '${this.layer.title??this.layer.id}' does not contain numeric values and cannot be used to drive the heatmap density`)}),n(()=>this.view.overlayManager.unregisterDrapeSource(this))])}destroy(){this._renderGeometries.clear(),this._material=null,this._materialWithField=null,this._featureStore.clear(),this._featureStore=null,this._updatingHandles.destroy(),this._baseInstance=null}get layer(){return this.owner.layer}get featureStore(){return this._featureStore}get updating(){return this._updatingHandles.updating||this.filterVisibility.updating}get updatingRemaining(){return 0}get suspendInfo(){return{}}get legendEnabled(){return!0}get filterVisibility(){return this._filterVisibility}get displayFeatureLimit(){let e=this.owner?.view?.quality??1,t=this.owner?.view?.qualitySettings,n=t?Math.ceil(t.graphics3D.maxTotalNumberOfFeatures*e):0,r=n*6;return new D(r,n)}get hasZ(){return`hasZ`in this.layer&&this.layer.hasZ===!0}get hasM(){return`hasM`in this.layer&&this.layer.hasM}get view(){return this.owner.view}get fullOpacity(){return this.owner.fullOpacity}get updatePolicy(){return this.owner.updatePolicy}get scaleVisibilitySuspended(){if(!this._isScaleRangeActive)return!1;let{minScale:e,maxScale:t}=this.layer.effectiveScaleRange,{scale:n}=this.view;return!v(n,e??0,t??0)}get usedMemory(){let e=this.usedMemoryPerFeature*this._featureStore.numFeatures,t=this._pixelFormat===6403?1:4,n=this._dataType===L.FLOAT?4:2,r=Math.ceil((this._overlayRenderer?.overlays[0]?.resolution??0)*this._densityMapPixelRatio)??0;return r*r*t*n+e+H}get usedMemoryPerFeature(){let e=this._loadedPointGraphics.find(()=>!0);if(e==null)return 0;let t=o(e);return i([0,0],a)+(this._heatmapRendererFieldIsNumeric?a:0)+t}get loadedFeatures(){return this._featureStore.numFeatures}get unprocessedMemoryEstimate(){return 0}get performanceInfo(){return new O(this._renderGeometries.size,this._visibleFeatures,0,0)}get renderer(){return this._heatmapRenderer}get _overlayRenderer(){return this.view.overlayManager.renderer}get _overlaySpatialReference(){return this.view.overlayManager.spatialReference}get _rendererParameters(){return{...this._radiusParameter,...this._densityParameters,...this._colorRampParameter,...this._pixelRatioParameter}}get _materialParameters(){return{...this._radiusParameter,...this._resolutionForScaleParameter}}get _densityParameters(){let e=this._heatmapRenderer;if(e==null)return null;let{minDensity:t,maxDensity:n}=e;return{minDensity:t,maxDensity:n,fieldTotal:this._fieldTotal}}get _radiusParameter(){let e=this._heatmapRenderer;return e?{searchRadius:d(this._clampSearchRadius(e.radius))}:null}get _resolutionForScaleParameter(){let e=this._heatmapRenderer;if(!e)return null;let{referenceScale:t}=e;return{resolutionForScale:t===0?0:y(t,this.view.spatialReference)}}get _colorRampParameter(){let e=this._heatmapRenderer;return e?{colorRampData:E(e.colorStops)}:null}get _pixelRatioParameter(){return{pixelRatio:this._densityMapPixelRatio}}get _densityMapPixelRatio(){return this.owner?.view?.qualitySettings.heatmap.pixelRatio??1}get _renderView(){return this.view.stage.renderView}get _featuresArePoints(){return this.layer.geometryType===`point`}get _loadedPointGraphics(){return this.owner.loadedGraphics}get _heatmapRenderer(){let e=this.layer.renderer;return e?.type===`heatmap`?e:null}get _heatmapRendererFieldName(){return this._heatmapRenderer?.field}get _heatmapRendererField(){let e=this._heatmapRendererFieldName;return e==null?null:this.layer.fieldsIndex.get(e)}get _heatmapRendererFieldIsNumeric(){let e=this._heatmapRendererField;return e!=null&&T(e)}get _isScaleRangeActive(){let{layer:e}=this;if(!(`effectiveScaleRange`in e))return!1;let{minScale:t,maxScale:n}=e.effectiveScaleRange;return b(t,n)}get _visibleFeatures(){return this._renderGeometries.values().reduce((e,{visible:t})=>e+ +!!t,0)}async whenGraphicBounds(){return null}computeAttachmentOrigin(){return null}highlightByGraphics(){return A}highlightByObjectIds(){return A}maskOccludee(){return n()}setObjectIdVisibility(){}refreshFilter(){this.filterVisibility.reapply()}_onLoadedFeaturesChange(e){if(!this._featuresArePoints)return;let{objectIdField:n}=this.layer;this._featureStore.removeManyById(e.removed.map(e=>x(e,n))),this._featureStore.addMany(e.added.map(e=>{let{attributes:t,centroid:r,geometry:i}=e,a=new C(S(i),t,r?S(r):null,x(e,n));return a.displayId=e.uid,a}));let r=e.added,i=e.removed;this._fieldTotal+=this._computeFieldTotalChange(r,i);let a=i.map(({uid:e})=>{let t=this._renderGeometries.get(e);return this._renderGeometries.delete(e),t}).filter(t),o=r.map(e=>{let t=this._pointGraphicToRenderGeometry(e);return this._renderGeometries.set(e.uid,t),t});a.length>0&&this._drapeSourceRenderer.removeGeometries(a,2),o.length>0&&this._drapeSourceRenderer.addGeometries(o,0),(o.length>0||a.length>0)&&(this.filterVisibility.reapply(),this._renderView.requestRender())}_recreate(){if(!this._loadedPointGraphics)return;let e=this._loadedPointGraphics.toArray();this._onLoadedFeaturesChange({added:e,removed:e})}_pointGraphicToRenderGeometry(e){let t=this._heatmapRendererFieldName,n=t==null?this._material:this._materialWithField,r=m();g(e.geometry,r,this._overlaySpatialReference);let i=_(1),a=[[`position`,new j([r[0],r[1]],i,2)]],o=this._heatmapRendererFieldIsNumeric;t!=null&&a.push([`featureAttribute`,new j([o?e.attributes[t]??0:0],i,1)]);let s=new F(new N(n,a,null,void 0,this._baseInstance),{layerViewUid:this.owner.layerViewUid,graphicUid:e.uid});return s.visible=this.filterVisibility.defaultVisibility,s}_forEachMaterial(e){e(this._material),e(this._materialWithField)}_computeFieldTotalChange(e,t){if(this._heatmapRendererFieldName==null||!this._heatmapRendererFieldIsNumeric)return e.length-t.length;let n=this._heatmapRendererFieldName,r=(e,t)=>e+(t.attributes[n]??0);return e.reduce(r,0)-t.reduce(r,0)}_clampSearchRadius(e){return e>112&&r.getLogger(this).warnOnce(`SceneView supports a maximum radius of 112 pt for HeatmapRenderer.`),Math.min(e,112)}_updateFeatureVisibilities(e){let t=[];this._featureStore.forEach(({objectId:n,displayId:r})=>{let i=e(n),a=this._renderGeometries.get(r);a&&a.visible!==i&&(t.push(a),a.visible=i)}),this._drapeSourceRenderer.modifyGeometries(t,1)}_setAllFeaturesVisibility(e){let t=[];for(let n of this._renderGeometries.values())n.visible!==e&&(t.push(n),n.visible=e);this._drapeSourceRenderer.modifyGeometries(t,1)}get test(){}};e([f()],V.prototype,`type`,void 0),e([f({constructOnly:!0})],V.prototype,`owner`,void 0),e([f()],V.prototype,`layer`,null),e([f()],V.prototype,`featureStore`,null),e([f()],V.prototype,`updating`,null),e([f()],V.prototype,`updatingRemaining`,null),e([f()],V.prototype,`suspendInfo`,null),e([f()],V.prototype,`legendEnabled`,null),e([f()],V.prototype,`filterVisibility`,null),e([f()],V.prototype,`displayFeatureLimit`,null),e([f()],V.prototype,`preferredUpdatePolicy`,void 0),e([f()],V.prototype,`hasZ`,null),e([f()],V.prototype,`hasM`,null),e([f()],V.prototype,`dataExtent`,void 0),e([f()],V.prototype,`view`,null),e([f()],V.prototype,`fullOpacity`,null),e([f()],V.prototype,`updatePolicy`,null),e([f()],V.prototype,`drapeSourceType`,void 0),e([f()],V.prototype,`scaleVisibilitySuspended`,null),e([f()],V.prototype,`renderer`,null),e([f()],V.prototype,`_featureStore`,void 0),e([f()],V.prototype,`_filterVisibility`,void 0),e([f()],V.prototype,`_overlayRenderer`,null),e([f()],V.prototype,`_overlaySpatialReference`,null),e([f()],V.prototype,`_rendererParameters`,null),e([f()],V.prototype,`_materialParameters`,null),e([f()],V.prototype,`_densityParameters`,null),e([f()],V.prototype,`_radiusParameter`,null),e([f()],V.prototype,`_resolutionForScaleParameter`,null),e([f()],V.prototype,`_colorRampParameter`,null),e([f()],V.prototype,`_pixelRatioParameter`,null),e([f()],V.prototype,`_densityMapPixelRatio`,null),e([f()],V.prototype,`_renderGeometries`,void 0),e([f()],V.prototype,`_material`,void 0),e([f()],V.prototype,`_materialWithField`,void 0),e([f()],V.prototype,`_renderView`,null),e([f()],V.prototype,`_featuresArePoints`,null),e([f()],V.prototype,`_loadedPointGraphics`,null),e([f()],V.prototype,`_heatmapRenderer`,null),e([f()],V.prototype,`_heatmapRendererFieldName`,null),e([f()],V.prototype,`_heatmapRendererField`,null),e([f()],V.prototype,`_heatmapRendererFieldIsNumeric`,null),e([f()],V.prototype,`_fieldTotal`,void 0),e([f()],V.prototype,`_drapeSourceRenderer`,void 0),e([f()],V.prototype,`_isScaleRangeActive`,null),V=e([p(`esri.views.3d.layers.support.HeatmapFeatureProcessor`)],V);const H=i([0,0,0,0,0,0,0,0],a);export{V as HeatmapFeatureProcessor,B as maxRadiusPt};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{isScreenRect as e,createScreenPoint as t}from"../../../core/screenUtils.js";import{isTiledLayer as n,isLayerWithFlowRenderer as r}from"../../../layers/support/layerUtils.js";import{hitTestSelectSimilarDistance as i}from"../../support/hitTestSelectUtils.js";import{isScaleRangeActive as a,scaleBoundsPredicate as o}from"../../support/layerViewUtils.js";async function s(s,d){let f=await i(s,d),{results:p}=f,m=f.ground,h=e(d)?s.toMap(t(d.x+d.width/2,d.y+d.height/2)):m.mapPoint,g=h!=null,_=[],v=u(s),y=m.layer==null,b=g?c(s,v,y):l,x=0,S=0,C=()=>{let e=b.layerViews[S++];if(!g||!e||!(`fetchPopupFeaturesAtTarget`in e))return;let t=h,i=e.layer;if(n(i)&&`effectiveScaleRange`in i){let{minScale:e,maxScale:n}=i.effectiveScaleRange;if(a(e,n)){if(r(i)&&!o(s.scale,e,n))return;let a=s.basemapTerrain.getScale(t);if(!o(a,e,n))return}}_.push({geometry:t,layerView:e})},w=null;for(;x<p.length||S<b.layerViews.length;){let e=p[x];if(e&&e.type!==`graphic`){++x;continue}if(e?.layer?.type===`scene`&&e?.layer?.parent===s?.map?.basemap){++x;continue}if(e){let t=e.layer?.uid,n=b.layerUids.has(t)&&e.distance===m.distance,r=v.get(e.layer?.uid);if(w??=e.mapPoint,S<b.layerViews.length&&(n||(e.distance??0)>m.distance)&&b.layerViews[S]!==r){C();continue}_.push({graphic:e.graphic,layerView:r}),++x}else C()}return w??=h,{hits:_,location:w}}function c(e,t,n){let r=new Set,i=new Set,a=e=>{e&&(r.add(e.layer.uid),i.add(e))};if(n){let{basemapTerrain:t}=e,n=t.numLayers(1);for(let e=n-1;e>=0;e--)a(t.layerViewByIndex(e,1))}let o=e.overlayManager.renderer.layers;for(let{uid:e}of o)a(t.get(e));return{layerUids:r,layerViews:Array.from(i).reverse()}}const l={layerUids:new Set,layerViews:[]};function u(e){let t=new Map;for(let n of e.allLayerViews){let e=n.layer.uid;t.set(e,n)}return t}export{s as popupHitTest};
2
+ import{isScreenRect as e,createScreenPoint as t}from"../../../core/screenUtils.js";import{isScaleRangeActive as n,scaleBoundsPredicate as r}from"../../../geometry/support/scaleUtils.js";import{isTiledLayer as i,isLayerWithFlowRenderer as a}from"../../../layers/support/layerUtils.js";import{hitTestSelectSimilarDistance as o}from"../../support/hitTestSelectUtils.js";async function s(s,d){let f=await o(s,d),{results:p}=f,m=f.ground,h=e(d)?s.toMap(t(d.x+d.width/2,d.y+d.height/2)):m.mapPoint,g=h!=null,_=[],v=u(s),y=m.layer==null,b=g?c(s,v,y):l,x=0,S=0,C=()=>{let e=b.layerViews[S++];if(!g||!e||!(`fetchPopupFeaturesAtTarget`in e))return;let t=h,o=e.layer;if(i(o)&&`effectiveScaleRange`in o){let{minScale:e,maxScale:i}=o.effectiveScaleRange;if(n(e,i)){if(a(o)&&!r(s.scale,e,i))return;let n=s.basemapTerrain.getScale(t);if(!r(n,e,i))return}}_.push({geometry:t,layerView:e})},w=null;for(;x<p.length||S<b.layerViews.length;){let e=p[x];if(e&&e.type!==`graphic`){++x;continue}if(e?.layer?.type===`scene`&&e?.layer?.parent===s?.map?.basemap){++x;continue}if(e){let t=e.layer?.uid,n=b.layerUids.has(t)&&e.distance===m.distance,r=v.get(e.layer?.uid);if(w??=e.mapPoint,S<b.layerViews.length&&(n||(e.distance??0)>m.distance)&&b.layerViews[S]!==r){C();continue}_.push({graphic:e.graphic,layerView:r}),++x}else C()}return w??=h,{hits:_,location:w}}function c(e,t,n){let r=new Set,i=new Set,a=e=>{e&&(r.add(e.layer.uid),i.add(e))};if(n){let{basemapTerrain:t}=e,n=t.numLayers(1);for(let e=n-1;e>=0;e--)a(t.layerViewByIndex(e,1))}let o=e.overlayManager.renderer.layers;for(let{uid:e}of o)a(t.get(e));return{layerUids:r,layerViews:Array.from(i).reverse()}}const l={layerUids:new Set,layerViews:[]};function u(e){let t=new Map;for(let n of e.allLayerViews){let e=n.layer.uid;t.set(e,n)}return t}export{s as popupHitTest};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- const e={type:`empty-tile`};function t(e){return e!=null&&`type`in e&&e.type===`vector-tile`}function n(e){return e!=null&&`type`in e&&e.type===`raster-tile`}function r(e){return e!=null&&`type`in e&&e.type===`tile-texture`}function i(e){return e!=null&&`type`in e&&e.type===`empty-tile`}function a(e){return e!=null&&`type`in e&&`bitmap`in e}export{e as emptyTile,a as isCreateBitmapResult,i as isEmptyTile,n as isRasterTile,r as isTileTexture,t as isVectorTile};
2
+ const e={type:`empty-tile`};function t(e){return e!=null&&`type`in e&&e.type===`vector-tile`}function n(e){return e!=null&&`type`in e&&e.type===`raster-tile`}function r(e){return e!=null&&`type`in e&&e.type===`tile-texture`}function i(e){return e==null||`type`in e&&e.type===`empty-tile`}function a(e){return e!=null&&`type`in e&&`bitmap`in e}export{e as emptyTile,a as isCreateBitmapResult,i as isEmptyTile,n as isRasterTile,r as isTileTexture,t as isVectorTile};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import e from"../../../core/Collection.js";import{isEarth as t}from"../../../geometry/ellipsoidUtils.js";import{isCGCS2000 as n}from"../../../geometry/support/spatialReferenceUtils.js";import{getTileMaxtrixSetFromActiveLayer as r}from"../../../layers/support/layerUtils.js";import{isRasterTile as i,isCreateBitmapResult as a,isTileTexture as o,isVectorTile as s}from"./TerrainData.js";import{t as c}from"../../../chunks/terrainUtilsPlanar.js";import{t as l}from"../../../chunks/terrainUtilsSpherical.js";const u={1:l,2:c};function d(e,t){e||console.warn(`Terrain: `+t)}let f=!1,p=!1;function m(e){p=e,f||=e}function h(e){f=e}function g(e,t){if(f&&!e){let e=Error().stack?.slice(5);throw console.warn(`Terrain internal: `+(t??``)+` at `+e),Error(`Assertion failed`+(t?`: `+t:``))}}function _(e){return e?.type===`imagery-tile`||e?.type===`wcs`}function v(e){return e?.type===`imagery-tile-3d`}function y(e){return e?.type===`tile-3d`}function b(e){return e?.type===`vector-tile-3d`}function x(e){return e?.type===`wmts-3d`}function S(e){return e?.type===`elevation-3d`}function C(e){return e?.type===`group`}function w(e){return e&&(y(e)||x(e)||v(e)||b(e))}function T(e){return e&&(y(e)||v(e)||b(e)||x(e))}function E(e){return T(e)||S(e)}function D(e){return i(e?.sourceLayerInfo?.data)}function O(e){return j(e?.sourceLayerInfo)||!!e?.isVTLBackground}function k(e){return o(e?.sourceLayerInfo?.data)}function A(e){let t=e?.sourceLayerInfo?.data;return a(t)}function j(e){return s(e?.data)}function M(e){return e!=null&&`release`in e&&e.release(),null}function N(e,t,n,r,i){return u[r].checkIfTileInfoSupportedForViewSR(e,n,t,i)}function P(e,t,n){let r=null,i=null;if(e?.type===`wmts`){let a=F(e,t,n);r=a.tileInfo,i=a.fullExtent}else{i=_(e)?e.getCompatibleFullExtent(t):e.fullExtent;let a=n===2;r=_(e)?e.getCompatibleTileInfo(t,i,a):e?.type===`vector-tile`?a&&!I(t)||L.force512VTL?e.tileInfo:e.tileInfo.getCompatibleForVTL(256):e.tileInfo}let a=`tilemapCache`in e?e.tilemapCache?.effectiveMaxLOD:void 0;return r!=null&&i!=null&&N(r,i,t,n,a)==null?{tileInfo:r,fullExtent:i}:null}function F(t,n,i){let a=r(t);if(a!=null){if(e.isCollection(a)){let e=a.find(e=>N(e.tileInfo,e.fullExtent,n,i)==null);if(e)return{tileInfo:e.tileInfo,fullExtent:e.fullExtent}}else return{tileInfo:a.tileInfo,fullExtent:a.fullExtent}}return{tileInfo:null,fullExtent:null}}function I(e){return e.isWGS84||e.isWebMercator||n(e)||!t(e)}const L={force512VTL:!1};function R(e){return`[`+e[0]+`,`+e[1]+`,`+e[2]+`]`}function z(e){return`(`+e[0]+`,`+e[1]+`,`+e[2]+`)`}function B(e,t,n=Z){return Math.abs(e-t)<n}function V(e){return e===1?5:e===7?3:e===5?1:7}function H(e){return e===0?4:e===2?6:e===4?0:2}function U(e){return e===7||e===5}function W(e){return e===7||e===1}function G(e){return e===7||e===6||e===5}function K(e){return e===1||e===2||e===3}function q(e){return e===3||e===4||e===5}function J(e){return e===1||e===0||e===7}const Y=[0,2,4,6],X=[1,3,5,7],Z=1e-5;export{B as almostEquals,N as checkIfTileInfoSupportedForView,h as enableInternalTerrainChecks,f as enableTerrainInternalChecks,m as enableTerrainWaterproofChecks,p as enableWaterproofTests,Z as eps,F as getTileInfoAndExtentFromWMTSLayer,P as getTiledLayerInfo,g as internalAssert,w as isBlendableLayerView,K as isEast,S as isElevationLayerView,C as isGroupLayerView,A as isImageSourceRenderInfo,v as isImageryTileLayerView,D as isImageryTileRenderInfo,T as isMapTileLayerView,J as isNorth,W as isNorthCorner,_ as isProjectableRasterLayer,q as isSouth,E as isSurfaceLayerView,k as isTextureTileRenderInfo,y as isTileLayerView,b as isVectorTileLayerView,j as isVectorTilePerLayerInfo,O as isVectorTileRenderInfo,x as isWMTSLayerView,G as isWest,U as isWestCorner,R as lij2s,X as neighborCornerIndices,Y as neighborEdgeIndices,V as oppositeCorner,H as oppositeEdge,M as releaseTerrainData,L as test,z as v32s,I as vtlAssumes256PixelSizeAsDefault,d as weakAssert};
2
+ import e from"../../../core/Collection.js";import{isEarth as t}from"../../../geometry/ellipsoidUtils.js";import{isCGCS2000 as n}from"../../../geometry/support/spatialReferenceUtils.js";import{getTileMaxtrixSetFromActiveLayer as r}from"../../../layers/support/layerUtils.js";import{isRasterTile as i,isCreateBitmapResult as a,isTileTexture as o,isVectorTile as s}from"./TerrainData.js";import{t as c}from"../../../chunks/terrainUtilsPlanar.js";import{t as l}from"../../../chunks/terrainUtilsSpherical.js";const u={1:l,2:c};function d(e,t){e||console.warn(`Terrain: `+t)}let f=!1,p=!1;function m(e){p=e,f||=e}function h(e){f=e}function g(e,t){if(f&&!e){let e=Error().stack?.slice(5);throw console.warn(`Terrain internal: `+(t??``)+` at `+e),Error(`Assertion failed`+(t?`: `+t:``))}}function _(e){return e?.type===`imagery-tile`||e?.type===`wcs`}function v(e){return e?.type===`imagery-tile-3d`}function y(e){return e?.type===`tile-3d`}function b(e){return e?.type===`vector-tile-3d`}function x(e){return e?.type===`wmts-3d`}function S(e){return e?.type===`elevation-3d`}function C(e){return e?.type===`group`}function w(e){return e&&(y(e)||x(e)||v(e)||b(e))}function T(e){return e&&(y(e)||v(e)||b(e)||x(e))}function E(e){return T(e)||S(e)}function D(e){return i(e?.sourceLayerInfo?.data)}function O(e){return e?.sourceLayerInfo?.data!=null&&j(e.sourceLayerInfo)||!!e?.isVTLBackground}function k(e){return o(e?.sourceLayerInfo?.data)}function A(e){let t=e?.sourceLayerInfo?.data;return a(t)}function j(e){return s(e?.data)}function M(e){return e!=null&&`release`in e&&e.release(),null}function N(e,t,n,r,i){return u[r].checkIfTileInfoSupportedForViewSR(e,n,t,i)}function P(e,t,n){let r=null,i=null;if(e?.type===`wmts`){let a=F(e,t,n);r=a.tileInfo,i=a.fullExtent}else{i=_(e)?e.getCompatibleFullExtent(t):e.fullExtent;let a=n===2;r=_(e)?e.getCompatibleTileInfo(t,i,a):e?.type===`vector-tile`?a&&!I(t)||L.force512VTL?e.tileInfo:e.tileInfo.getCompatibleForVTL(256):e.tileInfo}let a=`tilemapCache`in e?e.tilemapCache?.effectiveMaxLOD:void 0;return r!=null&&i!=null&&N(r,i,t,n,a)==null?{tileInfo:r,fullExtent:i}:null}function F(t,n,i){let a=r(t);if(a!=null){if(e.isCollection(a)){let e=a.find(e=>N(e.tileInfo,e.fullExtent,n,i)==null);if(e)return{tileInfo:e.tileInfo,fullExtent:e.fullExtent}}else return{tileInfo:a.tileInfo,fullExtent:a.fullExtent}}return{tileInfo:null,fullExtent:null}}function I(e){return e.isWGS84||e.isWebMercator||n(e)||!t(e)}const L={force512VTL:!1};function R(e){return`[`+e[0]+`,`+e[1]+`,`+e[2]+`]`}function z(e){return`(`+e[0]+`,`+e[1]+`,`+e[2]+`)`}function B(e,t,n=Z){return Math.abs(e-t)<n}function V(e){return e===1?5:e===7?3:e===5?1:7}function H(e){return e===0?4:e===2?6:e===4?0:2}function U(e){return e===7||e===5}function W(e){return e===7||e===1}function G(e){return e===7||e===6||e===5}function K(e){return e===1||e===2||e===3}function q(e){return e===3||e===4||e===5}function J(e){return e===1||e===0||e===7}const Y=[0,2,4,6],X=[1,3,5,7],Z=1e-5;export{B as almostEquals,N as checkIfTileInfoSupportedForView,h as enableInternalTerrainChecks,f as enableTerrainInternalChecks,m as enableTerrainWaterproofChecks,p as enableWaterproofTests,Z as eps,F as getTileInfoAndExtentFromWMTSLayer,P as getTiledLayerInfo,g as internalAssert,w as isBlendableLayerView,K as isEast,S as isElevationLayerView,C as isGroupLayerView,A as isImageSourceRenderInfo,v as isImageryTileLayerView,D as isImageryTileRenderInfo,T as isMapTileLayerView,J as isNorth,W as isNorthCorner,_ as isProjectableRasterLayer,q as isSouth,E as isSurfaceLayerView,k as isTextureTileRenderInfo,y as isTileLayerView,b as isVectorTileLayerView,j as isVectorTilePerLayerInfo,O as isVectorTileRenderInfo,x as isWMTSLayerView,G as isWest,U as isWestCorner,R as lij2s,X as neighborCornerIndices,Y as neighborEdgeIndices,V as oppositeCorner,H as oppositeEdge,M as releaseTerrainData,L as test,z as v32s,I as vtlAssumes256PixelSizeAsDefault,d as weakAssert};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{releaseMaybe as e}from"../../../../core/maybe.js";import{signal as t}from"../../../../core/signal.js";import{create as n}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import r from"../../webgl/RenderCamera.js";import{isColor as i}from"../core/shaderLibrary/ShaderOutput.js";import{CloudsParameters as a}from"../effects/clouds/CloudsParameters.js";import{ReprojectionUniforms as o}from"./ReprojectionUniforms.js";import{ScreenSpaceReflectionsUniforms as s}from"./ScreenSpaceReflectionsUniforms.js";import{SceneLighting as c}from"../lighting/SceneLighting.js";class l{constructor(e,t){this.width=e,this.height=t}}class u{constructor(e){this.shadowMap=e,this.output=0,this.slot=2,this.slicePlane=null,this.planarDistanceToGroundRatio=1,this.metersPerRenderUnit=1,this.hasOccludees=!1,this._emissions=t(0),this.transparentWithoutDepthEmissionDimmingPass=!1,this.useFloatBlend=t(!0),this.globalIlluminationDirectFactor=.8,this.globalIlluminationAmbientFactor=1,this.enableFillLights=!0,this.alignPixelEnabled=!1,this.decorations=!0,this.frameRendererTarget=0,this.overlayStretch=1,this.viewshedEnabled=!1,this.laserlinesEnabled=!1,this.shadowAnalysisEnabled=!1,this.cutFillComputationEnabled=!1,this.cutFillVisualizationEnabled=!1,this._camera=t(new r),this._inverseViewport=n(),this._oldLighting=new c,this._newLighting=new c,this._fadedLighting=new c,this._lighting=this._newLighting,this.screenSpaceReflections=new s,this.reprojection=new o,this.highlights=[],this.highlightMixOrigin=n(),this.highlightMixTexture=null,this.globalIlluminationEnabled=!1,this.hudRenderStyle=0,this.snowCover=0,this.clouds=new a,this.hasShadowHighlights=!1}destroy(){this._camera=this.contentCamera=null,this.mainDepth=this.overlay=this.ssao=this.shadowHighlight=null,this.depth=e(this.depth),this.shadowMap?.dispose()}get emissions(){return this._emissions.value}set emissions(e){this._emissions.value=e}get hasEmission(){switch(this.output){case 0:return this.hasOpaqueEmission;case 1:case 2:return this.hasTransparentEmission;default:return!1}}get hasOpaqueEmission(){return this.emissions===1||this.emissions===3}get hasTransparentEmission(){return this.emissions===2||this.emissions===3}get hasEmissions(){return this.emissions!==0}get camera(){return this._camera.value}set camera(e){this._camera.value=e,this._inverseViewport[0]=1/e.fullViewport[2],this._inverseViewport[1]=1/e.fullViewport[3]}get enableOITOffset(){return this.camera.relativeElevation<5e5}get inverseViewport(){return this._inverseViewport}get lighting(){return this._lighting}fadeLighting(){switch(this.clouds.fadeFactor){case 0:this._lighting=this._oldLighting;break;default:this._fadedLighting.lerpLighting(this._oldLighting,this._newLighting,this.clouds.fadeFactor),this._lighting=this._fadedLighting;break;case 1:this._lighting=this._newLighting,this._oldLighting.copyFrom(this._newLighting)}}updateLighting(e,t,n,r){this._oldLighting.copyFrom(this.lighting),this._newLighting.noonFactor=t,this._newLighting.globalFactor=n,this._newLighting.set(e),this._oldLighting.updateLegacy(),r===1&&this.clouds.requestFade(),this.fadeLighting()}get hasScreenSpaceReflections(){return i(this.output)&&this.screenSpaceReflections.enabled&&this.reprojection.lastFrameColor!=null}get highlight(){return this.highlightLevel==null?null:this.highlights[this.highlightLevel]}get depth(){return this._depth}set depth(e){e&&(e.name=`geometry depth`),this._depth=e}get occluder(){return this.slot===10||this.slot===11?this.slot:null}}export{u as BindParameters,l as ViewportSize};
2
+ import{releaseMaybe as e}from"../../../../core/maybe.js";import{signal as t}from"../../../../core/signal.js";import{create as n}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import r from"../../webgl/RenderCamera.js";import{isColor as i}from"../core/shaderLibrary/ShaderOutput.js";import{CloudsParameters as a}from"../effects/clouds/CloudsParameters.js";import{ReprojectionUniforms as o}from"./ReprojectionUniforms.js";import{ScreenSpaceReflectionsUniforms as s}from"./ScreenSpaceReflectionsUniforms.js";import{SceneLighting as c}from"../lighting/SceneLighting.js";class l{constructor(e,t){this.width=e,this.height=t}}class u{constructor(e){this.shadowMap=e,this.output=0,this.slot=2,this.slicePlane=null,this.planarDistanceToGroundRatio=1,this.metersPerRenderUnit=1,this.hasOccludees=!1,this._emissions=t(0),this.transparentWithoutDepthEmissionDimmingPass=!1,this.useFloatBlend=t(!0),this.globalIlluminationDirectFactor=.55,this.globalIlluminationAmbientFactor=.85,this.enableFillLights=!0,this.alignPixelEnabled=!1,this.decorations=!0,this.frameRendererTarget=0,this.overlayStretch=1,this.viewshedEnabled=!1,this.laserlinesEnabled=!1,this.shadowAnalysisEnabled=!1,this.cutFillComputationEnabled=!1,this.cutFillVisualizationEnabled=!1,this._camera=t(new r),this._inverseViewport=n(),this._oldLighting=new c,this._newLighting=new c,this._fadedLighting=new c,this._lighting=this._newLighting,this.screenSpaceReflections=new s,this.reprojection=new o,this.highlights=[],this.highlightMixOrigin=n(),this.highlightMixTexture=null,this.globalIlluminationEnabled=!1,this.hudRenderStyle=0,this.snowCover=0,this.clouds=new a,this.hasShadowHighlights=!1}destroy(){this._camera=this.contentCamera=null,this.mainDepth=this.overlay=this.ssao=this.shadowHighlight=null,this.depth=e(this.depth),this.shadowMap?.dispose()}get emissions(){return this._emissions.value}set emissions(e){this._emissions.value=e}get hasEmission(){switch(this.output){case 0:return this.hasOpaqueEmission;case 1:case 2:return this.hasTransparentEmission;default:return!1}}get hasOpaqueEmission(){return this.emissions===1||this.emissions===3}get hasTransparentEmission(){return this.emissions===2||this.emissions===3}get hasEmissions(){return this.emissions!==0}get camera(){return this._camera.value}set camera(e){this._camera.value=e,this._inverseViewport[0]=1/e.fullViewport[2],this._inverseViewport[1]=1/e.fullViewport[3]}get enableOITOffset(){return this.camera.relativeElevation<5e5}get inverseViewport(){return this._inverseViewport}get lighting(){return this._lighting}fadeLighting(){switch(this.clouds.fadeFactor){case 0:this._lighting=this._oldLighting;break;default:this._fadedLighting.lerpLighting(this._oldLighting,this._newLighting,this.clouds.fadeFactor),this._lighting=this._fadedLighting;break;case 1:this._lighting=this._newLighting,this._oldLighting.copyFrom(this._newLighting)}}updateLighting(e,t,n,r){this._oldLighting.copyFrom(this.lighting),this._newLighting.noonFactor=t,this._newLighting.globalFactor=n,this._newLighting.set(e),this._oldLighting.updateLegacy(),r===1&&this.clouds.requestFade(),this.fadeLighting()}get hasScreenSpaceReflections(){return i(this.output)&&this.screenSpaceReflections.enabled&&this.reprojection.lastFrameColor!=null}get highlight(){return this.highlightLevel==null?null:this.highlights[this.highlightLevel]}get depth(){return this._depth}set depth(e){e&&(e.name=`geometry depth`),this._depth=e}get occluder(){return this.slot===10||this.slot===11?this.slot:null}}export{u as BindParameters,l as ViewportSize};
@@ -20,15 +20,24 @@ export interface DOMContainerProperties extends Partial<Pick<DOMContainer, "aria
20
20
  */
21
21
  container?: HTMLDivElement | string | null;
22
22
  /**
23
- * Indicates whether the [focusRegion](https://developers.arcgis.com/javascript/latest/references/core/views/DOMContainer/#focusRegion) is enabled. Set this property to `true` to show the centered focus region, or `false` to hide it.
24
- * The focus region can also be enabled/disabled by pressing the `Shift` + `Alt`/`Option` + `O` keyboard shortcut when the view is in focus.
23
+ * Enables the keyboard shortcut for showing the focus region. Applications should enable
24
+ * this only when they handle focus-region selection. When false, the shortcut does not change
25
+ * focus-region visibility.
26
+ *
27
+ * @default false
28
+ * @since 5.2
29
+ */
30
+ focusRegionShortcutEnabled?: boolean;
31
+ /**
32
+ * Indicates whether the [focusRegion](https://developers.arcgis.com/javascript/latest/references/core/views/DOMContainer/#focusRegion) is visible. Set this property to `true` to show the centered focus region, or `false` to hide it.
33
+ * When [focusRegionShortcutEnabled](https://developers.arcgis.com/javascript/latest/references/core/views/DOMContainer/#focusRegionShortcutEnabled) is `true`, visibility can also be toggled by pressing the `Shift` + `Alt`/`Option` + `O` keyboard shortcut when the view is in focus.
25
34
  *
26
35
  * @default false
27
36
  * @since 5.2
28
37
  * @see [focusRegion](https://developers.arcgis.com/javascript/latest/references/core/views/DOMContainer/#focusRegion)
29
38
  * @see [focus-region-select](https://developers.arcgis.com/javascript/latest/references/core/views/View/#event-focus-region-select)
30
39
  */
31
- focusRegionEnabled?: boolean;
40
+ focusRegionVisible?: boolean;
32
41
  /**
33
42
  * Exposes the default widgets available in the view and allows you to toggle them on
34
43
  * and off. See [DefaultUI](https://developers.arcgis.com/javascript/latest/references/core/views/ui/DefaultUI/) for more details.
@@ -117,31 +126,40 @@ export abstract class DOMContainer {
117
126
  */
118
127
  get focused(): boolean;
119
128
  /**
120
- * The screen rectangle of the active focus region, or `null` when [focusRegionEnabled](https://developers.arcgis.com/javascript/latest/references/core/views/DOMContainer/#focusRegionEnabled) is `false`.
129
+ * The screen rectangle of the active focus region, or `null` when [focusRegionVisible](https://developers.arcgis.com/javascript/latest/references/core/views/DOMContainer/#focusRegionVisible) is `false`.
121
130
  * This screen rectangle represents the area of the view that is currently in focus and can be used with methods that require a screen rectangle as input, such as `hitTest()`.
122
131
  *
123
132
  * | Action | Keyboard Shortcut / Property |
124
133
  * |--------|----------------------------|
125
- * | Enable or disable focus region | Use the `Shift` + `Alt`/`Option` + `O` keyboard shortcut while the view component is in focus or set the [focusRegionEnabled](https://developers.arcgis.com/javascript/latest/references/core/views/DOMContainer/#focusRegionEnabled) property to `true` or `false`. |
134
+ * | Enable or disable focus region | When [focusRegionShortcutEnabled](https://developers.arcgis.com/javascript/latest/references/core/views/DOMContainer/#focusRegionShortcutEnabled) is `true`, use the `Shift` + `Alt`/`Option` + `O` keyboard shortcut while the view is in focus. Alternatively, set [focusRegionVisible](https://developers.arcgis.com/javascript/latest/references/core/views/DOMContainer/#focusRegionVisible) to `true` or `false`. |
126
135
  * | Resize focus region | Use the `Shift` + `Alt`/`Option` + Up/Down arrow keys while the focus region is enabled. |
127
136
  *
128
137
  * To know when this focus region is selected, listen for the [focus-region-select](https://developers.arcgis.com/javascript/latest/references/core/views/View/#event-focus-region-select) event.
129
138
  *
130
139
  * @since 5.2
131
- * @see [focusRegionEnabled](https://developers.arcgis.com/javascript/latest/references/core/views/DOMContainer/#focusRegionEnabled)
140
+ * @see [focusRegionVisible](https://developers.arcgis.com/javascript/latest/references/core/views/DOMContainer/#focusRegionVisible)
132
141
  * @see [focus-region-select](https://developers.arcgis.com/javascript/latest/references/core/views/View/#event-focus-region-select)
133
142
  */
134
143
  get focusRegion(): ScreenRect | null;
135
144
  /**
136
- * Indicates whether the [focusRegion](https://developers.arcgis.com/javascript/latest/references/core/views/DOMContainer/#focusRegion) is enabled. Set this property to `true` to show the centered focus region, or `false` to hide it.
137
- * The focus region can also be enabled/disabled by pressing the `Shift` + `Alt`/`Option` + `O` keyboard shortcut when the view is in focus.
145
+ * Enables the keyboard shortcut for showing the focus region. Applications should enable
146
+ * this only when they handle focus-region selection. When false, the shortcut does not change
147
+ * focus-region visibility.
148
+ *
149
+ * @default false
150
+ * @since 5.2
151
+ */
152
+ accessor focusRegionShortcutEnabled: boolean;
153
+ /**
154
+ * Indicates whether the [focusRegion](https://developers.arcgis.com/javascript/latest/references/core/views/DOMContainer/#focusRegion) is visible. Set this property to `true` to show the centered focus region, or `false` to hide it.
155
+ * When [focusRegionShortcutEnabled](https://developers.arcgis.com/javascript/latest/references/core/views/DOMContainer/#focusRegionShortcutEnabled) is `true`, visibility can also be toggled by pressing the `Shift` + `Alt`/`Option` + `O` keyboard shortcut when the view is in focus.
138
156
  *
139
157
  * @default false
140
158
  * @since 5.2
141
159
  * @see [focusRegion](https://developers.arcgis.com/javascript/latest/references/core/views/DOMContainer/#focusRegion)
142
160
  * @see [focus-region-select](https://developers.arcgis.com/javascript/latest/references/core/views/View/#event-focus-region-select)
143
161
  */
144
- accessor focusRegionEnabled: boolean;
162
+ accessor focusRegionVisible: boolean;
145
163
  /**
146
164
  * The height of the view in pixels read from the view container element.
147
165
  *
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import{byId as t,reparent as n}from"../core/domUtils.js";import{on as r}from"../core/events.js";import{makeHandle as i}from"../core/handleUtils.js";import a from"../core/Logger.js";import{destroyMaybe as o,removeMaybe as s}from"../core/maybe.js";import{watch as c,initial as l,syncAndInitial as u}from"../core/reactiveUtils.js";import{addFrameTask as d}from"../core/scheduling.js";import{property as f,subclass as p}from"../core/accessorSupport/decorators.js";import{Attribution as m}from"./Attribution.js";import h from"./overlay/FocusRegionOverlayItem.js";import g from"./overlay/ViewOverlay.js";const _=[0,0];function v(e){let t=(e.ownerDocument||window.document).defaultView,n=e.getBoundingClientRect();return _[0]=n.left+(t?.pageXOffset??0),_[1]=n.top+(t?.pageYOffset??0),_}function y(e){e&&(e.textContent=``,e.parentNode&&e.parentNode.removeChild(e))}const b=process.env.NODE_ENV===`test`,x=b?0:16,S=b?0:750,C=b?0:512,w={left:0,top:0,right:0,bottom:0},T={toggle:`KeyO`,resizeLarger:`ArrowUp`,resizeSmaller:`ArrowDown`,select:new Set([`Enter`,`Space`])},E=_=>{let b=_,E=class extends b{constructor(...e){super(...e),this._freqInfo={freq:x,time:S},this._overlayRenderTaskHandle=null,this._focusRegionOverlayItem=new h,this.aria={},this.attributionMode=null,this.height=0,this.focusRegionEnabled=!1,this.messagesCommon=null,this.overlay=null,this.position=null,this.resizing=!1,this.root=null,this.surface=null,this.suspended=!0,this.userContent=null,this.width=0,this.widthBreakpoint=null,this.addHandles([c(()=>[this.focusRegionEnabled,this.overlay,this.ready],()=>this._syncFocusRegionOverlayItemVisibility(this.focusRegionEnabled&&this.ready),{initial:!0}),c(()=>this.cursor,e=>{let{surface:t}=this;t&&t.setAttribute(`data-cursor`,e)}),c(()=>this.navigating,e=>{let{surface:t}=this;t&&t.setAttribute(`data-navigating`,e.toString())}),c(()=>[this.aria,this.surface],()=>this._updateAria(),{initial:!0}),c(()=>{let{left:e,top:t,right:n,bottom:r}=this.padding??w;return[this.width,this.height,e,t,n,r]},([e,t,n,r,i,a])=>{let{_focusRegionOverlayItem:o}=this;o.backgroundHeight=t,o.backgroundWidth=e,o.padding={left:n,top:r,right:i,bottom:a},o.updateBoxSize()})])}initialize(){let e=this;this.addHandles([c(()=>this.ui,(e,t)=>this._handleUIChange(e,t),l),e.on(`focus`,()=>this.notifyChange(`focused`)),e.on(`blur`,()=>this.notifyChange(`focused`)),e.on(`key-down`,t=>{let{shiftKey:n,altKey:r,code:i,defaultPrevented:a}=t.native,{toggle:o,resizeLarger:s,resizeSmaller:c,select:l}=T,u=this.focusRegionEnabled&&n&&r&&(i===s||i===c);if(!t.repeat||u){if(!a&&n&&r&&i===o){this._toggleFocusRegion(),t.preventDefault();return}if(!a&&u){let{_focusRegionOverlayItem:e}=this;e.resizeBoxSize(i===s?50:-50),t.preventDefault(),t.native.stopPropagation(),t.stopPropagation();return}if(!a&&this.focusRegionEnabled&&l.has(i)){this._selectFocusRegion(t,e);return}}})])}destroy(){this.destroyed||(this.focusRegionEnabled=!1,this._syncFocusRegionOverlayItemVisibility(!1),this.ui?.destroy(),this.container=null)}get attributionHeight(){return this._attribution?.height??0}get container(){return this._get(`container`)??null}set container(e){let r=this._get(`container`),i=t(e);if(!i&&typeof e==`string`&&a.getLogger(this).error(`#container`,`element with id '${e}' not found`),r===i)return;if(this._stopMeasuring(),this.removeHandles(`container`),r&&(r.classList.remove(`esri-view`),this._overlayRenderTaskHandle&&=(this._overlayRenderTaskHandle.remove(),null),this.overlay&&(this.overlay.destroy(),this._set(`overlay`,null)),this._attribution=o(this._attribution),this.root&&(y(this.root),this._set(`root`,null)),this.userContent&&(n(this.userContent,r),y(this.userContent),this._set(`userContent`,null))),!i){this._set(`width`,0),this._set(`height`,0),this._set(`position`,null),this._set(`suspended`,!0),this._set(`surface`,null),this._set(`container`,null);return}i.classList.add(`esri-view`);let f=document.createElement(`div`);f.className=`esri-view-user-storage`,n(i,f),i.appendChild(f),this._set(`userContent`,f);let p=document.createElement(`div`);p.className=`esri-view-root`,i.insertBefore(p,i.firstChild),this._set(`root`,p);let h=document.createElement(`div`);h.className=`esri-view-surface`,h.setAttribute(`role`,`application`),h.tabIndex=0,p.appendChild(h),this._set(`surface`,h);let _=new g;p.appendChild(_.surface),this._set(`overlay`,_),this._syncFocusRegionOverlayItemVisibility(!1),this.addHandles(c(()=>_.needsRender,e=>{this._overlayRenderTaskHandle=e&&!this._overlayRenderTaskHandle?d({render:()=>this.overlay?.render()}):s(this._overlayRenderTaskHandle)},l),`container`),this.addHandles([c(()=>({visible:this.attributionVisible,items:this.attributionItems,mode:this.attributionMode}),({visible:e,items:t,mode:n})=>{if(!e){this._attribution=o(this._attribution);return}this._attribution||=new m({attributionItems:this.attributionItems,mode:this.attributionMode}),this._attribution.appendBefore(p,this.ui?.container??null),this._attribution.attributionItems=t,this._attribution.mode=n},u)],`container`),this.forceDOMReadyCycle(),this._set(`container`,i),this._startMeasuring()}get focused(){let e=document.activeElement===this.surface;return document.hasFocus()&&e}get focusRegion(){return this.focusRegionEnabled?this._focusRegionOverlayItem.getScreenRect():null}get size(){return[this.width,this.height]}get ui(){return this._get(`ui`)}set ui(e){let t=this._get(`ui`);t!==e&&t?.destroy(),this._set(`ui`,e)}blur(){this.surface?.blur()}focus(){this.surface?.focus()}pageToContainer(e,t,n){let r=this.position;return e-=r?r[0]:0,t-=r?r[1]:0,n?(n[0]=e,n[1]=t):n=[e,t],n}containerToPage(e,t,n){let r=this.position;return e+=r?r[0]:0,t+=r?r[1]:0,n?(n[0]=e,n[1]=t):n=[e,t],n}_updateAria(){let{surface:e,aria:t}=this;e&&(e.ariaLabelledByElements=t?.labelledByElements??null,e.ariaDescribedByElements=t?.describedByElements??null,e.ariaLabel=t?.label??null,e.ariaDescription=t?.description??null)}_selectFocusRegion(e,t){let n=this._makeFocusRegionSelectEvent(e);t.emit(`focus-region-select`,n),e.preventDefault()}_makeFocusRegionSelectEvent(e){let t={type:`focus-region-select`,native:e.native,defaultPrevented:!1,preventDefault:()=>{t.defaultPrevented=!0},stopPropagation:()=>{e.stopPropagation()}};return t}_toggleFocusRegion(){this.focusRegionEnabled=!this.focusRegionEnabled}_updateFocusRegionOverlayItem(){let{_focusRegionOverlayItem:e}=this;e.backgroundHeight=this.height,e.backgroundWidth=this.width,e.padding=this.padding??w,e.updateBoxSize()}_syncFocusRegionOverlayItemVisibility(e){let{_focusRegionOverlayItem:t,overlay:n}=this,r=e;t.visible=r,n&&(n.removeItem(t),r&&(this._updateFocusRegionOverlayItem(),n.addItem(t)))}_handleUIChange(e,t){this.removeHandles(`ui`),t&&t!==e&&t.destroy(),e&&(e.view=this,this.addHandles(c(()=>this.root,t=>{if(!t)e.container=null;else{let n=document.createElement(`div`);t.insertBefore(n,this._attribution?.surface??null),e.container=n}},l),`ui`)),this._set(`ui`,e)}_stopMeasuring(){this.removeHandles(`measuring`),this._get(`resizing`)&&this._set(`resizing`,!1)}_startMeasuring(){let e=this._freqInfo;e.freq=x,e.time=S;let t=d({prepare:e=>{let n=this._measure(),r=this._freqInfo;r.time+=e.deltaTime,n&&(r.freq=x,this._get(`resizing`)||this._set(`resizing`,!0)),!(r.time<r.freq)&&(r.time=0,r.freq=this._position()||n?x:Math.min(S,r.freq*2),!n&&r.freq>=C&&(t.pause(),this._get(`resizing`)&&this._set(`resizing`,!1)))}}),n=new ResizeObserver(n=>{e.freq=x,e.time=S,t.resume()});this.container!=null&&n.observe(this.container);let a=i(()=>n.disconnect());this.addHandles([r(window,`resize`,()=>{e.freq=x,e.time=S,t.resume()}),a,t],`measuring`),this._measure(),this._position()}_measure(){let e=this.container,t=e?e.clientWidth:0,n=e?e.clientHeight:0;if(t===0||n===0)return this.suspended||this._set(`suspended`,!0),!1;let r=this.width,i=this.height;return t===r&&n===i?(this.suspended&&this._set(`suspended`,!1),!1):(this._set(`width`,t),this._set(`height`,n),this.suspended&&this._set(`suspended`,!1),this.emit(`resize`,{oldWidth:r,oldHeight:i,width:t,height:n}),!0)}_position(){let e=this.container,t=this.position,n=e&&v(e);return n&&(!t||n[0]!==t[0]||n[1]!==t[1])?(this._set(`position`,[n[0],n[1]]),!0):!1}forceDOMReadyCycle(){}};return e([f()],E.prototype,`_attribution`,void 0),e([f()],E.prototype,`aria`,void 0),e([f()],E.prototype,`attributionHeight`,null),e([f()],E.prototype,`attributionMode`,void 0),e([f()],E.prototype,`container`,null),e([f({readOnly:!0})],E.prototype,`focused`,null),e([f({readOnly:!0})],E.prototype,`height`,void 0),e([f()],E.prototype,`focusRegionEnabled`,void 0),e([f()],E.prototype,`focusRegion`,null),e([f()],E.prototype,`messagesCommon`,void 0),e([f({type:g})],E.prototype,`overlay`,void 0),e([f({readOnly:!0})],E.prototype,`position`,void 0),e([f({readOnly:!0})],E.prototype,`resizing`,void 0),e([f({readOnly:!0})],E.prototype,`root`,void 0),e([f({value:null,readOnly:!0})],E.prototype,`size`,null),e([f({readOnly:!0})],E.prototype,`surface`,void 0),e([f({readOnly:!0})],E.prototype,`suspended`,void 0),e([f({nonNullable:!0})],E.prototype,`ui`,null),e([f({readOnly:!0})],E.prototype,`userContent`,void 0),e([f({readOnly:!0})],E.prototype,`width`,void 0),e([f()],E.prototype,`widthBreakpoint`,void 0),E=e([p(`esri.views.DOMContainer`)],E),E};export{E as DOMContainer};
2
+ import{__decorate as e}from"tslib";import{byId as t,reparent as n}from"../core/domUtils.js";import{on as r}from"../core/events.js";import{makeHandle as i}from"../core/handleUtils.js";import a from"../core/Logger.js";import{destroyMaybe as o,removeMaybe as s}from"../core/maybe.js";import{watch as c,initial as l,syncAndInitial as u}from"../core/reactiveUtils.js";import{addFrameTask as d}from"../core/scheduling.js";import{property as f,subclass as p}from"../core/accessorSupport/decorators.js";import{Attribution as m}from"./Attribution.js";import h from"./overlay/FocusRegionOverlayItem.js";import g from"./overlay/ViewOverlay.js";const _=[0,0];function v(e){let t=(e.ownerDocument||window.document).defaultView,n=e.getBoundingClientRect();return _[0]=n.left+(t?.pageXOffset??0),_[1]=n.top+(t?.pageYOffset??0),_}function y(e){e&&(e.textContent=``,e.parentNode&&e.parentNode.removeChild(e))}const b=process.env.NODE_ENV===`test`,x=b?0:16,S=b?0:750,C=b?0:512,w={left:0,top:0,right:0,bottom:0},T={toggle:`KeyO`,resizeLarger:`ArrowUp`,resizeSmaller:`ArrowDown`,select:new Set([`Enter`,`Space`])},E=_=>{let b=_,E=class extends b{constructor(...e){super(...e),this._freqInfo={freq:x,time:S},this._overlayRenderTaskHandle=null,this._focusRegionOverlayItem=new h,this.aria={},this.attributionMode=null,this.height=0,this.focusRegionVisible=!1,this.focusRegionShortcutEnabled=!1,this.messagesCommon=null,this.overlay=null,this.position=null,this.resizing=!1,this.root=null,this.surface=null,this.suspended=!0,this.userContent=null,this.width=0,this.widthBreakpoint=null,this.addHandles([c(()=>[this.focusRegionVisible,this.overlay,this.ready],()=>this._syncFocusRegionOverlayItemVisibility(this.focusRegionVisible&&this.ready),{initial:!0}),c(()=>this.cursor,e=>{let{surface:t}=this;t&&t.setAttribute(`data-cursor`,e)}),c(()=>this.navigating,e=>{let{surface:t}=this;t&&t.setAttribute(`data-navigating`,e.toString())}),c(()=>[this.aria,this.surface],()=>this._updateAria(),{initial:!0}),c(()=>{let{left:e,top:t,right:n,bottom:r}=this.padding??w;return[this.width,this.height,e,t,n,r]},([e,t,n,r,i,a])=>{let{_focusRegionOverlayItem:o}=this;o.backgroundHeight=t,o.backgroundWidth=e,o.padding={left:n,top:r,right:i,bottom:a},o.updateBoxSize()})])}initialize(){let e=this;this.addHandles([c(()=>this.ui,(e,t)=>this._handleUIChange(e,t),l),e.on(`focus`,()=>this.notifyChange(`focused`)),e.on(`blur`,()=>this.notifyChange(`focused`)),e.on(`key-down`,t=>{let{shiftKey:n,altKey:r,code:i,defaultPrevented:a}=t.native,{toggle:o,resizeLarger:s,resizeSmaller:c,select:l}=T,u=this.focusRegionVisible&&n&&r&&(i===s||i===c);if(!t.repeat||u){if(!a&&n&&r&&i===o&&this.focusRegionShortcutEnabled){this._toggleFocusRegion(),t.preventDefault();return}if(!a&&u){let{_focusRegionOverlayItem:e}=this;e.resizeBoxSize(i===s?50:-50),t.preventDefault(),t.native.stopPropagation(),t.stopPropagation();return}if(!a&&this.focusRegionVisible&&l.has(i)){this._selectFocusRegion(t,e);return}}})])}destroy(){this.destroyed||(this.focusRegionVisible=!1,this._syncFocusRegionOverlayItemVisibility(!1),this.ui?.destroy(),this.container=null)}get attributionHeight(){return this._attribution?.height??0}get container(){return this._get(`container`)??null}set container(e){let r=this._get(`container`),i=t(e);if(!i&&typeof e==`string`&&a.getLogger(this).error(`#container`,`element with id '${e}' not found`),r===i)return;if(this._stopMeasuring(),this.removeHandles(`container`),r&&(r.classList.remove(`esri-view`),this._overlayRenderTaskHandle&&=(this._overlayRenderTaskHandle.remove(),null),this.overlay&&(this.overlay.destroy(),this._set(`overlay`,null)),this._attribution=o(this._attribution),this.root&&(y(this.root),this._set(`root`,null)),this.userContent&&(n(this.userContent,r),y(this.userContent),this._set(`userContent`,null))),!i){this._set(`width`,0),this._set(`height`,0),this._set(`position`,null),this._set(`suspended`,!0),this._set(`surface`,null),this._set(`container`,null);return}i.classList.add(`esri-view`);let f=document.createElement(`div`);f.className=`esri-view-user-storage`,n(i,f),i.appendChild(f),this._set(`userContent`,f);let p=document.createElement(`div`);p.className=`esri-view-root`,i.insertBefore(p,i.firstChild),this._set(`root`,p);let h=document.createElement(`div`);h.className=`esri-view-surface`,h.setAttribute(`role`,`application`),h.tabIndex=0,p.appendChild(h),this._set(`surface`,h);let _=new g;p.appendChild(_.surface),this._set(`overlay`,_),this._syncFocusRegionOverlayItemVisibility(!1),this.addHandles(c(()=>_.needsRender,e=>{this._overlayRenderTaskHandle=e&&!this._overlayRenderTaskHandle?d({render:()=>this.overlay?.render()}):s(this._overlayRenderTaskHandle)},l),`container`),this.addHandles([c(()=>({visible:this.attributionVisible,items:this.attributionItems,mode:this.attributionMode}),({visible:e,items:t,mode:n})=>{if(!e){this._attribution=o(this._attribution);return}this._attribution||=new m({attributionItems:this.attributionItems,mode:this.attributionMode}),this._attribution.appendBefore(p,this.ui?.container??null),this._attribution.attributionItems=t,this._attribution.mode=n},u)],`container`),this.forceDOMReadyCycle(),this._set(`container`,i),this._startMeasuring()}get focused(){let e=document.activeElement===this.surface;return document.hasFocus()&&e}get focusRegion(){return this.focusRegionVisible?this._focusRegionOverlayItem.getScreenRect():null}get size(){return[this.width,this.height]}get ui(){return this._get(`ui`)}set ui(e){let t=this._get(`ui`);t!==e&&t?.destroy(),this._set(`ui`,e)}blur(){this.surface?.blur()}focus(){this.surface?.focus()}pageToContainer(e,t,n){let r=this.position;return e-=r?r[0]:0,t-=r?r[1]:0,n?(n[0]=e,n[1]=t):n=[e,t],n}containerToPage(e,t,n){let r=this.position;return e+=r?r[0]:0,t+=r?r[1]:0,n?(n[0]=e,n[1]=t):n=[e,t],n}_updateAria(){let{surface:e,aria:t}=this;e&&(e.ariaLabelledByElements=t?.labelledByElements??null,e.ariaDescribedByElements=t?.describedByElements??null,e.ariaLabel=t?.label??null,e.ariaDescription=t?.description??null)}_selectFocusRegion(e,t){let n=this._makeFocusRegionSelectEvent(e);t.emit(`focus-region-select`,n),e.preventDefault()}_makeFocusRegionSelectEvent(e){let t={type:`focus-region-select`,native:e.native,defaultPrevented:!1,preventDefault:()=>{t.defaultPrevented=!0},stopPropagation:()=>{e.stopPropagation()}};return t}_toggleFocusRegion(){this.focusRegionVisible=!this.focusRegionVisible}_updateFocusRegionOverlayItem(){let{_focusRegionOverlayItem:e}=this;e.backgroundHeight=this.height,e.backgroundWidth=this.width,e.padding=this.padding??w,e.updateBoxSize()}_syncFocusRegionOverlayItemVisibility(e){let{_focusRegionOverlayItem:t,overlay:n}=this,r=e;t.visible=r,n&&(n.removeItem(t),r&&(this._updateFocusRegionOverlayItem(),n.addItem(t)))}_handleUIChange(e,t){this.removeHandles(`ui`),t&&t!==e&&t.destroy(),e&&(e.view=this,this.addHandles(c(()=>this.root,t=>{if(!t)e.container=null;else{let n=document.createElement(`div`);t.insertBefore(n,this._attribution?.surface??null),e.container=n}},l),`ui`)),this._set(`ui`,e)}_stopMeasuring(){this.removeHandles(`measuring`),this._get(`resizing`)&&this._set(`resizing`,!1)}_startMeasuring(){let e=this._freqInfo;e.freq=x,e.time=S;let t=d({prepare:e=>{let n=this._measure(),r=this._freqInfo;r.time+=e.deltaTime,n&&(r.freq=x,this._get(`resizing`)||this._set(`resizing`,!0)),!(r.time<r.freq)&&(r.time=0,r.freq=this._position()||n?x:Math.min(S,r.freq*2),!n&&r.freq>=C&&(t.pause(),this._get(`resizing`)&&this._set(`resizing`,!1)))}}),n=new ResizeObserver(n=>{e.freq=x,e.time=S,t.resume()});this.container!=null&&n.observe(this.container);let a=i(()=>n.disconnect());this.addHandles([r(window,`resize`,()=>{e.freq=x,e.time=S,t.resume()}),a,t],`measuring`),this._measure(),this._position()}_measure(){let e=this.container,t=e?e.clientWidth:0,n=e?e.clientHeight:0;if(t===0||n===0)return this.suspended||this._set(`suspended`,!0),!1;let r=this.width,i=this.height;return t===r&&n===i?(this.suspended&&this._set(`suspended`,!1),!1):(this._set(`width`,t),this._set(`height`,n),this.suspended&&this._set(`suspended`,!1),this.emit(`resize`,{oldWidth:r,oldHeight:i,width:t,height:n}),!0)}_position(){let e=this.container,t=this.position,n=e&&v(e);return n&&(!t||n[0]!==t[0]||n[1]!==t[1])?(this._set(`position`,[n[0],n[1]]),!0):!1}forceDOMReadyCycle(){}};return e([f()],E.prototype,`_attribution`,void 0),e([f()],E.prototype,`aria`,void 0),e([f()],E.prototype,`attributionHeight`,null),e([f()],E.prototype,`attributionMode`,void 0),e([f()],E.prototype,`container`,null),e([f({readOnly:!0})],E.prototype,`focused`,null),e([f({readOnly:!0})],E.prototype,`height`,void 0),e([f()],E.prototype,`focusRegionVisible`,void 0),e([f()],E.prototype,`focusRegionShortcutEnabled`,void 0),e([f()],E.prototype,`focusRegion`,null),e([f()],E.prototype,`messagesCommon`,void 0),e([f({type:g})],E.prototype,`overlay`,void 0),e([f({readOnly:!0})],E.prototype,`position`,void 0),e([f({readOnly:!0})],E.prototype,`resizing`,void 0),e([f({readOnly:!0})],E.prototype,`root`,void 0),e([f({value:null,readOnly:!0})],E.prototype,`size`,null),e([f({readOnly:!0})],E.prototype,`surface`,void 0),e([f({readOnly:!0})],E.prototype,`suspended`,void 0),e([f({nonNullable:!0})],E.prototype,`ui`,null),e([f({readOnly:!0})],E.prototype,`userContent`,void 0),e([f({readOnly:!0})],E.prototype,`width`,void 0),e([f()],E.prototype,`widthBreakpoint`,void 0),E=e([p(`esri.views.DOMContainer`)],E),E};export{E as DOMContainer};
@@ -17,6 +17,7 @@ export interface PopupViewProperties extends Partial<Pick<PopupView, "popupEnabl
17
17
  * when the user clicks on the view and [popupEnabled](https://developers.arcgis.com/javascript/latest/references/core/views/PopupView/#popupEnabled) is `true`, when the [openPopup](https://developers.arcgis.com/javascript/latest/references/core/views/PopupView/#openPopup) method is called,
18
18
  * or when some widgets need the popup, such as [Search](https://developers.arcgis.com/javascript/latest/references/core/widgets/Search/). If [popup](https://developers.arcgis.com/javascript/latest/references/core/views/PopupView/#popup) is `null`, the popup instance will not be created.
19
19
  *
20
+ * @deprecated since version 5.2. Use the `popupElement` on the [Map](/references/map-components/components/arcgis-map/#popupElement), [Scene](/references/map-components/components/arcgis-scene/#popupElement), or [Link Chart](/references/map-components/components/arcgis-link-chart/#popupElement) components instead.
20
21
  * @see [popupEnabled](https://developers.arcgis.com/javascript/latest/references/core/views/PopupView/#popupEnabled)
21
22
  * @see [openPopup()](https://developers.arcgis.com/javascript/latest/references/core/views/PopupView/#openPopup)
22
23
  * @see [Loading the Popup](https://developers.arcgis.com/javascript/latest/references/core/widgets/Popup/#loading-the-popup)
@@ -57,6 +58,7 @@ export abstract class PopupView {
57
58
  * when the user clicks on the view and [popupEnabled](https://developers.arcgis.com/javascript/latest/references/core/views/PopupView/#popupEnabled) is `true`, when the [openPopup](https://developers.arcgis.com/javascript/latest/references/core/views/PopupView/#openPopup) method is called,
58
59
  * or when some widgets need the popup, such as [Search](https://developers.arcgis.com/javascript/latest/references/core/widgets/Search/). If [popup](https://developers.arcgis.com/javascript/latest/references/core/views/PopupView/#popup) is `null`, the popup instance will not be created.
59
60
  *
61
+ * @deprecated since version 5.2. Use the `popupElement` on the [Map](/references/map-components/components/arcgis-map/#popupElement), [Scene](/references/map-components/components/arcgis-scene/#popupElement), or [Link Chart](/references/map-components/components/arcgis-link-chart/#popupElement) components instead.
60
62
  * @see [popupEnabled](https://developers.arcgis.com/javascript/latest/references/core/views/PopupView/#popupEnabled)
61
63
  * @see [openPopup()](https://developers.arcgis.com/javascript/latest/references/core/views/PopupView/#openPopup)
62
64
  * @see [Loading the Popup](https://developers.arcgis.com/javascript/latest/references/core/widgets/Popup/#loading-the-popup)
@@ -79,6 +81,7 @@ export abstract class PopupView {
79
81
  * view.popup = null;
80
82
  */
81
83
  get popup(): Popup | null | undefined;
84
+ /** @deprecated */
82
85
  set popup(value: Popup | PopupProperties | null | undefined);
83
86
  /**
84
87
  * Controls whether the popup opens when users click on the view.
@@ -90,6 +93,7 @@ export abstract class PopupView {
90
93
  * When `false`, the click event is ignored and [popup](https://developers.arcgis.com/javascript/latest/references/core/views/PopupView/#popup) is not created for features but will open for other
91
94
  * scenarios that use a popup, such as displaying Search results.
92
95
  *
96
+ * @deprecated since version 5.2. Use the `popupDisabled` property on the [Map](/references/map-components/components/arcgis-map/#popupDisabled), [Scene](/references/map-components/components/arcgis-scene/#popupDisabled), or [Link Chart](/references/map-components/components/arcgis-link-chart/#popupDisabled) components instead.
93
97
  * @default true
94
98
  * @since 4.27
95
99
  * @see [popup](https://developers.arcgis.com/javascript/latest/references/core/views/PopupView/#popup)
@@ -109,6 +113,7 @@ export abstract class PopupView {
109
113
  /**
110
114
  * Closes the popup.
111
115
  *
116
+ * @deprecated since version 5.2. Use the `closePopup()` method on the [Map](/references/map-components/components/arcgis-map/#closePopup), [Scene](/references/map-components/components/arcgis-scene/#closePopup), or [Link Chart](/references/map-components/components/arcgis-link-chart/#closePopup) components instead.
112
117
  * @since 4.27
113
118
  * @see [popup](https://developers.arcgis.com/javascript/latest/references/core/views/PopupView/#popup)
114
119
  * @see [openPopup()](https://developers.arcgis.com/javascript/latest/references/core/views/PopupView/#openPopup)
@@ -201,6 +206,7 @@ export abstract class PopupView {
201
206
  * > the view's size constraints in [dockOptions](https://developers.arcgis.com/javascript/latest/references/core/widgets/Popup/#dockOptions) are met or the [location](https://developers.arcgis.com/javascript/latest/references/core/widgets/Popup/#location)
202
207
  * > property is set to a geometry.
203
208
  *
209
+ * @deprecated since version 5.2. Use the `openPopup()` method on the [Map](/references/map-components/components/arcgis-map/#openPopup), [Scene](/references/map-components/components/arcgis-scene/#openPopup), or [Link Chart](/references/map-components/components/arcgis-link-chart/#openPopup) components instead.
204
210
  * @param options - Defines the location and content of the popup when opened.
205
211
  * @returns Resolves when the popup is opened. Calling `openPopup()` or `closePopup()` again rejects the Promise.
206
212
  * @since 4.27