@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"../../../../analysis/Viewshed.js";import n from"../../../../core/Accessor.js";import"../../../../core/has.js";import{createAbortError as r,throwIfAborted as i,onAbort as a}from"../../../../core/promiseUtils.js";import{watch as o,sync as s}from"../../../../core/reactiveUtils.js";import{property as c,subclass as l}from"../../../../core/accessorSupport/decorators.js";import{create as u}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{getConvertedElevation as d,absoluteHeightElevationInfo as f}from"../../../../support/elevationInfoUtils.js";import p from"../../../../symbols/support/ElevationInfo.js";import{createDrawTool as m,getFeatureReference as h}from"./placementUtils.js";import{detachToolFromView as g}from"./toolLifecycleUtils.js";import _ from"./ViewshedPlacementOperation.js";import{createViewshedPlacementRootPluginConfiguration as v}from"./ViewshedPlacementRootPlugin.js";import{computeParametersFromTargetPoint as y}from"./viewshedToolUtils.js";import{vectorToRender as b}from"../../interactive/support/viewUtils.js";import{DrawManipulator3D as x}from"../../../draw/DrawManipulator3D.js";import{ViewEventPriorities as S}from"../../../input/InputManager.js";import{sketchKeys as C}from"../../../interactive/keybindings.js";import{bindViewToolOptions as w}from"../../../interactive/options/bindViewToolOptions.js";import T from"../../../interactive/options/InteractiveToolOptions.js";const E=Symbol(`hiddenManipulatorHandle`);let D=class extends n{constructor(e){super(e),this.placementMode=`multiple`,this.observerPlacementElevationInfo=null,this.stagedViewshed=null,this._placeOperation=null,this._drawTool=null,this._renderer=null,this._toolOptions=new T,this._observerScenePoint=u(),this._targetScenePoint=u(),this._mapPointVector=u(),this.creationState=null}initialize(){this.addHandles([w(this._toolOptions,()=>this.view.options),o(()=>[this._drawTool?.tooltipManager,this.creationState],([e,t])=>{e&&(e.enabled=t===`placing-observer`)}),o(()=>[this._drawTool?.activeTooltipInfo,this.creationState],([e,t])=>{e&&(e.elevationModeContext=t===`placing-observer`?this._elevationModeContext:null)}),this.view.on(`key-down`,e=>this._handleKeyDown(e),S.DEFAULT),o(()=>{let{stagedViewshed:e}=this;return{stagedViewshed:e,stagedViewshedInAnalysis:e!=null&&this.analysis.viewsheds.includes(e)}},({stagedViewshed:e,stagedViewshedInAnalysis:t})=>{e!=null&&!t&&this.analysis.viewsheds.add(e)},s)])}destroy(){this._cancelPlacementOperation()}get updating(){return!!this._drawTool?.updating}get active(){return!!this._drawTool?.active}get _elevationModeContext(){let e=this;return{get mode(){return e._observerDrawToolElevationInfo.mode},get disabled(){return!e._drawTool?.interactiveHandleManager?.focusedHandle?.outputMapPosition},onChange:e=>this.setElevationMode(e)}}setElevationMode(e){let t=this._drawTool,n=t?.interactiveHandleManager?.focusedHandle,r=n?.outputMapPosition;if(this.creationState!==`placing-observer`||!t||!n||!r||e===this._observerDrawToolElevationInfo.mode)return;let i=this.observerPlacementElevationInfo?.clone()??new p;i.mode=e;let a=r.clone();t.activeTooltipInfo?.getConstraintFieldByName(n,`elevation`)?.locked||(a.z=d(this.view,r,this._observerDrawToolElevationInfo,i)),t.defaultZ=a.z,this.observerPlacementElevationInfo=i,t.elevationInfo=i,n.inputMapPosition=a.clone(),n.selectedSnappingResult=null,n.outputMapPosition=a}startPlaceOperation(e,t){this._removeStaged(),this.creationState=null,this._rejectPlaceOperation(r()),i(t);let{resolve:n,reject:o,promise:s}=Promise.withResolvers(),c=a(t,()=>this._cancelPlacementOperation());return this._placeOperation=new _({abortHandle:c,reject:o,resolve:n}),this.placementMode=e,this.observerPlacementElevationInfo=t?.elevationInfo,this.callbacks.setSelectedViewshed(null),this._startObserverPlacement(),s}cancelPlaceOperation(){(this.creationState!=null||this._placeOperation!=null)&&(this._cancelPlacementOperation(),this.callbacks.cancelTool())}_handleDeleteDuringCreation(){return this.creationState!=null&&(this._destroyDrawTool(),this._removeStaged(),this.callbacks.setSelectedViewshed(null),this._startObserverPlacement(),!0)}_handleKeyDown(e){this.creationState!=null&&(C.cancel===e.key?(this._handleCancelDuringCreation(),e.stopPropagation(),e.preventDefault()):C.delete.includes(e.key)&&(this._handleDeleteDuringCreation(),e.stopPropagation(),e.preventDefault()))}_handleCancelDuringCreation(){if(this._removeStaged()&&this.placementMode===`multiple`){this.callbacks.setSelectedViewshed(null),this._startObserverPlacement();return}this._destroyDrawTool(),this._abortCreation()}_removeStaged(){let{stagedViewshed:e}=this;return this.stagedViewshed=null,e?(this.analysis.viewsheds.remove(e),!0):!1}_cancelPlacementOperation(){this._destroyDrawTool(),this._removeStaged(),this.creationState=null,this._finishPlaceOperation()}_abortCreation(){this.callbacks.cancelTool(),this.creationState=null,this._finishPlaceOperation()}_handleObserverPlacementComplete(e,n,r){let i=new t({observer:e,elevationInfo:this.observerPlacementElevationInfo,feature:r});this.analysis.viewsheds.add(i),this.stagedViewshed=i,this.creationState=`placing-target`,this._updateStagedViewshed(n),this.callbacks.setSelectedViewshed(null)}_onCancel(e){let t=this._removeStaged();if(this.creationState===`placing-observer`){if(t&&this.placementMode===`multiple`){this.callbacks.setSelectedViewshed(null),this._startObserverPlacement();return}this._destroyDrawTool(e),this._abortCreation();return}if(!t){this._destroyDrawTool(e),this._abortCreation();return}if(this.creationState=`placing-observer`,this.callbacks.setSelectedViewshed(null),this.placementMode===`multiple`){this._startPointPlacement();return}this._destroyDrawTool(e),this._abortCreation()}_handleTargetPlacementComplete(e){this._updateStagedViewshed(e);let t=this.stagedViewshed;return t?.valid?(this._placeOperation?.markPlacedViewshed(),this.stagedViewshed=null,this.callbacks.setSelectedViewshed(t),!0):!1}_finishPlaceOperation(){this._clearPlaceOperationAndRun(e=>e?.finish())}_rejectPlaceOperation(e){this._clearPlaceOperationAndRun(t=>t?.reject(e))}_clearPlaceOperationAndRun(e){let t=this._placeOperation;this._placeOperation=null,this.observerPlacementElevationInfo=null,e(t)}_startObserverPlacement(){this.creationState=`placing-observer`,this._startPointPlacement()}_startPointPlacement(){this._drawTool&&this._destroyDrawTool(this._drawTool);let{drawTool:e,renderer:t}=m({analysisViewData:this.analysisViewData,snappingManager:this.snappingManager,view:this.view,toolOptions:this._toolOptions,elevationInfo:this._observerDrawToolElevationInfo,onCancel:e=>this._onCancel(e),onComplete:e=>this._onComplete(e),onManipulatorCountChange:e=>this._onManipulatorCountChange(e),isPlacingObserver:()=>this.creationState===`placing-observer`});this._drawTool=e,this._renderer=t;try{this.view.addAndActivateTool(e),e.begin([v({mode:this.placementMode,onObserverComplete:(e,t)=>this._onObserverMapPointComplete(e,t),onTargetComplete:e=>this._onTargetMapPointComplete(e),onObserverPreview:e=>this._onObserverMapPointPreview(e),onTargetPreview:e=>this._onTargetMapPointPreview(e)})])}catch(t){this._destroyDrawTool(e),this._rejectPlaceOperation(t instanceof Error?t:Error(String(t)))}}_onComplete(e){this._removeStaged(),this._finishPlaceOperation(),this._destroyDrawTool(e),this.creationState=null}_onObserverMapPointComplete(e,t){let{intersector:n,snappingManager:r,view:i}=this,a=e.clone(),o=this._toScenePoint(e,this._targetScenePoint,this._observerDrawToolElevationInfo),s=h({intersector:n,snappingManager:r,screenPoint:t,view:i});this._renderer?.updatePlacementLocation(o),this._handleObserverPlacementComplete(a,o,s),this._setDrawToolElevationInfo(f)}_onTargetMapPointComplete(e){let t=this._toScenePoint(e,this._targetScenePoint);return this._renderer?.updatePlacementLocation(t),this._handleTargetPlacementComplete(t)?(this.placementMode===`multiple`&&(this.creationState=`placing-observer`,this._setDrawToolElevationInfo(this._observerDrawToolElevationInfo),this._onObserverMapPointPreview(e)),!0):!1}_onObserverMapPointPreview(e){let t=e.clone(),n=this._toScenePoint(t,this._observerScenePoint,this._observerDrawToolElevationInfo);this._renderer?.updatePlacementLocation(n)}_onTargetMapPointPreview(e){let t=this._toScenePoint(e,this._targetScenePoint);this._renderer?.updatePlacementLocation(t),this._updateStagedViewshed(t)}_setDrawToolElevationInfo(e){let t=this._drawTool;t&&(t.elevationInfo=e)}get _observerDrawToolElevationInfo(){return this.observerPlacementElevationInfo??f}_onManipulatorCountChange(e){e.removeHandles(E);let t=[];e.manipulators.forEach(({manipulator:e})=>{e instanceof x&&t.push(e.disableDisplay())}),e.addHandles(t,E)}_destroyDrawTool(e=this._drawTool){this._drawTool=null,this._renderer=null,e&&g(this.view,e)}_toScenePoint(e,t,n=f){let{x:r,y:i,z:a,spatialReference:o}=e,s=this._mapPointVector;return s[0]=r,s[1]=i,s[2]=a??0,b(s,o,n,this.view,t)}_updateStagedViewshed(e){let t=this.stagedViewshed;if(!t)return;let n=this.callbacks.findViewshedComputedData(t);if(!n)return;let{heading:r,tilt:i,farDistance:a}=y(this.view,n,e);t.farDistance=a,t.tilt=i,t.heading=r}get test(){}};e([c({constructOnly:!0})],D.prototype,`analysis`,void 0),e([c({constructOnly:!0})],D.prototype,`analysisViewData`,void 0),e([c({constructOnly:!0})],D.prototype,`intersector`,void 0),e([c({constructOnly:!0})],D.prototype,`snappingManager`,void 0),e([c({constructOnly:!0})],D.prototype,`view`,void 0),e([c({constructOnly:!0})],D.prototype,`callbacks`,void 0),e([c()],D.prototype,`placementMode`,void 0),e([c()],D.prototype,`observerPlacementElevationInfo`,void 0),e([c()],D.prototype,`stagedViewshed`,void 0),e([c()],D.prototype,`_placeOperation`,void 0),e([c()],D.prototype,`_drawTool`,void 0),e([c()],D.prototype,`_renderer`,void 0),e([c()],D.prototype,`_toolOptions`,void 0),e([c()],D.prototype,`updating`,null),e([c()],D.prototype,`active`,null),e([c()],D.prototype,`creationState`,void 0),e([c()],D.prototype,`_elevationModeContext`,null),D=e([l(`esri.views.3d.analysis.Viewshed.ViewshedPlacementController`)],D);export{D as ViewshedPlacementController};
2
+ import{__decorate as e}from"tslib";import t from"../../../../analysis/Viewshed.js";import n from"../../../../core/Accessor.js";import"../../../../core/has.js";import{createAbortError as r,throwIfAborted as i,onAbort as a}from"../../../../core/promiseUtils.js";import{watch as o,sync as s}from"../../../../core/reactiveUtils.js";import{property as c,subclass as l}from"../../../../core/accessorSupport/decorators.js";import{create as u}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{getConvertedElevation as d,absoluteHeightElevationInfo as f}from"../../../../support/elevationInfoUtils.js";import p from"../../../../symbols/support/ElevationInfo.js";import{createDrawTool as m,getFeatureReference as h}from"./placementUtils.js";import{detachToolFromView as g}from"./toolLifecycleUtils.js";import _ from"./ViewshedPlacementOperation.js";import{createViewshedPlacementRootPluginConfiguration as v}from"./ViewshedPlacementRootPlugin.js";import{computeParametersFromTargetPoint as y}from"./viewshedToolUtils.js";import{vectorToRender as b}from"../../interactive/support/viewUtils.js";import{DrawManipulator3D as x}from"../../../draw/DrawManipulator3D.js";import{ViewEventPriorities as S}from"../../../input/InputManager.js";import{sketchKeys as C}from"../../../interactive/keybindings.js";import{bindViewToolOptions as w}from"../../../interactive/options/bindViewToolOptions.js";import T from"../../../interactive/options/InteractiveToolOptions.js";const E=Symbol(`hiddenManipulatorHandle`);let D=class extends n{constructor(e){super(e),this.placementMode=`multiple`,this.observerPlacementElevationInfo=null,this.stagedViewshed=null,this._placeOperation=null,this._drawTool=null,this._renderer=null,this._toolOptions=new T,this._observerScenePoint=u(),this._targetScenePoint=u(),this._mapPointVector=u(),this.creationState=null}initialize(){this.addHandles([w(this._toolOptions,()=>this.view.options),o(()=>[this._drawTool?.tooltipManager,this.creationState],([e,t])=>{e&&(e.enabled=t===`placing-observer`)}),o(()=>[this._drawTool?.activeTooltipInfo,this.creationState],([e,t])=>{e&&(e.elevationModeContext=t===`placing-observer`?this._elevationModeContext:null)}),this.view.on(`key-down`,e=>this._handleKeyDown(e),S.DEFAULT),o(()=>{let{stagedViewshed:e}=this;return{stagedViewshed:e,stagedViewshedInAnalysis:e!=null&&this.analysis.viewsheds.includes(e)}},({stagedViewshed:e,stagedViewshedInAnalysis:t})=>{e!=null&&!t&&this.analysis.viewsheds.add(e)},s)])}destroy(){this._cancelPlacementOperation()}get updating(){return!!this._drawTool?.updating}get active(){return!!this._drawTool?.active}get _elevationModeContext(){let e=this;return{get mode(){return e._observerDrawToolElevationInfo.mode},get disabled(){return!e._drawTool?.interactiveHandleManager?.focusedHandle?.outputMapPosition},onChange:e=>this.setElevationMode(e)}}setElevationMode(e){let t=this._drawTool,n=t?.interactiveHandleManager?.focusedHandle,r=n?.outputMapPosition;if(this.creationState!==`placing-observer`||!t||!n||!r||e===this._observerDrawToolElevationInfo.mode)return;let i=this.observerPlacementElevationInfo?.clone()??new p;i.mode=e;let a=r.clone();t.activeTooltipInfo?.getConstraintFieldByName(n,`elevation`)?.locked||(a.z=d(this.view,r,this._observerDrawToolElevationInfo,i)),t.defaultZ=a.z,this.observerPlacementElevationInfo=i,t.elevationInfo=i,n.inputMapPosition=a.clone(),n.selectedSnappingResult=null,n.outputMapPosition=a}startPlaceOperation(e,t){this._removeStaged(),this.creationState=null,this._rejectPlaceOperation(r()),i(t);let{resolve:n,reject:o,promise:s}=Promise.withResolvers(),c=a(t,()=>this._cancelPlacementOperation());this._placeOperation=new _({abortHandle:c,reject:o,resolve:n}),this.placementMode=e;let l=t?.elevationInfo;return this.observerPlacementElevationInfo=l?new p({featureExpressionInfo:l.featureExpressionInfo,mode:l.mode,offset:l.offset,unit:l.unit}):null,this.callbacks.setSelectedViewshed(null),this._startObserverPlacement(),s}cancelPlaceOperation(){(this.creationState!=null||this._placeOperation!=null)&&(this._cancelPlacementOperation(),this.callbacks.cancelTool())}_handleDeleteDuringCreation(){return this.creationState!=null&&(this._destroyDrawTool(),this._removeStaged(),this.callbacks.setSelectedViewshed(null),this._startObserverPlacement(),!0)}_handleKeyDown(e){this.creationState!=null&&(C.cancel===e.key?(this._handleCancelDuringCreation(),e.stopPropagation(),e.preventDefault()):C.delete.includes(e.key)&&(this._handleDeleteDuringCreation(),e.stopPropagation(),e.preventDefault()))}_handleCancelDuringCreation(){if(this._removeStaged()&&this.placementMode===`multiple`){this.callbacks.setSelectedViewshed(null),this._startObserverPlacement();return}this._destroyDrawTool(),this._abortCreation()}_removeStaged(){let{stagedViewshed:e}=this;return this.stagedViewshed=null,e?(this.analysis.viewsheds.remove(e),!0):!1}_cancelPlacementOperation(){this._destroyDrawTool(),this._removeStaged(),this.creationState=null,this._finishPlaceOperation()}_abortCreation(){this.callbacks.cancelTool(),this.creationState=null,this._finishPlaceOperation()}_handleObserverPlacementComplete(e,n,r){let i=new t({observer:e,elevationInfo:this.observerPlacementElevationInfo,feature:r});this.analysis.viewsheds.add(i),this.stagedViewshed=i,this.creationState=`placing-target`,this._updateStagedViewshed(n),this.callbacks.setSelectedViewshed(null)}_onCancel(e){let t=this._removeStaged();if(this.creationState===`placing-observer`){if(t&&this.placementMode===`multiple`){this.callbacks.setSelectedViewshed(null),this._startObserverPlacement();return}this._destroyDrawTool(e),this._abortCreation();return}if(!t){this._destroyDrawTool(e),this._abortCreation();return}if(this.creationState=`placing-observer`,this.callbacks.setSelectedViewshed(null),this.placementMode===`multiple`){this._startPointPlacement();return}this._destroyDrawTool(e),this._abortCreation()}_handleTargetPlacementComplete(e){this._updateStagedViewshed(e);let t=this.stagedViewshed;return t?.valid?(this._placeOperation?.markPlacedViewshed(),this.stagedViewshed=null,this.callbacks.setSelectedViewshed(t),!0):!1}_finishPlaceOperation(){this._clearPlaceOperationAndRun(e=>e?.finish())}_rejectPlaceOperation(e){this._clearPlaceOperationAndRun(t=>t?.reject(e))}_clearPlaceOperationAndRun(e){let t=this._placeOperation;this._placeOperation=null,this.observerPlacementElevationInfo=null,e(t)}_startObserverPlacement(){this.creationState=`placing-observer`,this._startPointPlacement()}_startPointPlacement(){this._drawTool&&this._destroyDrawTool(this._drawTool);let{drawTool:e,renderer:t}=m({analysisViewData:this.analysisViewData,snappingManager:this.snappingManager,view:this.view,toolOptions:this._toolOptions,elevationInfo:this._observerDrawToolElevationInfo,onCancel:e=>this._onCancel(e),onComplete:e=>this._onComplete(e),onManipulatorCountChange:e=>this._onManipulatorCountChange(e),isPlacingObserver:()=>this.creationState===`placing-observer`});this._drawTool=e,this._renderer=t;try{this.view.addAndActivateTool(e),e.begin([v({mode:this.placementMode,onObserverComplete:(e,t)=>this._onObserverMapPointComplete(e,t),onTargetComplete:e=>this._onTargetMapPointComplete(e),onObserverPreview:e=>this._onObserverMapPointPreview(e),onTargetPreview:e=>this._onTargetMapPointPreview(e)})])}catch(t){this._destroyDrawTool(e),this._rejectPlaceOperation(t instanceof Error?t:Error(String(t)))}}_onComplete(e){this._removeStaged(),this._finishPlaceOperation(),this._destroyDrawTool(e),this.creationState=null}_onObserverMapPointComplete(e,t){let{intersector:n,snappingManager:r,view:i}=this,a=e.clone(),o=this._toScenePoint(e,this._targetScenePoint,this._observerDrawToolElevationInfo),s=h({intersector:n,snappingManager:r,screenPoint:t,view:i});this._renderer?.updatePlacementLocation(o),this._handleObserverPlacementComplete(a,o,s),this._setDrawToolElevationInfo(f)}_onTargetMapPointComplete(e){let t=this._toScenePoint(e,this._targetScenePoint);return this._renderer?.updatePlacementLocation(t),this._handleTargetPlacementComplete(t)?(this.placementMode===`multiple`&&(this.creationState=`placing-observer`,this._setDrawToolElevationInfo(this._observerDrawToolElevationInfo),this._onObserverMapPointPreview(e)),!0):!1}_onObserverMapPointPreview(e){let t=e.clone(),n=this._toScenePoint(t,this._observerScenePoint,this._observerDrawToolElevationInfo);this._renderer?.updatePlacementLocation(n)}_onTargetMapPointPreview(e){let t=this._toScenePoint(e,this._targetScenePoint);this._renderer?.updatePlacementLocation(t),this._updateStagedViewshed(t)}_setDrawToolElevationInfo(e){let t=this._drawTool;t&&(t.elevationInfo=e)}get _observerDrawToolElevationInfo(){return this.observerPlacementElevationInfo??f}_onManipulatorCountChange(e){e.removeHandles(E);let t=[];e.manipulators.forEach(({manipulator:e})=>{e instanceof x&&t.push(e.disableDisplay())}),e.addHandles(t,E)}_destroyDrawTool(e=this._drawTool){this._drawTool=null,this._renderer=null,e&&g(this.view,e)}_toScenePoint(e,t,n=f){let{x:r,y:i,z:a,spatialReference:o}=e,s=this._mapPointVector;return s[0]=r,s[1]=i,s[2]=a??0,b(s,o,n,this.view,t)}_updateStagedViewshed(e){let t=this.stagedViewshed;if(!t)return;let n=this.callbacks.findViewshedComputedData(t);if(!n)return;let{heading:r,tilt:i,farDistance:a}=y(this.view,n,e);t.farDistance=a,t.tilt=i,t.heading=r}get test(){}};e([c({constructOnly:!0})],D.prototype,`analysis`,void 0),e([c({constructOnly:!0})],D.prototype,`analysisViewData`,void 0),e([c({constructOnly:!0})],D.prototype,`intersector`,void 0),e([c({constructOnly:!0})],D.prototype,`snappingManager`,void 0),e([c({constructOnly:!0})],D.prototype,`view`,void 0),e([c({constructOnly:!0})],D.prototype,`callbacks`,void 0),e([c()],D.prototype,`placementMode`,void 0),e([c()],D.prototype,`observerPlacementElevationInfo`,void 0),e([c()],D.prototype,`stagedViewshed`,void 0),e([c()],D.prototype,`_placeOperation`,void 0),e([c()],D.prototype,`_drawTool`,void 0),e([c()],D.prototype,`_renderer`,void 0),e([c()],D.prototype,`_toolOptions`,void 0),e([c()],D.prototype,`updating`,null),e([c()],D.prototype,`active`,null),e([c()],D.prototype,`creationState`,void 0),e([c()],D.prototype,`_elevationModeContext`,null),D=e([l(`esri.views.3d.analysis.Viewshed.ViewshedPlacementController`)],D);export{D as ViewshedPlacementController};
@@ -1,5 +1,6 @@
1
1
  import type ElevationInfo from "../../../../symbols/support/ElevationInfo.js";
2
2
  import type { AbortOptions } from "../../../../core/promiseUtils.js";
3
+ import type { ElevationInfoProperties } from "../../../../symbols/support/ElevationInfo.js";
3
4
 
4
5
  /**
5
6
  * Options for placing a viewshed interactively.
@@ -9,10 +10,11 @@ import type { AbortOptions } from "../../../../core/promiseUtils.js";
9
10
  export interface ViewshedPlacementOptions extends AbortOptions {
10
11
  /**
11
12
  * Specifies how the placed viewshed observer is positioned on the vertical axis (z).
13
+ * Accepts an [ElevationInfo](https://developers.arcgis.com/javascript/latest/references/core/symbols/support/ElevationInfo/) instance or a plain object with elevation information properties.
12
14
  *
13
15
  * @since 5.2
14
16
  */
15
- elevationInfo?: ElevationInfo | null;
17
+ elevationInfo?: ElevationInfo | ElevationInfoProperties | null;
16
18
  }
17
19
 
18
20
  /**
@@ -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"../../../Graphic.js";import n from"../../../core/Error.js";import r from"../../../core/Logger.js";import{destroyMaybe as i}from"../../../core/maybe.js";import{throwIfAborted as a,throwIfAbortError as o}from"../../../core/promiseUtils.js";import{syncAndInitial as s,initial as c}from"../../../core/reactiveUtils.js";import{property as l,subclass as u}from"../../../core/accessorSupport/decorators.js";import d from"../../../core/sql/WhereClause.js";import{fallbackObjectIDAttribute as f}from"../../../layers/LayerConstants.js";import"../../../layers/buildingSublayers/BuildingComponentSublayer.js";import p from"../../../layers/support/FeatureFilter.js";import{fixFields as m,unpackFieldNames as h,populateMissingFields as g}from"../../../layers/support/fieldUtils.js";import _ from"../../../rest/support/Query.js";import{isNumber as v}from"../../../support/guards.js";import{BuildingSublayerView3DMixin as y}from"./BuildingSublayerView3D.js";import{I3SMeshView3D as b}from"./I3SMeshView3D.js";import{applyFilterMode as x}from"./i3s/BuildingFilterUtil.js";import{createGetFeatureExtent as S}from"./i3s/I3SGeometryUtil.js";import{I3SMeshViewFilter as C}from"./i3s/I3SMeshViewFilter.js";import{I3SQueryEngine as w}from"./i3s/I3SQueryEngine.js";import{I3SQueryFeatureAdapter as T,I3SQueryFeature as E}from"./i3s/I3SQueryFeatureAdapter.js";import{I3SQueryFeatureStore as D}from"./i3s/I3SQueryFeatureStore.js";import{findFieldsCaseInsensitive as O,getIndexCrs as k}from"./i3s/I3SUtil.js";import{DefinitionExpressionSceneLayerView as A}from"./support/DefinitionExpressionSceneLayerView.js";import{TemporalSceneLayerView as j}from"./support/TemporalSceneLayerView.js";import M from"../../layers/BuildingComponentSublayerView.js";import{hasPopupTemplate as N,getRequiredFields as P,getFetchPopupTemplate as F}from"../../layers/support/popupUtils.js";import{isInEffectiveScaleRange as I}from"../../support/layerViewUtils.js";import{TaskPriority as L}from"../../support/Scheduler.js";let R=class extends j(A(b(y(M)))){constructor(e){super(e),this.type=`building-component-sublayer-3d`,this._elevationContext=2,this._supportsLabeling=!1,this.requiredFields=[],this.progressiveLoadFactor=1,this._queryEngine=null,this.layer=e.sublayer}get extractChanges(){return this.layerView.extractChanges}get layerViewUid(){return this.layerView.uid}get layerId(){return this.sublayer.layer.id}get sublayerId(){return this.sublayer.id}get layerPopupEnabledAndHasTemplate(){return this.sublayer.popupEnabled&&N(this.sublayer,this.layerView.view.popup?.defaultPopupTemplateEnabled)}initialize(){this._updatingHandles.add(()=>this.mergedFilter,e=>{if(e==null||!C.checkSupport(e)){this._i3sFilter=i(this._i3sFilter);return}if(this._i3sFilter!=null){this._i3sFilter.viewFilter=e;return}this._i3sFilter=new C({viewFilter:e,layerFieldsIndex:this.sublayer.fieldsIndex,loadAsyncModule:e=>this._loadAsyncModule(e),addSqlFilter:(e,t)=>this.addSqlFilter(e,t,this.logError),addTimeFilter:(e,t)=>this.addTimeFilter(e,t)})},s),this._updatingHandles.add(()=>[this.sublayer.renderer,this.definitionExpressionFields,this.filterExpressionFields],()=>this._updateRequiredFields()),this._updatingHandles.add(()=>this.sublayer.renderer,e=>this._rendererChange(e),c);let e=()=>this._filterChange();this._updatingHandles.add(()=>this.parsedDefinitionExpression,e),this._updatingHandles.add(()=>this._i3sFilter?.sortedObjectIds,e),this._updatingHandles.add(()=>this._i3sFilter?.parsedWhereClause,e),this._updatingHandles.add(()=>this.getTimeFilterDependencies(),e),this._updatingHandles.add(()=>this.mergedFilter,e),this._updatingHandles.add(()=>[this._i3sFilter?.parsedGeometry,this.filter?.spatialRelationship],()=>this._geometryFilterChange()),this._updatingHandles.add(()=>this.parsedFilterExpressions,()=>this._updateSymbologyOverride(),c),this.addResolvingPromise(this._updateRequiredFields())}get lodFactor(){return this.view.qualitySettings.sceneService.objectLoDFactor}get parsedFilterExpressions(){return this.sublayer.modelName===`Overview`?[]:this.layerView.filterExpressions.map(([e,t])=>{let n;try{n=d.create(e,{fieldsIndex:this.sublayer.fieldsIndex})}catch(e){return r.getLogger(this).error(`Failed to parse filterExpression: `+e),null}if(!n.isStandardized)return r.getLogger(this).error(`filterExpression is using non standard function`),null;let i=[],a=n.fieldNames;return O(a,this.sublayer.fieldsIndex,{missingFields:i}),i.length>0?(r.getLogger(this).error(`filterExpression references unknown fields: ${i.join(`, `)}`),null):[n,t]}).filter(e=>e!=null)}get filter(){return this._get(`filter`)}set filter(e){this._set(`filter`,C.checkSupport(e)?e:null)}isUpdating(){return super.isUpdating()||(this._i3sFilter?.updating??!1)}_updateSymbologyOverride(){let e=this.parsedFilterExpressions;e.length>0?this._setSymbologyOverride((t,n)=>{for(let[r,i]of e)try{if(r.testFeature(t))return x(n,i)}catch(e){this.logError(e)}return x(n,null)},this.filterExpressionFields):this._setSymbologyOverride(null,null)}get filterExpressionFields(){return m(this.sublayer.fieldsIndex,this.parsedFilterExpressions.reduce((e,[t])=>e.concat(t.fieldNames),[]))}get availableFields(){let e=this.sublayer,t=e.fieldsIndex,n=this.requiredFields;if(e.outFields||e.layer.outFields){let r=[...e.outFields||[],...e.layer.outFields||[]];n=[...h(t,r),...n]}return n=[...n,e.objectIdField??f],m(t,n)}get _graphicOrigin(){return this.sublayer.graphicOrigin}_createLayerGraphic(e){return new t({attributes:e,layer:this.sublayer.layer,sourceLayer:this.sublayer,origin:this._graphicOrigin})}canResume(){return super.canResume()&&I(this.sublayer.effectiveScaleRange,this.view.scale)&&(!this._controller||this._controller.rootNodeVisible)}async patchFeaturesForPopup(e,t){let n=this._validateFetchPopupFeatures(t);if(n)throw n;if(e.length===0)return[];let i=[],s=[],c=this.sublayer.associatedLayer==null?this.sublayer:await this.sublayer.associatedLayer.load(t),l=h(this.sublayer.fieldsIndex,await P(c,F(this.sublayer,t)));a(t);let u=new Set;for(let t of e)g(t,l,u)?s.push(t):i.push(t);return s.length===0?i:(this.sublayer.associatedLayer!=null&&await this.sublayer.associatedLayer.load().catch(()=>r.getLogger(this).warn(`Failed to load associated feature layer. Displaying popup attributes from cached attributes.`)),this.whenGraphicAttributes(s,Array.from(u)).catch(e=>(o(e),s)).then(e=>i.concat(e)))}async _updateRequiredFields(){let e=m(this.sublayer.fieldsIndex,[...this.sublayer.renderer?await this.sublayer.renderer.getRequiredFields(this.sublayer.fieldsIndex):[],...this.definitionExpressionFields,...this.filterExpressionFields]);this._set(`requiredFields`,e)}_validateFetchPopupFeatures(e){let{sublayer:t}=this,{popupEnabled:r}=t;if(!r)return new n(`buildingscenelayerview3d:fetchPopupFeatures`,`Popups are disabled`,{sublayer:t});if(!F(t,e))return new n(`buildingscenelayerview3d:fetchPopupFeatures`,`Layer does not define a popup template`,{sublayer:t})}getFilters(){let e=super.getFilters();return this.addSqlFilter(e,this.parsedDefinitionExpression,this.logError),this._i3sFilter?.addFilters(e,this.view,this._controller.crsIndex,this._collection),e}createQuery(){let e={outFields:[`*`],returnGeometry:!1,outSpatialReference:this.view.spatialReference};return this.filter==null?new _(e):this.filter.createQuery(e)}queryExtent(e,t){return this._ensureQueryEngine().executeQueryForExtent(this._ensureQuery(e),t?.signal)}queryFeatureCount(e,t){return this._ensureQueryEngine().executeQueryForCount(this._ensureQuery(e),t?.signal)}queryFeatures(e,t){return this._ensureQueryEngine().executeQuery(this._ensureQuery(e),t?.signal).then(e=>{if(!e?.features)return e;let t=this.sublayer,n=t.layer,r=this._graphicOrigin;for(let i of e.features)i.layer=n,i.sourceLayer=t,i.origin=r;return e})}async queryObjectIds(e,t){return(await this._ensureQueryEngine().executeQueryForIds(this._ensureQuery(e),t?.signal)).filter(v)}_ensureQueryEngine(){return this._queryEngine??=this._createQueryEngine(),this._queryEngine}_createQueryEngine(){let e=S(this.view.spatialReference,this.view.renderSpatialReference,this._collection);return new w({layerView:this,priority:L.FEATURE_QUERY_ENGINE,spatialIndex:new D({featureAdapter:new T({objectIdField:this.sublayer.objectIdField,attributeStorageInfo:this.sublayer.attributeStorageInfo,getFeatureExtent:e}),forAllFeatures:(e,t)=>this._forAllFeatures((t,n,r)=>e(new E(t,n,r)),t,2),getFeatureExtent:e,sourceSpatialReference:k(this.sublayer),viewSpatialReference:this.view.spatialReference})})}_ensureQuery(e){return this._addDefinitionExpressionToQuery(e==null?this.createQuery():_.from(e))}};e([l()],R.prototype,`layerView`,void 0),e([l()],R.prototype,`extractChanges`,null),e([l()],R.prototype,`lodFactor`,null),e([l({readOnly:!0})],R.prototype,`parsedFilterExpressions`,null),e([l({type:p})],R.prototype,`filter`,null),e([l()],R.prototype,`_i3sFilter`,void 0),e([l({type:[String],readOnly:!0})],R.prototype,`filterExpressionFields`,null),e([l({type:[String],readOnly:!0})],R.prototype,`requiredFields`,void 0),e([l({type:[String],readOnly:!0})],R.prototype,`availableFields`,null),e([l()],R.prototype,`_graphicOrigin`,null),R=e([u(`esri.views.3d.layers.BuildingComponentSublayerView3D`)],R);const z=R;export{z as default};
2
+ import{__decorate as e}from"tslib";import t from"../../../Graphic.js";import n from"../../../core/Error.js";import r from"../../../core/Logger.js";import{destroyMaybe as i}from"../../../core/maybe.js";import{throwIfAborted as a,throwIfAbortError as o}from"../../../core/promiseUtils.js";import{syncAndInitial as s,initial as c}from"../../../core/reactiveUtils.js";import{property as l,subclass as u}from"../../../core/accessorSupport/decorators.js";import d from"../../../core/sql/WhereClause.js";import{isInEffectiveScaleRange as f}from"../../../geometry/support/scaleUtils.js";import{fallbackObjectIDAttribute as p}from"../../../layers/LayerConstants.js";import"../../../layers/buildingSublayers/BuildingComponentSublayer.js";import m from"../../../layers/support/FeatureFilter.js";import{fixFields as h,unpackFieldNames as g,populateMissingFields as _}from"../../../layers/support/fieldUtils.js";import v from"../../../rest/support/Query.js";import{isNumber as y}from"../../../support/guards.js";import{BuildingSublayerView3DMixin as b}from"./BuildingSublayerView3D.js";import{I3SMeshView3D as x}from"./I3SMeshView3D.js";import{applyFilterMode as S}from"./i3s/BuildingFilterUtil.js";import{createGetFeatureExtent as C}from"./i3s/I3SGeometryUtil.js";import{I3SMeshViewFilter as w}from"./i3s/I3SMeshViewFilter.js";import{I3SQueryEngine as T}from"./i3s/I3SQueryEngine.js";import{I3SQueryFeatureAdapter as E,I3SQueryFeature as D}from"./i3s/I3SQueryFeatureAdapter.js";import{I3SQueryFeatureStore as O}from"./i3s/I3SQueryFeatureStore.js";import{findFieldsCaseInsensitive as k,getIndexCrs as A}from"./i3s/I3SUtil.js";import{DefinitionExpressionSceneLayerView as j}from"./support/DefinitionExpressionSceneLayerView.js";import{TemporalSceneLayerView as M}from"./support/TemporalSceneLayerView.js";import N from"../../layers/BuildingComponentSublayerView.js";import{hasPopupTemplate as P,getRequiredFields as F,getFetchPopupTemplate as I}from"../../layers/support/popupUtils.js";import{TaskPriority as L}from"../../support/Scheduler.js";let R=class extends M(j(x(b(N)))){constructor(e){super(e),this.type=`building-component-sublayer-3d`,this._elevationContext=2,this._supportsLabeling=!1,this.requiredFields=[],this.progressiveLoadFactor=1,this._queryEngine=null,this.layer=e.sublayer}get extractChanges(){return this.layerView.extractChanges}get layerViewUid(){return this.layerView.uid}get layerId(){return this.sublayer.layer.id}get sublayerId(){return this.sublayer.id}get layerPopupEnabledAndHasTemplate(){return this.sublayer.popupEnabled&&P(this.sublayer,this.layerView.view.popup?.defaultPopupTemplateEnabled)}initialize(){this._updatingHandles.add(()=>this.mergedFilter,e=>{if(e==null||!w.checkSupport(e)){this._i3sFilter=i(this._i3sFilter);return}if(this._i3sFilter!=null){this._i3sFilter.viewFilter=e;return}this._i3sFilter=new w({viewFilter:e,layerFieldsIndex:this.sublayer.fieldsIndex,loadAsyncModule:e=>this._loadAsyncModule(e),addSqlFilter:(e,t)=>this.addSqlFilter(e,t,this.logError),addTimeFilter:(e,t)=>this.addTimeFilter(e,t)})},s),this._updatingHandles.add(()=>[this.sublayer.renderer,this.definitionExpressionFields,this.filterExpressionFields],()=>this._updateRequiredFields()),this._updatingHandles.add(()=>this.sublayer.renderer,e=>this._rendererChange(e),c);let e=()=>this._filterChange();this._updatingHandles.add(()=>this.parsedDefinitionExpression,e),this._updatingHandles.add(()=>this._i3sFilter?.sortedObjectIds,e),this._updatingHandles.add(()=>this._i3sFilter?.parsedWhereClause,e),this._updatingHandles.add(()=>this.getTimeFilterDependencies(),e),this._updatingHandles.add(()=>this.mergedFilter,e),this._updatingHandles.add(()=>[this._i3sFilter?.parsedGeometry,this.filter?.spatialRelationship],()=>this._geometryFilterChange()),this._updatingHandles.add(()=>this.parsedFilterExpressions,()=>this._updateSymbologyOverride(),c),this.addResolvingPromise(this._updateRequiredFields())}get lodFactor(){return this.view.qualitySettings.sceneService.objectLoDFactor}get parsedFilterExpressions(){return this.sublayer.modelName===`Overview`?[]:this.layerView.filterExpressions.map(([e,t])=>{let n;try{n=d.create(e,{fieldsIndex:this.sublayer.fieldsIndex})}catch(e){return r.getLogger(this).error(`Failed to parse filterExpression: `+e),null}if(!n.isStandardized)return r.getLogger(this).error(`filterExpression is using non standard function`),null;let i=[],a=n.fieldNames;return k(a,this.sublayer.fieldsIndex,{missingFields:i}),i.length>0?(r.getLogger(this).error(`filterExpression references unknown fields: ${i.join(`, `)}`),null):[n,t]}).filter(e=>e!=null)}get filter(){return this._get(`filter`)}set filter(e){this._set(`filter`,w.checkSupport(e)?e:null)}isUpdating(){return super.isUpdating()||(this._i3sFilter?.updating??!1)}_updateSymbologyOverride(){let e=this.parsedFilterExpressions;e.length>0?this._setSymbologyOverride((t,n)=>{for(let[r,i]of e)try{if(r.testFeature(t))return S(n,i)}catch(e){this.logError(e)}return S(n,null)},this.filterExpressionFields):this._setSymbologyOverride(null,null)}get filterExpressionFields(){return h(this.sublayer.fieldsIndex,this.parsedFilterExpressions.reduce((e,[t])=>e.concat(t.fieldNames),[]))}get availableFields(){let e=this.sublayer,t=e.fieldsIndex,n=this.requiredFields;if(e.outFields||e.layer.outFields){let r=[...e.outFields||[],...e.layer.outFields||[]];n=[...g(t,r),...n]}return n=[...n,e.objectIdField??p],h(t,n)}get _graphicOrigin(){return this.sublayer.graphicOrigin}_createLayerGraphic(e){return new t({attributes:e,layer:this.sublayer.layer,sourceLayer:this.sublayer,origin:this._graphicOrigin})}canResume(){return super.canResume()&&f(this.sublayer.effectiveScaleRange,this.view.scale)&&(!this._controller||this._controller.rootNodeVisible)}async patchFeaturesForPopup(e,t){let n=this._validateFetchPopupFeatures(t);if(n)throw n;if(e.length===0)return[];let i=[],s=[],c=this.sublayer.associatedLayer==null?this.sublayer:await this.sublayer.associatedLayer.load(t),l=g(this.sublayer.fieldsIndex,await F(c,I(this.sublayer,t)));a(t);let u=new Set;for(let t of e)_(t,l,u)?s.push(t):i.push(t);return s.length===0?i:(this.sublayer.associatedLayer!=null&&await this.sublayer.associatedLayer.load().catch(()=>r.getLogger(this).warn(`Failed to load associated feature layer. Displaying popup attributes from cached attributes.`)),this.whenGraphicAttributes(s,Array.from(u)).catch(e=>(o(e),s)).then(e=>i.concat(e)))}async _updateRequiredFields(){let e=h(this.sublayer.fieldsIndex,[...this.sublayer.renderer?await this.sublayer.renderer.getRequiredFields(this.sublayer.fieldsIndex):[],...this.definitionExpressionFields,...this.filterExpressionFields]);this._set(`requiredFields`,e)}_validateFetchPopupFeatures(e){let{sublayer:t}=this,{popupEnabled:r}=t;if(!r)return new n(`buildingscenelayerview3d:fetchPopupFeatures`,`Popups are disabled`,{sublayer:t});if(!I(t,e))return new n(`buildingscenelayerview3d:fetchPopupFeatures`,`Layer does not define a popup template`,{sublayer:t})}getFilters(){let e=super.getFilters();return this.addSqlFilter(e,this.parsedDefinitionExpression,this.logError),this._i3sFilter?.addFilters(e,this.view,this._controller.crsIndex,this._collection),e}createQuery(){let e={outFields:[`*`],returnGeometry:!1,outSpatialReference:this.view.spatialReference};return this.filter==null?new v(e):this.filter.createQuery(e)}queryExtent(e,t){return this._ensureQueryEngine().executeQueryForExtent(this._ensureQuery(e),t?.signal)}queryFeatureCount(e,t){return this._ensureQueryEngine().executeQueryForCount(this._ensureQuery(e),t?.signal)}queryFeatures(e,t){return this._ensureQueryEngine().executeQuery(this._ensureQuery(e),t?.signal).then(e=>{if(!e?.features)return e;let t=this.sublayer,n=t.layer,r=this._graphicOrigin;for(let i of e.features)i.layer=n,i.sourceLayer=t,i.origin=r;return e})}async queryObjectIds(e,t){return(await this._ensureQueryEngine().executeQueryForIds(this._ensureQuery(e),t?.signal)).filter(y)}_ensureQueryEngine(){return this._queryEngine??=this._createQueryEngine(),this._queryEngine}_createQueryEngine(){let e=C(this.view.spatialReference,this.view.renderSpatialReference,this._collection);return new T({layerView:this,priority:L.FEATURE_QUERY_ENGINE,spatialIndex:new O({featureAdapter:new E({objectIdField:this.sublayer.objectIdField,attributeStorageInfo:this.sublayer.attributeStorageInfo,getFeatureExtent:e}),forAllFeatures:(e,t)=>this._forAllFeatures((t,n,r)=>e(new D(t,n,r)),t,2),getFeatureExtent:e,sourceSpatialReference:A(this.sublayer),viewSpatialReference:this.view.spatialReference})})}_ensureQuery(e){return this._addDefinitionExpressionToQuery(e==null?this.createQuery():v.from(e))}};e([l()],R.prototype,`layerView`,void 0),e([l()],R.prototype,`extractChanges`,null),e([l()],R.prototype,`lodFactor`,null),e([l({readOnly:!0})],R.prototype,`parsedFilterExpressions`,null),e([l({type:m})],R.prototype,`filter`,null),e([l()],R.prototype,`_i3sFilter`,void 0),e([l({type:[String],readOnly:!0})],R.prototype,`filterExpressionFields`,null),e([l({type:[String],readOnly:!0})],R.prototype,`requiredFields`,void 0),e([l({type:[String],readOnly:!0})],R.prototype,`availableFields`,null),e([l()],R.prototype,`_graphicOrigin`,null),R=e([u(`esri.views.3d.layers.BuildingComponentSublayerView3D`)],R);const z=R;export{z 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/Collection.js";import r from"../../../core/Error.js";import{handlesGroup as i}from"../../../core/handleUtils.js";import a from"../../../core/Logger.js";import{getOrCreateMapValue as o}from"../../../core/MapUtils.js";import{abortMaybe as s}from"../../../core/maybe.js";import{isAbortError as c,allSettledValues as l,throwIfAborted as u}from"../../../core/promiseUtils.js";import{watch as d,syncAndInitial as f}from"../../../core/reactiveUtils.js";import{property as p,subclass as m}from"../../../core/accessorSupport/decorators.js";import{runUntracked as h}from"../../../core/accessorSupport/tracking.js";import{isBuildingGraphicOrigin as g}from"../../../graphic/isBuildingGraphicOrigin.js";import"../../../layers/buildingSublayers/BuildingGroupSublayer.js";import{I3SExtractChanges as _}from"../../../layers/support/I3SExtractChanges.js";import{isGraphic as v}from"../../../support/graphicInstanceUtils.js";import y from"./BuildingComponentSublayerView3D.js";import{BuildingSublayerView3DMixin as b}from"./BuildingSublayerView3D.js";import{LayerView3D as x}from"./LayerView3D.js";import{parseFilterMode as S}from"./i3s/BuildingFilterUtil.js";import{checkSpatialReference as C}from"./i3s/I3SUtil.js";import{normalizeHighlightTarget as w,emptyHighlightHandle as T}from"./support/highlightUtils.js";import{LayerViewPerformanceInfo as E}from"./support/LayerViewPerformanceInfo.js";import{updatingProgress as D}from"../support/updatingProperties.js";import O from"../../layers/BuildingSceneLayerView.js";import{isInEffectiveScaleRange as k}from"../../support/layerViewUtils.js";const A=b(t);let j=class extends x(O){constructor(e){super(e),this.type=`building-scene-3d`,this.sublayerViews=new n,this._rejectedSublayerViews=new Map,this._abortController=new AbortController,this._loadingComponents=0,this._pendingWhenSublayerViews=new Map,this.ignoresMemoryFactor=!1}get extractChanges(){return this._extractChanges}get filterExpression(){let e=this.layer.activeFilterId,t=e==null?null:this.layer.filters.find(t=>t.id===e),n=t==null?null:t.filterBlocks?.find(e=>e.filterMode.type===`solid`);return n?n.filterExpression:null}get filterExpressions(){let e=this.layer.activeFilterId,t=e==null?null:this.layer.filters.find(t=>t.id===e);return t?.filterBlocks?t.filterBlocks.toArray().map(e=>[e.filterExpression??``,S(e)]):[]}get updatingProgressValue(){return h(()=>{let e=this.sublayerViews,t=this._loadingComponents+(e?e.length:0);return e.reduce((e,t)=>e+t.updatingProgress,0)/t})}get visibleAtCurrentScale(){return k(this.layer.effectiveScaleRange,this.view.scale)}isUpdating(){return this._loadingComponents>0||this.sublayerViews&&this.sublayerViews.some(e=>e.updating)}initialize(){C(this.layer.spatialReference,this.view.spatialReference,this.view.viewingMode),this._extractChanges=new _({layer:this.layer,batchingEnabled:!0}),this._initializeSublayerViews(this.layer.sublayers,this)}destroy(){this.sublayerViews&&=(this.sublayerViews.forEach(e=>e.destroy()),null),this._extractChanges.destroy(),this._rejectedSublayerViews=null,this._abortController=s(this._abortController)}_initializeSublayerViews(e,t){let n=this,i=this.view;e.forEach(e=>{if(!e.isEmpty){if(e.type===`building-group`){let n=new A({sublayer:e,view:i,parent:t});this._initializeSublayerViews(e.sublayers,n)}else e.geometryType===`mesh`?(this._loadingComponents++,e.load({signal:this._abortController.signal}).then(()=>{let r=new y({sublayer:e,layerView:n,view:i,parent:t});this.sublayerViews.push(r);let a=this._pendingWhenSublayerViews.get(e);if(a){for(let e of a)e.resolve(r);this._pendingWhenSublayerViews.delete(e)}this.addHandles([d(()=>r.updating,()=>this.notifyChange(`updating`),f),d(()=>r.updatingProgress,()=>this.notifyChange(`updatingProgressValue`),f)])}).catch(t=>{c(t)||a.getLogger(this).error(`Error while creating view for sublayer ${e.id}\nLayer: ${this.layer.url}\n`,t),this._rejectWhenSublayerView(e,t)}).then(()=>{this._loadingComponents--,this.notifyChange(`updating`),this.notifyChange(`updatingProgressValue`)})):this._rejectWhenSublayerView(e,new r(`view:no-layerview-for-sublayer`,`No layerview created for sublayer ${e.id}`))}})}getGraphicFromIntersectorTarget(e,t){for(let n of this.sublayerViews.items)if(n.sublayer.id===e.sublayerId)return n.getGraphicFromIntersectorTarget(e,t);return null}async patchFeaturesForPopup(e,t){if(e.length===0)return[];let n=M(e,e=>g(e.origin)?e.origin.sublayer:e.sourceLayer),r=[];for(let[e,i]of n){let n=this._findComponent(e);n!=null&&r.push(n.patchFeaturesForPopup(i,t))}let i=await l(r);return u(t),i.flat()}whenGraphicBounds(e){let t=this._findComponent(g(e.origin)?e.origin.sublayer:e.sourceLayer);return t==null?Promise.reject():t.whenGraphicBounds(e)}getAABBFromIntersectorTarget(e){for(let t of this.sublayerViews.items)if(t.sublayer.id===e.sublayerId)return t.getAABBFromIntersectorTarget(e);return null}async whenSublayerView(e){let t=this._findComponent(e);if(t!=null)return t;let n=this._rejectedSublayerViews.get(e);if(n!=null)throw n;let r=this._pendingWhenSublayerViews.get(e),i=Promise.withResolvers();return r?r.push(i):this._pendingWhenSublayerViews.set(e,[i]),i.promise}_rejectWhenSublayerView(e,t){if(this.destroyed)return;this._rejectedSublayerViews.set(e,t);let n=this._pendingWhenSublayerViews.get(e);if(n){for(let e of n)e.reject(t);this._pendingWhenSublayerViews.delete(e)}}_findComponent(e){return this.sublayerViews.find(t=>e===t.sublayer)}highlight(e,t){let n=w(e);if(n.length===0)return T;if(v(n[0])){let e=n,r=new Map;for(let t of e)o(r,g(t.origin)?t.origin.sublayer:t.sourceLayer,()=>[]).push(t);let a=[];return this.sublayerViews.forEach(e=>{let n=r.get(e.sublayer);n&&a.push(e.highlight(n,t))}),i(a)}return T}get usedMemory(){return this.sublayerViews.reduce((e,t)=>e+t.usedMemory,0)}get unloadedMemory(){return this.sublayerViews.reduce((e,t)=>e+t.unloadedMemory,0)}get performanceInfo(){return new E(this.usedMemory)}};e([p()],j.prototype,`sublayerViews`,void 0),e([p()],j.prototype,`_rejectedSublayerViews`,void 0),e([p({readOnly:!0})],j.prototype,`filterExpression`,null),e([p({readOnly:!0})],j.prototype,`filterExpressions`,null),e([p(D)],j.prototype,`updatingProgress`,void 0),e([p({readOnly:!0})],j.prototype,`updatingProgressValue`,null),e([p({readOnly:!0})],j.prototype,`visibleAtCurrentScale`,null),j=e([m(`esri.views.3d.layers.BuildingSceneLayerView3D`)],j);function M(e,t){let n=new Map,r=e.length;for(let i=0;i<r;i++){let r=e[i],a=t(r,i,e),o=n.get(a);o?o.push(r):n.set(a,[r])}return n}const N=j;export{N as default};
2
+ import{__decorate as e}from"tslib";import t from"../../../core/Accessor.js";import n from"../../../core/Collection.js";import r from"../../../core/Error.js";import{handlesGroup as i}from"../../../core/handleUtils.js";import a from"../../../core/Logger.js";import{getOrCreateMapValue as o}from"../../../core/MapUtils.js";import{abortMaybe as s}from"../../../core/maybe.js";import{isAbortError as c,allSettledValues as l,throwIfAborted as u}from"../../../core/promiseUtils.js";import{watch as d,syncAndInitial as f}from"../../../core/reactiveUtils.js";import{property as p,subclass as m}from"../../../core/accessorSupport/decorators.js";import{runUntracked as h}from"../../../core/accessorSupport/tracking.js";import{isInEffectiveScaleRange as g}from"../../../geometry/support/scaleUtils.js";import{isBuildingGraphicOrigin as _}from"../../../graphic/isBuildingGraphicOrigin.js";import"../../../layers/buildingSublayers/BuildingGroupSublayer.js";import{I3SExtractChanges as v}from"../../../layers/support/I3SExtractChanges.js";import{isGraphic as y}from"../../../support/graphicInstanceUtils.js";import b from"./BuildingComponentSublayerView3D.js";import{BuildingSublayerView3DMixin as x}from"./BuildingSublayerView3D.js";import{LayerView3D as S}from"./LayerView3D.js";import{parseFilterMode as C}from"./i3s/BuildingFilterUtil.js";import{checkSpatialReference as w}from"./i3s/I3SUtil.js";import{normalizeHighlightTarget as T,emptyHighlightHandle as E}from"./support/highlightUtils.js";import{LayerViewPerformanceInfo as D}from"./support/LayerViewPerformanceInfo.js";import{updatingProgress as O}from"../support/updatingProperties.js";import k from"../../layers/BuildingSceneLayerView.js";const A=x(t);let j=class extends S(k){constructor(e){super(e),this.type=`building-scene-3d`,this.sublayerViews=new n,this._rejectedSublayerViews=new Map,this._abortController=new AbortController,this._loadingComponents=0,this._pendingWhenSublayerViews=new Map,this.ignoresMemoryFactor=!1}get extractChanges(){return this._extractChanges}get filterExpression(){let e=this.layer.activeFilterId,t=e==null?null:this.layer.filters.find(t=>t.id===e),n=t==null?null:t.filterBlocks?.find(e=>e.filterMode.type===`solid`);return n?n.filterExpression:null}get filterExpressions(){let e=this.layer.activeFilterId,t=e==null?null:this.layer.filters.find(t=>t.id===e);return t?.filterBlocks?t.filterBlocks.toArray().map(e=>[e.filterExpression??``,C(e)]):[]}get updatingProgressValue(){return h(()=>{let e=this.sublayerViews,t=this._loadingComponents+(e?e.length:0);return e.reduce((e,t)=>e+t.updatingProgress,0)/t})}get visibleAtCurrentScale(){return g(this.layer.effectiveScaleRange,this.view.scale)}isUpdating(){return this._loadingComponents>0||this.sublayerViews&&this.sublayerViews.some(e=>e.updating)}initialize(){w(this.layer.spatialReference,this.view.spatialReference,this.view.viewingMode),this._extractChanges=new v({layer:this.layer,batchingEnabled:!0}),this._initializeSublayerViews(this.layer.sublayers,this)}destroy(){this.sublayerViews&&=(this.sublayerViews.forEach(e=>e.destroy()),null),this._extractChanges.destroy(),this._rejectedSublayerViews=null,this._abortController=s(this._abortController)}_initializeSublayerViews(e,t){let n=this,i=this.view;e.forEach(e=>{if(!e.isEmpty){if(e.type===`building-group`){let n=new A({sublayer:e,view:i,parent:t});this._initializeSublayerViews(e.sublayers,n)}else e.geometryType===`mesh`?(this._loadingComponents++,e.load({signal:this._abortController.signal}).then(()=>{let r=new b({sublayer:e,layerView:n,view:i,parent:t});this.sublayerViews.push(r);let a=this._pendingWhenSublayerViews.get(e);if(a){for(let e of a)e.resolve(r);this._pendingWhenSublayerViews.delete(e)}this.addHandles([d(()=>r.updating,()=>this.notifyChange(`updating`),f),d(()=>r.updatingProgress,()=>this.notifyChange(`updatingProgressValue`),f)])}).catch(t=>{c(t)||a.getLogger(this).error(`Error while creating view for sublayer ${e.id}\nLayer: ${this.layer.url}\n`,t),this._rejectWhenSublayerView(e,t)}).then(()=>{this._loadingComponents--,this.notifyChange(`updating`),this.notifyChange(`updatingProgressValue`)})):this._rejectWhenSublayerView(e,new r(`view:no-layerview-for-sublayer`,`No layerview created for sublayer ${e.id}`))}})}getGraphicFromIntersectorTarget(e,t){for(let n of this.sublayerViews.items)if(n.sublayer.id===e.sublayerId)return n.getGraphicFromIntersectorTarget(e,t);return null}async patchFeaturesForPopup(e,t){if(e.length===0)return[];let n=M(e,e=>_(e.origin)?e.origin.sublayer:e.sourceLayer),r=[];for(let[e,i]of n){let n=this._findComponent(e);n!=null&&r.push(n.patchFeaturesForPopup(i,t))}let i=await l(r);return u(t),i.flat()}whenGraphicBounds(e){let t=this._findComponent(_(e.origin)?e.origin.sublayer:e.sourceLayer);return t==null?Promise.reject():t.whenGraphicBounds(e)}getAABBFromIntersectorTarget(e){for(let t of this.sublayerViews.items)if(t.sublayer.id===e.sublayerId)return t.getAABBFromIntersectorTarget(e);return null}async whenSublayerView(e){let t=this._findComponent(e);if(t!=null)return t;let n=this._rejectedSublayerViews.get(e);if(n!=null)throw n;let r=this._pendingWhenSublayerViews.get(e),i=Promise.withResolvers();return r?r.push(i):this._pendingWhenSublayerViews.set(e,[i]),i.promise}_rejectWhenSublayerView(e,t){if(this.destroyed)return;this._rejectedSublayerViews.set(e,t);let n=this._pendingWhenSublayerViews.get(e);if(n){for(let e of n)e.reject(t);this._pendingWhenSublayerViews.delete(e)}}_findComponent(e){return this.sublayerViews.find(t=>e===t.sublayer)}highlight(e,t){let n=T(e);if(n.length===0)return E;if(y(n[0])){let e=n,r=new Map;for(let t of e)o(r,_(t.origin)?t.origin.sublayer:t.sourceLayer,()=>[]).push(t);let a=[];return this.sublayerViews.forEach(e=>{let n=r.get(e.sublayer);n&&a.push(e.highlight(n,t))}),i(a)}return E}get usedMemory(){return this.sublayerViews.reduce((e,t)=>e+t.usedMemory,0)}get unloadedMemory(){return this.sublayerViews.reduce((e,t)=>e+t.unloadedMemory,0)}get performanceInfo(){return new D(this.usedMemory)}};e([p()],j.prototype,`sublayerViews`,void 0),e([p()],j.prototype,`_rejectedSublayerViews`,void 0),e([p({readOnly:!0})],j.prototype,`filterExpression`,null),e([p({readOnly:!0})],j.prototype,`filterExpressions`,null),e([p(O)],j.prototype,`updatingProgress`,void 0),e([p({readOnly:!0})],j.prototype,`updatingProgressValue`,null),e([p({readOnly:!0})],j.prototype,`visibleAtCurrentScale`,null),j=e([m(`esri.views.3d.layers.BuildingSceneLayerView3D`)],j);function M(e,t){let n=new Map,r=e.length;for(let i=0;i<r;i++){let r=e[i],a=t(r,i,e),o=n.get(a);o?o.push(r):n.set(a,[r])}return n}const N=j;export{N 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"../../../core/has.js";import t from"../../../core/Logger.js";import{destroyMaybe as n}from"../../../core/maybe.js";import{debounce as r,isAbortError as i}from"../../../core/promiseUtils.js";import{property as a,subclass as o}from"../../../core/accessorSupport/decorators.js";import{projectAsync as s}from"../../../geometry/projectionUtils.js";import{LayerView3D as c}from"./LayerView3D.js";import{LayerViewPerformanceInfo as l}from"./support/LayerViewPerformanceInfo.js";import u from"../../layers/LayerView.js";import{RefreshableLayerView as d}from"../../layers/RefreshableLayerView.js";import{isInEffectiveScaleRange as f}from"../../support/layerViewUtils.js";const p=c=>{let u=c,d=class extends u{constructor(){super(...arguments),this.fullExtentInLocalViewSpatialReference=null,this.refreshDebounced=r(async e=>{this.destroyed||await this._doRefresh(e).catch(e=>{i(e)||t.getLogger(this).error(e)})},2e3),this.ignoresMemoryFactor=!1,this.unloadedMemory=0}get visibleAtCurrentScale(){let e=this.layer,t=`effectiveScaleRange`in e?e.effectiveScaleRange:null;return f(t,this.view.scale)}isUpdating(){return super.isUpdating()||this.subView?.updating}initialize(){this._initSubView(),this.view.viewingMode===`local`&&this.addResolvingPromise((async()=>this.fullExtentInLocalViewSpatialReference=await s(this.layer.fullExtent,this.view.spatialReference).catch(()=>null))()),this._updatingHandles.add(()=>this.suspended,()=>this._suspendedChangeHandler())}destroy(){this.subView=n(this.subView)}async doRefresh(){return this._doRefresh()}async _doRefresh(e){this.suspended||await this.subView.doRefresh(e)}getFetchOptions(){}_suspendedChangeHandler(){this.suspended?this.subView.clear():this.refreshDebounced()}get test(){}get usedMemory(){return this.subView.usedMemory}get performanceInfo(){return new l(this.usedMemory)}};return e([a()],d.prototype,`suspended`,void 0),e([a()],d.prototype,`fullExtentInLocalViewSpatialReference`,void 0),e([a({readOnly:!0})],d.prototype,`visibleAtCurrentScale`,null),e([a()],d.prototype,`updating`,void 0),e([a()],d.prototype,`subView`,void 0),d=e([o(`esri.views.3d.layers.DynamicLayerView3D`)],d),d};class m extends p(d(c(u))){}export{m as DynamicLayerView3D,p as DynamicLayerView3DMixin};
2
+ import{__decorate as e}from"tslib";import"../../../core/has.js";import t from"../../../core/Logger.js";import{destroyMaybe as n}from"../../../core/maybe.js";import{debounce as r,isAbortError as i}from"../../../core/promiseUtils.js";import{property as a,subclass as o}from"../../../core/accessorSupport/decorators.js";import{projectAsync as s}from"../../../geometry/projectionUtils.js";import{isInEffectiveScaleRange as c}from"../../../geometry/support/scaleUtils.js";import{LayerView3D as l}from"./LayerView3D.js";import{LayerViewPerformanceInfo as u}from"./support/LayerViewPerformanceInfo.js";import d from"../../layers/LayerView.js";import{RefreshableLayerView as f}from"../../layers/RefreshableLayerView.js";const p=l=>{let d=l,f=class extends d{constructor(){super(...arguments),this.fullExtentInLocalViewSpatialReference=null,this.refreshDebounced=r(async e=>{this.destroyed||await this._doRefresh(e).catch(e=>{i(e)||t.getLogger(this).error(e)})},2e3),this.ignoresMemoryFactor=!1,this.unloadedMemory=0}get visibleAtCurrentScale(){let e=this.layer,t=`effectiveScaleRange`in e?e.effectiveScaleRange:null;return c(t,this.view.scale)}isUpdating(){return super.isUpdating()||this.subView?.updating}initialize(){this._initSubView(),this.view.viewingMode===`local`&&this.addResolvingPromise((async()=>this.fullExtentInLocalViewSpatialReference=await s(this.layer.fullExtent,this.view.spatialReference).catch(()=>null))()),this._updatingHandles.add(()=>this.suspended,()=>this._suspendedChangeHandler())}destroy(){this.subView=n(this.subView)}async doRefresh(){return this._doRefresh()}async _doRefresh(e){this.suspended||await this.subView.doRefresh(e)}getFetchOptions(){}_suspendedChangeHandler(){this.suspended?this.subView.clear():this.refreshDebounced()}get test(){}get usedMemory(){return this.subView.usedMemory}get performanceInfo(){return new u(this.usedMemory)}};return e([a()],f.prototype,`suspended`,void 0),e([a()],f.prototype,`fullExtentInLocalViewSpatialReference`,void 0),e([a({readOnly:!0})],f.prototype,`visibleAtCurrentScale`,null),e([a()],f.prototype,`updating`,void 0),e([a()],f.prototype,`subView`,void 0),f=e([o(`esri.views.3d.layers.DynamicLayerView3D`)],f),f};class m extends p(f(l(d))){}export{m as DynamicLayerView3D,p as DynamicLayerView3DMixin};
@@ -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{makeHandle as n}from"../../../core/handleUtils.js";import{destroyMaybe as r}from"../../../core/maybe.js";import i from"../../../core/ReactiveMap.js";import{property as a,subclass as o}from"../../../core/accessorSupport/decorators.js";import{projectAsync as s}from"../../../geometry/projectionUtils.js";import{hydrateGraphic as c}from"../../../layers/graphics/hydratedFeatures.js";import{combineTimeExtent as l,hasTimeOptions as u}from"../../../layers/support/timeSupport.js";import d from"../../../rest/support/AttributeBinsQuery.js";import f from"../../../rest/support/Query.js";import{isGraphic as p}from"../../../support/graphicInstanceUtils.js";import{LayerView3D as m}from"./LayerView3D.js";import{attributeLookup as h}from"./support/attributeUtils.js";import{normalizeHighlightTarget as g,emptyHighlightHandle as _,isObjectId as v}from"./support/highlightUtils.js";import{RefreshableLayerView as y}from"../../layers/RefreshableLayerView.js";import{getHighlightName as b}from"../../support/highlightOptionsUtils.js";import{hasLayerBasedScaleVisibility as x,isInEffectiveScaleRange as S}from"../../support/layerViewUtils.js";const C=C=>{let w=y(m(C)),T=class extends w{constructor(){super(...arguments),this.updatePolicy=1,this.slicePlaneEnabled=!1,this._highlightCounter=new i,this.fullExtentInLocalViewSpatialReference=null,this.supportsHeightUnitConversion=!0}initialize(){let e=this.layer;if(`isTable`in e&&e.isTable){this.addResolvingPromise(Promise.reject(new t(`featurelayerview:table-not-supported`,`table feature layer can't be displayed`,{layer:e})));return}this.addResolvingPromise(this._validateGeometryType()),this.addResolvingPromise((async()=>{if(this.destroyed)return;this.fullExtentInLocalViewSpatialReference=this.view.viewingMode===`local`?await s(this.layer.fullExtent,this.view.spatialReference).catch(()=>null):null,await this._updatingRequiredPromise;let e=await this.createGraphicsPipeline();if(this.destroyed){e.destroy();return}this.graphicsPipeline=e,await e.when()})()),this.notifyChange(`updating`)}destroy(){this.graphicsPipeline=r(this.graphicsPipeline)}get dataUpdating(){return!!this.graphicsPipeline?.dataUpdating}get legendEnabled(){return this.canResume()&&this.graphicsPipeline?.legendEnabled}get visibleAtCurrentScale(){return x()?S(this.layer.effectiveScaleRange,this.view.scale):!this.graphicsPipeline?.scaleVisibilitySuspended}get symbologySnappingSupported(){return this.graphicsPipeline.symbologySnappingSupported}get hasAllFeatures(){return this.graphicsPipeline.hasAllFeatures}get hasAllFeaturesInView(){return this.graphicsPipeline.hasAllFeaturesInView}get hasFullGeometries(){return this.graphicsPipeline.hasFullGeometries}get timeExtent(){return l(u(this.layer)?this.layer:null,this.view?.timeExtent,this._get(`timeExtent`))}get highlightIds(){return Array.from(this._highlightCounter.keys())}get hasHighlight(){return this.highlightIds.length>0}getHit(e,t){let n=this.graphicsPipeline.findGraphic(t=>t.uid===e);if(n==null)return null;let r=c(n,this.layer,this.layer.graphicOrigin);return{type:`graphic`,graphic:r,layer:r.layer}}whenGraphicBounds(e,t){return this.graphicsPipeline?.whenGraphicBounds(e,t)}computeAttachmentOrigin(e,t){return this.graphicsPipeline?.computeAttachmentOrigin(e,t)}async elevationAlignPointsInFeatures(e,t){return this.graphicsPipeline.elevationAlignPointsInFeatures(e,t)}async queryForSymbologySnapping(e,t){return this.graphicsPipeline.graphicsQuery.queryForSymbologySnapping(e,t)}queryAggregates(e,t){throw Error(`missing implementation`)}queryFeatures(e,t){return this.graphicsPipeline.graphicsQuery.executeQuery(this._ensureQuery(e),t?.signal)}queryObjectIds(e,t){return this.graphicsPipeline.graphicsQuery.executeQueryForIds(this._ensureQuery(e),t?.signal)}queryFeatureCount(e,t){return this.graphicsPipeline.graphicsQuery.executeQueryForCount(this._ensureQuery(e),t?.signal)}queryAttributeBins(e,t){return this.graphicsPipeline.graphicsQuery.executeAttributeBinsQuery(this._ensureAttributeBinsQuery(e),t?.signal)}queryExtent(e,t){return this.graphicsPipeline.graphicsQuery.executeQueryForExtent(this._ensureQuery(e),t?.signal)}_ensureQuery(e){return e==null?this.createQuery():f.from(e)}_ensureAttributeBinsQuery(e){let t=d.from(e);return t.outSpatialReference||=this.view.spatialReference,t}_addHighlightIds(e){this._highlightCounter.batch(()=>{for(let t of e){let e=this._highlightCounter.get(t)??0;this._highlightCounter.set(t,e+1)}})}_removeHighlightIds(e){this._highlightCounter.batch(()=>{for(let t of e){let e=this._highlightCounter.get(t);e!=null&&(e--,e>0?this._highlightCounter.set(t,e):this._highlightCounter.delete(t))}})}highlight(e,t){let r=b(t),i=this.layer.objectIdField,a=g(e);if(a.length===0)return _;if(p(a[0])){let e=a;if(h(this.layer.fieldsIndex,e[0].attributes,i)!=null){let t=e.map(e=>h(this.layer.fieldsIndex,e.attributes,i)),a=this.graphicsPipeline.highlightByObjectIds(t,r);return this._addHighlightIds(t),n(()=>{this._removeHighlightIds(t),a.remove()})}return this.graphicsPipeline.highlightByGraphics(e,r)}if(v(a[0])){let e=a;this._addHighlightIds(e);let t=this.graphicsPipeline.highlightByObjectIds(e,r);return n(()=>{t.remove(),this._removeHighlightIds(e)})}return _}maskOccludee(e){return this.graphicsPipeline.maskOccludee(e)}getSuspendInfo(){return{...super.getSuspendInfo(),...this.graphicsPipeline.suspendInfo}}isUpdating(){return!this.graphicsPipeline||this.graphicsPipeline.destroyed?!1:!(!this.graphicsPipeline?.updating&&this.view?.groundView?.ready)}async _validateGeometryType(){switch(this.layer.geometryType){case`multipatch`:case`multipoint`:throw new t(`featurelayerview3d:unsupported-geometry-type`,"Unsupported geometry type ${geometryType}",{geometryType:this.layer.geometryType})}}get performanceInfo(){return this.graphicsPipeline.performanceInfo}};return e([a()],T.prototype,`graphicsPipeline`,void 0),e([a({readOnly:!0})],T.prototype,`dataUpdating`,null),e([a()],T.prototype,`suspended`,void 0),e([a({readOnly:!0})],T.prototype,`legendEnabled`,null),e([a({readOnly:!0})],T.prototype,`visibleAtCurrentScale`,null),e([a()],T.prototype,`updating`,void 0),e([a({readOnly:!0})],T.prototype,`updatePolicy`,void 0),e([a({type:Boolean})],T.prototype,`slicePlaneEnabled`,void 0),e([a({readOnly:!0})],T.prototype,`suspendInfo`,void 0),e([a()],T.prototype,`symbologySnappingSupported`,null),e([a({readOnly:!0})],T.prototype,`hasAllFeatures`,null),e([a({readOnly:!0})],T.prototype,`hasAllFeaturesInView`,null),e([a({readOnly:!0})],T.prototype,`hasFullGeometries`,null),e([a({readOnly:!0})],T.prototype,`timeExtent`,null),e([a()],T.prototype,`highlightIds`,null),e([a()],T.prototype,`hasHighlight`,null),T=e([o(`esri.views.3d.layers.FeatureLikeLayerViewBase3D`)],T),T};export{C as FeatureLikeLayerViewBase3D};
2
+ import{__decorate as e}from"tslib";import t from"../../../core/Error.js";import{makeHandle as n}from"../../../core/handleUtils.js";import{destroyMaybe as r}from"../../../core/maybe.js";import i from"../../../core/ReactiveMap.js";import{property as a,subclass as o}from"../../../core/accessorSupport/decorators.js";import{projectAsync as s}from"../../../geometry/projectionUtils.js";import{isInEffectiveScaleRange as c}from"../../../geometry/support/scaleUtils.js";import{hydrateGraphic as l}from"../../../layers/graphics/hydratedFeatures.js";import{combineTimeExtent as u,hasTimeOptions as d}from"../../../layers/support/timeSupport.js";import f from"../../../rest/support/AttributeBinsQuery.js";import p from"../../../rest/support/Query.js";import{isGraphic as m}from"../../../support/graphicInstanceUtils.js";import{LayerView3D as h}from"./LayerView3D.js";import{attributeLookup as g}from"./support/attributeUtils.js";import{normalizeHighlightTarget as _,emptyHighlightHandle as v,isObjectId as y}from"./support/highlightUtils.js";import{RefreshableLayerView as b}from"../../layers/RefreshableLayerView.js";import{getHighlightName as x}from"../../support/highlightOptionsUtils.js";import{hasLayerBasedScaleVisibility as S}from"../../support/layerViewUtils.js";const C=C=>{let w=b(h(C)),T=class extends w{constructor(){super(...arguments),this.updatePolicy=1,this.slicePlaneEnabled=!1,this._highlightCounter=new i,this.fullExtentInLocalViewSpatialReference=null,this.supportsHeightUnitConversion=!0}initialize(){let e=this.layer;if(`isTable`in e&&e.isTable){this.addResolvingPromise(Promise.reject(new t(`featurelayerview:table-not-supported`,`table feature layer can't be displayed`,{layer:e})));return}this.addResolvingPromise(this._validateGeometryType()),this.addResolvingPromise((async()=>{if(this.destroyed)return;this.fullExtentInLocalViewSpatialReference=this.view.viewingMode===`local`?await s(this.layer.fullExtent,this.view.spatialReference).catch(()=>null):null,await this._updatingRequiredPromise;let e=await this.createGraphicsPipeline();if(this.destroyed){e.destroy();return}this.graphicsPipeline=e,await e.when()})()),this.notifyChange(`updating`)}destroy(){this.graphicsPipeline=r(this.graphicsPipeline)}get dataUpdating(){return!!this.graphicsPipeline?.dataUpdating}get legendEnabled(){return this.canResume()&&this.graphicsPipeline?.legendEnabled}get visibleAtCurrentScale(){return S()?c(this.layer.effectiveScaleRange,this.view.scale):!this.graphicsPipeline?.scaleVisibilitySuspended}get symbologySnappingSupported(){return this.graphicsPipeline.symbologySnappingSupported}get hasAllFeatures(){return this.graphicsPipeline.hasAllFeatures}get hasAllFeaturesInView(){return this.graphicsPipeline.hasAllFeaturesInView}get hasFullGeometries(){return this.graphicsPipeline.hasFullGeometries}get timeExtent(){return u(d(this.layer)?this.layer:null,this.view?.timeExtent,this._get(`timeExtent`))}get highlightIds(){return Array.from(this._highlightCounter.keys())}get hasHighlight(){return this.highlightIds.length>0}getHit(e,t){let n=this.graphicsPipeline.findGraphic(t=>t.uid===e);if(n==null)return null;let r=l(n,this.layer,this.layer.graphicOrigin);return{type:`graphic`,graphic:r,layer:r.layer}}whenGraphicBounds(e,t){return this.graphicsPipeline?.whenGraphicBounds(e,t)}computeAttachmentOrigin(e,t){return this.graphicsPipeline?.computeAttachmentOrigin(e,t)}async elevationAlignPointsInFeatures(e,t){return this.graphicsPipeline.elevationAlignPointsInFeatures(e,t)}async queryForSymbologySnapping(e,t){return this.graphicsPipeline.graphicsQuery.queryForSymbologySnapping(e,t)}queryAggregates(e,t){throw Error(`missing implementation`)}queryFeatures(e,t){return this.graphicsPipeline.graphicsQuery.executeQuery(this._ensureQuery(e),t?.signal)}queryObjectIds(e,t){return this.graphicsPipeline.graphicsQuery.executeQueryForIds(this._ensureQuery(e),t?.signal)}queryFeatureCount(e,t){return this.graphicsPipeline.graphicsQuery.executeQueryForCount(this._ensureQuery(e),t?.signal)}queryAttributeBins(e,t){return this.graphicsPipeline.graphicsQuery.executeAttributeBinsQuery(this._ensureAttributeBinsQuery(e),t?.signal)}queryExtent(e,t){return this.graphicsPipeline.graphicsQuery.executeQueryForExtent(this._ensureQuery(e),t?.signal)}_ensureQuery(e){return e==null?this.createQuery():p.from(e)}_ensureAttributeBinsQuery(e){let t=f.from(e);return t.outSpatialReference||=this.view.spatialReference,t}_addHighlightIds(e){this._highlightCounter.batch(()=>{for(let t of e){let e=this._highlightCounter.get(t)??0;this._highlightCounter.set(t,e+1)}})}_removeHighlightIds(e){this._highlightCounter.batch(()=>{for(let t of e){let e=this._highlightCounter.get(t);e!=null&&(e--,e>0?this._highlightCounter.set(t,e):this._highlightCounter.delete(t))}})}highlight(e,t){let r=x(t),i=this.layer.objectIdField,a=_(e);if(a.length===0)return v;if(m(a[0])){let e=a;if(g(this.layer.fieldsIndex,e[0].attributes,i)!=null){let t=e.map(e=>g(this.layer.fieldsIndex,e.attributes,i)),a=this.graphicsPipeline.highlightByObjectIds(t,r);return this._addHighlightIds(t),n(()=>{this._removeHighlightIds(t),a.remove()})}return this.graphicsPipeline.highlightByGraphics(e,r)}if(y(a[0])){let e=a;this._addHighlightIds(e);let t=this.graphicsPipeline.highlightByObjectIds(e,r);return n(()=>{t.remove(),this._removeHighlightIds(e)})}return v}maskOccludee(e){return this.graphicsPipeline.maskOccludee(e)}getSuspendInfo(){return{...super.getSuspendInfo(),...this.graphicsPipeline.suspendInfo}}isUpdating(){return!this.graphicsPipeline||this.graphicsPipeline.destroyed?!1:!(!this.graphicsPipeline?.updating&&this.view?.groundView?.ready)}async _validateGeometryType(){switch(this.layer.geometryType){case`multipatch`:case`multipoint`:throw new t(`featurelayerview3d:unsupported-geometry-type`,"Unsupported geometry type ${geometryType}",{geometryType:this.layer.geometryType})}}get performanceInfo(){return this.graphicsPipeline.performanceInfo}};return e([a()],T.prototype,`graphicsPipeline`,void 0),e([a({readOnly:!0})],T.prototype,`dataUpdating`,null),e([a()],T.prototype,`suspended`,void 0),e([a({readOnly:!0})],T.prototype,`legendEnabled`,null),e([a({readOnly:!0})],T.prototype,`visibleAtCurrentScale`,null),e([a()],T.prototype,`updating`,void 0),e([a({readOnly:!0})],T.prototype,`updatePolicy`,void 0),e([a({type:Boolean})],T.prototype,`slicePlaneEnabled`,void 0),e([a({readOnly:!0})],T.prototype,`suspendInfo`,void 0),e([a()],T.prototype,`symbologySnappingSupported`,null),e([a({readOnly:!0})],T.prototype,`hasAllFeatures`,null),e([a({readOnly:!0})],T.prototype,`hasAllFeaturesInView`,null),e([a({readOnly:!0})],T.prototype,`hasFullGeometries`,null),e([a({readOnly:!0})],T.prototype,`timeExtent`,null),e([a()],T.prototype,`highlightIds`,null),e([a()],T.prototype,`hasHighlight`,null),T=e([o(`esri.views.3d.layers.FeatureLikeLayerViewBase3D`)],T),T};export{C as FeatureLikeLayerViewBase3D};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import{equals as t}from"../../../core/arrayUtils.js";import"../../../core/has.js";import{removeMaybe as n,abortMaybe as r}from"../../../core/maybe.js";import{debounce as i,throwIfAborted as a,ignoreAbortErrors as o}from"../../../core/promiseUtils.js";import{watch as s,sync as c,when as l,whenOnce as ee}from"../../../core/reactiveUtils.js";import{addFrameTask as u}from"../../../core/scheduling.js";import{signal as d}from"../../../core/signal.js";import{Seconds as f,secondsFromMilliseconds as te}from"../../../core/time.js";import{property as p,subclass as m}from"../../../core/accessorSupport/decorators.js";import{projectOrLoad as h}from"../../../geometry/projectionUtils.js";import ne from"../../../geometry/SpatialReference.js";import{toExtent as g,fromExtent as _,intersection as re,create as ie,intersects as v}from"../../../geometry/support/aaBoundingRect.js";import{getInfo as y}from"../../../geometry/support/spatialReferenceUtils.js";import b from"../../../symbols/support/ElevationInfo.js";import x from"./SubView3D.js";import{getFeatureTileId as S}from"./support/FeatureTileDescriptor.js";import{makeScheduleFunction as C}from"./support/makeScheduleFunction.js";import{debugFlags as w}from"../support/debugFlags.js";import{tileFilterDistance as T,scaleThresholdForLoadingAllTiles as E,defaultTransitionDuration as D,transitionDurationFactor as O,seamlessTransitionEnabled as k,densityFactor as A,loadAllTilesDensityFactor as j,averageLoadingTimeSmoothingFactor as M,fadeOutTime as N,fadeInTime as P,minimumTracingResolution as F}from"../support/flow/constants.js";import{isFullExtent as I,wrappedWidth as L,FlowQuery3D as ae}from"../support/flow/FlowQuery3D.js";import{FlowWorkerHandle as R}from"../support/flow/FlowWorkerHandle.js";import{materialParametersFromRenderer as z,createStreamlineGeometry as B}from"../support/flow/geometryUtils.js";import{boundingRectOfTiles as V}from"../support/flow/loadUtils.js";import{StreamlineResources3DOverlay as H}from"../support/flow/StreamlineResources3DOverlay.js";import{StreamlineResources3DShape as U}from"../support/flow/StreamlineResources3DShape.js";import{webMercatorWorldExtent as W}from"../terrain/TerrainConst.js";import{descendantsAtLevel as G,tilesAreRelated as K}from"../terrain/tileUtils.js";import{isScreenSizePerspectiveEnabled as q}from"../webgl-engine/lib/screenSizePerspectiveUtils.js";import{RibbonLineMaterial as J}from"../webgl-engine/materials/RibbonLineMaterial.js";import{hasLayerBasedScaleVisibility as oe,isInEffectiveScaleRange as se}from"../../support/layerViewUtils.js";import{TaskPriority as ce}from"../../support/Scheduler.js";import{simulationSettingsEqual as le,getPositions as ue,getFlowSimulationSettings as Y}from"../../support/flow/utils.js";let X=class extends x{constructor(e){super(e),this.type=`flow`,this.renderedTiles=null,this.tilesIntersectDataBounds=!0,this.requireLoad=!1,this.workerHandle=null,this.frameTask=null,this._averageLoadingTime=f(0),this._abortController=null,this._loadingState=`ready-to-load`,this._tilesUpdateIsWaiting=!1,this._debugAllowAutoLoading=d(!0),this.emissiveStrength=0,this._materialParametersOverridde=null,this._suspendedOverride=null,this._simulationSettingsOverride=null,this._seamlessTransitionEnabledOverride=null,this._updateTask=null,this._debouncedTileUpdate=i(async e=>{let{allTiles:t}=this.surface,n=this._getTileFilterFunction(),{_dataBounds:r}=this,i=new Set,o=!1;function*s(e){for(let a=0;a<t.length;++a){let s=t.at(a),c=Z(r,s.extent);n(s)&&c&&(i.add(s),o=!0),e.madeProgress(),e.done&&(e=yield)}}await this.frameTask.scheduleGenerator(s,e.signal),a(e.signal),this.tilesIntersectDataBounds=t.length===0||this.loadAllTiles?!0:o,this.renderedTiles=i})}initialize(){let{surface:e,view:t}=this,{resourceController:n}=t;this.workerHandle=new R(C(n)),this.frameTask=n.scheduler.registerTask(ce.FLOW_GENERATOR),this._updateTask=u({update:()=>this._update()}),this.addHandles([s(()=>this._simulationSettings,()=>this.triggerLoad(),{sync:!0,equals:(e,t)=>e==null&&t==null||e!=null&&t!=null&&le(e,t)}),this.updatingHandles.add(()=>this.suspended,e=>{e?this._suspend():this._resume()},c),s(()=>{let{elevationInfo:e}=this;return[this._clippingArea,this.visible,this._draped,this.view.state.contentPixelRatio,this.view.viewingMode,e?.mode,e?.offset,e?.unit,this._effectiveDensity]},()=>this.triggerLoad(),c),l(()=>!this._animationsEnabled,()=>{let{_resources:e,_lastResources:t}=this;e!=null&&(e.startTime=Q),t!=null&&(t.startTime=Q)},c),s(()=>this._materialParameters,e=>{this._resources?.setMaterialParameters(e),this._lastResources?.setMaterialParameters(e)}),l(()=>e.allTilesCreated,()=>this._triggerTilesUpdate(),c),t.enableFeatureTiles(),s(()=>[this._dataBounds,this._featureTilesBounds,this.loadAllTiles],()=>this._triggerTilesUpdate()),s(()=>this._flowRenderer,(e,t)=>{let n=t?.visualVariables??[],r=e?.visualVariables??[];r.length===n.length&&r.every((e,t)=>e.type===n[t].type)||this.clear()}),l(()=>!t.featureTiles?.updating,()=>{this._triggerTilesUpdate()})]),this.suspended&&this._suspend(),this._triggerTilesUpdate()}destroy(){this._updateTask=n(this._updateTask),this.abort(),this.clear(),this.notifyChange(`updating`)}abort(){this._abortController=r(this._abortController),this._tilesUpdateIsWaiting=!1,this.requireLoad=!1}_ensureAbortController(){return this._abortController??=new AbortController,this._abortController}_resume(){this._updateTask.resume(),this._triggerTilesUpdate(),this.triggerLoad()}_suspend(){this._updateTask.pause(),this.abort(),this.clear()}get _animationsEnabled(){return this.view.state.animationsEnabled}get _clippingArea(){let e=h(this.view.clippingArea,this.surface.spatialReference).geometry;return e==null?null:_(e)}get _dataBounds(){let e=this._fullExtentSurfaceSpatialReference;return e==null?null:_(e)}get suspended(){return this._suspendedOverride==null?this.layerView.suspended||this.view.groundView.hasTerrainReplacement:this._suspendedOverride}get _fullExtentSurfaceSpatialReference(){return h(this.layer.fullExtent,this.surface.spatialReference).geometry}get _draped(){return this.elevationInfo.mode===`on-the-ground`}get extent(){if(this.loadAllTiles)return $(this._fullExtentSurfaceSpatialReference);let{spatialReference:e}=this.surface,t=this.renderedTiles;if(e==null||t==null)return null;let n=this.view.terrainLevel;if(n!=null){let e=new Set;t.forEach(t=>{Math.abs(n-t.level)<T&&e.add(t)}),t=e}let r=V(t,this.spatialReferenceInfo);return r==null?null:(re(r,this._clippingArea,r),$(g(r,e)))}get loadAllTiles(){return this.view.scale>(w.FLOW_GLOBAL_SCALE_THRESHOLD??E)}get isDataGlobal(){let{extent:e,spatialReferenceInfo:t}=this;return e!=null&&I(e.xmin,e.xmax,t)}get loadAllTilesLevel(){let{tilingScheme:e}=this.surface;return Math.min(Math.ceil(e.levelAtScale(w.FLOW_GLOBAL_SCALE_THRESHOLD??E)),e.getMaxLod())}get targetTiles(){let e=new Map;if(this.loadAllTiles){let{_dataBounds:t}=this;if(t==null)return e;let n=ie(),r=this.loadAllTilesLevel,i=this.surface.tilingScheme,a=i.rootTilesInExtent(t).values().flatMap(e=>G(e,r));for(let o of a){let[a,s,c]=o;i.getExtent(r,s,c,n),Z(t,n)&&e.set(S(r,s,c),o)}return e}let{renderedTiles:t}=this;for(let n of t??[])e.set(n.key,n.lij);return e}get _featureTilesBounds(){let e=this.view.featureTiles?.filterExtent,t=h(e,this.surface.spatialReference).geometry;return t==null?null:_(t)}get _flowRenderer(){let e=this.layer.renderer;return e?.type===`flow`?e:null}get _materialParameters(){return{...z(this._flowRenderer,this.layerView.fullOpacity,this.emissiveStrength),...this._materialParametersOverridde,hasSlicePlane:this.layerView.slicePlaneEnabled,screenSizePerspective:!this._draped&&`screenSizePerspectiveEnabled`in this.layer&&q(this.layer.screenSizePerspectiveEnabled)?this.view.screenSizePerspective.parameters:null}}get _opacity(){return this.layerView.fullOpacity}get _seamlessTransitionWaitingTime(){let{_averageLoadingTime:e}=this;return f(e===0?D:this._averageLoadingTime*O)}get _transitionEnabled(){return this.view.qualitySettings.flow.transitionEnabled}get _seamlessTransitionEnabled(){return this._transitionEnabled?this._seamlessTransitionEnabledOverride==null?k:this._seamlessTransitionEnabledOverride:!1}get _tracingResolution(){let{extent:e}=this;if(!e)return[0,0];let t=L(e.xmin,e.xmax,this.spatialReferenceInfo?.valid)/(e.ymax-e.ymin),[n,r]=this.view.size,i,a;n<r?(i=n,a=n/t):(i=r*t,a=r);let o=F,s=this.view.qualitySettings.flow.maxTracingResolution,c=Math.max(1,o/Math.min(i,a)),l=c*Math.min(1,s/Math.max(i*c,a*c));return[Math.round(i*l),Math.round(a*l)]}get visible(){let e=this._flowRenderer?.color;return this.visibleAtCurrentScale&&this.layer.effectiveVisible&&this._opacity>0&&(e==null||e.a>0)}get _effectiveDensity(){let{_simulationSettings:e}=this;if(e==null)return 0;let t=e.density*this.view.quality;return e.lineSpacing/Math.sqrt(t)<e.lineCollisionWidth?(e.lineSpacing/e.lineCollisionWidth)**2:t}get elevationInfo(){return(`elevationInfo`in this.layer?this.layer.elevationInfo:void 0)??fe}startPositions(e){if(!this._seamlessTransitionEnabled)return[];let{_flowRenderer:t,_resources:n}=this;return t==null||n==null?[]:ue(n.streamlines,n.query,e,t.flowSpeed)}get needsMagnitude(){return this._flowRenderer?.hasVisualVariables()??!1}get spatialReferenceInfo(){return y(this.surface.spatialReference)}get loadingState(){return this._loadingState}get loadRequirementsMet(){return this.renderedTiles!=null&&(this.renderedTiles.size>0||this.loadAllTiles)&&this.extent!=null}hasWork(){return this.updatingHandles.updating||this.requireLoad||this._loadingState===`before-transition`}get updating(){return this._debugAllowAutoLoading.value&&this.visible&&!(this.destroyed||this.destroying)&&this.hasWork()}get visibleAtCurrentScale(){return!oe()||se(this.layer.effectiveScaleRange,this.view.scale)}get _simulationSettings(){let{_flowRenderer:e,_simulationSettingsOverride:t}=this;if(e==null)return null;let n=Y(e);return n.segmentLength=n.lineCollisionWidth/2,n.onlyForwardTracing=!1,n.maxNumberOfStreamlines=this.view.qualitySettings.flow.maxTotalNumberOfStreamlines,n.density*=A,this.loadAllTiles&&this.isDataGlobal&&(n.density*=j),t!=null&&(n={...n,...t}),n}getSimulationSettings(e){let{_simulationSettings:t,spatialReferenceInfo:n}=this;if(t==null)return null;let r=this.view.viewingMode===`global`&&n!=null&&I(e.extent.xmin,e.extent.xmax,n);return{...t,wrapAround:r,density:this._effectiveDensity}}get surface(){return this.view.basemapTerrain}doRefresh(){}clear(){this._resources?.detach(),this._resources=null,this._lastResources?.detach(),this._lastResources=null,this.tilesIntersectDataBounds=!0,this._loadingState=`ready-to-load`}_update(){let e=this._time;this._lastResources?.hasFadedOut(e)&&this._lastResources.detach();let t=this._nextStateForTransition(e);if(!this.requireLoad||this.updatingHandles.updating||t!==`ready-to-load`||!this.loadRequirementsMet){this._loadingState=t,this.tilesIntersectDataBounds||(this.requireLoad=!1);return}this._loadingState=`loading`,this.updatingHandles.consumePromise(o((async()=>{let t=this._time,n=this._seamlessTransitionEnabled&&this._resources!=null?f(e+this._seamlessTransitionWaitingTime):e;await this._load(n);let r=f((this._time-t)/1e3);this._updateAverageLoadingTime(r)})())),this.requireLoad=!1}_updateAverageLoadingTime(e){let t=M;this._averageLoadingTime=f(t*e+(1-t)*this._averageLoadingTime)}triggerLoad(){if(!this.suspended&&this._debugAllowAutoLoading.value){if(!this.visible){this.clear();return}this.requireLoad=!0}}get _time(){return te(this.layerView.view.stage.renderer.renderContext.time)}async _load(e){let{extent:t,view:n}=this;if(!this.visible){this.clear();return}if(t==null){this._loadingState=`ready-to-load`;return}this._transitionEnabled||(this._lastResources?.detach(),this._lastResources=null,this._resources?.detach(),this._resources=null);let r=new ae(t,this.layerView.timeExtent,this._tracingResolution,n.state.contentPixelRatio,e),i=this._ensureAbortController();try{let t=await this._loadStreamlines(r,i.signal);if(a(i.signal),t!=null){this._lastResources?.detach(),this._lastResources=this._resources,this._resources=t;let n=this._getStartTime(e);this._lastResources!=null&&(this._lastResources.endTime=n),this._resources.startTime=n,this._animationsEnabled||(this._lastResources?.detach(),this._lastResources=null),await t.attach(),this.suspended&&this.clear(),a(i.signal),this._loadingState=this._seamlessTransitionEnabled?`before-transition`:`transitioning`}else this._loadingState=`ready-to-load`}catch{this._loadingState=`ready-to-load`}}async _loadStreamlines(e,t){let n=await this.fetchDataAndGenerateStreamlines(e,t);if(n==null)return null;let{geometries:r,material:i}=await this._createGeometry(e,n,t);return this._draped?new H(e,n,i,r,this.layerView):new U(e,n,i,r,this.view)}async fetchDataAndGenerateStreamlines(e,t){return null}async _createGeometry(e,t,n){let r=new J(this._materialParameters,this.view.state.isGlobal),i=[],{elevationInfo:o,_draped:s,view:c}=this;function*l(n){for(let a=0;a<t.length;++a)i.push(B(c,e,t[a],o,r,s)),n.madeProgress(),n.done&&(n=yield)}return await this.frameTask.scheduleGenerator(l,n),a(n),{geometries:i,material:r}}_triggerTilesUpdate(){if(this.suspended||this._tilesUpdateIsWaiting)return;this._tilesUpdateIsWaiting=!0;let e=this._ensureAbortController();this.updatingHandles.consumePromise(o((async()=>{try{await ee(()=>this.view.stationary),a(e.signal),await this._debouncedTileUpdate(e)}finally{this._tilesUpdateIsWaiting=!1}})()))}_getTileFilterFunction(){let{view:e,_featureTilesBounds:n,loadAllTiles:r}=this;if(r){let{loadAllTilesLevel:e}=this;return t=>t.level===e}let i=e=>e.rendered&&e.visible,{featureTiles:a}=e;if(!a)return i;let o=a.tiles.filter(e=>e.measures.visible);return e=>i(e)&&Z(n,e.extent)&&o.some(({lij:n})=>t(n,e.lij)||K(n,e.lij))}_nextStateForTransition(e){let{_resources:t}=this;if(this._flowRenderer==null||t==null||this._loadingState===`ready-to-load`||this._loadingState===`loading`)return this._loadingState;let n=t.startTime,r=n+N;return e<n?`before-transition`:e<r?`transitioning`:`ready-to-load`}_getStartTime(e){if(!this._animationsEnabled)return Q;let t=this._time;return f(t>e?t:e)}get usedMemory(){return(this._lastResources?.usedMemory??0)+(this._resources?.usedMemory??0)}get test(){}};e([p()],X.prototype,`type`,void 0),e([p()],X.prototype,`renderedTiles`,void 0),e([p()],X.prototype,`_resources`,void 0),e([p()],X.prototype,`_lastResources`,void 0),e([p()],X.prototype,`tilesIntersectDataBounds`,void 0),e([p()],X.prototype,`requireLoad`,void 0),e([p()],X.prototype,`_averageLoadingTime`,void 0),e([p()],X.prototype,`_loadingState`,void 0),e([p()],X.prototype,`emissiveStrength`,void 0),e([p()],X.prototype,`_animationsEnabled`,null),e([p()],X.prototype,`_clippingArea`,null),e([p()],X.prototype,`_dataBounds`,null),e([p()],X.prototype,`suspended`,null),e([p()],X.prototype,`_fullExtentSurfaceSpatialReference`,null),e([p()],X.prototype,`_draped`,null),e([p()],X.prototype,`extent`,null),e([p()],X.prototype,`loadAllTiles`,null),e([p()],X.prototype,`isDataGlobal`,null),e([p()],X.prototype,`loadAllTilesLevel`,null),e([p()],X.prototype,`targetTiles`,null),e([p()],X.prototype,`_featureTilesBounds`,null),e([p()],X.prototype,`_flowRenderer`,null),e([p()],X.prototype,`_materialParameters`,null),e([p()],X.prototype,`_opacity`,null),e([p()],X.prototype,`_seamlessTransitionWaitingTime`,null),e([p()],X.prototype,`_transitionEnabled`,null),e([p()],X.prototype,`_seamlessTransitionEnabled`,null),e([p()],X.prototype,`_tracingResolution`,null),e([p()],X.prototype,`visible`,null),e([p()],X.prototype,`_effectiveDensity`,null),e([p()],X.prototype,`elevationInfo`,null),e([p()],X.prototype,`needsMagnitude`,null),e([p()],X.prototype,`spatialReferenceInfo`,null),e([p()],X.prototype,`loadingState`,null),e([p()],X.prototype,`updating`,null),e([p()],X.prototype,`visibleAtCurrentScale`,null),e([p()],X.prototype,`_materialParametersOverridde`,void 0),e([p()],X.prototype,`_suspendedOverride`,void 0),e([p()],X.prototype,`_simulationSettingsOverride`,void 0),e([p()],X.prototype,`_seamlessTransitionEnabledOverride`,void 0),e([p()],X.prototype,`_simulationSettings`,null),e([p()],X.prototype,`surface`,null),X=e([m(`esri.views.3d.layers.FlowSubView3D`)],X);const de=X,fe=new b({mode:`on-the-ground`});function Z(e,t){return e==null||t==null||v(e,t)}const pe=g(W,ne.WebMercator),Q=f(-P);function $(e){return e!=null&&e.spatialReference.isWebMercator?e?.intersection(pe):e}export{de as default};
2
+ import{__decorate as e}from"tslib";import{equals as t}from"../../../core/arrayUtils.js";import"../../../core/has.js";import{removeMaybe as n,abortMaybe as r}from"../../../core/maybe.js";import{debounce as i,throwIfAborted as a,ignoreAbortErrors as o}from"../../../core/promiseUtils.js";import{watch as s,sync as c,when as l,whenOnce as ee}from"../../../core/reactiveUtils.js";import{addFrameTask as u}from"../../../core/scheduling.js";import{signal as d}from"../../../core/signal.js";import{Seconds as f,secondsFromMilliseconds as te}from"../../../core/time.js";import{property as p,subclass as m}from"../../../core/accessorSupport/decorators.js";import{projectOrLoad as h}from"../../../geometry/projectionUtils.js";import ne from"../../../geometry/SpatialReference.js";import{toExtent as g,fromExtent as _,intersection as re,create as ie,intersects as v}from"../../../geometry/support/aaBoundingRect.js";import{isInEffectiveScaleRange as y}from"../../../geometry/support/scaleUtils.js";import{getInfo as b}from"../../../geometry/support/spatialReferenceUtils.js";import x from"../../../symbols/support/ElevationInfo.js";import S from"./SubView3D.js";import{getFeatureTileId as C}from"./support/FeatureTileDescriptor.js";import{makeScheduleFunction as w}from"./support/makeScheduleFunction.js";import{debugFlags as T}from"../support/debugFlags.js";import{tileFilterDistance as E,scaleThresholdForLoadingAllTiles as D,defaultTransitionDuration as O,transitionDurationFactor as k,seamlessTransitionEnabled as A,densityFactor as j,loadAllTilesDensityFactor as M,averageLoadingTimeSmoothingFactor as N,fadeOutTime as P,fadeInTime as F,minimumTracingResolution as I}from"../support/flow/constants.js";import{isFullExtent as L,wrappedWidth as ae,FlowQuery3D as R}from"../support/flow/FlowQuery3D.js";import{FlowWorkerHandle as z}from"../support/flow/FlowWorkerHandle.js";import{materialParametersFromRenderer as B,createStreamlineGeometry as V}from"../support/flow/geometryUtils.js";import{boundingRectOfTiles as H}from"../support/flow/loadUtils.js";import{StreamlineResources3DOverlay as U}from"../support/flow/StreamlineResources3DOverlay.js";import{StreamlineResources3DShape as W}from"../support/flow/StreamlineResources3DShape.js";import{webMercatorWorldExtent as G}from"../terrain/TerrainConst.js";import{descendantsAtLevel as K,tilesAreRelated as q}from"../terrain/tileUtils.js";import{isScreenSizePerspectiveEnabled as J}from"../webgl-engine/lib/screenSizePerspectiveUtils.js";import{RibbonLineMaterial as oe}from"../webgl-engine/materials/RibbonLineMaterial.js";import{hasLayerBasedScaleVisibility as se}from"../../support/layerViewUtils.js";import{TaskPriority as ce}from"../../support/Scheduler.js";import{simulationSettingsEqual as le,getPositions as ue,getFlowSimulationSettings as Y}from"../../support/flow/utils.js";let X=class extends S{constructor(e){super(e),this.type=`flow`,this.renderedTiles=null,this.tilesIntersectDataBounds=!0,this.requireLoad=!1,this.workerHandle=null,this.frameTask=null,this._averageLoadingTime=f(0),this._abortController=null,this._loadingState=`ready-to-load`,this._tilesUpdateIsWaiting=!1,this._debugAllowAutoLoading=d(!0),this.emissiveStrength=0,this._materialParametersOverridde=null,this._suspendedOverride=null,this._simulationSettingsOverride=null,this._seamlessTransitionEnabledOverride=null,this._updateTask=null,this._debouncedTileUpdate=i(async e=>{let{allTiles:t}=this.surface,n=this._getTileFilterFunction(),{_dataBounds:r}=this,i=new Set,o=!1;function*s(e){for(let a=0;a<t.length;++a){let s=t.at(a),c=Z(r,s.extent);n(s)&&c&&(i.add(s),o=!0),e.madeProgress(),e.done&&(e=yield)}}await this.frameTask.scheduleGenerator(s,e.signal),a(e.signal),this.tilesIntersectDataBounds=t.length===0||this.loadAllTiles?!0:o,this.renderedTiles=i})}initialize(){let{surface:e,view:t}=this,{resourceController:n}=t;this.workerHandle=new z(w(n)),this.frameTask=n.scheduler.registerTask(ce.FLOW_GENERATOR),this._updateTask=u({update:()=>this._update()}),this.addHandles([s(()=>this._simulationSettings,()=>this.triggerLoad(),{sync:!0,equals:(e,t)=>e==null&&t==null||e!=null&&t!=null&&le(e,t)}),this.updatingHandles.add(()=>this.suspended,e=>{e?this._suspend():this._resume()},c),s(()=>{let{elevationInfo:e}=this;return[this._clippingArea,this.visible,this._draped,this.view.state.contentPixelRatio,this.view.viewingMode,e?.mode,e?.offset,e?.unit,this._effectiveDensity]},()=>this.triggerLoad(),c),l(()=>!this._animationsEnabled,()=>{let{_resources:e,_lastResources:t}=this;e!=null&&(e.startTime=Q),t!=null&&(t.startTime=Q)},c),s(()=>this._materialParameters,e=>{this._resources?.setMaterialParameters(e),this._lastResources?.setMaterialParameters(e)}),l(()=>e.allTilesCreated,()=>this._triggerTilesUpdate(),c),t.enableFeatureTiles(),s(()=>[this._dataBounds,this._featureTilesBounds,this.loadAllTiles],()=>this._triggerTilesUpdate()),s(()=>this._flowRenderer,(e,t)=>{let n=t?.visualVariables??[],r=e?.visualVariables??[];r.length===n.length&&r.every((e,t)=>e.type===n[t].type)||this.clear()}),l(()=>!t.featureTiles?.updating,()=>{this._triggerTilesUpdate()})]),this.suspended&&this._suspend(),this._triggerTilesUpdate()}destroy(){this._updateTask=n(this._updateTask),this.abort(),this.clear(),this.notifyChange(`updating`)}abort(){this._abortController=r(this._abortController),this._tilesUpdateIsWaiting=!1,this.requireLoad=!1}_ensureAbortController(){return this._abortController??=new AbortController,this._abortController}_resume(){this._updateTask.resume(),this._triggerTilesUpdate(),this.triggerLoad()}_suspend(){this._updateTask.pause(),this.abort(),this.clear()}get _animationsEnabled(){return this.view.state.animationsEnabled}get _clippingArea(){let e=h(this.view.clippingArea,this.surface.spatialReference).geometry;return e==null?null:_(e)}get _dataBounds(){let e=this._fullExtentSurfaceSpatialReference;return e==null?null:_(e)}get suspended(){return this._suspendedOverride==null?this.layerView.suspended||this.view.groundView.hasTerrainReplacement:this._suspendedOverride}get _fullExtentSurfaceSpatialReference(){return h(this.layer.fullExtent,this.surface.spatialReference).geometry}get _draped(){return this.elevationInfo.mode===`on-the-ground`}get extent(){if(this.loadAllTiles)return $(this._fullExtentSurfaceSpatialReference);let{spatialReference:e}=this.surface,t=this.renderedTiles;if(e==null||t==null)return null;let n=this.view.terrainLevel;if(n!=null){let e=new Set;t.forEach(t=>{Math.abs(n-t.level)<E&&e.add(t)}),t=e}let r=H(t,this.spatialReferenceInfo);return r==null?null:(re(r,this._clippingArea,r),$(g(r,e)))}get loadAllTiles(){return this.view.scale>(T.FLOW_GLOBAL_SCALE_THRESHOLD??D)}get isDataGlobal(){let{extent:e,spatialReferenceInfo:t}=this;return e!=null&&L(e.xmin,e.xmax,t)}get loadAllTilesLevel(){let{tilingScheme:e}=this.surface;return Math.min(Math.ceil(e.levelAtScale(T.FLOW_GLOBAL_SCALE_THRESHOLD??D)),e.getMaxLod())}get targetTiles(){let e=new Map;if(this.loadAllTiles){let{_dataBounds:t}=this;if(t==null)return e;let n=ie(),r=this.loadAllTilesLevel,i=this.surface.tilingScheme,a=i.rootTilesInExtent(t).values().flatMap(e=>K(e,r));for(let o of a){let[a,s,c]=o;i.getExtent(r,s,c,n),Z(t,n)&&e.set(C(r,s,c),o)}return e}let{renderedTiles:t}=this;for(let n of t??[])e.set(n.key,n.lij);return e}get _featureTilesBounds(){let e=this.view.featureTiles?.filterExtent,t=h(e,this.surface.spatialReference).geometry;return t==null?null:_(t)}get _flowRenderer(){let e=this.layer.renderer;return e?.type===`flow`?e:null}get _materialParameters(){return{...B(this._flowRenderer,this.layerView.fullOpacity,this.emissiveStrength),...this._materialParametersOverridde,hasSlicePlane:this.layerView.slicePlaneEnabled,screenSizePerspective:!this._draped&&`screenSizePerspectiveEnabled`in this.layer&&J(this.layer.screenSizePerspectiveEnabled)?this.view.screenSizePerspective.parameters:null}}get _opacity(){return this.layerView.fullOpacity}get _seamlessTransitionWaitingTime(){let{_averageLoadingTime:e}=this;return f(e===0?O:this._averageLoadingTime*k)}get _transitionEnabled(){return this.view.qualitySettings.flow.transitionEnabled}get _seamlessTransitionEnabled(){return this._transitionEnabled?this._seamlessTransitionEnabledOverride==null?A:this._seamlessTransitionEnabledOverride:!1}get _tracingResolution(){let{extent:e}=this;if(!e)return[0,0];let t=ae(e.xmin,e.xmax,this.spatialReferenceInfo?.valid)/(e.ymax-e.ymin),[n,r]=this.view.size,i,a;n<r?(i=n,a=n/t):(i=r*t,a=r);let o=I,s=this.view.qualitySettings.flow.maxTracingResolution,c=Math.max(1,o/Math.min(i,a)),l=c*Math.min(1,s/Math.max(i*c,a*c));return[Math.round(i*l),Math.round(a*l)]}get visible(){let e=this._flowRenderer?.color;return this.visibleAtCurrentScale&&this.layer.effectiveVisible&&this._opacity>0&&(e==null||e.a>0)}get _effectiveDensity(){let{_simulationSettings:e}=this;if(e==null)return 0;let t=e.density*this.view.quality;return e.lineSpacing/Math.sqrt(t)<e.lineCollisionWidth?(e.lineSpacing/e.lineCollisionWidth)**2:t}get elevationInfo(){return(`elevationInfo`in this.layer?this.layer.elevationInfo:void 0)??fe}startPositions(e){if(!this._seamlessTransitionEnabled)return[];let{_flowRenderer:t,_resources:n}=this;return t==null||n==null?[]:ue(n.streamlines,n.query,e,t.flowSpeed)}get needsMagnitude(){return this._flowRenderer?.hasVisualVariables()??!1}get spatialReferenceInfo(){return b(this.surface.spatialReference)}get loadingState(){return this._loadingState}get loadRequirementsMet(){return this.renderedTiles!=null&&(this.renderedTiles.size>0||this.loadAllTiles)&&this.extent!=null}hasWork(){return this.updatingHandles.updating||this.requireLoad||this._loadingState===`before-transition`}get updating(){return this._debugAllowAutoLoading.value&&this.visible&&!(this.destroyed||this.destroying)&&this.hasWork()}get visibleAtCurrentScale(){return!se()||y(this.layer.effectiveScaleRange,this.view.scale)}get _simulationSettings(){let{_flowRenderer:e,_simulationSettingsOverride:t}=this;if(e==null)return null;let n=Y(e);return n.segmentLength=n.lineCollisionWidth/2,n.onlyForwardTracing=!1,n.maxNumberOfStreamlines=this.view.qualitySettings.flow.maxTotalNumberOfStreamlines,n.density*=j,this.loadAllTiles&&this.isDataGlobal&&(n.density*=M),t!=null&&(n={...n,...t}),n}getSimulationSettings(e){let{_simulationSettings:t,spatialReferenceInfo:n}=this;if(t==null)return null;let r=this.view.viewingMode===`global`&&n!=null&&L(e.extent.xmin,e.extent.xmax,n);return{...t,wrapAround:r,density:this._effectiveDensity}}get surface(){return this.view.basemapTerrain}doRefresh(){}clear(){this._resources?.detach(),this._resources=null,this._lastResources?.detach(),this._lastResources=null,this.tilesIntersectDataBounds=!0,this._loadingState=`ready-to-load`}_update(){let e=this._time;this._lastResources?.hasFadedOut(e)&&this._lastResources.detach();let t=this._nextStateForTransition(e);if(!this.requireLoad||this.updatingHandles.updating||t!==`ready-to-load`||!this.loadRequirementsMet){this._loadingState=t,this.tilesIntersectDataBounds||(this.requireLoad=!1);return}this._loadingState=`loading`,this.updatingHandles.consumePromise(o((async()=>{let t=this._time,n=this._seamlessTransitionEnabled&&this._resources!=null?f(e+this._seamlessTransitionWaitingTime):e;await this._load(n);let r=f((this._time-t)/1e3);this._updateAverageLoadingTime(r)})())),this.requireLoad=!1}_updateAverageLoadingTime(e){let t=N;this._averageLoadingTime=f(t*e+(1-t)*this._averageLoadingTime)}triggerLoad(){if(!this.suspended&&this._debugAllowAutoLoading.value){if(!this.visible){this.clear();return}this.requireLoad=!0}}get _time(){return te(this.layerView.view.stage.renderer.renderContext.time)}async _load(e){let{extent:t,view:n}=this;if(!this.visible){this.clear();return}if(t==null){this._loadingState=`ready-to-load`;return}this._transitionEnabled||(this._lastResources?.detach(),this._lastResources=null,this._resources?.detach(),this._resources=null);let r=new R(t,this.layerView.timeExtent,this._tracingResolution,n.state.contentPixelRatio,e),i=this._ensureAbortController();try{let t=await this._loadStreamlines(r,i.signal);if(a(i.signal),t!=null){this._lastResources?.detach(),this._lastResources=this._resources,this._resources=t;let n=this._getStartTime(e);this._lastResources!=null&&(this._lastResources.endTime=n),this._resources.startTime=n,this._animationsEnabled||(this._lastResources?.detach(),this._lastResources=null),await t.attach(),this.suspended&&this.clear(),a(i.signal),this._loadingState=this._seamlessTransitionEnabled?`before-transition`:`transitioning`}else this._loadingState=`ready-to-load`}catch{this._loadingState=`ready-to-load`}}async _loadStreamlines(e,t){let n=await this.fetchDataAndGenerateStreamlines(e,t);if(n==null)return null;let{geometries:r,material:i}=await this._createGeometry(e,n,t);return this._draped?new U(e,n,i,r,this.layerView):new W(e,n,i,r,this.view)}async fetchDataAndGenerateStreamlines(e,t){return null}async _createGeometry(e,t,n){let r=new oe(this._materialParameters,this.view.state.isGlobal),i=[],{elevationInfo:o,_draped:s,view:c}=this;function*l(n){for(let a=0;a<t.length;++a)i.push(V(c,e,t[a],o,r,s)),n.madeProgress(),n.done&&(n=yield)}return await this.frameTask.scheduleGenerator(l,n),a(n),{geometries:i,material:r}}_triggerTilesUpdate(){if(this.suspended||this._tilesUpdateIsWaiting)return;this._tilesUpdateIsWaiting=!0;let e=this._ensureAbortController();this.updatingHandles.consumePromise(o((async()=>{try{await ee(()=>this.view.stationary),a(e.signal),await this._debouncedTileUpdate(e)}finally{this._tilesUpdateIsWaiting=!1}})()))}_getTileFilterFunction(){let{view:e,_featureTilesBounds:n,loadAllTiles:r}=this;if(r){let{loadAllTilesLevel:e}=this;return t=>t.level===e}let i=e=>e.rendered&&e.visible,{featureTiles:a}=e;if(!a)return i;let o=a.tiles.filter(e=>e.measures.visible);return e=>i(e)&&Z(n,e.extent)&&o.some(({lij:n})=>t(n,e.lij)||q(n,e.lij))}_nextStateForTransition(e){let{_resources:t}=this;if(this._flowRenderer==null||t==null||this._loadingState===`ready-to-load`||this._loadingState===`loading`)return this._loadingState;let n=t.startTime,r=n+P;return e<n?`before-transition`:e<r?`transitioning`:`ready-to-load`}_getStartTime(e){if(!this._animationsEnabled)return Q;let t=this._time;return f(t>e?t:e)}get usedMemory(){return(this._lastResources?.usedMemory??0)+(this._resources?.usedMemory??0)}get test(){}};e([p()],X.prototype,`type`,void 0),e([p()],X.prototype,`renderedTiles`,void 0),e([p()],X.prototype,`_resources`,void 0),e([p()],X.prototype,`_lastResources`,void 0),e([p()],X.prototype,`tilesIntersectDataBounds`,void 0),e([p()],X.prototype,`requireLoad`,void 0),e([p()],X.prototype,`_averageLoadingTime`,void 0),e([p()],X.prototype,`_loadingState`,void 0),e([p()],X.prototype,`emissiveStrength`,void 0),e([p()],X.prototype,`_animationsEnabled`,null),e([p()],X.prototype,`_clippingArea`,null),e([p()],X.prototype,`_dataBounds`,null),e([p()],X.prototype,`suspended`,null),e([p()],X.prototype,`_fullExtentSurfaceSpatialReference`,null),e([p()],X.prototype,`_draped`,null),e([p()],X.prototype,`extent`,null),e([p()],X.prototype,`loadAllTiles`,null),e([p()],X.prototype,`isDataGlobal`,null),e([p()],X.prototype,`loadAllTilesLevel`,null),e([p()],X.prototype,`targetTiles`,null),e([p()],X.prototype,`_featureTilesBounds`,null),e([p()],X.prototype,`_flowRenderer`,null),e([p()],X.prototype,`_materialParameters`,null),e([p()],X.prototype,`_opacity`,null),e([p()],X.prototype,`_seamlessTransitionWaitingTime`,null),e([p()],X.prototype,`_transitionEnabled`,null),e([p()],X.prototype,`_seamlessTransitionEnabled`,null),e([p()],X.prototype,`_tracingResolution`,null),e([p()],X.prototype,`visible`,null),e([p()],X.prototype,`_effectiveDensity`,null),e([p()],X.prototype,`elevationInfo`,null),e([p()],X.prototype,`needsMagnitude`,null),e([p()],X.prototype,`spatialReferenceInfo`,null),e([p()],X.prototype,`loadingState`,null),e([p()],X.prototype,`updating`,null),e([p()],X.prototype,`visibleAtCurrentScale`,null),e([p()],X.prototype,`_materialParametersOverridde`,void 0),e([p()],X.prototype,`_suspendedOverride`,void 0),e([p()],X.prototype,`_simulationSettingsOverride`,void 0),e([p()],X.prototype,`_seamlessTransitionEnabledOverride`,void 0),e([p()],X.prototype,`_simulationSettings`,null),e([p()],X.prototype,`surface`,null),X=e([m(`esri.views.3d.layers.FlowSubView3D`)],X);const de=X,fe=new x({mode:`on-the-ground`});function Z(e,t){return e==null||t==null||v(e,t)}const pe=g(G,ne.WebMercator),Q=f(-F);function $(e){return e!=null&&e.spatialReference.isWebMercator?e?.intersection(pe):e}export{de 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"../../../core/has.js";import t from"../../../core/Logger.js";import{abortMaybe as n,removeMaybe as r,destroyMaybe as i}from"../../../core/maybe.js";import{throwIfAborted as a}from"../../../core/promiseUtils.js";import{watch as o,whenOnce as s,initial as c}from"../../../core/reactiveUtils.js";import{Milliseconds as l}from"../../../core/time.js";import{isUint32Array as u}from"../../../core/typedArrayUtil.js";import{unitFromRESTJSON as d,convertUnit as f}from"../../../core/units.js";import{property as p,subclass as m}from"../../../core/accessorSupport/decorators.js";import{fromValues as h}from"../../../core/libs/gl-matrix-2/factories/quatf64.js";import{getReferenceEllipsoid as g}from"../../../geometry/ellipsoidUtils.js";import _ from"../../../geometry/HeightModelInfo.js";import{create as v}from"../../../geometry/support/aaBoundingBox.js";import{isCompatible as y}from"../../../geometry/support/heightModelInfoUtils.js";import{isPlateCarree as b,isWebMercator as x,equals as S,isGeographic as C}from"../../../geometry/support/spatialReferenceUtils.js";import w from"../../../geometry/support/WKIDUnitConversion.js";import{validateEntity3D as T,makeCacheKey as E,getHeightModelInfoFromVCS as D}from"../../../layers/support/tiles3DUtils.js";import{getElevationOffsetInMeters as O}from"../../../support/elevationInfoUtils.js";import{getMetersPerUnit as k}from"../../../symbols/support/unitConversionUtils.js";import{GaussianSplatLayerViewPerformanceInfo as A}from"./GaussianSplatLayerViewPerformanceInfo.js";import{LayerView3D as j}from"./LayerView3D.js";import{addLayerViewToWasm as M,getLyr3DWasm as N,removeLayerViewFromWasm as P}from"./Lyr3DWasm.js";import{LayerElevationProvider as F}from"./i3s/LayerElevationProvider.js";import{ElevationRange as I}from"../support/ElevationRange.js";import{projectToBoundingBox as L}from"../support/extentUtils.js";import{Obb as R}from"../support/orientedBoundingBox.js";import{splatPageSizeInU32 as z,gaussiansPerPage as B,packedGaussianSizeInU32 as V,splatAtlasTextureWidth as H}from"../support/gaussianSplatting/GaussianSplatAtlasPages.js";import{GaussianSplatDataStore as U}from"../support/gaussianSplatting/GaussianSplatDataStore.js";import{GaussianSplatFadeHelper as W}from"../support/gaussianSplatting/GaussianSplatFadeHelper.js";import{GaussianSplatIntersectionHandler as G}from"../support/gaussianSplatting/GaussianSplatIntersectionHandler.js";import{GaussianTile as K}from"../support/gaussianSplatting/GaussianTile.js";import{GaussianSplatDepthRenderer as q}from"../webgl-engine/lib/GaussianSplatDepthRenderer.js";import{GaussianSplatRenderer as J}from"../webgl-engine/lib/GaussianSplatRenderer.js";import{GaussianSplatShadows as Y}from"../webgl-engine/lib/GaussianSplatShadows.js";import X from"../../layers/LayerView.js";import{spatialReferenceIncompatibleError as Z,isInEffectiveScaleRange as ee}from"../../support/layerViewUtils.js";import{TaskPriority as te}from"../../support/Scheduler.js";var Q;const ne=()=>t.getLogger(`esri.views.3d.layers.GaussianSplatLayerView3D`),re=(()=>{let e=new Int16Array(256);e[0]=-255;for(let t=1;t<e.length;t++)e[t]=Math.round(16*Math.log(t/255));return e})();let $=class extends j(X){static{Q=this}static{this.createRenderableBatchSize=64}static{this.uploadBatchPageCount=16}constructor(e){super(e),this.type=`gaussian-splat-3d`,this.ignoresMemoryFactor=!1,this._tileHandles=new Map,this._pageBuffer=new Uint32Array(z*Q.uploadBatchPageCount),this._tmpTilesWithChangedVisibility=[],this._renderablesBeingCreated=new Set,this._currentLyr3dVisibilityChange=0,this._tileFadeInsAwaitingInitialSort=new Set,this._pendingTileFadeOuts=new Map,this._pendingFadeDuration=l(0),this._createRenderableAbortController=new AbortController,this.skipHeightModelInfoValidation=!0,this._initializationController=null,this._wasmLayerId=-1,this._metersPerVCSUnit=1,this._usedTileMemory=0,this._cacheTileMemory=0,this._useEsriCrs=!1,this.fullExtentInLocalViewSpatialReference=null,this._suspendedHandle=null,this._conversionBuffer=new ArrayBuffer(4),this._u32View=new Uint32Array(this._conversionBuffer),this._f32View=new Float32Array(this._conversionBuffer);let t=e.view.resourceController;this._memCache=t.memoryController.newCache(`GaussianSplat-${this.uid}`,e=>this._deleteTile(e)),this._frameTask=t.scheduler.registerTask(te.GAUSSIAN_SPLAT_TEXTURE_ATLAS)}get _clippingBox(){if(!this.view?.clippingArea)return null;let e=v();return L(this.view.clippingArea,e,this.view.renderSpatialReference)?e:null}get clippingBox(){return this._renderer?.clippingBox??null}initialize(){let{view:e}=this;this.addHandles([o(()=>e.qualitySettings.fadeDuration,e=>{this.data&&(this.fadeHelper.onFadeDurationChanged(e),this.updateFadingTexture())})]),this.addResolvingPromise(this._initializeAsync(e))}async _initializeAsync(e){this._initializationController=new AbortController;let{signal:t}=this._initializationController;if(await s(()=>e?.defaultsFromMap.heightModelInfoReady,t),a(t),!this._canProjectWithoutEngine())throw Z(`layer`,this.layer.spatialReference.wkid,e.renderSpatialReference?.wkid);this._wasmLayerId=await M(this,t),a(t),this._renderer=new J({view:e,layerView:this}),this.data=new U(this._renderer,(e,t)=>this._onSortComplete(e,t),()=>this._freeInvisibleTiles()),this._shadows=new Y({view:e,layerView:this}),this.fadeHelper=new W(this),this._prepassDepthRenderer=new q({view:e,layerView:this});let n=new G(this);this._intersectionHandler=n,e.sceneIntersectionHelper.addIntersectionHandler(n),this._elevationProvider=new F({view:e,layerElevationSource:this,intersectionHandler:n}),e.elevationProvider.register(2,this._elevationProvider),this.addHandles([o(()=>this.layer.elevationInfo,e=>this._elevationInfoChanged(e)),o(()=>this.slicePlaneEnabled,e=>this._slicePlaneEnabledChanged(e),c)]),this._suspendedHandle=o(()=>this.suspended,e=>this._wasm?.setEnabled(this,!e),c),this.addHandles([o(()=>this._clippingBox,e=>{this._renderer&&(this._renderer.clippingBox=e)},c),o(()=>this.maximumGaussianCount,e=>this._wasm?.setMaximumGaussianSplatCount(Math.min(e,this.data.textureAtlas.maximumSupportedVisibleGaussians)),c)]),this._initializationController=null}get wasmLayerId(){return this._wasmLayerId}get metersPerVCSUnit(){return this._metersPerVCSUnit}get tileHandles(){return this._tileHandles}updateFadingTexture(){this.data.fadingTexture.updateTexture(this.data.textureAtlas.pageAllocator.pageCount)}get _wasm(){return N(this.view)}get usedMemory(){return this._usedTileMemory+(this.data?.usedMemory??0)}get cachedMemory(){return this._cacheTileMemory}get unloadedMemory(){return 0}get useEsriCrs(){return this._useEsriCrs}get elevationProvider(){return this._elevationProvider}get elevationOffset(){return O(this.layer.elevationInfo)}get elevationRange(){let e=this.fullExtent;return e?.zmin&&e?.zmax?new I(e.zmin,e.zmax):null}getElevationRange(e){return this._intersectionHandler.getElevationRange(e)}get fullExtent(){return this.layer.fullExtent}get visibleAtCurrentScale(){return ee(this.layer.effectiveScaleRange,this.view.scale)}isUpdating(){let e=this._wasm;return this._wasmLayerId<0||e==null?!1:e.isUpdating(this._wasmLayerId)||this.data.updating||this.fadeHelper.updating}updatingFlagChanged(){this.notifyChange(`updating`)}async createRenderable(e){if(this.destroyed||this.destroying)throw Error(`IntegratedMesh3DTilesLayerView3D: createRenderable called after destroy`);let{entity3d:t}=e;if(!T(t))throw Error(`entity3D not valid`);let n=t.desc.geometry.prims[t.validPrimitiveIndices[0]].atrbs[0],r=t.assets[n.assetId];if(!r)throw Error(`entity3D not valid`);let i=r.count;if(i===0)return ne().warnOnce(`encountered tile with zero Gaussians`),()=>({memUsageBytes:0,numGaussians:0});let a=null;if(r.dataType===`U32`&&u(r.data))a=r.data;else throw Error(`unexpected GaussianSplat Entity3D asset.data format`);let o=this.extractHeader(a),s=2.048,c=o.tileOrigin.x*s,l=o.tileOrigin.y*s,d=o.tileOrigin.z*s,f=t.desc,p=f.obb.quaternion,m=new R(f.obb.center,f.obb.halfSize,h(...p)),_=this.view.state.isGlobal,v=_?g(this.view.spatialReference).radius:0,y={handle:e.handle,bufferView:a,totalGaussians:i,packedHeader:o.packedHeader,tileOrigin:{x:c,y:l,z:d},invPosScale:o.invPosScale,obb:m,origin:{x:m.centerX,y:m.centerY,z:m.centerZ},isGlobal:_,ellipsoidRadius:v};this._renderablesBeingCreated.add(e.handle);let b;try{b=await this._frameTask.scheduleGenerator(e=>this._createRenderableTask(y,e),this._createRenderableAbortController.signal)}catch(t){throw this._renderablesBeingCreated.delete(e.handle),t}return this._renderablesBeingCreated.delete(e.handle),()=>b}*_createRenderableTask(e,t){let{handle:n,bufferView:r,totalGaussians:i,packedHeader:a,tileOrigin:o,invPosScale:s,obb:c,origin:l,isGlobal:u,ellipsoidRadius:d}=e,f=o.x,p=o.y,m=o.z,h=l.x,g=l.y,_=l.z,v=new Float32Array(i*3),y=new Uint32Array(i),b=new Uint32Array(i),x=[],S=Math.ceil(i/B),C=1/0,w=-1/0,T=1/0,E=-1/0,D=0,O=-1,k=0,A=0;for(let e=0;e<i;e++){let n=e*V,i=r[n],a=r[n+1],o=r[n+2],c=r[n+3],l=a&16383,d=a>>>14&16383,x=a>>>28&15|(o&1023)<<4,S=c>>>24,j=re[S],M=(o>>>10&255)+j,N=(o>>>18&255)+j,P=(o>>>26&63|(c&3)<<6)+j,F=M>0?M:0,I=N>0?N:0,L=P>0?P:0,R=F|I<<8|L<<16,z=Math.max(F,I,L),B=l*s+f,H=d*s+p,U=x*s+m;if(v[D]=B-h,v[D+1]=H-g,v[D+2]=U-_,u){let e=B*B+H*H+U*U;T=Math.min(T,e),E=Math.max(E,e)}else C=Math.min(C,U),w=Math.max(w,U);y[e]=i,b[e]=R,z>O&&(O=z),S>k&&(k=S),D+=3,A++,A===Q.createRenderableBatchSize&&(A=0,t.madeProgress()&&(t=yield))}A>0&&t.madeProgress()&&(t=yield),u&&(C=Math.sqrt(T)-d,w=Math.sqrt(E)-d);let j=this._extractGaussianSplatMbsRadiusSquared(O),{fullExtent:M}=this.layer;M?.hasZ&&M.zmax&&M.zmin&&(C=Math.max(C,M.zmin),w=Math.min(w,M.zmax));let N=new I(C,w),P=this.data.textureAtlas,F=this.data.headerTexture;try{for(let e=0;e<S;e+=Q.uploadBatchPageCount){let n=Math.min(S,e+Q.uploadBatchPageCount);for(let t=e;t<n;t++){let e=P.allocatePage();if(e===null&&(this._freeInvisibleTiles(),e=P.allocatePage()),e===null)throw Error(`ran out of gaussian splat memory`);x.push(e)}for(let t=e;t<n;){let e=x[t],o=t+1;for(;o<n&&x[o]===x[o-1]+1;)o++;let s=o-t,c=i-t*B,l=Math.min(c,s*B),u=t*z,d=l*V;this._pageBuffer.set(r.subarray(u,u+d));let f=e*B,p=f%H,m=Math.floor(f/H);P.update(p,m,this._pageBuffer,s),F.update(e,a,s),t=o}t.madeProgress()&&(t=yield)}}catch(e){throw P.freePages(x),e}let L=new K(n,c,x,v,y,b,i,j,k/255,N);return this._tileHandles.set(n,L),this._cacheTileMemory+=L.usedMemory,this._memCache.put(`${L.handle}`,L),{memUsageBytes:L.usedMemory,numGaussians:i}}_extractGaussianSplatMbsRadiusSquared(e){return Math.exp(e/8-20)*9}freeRenderable(e){this._tileFadeInsAwaitingInitialSort.delete(e),this._pendingTileFadeOuts.delete(e);let t=this.data?.textureAtlas,n=!1,r=this._tileHandles.get(e);if(r){let i=!1;for(let t of this._pendingTileFadeOuts.values())t.incomingTileHandles.has(e)&&(t.visibilityChange=this._currentLyr3dVisibilityChange+1,i=!0);i&&(this._currentLyr3dVisibilityChange++,n=!0),r.lifecycleState===0?this._cacheTileMemory-=r.usedMemory:(n=!0,this.fadeHelper.onTileDiscarded(r),this._usedTileMemory-=r.usedMemory,this._intersectionHandler.removeTile(r)),t&&r.pageIds.forEach(e=>t.freePage(e)),this.freeObject(r),this._tileHandles.delete(e)}n&&this.updateGaussians()}freeObject(e){this._memCache.pop(`${e.handle}`)}notifyTileObbsChanged(e){this._elevationProvider&&this._elevationProvider.notifyObjectsChangedFunctional(e.length,t=>{for(let{obb:n}of e)if(!t(n))break})}setRenderableVisibility(e,t,n){let r=this.fadeHelper.updateFadeDuration(),i=new ie(this._currentLyr3dVisibilityChange+1),a=new Set,o=!1;for(let s=0;s<n;s++){let n=this._tileHandles.get(e[s]);if(!n)continue;let c=t[s]?this._prepareTileFadeIn(n,r):this._prepareTileFadeOut(n,i);t[s]&&i.incomingTileHandles.add(n.handle),c&&a.add(n.handle),o||=c}if(o){if(this._currentLyr3dVisibilityChange++,this._pendingFadeDuration=r,this._updatePendingTileHandoffs(a,i),i.incomingTileHandles.size===0)for(let e of this._tileFadeInsAwaitingInitialSort)i.incomingTileHandles.add(e);this.updateGaussians()}}_updatePendingTileHandoffs(e,t){for(let n of new Set(this._pendingTileFadeOuts.values())){if(n===t)continue;let r=!1;for(let i of e)n.incomingTileHandles.has(i)&&(r=!0,t.incomingTileHandles.size>0&&n.incomingTileHandles.delete(i));if(r){n.visibilityChange=t.visibilityChange;for(let e of t.incomingTileHandles)n.incomingTileHandles.add(e)}}}_prepareTileFadeIn(e,t){let n=this._pendingTileFadeOuts.delete(e.handle);return e.lifecycleState===2?(this.fadeHelper.fadeTile(e,0,t),!1):this._tileFadeInsAwaitingInitialSort.has(e.handle)?n:(e.lifecycleState===0&&this._popTileFromCache(e),e.lifecycleState=1,this._tileFadeInsAwaitingInitialSort.add(e.handle),!0)}_prepareTileFadeOut(e,t){let n=this._tileFadeInsAwaitingInitialSort.delete(e.handle);return n&&e.lifecycleState===1&&(this.moveTileToCache(e),e.lifecycleState=0),e.lifecycleState===2?this._pendingTileFadeOuts.has(e.handle)?n:(this._pendingTileFadeOuts.set(e.handle,t),!0):n}_onSortComplete(e,t){let n=this._tmpTilesWithChangedVisibility;n.length=0,this._triggerFadeIns(e,n);let r=this._triggerFadeOuts(t,n);n.length>0&&this.notifyTileObbsChanged(n),r&&this.updateGaussians()}_triggerFadeIns(e,t){for(let n of e)this._tileHandles.get(n.handle)===n&&this._tileFadeInsAwaitingInitialSort.delete(n.handle)&&(n.lifecycleState=2,t.push(n),this.fadeHelper.fadeTile(n,0,this._pendingFadeDuration))}_triggerFadeOuts(e,t){let n=!1;for(let t of this._pendingTileFadeOuts.values())if(e>=t.visibilityChange){n=!0;break}if(!n)return!1;let r=this._pendingFadeDuration,i=this._pendingFadeDuration;for(let e of this._tileHandles.values()){let{fadeDirection:t,fadeDuration:n,fadeProgress:a}=e;if(t!==0||n==null||a==null)continue;let o=n*(1-a);r=l(Math.max(r,o)),i=l(Math.max(i,n))}let a=!1;for(let[n,o]of this._pendingTileFadeOuts){if(e<o.visibilityChange)continue;this._pendingTileFadeOuts.delete(n);let s=this._tileHandles.get(n);if(s){let e=s.lifecycleState===2,n=s.opacityModifier===1?r:i;this.fadeHelper.fadeTile(s,1,n),e&&s.lifecycleState===0&&(t.push(s),a=!0)}}return a}_popTileFromCache(e){this._usedTileMemory+=e.usedMemory,this._cacheTileMemory-=e.usedMemory,this._intersectionHandler.addTile(e),this._memCache.pop(E(e.handle))}moveTileToCache(e){this._usedTileMemory-=e.usedMemory,this._cacheTileMemory+=e.usedMemory,this._intersectionHandler.removeTile(e),this._memCache.put(E(e.handle),e)}destroy(){this._initializationController=n(this._initializationController),this._createRenderableAbortController.abort(),P(this),this._suspendedHandle&&=r(this._suspendedHandle),this._intersectionHandler&&=(this.view.sceneIntersectionHelper.removeIntersectionHandler(this._intersectionHandler),null),this._elevationProvider&&this.view.elevationProvider&&(this._elevationProvider.notifyObjectsChangedFunctional(this._tileHandles.size,e=>{for(let{obb:t}of this._tileHandles.values())if(!e(t))break}),this.view.elevationProvider.unregister(this._elevationProvider),this._elevationProvider=null),this._frameTask.remove(),this._shadows=i(this._shadows),this._prepassDepthRenderer=i(this._prepassDepthRenderer),this._renderer=i(this._renderer),this._memCache.destroy(),this.data=i(this.data)}_canProjectWithoutEngine(){if(this.view.state.viewingMode===1||b(this.view.renderSpatialReference)||x(this.view.renderSpatialReference))return!0;if(this.layer.esriCrsSpatialReference&&S(this.layer.esriCrsSpatialReference,this.view.renderSpatialReference)){if(this.layer.esriCrsSpatialReference.vcsWkid===115700)return!1;let e=D(this.layer.esriCrsSpatialReference);if(!e){let t=this.layer.esriCrsSpatialReference,n=C(t),r=`meters`;!n&&t.wkid&&t.wkid!==-1&&(r=d(w.units[w[t.wkid]])),r&&(e=new _({heightModel:`gravity-related-height`,heightUnit:r}))}let t=this.view.heightModelInfo;return this._useEsriCrs=y(e,t,!1)===0,this._useEsriCrs&&(e&&(this._metersPerVCSUnit=f(1,e.heightUnit,`meters`)),this.fullExtentInLocalViewSpatialReference=this.layer.esriCrsFullExtent),this._useEsriCrs}return!1}_elevationInfoChanged(e){if(!e?.offset)this._wasm?.setLayerOffset(this,0);else if(!this._useEsriCrs)this._wasm?.setLayerOffset(this,O(e));else{let t=k(e?.unit)/this._metersPerVCSUnit,n=e?.offset??0;this._wasm?.setLayerOffset(this,n*t)}}_slicePlaneEnabledChanged(e){this._renderer&&(this._renderer.slicePlaneEnabled=e),this._intersectionHandler&&(this._intersectionHandler.slicePlaneEnabled=e)}updateGaussians(){let e=[];for(let t of this._tileHandles.values())t.lifecycleState!==0&&e.push(t);this.data.updateGaussianVisibility(e,this._currentLyr3dVisibilityChange),this.notifyChange(`updating`)}get maximumGaussianCount(){return this.view.qualitySettings.gaussianSplat.maximumNumberOfGaussians*this.view.quality}set maximumGaussianCount(e){this._set(`maximumGaussianCount`,e)}_freeInvisibleTiles(){for(let e of this._tileHandles.values())e.lifecycleState===0&&!this._renderablesBeingCreated.has(e.handle)&&this._deleteTile(e)}extractHeader(e){let t=e.length-4,n=this.reinterpretU32AsFloat(e[t]),r=this.reinterpretU32AsFloat(e[t+1]),i=this.reinterpretU32AsFloat(e[t+2]),a=1/(1<<(e[t+3]&255));return{packedHeader:e.subarray(t,t+4),tileOrigin:{x:n,y:r,z:i},invPosScale:a}}_deleteTile(e){this._renderablesBeingCreated.has(e.handle)||this._wasm?.onRenderableEvicted(this,e.handle,e.usedMemory),this.freeRenderable(e.handle)}reinterpretU32AsFloat(e){return this._u32View[0]=e,this._f32View[0]}get performanceInfo(){let e=0,t=0;this._tileHandles.forEach(n=>{n.lifecycleState===0?t++:e++});let n=this.data?.textureAtlasMemory??0,r=this.data?.headerTextureMemory??0,i=this.data?.orderTextureMemory??0,a=this.data?.fadingTextureMemory??0,o=this.data?.sortBufferMemory??0;return new A(this.usedMemory,e,this._usedTileMemory,t,this._cacheTileMemory,n,r,i,a,o)}get test(){}};e([p()],$.prototype,`layer`,void 0),e([p({readOnly:!0})],$.prototype,`_clippingBox`,null),e([p()],$.prototype,`elevationOffset`,null),e([p({readOnly:!0})],$.prototype,`visibleAtCurrentScale`,null),e([p()],$.prototype,`fullExtentInLocalViewSpatialReference`,void 0),e([p()],$.prototype,`maximumGaussianCount`,null),$=Q=e([m(`esri.views.3d.layers.GaussianSplatLayerView3D`)],$);class ie{constructor(e){this.visibilityChange=e,this.incomingTileHandles=new Set}}const ae=$;export{ae as default};
2
+ import{__decorate as e}from"tslib";import"../../../core/has.js";import t from"../../../core/Logger.js";import{abortMaybe as n,removeMaybe as r,destroyMaybe as i}from"../../../core/maybe.js";import{throwIfAborted as a}from"../../../core/promiseUtils.js";import{watch as o,whenOnce as s,initial as c}from"../../../core/reactiveUtils.js";import{Milliseconds as l}from"../../../core/time.js";import{isUint32Array as u}from"../../../core/typedArrayUtil.js";import{unitFromRESTJSON as d,convertUnit as f}from"../../../core/units.js";import{property as p,subclass as m}from"../../../core/accessorSupport/decorators.js";import{fromValues as h}from"../../../core/libs/gl-matrix-2/factories/quatf64.js";import{getReferenceEllipsoid as g}from"../../../geometry/ellipsoidUtils.js";import _ from"../../../geometry/HeightModelInfo.js";import{create as v}from"../../../geometry/support/aaBoundingBox.js";import{isCompatible as y}from"../../../geometry/support/heightModelInfoUtils.js";import{isInEffectiveScaleRange as b}from"../../../geometry/support/scaleUtils.js";import{isPlateCarree as x,isWebMercator as S,equals as C,isGeographic as w}from"../../../geometry/support/spatialReferenceUtils.js";import T from"../../../geometry/support/WKIDUnitConversion.js";import{validateEntity3D as E,makeCacheKey as D,getHeightModelInfoFromVCS as O}from"../../../layers/support/tiles3DUtils.js";import{getElevationOffsetInMeters as k}from"../../../support/elevationInfoUtils.js";import{getMetersPerUnit as A}from"../../../symbols/support/unitConversionUtils.js";import{GaussianSplatLayerViewPerformanceInfo as j}from"./GaussianSplatLayerViewPerformanceInfo.js";import{LayerView3D as M}from"./LayerView3D.js";import{addLayerViewToWasm as N,getLyr3DWasm as P,removeLayerViewFromWasm as F}from"./Lyr3DWasm.js";import{LayerElevationProvider as I}from"./i3s/LayerElevationProvider.js";import{ElevationRange as L}from"../support/ElevationRange.js";import{projectToBoundingBox as R}from"../support/extentUtils.js";import{Obb as z}from"../support/orientedBoundingBox.js";import{splatPageSizeInU32 as B,gaussiansPerPage as V,packedGaussianSizeInU32 as H,splatAtlasTextureWidth as U}from"../support/gaussianSplatting/GaussianSplatAtlasPages.js";import{GaussianSplatDataStore as W}from"../support/gaussianSplatting/GaussianSplatDataStore.js";import{GaussianSplatFadeHelper as G}from"../support/gaussianSplatting/GaussianSplatFadeHelper.js";import{GaussianSplatIntersectionHandler as K}from"../support/gaussianSplatting/GaussianSplatIntersectionHandler.js";import{GaussianTile as q}from"../support/gaussianSplatting/GaussianTile.js";import{GaussianSplatDepthRenderer as J}from"../webgl-engine/lib/GaussianSplatDepthRenderer.js";import{GaussianSplatRenderer as Y}from"../webgl-engine/lib/GaussianSplatRenderer.js";import{GaussianSplatShadows as X}from"../webgl-engine/lib/GaussianSplatShadows.js";import Z from"../../layers/LayerView.js";import{spatialReferenceIncompatibleError as ee}from"../../support/layerViewUtils.js";import{TaskPriority as te}from"../../support/Scheduler.js";var Q;const ne=()=>t.getLogger(`esri.views.3d.layers.GaussianSplatLayerView3D`),re=(()=>{let e=new Int16Array(256);e[0]=-255;for(let t=1;t<e.length;t++)e[t]=Math.round(16*Math.log(t/255));return e})();let $=class extends M(Z){static{Q=this}static{this.createRenderableBatchSize=64}static{this.uploadBatchPageCount=16}constructor(e){super(e),this.type=`gaussian-splat-3d`,this.ignoresMemoryFactor=!1,this._tileHandles=new Map,this._pageBuffer=new Uint32Array(B*Q.uploadBatchPageCount),this._tmpTilesWithChangedVisibility=[],this._renderablesBeingCreated=new Set,this._currentLyr3dVisibilityChange=0,this._tileFadeInsAwaitingInitialSort=new Set,this._pendingTileFadeOuts=new Map,this._pendingFadeDuration=l(0),this._createRenderableAbortController=new AbortController,this.skipHeightModelInfoValidation=!0,this._initializationController=null,this._wasmLayerId=-1,this._metersPerVCSUnit=1,this._usedTileMemory=0,this._cacheTileMemory=0,this._useEsriCrs=!1,this.fullExtentInLocalViewSpatialReference=null,this._suspendedHandle=null,this._conversionBuffer=new ArrayBuffer(4),this._u32View=new Uint32Array(this._conversionBuffer),this._f32View=new Float32Array(this._conversionBuffer);let t=e.view.resourceController;this._memCache=t.memoryController.newCache(`GaussianSplat-${this.uid}`,e=>this._deleteTile(e)),this._frameTask=t.scheduler.registerTask(te.GAUSSIAN_SPLAT_TEXTURE_ATLAS)}get _clippingBox(){if(!this.view?.clippingArea)return null;let e=v();return R(this.view.clippingArea,e,this.view.renderSpatialReference)?e:null}get clippingBox(){return this._renderer?.clippingBox??null}initialize(){let{view:e}=this;this.addHandles([o(()=>e.qualitySettings.fadeDuration,e=>{this.data&&(this.fadeHelper.onFadeDurationChanged(e),this.updateFadingTexture())})]),this.addResolvingPromise(this._initializeAsync(e))}async _initializeAsync(e){this._initializationController=new AbortController;let{signal:t}=this._initializationController;if(await s(()=>e?.defaultsFromMap.heightModelInfoReady,t),a(t),!this._canProjectWithoutEngine())throw ee(`layer`,this.layer.spatialReference.wkid,e.renderSpatialReference?.wkid);this._wasmLayerId=await N(this,t),a(t),this._renderer=new Y({view:e,layerView:this}),this.data=new W(this._renderer,(e,t)=>this._onSortComplete(e,t),()=>this._freeInvisibleTiles()),this._shadows=new X({view:e,layerView:this}),this.fadeHelper=new G(this),this._prepassDepthRenderer=new J({view:e,layerView:this});let n=new K(this);this._intersectionHandler=n,e.sceneIntersectionHelper.addIntersectionHandler(n),this._elevationProvider=new I({view:e,layerElevationSource:this,intersectionHandler:n}),e.elevationProvider.register(2,this._elevationProvider),this.addHandles([o(()=>this.layer.elevationInfo,e=>this._elevationInfoChanged(e)),o(()=>this.slicePlaneEnabled,e=>this._slicePlaneEnabledChanged(e),c)]),this._suspendedHandle=o(()=>this.suspended,e=>this._wasm?.setEnabled(this,!e),c),this.addHandles([o(()=>this._clippingBox,e=>{this._renderer&&(this._renderer.clippingBox=e)},c),o(()=>this.maximumGaussianCount,e=>this._wasm?.setMaximumGaussianSplatCount(Math.min(e,this.data.textureAtlas.maximumSupportedVisibleGaussians)),c)]),this._initializationController=null}get wasmLayerId(){return this._wasmLayerId}get metersPerVCSUnit(){return this._metersPerVCSUnit}get tileHandles(){return this._tileHandles}updateFadingTexture(){this.data.fadingTexture.updateTexture(this.data.textureAtlas.pageAllocator.pageCount)}get _wasm(){return P(this.view)}get usedMemory(){return this._usedTileMemory+(this.data?.usedMemory??0)}get cachedMemory(){return this._cacheTileMemory}get unloadedMemory(){return 0}get useEsriCrs(){return this._useEsriCrs}get elevationProvider(){return this._elevationProvider}get elevationOffset(){return k(this.layer.elevationInfo)}get elevationRange(){let e=this.fullExtent;return e?.zmin&&e?.zmax?new L(e.zmin,e.zmax):null}getElevationRange(e){return this._intersectionHandler.getElevationRange(e)}get fullExtent(){return this.layer.fullExtent}get visibleAtCurrentScale(){return b(this.layer.effectiveScaleRange,this.view.scale)}isUpdating(){let e=this._wasm;return this._wasmLayerId<0||e==null?!1:e.isUpdating(this._wasmLayerId)||this.data.updating||this.fadeHelper.updating}updatingFlagChanged(){this.notifyChange(`updating`)}async createRenderable(e){if(this.destroyed||this.destroying)throw Error(`IntegratedMesh3DTilesLayerView3D: createRenderable called after destroy`);let{entity3d:t}=e;if(!E(t))throw Error(`entity3D not valid`);let n=t.desc.geometry.prims[t.validPrimitiveIndices[0]].atrbs[0],r=t.assets[n.assetId];if(!r)throw Error(`entity3D not valid`);let i=r.count;if(i===0)return ne().warnOnce(`encountered tile with zero Gaussians`),()=>({memUsageBytes:0,numGaussians:0});let a=null;if(r.dataType===`U32`&&u(r.data))a=r.data;else throw Error(`unexpected GaussianSplat Entity3D asset.data format`);let o=this.extractHeader(a),s=2.048,c=o.tileOrigin.x*s,l=o.tileOrigin.y*s,d=o.tileOrigin.z*s,f=t.desc,p=f.obb.quaternion,m=new z(f.obb.center,f.obb.halfSize,h(...p)),_=this.view.state.isGlobal,v=_?g(this.view.spatialReference).radius:0,y={handle:e.handle,bufferView:a,totalGaussians:i,packedHeader:o.packedHeader,tileOrigin:{x:c,y:l,z:d},invPosScale:o.invPosScale,obb:m,origin:{x:m.centerX,y:m.centerY,z:m.centerZ},isGlobal:_,ellipsoidRadius:v};this._renderablesBeingCreated.add(e.handle);let b;try{b=await this._frameTask.scheduleGenerator(e=>this._createRenderableTask(y,e),this._createRenderableAbortController.signal)}catch(t){throw this._renderablesBeingCreated.delete(e.handle),t}return this._renderablesBeingCreated.delete(e.handle),()=>b}*_createRenderableTask(e,t){let{handle:n,bufferView:r,totalGaussians:i,packedHeader:a,tileOrigin:o,invPosScale:s,obb:c,origin:l,isGlobal:u,ellipsoidRadius:d}=e,f=o.x,p=o.y,m=o.z,h=l.x,g=l.y,_=l.z,v=new Float32Array(i*3),y=new Uint32Array(i),b=new Uint32Array(i),x=[],S=Math.ceil(i/V),C=1/0,w=-1/0,T=1/0,E=-1/0,D=0,O=-1,k=0,A=0;for(let e=0;e<i;e++){let n=e*H,i=r[n],a=r[n+1],o=r[n+2],c=r[n+3],l=a&16383,d=a>>>14&16383,x=a>>>28&15|(o&1023)<<4,S=c>>>24,j=re[S],M=(o>>>10&255)+j,N=(o>>>18&255)+j,P=(o>>>26&63|(c&3)<<6)+j,F=M>0?M:0,I=N>0?N:0,L=P>0?P:0,R=F|I<<8|L<<16,z=Math.max(F,I,L),B=l*s+f,V=d*s+p,U=x*s+m;if(v[D]=B-h,v[D+1]=V-g,v[D+2]=U-_,u){let e=B*B+V*V+U*U;T=Math.min(T,e),E=Math.max(E,e)}else C=Math.min(C,U),w=Math.max(w,U);y[e]=i,b[e]=R,z>O&&(O=z),S>k&&(k=S),D+=3,A++,A===Q.createRenderableBatchSize&&(A=0,t.madeProgress()&&(t=yield))}A>0&&t.madeProgress()&&(t=yield),u&&(C=Math.sqrt(T)-d,w=Math.sqrt(E)-d);let j=this._extractGaussianSplatMbsRadiusSquared(O),{fullExtent:M}=this.layer;M?.hasZ&&M.zmax&&M.zmin&&(C=Math.max(C,M.zmin),w=Math.min(w,M.zmax));let N=new L(C,w),P=this.data.textureAtlas,F=this.data.headerTexture;try{for(let e=0;e<S;e+=Q.uploadBatchPageCount){let n=Math.min(S,e+Q.uploadBatchPageCount);for(let t=e;t<n;t++){let e=P.allocatePage();if(e===null&&(this._freeInvisibleTiles(),e=P.allocatePage()),e===null)throw Error(`ran out of gaussian splat memory`);x.push(e)}for(let t=e;t<n;){let e=x[t],o=t+1;for(;o<n&&x[o]===x[o-1]+1;)o++;let s=o-t,c=i-t*V,l=Math.min(c,s*V),u=t*B,d=l*H;this._pageBuffer.set(r.subarray(u,u+d));let f=e*V,p=f%U,m=Math.floor(f/U);P.update(p,m,this._pageBuffer,s),F.update(e,a,s),t=o}t.madeProgress()&&(t=yield)}}catch(e){throw P.freePages(x),e}let I=new q(n,c,x,v,y,b,i,j,k/255,N);return this._tileHandles.set(n,I),this._cacheTileMemory+=I.usedMemory,this._memCache.put(`${I.handle}`,I),{memUsageBytes:I.usedMemory,numGaussians:i}}_extractGaussianSplatMbsRadiusSquared(e){return Math.exp(e/8-20)*9}freeRenderable(e){this._tileFadeInsAwaitingInitialSort.delete(e),this._pendingTileFadeOuts.delete(e);let t=this.data?.textureAtlas,n=!1,r=this._tileHandles.get(e);if(r){let i=!1;for(let t of this._pendingTileFadeOuts.values())t.incomingTileHandles.has(e)&&(t.visibilityChange=this._currentLyr3dVisibilityChange+1,i=!0);i&&(this._currentLyr3dVisibilityChange++,n=!0),r.lifecycleState===0?this._cacheTileMemory-=r.usedMemory:(n=!0,this.fadeHelper.onTileDiscarded(r),this._usedTileMemory-=r.usedMemory,this._intersectionHandler.removeTile(r)),t&&r.pageIds.forEach(e=>t.freePage(e)),this.freeObject(r),this._tileHandles.delete(e)}n&&this.updateGaussians()}freeObject(e){this._memCache.pop(`${e.handle}`)}notifyTileObbsChanged(e){this._elevationProvider&&this._elevationProvider.notifyObjectsChangedFunctional(e.length,t=>{for(let{obb:n}of e)if(!t(n))break})}setRenderableVisibility(e,t,n){let r=this.fadeHelper.updateFadeDuration(),i=new ie(this._currentLyr3dVisibilityChange+1),a=new Set,o=!1;for(let s=0;s<n;s++){let n=this._tileHandles.get(e[s]);if(!n)continue;let c=t[s]?this._prepareTileFadeIn(n,r):this._prepareTileFadeOut(n,i);t[s]&&i.incomingTileHandles.add(n.handle),c&&a.add(n.handle),o||=c}if(o){if(this._currentLyr3dVisibilityChange++,this._pendingFadeDuration=r,this._updatePendingTileHandoffs(a,i),i.incomingTileHandles.size===0)for(let e of this._tileFadeInsAwaitingInitialSort)i.incomingTileHandles.add(e);this.updateGaussians()}}_updatePendingTileHandoffs(e,t){for(let n of new Set(this._pendingTileFadeOuts.values())){if(n===t)continue;let r=!1;for(let i of e)n.incomingTileHandles.has(i)&&(r=!0,t.incomingTileHandles.size>0&&n.incomingTileHandles.delete(i));if(r){n.visibilityChange=t.visibilityChange;for(let e of t.incomingTileHandles)n.incomingTileHandles.add(e)}}}_prepareTileFadeIn(e,t){let n=this._pendingTileFadeOuts.delete(e.handle);return e.lifecycleState===2?(this.fadeHelper.fadeTile(e,0,t),!1):this._tileFadeInsAwaitingInitialSort.has(e.handle)?n:(e.lifecycleState===0&&this._popTileFromCache(e),e.lifecycleState=1,this._tileFadeInsAwaitingInitialSort.add(e.handle),!0)}_prepareTileFadeOut(e,t){let n=this._tileFadeInsAwaitingInitialSort.delete(e.handle);return n&&e.lifecycleState===1&&(this.moveTileToCache(e),e.lifecycleState=0),e.lifecycleState===2?this._pendingTileFadeOuts.has(e.handle)?n:(this._pendingTileFadeOuts.set(e.handle,t),!0):n}_onSortComplete(e,t){let n=this._tmpTilesWithChangedVisibility;n.length=0,this._triggerFadeIns(e,n);let r=this._triggerFadeOuts(t,n);n.length>0&&this.notifyTileObbsChanged(n),r&&this.updateGaussians()}_triggerFadeIns(e,t){for(let n of e)this._tileHandles.get(n.handle)===n&&this._tileFadeInsAwaitingInitialSort.delete(n.handle)&&(n.lifecycleState=2,t.push(n),this.fadeHelper.fadeTile(n,0,this._pendingFadeDuration))}_triggerFadeOuts(e,t){let n=!1;for(let t of this._pendingTileFadeOuts.values())if(e>=t.visibilityChange){n=!0;break}if(!n)return!1;let r=this._pendingFadeDuration,i=this._pendingFadeDuration;for(let e of this._tileHandles.values()){let{fadeDirection:t,fadeDuration:n,fadeProgress:a}=e;if(t!==0||n==null||a==null)continue;let o=n*(1-a);r=l(Math.max(r,o)),i=l(Math.max(i,n))}let a=!1;for(let[n,o]of this._pendingTileFadeOuts){if(e<o.visibilityChange)continue;this._pendingTileFadeOuts.delete(n);let s=this._tileHandles.get(n);if(s){let e=s.lifecycleState===2,n=s.opacityModifier===1?r:i;this.fadeHelper.fadeTile(s,1,n),e&&s.lifecycleState===0&&(t.push(s),a=!0)}}return a}_popTileFromCache(e){this._usedTileMemory+=e.usedMemory,this._cacheTileMemory-=e.usedMemory,this._intersectionHandler.addTile(e),this._memCache.pop(D(e.handle))}moveTileToCache(e){this._usedTileMemory-=e.usedMemory,this._cacheTileMemory+=e.usedMemory,this._intersectionHandler.removeTile(e),this._memCache.put(D(e.handle),e)}destroy(){this._initializationController=n(this._initializationController),this._createRenderableAbortController.abort(),F(this),this._suspendedHandle&&=r(this._suspendedHandle),this._intersectionHandler&&=(this.view.sceneIntersectionHelper.removeIntersectionHandler(this._intersectionHandler),null),this._elevationProvider&&this.view.elevationProvider&&(this._elevationProvider.notifyObjectsChangedFunctional(this._tileHandles.size,e=>{for(let{obb:t}of this._tileHandles.values())if(!e(t))break}),this.view.elevationProvider.unregister(this._elevationProvider),this._elevationProvider=null),this._frameTask.remove(),this._shadows=i(this._shadows),this._prepassDepthRenderer=i(this._prepassDepthRenderer),this._renderer=i(this._renderer),this._memCache.destroy(),this.data=i(this.data)}_canProjectWithoutEngine(){if(this.view.state.viewingMode===1||x(this.view.renderSpatialReference)||S(this.view.renderSpatialReference))return!0;if(this.layer.esriCrsSpatialReference&&C(this.layer.esriCrsSpatialReference,this.view.renderSpatialReference)){if(this.layer.esriCrsSpatialReference.vcsWkid===115700)return!1;let e=O(this.layer.esriCrsSpatialReference);if(!e){let t=this.layer.esriCrsSpatialReference,n=w(t),r=`meters`;!n&&t.wkid&&t.wkid!==-1&&(r=d(T.units[T[t.wkid]])),r&&(e=new _({heightModel:`gravity-related-height`,heightUnit:r}))}let t=this.view.heightModelInfo;return this._useEsriCrs=y(e,t,!1)===0,this._useEsriCrs&&(e&&(this._metersPerVCSUnit=f(1,e.heightUnit,`meters`)),this.fullExtentInLocalViewSpatialReference=this.layer.esriCrsFullExtent),this._useEsriCrs}return!1}_elevationInfoChanged(e){if(!e?.offset)this._wasm?.setLayerOffset(this,0);else if(!this._useEsriCrs)this._wasm?.setLayerOffset(this,k(e));else{let t=A(e?.unit)/this._metersPerVCSUnit,n=e?.offset??0;this._wasm?.setLayerOffset(this,n*t)}}_slicePlaneEnabledChanged(e){this._renderer&&(this._renderer.slicePlaneEnabled=e),this._intersectionHandler&&(this._intersectionHandler.slicePlaneEnabled=e)}updateGaussians(){let e=[];for(let t of this._tileHandles.values())t.lifecycleState!==0&&e.push(t);this.data.updateGaussianVisibility(e,this._currentLyr3dVisibilityChange),this.notifyChange(`updating`)}get maximumGaussianCount(){return this.view.qualitySettings.gaussianSplat.maximumNumberOfGaussians*this.view.quality}set maximumGaussianCount(e){this._set(`maximumGaussianCount`,e)}_freeInvisibleTiles(){for(let e of this._tileHandles.values())e.lifecycleState===0&&!this._renderablesBeingCreated.has(e.handle)&&this._deleteTile(e)}extractHeader(e){let t=e.length-4,n=this.reinterpretU32AsFloat(e[t]),r=this.reinterpretU32AsFloat(e[t+1]),i=this.reinterpretU32AsFloat(e[t+2]),a=1/(1<<(e[t+3]&255));return{packedHeader:e.subarray(t,t+4),tileOrigin:{x:n,y:r,z:i},invPosScale:a}}_deleteTile(e){this._renderablesBeingCreated.has(e.handle)||this._wasm?.onRenderableEvicted(this,e.handle,e.usedMemory),this.freeRenderable(e.handle)}reinterpretU32AsFloat(e){return this._u32View[0]=e,this._f32View[0]}get performanceInfo(){let e=0,t=0;this._tileHandles.forEach(n=>{n.lifecycleState===0?t++:e++});let n=this.data?.textureAtlasMemory??0,r=this.data?.headerTextureMemory??0,i=this.data?.orderTextureMemory??0,a=this.data?.fadingTextureMemory??0,o=this.data?.sortBufferMemory??0;return new j(this.usedMemory,e,this._usedTileMemory,t,this._cacheTileMemory,n,r,i,a,o)}get test(){}};e([p()],$.prototype,`layer`,void 0),e([p({readOnly:!0})],$.prototype,`_clippingBox`,null),e([p()],$.prototype,`elevationOffset`,null),e([p({readOnly:!0})],$.prototype,`visibleAtCurrentScale`,null),e([p()],$.prototype,`fullExtentInLocalViewSpatialReference`,void 0),e([p()],$.prototype,`maximumGaussianCount`,null),$=Q=e([m(`esri.views.3d.layers.GaussianSplatLayerView3D`)],$);class ie{constructor(e){this.visibilityChange=e,this.incomingTileHandles=new Set}}const ae=$;export{ae 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/Error.js";import{destroyMaybe as n}from"../../../core/maybe.js";import{when as r}from"../../../core/reactiveUtils.js";import{property as i,subclass as a}from"../../../core/accessorSupport/decorators.js";import{projectAsync as o}from"../../../geometry/projectionUtils.js";import{LayerView3D as s}from"./LayerView3D.js";import{elevationAlignPointsInFeatures as c}from"./graphics/elevationAlignPointsInFeatures.js";import{GraphicsProcessor as l}from"./graphics/GraphicsProcessor.js";import{queryForSymbologySnapping as u}from"./graphics/queryForSymbologySnapping.js";import{LayerViewPerformanceInfo as d}from"./support/LayerViewPerformanceInfo.js";import f from"../../layers/GraphicsLayerView.js";import{getHighlightName as p}from"../../support/highlightOptionsUtils.js";import{hasLayerBasedScaleVisibility as m,isInEffectiveScaleRange as h}from"../../support/layerViewUtils.js";let g=class extends s(f){constructor(){super(...arguments),this.type=`graphics-3d`,this.symbologySnappingSupported=!0,this._slicePlaneEnabled=!1,this.fullExtentInLocalViewSpatialReference=null,this.ignoresMemoryFactor=!0}initialize(){this._set(`processor`,new l({owner:this,scaleVisibilityEnabled:!0,frustumVisibilityEnabled:!0})),this.addResolvingPromise(this.processor.initializePromise),this.addHandles(this.layer.on(`graphic-update`,e=>this.processor.graphicsCore.graphicUpdateHandler(e))),this.layer.internal?this.notifyChange(`updating`):(this.view.viewingMode===`local`&&this.addResolvingPromise((async()=>this.fullExtentInLocalViewSpatialReference=await o(this.layer.fullExtent,this.view.spatialReference).catch(()=>null))()),this.addHandles(r(()=>this.view?.groundView?.ready,()=>()=>this.notifyChange(`updating`),{once:!0})))}destroy(){this._updatingHandles.removeAll(),this._set(`processor`,n(this.processor))}get loadedGraphics(){return this.layer.graphics}get legendEnabled(){return this.canResume()&&!this.processor?.frustumVisibilitySuspended}get visibleAtCurrentScale(){return m()?h(this.layer.effectiveScaleRange,this.view.scale):!this.processor?.scaleVisibilitySuspended}get slicePlaneEnabled(){let e=this.layer.internal;return this._slicePlaneEnabled&&!e}set slicePlaneEnabled(e){this._slicePlaneEnabled=e}getSuspendInfo(){let e=super.getSuspendInfo();return e.outsideOfView=this.processor?.frustumVisibilitySuspended??!1,e}getHit(e){return this.processor.getHit(e,null)}whenGraphicBounds(e,t){return this.processor.whenGraphicBounds(e,t)}computeAttachmentOrigin(e,t){return this.processor?.computeAttachmentOrigin(e,t)}getSymbolLayerSize(e,t){return this.processor.getSymbolLayerSize(e,t)}queryGraphics(){return Promise.resolve(this.loadedGraphics)}maskOccludee(e){return this.processor.maskOccludee(e)}highlight(e,t){return this.processor.highlight(e,p(t))}notifyContentGeometryUpdate(){this.emit(`visible-geometry-changed`)}async elevationAlignPointsInFeatures(e,n){let{processor:r}=this;if(r?.graphics3DGraphics==null)throw new t(`graphicslayerview3d:missing-processor`,`A Graphics3D processor is needed to resolve graphics elevation.`);let{graphics3DGraphics:i}=r;return c(this.view,this.layer,e=>typeof e==`number`?i.get(e):void 0,e,n)}async queryForSymbologySnapping(e,t){return u(this.processor,e,t)}get updatePolicy(){return this.processor?.graphicsCore.effectiveUpdatePolicy||1}isUpdating(){return this.view&&this.layer&&!!(this.processor?.updating||!this.layer.internal&&!this.view.groundView?.ready)}get performanceInfo(){return new d(this.usedMemory,this.loadedGraphics.length,-1,-1)}get usedMemory(){return this.processor?.graphicsCore?.usedMemory??0}get unloadedMemory(){return this.processor?.graphicsCore?.unprocessedMemoryEstimate}get test(){return{graphics3DProcessor:this.processor,loadedGraphics:this.loadedGraphics}}};e([i()],g.prototype,`loadedGraphics`,null),e([i({readOnly:!0})],g.prototype,`legendEnabled`,null),e([i({readOnly:!0})],g.prototype,`processor`,void 0),e([i({readOnly:!0})],g.prototype,`visibleAtCurrentScale`,null),e([i()],g.prototype,`_slicePlaneEnabled`,void 0),e([i({type:Boolean})],g.prototype,`slicePlaneEnabled`,null),g=e([a(`esri.views.3d.layers.GraphicsLayerView3D`)],g);const _=g;export{_ as default};
2
+ import{__decorate as e}from"tslib";import t from"../../../core/Error.js";import{destroyMaybe as n}from"../../../core/maybe.js";import{when as r}from"../../../core/reactiveUtils.js";import{property as i,subclass as a}from"../../../core/accessorSupport/decorators.js";import{projectAsync as o}from"../../../geometry/projectionUtils.js";import{isInEffectiveScaleRange as s}from"../../../geometry/support/scaleUtils.js";import{LayerView3D as c}from"./LayerView3D.js";import{elevationAlignPointsInFeatures as l}from"./graphics/elevationAlignPointsInFeatures.js";import{GraphicsProcessor as u}from"./graphics/GraphicsProcessor.js";import{queryForSymbologySnapping as d}from"./graphics/queryForSymbologySnapping.js";import{LayerViewPerformanceInfo as f}from"./support/LayerViewPerformanceInfo.js";import p from"../../layers/GraphicsLayerView.js";import{getHighlightName as m}from"../../support/highlightOptionsUtils.js";import{hasLayerBasedScaleVisibility as h}from"../../support/layerViewUtils.js";let g=class extends c(p){constructor(){super(...arguments),this.type=`graphics-3d`,this.symbologySnappingSupported=!0,this._slicePlaneEnabled=!1,this.fullExtentInLocalViewSpatialReference=null,this.ignoresMemoryFactor=!0}initialize(){this._set(`processor`,new u({owner:this,scaleVisibilityEnabled:!0,frustumVisibilityEnabled:!0})),this.addResolvingPromise(this.processor.initializePromise),this.addHandles(this.layer.on(`graphic-update`,e=>this.processor.graphicsCore.graphicUpdateHandler(e))),this.layer.internal?this.notifyChange(`updating`):(this.view.viewingMode===`local`&&this.addResolvingPromise((async()=>this.fullExtentInLocalViewSpatialReference=await o(this.layer.fullExtent,this.view.spatialReference).catch(()=>null))()),this.addHandles(r(()=>this.view?.groundView?.ready,()=>()=>this.notifyChange(`updating`),{once:!0})))}destroy(){this._updatingHandles.removeAll(),this._set(`processor`,n(this.processor))}get loadedGraphics(){return this.layer.graphics}get legendEnabled(){return this.canResume()&&!this.processor?.frustumVisibilitySuspended}get visibleAtCurrentScale(){return h()?s(this.layer.effectiveScaleRange,this.view.scale):!this.processor?.scaleVisibilitySuspended}get slicePlaneEnabled(){let e=this.layer.internal;return this._slicePlaneEnabled&&!e}set slicePlaneEnabled(e){this._slicePlaneEnabled=e}getSuspendInfo(){let e=super.getSuspendInfo();return e.outsideOfView=this.processor?.frustumVisibilitySuspended??!1,e}getHit(e){return this.processor.getHit(e,null)}whenGraphicBounds(e,t){return this.processor.whenGraphicBounds(e,t)}computeAttachmentOrigin(e,t){return this.processor?.computeAttachmentOrigin(e,t)}getSymbolLayerSize(e,t){return this.processor.getSymbolLayerSize(e,t)}queryGraphics(){return Promise.resolve(this.loadedGraphics)}maskOccludee(e){return this.processor.maskOccludee(e)}highlight(e,t){return this.processor.highlight(e,m(t))}notifyContentGeometryUpdate(){this.emit(`visible-geometry-changed`)}async elevationAlignPointsInFeatures(e,n){let{processor:r}=this;if(r?.graphics3DGraphics==null)throw new t(`graphicslayerview3d:missing-processor`,`A Graphics3D processor is needed to resolve graphics elevation.`);let{graphics3DGraphics:i}=r;return l(this.view,this.layer,e=>typeof e==`number`?i.get(e):void 0,e,n)}async queryForSymbologySnapping(e,t){return d(this.processor,e,t)}get updatePolicy(){return this.processor?.graphicsCore.effectiveUpdatePolicy||1}isUpdating(){return this.view&&this.layer&&!!(this.processor?.updating||!this.layer.internal&&!this.view.groundView?.ready)}get performanceInfo(){return new f(this.usedMemory,this.loadedGraphics.length,-1,-1)}get usedMemory(){return this.processor?.graphicsCore?.usedMemory??0}get unloadedMemory(){return this.processor?.graphicsCore?.unprocessedMemoryEstimate}get test(){return{graphics3DProcessor:this.processor,loadedGraphics:this.loadedGraphics}}};e([i()],g.prototype,`loadedGraphics`,null),e([i({readOnly:!0})],g.prototype,`legendEnabled`,null),e([i({readOnly:!0})],g.prototype,`processor`,void 0),e([i({readOnly:!0})],g.prototype,`visibleAtCurrentScale`,null),e([i()],g.prototype,`_slicePlaneEnabled`,void 0),e([i({type:Boolean})],g.prototype,`slicePlaneEnabled`,null),g=e([a(`esri.views.3d.layers.GraphicsLayerView3D`)],g);const _=g;export{_ as default};