@arcgis/core 4.33.0-next.20250414 → 4.33.0-next.20250416

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 (253) hide show
  1. package/arcade/featureset/support/FeatureSet.js +1 -1
  2. package/arcade/functions/geomasync.js +1 -1
  3. package/arcade/functions/geomsync.js +1 -1
  4. package/arcade/geometry/functions.js +1 -1
  5. package/arcade/geometry/operatorsWorker.js +1 -1
  6. package/assets/esri/core/workers/RemoteClient.js +1 -1
  7. package/assets/esri/core/workers/chunks/0252d853419adc203f04.js +1 -0
  8. package/assets/esri/core/workers/chunks/030f5b9a9757eead436b.js +1 -0
  9. package/assets/esri/core/workers/chunks/{3a84ee5d0434362286a6.js → 07f206719763173faa8d.js} +1 -1
  10. package/assets/esri/core/workers/chunks/{4403b3f08907e88d0d91.js → 0b34c8356b8492ce7b16.js} +1 -1
  11. package/assets/esri/core/workers/chunks/{fb65796296b0422cf266.js → 272a309760dacb13dee3.js} +1 -1
  12. package/assets/esri/core/workers/chunks/{fe1ad9ed0d32f557e5a3.js → 29283c19e1ccdc6cfbde.js} +33 -33
  13. package/assets/esri/core/workers/chunks/2bdbf678d4f013543dbb.js +1 -0
  14. package/assets/esri/core/workers/chunks/2fd5b48976cefe7cc0ab.js +1 -0
  15. package/assets/esri/core/workers/chunks/321f6f6d268755482c27.js +1 -0
  16. package/assets/esri/core/workers/chunks/{b7a1185ac49480fc1410.js → 35a59f0df087e3c588a9.js} +1 -1
  17. package/assets/esri/core/workers/chunks/{626e33ece2c49d40f6cd.js → 42aab2a336ee22fd9055.js} +1 -1
  18. package/assets/esri/core/workers/chunks/{083548c5eea5aca6404c.js → 45d64b72b7e93e9c64d7.js} +1 -1
  19. package/assets/esri/core/workers/chunks/56fdbe61ac84b036a1a2.js +1 -0
  20. package/assets/esri/core/workers/chunks/57fd5a52be41ddd6a11b.js +1 -0
  21. package/assets/esri/core/workers/chunks/5fb9bb3ac2f60dbd59c4.js +1 -0
  22. package/assets/esri/core/workers/chunks/{0a675f9f69b8b13b7443.js → 601fc99426f0213b0769.js} +1 -1
  23. package/assets/esri/core/workers/chunks/68d7babbe7e0d934e056.js +1 -0
  24. package/assets/esri/core/workers/chunks/6fc39a58f3011291c602.js +1 -0
  25. package/assets/esri/core/workers/chunks/8221f2e540abe1e0f048.js +1 -0
  26. package/assets/esri/core/workers/chunks/83e13baab4b90a88d967.js +1 -0
  27. package/assets/esri/core/workers/chunks/851baab753d9c8e967bd.js +1 -0
  28. package/assets/esri/core/workers/chunks/8ba7d44eff348004f084.js +1 -0
  29. package/assets/esri/core/workers/chunks/{9050dad7e4f093568026.js → 97267911d03c2426d319.js} +1 -1
  30. package/assets/esri/core/workers/chunks/984c5047ab1fa632ca09.js +1 -0
  31. package/assets/esri/core/workers/chunks/{5aae4e127e888f69435a.js → 9a1c058d3ecd1db0e996.js} +1 -1
  32. package/assets/esri/core/workers/chunks/9b21dc4659922cc577cb.js +1 -0
  33. package/assets/esri/core/workers/chunks/{ff62b813fff4a015a8a6.js → a4239e301728d594afa5.js} +1 -1
  34. package/assets/esri/core/workers/chunks/aca3ccb9599bcc444617.js +1 -0
  35. package/assets/esri/core/workers/chunks/{a3421383e48379012c9c.js → b6dd25bccb9f6e19c18e.js} +1 -1
  36. package/assets/esri/core/workers/chunks/bf4947fe446dcb477031.js +1 -0
  37. package/assets/esri/core/workers/chunks/d053c23fce77fb77cc00.js +1 -0
  38. package/assets/esri/core/workers/chunks/e31bb256921807464715.js +1 -0
  39. package/assets/esri/core/workers/chunks/{8aae03e347ab18ae6ee2.js → e3d25d027885eb1a415f.js} +1 -1
  40. package/assets/esri/core/workers/chunks/{d88544ac332be633e3fe.js → e64e0c3240f8e577a61c.js} +1 -1
  41. package/assets/esri/core/workers/chunks/e9fba86036b8fe700a41.js +1 -0
  42. package/assets/esri/themes/base/widgets/_Expand.scss +6 -1
  43. package/assets/esri/themes/base/widgets/_TimeSlider.scss +97 -107
  44. package/assets/esri/themes/dark/main.css +1 -1
  45. package/assets/esri/themes/light/main.css +1 -1
  46. package/assets/esri/themes/light/view.css +1 -1
  47. package/assets/esri/widgets/TimeSlider/t9n/TimeSlider.json +1 -1
  48. package/assets/esri/widgets/TimeSlider/t9n/TimeSlider_ar.json +1 -1
  49. package/assets/esri/widgets/TimeSlider/t9n/TimeSlider_bg.json +1 -1
  50. package/assets/esri/widgets/TimeSlider/t9n/TimeSlider_bs.json +1 -1
  51. package/assets/esri/widgets/TimeSlider/t9n/TimeSlider_ca.json +1 -1
  52. package/assets/esri/widgets/TimeSlider/t9n/TimeSlider_cs.json +1 -1
  53. package/assets/esri/widgets/TimeSlider/t9n/TimeSlider_da.json +1 -1
  54. package/assets/esri/widgets/TimeSlider/t9n/TimeSlider_de.json +1 -1
  55. package/assets/esri/widgets/TimeSlider/t9n/TimeSlider_el.json +1 -1
  56. package/assets/esri/widgets/TimeSlider/t9n/TimeSlider_en.json +1 -1
  57. package/assets/esri/widgets/TimeSlider/t9n/TimeSlider_es.json +1 -1
  58. package/assets/esri/widgets/TimeSlider/t9n/TimeSlider_et.json +1 -1
  59. package/assets/esri/widgets/TimeSlider/t9n/TimeSlider_fi.json +1 -1
  60. package/assets/esri/widgets/TimeSlider/t9n/TimeSlider_fr.json +1 -1
  61. package/assets/esri/widgets/TimeSlider/t9n/TimeSlider_he.json +1 -1
  62. package/assets/esri/widgets/TimeSlider/t9n/TimeSlider_hr.json +1 -1
  63. package/assets/esri/widgets/TimeSlider/t9n/TimeSlider_hu.json +1 -1
  64. package/assets/esri/widgets/TimeSlider/t9n/TimeSlider_id.json +1 -1
  65. package/assets/esri/widgets/TimeSlider/t9n/TimeSlider_it.json +1 -1
  66. package/assets/esri/widgets/TimeSlider/t9n/TimeSlider_ja.json +1 -1
  67. package/assets/esri/widgets/TimeSlider/t9n/TimeSlider_ko.json +1 -1
  68. package/assets/esri/widgets/TimeSlider/t9n/TimeSlider_lt.json +1 -1
  69. package/assets/esri/widgets/TimeSlider/t9n/TimeSlider_lv.json +1 -1
  70. package/assets/esri/widgets/TimeSlider/t9n/TimeSlider_nl.json +1 -1
  71. package/assets/esri/widgets/TimeSlider/t9n/TimeSlider_no.json +1 -1
  72. package/assets/esri/widgets/TimeSlider/t9n/TimeSlider_pl.json +1 -1
  73. package/assets/esri/widgets/TimeSlider/t9n/TimeSlider_pt-BR.json +1 -1
  74. package/assets/esri/widgets/TimeSlider/t9n/TimeSlider_pt-PT.json +1 -1
  75. package/assets/esri/widgets/TimeSlider/t9n/TimeSlider_ro.json +1 -1
  76. package/assets/esri/widgets/TimeSlider/t9n/TimeSlider_ru.json +1 -1
  77. package/assets/esri/widgets/TimeSlider/t9n/TimeSlider_sk.json +1 -1
  78. package/assets/esri/widgets/TimeSlider/t9n/TimeSlider_sl.json +1 -1
  79. package/assets/esri/widgets/TimeSlider/t9n/TimeSlider_sr.json +1 -1
  80. package/assets/esri/widgets/TimeSlider/t9n/TimeSlider_sv.json +1 -1
  81. package/assets/esri/widgets/TimeSlider/t9n/TimeSlider_th.json +1 -1
  82. package/assets/esri/widgets/TimeSlider/t9n/TimeSlider_tr.json +1 -1
  83. package/assets/esri/widgets/TimeSlider/t9n/TimeSlider_uk.json +1 -1
  84. package/assets/esri/widgets/TimeSlider/t9n/TimeSlider_vi.json +1 -1
  85. package/assets/esri/widgets/TimeSlider/t9n/TimeSlider_zh-CN.json +1 -1
  86. package/assets/esri/widgets/TimeSlider/t9n/TimeSlider_zh-HK.json +1 -1
  87. package/assets/esri/widgets/TimeSlider/t9n/TimeSlider_zh-TW.json +1 -1
  88. package/assets/esri/widgets/support/SelectionList/t9n/SelectionList_ar.json +1 -0
  89. package/assets/esri/widgets/support/SelectionList/t9n/SelectionList_bg.json +1 -0
  90. package/assets/esri/widgets/support/SelectionList/t9n/SelectionList_bs.json +1 -0
  91. package/assets/esri/widgets/support/SelectionList/t9n/SelectionList_ca.json +1 -0
  92. package/assets/esri/widgets/support/SelectionList/t9n/SelectionList_cs.json +1 -0
  93. package/assets/esri/widgets/support/SelectionList/t9n/SelectionList_da.json +1 -0
  94. package/assets/esri/widgets/support/SelectionList/t9n/SelectionList_de.json +1 -0
  95. package/assets/esri/widgets/support/SelectionList/t9n/SelectionList_el.json +1 -0
  96. package/assets/esri/widgets/support/SelectionList/t9n/SelectionList_es.json +1 -0
  97. package/assets/esri/widgets/support/SelectionList/t9n/SelectionList_et.json +1 -0
  98. package/assets/esri/widgets/support/SelectionList/t9n/SelectionList_fi.json +1 -0
  99. package/assets/esri/widgets/support/SelectionList/t9n/SelectionList_fr.json +1 -0
  100. package/assets/esri/widgets/support/SelectionList/t9n/SelectionList_he.json +1 -0
  101. package/assets/esri/widgets/support/SelectionList/t9n/SelectionList_hr.json +1 -0
  102. package/assets/esri/widgets/support/SelectionList/t9n/SelectionList_hu.json +1 -0
  103. package/assets/esri/widgets/support/SelectionList/t9n/SelectionList_id.json +1 -0
  104. package/assets/esri/widgets/support/SelectionList/t9n/SelectionList_it.json +1 -0
  105. package/assets/esri/widgets/support/SelectionList/t9n/SelectionList_ja.json +1 -0
  106. package/assets/esri/widgets/support/SelectionList/t9n/SelectionList_ko.json +1 -0
  107. package/assets/esri/widgets/support/SelectionList/t9n/SelectionList_lt.json +1 -0
  108. package/assets/esri/widgets/support/SelectionList/t9n/SelectionList_lv.json +1 -0
  109. package/assets/esri/widgets/support/SelectionList/t9n/SelectionList_nl.json +1 -0
  110. package/assets/esri/widgets/support/SelectionList/t9n/SelectionList_no.json +1 -0
  111. package/assets/esri/widgets/support/SelectionList/t9n/SelectionList_pl.json +1 -0
  112. package/assets/esri/widgets/support/SelectionList/t9n/SelectionList_pt-BR.json +1 -0
  113. package/assets/esri/widgets/support/SelectionList/t9n/SelectionList_pt-PT.json +1 -0
  114. package/assets/esri/widgets/support/SelectionList/t9n/SelectionList_ro.json +1 -0
  115. package/assets/esri/widgets/support/SelectionList/t9n/SelectionList_ru.json +1 -0
  116. package/assets/esri/widgets/support/SelectionList/t9n/SelectionList_sk.json +1 -0
  117. package/assets/esri/widgets/support/SelectionList/t9n/SelectionList_sl.json +1 -0
  118. package/assets/esri/widgets/support/SelectionList/t9n/SelectionList_sr.json +1 -0
  119. package/assets/esri/widgets/support/SelectionList/t9n/SelectionList_sv.json +1 -0
  120. package/assets/esri/widgets/support/SelectionList/t9n/SelectionList_th.json +1 -0
  121. package/assets/esri/widgets/support/SelectionList/t9n/SelectionList_tr.json +1 -0
  122. package/assets/esri/widgets/support/SelectionList/t9n/SelectionList_uk.json +1 -0
  123. package/assets/esri/widgets/support/SelectionList/t9n/SelectionList_vi.json +1 -0
  124. package/assets/esri/widgets/support/SelectionList/t9n/SelectionList_zh-CN.json +1 -0
  125. package/assets/esri/widgets/support/SelectionList/t9n/SelectionList_zh-HK.json +1 -0
  126. package/assets/esri/widgets/support/SelectionList/t9n/SelectionList_zh-TW.json +1 -0
  127. package/chunks/BloomComposition.glsl.js +4 -13
  128. package/chunks/Theme.js +1 -1
  129. package/chunks/Tick.js +1 -1
  130. package/geometry/support/HalfFloatArray.js +1 -1
  131. package/geometry/support/MeshTexture.js +1 -1
  132. package/geometry/support/buffer/BufferView.js +1 -1
  133. package/geometry/support/float16.js +1 -1
  134. package/interfaces.d.ts +266 -139
  135. package/layers/FeatureLayer.js +1 -1
  136. package/layers/WCSLayer.js +1 -1
  137. package/layers/graphics/data/QueryEngineCapabilities.js +1 -1
  138. package/layers/graphics/sources/OGCFeatureSource.js +1 -1
  139. package/layers/mixins/ArcGISImageService.js +1 -1
  140. package/layers/mixins/FeatureLayerBase.js +1 -1
  141. package/layers/support/capabilities.js +1 -1
  142. package/layers/support/serviceCapabilitiesUtils.js +1 -1
  143. package/package.json +2 -2
  144. package/support/revision.js +1 -1
  145. package/views/3d/analysis/Dimension/DimensionVisualization.js +1 -1
  146. package/views/3d/interactive/Manipulator3D.js +1 -1
  147. package/views/3d/interactive/visualElements/ExtendedLineVisualElement.js +1 -1
  148. package/views/3d/interactive/visualElements/Object3DVisualElement.js +1 -1
  149. package/views/3d/interactive/visualElements/OutlineVisualElement.js +1 -1
  150. package/views/3d/interactive/visualElements/ParallelLineVisualElement.js +1 -1
  151. package/views/3d/interactive/visualElements/RightAngleQuadVisualElement.js +1 -1
  152. package/views/3d/interactive/visualElements/VisualElementResources.js +1 -1
  153. package/views/3d/layers/DrapedSubView3D.js +1 -1
  154. package/views/3d/layers/DynamicLayerView3D.js +1 -1
  155. package/views/3d/layers/FlowSubView3D.js +5 -0
  156. package/views/3d/layers/ImageryLayerView3D.js +1 -1
  157. package/views/3d/layers/ImageryTileLayerView3D.js +1 -1
  158. package/views/3d/layers/PointCloudLayerView3D.js +1 -1
  159. package/views/3d/layers/WMSLayerView3D.js +1 -1
  160. package/views/3d/layers/graphics/Graphics3DExtrudeSymbolLayer.js +1 -1
  161. package/views/3d/layers/graphics/Graphics3DIconSymbolLayer.js +1 -1
  162. package/views/3d/layers/graphics/Graphics3DLineCalloutSymbolLayer.js +1 -1
  163. package/views/3d/layers/graphics/Graphics3DLineSymbolLayer.js +1 -1
  164. package/views/3d/layers/graphics/Graphics3DMeshFillSymbolLayer.js +1 -1
  165. package/views/3d/layers/graphics/Graphics3DObject3DGraphicLayer.js +1 -1
  166. package/views/3d/layers/graphics/Graphics3DObjectSymbolLayer.js +1 -1
  167. package/views/3d/layers/graphics/Graphics3DPathSymbolLayer.js +1 -1
  168. package/views/3d/layers/graphics/Graphics3DPolygonFillSymbolLayer.js +1 -1
  169. package/views/3d/layers/graphics/Graphics3DSymbolLayer.js +1 -1
  170. package/views/3d/layers/graphics/Graphics3DTextSymbolLayer.js +1 -1
  171. package/views/3d/layers/graphics/Graphics3DWaterSymbolLayer.js +1 -1
  172. package/views/3d/layers/graphics/LabelDeconflictor.js +1 -1
  173. package/views/3d/layers/graphics/Labeler.js +1 -1
  174. package/views/3d/layers/graphics/MeshFastUpdateProcessor.js +1 -1
  175. package/views/3d/layers/graphics/objectResourceUtils.js +1 -1
  176. package/views/3d/layers/graphics/pipeline/rendering/DirectRenderer.js +1 -1
  177. package/views/3d/layers/graphics/pipeline/rendering/LodRenderer.js +1 -1
  178. package/views/3d/layers/graphics/polygonUtils.js +1 -1
  179. package/views/3d/layers/support/HeatmapFeatureProcessor.js +1 -1
  180. package/views/3d/support/MemoryController.js +1 -1
  181. package/views/3d/support/buffer/InterleavedLayout.js +1 -1
  182. package/views/3d/support/engineContent/line.js +1 -1
  183. package/views/3d/terrain/OverlayRenderer.js +1 -1
  184. package/views/3d/webgl-engine/Stage.js +1 -1
  185. package/views/3d/webgl-engine/effects/bloom/BloomComposition.glsl.js +1 -1
  186. package/views/3d/webgl-engine/effects/bloom/BloomPresets.glsl.js +1 -1
  187. package/views/3d/webgl-engine/effects/bloom/BloomRenderNode.js +1 -1
  188. package/views/3d/webgl-engine/lib/ContentObjectType.js +1 -1
  189. package/views/3d/webgl-engine/lib/DefaultVertexBufferLayouts.js +1 -1
  190. package/views/3d/webgl-engine/lib/Geometry.js +1 -1
  191. package/views/3d/webgl-engine/lib/GeometryUtil.js +1 -1
  192. package/views/3d/webgl-engine/lib/GridLocalOriginFactory.js +1 -1
  193. package/views/3d/webgl-engine/lib/IntersectableGeometry.js +5 -0
  194. package/views/3d/webgl-engine/lib/Material.js +1 -1
  195. package/views/3d/webgl-engine/lib/Object3D.js +1 -1
  196. package/views/3d/webgl-engine/lib/PathGeometry.js +1 -1
  197. package/views/3d/webgl-engine/lib/RayIntersections.js +1 -1
  198. package/views/3d/webgl-engine/lib/RenderContext.js +1 -1
  199. package/views/3d/webgl-engine/lib/Renderer.js +1 -1
  200. package/views/3d/webgl-engine/lib/RendererBase.js +1 -1
  201. package/views/3d/webgl-engine/lib/SortedRenderGeometryRenderer.js +1 -1
  202. package/views/3d/webgl-engine/lib/WebGLLayer.js +1 -1
  203. package/views/3d/webgl-engine/lib/glUtil3D.js +1 -1
  204. package/views/3d/webgl-engine/materials/LineMarkerMaterial.js +1 -1
  205. package/views/3d/webgl-engine/materials/RibbonLineMaterial.js +1 -1
  206. package/views/3d/webgl-engine/materials/internal/bufferWriterUtils.js +1 -1
  207. package/views/3d/webgl-engine/materials/renderers/MergedRenderer.js +1 -1
  208. package/views/3d/webgl-engine/parts/RenderView.js +1 -1
  209. package/views/layers/ImageryTileLayerView.js +1 -1
  210. package/views/support/Scheduler.js +1 -1
  211. package/webscene/Slide.js +1 -1
  212. package/widgets/Editor/UpdateFeatureWorkflow.js +1 -1
  213. package/widgets/Features/FeaturesViewModel.js +1 -1
  214. package/widgets/Search/types.d.ts +10 -0
  215. package/widgets/Search/types.js +5 -0
  216. package/widgets/TimeSlider/TimeSliderViewModel.js +1 -1
  217. package/widgets/TimeSlider/css.js +1 -1
  218. package/widgets/TimeSlider.js +1 -1
  219. package/widgets/support/SelectionList/FeatureItem.js +5 -0
  220. package/widgets/support/SelectionList/GroupLayerItem.js +5 -0
  221. package/widgets/support/SelectionList/{SelectionListItemBase.js → ItemBase.js} +1 -1
  222. package/widgets/support/SelectionList/LayerItem.js +5 -0
  223. package/widgets/support/SelectionList/SelectionListViewModel.js +1 -1
  224. package/widgets/support/SelectionList/selectionListUtils.js +1 -1
  225. package/widgets/support/SelectionList.js +1 -1
  226. package/widgets/support/UtilityNetworkAssociations/FeatureUtilityNetworkAssociationsViewModel.js +1 -1
  227. package/assets/esri/core/workers/chunks/0db4c0071282dd94f3b2.js +0 -1
  228. package/assets/esri/core/workers/chunks/10631680abe7607616ca.js +0 -1
  229. package/assets/esri/core/workers/chunks/277b61af8982092a4c81.js +0 -1
  230. package/assets/esri/core/workers/chunks/290aed587aa647226b46.js +0 -1
  231. package/assets/esri/core/workers/chunks/345f428dfcaa594ee617.js +0 -1
  232. package/assets/esri/core/workers/chunks/358a3a9326615d5e6d3b.js +0 -1
  233. package/assets/esri/core/workers/chunks/39fbac918ebd1b0e3a18.js +0 -1
  234. package/assets/esri/core/workers/chunks/544771f64a86b541d5bb.js +0 -1
  235. package/assets/esri/core/workers/chunks/6275114e8ed9dd31465d.js +0 -1
  236. package/assets/esri/core/workers/chunks/72b5e43741ce3a0da8f7.js +0 -1
  237. package/assets/esri/core/workers/chunks/72d7e45e7eb28f2cc0b0.js +0 -1
  238. package/assets/esri/core/workers/chunks/7e63e3d759c874077b52.js +0 -1
  239. package/assets/esri/core/workers/chunks/7f8c7e3e41e51ab4d612.js +0 -1
  240. package/assets/esri/core/workers/chunks/80a5fd4fb79e90086538.js +0 -1
  241. package/assets/esri/core/workers/chunks/80aaf31c8eec3cff2add.js +0 -1
  242. package/assets/esri/core/workers/chunks/b6361cec92003997bfe5.js +0 -1
  243. package/assets/esri/core/workers/chunks/bbbb1aa2569ebf01ad8b.js +0 -1
  244. package/assets/esri/core/workers/chunks/d59aeb46bf2fb0931a9b.js +0 -1
  245. package/assets/esri/core/workers/chunks/ee277dd58aa69281163f.js +0 -1
  246. package/assets/esri/core/workers/chunks/f718d41f665d5df25f79.js +0 -1
  247. package/assets/esri/core/workers/chunks/fa9ef9e8eae505371965.js +0 -1
  248. package/assets/esri/core/workers/chunks/fb5b852d0f72df014377.js +0 -1
  249. package/assets/esri/core/workers/chunks/fb603edd374e24f366ff.js +0 -1
  250. package/views/3d/webgl-engine/lib/MaterialCollection.js +0 -5
  251. package/widgets/support/SelectionList/SelectionListFeatureItem.js +0 -5
  252. package/widgets/support/SelectionList/SelectionListGroupLayerItem.js +0 -5
  253. package/widgets/support/SelectionList/SelectionListLayerItem.js +0 -5
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import has from"../../core/has.js";import{parse as t,isHostedAgolService as s}from"./arcgisLayerUrl.js";import{getGltfQueryFormat as e}from"./infoFor3D.js";import{readBoolean as r,readNumber as p}from"../../rest/support/jsonUtils.js";const o={name:"supportsName",size:"supportsSize",contentType:"supportsContentType",keywords:"supportsKeywords",exifInfo:"supportsExifInfo"};function u(t){const s=t?.supportedSpatialAggregationStatistics?.map((t=>t.toLowerCase()));return{envelope:!!s?.includes("envelopeaggregate"),centroid:!!s?.includes("centroidaggregate"),convexHull:!!s?.includes("convexhullaggregate")}}function n(t,s){const e=t?.supportedOperationsWithCacheHint?.map((t=>t.toLowerCase()));return!!e?.includes(s.toLowerCase())}function i(t){const s=t?.supportedStatisticTypes?.map((t=>t.toLowerCase()));return{count:!!s?.includes("count"),sum:!!s?.includes("sum"),min:!!s?.includes("min"),max:!!s?.includes("max"),avg:!!s?.includes("avg"),var:!!s?.includes("var"),stddev:!!s?.includes("stddev"),percentileContinuous:!!s?.includes("percentile_continuous"),percentileDiscrete:!!s?.includes("percentile_discrete"),envelope:!!s?.includes("envelopeaggregate"),centroid:!!s?.includes("centroidaggregate"),convexHull:!!s?.includes("convexhullaggregate")}}function a(t){const s=t?.supportedNormalizationTypes?.map((t=>t.toLowerCase()));return{field:!!s?.includes("field"),log:!!s?.includes("log"),naturalLog:!!s?.includes("naturallog"),percentOfTotal:!!s?.includes("percentoftotal"),squareRoot:!!s?.includes("squareroot")}}function c(t,s){return{analytics:l(t),attachment:d(t),data:y(t),metadata:m(t),operations:g(t.capabilities,t,s),query:C(t,s),queryAttributeBins:S(t),queryRelated:v(t),queryTopFeatures:h(t),editing:f(t)}}function l(t){return{supportsCacheHint:n(t.advancedQueryCapabilities,"queryAnalytics")}}function d(t){const s=t.attachmentProperties,e={supportsName:!1,supportsSize:!1,supportsContentType:!1,supportsKeywords:!1,supportsExifInfo:!1,supportsCacheHint:n(t.advancedQueryCapabilities,"queryAttachments"),supportsOrderByFields:r(t.advancedQueryCapabilities,"supportsQueryAttachmentOrderByFields",!1),supportsResize:r(t,"supportsAttachmentsResizing",!1)};return s&&Array.isArray(s)&&s.forEach((t=>{const s=o[t.name];s&&(e[s]=!!t.isEnabled)})),e}function y(t){return{isVersioned:r(t,"isDataVersioned",!1),isBranchVersioned:r(t,"isDataBranchVersioned",!1),supportsAttachment:r(t,"hasAttachments",!1),supportsM:r(t,"hasM",!1),supportsZ:r(t,"hasZ",!1)}}function m(t){return{supportsAdvancedFieldProperties:r(t,"supportsFieldDescriptionProperty",!1)}}function g(s,e,p){const o=s?s.toLowerCase().split(",").map((t=>t.trim())):[],u=p?t(p):null,n=o.includes(null!=u&&"MapServer"===u.serverType?"data":"query"),i=o.includes("editing")&&!e.datesInUnknownTimezone;let a=i&&o.includes("create"),c=i&&o.includes("delete"),l=i&&o.includes("update");const d=o.includes("changetracking"),y=e.advancedQueryCapabilities;return i&&!(a||c||l)&&(a=c=l=!0),{supportsCalculate:r(e,"supportsCalculate",!1),supportsTruncate:r(e,"supportsTruncate",!1),supportsValidateSql:r(e,"supportsValidateSql",!1),supportsAdd:a,supportsDelete:c,supportsEditing:i,supportsChangeTracking:d,supportsQuery:n,supportsQueryAnalytics:r(y,"supportsQueryAnalytic",!1),supportsQueryAttachments:r(y,"supportsQueryAttachments",!1),supportsQueryBins:r(y,"supportsQueryBins",!1),supportsQueryTopFeatures:r(y,"supportsTopFeaturesQuery",!1),supportsResizeAttachments:r(e,"supportsAttachmentsResizing",!1),supportsSync:o.includes("sync"),supportsUpdate:l,supportsExceedsLimitStatistics:r(e,"supportsExceedsLimitStatistics",!1),supportsAsyncConvert3D:r(e,"supportsAsyncConvert3D",!1)}}function C(t,o){const i=t.advancedQueryCapabilities,a=t.ownershipBasedAccessControlForFeatures,c=t.archivingInfo,l=t.currentVersion,d=o?.includes("MapServer"),y=!d||l>=has("mapserver-pbf-version-support"),m=s(o),g=new Set((t.supportedQueryFormats??"").split(",").map((t=>t.toLowerCase().trim())));return{maxRecordCount:p(t,"maxRecordCount",void 0),maxRecordCountFactor:p(t,"maxRecordCountFactor",void 0),standardMaxRecordCount:p(t,"standardMaxRecordCount",void 0),supportedSpatialAggregationStatistics:u(i),supportsCacheHint:r(i,"supportsQueryWithCacheHint",!1)||n(i,"query"),supportsCentroid:r(i,"supportsReturningGeometryCentroid",!1),supportsCompactGeometry:m,supportsCurrentUser:r(i,"supportsCurrentUserQueries",!1),supportsDefaultSpatialReference:r(i,"supportsDefaultSR",!1),supportsDisjointSpatialRelationship:r(i,"supportsDisjointSpatialRel",!1),supportsDistance:r(i,"supportsQueryWithDistance",!1),supportsDistinct:r(i,"supportsDistinct",t.supportsAdvancedQueries),supportsExtent:r(i,"supportsReturningQueryExtent",!1),supportsFormatPBF:y&&g.has("pbf"),supportsFullTextSearch:r(i,"supportsFullTextSearch",!1),supportsGeometryProperties:r(i,"supportsReturningGeometryProperties",!1),supportsHavingClause:r(i,"supportsHavingClause",!1),supportsHistoricMoment:r(c,"supportsQueryWithHistoricMoment",!1),supportsMaxRecordCountFactor:r(i,"supportsMaxRecordCountFactor",!1),supportsOrderBy:r(i,"supportsOrderBy",t.supportsAdvancedQueries),supportsPagination:r(i,"supportsPagination",!1),supportsPercentileStatistics:r(i,"supportsPercentileStatistics",!1),supportsQuantization:r(t,"supportsCoordinatesQuantization",!1),supportsQuantizationEditMode:r(t,"supportsQuantizationEditMode",!1),supportsQueryByAnonymous:r(a,"allowAnonymousToQuery",!0),supportsQueryByOthers:r(a,"allowOthersToQuery",!0),supportsQueryGeometry:r(t,"supportsReturningQueryGeometry",!1),supportsResultType:r(i,"supportsQueryWithResultType",!1),supportsReturnMesh:!!e(t.infoFor3D),supportsSpatialAggregationStatistics:r(i,"supportsSpatialAggregationStatistics",!1),supportsSqlExpression:r(i,"supportsSqlExpression",!1),supportsStandardizedQueriesOnly:r(t,"useStandardizedQueries",!1),supportsStatistics:r(i,"supportsStatistics",t.supportsStatistics),supportsTopFeaturesQuery:r(i,"supportsTopFeaturesQuery",!1),supportsTrueCurve:r(i,"supportsTrueCurve",!1),tileMaxRecordCount:p(t,"tileMaxRecordCount",void 0)}}function v(t){const s=t.advancedQueryCapabilities,e=r(s,"supportsAdvancedQueryRelated",!1);return{supportsPagination:r(s,"supportsQueryRelatedPagination",!1),supportsCount:e,supportsOrderBy:e,supportsCacheHint:n(s,"queryRelated")}}function h(t){return{supportsCacheHint:n(t.advancedQueryCapabilities,"queryTopFilter")}}function S(t){const s=t?t.queryBinsCapabilities:void 0;return{supportsDate:r(s,"supportsDateBin",!1),supportsFixedInterval:r(s,"supportsFixedIntervalBin",!1),supportsAutoInterval:r(s,"supportsAutoIntervalBin",!1),supportsFixedBoundaries:r(s,"supportsFixedBoundariesBin",!1),supportsStackBy:r(s,"supportsStackBy",!1),supportsSplitBy:r(s,"supportsSplitBy",!1),supportsSnapToData:r(s,"supportsSnapToData",!1),supportsReturnFullIntervalBin:r(s,"supportsReturnFullIntervalBin",!1),supportsFirstDayOfWeek:r(s,"supportsFirstDayOfWeek",!1),supportsNormalization:r(s,"supportsNormalization",!1),supportedStatistics:i(s),supportedNormalizationTypes:a(s)}}function f(t){const s=t.ownershipBasedAccessControlForFeatures,e=t?t.advancedEditingCapabilities:void 0;return{supportsGeometryUpdate:r(t,"allowGeometryUpdates",!0),supportsGlobalId:r(t,"supportsApplyEditsWithGlobalIds",!1),supportsReturnServiceEditsInSourceSpatialReference:r(t,"supportsReturnServiceEditsInSourceSR",!1),supportsRollbackOnFailure:r(t,"supportsRollbackOnFailureParameter",!1),supportsUpdateWithoutM:r(t,"allowUpdateWithoutMValues",!1),supportsUploadWithItemId:r(t,"supportsAttachmentsByUploadId",!1),supportsDeleteByAnonymous:r(s,"allowAnonymousToDelete",!0),supportsDeleteByOthers:r(s,"allowOthersToDelete",!0),supportsUpdateByAnonymous:r(s,"allowAnonymousToUpdate",!0),supportsUpdateByOthers:r(s,"allowOthersToUpdate",!0),supportsAsyncApplyEdits:r(e,"supportsAsyncApplyEdits",!1),zDefault:p(t,"zDefault",void 0)}}function A(t){return{operations:{supportsAppend:r(t,"supportsAppend",!1),supportsCoverageQuery:t?.playbackInfo?.klv["0601"]??!1,supportsExportClip:r(t,"supportsExportClip",!1),supportsExportFrameset:r(t,"supportsExportFrameset",!1),supportsMensuration:r(t,"supportsMensuration",!1),supportsUpdate:r(t,"supportsUpdate",!1)}}}export{c as getFeatureLayerCapabilities,A as getVideoLayerCapabilities};
5
+ import has from"../../core/has.js";import{parse as t,isHostedAgolService as s}from"./arcgisLayerUrl.js";import{getGltfQueryFormat as e}from"./infoFor3D.js";import{readBoolean as r,readNumber as p}from"../../rest/support/jsonUtils.js";const o={name:"supportsName",size:"supportsSize",contentType:"supportsContentType",keywords:"supportsKeywords",exifInfo:"supportsExifInfo"};function u(t){const s=t?.supportedSpatialAggregationStatistics?.map((t=>t.toLowerCase()));return{envelope:!!s?.includes("envelopeaggregate"),centroid:!!s?.includes("centroidaggregate"),convexHull:!!s?.includes("convexhullaggregate")}}function n(t,s){const e=t?.supportedOperationsWithCacheHint?.map((t=>t.toLowerCase()));return!!e?.includes(s.toLowerCase())}function i(t){const s=t?.supportedStatisticTypes?.map((t=>t.toLowerCase()));return{count:!!s?.includes("count"),sum:!!s?.includes("sum"),min:!!s?.includes("min"),max:!!s?.includes("max"),avg:!!s?.includes("avg"),var:!!s?.includes("var"),stddev:!!s?.includes("stddev"),percentileContinuous:!!s?.includes("percentile_continuous"),percentileDiscrete:!!s?.includes("percentile_discrete"),envelope:!!s?.includes("envelopeaggregate"),centroid:!!s?.includes("centroidaggregate"),convexHull:!!s?.includes("convexhullaggregate")}}function a(t){const s=t?.supportedNormalizationTypes?.map((t=>t.toLowerCase()));return{field:!!s?.includes("field"),log:!!s?.includes("log"),naturalLog:!!s?.includes("naturallog"),percentOfTotal:!!s?.includes("percentoftotal"),squareRoot:!!s?.includes("squareroot")}}function c(t,s){return{analytics:l(t),attachment:d(t),data:y(t),metadata:m(t),operations:g(t.capabilities,t,s),query:C(t,s),queryAttributeBins:S(t),queryRelated:v(t),queryTopFeatures:h(t),editing:f(t)}}function l(t){return{supportsCacheHint:n(t.advancedQueryCapabilities,"queryAnalytics")}}function d(t){const s=t.attachmentProperties,e={supportsName:!1,supportsSize:!1,supportsContentType:!1,supportsKeywords:!1,supportsExifInfo:!1,supportsCacheHint:n(t.advancedQueryCapabilities,"queryAttachments"),supportsOrderByFields:r(t.advancedQueryCapabilities,"supportsQueryAttachmentOrderByFields",!1),supportsResize:r(t,"supportsAttachmentsResizing",!1)};return s&&Array.isArray(s)&&s.forEach((t=>{const s=o[t.name];s&&(e[s]=!!t.isEnabled)})),e}function y(t){return{isVersioned:r(t,"isDataVersioned",!1),isBranchVersioned:r(t,"isDataBranchVersioned",!1),supportsAttachment:r(t,"hasAttachments",!1),supportsM:r(t,"hasM",!1),supportsZ:r(t,"hasZ",!1)}}function m(t){return{supportsAdvancedFieldProperties:r(t,"supportsFieldDescriptionProperty",!1)}}function g(s,e,p){const o=s?.toLowerCase().split(",").map((t=>t.trim()))??[],u=p?t(p):null,n=o.includes("MapServer"===u?.serverType?"data":"query"),i=o.includes("editing")&&!e.datesInUnknownTimezone;let a=i&&o.includes("create"),c=i&&o.includes("delete"),l=i&&o.includes("update");const d=o.includes("changetracking"),y=e.advancedQueryCapabilities;return i&&!(a||c||l)&&(a=c=l=!0),{supportsCalculate:r(e,"supportsCalculate",!1),supportsTruncate:r(e,"supportsTruncate",!1),supportsValidateSql:r(e,"supportsValidateSql",!1),supportsAdd:a,supportsDelete:c,supportsEditing:i,supportsChangeTracking:d,supportsQuery:n,supportsQueryAnalytics:r(y,"supportsQueryAnalytic",!1),supportsQueryAttachments:r(y,"supportsQueryAttachments",!1),supportsQueryBins:r(y,"supportsQueryBins",!1),supportsQueryTopFeatures:r(y,"supportsTopFeaturesQuery",!1),supportsResizeAttachments:r(e,"supportsAttachmentsResizing",!1),supportsSync:o.includes("sync"),supportsUpdate:l,supportsExceedsLimitStatistics:r(e,"supportsExceedsLimitStatistics",!1),supportsAsyncConvert3D:r(e,"supportsAsyncConvert3D",!1)}}function C(t,o){const i=t.advancedQueryCapabilities,a=t.ownershipBasedAccessControlForFeatures,c=t.archivingInfo,l=t.currentVersion,d=o?.includes("MapServer"),y=!d||l>=has("mapserver-pbf-version-support"),m=s(o),g=new Set((t.supportedQueryFormats??"").split(",").map((t=>t.toLowerCase().trim())));return{maxRecordCount:p(t,"maxRecordCount",void 0),maxRecordCountFactor:p(t,"maxRecordCountFactor",void 0),maxUniqueIDCount:p(t,"maxUniqueIDCount",void 0),standardMaxRecordCount:p(t,"standardMaxRecordCount",void 0),supportedSpatialAggregationStatistics:u(i),supportsCacheHint:r(i,"supportsQueryWithCacheHint",!1)||n(i,"query"),supportsCentroid:r(i,"supportsReturningGeometryCentroid",!1),supportsCompactGeometry:m,supportsCurrentUser:r(i,"supportsCurrentUserQueries",!1),supportsDefaultSpatialReference:r(i,"supportsDefaultSR",!1),supportsDisjointSpatialRelationship:r(i,"supportsDisjointSpatialRel",!1),supportsDistance:r(i,"supportsQueryWithDistance",!1),supportsDistinct:r(i,"supportsDistinct",t.supportsAdvancedQueries),supportsExtent:r(i,"supportsReturningQueryExtent",!1),supportsFormatPBF:y&&g.has("pbf"),supportsFullTextSearch:r(i,"supportsFullTextSearch",!1),supportsGeometryProperties:r(i,"supportsReturningGeometryProperties",!1),supportsHavingClause:r(i,"supportsHavingClause",!1),supportsHistoricMoment:r(c,"supportsQueryWithHistoricMoment",!1),supportsMaxRecordCountFactor:r(i,"supportsMaxRecordCountFactor",!1),supportsOrderBy:r(i,"supportsOrderBy",t.supportsAdvancedQueries),supportsPagination:r(i,"supportsPagination",!1),supportsPercentileStatistics:r(i,"supportsPercentileStatistics",!1),supportsQuantization:r(t,"supportsCoordinatesQuantization",!1),supportsQuantizationEditMode:r(t,"supportsQuantizationEditMode",!1),supportsQueryByAnonymous:r(a,"allowAnonymousToQuery",!0),supportsQueryByOthers:r(a,"allowOthersToQuery",!0),supportsQueryGeometry:r(t,"supportsReturningQueryGeometry",!1),supportsResultType:r(i,"supportsQueryWithResultType",!1),supportsReturnMesh:!!e(t.infoFor3D),supportsSpatialAggregationStatistics:r(i,"supportsSpatialAggregationStatistics",!1),supportsSqlExpression:r(i,"supportsSqlExpression",!1),supportsStandardizedQueriesOnly:r(t,"useStandardizedQueries",!1),supportsStatistics:r(i,"supportsStatistics",t.supportsStatistics),supportsTopFeaturesQuery:r(i,"supportsTopFeaturesQuery",!1),supportsTrueCurve:r(i,"supportsTrueCurve",!1),tileMaxRecordCount:p(t,"tileMaxRecordCount",void 0)}}function v(t){const s=t.advancedQueryCapabilities,e=r(s,"supportsAdvancedQueryRelated",!1);return{supportsPagination:r(s,"supportsQueryRelatedPagination",!1),supportsCount:e,supportsOrderBy:e,supportsCacheHint:n(s,"queryRelated")}}function h(t){return{supportsCacheHint:n(t.advancedQueryCapabilities,"queryTopFilter")}}function S(t){const s=t?t.queryBinsCapabilities:void 0;return{supportsDate:r(s,"supportsDateBin",!1),supportsFixedInterval:r(s,"supportsFixedIntervalBin",!1),supportsAutoInterval:r(s,"supportsAutoIntervalBin",!1),supportsFixedBoundaries:r(s,"supportsFixedBoundariesBin",!1),supportsStackBy:r(s,"supportsStackBy",!1),supportsSplitBy:r(s,"supportsSplitBy",!1),supportsSnapToData:r(s,"supportsSnapToData",!1),supportsReturnFullIntervalBin:r(s,"supportsReturnFullIntervalBin",!1),supportsFirstDayOfWeek:r(s,"supportsFirstDayOfWeek",!1),supportsNormalization:r(s,"supportsNormalization",!1),supportedStatistics:i(s),supportedNormalizationTypes:a(s)}}function f(t){const s=t.ownershipBasedAccessControlForFeatures,e=t?t.advancedEditingCapabilities:void 0;return{supportsGeometryUpdate:r(t,"allowGeometryUpdates",!0),supportsGlobalId:r(t,"supportsApplyEditsWithGlobalIds",!1),supportsReturnServiceEditsInSourceSpatialReference:r(t,"supportsReturnServiceEditsInSourceSR",!1),supportsRollbackOnFailure:r(t,"supportsRollbackOnFailureParameter",!1),supportsUpdateWithoutM:r(t,"allowUpdateWithoutMValues",!1),supportsUploadWithItemId:r(t,"supportsAttachmentsByUploadId",!1),supportsDeleteByAnonymous:r(s,"allowAnonymousToDelete",!0),supportsDeleteByOthers:r(s,"allowOthersToDelete",!0),supportsUpdateByAnonymous:r(s,"allowAnonymousToUpdate",!0),supportsUpdateByOthers:r(s,"allowOthersToUpdate",!0),supportsAsyncApplyEdits:r(e,"supportsAsyncApplyEdits",!1),zDefault:p(t,"zDefault",void 0)}}function A(t){return{operations:{supportsAppend:r(t,"supportsAppend",!1),supportsCoverageQuery:t?.playbackInfo?.klv["0601"]??!1,supportsExportClip:r(t,"supportsExportClip",!1),supportsExportFrameset:r(t,"supportsExportFrameset",!1),supportsMensuration:r(t,"supportsMensuration",!1),supportsUpdate:r(t,"supportsUpdate",!1)}}}export{c as getFeatureLayerCapabilities,A as getVideoLayerCapabilities};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arcgis/core",
3
- "version": "4.33.0-next.20250414",
3
+ "version": "4.33.0-next.20250416",
4
4
  "homepage": "https://js.arcgis.com",
5
5
  "description": "ArcGIS Maps SDK for JavaScript: A complete 2D and 3D mapping and data visualization API",
6
6
  "keywords": [
@@ -28,7 +28,7 @@
28
28
  "@esri/arcgis-html-sanitizer": "~4.1.0",
29
29
  "@esri/calcite-components": "^3.0.3",
30
30
  "@petamoriken/float16": "~3.9.2",
31
- "@vaadin/grid": "~24.7.2",
31
+ "@vaadin/grid": "~24.7.3",
32
32
  "@zip.js/zip.js": "~2.7.60",
33
33
  "luxon": "~3.6.1",
34
34
  "marked": "~15.0.8"
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- const e="20250414",f="e6343edb3df84ef485349b2f7cbf15e3b633f6a2";export{e as buildDate,f as commitHash};
5
+ const c="20250416",d="b270f3a2c346824508d44d20e800819cd5697994";export{c as buildDate,d as commitHash};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../../chunks/tslib.es6.js";import i from"../../../../Color.js";import"../../../../intl.js";import s from"../../../../core/Accessor.js";import{makeHandle as t,destroyHandle as a}from"../../../../core/handleUtils.js";import"../../../../core/has.js";import{mapCollection as r}from"../../../../core/mapCollectionUtils.js";import{watch as o,syncAndInitial as n,when as l,sync as m}from"../../../../core/reactiveUtils.js";import{pt2px as c}from"../../../../core/screenUtils.js";import{property as d}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as h}from"../../../../core/accessorSupport/decorators/subclass.js";import{ZEROS as p}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{LengthDimensionVisualization as u}from"./LengthDimensionVisualization.js";import{markerLineSizeFraction as f,offsetLineSizeFraction as g}from"./settings.js";import{RenderOccludedFlag as M}from"../../webgl-engine/lib/Material.js";import{LineMarkerMaterial as _}from"../../webgl-engine/materials/LineMarkerMaterial.js";import{createStipplePatternSimple as y}from"../../webgl-engine/materials/lineStippleUtils.js";import{RibbonLineMaterial as w}from"../../webgl-engine/materials/RibbonLineMaterial.js";import{LineMarkerAnchor as v}from"../../webgl-engine/shaders/LineMarkerTechniqueConfiguration.js";import{onLocaleChange as L}from"../../../../intl/locale.js";import{fetchMessageBundle as j}from"../../../../intl/messages.js";let b=class extends s{get analysis(){return this.analysisViewData.analysis}get visible(){return this.analysisViewData.visible}constructor(e){super(e),this.loadingMessages=!1,this._messages=null}initialize(){const e=this.isDecoration;this._markerMaterial=new _({width:1,anchor:v.Tip,color:p,placement:"begin-end",worldSpace:!0,hideOnShortSegments:!0,hasTip:!0,renderOccluded:M.OccludeAndTransparent,markerPrimitive:"triangle",isDecoration:e}),this._dimensionLineMaterial=new w({width:1,color:p,renderOccluded:M.OccludeAndTransparent,markerParameters:this._markerMaterial.parameters,isDecoration:e}),this._offsetLineMaterial=new w({width:1,color:p,renderOccluded:M.OccludeAndTransparent,stipplePattern:y(5),isDecoration:e}),this._smallDimensionLineMaterial=new w({width:1,color:p,renderOccluded:M.OccludeAndTransparent,isDecoration:e}),this._smallOffsetLineMaterial=new w({width:1,color:p,renderOccluded:M.OccludeAndTransparent,stipplePattern:y(5),isDecoration:e});for(const i of this._lineMaterials())this.view.stage.add(i),this.addHandles(t((()=>{this.view.stage?.remove(i)})));const s=r((()=>this.analysisViewData.computations),(({computation:e})=>this._createVisualization(e)));this._dimensionVisualizations=s,this.addHandles([a(s),o((()=>i.toUnitRGBA(this.analysis.style.color)),(e=>{for(const i of this._lineMaterials())i.setParameters({color:e})}),n),o((()=>this.analysis.style.lineSize),(e=>{const i=c(e);this._markerMaterial.setParameters({width:i*f}),this._dimensionLineMaterial.setParameters({width:i,markerParameters:this._markerMaterial.parameters});const s=Math.max(i*g,1);this._offsetLineMaterial.setParameters({width:s})}),n),o((()=>({camera:this.view.state.camera,style:D(this.analysis)})),(({camera:e,style:i})=>{for(const{visualization:s}of this._dimensionVisualizations)s.updateCameraDependentElements(e,s.computation.geometry,i),s.updateLabelStyle(i)})),o((()=>this.visible),(e=>{for(const{visualization:i}of this._dimensionVisualizations)i.visible=e}))]),this.addHandles([L((()=>this._updateMessageBundle())),l((()=>!this.loadingMessages),(()=>{for(const{visualization:e}of this._dimensionVisualizations)e.updateUnitsMessages(this._messages)}),m)]),this._updateMessageBundle()}get testInfo(){}_createVisualization(e){const i=new u({analysis:this.analysis,computation:e,view:this.view,visible:this.visible,markerMaterial:this._markerMaterial,dimensionLineMaterial:this._dimensionLineMaterial,offsetLineMaterial:this._offsetLineMaterial,smallDimensionLineMaterial:this._smallDimensionLineMaterial,smallOffsetLineMaterial:this._smallOffsetLineMaterial,messages:this._messages,isDecoration:this.isDecoration});return{visualization:i,remove:()=>i.destroy()}}_lineMaterials(){return[this._markerMaterial,this._dimensionLineMaterial,this._offsetLineMaterial,this._smallDimensionLineMaterial,this._smallOffsetLineMaterial]}async _updateMessageBundle(){this.loadingMessages=!0;try{this._messages=await j("esri/core/t9n/Units")}finally{this.loadingMessages=!1}}};function D(e){const{fontSize:i,lineSize:s,textColor:t,textBackgroundColor:a}=e.style;return{fontSize:i,lineSize:s,textBackgroundColor:a.clone(),textColor:t.clone()}}e([d({constructOnly:!0})],b.prototype,"analysisViewData",void 0),e([d({constructOnly:!0,nonNullable:!0})],b.prototype,"view",void 0),e([d({constructOnly:!0})],b.prototype,"isDecoration",void 0),e([d()],b.prototype,"analysis",null),e([d()],b.prototype,"visible",null),e([d()],b.prototype,"loadingMessages",void 0),b=e([h("esri.views.3d.analysis.Dimension.DimensionVisualization")],b);export{b as DimensionVisualization};
5
+ import{_ as e}from"../../../../chunks/tslib.es6.js";import i from"../../../../Color.js";import"../../../../intl.js";import s from"../../../../core/Accessor.js";import{destroyHandle as t}from"../../../../core/handleUtils.js";import"../../../../core/has.js";import{mapCollection as a}from"../../../../core/mapCollectionUtils.js";import{watch as r,syncAndInitial as o,when as n,sync as l}from"../../../../core/reactiveUtils.js";import{pt2px as m}from"../../../../core/screenUtils.js";import{property as c}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as d}from"../../../../core/accessorSupport/decorators/subclass.js";import{ZEROS as p}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{LengthDimensionVisualization as h}from"./LengthDimensionVisualization.js";import{markerLineSizeFraction as u,offsetLineSizeFraction as f}from"./settings.js";import{RenderOccludedFlag as g}from"../../webgl-engine/lib/Material.js";import{LineMarkerMaterial as M}from"../../webgl-engine/materials/LineMarkerMaterial.js";import{createStipplePatternSimple as _}from"../../webgl-engine/materials/lineStippleUtils.js";import{RibbonLineMaterial as y}from"../../webgl-engine/materials/RibbonLineMaterial.js";import{LineMarkerAnchor as w}from"../../webgl-engine/shaders/LineMarkerTechniqueConfiguration.js";import{onLocaleChange as L}from"../../../../intl/locale.js";import{fetchMessageBundle as v}from"../../../../intl/messages.js";let j=class extends s{get analysis(){return this.analysisViewData.analysis}get visible(){return this.analysisViewData.visible}constructor(e){super(e),this.loadingMessages=!1,this._messages=null}initialize(){const e=this.isDecoration;this._markerMaterial=new M({width:1,anchor:w.Tip,color:p,placement:"begin-end",worldSpace:!0,hideOnShortSegments:!0,hasTip:!0,renderOccluded:g.OccludeAndTransparent,markerPrimitive:"triangle",isDecoration:e}),this._dimensionLineMaterial=new y({width:1,color:p,renderOccluded:g.OccludeAndTransparent,markerParameters:this._markerMaterial.parameters,isDecoration:e}),this._offsetLineMaterial=new y({width:1,color:p,renderOccluded:g.OccludeAndTransparent,stipplePattern:_(5),isDecoration:e}),this._smallDimensionLineMaterial=new y({width:1,color:p,renderOccluded:g.OccludeAndTransparent,isDecoration:e}),this._smallOffsetLineMaterial=new y({width:1,color:p,renderOccluded:g.OccludeAndTransparent,stipplePattern:_(5),isDecoration:e});const s=a((()=>this.analysisViewData.computations),(({computation:e})=>this._createVisualization(e)));this._dimensionVisualizations=s,this.addHandles([t(s),r((()=>i.toUnitRGBA(this.analysis.style.color)),(e=>{for(const i of this._lineMaterials())i.setParameters({color:e})}),o),r((()=>this.analysis.style.lineSize),(e=>{const i=m(e);this._markerMaterial.setParameters({width:i*u}),this._dimensionLineMaterial.setParameters({width:i,markerParameters:this._markerMaterial.parameters});const s=Math.max(i*f,1);this._offsetLineMaterial.setParameters({width:s})}),o),r((()=>({camera:this.view.state.camera,style:b(this.analysis)})),(({camera:e,style:i})=>{for(const{visualization:s}of this._dimensionVisualizations)s.updateCameraDependentElements(e,s.computation.geometry,i),s.updateLabelStyle(i)})),r((()=>this.visible),(e=>{for(const{visualization:i}of this._dimensionVisualizations)i.visible=e}))]),this.addHandles([L((()=>this._updateMessageBundle())),n((()=>!this.loadingMessages),(()=>{for(const{visualization:e}of this._dimensionVisualizations)e.updateUnitsMessages(this._messages)}),l)]),this._updateMessageBundle()}get testInfo(){}_createVisualization(e){const i=new h({analysis:this.analysis,computation:e,view:this.view,visible:this.visible,markerMaterial:this._markerMaterial,dimensionLineMaterial:this._dimensionLineMaterial,offsetLineMaterial:this._offsetLineMaterial,smallDimensionLineMaterial:this._smallDimensionLineMaterial,smallOffsetLineMaterial:this._smallOffsetLineMaterial,messages:this._messages,isDecoration:this.isDecoration});return{visualization:i,remove:()=>i.destroy()}}_lineMaterials(){return[this._markerMaterial,this._dimensionLineMaterial,this._offsetLineMaterial,this._smallDimensionLineMaterial,this._smallOffsetLineMaterial]}async _updateMessageBundle(){this.loadingMessages=!0;try{this._messages=await v("esri/core/t9n/Units")}finally{this.loadingMessages=!1}}};function b(e){const{fontSize:i,lineSize:s,textColor:t,textBackgroundColor:a}=e.style;return{fontSize:i,lineSize:s,textBackgroundColor:a.clone(),textColor:t.clone()}}e([c({constructOnly:!0})],j.prototype,"analysisViewData",void 0),e([c({constructOnly:!0,nonNullable:!0})],j.prototype,"view",void 0),e([c({constructOnly:!0})],j.prototype,"isDecoration",void 0),e([c()],j.prototype,"analysis",null),e([c()],j.prototype,"visible",null),e([c()],j.prototype,"loadingMessages",void 0),j=e([d("esri.views.3d.analysis.Dimension.DimensionVisualization")],j);export{j as DimensionVisualization};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{neverReached as e}from"../../../core/compilerUtils.js";import t from"../../../core/Evented.js";import{makeHandle as i}from"../../../core/handleUtils.js";import"../../../core/has.js";import{deg2rad as s}from"../../../core/mathUtils.js";import{destroyMaybe as o}from"../../../core/maybe.js";import{createScreenPointArray as r,createRenderScreenPointArray3 as n,screenPointObjectToArray as a,castRenderScreenPointArray as c}from"../../../core/screenUtils.js";import{fromMat4 as l}from"../../../core/libs/gl-matrix-2/math/mat3.js";import{create as h}from"../../../core/libs/gl-matrix-2/factories/mat3f64.js";import{copy as d,set as _,multiply as u,identity as g}from"../../../core/libs/gl-matrix-2/math/mat4.js";import{create as m}from"../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{squaredDistance as f}from"../../../core/libs/gl-matrix-2/math/vec2.js";import{g as p,q as b,t as v,h as y,c as j,s as L,i as S,d as R}from"../../../chunks/vec32.js";import{create as O,ZEROS as w}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{getReferenceEllipsoid as T}from"../../../geometry/ellipsoidUtils.js";import A from"../../../geometry/Point.js";import{canProjectWithoutEngine as E,projectPoint as D}from"../../../geometry/projection.js";import{computeENUToPCPFLocalRotation as F}from"../../../geometry/projection/localRotationUtils.js";import{sphericalPCPFtoLonLatElevation as z}from"../../../geometry/projection/projectors.js";import{containsPointObject as P}from"../../../geometry/support/aaBoundingRect.js";import{create as C,distance2 as I,fromPoints as x,closestRayDistance2 as M}from"../../../geometry/support/lineSegment.js";import{create as k,fromPositionAndNormal as U,intersectRay as W}from"../../../geometry/support/plane.js";import{create as B}from"../../../geometry/support/ray.js";import{sv3d as N}from"../../../geometry/support/vectorStacks.js";import{clonePoint as H,hydratedSpatialReference as q}from"../../../layers/graphics/hydratedFeatures.js";import{getElevationOffset as G}from"../../../support/elevationInfoUtils.js";import{getElevationAtPoint as V}from"../support/ElevationProvider.js";import{fromScreen as Y}from"../support/geometryUtils/ray.js";import J from"../webgl/RenderCamera.js";import{Object3D as K}from"../webgl-engine/lib/Object3D.js";import{UpdatePolicy as Q}from"../webgl-engine/lib/UpdatePolicy.js";import{WebGLLayer as X}from"../webgl-engine/lib/WebGLLayer.js";import{ManipulatorStateCustomFlags as Z,ManipulatorStateFlags as $}from"../../interactive/interfaces.js";class ee{constructor(e){this.metadata=void 0,this._camera=new J,this._elevation={offset:0,override:null},this.collisionType={type:"point"},this.collisionPriority=0,this._renderObjects=new Array,this.autoScaleRenderObjects=!0,this._available=!0,this._noDisplayCount=0,this._radius=10,this._worldSized=!1,this.focusMultiplier=2,this.touchMultiplier=2.5,this.worldOriented=!1,this._modelTransform=m(),this._worldFrame=null,this._renderLocation=O(),this._renderLocationDirty=!0,this._location=new A({x:0,y:0,z:0}),this._elevationAlignedLocation=new A,this._elevationAlignedLocationDirty=!0,this.interactive=!0,this.selectable=!1,this.grabbable=!0,this.consumesClicks=!0,this.cursor=null,this.grabCursor=null,this._grabbing=!1,this.dragging=!1,this._hovering=!1,this._selected=!1,this._state=Z.None,this._focused=!1,this.events=new t.EventEmitter,this._screenLocation={screenPointArray:r(),renderScreenPointArray:n(),pixelSize:0},this._screenLocationDirty=!0,this._engineResourcesAddedToStage=!1,this._attached=!1,this._location.spatialReference=e.view.spatialReference,Object.assign(this,e);const i=this.view.state?.camera;i&&this._camera.copyFrom(i)}destroy(){this._applyObjectTransform=pe,this._removeResourcesFromStage(),this._engineResources=null,this.view=null,this._camera=null}get _stage(){return this.view?.stage}get elevationInfo(){return this._elevationInfo}set elevationInfo(e){this._elevationInfo=e,this._elevationAlignedLocationDirty=!0,this._renderLocationDirty=!0,this._updateEngineObject()}get renderObjects(){return this._renderObjects}set renderObjects(e){this._removeResourcesFromStage(),this._engineResources=null,this._renderObjects=e.slice(),this._updateEngineObject()}set available(e){e!==this._available&&(this._available=e,this._updateEngineObject())}get available(){return this._available}disableDisplay(){return this._noDisplayCount++,1===this._noDisplayCount&&this._updateEngineObject(),i((()=>{this._noDisplayCount--,0===this._noDisplayCount&&this._updateEngineObject()}))}set radius(e){e!==this._radius&&(this._radius=e,this._updateEngineObject())}get radius(){return this._radius}set worldSized(e){e!==this._worldSized&&(this._worldSized=e,this._updateEngineObject())}get worldSized(){return this._worldSized}get modelTransform(){return this._modelTransform}set modelTransform(e){te(e)&&(this._screenLocationDirty=!0),d(this._modelTransform,e),this._updateEngineObject()}get renderLocation(){return this._renderLocationDirty&&(this._renderLocationDirty=!1,this.view.renderCoordsHelper.toRenderCoords(this.elevationAlignedLocation,this._renderLocation),this.worldOriented?(this._worldFrame||(this._worldFrame=m()),ie(this.view,this._renderLocation,this._worldFrame)):this._worldFrame&&(this._worldFrame=null)),this._renderLocation}set renderLocation(e){this.view.renderCoordsHelper.fromRenderCoords(e,this._location),this.elevationAlignedLocation=this._location}get location(){return this._location}set location(e){H(e,this._location),this._notifyLocationChanged()}_notifyLocationChanged(){this._renderLocationDirty=!0,this._screenLocationDirty=!0,this._elevationAlignedLocationDirty=!0,this._updateEngineObject(),this.events.emit("location-update",{location:this._location})}get elevationAlignedLocation(){return this._elevationAlignedLocationDirty?(this._evaluateElevationAlignment(),this._updateElevationAlignedLocation(),this._elevationAlignedLocation):this._elevationAlignedLocation}set elevationAlignedLocation(e){H(e,this._location),this._evaluateElevationAlignment(),this._location.z-=this._elevation.offset,this._updateElevationAlignedLocation(),this._updateEngineObject(),this.events.emit("location-update",{location:this._location})}_updateElevationAlignedLocation(){const e=null!=this._elevation.override?this._elevation.override:this.location.z||0;this._elevationAlignedLocation.x=this.location.x,this._elevationAlignedLocation.y=this.location.y,this._elevationAlignedLocation.z=e+this._elevation.offset,this._elevationAlignedLocation.spatialReference=q(this.location.spatialReference),this._renderLocationDirty=!0,this._screenLocationDirty=!0,this._elevationAlignedLocationDirty=!1}grabbableForEvent(){return!0}get grabbing(){return this._grabbing}set grabbing(e){e!==this._grabbing&&(this._grabbing=e,this._setFocused(this._hovering||this._grabbing),this._updateEngineObject())}get hovering(){return this._hovering}set hovering(e){e!==this._hovering&&(this._hovering=e,this._setFocused(this._hovering||this._grabbing),this._updateEngineObject())}get selected(){return this._selected}set selected(e){e!==this._selected&&(this._selected=e,this._updateEngineObject(),this.events.emit("select-changed",{action:e?"select":"deselect"}))}get state(){return this._state}set state(e){e!==this._state&&(this._state=e,this._updateEngineObject())}updateStateEnabled(e,t){t?this.state|=e:this.state&=~e}_setFocused(e){e!==this._focused&&(this._focused=e,this.events.emit("focus-changed",{action:!0===e?"focus":"unfocus"}))}get focused(){return this._focused}get screenLocation(){return this._ensureScreenLocation(),this._screenLocation}_ensureScreenLocation(){if(!this._screenLocationDirty)return;this._screenLocation.pixelSize=this._camera.computeScreenPixelSizeAt(this.renderLocation),this._screenLocationDirty=!1;let e;if(te(this._modelTransform)){const t=this._calculateModelTransformOffset(me);e=p(t,t,this.renderLocation)}else e=this.renderLocation;this._camera.projectToRenderScreen(e,this._screenLocation.renderScreenPointArray),this._camera.renderToScreen(this._screenLocation.renderScreenPointArray,this._screenLocation.screenPointArray)}get applyObjectTransform(){return this._applyObjectTransform}set applyObjectTransform(e){this._applyObjectTransform=e,this._screenLocationDirty=!0,this._updateEngineObject()}get attached(){return this._attached}intersectionDistance(t,i){if(!this.available)return null;const s=a(t,se),o=this._getCollisionRadius(i),r=-1*this.collisionPriority;switch(this.collisionType.type){case"point":if(f(this.screenLocation.screenPointArray,s)<o*o)return this.screenLocation.renderScreenPointArray[2]+r;break;case"line":{const e=this.collisionType.paths,t=this._getWorldToScreenObjectScale(),i=this._calculateObjectTransform(t,ce),n=o*this.screenLocation.pixelSize,a=Y(this._camera,s,re);if(null==a)return null;for(const s of e){if(0===s.length)continue;const e=v(he,s[0],i);for(let t=1;t<s.length;t++){const o=v(de,s[t],i),l=M(x(e,o,oe),a);if(null!=l&&l<n*n){const t=p(N.get(),e,o);y(t,t,.5);const i=c(N.get());return this._camera.projectToRenderScreen(t,i),i[2]+r}j(e,o)}}break}case"disc":{const e=this.collisionType.direction,t=this.collisionType.offset??w,i=this._getWorldToScreenObjectScale(),n=this._calculateObjectTransform(i,ce),a=o*this.screenLocation.pixelSize,c=Y(this._camera,s,re);if(null==c)return null;const h=l(ne,n),d=b(ue,e,h),_=v(ge,t,n);U(_,d,le);const u=_e;if(W(le,c,u)&&L(u,_)<a*a)return this.screenLocation.renderScreenPointArray[2]+r;break}case"ribbon":{const{paths:e,direction:t}=this.collisionType,i=this._getWorldToScreenObjectScale(),n=this._calculateObjectTransform(i,ce),a=o*this._camera.computeScreenPixelSizeAt(this.renderLocation),h=Y(this._camera,s,re);if(null==h)return null;const d=l(ne,n),_=b(ue,t,d),u=this._calculateModelTransformPosition(ge);U(u,_,le);const g=_e;if(!W(le,h,g))break;for(const s of e){if(0===s.length)continue;const e=v(he,s[0],n);for(let t=1;t<s.length;t++){const i=v(de,s[t],n),o=I(x(e,i,oe),g);if(null!=o&&o<a*a){const t=p(N.get(),e,i);y(t,t,.5);const s=c(N.get());return this._camera.projectToRenderScreen(t,s),s[2]+r}j(e,i)}}break}default:e(this.collisionType)}return null}attach(e={manipulator3D:{}}){const t=this._stage;if(!t)return;const i=e.manipulator3D;null==i.engineLayerId?(this._engineLayer=new X(t,{pickable:!1,updatePolicy:Q.SYNC}),i.engineLayerId=this._engineLayer.id):t?.getObject&&(this._engineLayer=t.getObject(i.engineLayerId)),i.engineLayerReferences=(i.engineLayerReferences||0)+1,this._materialIdReferences=i.materialIdReferences,null==this._materialIdReferences&&(this._materialIdReferences=new Map,i.materialIdReferences=this._materialIdReferences),this._camera.copyFrom(this.view.state.camera),this._attached=!0,this._updateEngineObject(),E(this._location.spatialReference,this.view.spatialReference)||(this.location=new A({x:0,y:0,z:0,spatialReference:this.view.spatialReference}))}detach(e={manipulator3D:{}}){const t=e.manipulator3D;t.engineLayerReferences--;const i=0===t.engineLayerReferences;this._removeResourcesFromStage(),i&&(t.engineLayerId=null,o(this._engineLayer)),this._engineResources=null,this._engineLayer=null,this._materialIdReferences=null,this._attached=!1}onViewChange(){this._camera.copyFrom(this.view.state.camera),this._screenLocationDirty=!0,this._updateEngineObject()}onElevationChange(e){D(this.location,fe,e.spatialReference)&&P(e.extent,fe)&&this._notifyLocationChanged()}_evaluateElevationAlignment(){if(null==this.elevationInfo)return;let e=null,t=0;const i=G(this.elevationInfo,this.location.spatialReference??this.view.elevationProvider.spatialReference);switch(this.elevationInfo.mode){case"on-the-ground":e=V(this.view.elevationProvider,this.location,"ground")??0;break;case"relative-to-ground":t=(V(this.view.elevationProvider,this.location,"ground")??0)+i;break;case"relative-to-scene":t=(V(this.view.elevationProvider,this.location,"scene")??0)+i;break;case"absolute-height":t=i}return t!==this._elevation.offset||e!==this._elevation.override?(this._elevation.offset=t,void(this._elevation.override=e)):void 0}_updateEngineObject(){if(!this._attached)return;if(!this.available)return void this._removeResourcesFromStage();const e=this._getWorldToScreenObjectScale(),t=ce;if(!0===this.autoScaleRenderObjects){const i=this._getFocusedSize(this._radius,this.focused)*e;this._calculateObjectTransform(i,t)}else this._calculateObjectTransform(e,t);const{objectsByState:i}=this._ensureEngineResources(),s=(this.focused?$.Focused:$.Unfocused)|(this.selected?$.Selected:$.Unselected),o=this._noDisplayCount>0;for(const{stateMask:r,objects:n}of i){if(o){for(const e of n)e.visible=!1;continue}const e=(r&$.All)!==$.None,i=(r&Z.All)!==Z.None,a=!e||(s&r)==(r&$.All),c=!i||(this.state&r)==(r&Z.All);if(a&&c)for(const s of n)s.visible=!0,s.transformation=t;else for(const t of n)t.visible=!1}}_ensureEngineResources(){if(null==this._engineResources){const e=this._engineLayer,t=[],i=new Set;this.renderObjects.forEach((({geometry:{material:e}})=>{i.has(e)||(t.push(e),i.add(e))}));const s=new Map;this._renderObjects.forEach((e=>{const t=new K({castShadow:!1,geometries:[e.geometry]}),i=s.get(e.stateMask)||[];i.push(t),s.set(e.stateMask,i)}));const o=[];s.forEach(((e,t)=>o.push({stateMask:t,objects:e}))),this._engineResources={objectsByState:o,layer:e,materials:t}}return this._addResourcesToStage(),this._engineResources}_addResourcesToStage(){const e=this._stage;if(this._engineResourcesAddedToStage||null==this._engineResources||!e)return;const{objectsByState:t,layer:i,materials:s}=this._engineResources;s.forEach((t=>{const i=this._materialIdReferences,s=i.get(t.id)||0;0===s&&e.add(t),i.set(t.id,s+1)})),t.forEach((({objects:t})=>{i.addMany(t),e.addMany(t)})),this._engineResourcesAddedToStage=!0}_removeResourcesFromStage(){const e=this._stage;if(!this._engineResourcesAddedToStage||null==this._engineResources||!e)return;const{objectsByState:t,layer:i,materials:s}=this._engineResources;t.forEach((({objects:t})=>{i.removeMany(t),e.removeMany(t)})),s.forEach((t=>{const i=this._materialIdReferences,s=i.get(t.id);1===s?(e.remove(t),i.delete(t.id)):i.set(t.id,s-1)})),this._engineResourcesAddedToStage=!1}_getCollisionRadius(e){return this._getFocusedSize(this.radius,!0)*("touch"===e?this.touchMultiplier:1)}_getFocusedSize(e,t){return e*(t?this.focusMultiplier:1)}_getWorldToScreenObjectScale(){return this._worldSized?1:this.screenLocation.pixelSize}_calculateModelTransformPosition(e){const t=this._getWorldToScreenObjectScale(),i=this._calculateObjectTransform(t,ae);return S(e,i[12],i[13],i[14])}_calculateModelTransformOffset(e){const t=this._calculateModelTransformPosition(e);return R(e,t,this.renderLocation)}_calculateObjectTransform(e,t){return _(t,e,0,0,0,0,e,0,0,0,0,e,0,0,0,0,1),this._worldFrame&&u(t,t,this._worldFrame),u(t,t,this._modelTransform),t[12]+=this.renderLocation[0],t[13]+=this.renderLocation[1],t[14]+=this.renderLocation[2],t[15]=1,null!=this._applyObjectTransform&&this._applyObjectTransform(t),t}get test(){}}function te(e){return 0!==e[12]||0!==e[13]||0!==e[14]}function ie(e,t,i){switch(e.viewingMode){case"local":return g(i),!0;case"global":{const o=T(e.renderCoordsHelper.spatialReference);return z(t,0,he,0,o.radius),F(s(he[0]),s(he[1]),i),!0}}}const se=r(),oe=C(),re=B(),ne=h(),ae=m(),ce=m(),le=k(),he=O(),de=O(),_e=O(),ue=O(),ge=O(),me=O(),fe=new A({x:0,y:0,z:0,spatialReference:null}),pe=()=>{};export{ee as Manipulator3D};
5
+ import{neverReached as e}from"../../../core/compilerUtils.js";import t from"../../../core/Evented.js";import{makeHandle as i}from"../../../core/handleUtils.js";import"../../../core/has.js";import{deg2rad as s}from"../../../core/mathUtils.js";import{destroyMaybe as o}from"../../../core/maybe.js";import{createScreenPointArray as n,createRenderScreenPointArray3 as r,screenPointObjectToArray as a,castRenderScreenPointArray as c}from"../../../core/screenUtils.js";import{fromMat4 as l}from"../../../core/libs/gl-matrix-2/math/mat3.js";import{create as h}from"../../../core/libs/gl-matrix-2/factories/mat3f64.js";import{copy as d,set as _,multiply as u,identity as g}from"../../../core/libs/gl-matrix-2/math/mat4.js";import{create as m}from"../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{squaredDistance as f}from"../../../core/libs/gl-matrix-2/math/vec2.js";import{g as p,q as b,t as v,h as y,c as j,s as L,i as S,d as O}from"../../../chunks/vec32.js";import{create as w,ZEROS as R}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{getReferenceEllipsoid as T}from"../../../geometry/ellipsoidUtils.js";import A from"../../../geometry/Point.js";import{canProjectWithoutEngine as E,projectPoint as D}from"../../../geometry/projection.js";import{computeENUToPCPFLocalRotation as F}from"../../../geometry/projection/localRotationUtils.js";import{sphericalPCPFtoLonLatElevation as z}from"../../../geometry/projection/projectors.js";import{containsPointObject as P}from"../../../geometry/support/aaBoundingRect.js";import{create as C,distance2 as x,fromPoints as M,closestRayDistance2 as k}from"../../../geometry/support/lineSegment.js";import{create as I,fromPositionAndNormal as U,intersectRay as W}from"../../../geometry/support/plane.js";import{create as B}from"../../../geometry/support/ray.js";import{sv3d as N}from"../../../geometry/support/vectorStacks.js";import{clonePoint as H,hydratedSpatialReference as q}from"../../../layers/graphics/hydratedFeatures.js";import{getElevationOffset as G}from"../../../support/elevationInfoUtils.js";import{getElevationAtPoint as V}from"../support/ElevationProvider.js";import{fromScreen as Y}from"../support/geometryUtils/ray.js";import J from"../webgl/RenderCamera.js";import{Object3D as K}from"../webgl-engine/lib/Object3D.js";import{UpdatePolicy as Q}from"../webgl-engine/lib/UpdatePolicy.js";import{WebGLLayer as X}from"../webgl-engine/lib/WebGLLayer.js";import{ManipulatorStateCustomFlags as Z,ManipulatorStateFlags as $}from"../../interactive/interfaces.js";class ee{constructor(e){this.metadata=void 0,this._camera=new J,this._elevation={offset:0,override:null},this.collisionType={type:"point"},this.collisionPriority=0,this._renderObjects=new Array,this.autoScaleRenderObjects=!0,this._available=!0,this._noDisplayCount=0,this._radius=10,this._worldSized=!1,this.focusMultiplier=2,this.touchMultiplier=2.5,this.worldOriented=!1,this._modelTransform=m(),this._worldFrame=null,this._renderLocation=w(),this._renderLocationDirty=!0,this._location=new A({x:0,y:0,z:0}),this._elevationAlignedLocation=new A,this._elevationAlignedLocationDirty=!0,this.interactive=!0,this.selectable=!1,this.grabbable=!0,this.consumesClicks=!0,this.cursor=null,this.grabCursor=null,this._grabbing=!1,this.dragging=!1,this._hovering=!1,this._selected=!1,this._state=Z.None,this._focused=!1,this.events=new t.EventEmitter,this._screenLocation={screenPointArray:n(),renderScreenPointArray:r(),pixelSize:0},this._screenLocationDirty=!0,this._engineResourcesAddedToStage=!1,this._attached=!1,this._location.spatialReference=e.view.spatialReference,Object.assign(this,e);const i=this.view.state?.camera;i&&this._camera.copyFrom(i)}destroy(){this._applyObjectTransform=pe,this._removeResourcesFromStage(),this._engineResources=null,this.view=null,this._camera=null}get _stage(){return this.view?.stage}get elevationInfo(){return this._elevationInfo}set elevationInfo(e){this._elevationInfo=e,this._elevationAlignedLocationDirty=!0,this._renderLocationDirty=!0,this._updateEngineObject()}get renderObjects(){return this._renderObjects}set renderObjects(e){this._removeResourcesFromStage(),this._engineResources=null,this._renderObjects=e.slice(),this._updateEngineObject()}set available(e){e!==this._available&&(this._available=e,this._updateEngineObject())}get available(){return this._available}disableDisplay(){return this._noDisplayCount++,1===this._noDisplayCount&&this._updateEngineObject(),i((()=>{this._noDisplayCount--,0===this._noDisplayCount&&this._updateEngineObject()}))}set radius(e){e!==this._radius&&(this._radius=e,this._updateEngineObject())}get radius(){return this._radius}set worldSized(e){e!==this._worldSized&&(this._worldSized=e,this._updateEngineObject())}get worldSized(){return this._worldSized}get modelTransform(){return this._modelTransform}set modelTransform(e){te(e)&&(this._screenLocationDirty=!0),d(this._modelTransform,e),this._updateEngineObject()}get renderLocation(){return this._renderLocationDirty&&(this._renderLocationDirty=!1,this.view.renderCoordsHelper.toRenderCoords(this.elevationAlignedLocation,this._renderLocation),this.worldOriented?(this._worldFrame||(this._worldFrame=m()),ie(this.view,this._renderLocation,this._worldFrame)):this._worldFrame&&(this._worldFrame=null)),this._renderLocation}set renderLocation(e){this.view.renderCoordsHelper.fromRenderCoords(e,this._location),this.elevationAlignedLocation=this._location}get location(){return this._location}set location(e){H(e,this._location),this._notifyLocationChanged()}_notifyLocationChanged(){this._renderLocationDirty=!0,this._screenLocationDirty=!0,this._elevationAlignedLocationDirty=!0,this._updateEngineObject(),this.events.emit("location-update",{location:this._location})}get elevationAlignedLocation(){return this._elevationAlignedLocationDirty?(this._evaluateElevationAlignment(),this._updateElevationAlignedLocation(),this._elevationAlignedLocation):this._elevationAlignedLocation}set elevationAlignedLocation(e){H(e,this._location),this._evaluateElevationAlignment(),this._location.z-=this._elevation.offset,this._updateElevationAlignedLocation(),this._updateEngineObject(),this.events.emit("location-update",{location:this._location})}_updateElevationAlignedLocation(){const e=null!=this._elevation.override?this._elevation.override:this.location.z||0;this._elevationAlignedLocation.x=this.location.x,this._elevationAlignedLocation.y=this.location.y,this._elevationAlignedLocation.z=e+this._elevation.offset,this._elevationAlignedLocation.spatialReference=q(this.location.spatialReference),this._renderLocationDirty=!0,this._screenLocationDirty=!0,this._elevationAlignedLocationDirty=!1}grabbableForEvent(){return!0}get grabbing(){return this._grabbing}set grabbing(e){e!==this._grabbing&&(this._grabbing=e,this._setFocused(this._hovering||this._grabbing),this._updateEngineObject())}get hovering(){return this._hovering}set hovering(e){e!==this._hovering&&(this._hovering=e,this._setFocused(this._hovering||this._grabbing),this._updateEngineObject())}get selected(){return this._selected}set selected(e){e!==this._selected&&(this._selected=e,this._updateEngineObject(),this.events.emit("select-changed",{action:e?"select":"deselect"}))}get state(){return this._state}set state(e){e!==this._state&&(this._state=e,this._updateEngineObject())}updateStateEnabled(e,t){t?this.state|=e:this.state&=~e}_setFocused(e){e!==this._focused&&(this._focused=e,this.events.emit("focus-changed",{action:!0===e?"focus":"unfocus"}))}get focused(){return this._focused}get screenLocation(){return this._ensureScreenLocation(),this._screenLocation}_ensureScreenLocation(){if(!this._screenLocationDirty)return;this._screenLocation.pixelSize=this._camera.computeScreenPixelSizeAt(this.renderLocation),this._screenLocationDirty=!1;let e;if(te(this._modelTransform)){const t=this._calculateModelTransformOffset(me);e=p(t,t,this.renderLocation)}else e=this.renderLocation;this._camera.projectToRenderScreen(e,this._screenLocation.renderScreenPointArray),this._camera.renderToScreen(this._screenLocation.renderScreenPointArray,this._screenLocation.screenPointArray)}get applyObjectTransform(){return this._applyObjectTransform}set applyObjectTransform(e){this._applyObjectTransform=e,this._screenLocationDirty=!0,this._updateEngineObject()}get attached(){return this._attached}intersectionDistance(t,i){if(!this.available)return null;const s=a(t,se),o=this._getCollisionRadius(i),n=-1*this.collisionPriority;switch(this.collisionType.type){case"point":if(f(this.screenLocation.screenPointArray,s)<o*o)return this.screenLocation.renderScreenPointArray[2]+n;break;case"line":{const e=this.collisionType.paths,t=this._getWorldToScreenObjectScale(),i=this._calculateObjectTransform(t,ce),r=o*this.screenLocation.pixelSize,a=Y(this._camera,s,ne);if(null==a)return null;for(const s of e){if(0===s.length)continue;const e=v(he,s[0],i);for(let t=1;t<s.length;t++){const o=v(de,s[t],i),l=k(M(e,o,oe),a);if(null!=l&&l<r*r){const t=p(N.get(),e,o);y(t,t,.5);const i=c(N.get());return this._camera.projectToRenderScreen(t,i),i[2]+n}j(e,o)}}break}case"disc":{const e=this.collisionType.direction,t=this.collisionType.offset??R,i=this._getWorldToScreenObjectScale(),r=this._calculateObjectTransform(i,ce),a=o*this.screenLocation.pixelSize,c=Y(this._camera,s,ne);if(null==c)return null;const h=l(re,r),d=b(ue,e,h),_=v(ge,t,r);U(_,d,le);const u=_e;if(W(le,c,u)&&L(u,_)<a*a)return this.screenLocation.renderScreenPointArray[2]+n;break}case"ribbon":{const{paths:e,direction:t}=this.collisionType,i=this._getWorldToScreenObjectScale(),r=this._calculateObjectTransform(i,ce),a=o*this._camera.computeScreenPixelSizeAt(this.renderLocation),h=Y(this._camera,s,ne);if(null==h)return null;const d=l(re,r),_=b(ue,t,d),u=this._calculateModelTransformPosition(ge);U(u,_,le);const g=_e;if(!W(le,h,g))break;for(const s of e){if(0===s.length)continue;const e=v(he,s[0],r);for(let t=1;t<s.length;t++){const i=v(de,s[t],r),o=x(M(e,i,oe),g);if(null!=o&&o<a*a){const t=p(N.get(),e,i);y(t,t,.5);const s=c(N.get());return this._camera.projectToRenderScreen(t,s),s[2]+n}j(e,i)}}break}default:e(this.collisionType)}return null}attach(e={manipulator3D:{}}){const t=this._stage;if(!t)return;const i=e.manipulator3D;null==i.engineLayerId?(this._engineLayer=new X(t,{pickable:!1,updatePolicy:Q.SYNC}),i.engineLayerId=this._engineLayer.id):t?.getObject&&(this._engineLayer=t.getObject(i.engineLayerId)),i.engineLayerReferences=(i.engineLayerReferences||0)+1,this._camera.copyFrom(this.view.state.camera),this._attached=!0,this._updateEngineObject(),E(this._location.spatialReference,this.view.spatialReference)||(this.location=new A({x:0,y:0,z:0,spatialReference:this.view.spatialReference}))}detach(e={manipulator3D:{}}){const t=e.manipulator3D;t.engineLayerReferences--;const i=0===t.engineLayerReferences;this._removeResourcesFromStage(),i&&(t.engineLayerId=null,o(this._engineLayer)),this._engineResources=null,this._engineLayer=null,this._attached=!1}onViewChange(){this._camera.copyFrom(this.view.state.camera),this._screenLocationDirty=!0,this._updateEngineObject()}onElevationChange(e){D(this.location,fe,e.spatialReference)&&P(e.extent,fe)&&this._notifyLocationChanged()}_evaluateElevationAlignment(){if(null==this.elevationInfo)return;let e=null,t=0;const i=G(this.elevationInfo,this.location.spatialReference??this.view.elevationProvider.spatialReference);switch(this.elevationInfo.mode){case"on-the-ground":e=V(this.view.elevationProvider,this.location,"ground")??0;break;case"relative-to-ground":t=(V(this.view.elevationProvider,this.location,"ground")??0)+i;break;case"relative-to-scene":t=(V(this.view.elevationProvider,this.location,"scene")??0)+i;break;case"absolute-height":t=i}return t!==this._elevation.offset||e!==this._elevation.override?(this._elevation.offset=t,void(this._elevation.override=e)):void 0}_updateEngineObject(){if(!this._attached)return;if(!this.available)return void this._removeResourcesFromStage();const e=this._getWorldToScreenObjectScale(),t=ce;if(!0===this.autoScaleRenderObjects){const i=this._getFocusedSize(this._radius,this.focused)*e;this._calculateObjectTransform(i,t)}else this._calculateObjectTransform(e,t);const{objectsByState:i}=this._ensureEngineResources(),s=(this.focused?$.Focused:$.Unfocused)|(this.selected?$.Selected:$.Unselected),o=this._noDisplayCount>0;for(const{stateMask:n,objects:r}of i){if(o){for(const e of r)e.visible=!1;continue}const e=(n&$.All)!==$.None,i=(n&Z.All)!==Z.None,a=!e||(s&n)==(n&$.All),c=!i||(this.state&n)==(n&Z.All);if(a&&c)for(const s of r)s.visible=!0,s.transformation=t;else for(const t of r)t.visible=!1}}_ensureEngineResources(){if(null==this._engineResources){const e=this._engineLayer,t=[],i=new Set;this.renderObjects.forEach((({geometry:{material:e}})=>{i.has(e)||(t.push(e),i.add(e))}));const s=new Map;this._renderObjects.forEach((e=>{const t=new K({castShadow:!1,geometries:[e.geometry]}),i=s.get(e.stateMask)||[];i.push(t),s.set(e.stateMask,i)}));const o=[];s.forEach(((e,t)=>o.push({stateMask:t,objects:e}))),this._engineResources={objectsByState:o,layer:e,materials:t}}return this._addResourcesToStage(),this._engineResources}_addResourcesToStage(){const e=this._stage;if(this._engineResourcesAddedToStage||null==this._engineResources||!e)return;const{objectsByState:t,layer:i}=this._engineResources;t.forEach((({objects:t})=>{i.addMany(t),e.addMany(t)})),this._engineResourcesAddedToStage=!0}_removeResourcesFromStage(){const e=this._stage;if(!this._engineResourcesAddedToStage||null==this._engineResources||!e)return;const{objectsByState:t,layer:i}=this._engineResources;t.forEach((({objects:t})=>{i.removeMany(t),e.removeMany(t)})),this._engineResourcesAddedToStage=!1}_getCollisionRadius(e){return this._getFocusedSize(this.radius,!0)*("touch"===e?this.touchMultiplier:1)}_getFocusedSize(e,t){return e*(t?this.focusMultiplier:1)}_getWorldToScreenObjectScale(){return this._worldSized?1:this.screenLocation.pixelSize}_calculateModelTransformPosition(e){const t=this._getWorldToScreenObjectScale(),i=this._calculateObjectTransform(t,ae);return S(e,i[12],i[13],i[14])}_calculateModelTransformOffset(e){const t=this._calculateModelTransformPosition(e);return O(e,t,this.renderLocation)}_calculateObjectTransform(e,t){return _(t,e,0,0,0,0,e,0,0,0,0,e,0,0,0,0,1),this._worldFrame&&u(t,t,this._worldFrame),u(t,t,this._modelTransform),t[12]+=this.renderLocation[0],t[13]+=this.renderLocation[1],t[14]+=this.renderLocation[2],t[15]=1,null!=this._applyObjectTransform&&this._applyObjectTransform(t),t}get test(){}}function te(e){return 0!==e[12]||0!==e[13]||0!==e[14]}function ie(e,t,i){switch(e.viewingMode){case"local":return g(i),!0;case"global":{const o=T(e.renderCoordsHelper.spatialReference);return z(t,0,he,0,o.radius),F(s(he[0]),s(he[1]),i),!0}}}const se=n(),oe=C(),ne=B(),re=h(),ae=m(),ce=m(),le=I(),he=w(),de=w(),_e=w(),ue=w(),ge=w(),me=w(),fe=new A({x:0,y:0,z:0,spatialReference:null}),pe=()=>{};export{ee as Manipulator3D};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import"../../../../core/has.js";import{c as e,d as t,p as r,v as i}from"../../../../chunks/vec32.js";import{create as s,fromValues as n}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{a,c as o}from"../../../../chunks/vec42.js";import{fromValues as l,clone as h}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{create as d,fromRay as _,getStart as c,getEnd as p}from"../../../../geometry/support/clipRay.js";import{intersectClipRay as u}from"../../../../geometry/support/frustum.js";import{create as f,fromPoints as m,pointAt as y}from"../../../../geometry/support/lineSegment.js";import{create as g,fromPoints as b}from"../../../../geometry/support/ray.js";import{EngineVisualElement as D}from"./EngineVisualElement.js";import{LaserlineVisualElement as O}from"./LaserlineVisualElement.js";import{drapedZ as w}from"../../terrain/OverlayRenderer.js";import{createPolylineGeometry as E}from"../../webgl-engine/lib/GeometryUtil.js";import{RenderOccludedFlag as A}from"../../webgl-engine/lib/Material.js";import{RenderGeometry as j}from"../../webgl-engine/lib/RenderGeometry.js";import{VertexAttribute as R}from"../../webgl-engine/lib/VertexAttribute.js";import{RibbonLineMaterial as C}from"../../webgl-engine/materials/RibbonLineMaterial.js";class G extends D{constructor(e){super(e),this._ray=g(),this._isWorldDown=!1,this._start=s(),this._end=n(1,0,0),this._width=1,this._color=l(1,0,1,1),this._polygonOffset=!1,this._writeDepthEnabled=!0,this._innerWidth=0,this._innerColor=l(1,1,1,1),this._stipplePattern=null,this._stippleOffColor=null,this._stipplePreferContinuous=!0,this._falloff=0,this._extensionType=M.LINE,this._laserlineStyle=null,this._laserlineEnabled=!1,this._renderOccluded=A.OccludeAndTransparent,this._fadedExtensions=L,this._laserline=new O({view:this.view,isDecoration:e.isDecoration}),this.applyProperties(e)}destroy(){this._laserline.destroy(),super.destroy()}createObject3DResourceFactory(e){return{view:e,createResources:e=>this._createObject3DResources(e),destroyResources:P,recreateGeometry:(e,t)=>this._recreateObject3DGeometry(e,t),cameraChanged:()=>this._updateGeometry()}}createDrapedResourceFactory(e){return{view:e,createResources:()=>this._createDrapedResources(),destroyResources:P,recreateGeometry:e=>this._recreateDrapedGeometry(e)}}updateVisibility(e){super.updateVisibility(e),this._laserline.visible=e}onAttachedChange(){this._laserline.attached=this._laserlineAttached}setStartEndFromWorldDownAtLocation(r){this._isWorldDown=!0,e(this._start,r),this.view.renderCoordsHelper.worldUpAtPosition(r,this._end),t(this._end,r,this._end),b(this._start,this._end,this._ray),this._updateGeometry()}get start(){return this._start}set start(t){this._isWorldDown=!1,r(this._start,t)||(e(this._start,t),b(this._start,this._end,this._ray),this._updateGeometry())}get end(){return this._end}set end(t){this._isWorldDown=!1,r(this._end,t)||(e(this._end,t),b(this._start,this._end,this._ray),this._updateGeometry())}get width(){return this._width}set width(e){e!==this._width&&(this._width=e,this._updateMaterial())}get color(){return this._color}set color(e){a(e,this._color)||(o(this._color,e),this._updateMaterial())}get polygonOffset(){return this._polygonOffset}set polygonOffset(e){e!==this._polygonOffset&&(this._polygonOffset=e,this._updateMaterial())}get writeDepthEnabled(){return this._writeDepthEnabled}set writeDepthEnabled(e){this._writeDepthEnabled!==e&&(this._writeDepthEnabled=e,this._updateMaterial())}get innerWidth(){return this._innerWidth}set innerWidth(e){e!==this._innerWidth&&(this._innerWidth=e,this._updateMaterial())}get innerColor(){return this._innerColor}set innerColor(e){a(e,this._innerColor)||(o(this._innerColor,e),this._updateMaterial())}get stipplePattern(){return this._stipplePattern}set stipplePattern(e){const t=null!=e!=(null!=this._stipplePattern);this._stipplePattern=e,t?this.recreate():this._updateMaterial()}get stippleOffColor(){return this._stippleOffColor}set stippleOffColor(e){null!=e&&null!=this._stippleOffColor&&a(e,this._stippleOffColor)||(this._stippleOffColor=null!=e?h(e):null,this._updateMaterial())}get stipplePreferContinuous(){return this._stipplePreferContinuous}set stipplePreferContinuous(e){e!==this._stipplePreferContinuous&&(this._stipplePreferContinuous=e,this._updateMaterial())}get falloff(){return this._falloff}set falloff(e){e!==this._falloff&&(this._falloff=e,this._updateMaterial())}get extensionType(){return this._extensionType}set extensionType(e){e!==this._extensionType&&(this._extensionType=e,this.recreateGeometry())}get _laserlineAttached(){return this._laserlineEnabled&&null!=this._laserlineStyle&&this.attached&&!this.isDraped}get laserlineStyle(){return this._laserlineStyle}set laserlineStyle(e){this._laserlineStyle=e,this._laserline.attached=this._laserlineAttached,null!=e&&(this._laserline.style=e)}get laserlineEnabled(){return this._laserlineEnabled}set laserlineEnabled(e){this._laserlineEnabled!==e&&(this._laserlineEnabled=e,this._laserline.attached=this._laserlineAttached)}get renderOccluded(){return this._renderOccluded}set renderOccluded(e){e!==this._renderOccluded&&(this._renderOccluded=e,this._updateMaterial())}get _normalizedRenderOccluded(){return this.isDraped&&this._renderOccluded===A.OccludeAndTransparentStencil?A.OccludeAndTransparent:this._renderOccluded}get fadedExtensions(){return this._fadedExtensions}set fadedExtensions(e){this._fadedExtensions=e??L,this.recreateGeometry()}_updateMaterial(){const{materialParameters:e}=this;this.object3dResources.resources?.material.setParameters(e),this.drapedResources.resources?.material.setParameters(e)}get materialParameters(){return{width:this._width,color:this._color,stippleOffColor:this._stippleOffColor,stipplePattern:this._stipplePattern,stipplePreferContinuous:this._stipplePreferContinuous,innerWidth:this._innerWidth,innerColor:this._innerColor,falloff:this._falloff,hasPolygonOffset:this._polygonOffset,renderOccluded:this._normalizedRenderOccluded,isDecoration:this.isDecoration,writeDepth:this._writeDepthEnabled}}_createObject3DResources(e){const t=new C(this.materialParameters),r=new Array;return this._createObject3DGeometry(t,e,r),{material:t,geometries:r,forEach:e=>{e(t),r.forEach(e)}}}_recreateObject3DGeometry(e,t){e.geometries.length=0,this._createObject3DGeometry(e.material,t,e.geometries)}_createObject3DGeometry(e,t,r){const i=this._createGeometry(e);r.push(i),t.addGeometry(i),this._updateVerticesObject3D(t)}_createDrapedResources(){const e=new C(this.materialParameters);return{material:e,geometries:[this._createDrapedGeometry(e)]}}_recreateDrapedGeometry(e){e.geometries=[this._createDrapedGeometry(e.material)]}_createDrapedGeometry(e){const t=this._createGeometry(e);return this._updateVerticesDraped(t),new j(t)}_createGeometry(e){const t=this.extensionType===M.FADED,r=t?[s(),s(),s(),s()]:[s(),s()];return E(e,r,null,t?[1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,0]:null)}_updateGeometry(){if(this.isDraped)this.drapedResources.recreateGeometry();else{const e=this.object3dResources.object;e&&this._updateVerticesObject3D(e)}}_updateVerticesObject3D(e){const t=this._lineSegment;this._updateVertexAttributesObject3D(e,t),this._laserline.intersectsLine=t}_updateVerticesDraped(e){this._updateVertexAttributesDraped(e,this._lineSegment)}get _lineSegment(){return this._extensionType===M.FADED?this._updateLineSegmentFinite(V):this._updateLineSegmentInfinite(this._extensionType,V)}_updateLineSegmentFinite(e){return m(this._start,this._end,e)}_updateLineSegmentInfinite(e,t){const r=this.view.state.camera;switch(_(this._ray,x),e){case M.LINE:x.c0=-Number.MAX_VALUE;break;case M.RAY:case M.GROUND_RAY:{const e=this._ray.origin,t=this.view.elevationProvider.getElevation(e[0],e[1],e[2],this.view.renderCoordsHelper.spatialReference,"ground")??0,r=this.view.renderCoordsHelper.getAltitude(e);this._isWorldDown&&r<t&&i(x.ray.direction,x.ray.direction),this._extensionType===M.GROUND_RAY&&null!=t&&(x.c1=Math.abs(r-t));break}}if(!u(r.frustum,x))return this._updateLineSegmentFinite(t);const s=c(x,v),n=p(x,S);return m(s,n,t)}_updateVertexAttributesObject3D(e,t){const r=e.geometries[0].getMutableAttribute(R.POSITION)?.data;if(!r)return;let i=0;for(const s of this._lineVertices(t))r[i++]=s[0],r[i++]=s[1],r[i++]=s[2];e.geometryVertexAttributeUpdated(e.geometries[0],R.POSITION)}_updateVertexAttributesDraped(e,t){const r=e.getMutableAttribute(R.POSITION)?.data;if(!r)return;let i=0;for(const s of this._lineVertices(t))r[i++]=s[0],r[i++]=s[1],r[i++]=w;e.invalidateBoundingInfo()}*_lineVertices(e){this.extensionType===M.FADED?(yield y(e,-this.fadedExtensions.start,v),yield y(e,0,v),yield y(e,1,v),yield y(e,1+this.fadedExtensions.end,v)):(yield y(e,0,v),yield y(e,1,v))}}function P(e){e.geometries=[]}const x=d(),v=s(),S=s(),V=f();var M;!function(e){e[e.LINE=0]="LINE",e[e.RAY=1]="RAY",e[e.GROUND_RAY=2]="GROUND_RAY",e[e.FADED=3]="FADED"}(M||(M={}));const T=1/3,L={start:T,end:T};export{G as ExtendedLineVisualElement,M as ExtensionType};
5
+ import"../../../../core/has.js";import{c as e,d as t,p as r,v as i}from"../../../../chunks/vec32.js";import{create as s,fromValues as n}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{a,c as o}from"../../../../chunks/vec42.js";import{fromValues as l,clone as h}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{create as d,fromRay as _,getStart as c,getEnd as p}from"../../../../geometry/support/clipRay.js";import{intersectClipRay as u}from"../../../../geometry/support/frustum.js";import{create as m,fromPoints as f,pointAt as y}from"../../../../geometry/support/lineSegment.js";import{create as g,fromPoints as b}from"../../../../geometry/support/ray.js";import{EngineVisualElement as D}from"./EngineVisualElement.js";import{LaserlineVisualElement as O}from"./LaserlineVisualElement.js";import{drapedZ as w}from"../../terrain/OverlayRenderer.js";import{createPolylineGeometry as E}from"../../webgl-engine/lib/GeometryUtil.js";import{RenderOccludedFlag as A}from"../../webgl-engine/lib/Material.js";import{RenderGeometry as j}from"../../webgl-engine/lib/RenderGeometry.js";import{VertexAttribute as R}from"../../webgl-engine/lib/VertexAttribute.js";import{RibbonLineMaterial as C}from"../../webgl-engine/materials/RibbonLineMaterial.js";class G extends D{constructor(e){super(e),this._ray=g(),this._isWorldDown=!1,this._start=s(),this._end=n(1,0,0),this._width=1,this._color=l(1,0,1,1),this._polygonOffset=!1,this._writeDepthEnabled=!0,this._innerWidth=0,this._innerColor=l(1,1,1,1),this._stipplePattern=null,this._stippleOffColor=null,this._stipplePreferContinuous=!0,this._falloff=0,this._extensionType=M.LINE,this._laserlineStyle=null,this._laserlineEnabled=!1,this._renderOccluded=A.OccludeAndTransparent,this._fadedExtensions=L,this._laserline=new O({view:this.view,isDecoration:e.isDecoration}),this.applyProperties(e)}destroy(){this._laserline.destroy(),super.destroy()}createObject3DResourceFactory(e){return{view:e,createResources:e=>this._createObject3DResources(e),destroyResources:P,recreateGeometry:(e,t)=>this._recreateObject3DGeometry(e,t),cameraChanged:()=>this._updateGeometry()}}createDrapedResourceFactory(e){return{view:e,createResources:()=>this._createDrapedResources(),destroyResources:P,recreateGeometry:e=>this._recreateDrapedGeometry(e)}}updateVisibility(e){super.updateVisibility(e),this._laserline.visible=e}onAttachedChange(){this._laserline.attached=this._laserlineAttached}setStartEndFromWorldDownAtLocation(r){this._isWorldDown=!0,e(this._start,r),this.view.renderCoordsHelper.worldUpAtPosition(r,this._end),t(this._end,r,this._end),b(this._start,this._end,this._ray),this._updateGeometry()}get start(){return this._start}set start(t){this._isWorldDown=!1,r(this._start,t)||(e(this._start,t),b(this._start,this._end,this._ray),this._updateGeometry())}get end(){return this._end}set end(t){this._isWorldDown=!1,r(this._end,t)||(e(this._end,t),b(this._start,this._end,this._ray),this._updateGeometry())}get width(){return this._width}set width(e){e!==this._width&&(this._width=e,this._updateMaterial())}get color(){return this._color}set color(e){a(e,this._color)||(o(this._color,e),this._updateMaterial())}get polygonOffset(){return this._polygonOffset}set polygonOffset(e){e!==this._polygonOffset&&(this._polygonOffset=e,this._updateMaterial())}get writeDepthEnabled(){return this._writeDepthEnabled}set writeDepthEnabled(e){this._writeDepthEnabled!==e&&(this._writeDepthEnabled=e,this._updateMaterial())}get innerWidth(){return this._innerWidth}set innerWidth(e){e!==this._innerWidth&&(this._innerWidth=e,this._updateMaterial())}get innerColor(){return this._innerColor}set innerColor(e){a(e,this._innerColor)||(o(this._innerColor,e),this._updateMaterial())}get stipplePattern(){return this._stipplePattern}set stipplePattern(e){const t=null!=e!=(null!=this._stipplePattern);this._stipplePattern=e,t?this.recreate():this._updateMaterial()}get stippleOffColor(){return this._stippleOffColor}set stippleOffColor(e){null!=e&&null!=this._stippleOffColor&&a(e,this._stippleOffColor)||(this._stippleOffColor=null!=e?h(e):null,this._updateMaterial())}get stipplePreferContinuous(){return this._stipplePreferContinuous}set stipplePreferContinuous(e){e!==this._stipplePreferContinuous&&(this._stipplePreferContinuous=e,this._updateMaterial())}get falloff(){return this._falloff}set falloff(e){e!==this._falloff&&(this._falloff=e,this._updateMaterial())}get extensionType(){return this._extensionType}set extensionType(e){e!==this._extensionType&&(this._extensionType=e,this.recreateGeometry())}get _laserlineAttached(){return this._laserlineEnabled&&null!=this._laserlineStyle&&this.attached&&!this.isDraped}get laserlineStyle(){return this._laserlineStyle}set laserlineStyle(e){this._laserlineStyle=e,this._laserline.attached=this._laserlineAttached,null!=e&&(this._laserline.style=e)}get laserlineEnabled(){return this._laserlineEnabled}set laserlineEnabled(e){this._laserlineEnabled!==e&&(this._laserlineEnabled=e,this._laserline.attached=this._laserlineAttached)}get renderOccluded(){return this._renderOccluded}set renderOccluded(e){e!==this._renderOccluded&&(this._renderOccluded=e,this._updateMaterial())}get _normalizedRenderOccluded(){return this.isDraped&&this._renderOccluded===A.OccludeAndTransparentStencil?A.OccludeAndTransparent:this._renderOccluded}get fadedExtensions(){return this._fadedExtensions}set fadedExtensions(e){this._fadedExtensions=e??L,this.recreateGeometry()}_updateMaterial(){const{materialParameters:e}=this;this.object3dResources.resources?.material.setParameters(e),this.drapedResources.resources?.material.setParameters(e)}get materialParameters(){return{width:this._width,color:this._color,stippleOffColor:this._stippleOffColor,stipplePattern:this._stipplePattern,stipplePreferContinuous:this._stipplePreferContinuous,innerWidth:this._innerWidth,innerColor:this._innerColor,falloff:this._falloff,hasPolygonOffset:this._polygonOffset,renderOccluded:this._normalizedRenderOccluded,isDecoration:this.isDecoration,writeDepth:this._writeDepthEnabled}}_createObject3DResources(e){const t=new C(this.materialParameters),r=new Array;return this._createObject3DGeometry(t,e,r),{material:t,geometries:r}}_recreateObject3DGeometry(e,t){e.geometries.length=0,this._createObject3DGeometry(e.material,t,e.geometries)}_createObject3DGeometry(e,t,r){const i=this._createGeometry(e);r.push(i),t.addGeometry(i),this._updateVerticesObject3D(t)}_createDrapedResources(){const e=new C(this.materialParameters);return{material:e,geometries:[this._createDrapedGeometry(e)]}}_recreateDrapedGeometry(e){e.geometries=[this._createDrapedGeometry(e.material)]}_createDrapedGeometry(e){const t=this._createGeometry(e);return this._updateVerticesDraped(t),new j(t)}_createGeometry(e){const t=this.extensionType===M.FADED,r=t?[s(),s(),s(),s()]:[s(),s()];return E(e,r,null,t?[1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,0]:null)}_updateGeometry(){if(this.isDraped)this.drapedResources.recreateGeometry();else{const e=this.object3dResources.object;e&&this._updateVerticesObject3D(e)}}_updateVerticesObject3D(e){const t=this._lineSegment;this._updateVertexAttributesObject3D(e,t),this._laserline.intersectsLine=t}_updateVerticesDraped(e){this._updateVertexAttributesDraped(e,this._lineSegment)}get _lineSegment(){return this._extensionType===M.FADED?this._updateLineSegmentFinite(V):this._updateLineSegmentInfinite(this._extensionType,V)}_updateLineSegmentFinite(e){return f(this._start,this._end,e)}_updateLineSegmentInfinite(e,t){const r=this.view.state.camera;switch(_(this._ray,x),e){case M.LINE:x.c0=-Number.MAX_VALUE;break;case M.RAY:case M.GROUND_RAY:{const e=this._ray.origin,t=this.view.elevationProvider.getElevation(e[0],e[1],e[2],this.view.renderCoordsHelper.spatialReference,"ground")??0,r=this.view.renderCoordsHelper.getAltitude(e);this._isWorldDown&&r<t&&i(x.ray.direction,x.ray.direction),this._extensionType===M.GROUND_RAY&&null!=t&&(x.c1=Math.abs(r-t));break}}if(!u(r.frustum,x))return this._updateLineSegmentFinite(t);const s=c(x,v),n=p(x,S);return f(s,n,t)}_updateVertexAttributesObject3D(e,t){const r=e.geometries[0].getMutableAttribute(R.POSITION)?.data;if(!r)return;let i=0;for(const s of this._lineVertices(t))r[i++]=s[0],r[i++]=s[1],r[i++]=s[2];e.geometryVertexAttributeUpdated(e.geometries[0],R.POSITION)}_updateVertexAttributesDraped(e,t){const r=e.getMutableAttribute(R.POSITION)?.data;if(!r)return;let i=0;for(const s of this._lineVertices(t))r[i++]=s[0],r[i++]=s[1],r[i++]=w;e.invalidateBoundingInfo()}*_lineVertices(e){this.extensionType===M.FADED?(yield y(e,-this.fadedExtensions.start,v),yield y(e,0,v),yield y(e,1,v),yield y(e,1+this.fadedExtensions.end,v)):(yield y(e,0,v),yield y(e,1,v))}}function P(e){e.geometries=[]}const x=d(),v=s(),S=s(),V=m();var M;!function(e){e[e.LINE=0]="LINE",e[e.RAY=1]="RAY",e[e.GROUND_RAY=2]="GROUND_RAY",e[e.FADED=3]="FADED"}(M||(M={}));const T=1/3,L={start:T,end:T};export{G as ExtendedLineVisualElement,M as ExtensionType};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{copy as e}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as s}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{VisualElement as r}from"./VisualElement.js";import{Object3D as t}from"../../webgl-engine/lib/Object3D.js";import{UpdatePolicy as i}from"../../webgl-engine/lib/UpdatePolicy.js";import{WebGLLayer as o}from"../../webgl-engine/lib/WebGLLayer.js";class a extends r{constructor(e){super(e),this._resources=null,this._transform=s()}get object(){return null!=this._resources?this._resources.object:null}get transform(){return this._transform}set transform(s){e(this._transform,s),null!=this._resources&&(this._resources.object.transformation=this._transform)}recreate(){this.attached&&this.createResources()}recreateGeometry(){if(null==this._resources)return;const e=this._resources.object,s=this.view.stage;s.removeMany(e.geometries),e.removeAllGeometries(),this.createGeometries(e),e.visible=this.visible,s.addMany(e.geometries)}createResources(){this.destroyResources();const e=this.view.stage;if(!e)return;const s=new o(e,{pickable:!1,updatePolicy:i.SYNC}),r=new t({castShadow:!1});r.transformation=this._transform,this.createExternalResources(),this.createGeometries(r),e.addMany(r.geometries),this.forEachExternalMaterial((s=>e.add(s))),e.add(r),s.add(r),r.visible=this.visible,this._resources={layer:s,object:r}}destroyResources(){const e=this.view.stage;null!=this._resources&&e&&(e.remove(this._resources.object),this._resources.layer.destroy(),this.forEachExternalMaterial((s=>{e.remove(s)})),e.removeMany(this._resources.object.geometries),this._resources.object.dispose(),this.destroyExternalResources(),this._resources=null)}updateVisibility(e){null!=this._resources&&(this._resources.object.visible=e)}}export{a as Object3DVisualElement};
5
+ import{copy as e}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as s}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{VisualElement as r}from"./VisualElement.js";import{Object3D as t}from"../../webgl-engine/lib/Object3D.js";import{UpdatePolicy as i}from"../../webgl-engine/lib/UpdatePolicy.js";import{WebGLLayer as o}from"../../webgl-engine/lib/WebGLLayer.js";class c extends r{constructor(e){super(e),this._resources=null,this._transform=s()}get object(){return null!=this._resources?this._resources.object:null}get transform(){return this._transform}set transform(s){e(this._transform,s),null!=this._resources&&(this._resources.object.transformation=this._transform)}recreate(){this.attached&&this.createResources()}recreateGeometry(){if(null==this._resources)return;const e=this._resources.object;e.removeAllGeometries(),this.createGeometries(e),e.visible=this.visible}createResources(){this.destroyResources();const e=this.view.stage;if(!e)return;const s=new o(e,{pickable:!1,updatePolicy:i.SYNC}),r=new t({castShadow:!1});r.transformation=this._transform,this.createExternalResources(),this.createGeometries(r),e.add(r),s.add(r),r.visible=this.visible,this._resources={layer:s,object:r}}destroyResources(){const e=this.view.stage;null!=this._resources&&e&&(e.remove(this._resources.object),this._resources.layer.destroy(),this._resources.object.dispose(),this.destroyExternalResources(),this._resources=null)}updateVisibility(e){null!=this._resources&&(this._resources.object.visible=e)}}export{c as Object3DVisualElement};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import e from"../../../../core/Evented.js";import{i as t,g as r,h as i}from"../../../../chunks/vec32.js";import{create as s}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{a as n,c as o}from"../../../../chunks/vec42.js";import{fromValues as a,clone as l}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{projectBuffer as h}from"../../../../geometry/projection/projectBuffer.js";import{expandWithBuffer as c}from"../../../../geometry/support/aaBoundingBox.js";import{newDoubleArray as d}from"../../../../geometry/support/DoubleArray.js";import{makeDehydratedPoint as p}from"../../../../layers/graphics/dehydratedPoint.js";import{getGeometryEffectiveElevationMode as m}from"../../../../support/elevationInfoUtils.js";import u from"../../../../symbols/support/ElevationInfo.js";import{EngineVisualElement as _}from"./EngineVisualElement.js";import{LaserlineVisualElement as f}from"./LaserlineVisualElement.js";import{ElevationContext as g}from"../../layers/graphics/ElevationContext.js";import{createGeometry as y}from"../../support/engineContent/line.js";import{geometryToRenderInfoDraped as O,geometryToRenderInfo as C}from"../../support/renderInfoUtils/line.js";import{RenderOccludedFlag as v}from"../../webgl-engine/lib/Material.js";import{RenderGeometry as b}from"../../webgl-engine/lib/RenderGeometry.js";import{VertexAttribute as w}from"../../webgl-engine/lib/VertexAttribute.js";import{RibbonLineMaterial as R}from"../../webgl-engine/materials/RibbonLineMaterial.js";class j extends _{constructor(t){super(t),this._attachmentOrigin=p(0,0,0,null),this._attachmentOriginDirty=!0,this.events=new e,this._geometry=null,this._width=1,this._color=a(1,0,1,1),this._innerWidth=0,this._innerColor=a(1,1,1,1),this._stipplePattern=null,this._stippleOffColor=null,this._falloff=0,this._elevationInfo=null,this._laserlineStyle=null,this._laserlineEnabled=!1,this._renderOccluded=v.OccludeAndTransparentStencil,this._attachmentOrigin.spatialReference=t.view.spatialReference,this._laserline=new f({view:t.view,isDecoration:t.isDecoration}),this.applyProperties(t),this.attached=t.attached??!0}destroy(){this._laserline.destroy(),super.destroy()}createObject3DResourceFactory(e){return{view:e,createResources:e=>this._createObject3DResources(e),destroyResources:D,recreateGeometry:(e,t)=>{e.geometries.length=0,this._recreateGeometry(t,e.material,e.geometries)}}}createDrapedResourceFactory(e){return{view:e,createResources:()=>this._createDrapedResources(),destroyResources:D,recreateGeometry:e=>{e.geometries=this._createRenderGeometriesDraped(e.material),this._attachmentOriginChanged()}}}get _laserlineAttached(){return this.attached&&this.visible&&null!=this._laserlineStyle&&!this.isDraped&&this.laserlineEnabled}onAttachedChange(e){this._laserline.attached=this._laserlineAttached,e&&this._attachmentOriginChanged()}get geometry(){return this._geometry}set geometry(e){const t=this._isClosed;this._geometry=e,this.recreateGeometry(),t!==this._isClosed&&this._updateMaterial()}get width(){return this._width}set width(e){e!==this._width&&(this._width=e,this._updateMaterial())}get color(){return this._color}set color(e){n(e,this._color)||(o(this._color,e),this._updateMaterial())}get innerWidth(){return this._innerWidth}set innerWidth(e){e!==this._innerWidth&&(this._innerWidth=e,this._updateMaterial())}get innerColor(){return this._innerColor}set innerColor(e){n(e,this._innerColor)||(o(this._innerColor,e),this._updateMaterial())}get stipplePattern(){return this._stipplePattern}set stipplePattern(e){const t=null!=e!=(null!=this._stipplePattern);this._stipplePattern=e,t?this.recreate():this._updateMaterial()}get stippleOffColor(){return this._stippleOffColor}set stippleOffColor(e){e&&this._stippleOffColor&&n(e,this._stippleOffColor)||(this._stippleOffColor=e?l(e):null,this._updateMaterial())}get falloff(){return this._falloff}set falloff(e){e!==this._falloff&&(this._falloff=e,this._updateMaterial())}get elevationInfo(){return this._elevationInfo}set elevationInfo(e){this._elevationInfo=e,this.recreateGeometry()}get laserlineStyle(){return this._laserlineStyle}set laserlineStyle(e){this._laserlineStyle=e,this._laserline.attached=this._laserlineAttached,null!=e&&(this._laserline.style=e)}get laserlineEnabled(){return this._laserlineEnabled}set laserlineEnabled(e){this._laserlineEnabled!==e&&(this._laserlineEnabled=e,this._laserline.attached=this._laserlineAttached)}get renderOccluded(){return this._renderOccluded}set renderOccluded(e){e!==this._renderOccluded&&(this._renderOccluded=e,this._updateMaterial())}get attachmentOrigin(){if(!this._attachmentOriginDirty)return this._attachmentOrigin;const e=this.object3dResources.resources?.geometries;if(!e||0===e.length)return null;t(E,0,0,0);let s=0;for(const t of e)t.computeAttachmentOrigin(P)&&(r(E,E,P),s++);return 0===s?null:(i(E,E,1/s),this.view.renderCoordsHelper.fromRenderCoords(E,this._attachmentOrigin),this._attachmentOriginDirty=!1,this._attachmentOrigin)}_updateMaterial(){this.object3dResources.resources?.material.setParameters(this._materialParameters),this.drapedResources.resources?.material.setParameters(this._materialParameters)}get _isClosed(){return null!=this.geometry&&"polygon"===this.geometry.type}get _materialParameters(){return{width:this._width,color:this._color,stippleOffColor:this._stippleOffColor,stipplePattern:this._stipplePattern,stipplePreferContinuous:!1,isClosed:this._isClosed,falloff:this._falloff,innerColor:this._innerColor,innerWidth:this._innerWidth,join:"round",hasPolygonOffset:!0,renderOccluded:this._normalizedRenderOccluded,isDecoration:this.isDecoration}}get _normalizedRenderOccluded(){return this.isDraped&&this._renderOccluded===v.OccludeAndTransparentStencil?v.OccludeAndTransparent:this._renderOccluded}_recreateGeometry(e,t,r){this._createRenderGeometries(t,r);for(const i of r)e.addGeometry(i);this._attachmentOriginChanged()}_attachmentOriginChanged(){this._attachmentOriginDirty=!0,this.events.emit("attachment-origin-changed")}_createObject3DResources(e){const t=new R(this._materialParameters),r=new Array;return this._recreateGeometry(e,t,r),{material:t,geometries:r,forEach:e=>{e(t),r.forEach(e)}}}_createDrapedResources(){const e=new R(this._materialParameters);return{material:e,geometries:this._createRenderGeometriesDraped(e)}}_createRenderGeometriesDraped(e){const{geometry:t,view:r}=this,i=r.basemapTerrain.spatialReference;if(null==t||null==i)return[];return O(t,i).lines.map((({position:t})=>{const s={overlayInfo:{spatialReference:i,renderCoordsHelper:r.renderCoordsHelper},attributeData:{position:t},removeDuplicateStartEnd:this._isClosed};return new b(y(e,s))}))}calculateMapBounds(e){if(null==this.object3dResources.resources)return!1;const t=this.view.renderCoordsHelper;for(const r of this.object3dResources.resources.geometries){const i=r.attributes.get(w.POSITION),s=d(i.data.length);h(i.data,t.spatialReference,0,s,this.view.spatialReference,0),c(e,s)}return!0}_createRenderGeometries(e,t){const r=this.geometry;if(null==r)return;const i=C(r,this.view.elevationProvider,this.view.renderCoordsHelper,g.fromElevationInfo(this.elevationInfo??new u({mode:m(r,null)}))),s=new Array;for(const{position:n,mapPositions:o}of i.lines){const r={mapPositions:o,attributeData:{position:n},removeDuplicateStartEnd:this._isClosed};t.push(y(e,r)),s.push(n)}this._laserline.pathVerticalPlane=s}}function D(e){e.geometries=[]}const P=s(),E=s();export{j as OutlineVisualElement};
5
+ import e from"../../../../core/Evented.js";import{i as t,g as r,h as i}from"../../../../chunks/vec32.js";import{create as s}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{a as n,c as o}from"../../../../chunks/vec42.js";import{fromValues as a,clone as l}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{projectBuffer as h}from"../../../../geometry/projection/projectBuffer.js";import{expandWithBuffer as c}from"../../../../geometry/support/aaBoundingBox.js";import{newDoubleArray as d}from"../../../../geometry/support/DoubleArray.js";import{makeDehydratedPoint as p}from"../../../../layers/graphics/dehydratedPoint.js";import{getGeometryEffectiveElevationMode as m}from"../../../../support/elevationInfoUtils.js";import u from"../../../../symbols/support/ElevationInfo.js";import{EngineVisualElement as _}from"./EngineVisualElement.js";import{LaserlineVisualElement as f}from"./LaserlineVisualElement.js";import{ElevationContext as g}from"../../layers/graphics/ElevationContext.js";import{createGeometry as y}from"../../support/engineContent/line.js";import{geometryToRenderInfoDraped as O,geometryToRenderInfo as C}from"../../support/renderInfoUtils/line.js";import{RenderOccludedFlag as v}from"../../webgl-engine/lib/Material.js";import{RenderGeometry as b}from"../../webgl-engine/lib/RenderGeometry.js";import{VertexAttribute as w}from"../../webgl-engine/lib/VertexAttribute.js";import{RibbonLineMaterial as R}from"../../webgl-engine/materials/RibbonLineMaterial.js";class j extends _{constructor(t){super(t),this._attachmentOrigin=p(0,0,0,null),this._attachmentOriginDirty=!0,this.events=new e,this._geometry=null,this._width=1,this._color=a(1,0,1,1),this._innerWidth=0,this._innerColor=a(1,1,1,1),this._stipplePattern=null,this._stippleOffColor=null,this._falloff=0,this._elevationInfo=null,this._laserlineStyle=null,this._laserlineEnabled=!1,this._renderOccluded=v.OccludeAndTransparentStencil,this._attachmentOrigin.spatialReference=t.view.spatialReference,this._laserline=new f({view:t.view,isDecoration:t.isDecoration}),this.applyProperties(t),this.attached=t.attached??!0}destroy(){this._laserline.destroy(),super.destroy()}createObject3DResourceFactory(e){return{view:e,createResources:e=>this._createObject3DResources(e),destroyResources:D,recreateGeometry:(e,t)=>{e.geometries.length=0,this._recreateGeometry(t,e.material,e.geometries)}}}createDrapedResourceFactory(e){return{view:e,createResources:()=>this._createDrapedResources(),destroyResources:D,recreateGeometry:e=>{e.geometries=this._createRenderGeometriesDraped(e.material),this._attachmentOriginChanged()}}}get _laserlineAttached(){return this.attached&&this.visible&&null!=this._laserlineStyle&&!this.isDraped&&this.laserlineEnabled}onAttachedChange(e){this._laserline.attached=this._laserlineAttached,e&&this._attachmentOriginChanged()}get geometry(){return this._geometry}set geometry(e){const t=this._isClosed;this._geometry=e,this.recreateGeometry(),t!==this._isClosed&&this._updateMaterial()}get width(){return this._width}set width(e){e!==this._width&&(this._width=e,this._updateMaterial())}get color(){return this._color}set color(e){n(e,this._color)||(o(this._color,e),this._updateMaterial())}get innerWidth(){return this._innerWidth}set innerWidth(e){e!==this._innerWidth&&(this._innerWidth=e,this._updateMaterial())}get innerColor(){return this._innerColor}set innerColor(e){n(e,this._innerColor)||(o(this._innerColor,e),this._updateMaterial())}get stipplePattern(){return this._stipplePattern}set stipplePattern(e){const t=null!=e!=(null!=this._stipplePattern);this._stipplePattern=e,t?this.recreate():this._updateMaterial()}get stippleOffColor(){return this._stippleOffColor}set stippleOffColor(e){e&&this._stippleOffColor&&n(e,this._stippleOffColor)||(this._stippleOffColor=e?l(e):null,this._updateMaterial())}get falloff(){return this._falloff}set falloff(e){e!==this._falloff&&(this._falloff=e,this._updateMaterial())}get elevationInfo(){return this._elevationInfo}set elevationInfo(e){this._elevationInfo=e,this.recreateGeometry()}get laserlineStyle(){return this._laserlineStyle}set laserlineStyle(e){this._laserlineStyle=e,this._laserline.attached=this._laserlineAttached,null!=e&&(this._laserline.style=e)}get laserlineEnabled(){return this._laserlineEnabled}set laserlineEnabled(e){this._laserlineEnabled!==e&&(this._laserlineEnabled=e,this._laserline.attached=this._laserlineAttached)}get renderOccluded(){return this._renderOccluded}set renderOccluded(e){e!==this._renderOccluded&&(this._renderOccluded=e,this._updateMaterial())}get attachmentOrigin(){if(!this._attachmentOriginDirty)return this._attachmentOrigin;const e=this.object3dResources.resources?.geometries;if(!e||0===e.length)return null;t(E,0,0,0);let s=0;for(const t of e)t.computeAttachmentOrigin(P)&&(r(E,E,P),s++);return 0===s?null:(i(E,E,1/s),this.view.renderCoordsHelper.fromRenderCoords(E,this._attachmentOrigin),this._attachmentOriginDirty=!1,this._attachmentOrigin)}_updateMaterial(){this.object3dResources.resources?.material.setParameters(this._materialParameters),this.drapedResources.resources?.material.setParameters(this._materialParameters)}get _isClosed(){return null!=this.geometry&&"polygon"===this.geometry.type}get _materialParameters(){return{width:this._width,color:this._color,stippleOffColor:this._stippleOffColor,stipplePattern:this._stipplePattern,stipplePreferContinuous:!1,isClosed:this._isClosed,falloff:this._falloff,innerColor:this._innerColor,innerWidth:this._innerWidth,join:"round",hasPolygonOffset:!0,renderOccluded:this._normalizedRenderOccluded,isDecoration:this.isDecoration}}get _normalizedRenderOccluded(){return this.isDraped&&this._renderOccluded===v.OccludeAndTransparentStencil?v.OccludeAndTransparent:this._renderOccluded}_recreateGeometry(e,t,r){this._createRenderGeometries(t,r);for(const i of r)e.addGeometry(i);this._attachmentOriginChanged()}_attachmentOriginChanged(){this._attachmentOriginDirty=!0,this.events.emit("attachment-origin-changed")}_createObject3DResources(e){const t=new R(this._materialParameters),r=new Array;return this._recreateGeometry(e,t,r),{material:t,geometries:r}}_createDrapedResources(){const e=new R(this._materialParameters);return{material:e,geometries:this._createRenderGeometriesDraped(e)}}_createRenderGeometriesDraped(e){const{geometry:t,view:r}=this,i=r.basemapTerrain.spatialReference;if(null==t||null==i)return[];return O(t,i).lines.map((({position:t})=>{const s={overlayInfo:{spatialReference:i,renderCoordsHelper:r.renderCoordsHelper},attributeData:{position:t},removeDuplicateStartEnd:this._isClosed};return new b(y(e,s))}))}calculateMapBounds(e){if(null==this.object3dResources.resources)return!1;const t=this.view.renderCoordsHelper;for(const r of this.object3dResources.resources.geometries){const i=r.attributes.get(w.POSITION),s=d(i.data.length);h(i.data,t.spatialReference,0,s,this.view.spatialReference,0),c(e,s)}return!0}_createRenderGeometries(e,t){const r=this.geometry;if(null==r)return;const i=C(r,this.view.elevationProvider,this.view.renderCoordsHelper,g.fromElevationInfo(this.elevationInfo??new u({mode:m(r,null)}))),s=new Array;for(const{position:n,mapPositions:o}of i.lines){const r={mapPositions:o,attributeData:{position:n},removeDuplicateStartEnd:this._isClosed};t.push(y(e,r)),s.push(n)}this._laserline.pathVerticalPlane=s}}function D(e){e.geometries=[]}const P=s(),E=s();export{j as OutlineVisualElement};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{watch as e}from"../../../../core/reactiveUtils.js";import{castScreenPointArray as t,createScreenPointArray as r}from"../../../../core/screenUtils.js";import{normalize as i,subtract as s,scale as o,set as a,add as c}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{create as n}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{p as d,c as h,n as l,d as m,g as u}from"../../../../chunks/vec32.js";import{create as p,fromValues as _}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{a as f,c as g}from"../../../../chunks/vec42.js";import{fromValues as b}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{makeDehydratedPoint as y}from"../../../../layers/graphics/dehydratedPoint.js";import{EngineVisualElement as j}from"./EngineVisualElement.js";import{drapedZ as D}from"../../terrain/OverlayRenderer.js";import{createPolylineGeometry as O}from"../../webgl-engine/lib/GeometryUtil.js";import{RenderOccludedFlag as w}from"../../webgl-engine/lib/Material.js";import{RenderGeometry as G}from"../../webgl-engine/lib/RenderGeometry.js";import{VertexAttribute as R}from"../../webgl-engine/lib/VertexAttribute.js";import{RibbonLineMaterial as x}from"../../webgl-engine/materials/RibbonLineMaterial.js";class v extends j{constructor(e){super(e),this._location=p(),this._direction=_(1,0,0),this._width=1,this._offset=1,this._length=18,this._color=b(1,0,1,1),this._renderOccluded=w.OccludeAndTransparent,this.applyProperties(e)}createObject3DResourceFactory(e){return{view:e,createResources:e=>this._createObject3DResources(e),destroyResources:A,recreateGeometry:(e,t)=>this._recreateObject3DGeometry(e,t),cameraChanged:()=>this._updateGeometry()}}createDrapedResourceFactory(e){return{view:e,createResources:()=>this._createDrapedResources(),destroyResources:M,recreateGeometry:e=>this._recreateDrapedGeometry(e)}}get location(){return this._location}set location(e){d(this._location,e)||(h(this._location,e),this._updateGeometry())}get direction(){return this._direction}set direction(e){d(this._direction,e)||(h(this._direction,e),this._updateGeometry())}setDirectionFromPoints(e,t){l(this._direction,m(this._direction,t,e)),this._updateGeometry()}get width(){return this._width}set width(e){e!==this._width&&(this._width=e,this._updateMaterial())}get offset(){return this._offset}set offset(e){e!==this._offset&&(this._offset=e,this._updateGeometry())}get length(){return this._length}set length(e){e!==this._length&&(this._length=e,this._updateGeometry())}get color(){return this._color}set color(e){f(e,this._color)||(g(this._color,e),this._updateMaterial())}get renderOccluded(){return this._renderOccluded}set renderOccluded(e){e!==this._renderOccluded&&(this._renderOccluded=e,this._updateMaterial())}_createObject3DResources(e){const t=new x(this.materialParameters),r=new Array;return this._createObject3DGeometry(t,e,r),{material:t,geometries:r,forEach:e=>{e(t),r.forEach(e)}}}_recreateObject3DGeometry(e,t){e.geometries.length=0,this._createObject3DGeometry(e.material,t,e.geometries)}_createObject3DGeometry(e,t,r){const[i,s]=P(e);t.addGeometry(i),t.addGeometry(s),r.push(i),r.push(s),this._updateVerticesObject3D(t)}_createDrapedResources(){const t=new x(this.materialParameters),r=e((()=>this.view.state.contentPixelRatio),(()=>this.drapedResources.recreateGeometry()));return{material:t,geometries:this._createDrapedGeometry(t),pixelRatioHandle:r}}_recreateDrapedGeometry(e){e.geometries=this._createDrapedGeometry(e.material)}_createDrapedGeometry(e){const t=P(e);return this._updateVerticesDraped(t),t.map((e=>new G(e)))}_updateMaterial(){const{materialParameters:e}=this;this.object3dResources.resources?.material.setParameters(e),this.drapedResources.resources?.material.setParameters(e)}get materialParameters(){return{width:this._width,color:this._color,renderOccluded:this._renderOccluded,isDecoration:this.isDecoration}}_updateGeometry(){if(this.isDraped)this.drapedResources.recreateGeometry();else{const e=this.object3dResources.object;e&&this._updateVerticesObject3D(e)}}_updateVerticesObject3D(e){const t=this.view.state.camera;t.projectToScreen(this.location,U),u(I,this.location,this.direction),t.projectToScreen(I,E),i(E,s(E,E,U)),this._updateVertexAttributesObject3D(t,e,0,U,E,1),this._updateVertexAttributesObject3D(t,e,1,U,E,-1)}_updateVertexAttributesObject3D(e,r,i,s,o,a){const c=r.geometries[i],n=c.getMutableAttribute(R.POSITION)?.data;if(!n)return;const{start:d,end:h}=V(o,s,a,this.offset,this.width,this.length);e.unprojectFromScreen(t(d),I),n[0]=I[0],n[1]=I[1],n[2]=I[2],e.unprojectFromScreen(t(h),I),n[3]=I[0],n[4]=I[1],n[5]=I[2],r.geometryVertexAttributeUpdated(c,R.POSITION)}_updateVerticesDraped(e){const{view:{basemapTerrain:{overlayManager:t},state:{contentPixelRatio:r}}}=this,{location:i,width:s,length:o,offset:a}=this,c=N;c.spatialReference=t.renderer.spatialReference,c.x=i[0],c.y=i[1];const n=this.view.overlayPixelSizeInMapUnits(c)*r,d=s*n,h=o*n,l=a*n;this._updateVertexAttributesDraped(e[0],d,h,l,-1),this._updateVertexAttributesDraped(e[1],d,h,l,1)}_updateVertexAttributesDraped(e,t,r,i,s){const o=e.getMutableAttribute(R.POSITION)?.data;if(!o)return;const{location:a,direction:c}=this,{start:n,end:d}=V(c,a,s,i,t,r);o[0]=n[0],o[1]=n[1],o[2]=D,o[3]=d[0],o[4]=d[1],o[5]=D,e.invalidateBoundingInfo()}}function P(e){return[O(e,[p(),p()]),O(e,[p(),p()])]}function V(e,t,r,i,s,n){const d=o(S,a(S,e[1]*r,e[0]*-r),i+s/2),h=c(T,c(T,c(T,t,o(T,e,n/2)),d),d);return{start:h,end:c(F,h,o(F,e,-n))}}function A(e){e.geometries.length=0}function M(e){e.pixelRatioHandle.remove(),e.geometries=[]}const I=p(),S=n(),T=n(),F=n(),U=r(),E=r(),N=y(0,0,void 0,null);export{v as ParallelLineVisualElement};
5
+ import{watch as e}from"../../../../core/reactiveUtils.js";import{castScreenPointArray as t,createScreenPointArray as r}from"../../../../core/screenUtils.js";import{normalize as i,subtract as s,scale as o,set as a,add as c}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{create as n}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{p as d,c as h,n as l,d as m,g as u}from"../../../../chunks/vec32.js";import{create as p,fromValues as _}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{a as f,c as g}from"../../../../chunks/vec42.js";import{fromValues as b}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{makeDehydratedPoint as y}from"../../../../layers/graphics/dehydratedPoint.js";import{EngineVisualElement as j}from"./EngineVisualElement.js";import{drapedZ as D}from"../../terrain/OverlayRenderer.js";import{createPolylineGeometry as O}from"../../webgl-engine/lib/GeometryUtil.js";import{RenderOccludedFlag as w}from"../../webgl-engine/lib/Material.js";import{RenderGeometry as G}from"../../webgl-engine/lib/RenderGeometry.js";import{VertexAttribute as R}from"../../webgl-engine/lib/VertexAttribute.js";import{RibbonLineMaterial as x}from"../../webgl-engine/materials/RibbonLineMaterial.js";class v extends j{constructor(e){super(e),this._location=p(),this._direction=_(1,0,0),this._width=1,this._offset=1,this._length=18,this._color=b(1,0,1,1),this._renderOccluded=w.OccludeAndTransparent,this.applyProperties(e)}createObject3DResourceFactory(e){return{view:e,createResources:e=>this._createObject3DResources(e),destroyResources:A,recreateGeometry:(e,t)=>this._recreateObject3DGeometry(e,t),cameraChanged:()=>this._updateGeometry()}}createDrapedResourceFactory(e){return{view:e,createResources:()=>this._createDrapedResources(),destroyResources:M,recreateGeometry:e=>this._recreateDrapedGeometry(e)}}get location(){return this._location}set location(e){d(this._location,e)||(h(this._location,e),this._updateGeometry())}get direction(){return this._direction}set direction(e){d(this._direction,e)||(h(this._direction,e),this._updateGeometry())}setDirectionFromPoints(e,t){l(this._direction,m(this._direction,t,e)),this._updateGeometry()}get width(){return this._width}set width(e){e!==this._width&&(this._width=e,this._updateMaterial())}get offset(){return this._offset}set offset(e){e!==this._offset&&(this._offset=e,this._updateGeometry())}get length(){return this._length}set length(e){e!==this._length&&(this._length=e,this._updateGeometry())}get color(){return this._color}set color(e){f(e,this._color)||(g(this._color,e),this._updateMaterial())}get renderOccluded(){return this._renderOccluded}set renderOccluded(e){e!==this._renderOccluded&&(this._renderOccluded=e,this._updateMaterial())}_createObject3DResources(e){const t=new x(this.materialParameters),r=new Array;return this._createObject3DGeometry(t,e,r),{material:t,geometries:r}}_recreateObject3DGeometry(e,t){e.geometries.length=0,this._createObject3DGeometry(e.material,t,e.geometries)}_createObject3DGeometry(e,t,r){const[i,s]=P(e);t.addGeometry(i),t.addGeometry(s),r.push(i),r.push(s),this._updateVerticesObject3D(t)}_createDrapedResources(){const t=new x(this.materialParameters),r=e((()=>this.view.state.contentPixelRatio),(()=>this.drapedResources.recreateGeometry()));return{material:t,geometries:this._createDrapedGeometry(t),pixelRatioHandle:r}}_recreateDrapedGeometry(e){e.geometries=this._createDrapedGeometry(e.material)}_createDrapedGeometry(e){const t=P(e);return this._updateVerticesDraped(t),t.map((e=>new G(e)))}_updateMaterial(){const{materialParameters:e}=this;this.object3dResources.resources?.material.setParameters(e),this.drapedResources.resources?.material.setParameters(e)}get materialParameters(){return{width:this._width,color:this._color,renderOccluded:this._renderOccluded,isDecoration:this.isDecoration}}_updateGeometry(){if(this.isDraped)this.drapedResources.recreateGeometry();else{const e=this.object3dResources.object;e&&this._updateVerticesObject3D(e)}}_updateVerticesObject3D(e){const t=this.view.state.camera;t.projectToScreen(this.location,U),u(I,this.location,this.direction),t.projectToScreen(I,N),i(N,s(N,N,U)),this._updateVertexAttributesObject3D(t,e,0,U,N,1),this._updateVertexAttributesObject3D(t,e,1,U,N,-1)}_updateVertexAttributesObject3D(e,r,i,s,o,a){const c=r.geometries[i],n=c.getMutableAttribute(R.POSITION)?.data;if(!n)return;const{start:d,end:h}=V(o,s,a,this.offset,this.width,this.length);e.unprojectFromScreen(t(d),I),n[0]=I[0],n[1]=I[1],n[2]=I[2],e.unprojectFromScreen(t(h),I),n[3]=I[0],n[4]=I[1],n[5]=I[2],r.geometryVertexAttributeUpdated(c,R.POSITION)}_updateVerticesDraped(e){const{view:{basemapTerrain:{overlayManager:t},state:{contentPixelRatio:r}}}=this,{location:i,width:s,length:o,offset:a}=this,c=k;c.spatialReference=t.renderer.spatialReference,c.x=i[0],c.y=i[1];const n=this.view.overlayPixelSizeInMapUnits(c)*r,d=s*n,h=o*n,l=a*n;this._updateVertexAttributesDraped(e[0],d,h,l,-1),this._updateVertexAttributesDraped(e[1],d,h,l,1)}_updateVertexAttributesDraped(e,t,r,i,s){const o=e.getMutableAttribute(R.POSITION)?.data;if(!o)return;const{location:a,direction:c}=this,{start:n,end:d}=V(c,a,s,i,t,r);o[0]=n[0],o[1]=n[1],o[2]=D,o[3]=d[0],o[4]=d[1],o[5]=D,e.invalidateBoundingInfo()}}function P(e){return[O(e,[p(),p()]),O(e,[p(),p()])]}function V(e,t,r,i,s,n){const d=o(S,a(S,e[1]*r,e[0]*-r),i+s/2),h=c(T,c(T,c(T,t,o(T,e,n/2)),d),d);return{start:h,end:c(F,h,o(F,e,-n))}}function A(e){e.geometries.length=0}function M(e){e.pixelRatioHandle.remove(),e.geometries=[]}const I=p(),S=n(),T=n(),F=n(),U=r(),N=r(),k=y(0,0,void 0,null);export{v as ParallelLineVisualElement};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{watch as e}from"../../../../core/reactiveUtils.js";import{fromTranslation as t,scale as r}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as i}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{j as s,n as o,d as a,c as n,p as c,g as l}from"../../../../chunks/vec32.js";import{create as u,ZEROS as d}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{c as h}from"../../../../chunks/vec42.js";import{fromValues as m}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{sv3d as _}from"../../../../geometry/support/vectorStacks.js";import{makeDehydratedPoint as p}from"../../../../layers/graphics/dehydratedPoint.js";import{EngineVisualElement as g}from"./EngineVisualElement.js";import{drapedZ as f}from"../../terrain/OverlayRenderer.js";import{Attribute as b}from"../../webgl-engine/lib/Attribute.js";import{Geometry as M}from"../../webgl-engine/lib/Geometry.js";import{createPolylineGeometry as O}from"../../webgl-engine/lib/GeometryUtil.js";import{RenderOccludedFlag as j}from"../../webgl-engine/lib/Material.js";import{RenderGeometry as R}from"../../webgl-engine/lib/RenderGeometry.js";import{VertexAttribute as w}from"../../webgl-engine/lib/VertexAttribute.js";import{ColorMaterial as z}from"../../webgl-engine/materials/ColorMaterial.js";import{RibbonLineMaterial as y}from"../../webgl-engine/materials/RibbonLineMaterial.js";class D extends g{constructor(e){super(e),this._maxSize=0,this._position=u(),this._up=u(),this._right=u(),this._renderOccluded=j.OccludeAndTransparent,this._color=m(1,0,0,1),this._outlineColor=m(0,0,0,1),this._outlineSize=0,this._size=32,this._outlineRenderOccluded=j.Opaque,this.applyProperties(e)}createObject3DResourceFactory(e){return{view:e,createResources:e=>this._createObject3DResources(e),destroyResources:()=>{},cameraChanged:()=>this._updateTransformObject3D()}}createDrapedResourceFactory(e){return{view:e,createResources:()=>this._createDrapedResources(),destroyResources:P}}get renderOccluded(){return this._renderOccluded}set renderOccluded(e){e!==this._renderOccluded&&(this._renderOccluded=e,this._updateQuadMaterial())}get color(){return this._color}set color(e){h(this._color,e),this._updateQuadMaterial()}get outlineColor(){return this._outlineColor}set outlineColor(e){h(this._outlineColor,e),this._updateOutlineMaterial()}get outlineSize(){return this._outlineSize}set outlineSize(e){const t=0===this._outlineSize!=(0===e);this._outlineSize=e,t?this.recreateGeometry():this._updateOutlineMaterial()}get size(){return this._size}set size(e){e!==this._size&&(this._size=e,this._updateTransform())}get outlineRenderOccluded(){return this._outlineRenderOccluded}set outlineRenderOccluded(e){this._outlineRenderOccluded=e,this._updateOutlineMaterial()}set geometry({previous:e,center:t,next:r}){this._maxSize=Math.min(s(t,e),s(t,r))/3,o(this._up,a(this._up,e,t)),o(this._right,a(this._right,r,t)),n(this._position,t),this.recreateGeometry()}_createObject3DResources(e){const t=new z(this._quadMaterialParameters),r=0===this._outlineSize?void 0:new y(this._outlineMaterialParameters);return this._createObject3DGeometries(e,t,r),{quadMaterial:t,outlineMaterial:r,forEach:e=>{e(t),r&&e(r)}}}_createObject3DGeometries(e,t,r){if(c(this._up,d)&&c(this._right,d))return;const i=this._createGeometries(t,r);for(const s of i)e.addGeometry(s);this._updateTransformObject3D(e)}_createDrapedResources(){const t=new z(this._quadMaterialParameters),r=0===this._outlineSize?void 0:new y(this._outlineMaterialParameters),i=this._createGeometries(t,r).map((e=>new R(e)));this._setTransformDraped(i);return{quadMaterial:t,outlineMaterial:r,geometries:i,pixelRatioHandle:e((()=>this.view.state.contentPixelRatio),(()=>this.drapedResources.recreateGeometry()))}}_createGeometries(e,t){const{up:r,right:i,corner:s}=this._getVertices(),o=v(r,i,s,e);if(!t)return[o];return[o,O(t,[r,s,i])]}_getVertices(){let e=this._up,t=this._right;const r=l(_.get(),e,t);return this.isDraped&&(e=n(_.get(),e),t=n(_.get(),t),e[2]=0,t[2]=0,r[2]=0),{up:e,right:t,corner:r}}_updateTransform(){this.isDraped?this.drapedResources.recreateGeometry():this._updateTransformObject3D()}_updateTransformObject3D(e=this.object3dResources.object){if(!e)return;const i=this.view.state.camera,s=this._size*i.computeScreenPixelSizeAt(this._position),o=Math.min(this._maxSize,s);t(x,this._position),r(x,x,[o,o,o]),e.transformation=x}_setTransformDraped(e){if(0===e.length)return;const{view:{basemapTerrain:{overlayManager:i},state:{contentPixelRatio:s}}}=this,{_position:o,_size:a}=this,c=n(_.get(),o);c[2]=f;const l=S;l.spatialReference=i.renderer.spatialReference,l.x=c[0],l.y=c[1];const u=a*(this.view.overlayPixelSizeInMapUnits(l)*s),d=Math.min(this._maxSize,u);t(x,c),r(x,x,[d,d,1]);for(const t of e)t.transformation=x}get _quadMaterialParameters(){return{color:this._color,forceTransparentMode:!0,writeDepth:!1,polygonOffset:!0,renderOccluded:this._renderOccluded,isDecoration:this.isDecoration}}_updateQuadMaterial(){this.object3dResources.resources?.quadMaterial.setParameters(this._quadMaterialParameters),this.drapedResources.resources?.quadMaterial.setParameters(this._quadMaterialParameters)}get _outlineMaterialParameters(){return{color:this._outlineColor,width:this._outlineSize,renderOccluded:this._outlineRenderOccluded,isDecoration:this.isDecoration}}_updateOutlineMaterial(){this.object3dResources.resources?.outlineMaterial?.setParameters(this._outlineMaterialParameters),this.drapedResources.resources?.outlineMaterial?.setParameters(this._outlineMaterialParameters)}}function P(e){e.pixelRatioHandle.remove(),e.geometries=[]}function v(e,t,r,i){return new M(i,[[w.POSITION,new b([0,0,0,...t,...e,...r],[0,1,2,1,2,3],3,!0)]])}const x=i(),S=p(0,0,void 0,null);export{D as RightAngleQuadVisualElement};
5
+ import{watch as e}from"../../../../core/reactiveUtils.js";import{fromTranslation as t,scale as r}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as i}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{j as s,n as o,d as a,c as n,p as c,g as l}from"../../../../chunks/vec32.js";import{create as u,ZEROS as d}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{c as h}from"../../../../chunks/vec42.js";import{fromValues as m}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{sv3d as _}from"../../../../geometry/support/vectorStacks.js";import{makeDehydratedPoint as p}from"../../../../layers/graphics/dehydratedPoint.js";import{EngineVisualElement as g}from"./EngineVisualElement.js";import{drapedZ as f}from"../../terrain/OverlayRenderer.js";import{Attribute as b}from"../../webgl-engine/lib/Attribute.js";import{Geometry as M}from"../../webgl-engine/lib/Geometry.js";import{createPolylineGeometry as O}from"../../webgl-engine/lib/GeometryUtil.js";import{RenderOccludedFlag as j}from"../../webgl-engine/lib/Material.js";import{RenderGeometry as R}from"../../webgl-engine/lib/RenderGeometry.js";import{VertexAttribute as w}from"../../webgl-engine/lib/VertexAttribute.js";import{ColorMaterial as z}from"../../webgl-engine/materials/ColorMaterial.js";import{RibbonLineMaterial as y}from"../../webgl-engine/materials/RibbonLineMaterial.js";class D extends g{constructor(e){super(e),this._maxSize=0,this._position=u(),this._up=u(),this._right=u(),this._renderOccluded=j.OccludeAndTransparent,this._color=m(1,0,0,1),this._outlineColor=m(0,0,0,1),this._outlineSize=0,this._size=32,this._outlineRenderOccluded=j.Opaque,this.applyProperties(e)}createObject3DResourceFactory(e){return{view:e,createResources:e=>this._createObject3DResources(e),destroyResources:()=>{},cameraChanged:()=>this._updateTransformObject3D()}}createDrapedResourceFactory(e){return{view:e,createResources:()=>this._createDrapedResources(),destroyResources:P}}get renderOccluded(){return this._renderOccluded}set renderOccluded(e){e!==this._renderOccluded&&(this._renderOccluded=e,this._updateQuadMaterial())}get color(){return this._color}set color(e){h(this._color,e),this._updateQuadMaterial()}get outlineColor(){return this._outlineColor}set outlineColor(e){h(this._outlineColor,e),this._updateOutlineMaterial()}get outlineSize(){return this._outlineSize}set outlineSize(e){const t=0===this._outlineSize!=(0===e);this._outlineSize=e,t?this.recreateGeometry():this._updateOutlineMaterial()}get size(){return this._size}set size(e){e!==this._size&&(this._size=e,this._updateTransform())}get outlineRenderOccluded(){return this._outlineRenderOccluded}set outlineRenderOccluded(e){this._outlineRenderOccluded=e,this._updateOutlineMaterial()}set geometry({previous:e,center:t,next:r}){this._maxSize=Math.min(s(t,e),s(t,r))/3,o(this._up,a(this._up,e,t)),o(this._right,a(this._right,r,t)),n(this._position,t),this.recreateGeometry()}_createObject3DResources(e){const t=new z(this._quadMaterialParameters),r=0===this._outlineSize?void 0:new y(this._outlineMaterialParameters);return this._createObject3DGeometries(e,t,r),{quadMaterial:t,outlineMaterial:r}}_createObject3DGeometries(e,t,r){if(c(this._up,d)&&c(this._right,d))return;const i=this._createGeometries(t,r);for(const s of i)e.addGeometry(s);this._updateTransformObject3D(e)}_createDrapedResources(){const t=new z(this._quadMaterialParameters),r=0===this._outlineSize?void 0:new y(this._outlineMaterialParameters),i=this._createGeometries(t,r).map((e=>new R(e)));this._setTransformDraped(i);return{quadMaterial:t,outlineMaterial:r,geometries:i,pixelRatioHandle:e((()=>this.view.state.contentPixelRatio),(()=>this.drapedResources.recreateGeometry()))}}_createGeometries(e,t){const{up:r,right:i,corner:s}=this._getVertices(),o=v(r,i,s,e);if(!t)return[o];return[o,O(t,[r,s,i])]}_getVertices(){let e=this._up,t=this._right;const r=l(_.get(),e,t);return this.isDraped&&(e=n(_.get(),e),t=n(_.get(),t),e[2]=0,t[2]=0,r[2]=0),{up:e,right:t,corner:r}}_updateTransform(){this.isDraped?this.drapedResources.recreateGeometry():this._updateTransformObject3D()}_updateTransformObject3D(e=this.object3dResources.object){if(!e)return;const i=this.view.state.camera,s=this._size*i.computeScreenPixelSizeAt(this._position),o=Math.min(this._maxSize,s);t(x,this._position),r(x,x,[o,o,o]),e.transformation=x}_setTransformDraped(e){if(0===e.length)return;const{view:{basemapTerrain:{overlayManager:i},state:{contentPixelRatio:s}}}=this,{_position:o,_size:a}=this,c=n(_.get(),o);c[2]=f;const l=S;l.spatialReference=i.renderer.spatialReference,l.x=c[0],l.y=c[1];const u=a*(this.view.overlayPixelSizeInMapUnits(l)*s),d=Math.min(this._maxSize,u);t(x,c),r(x,x,[d,d,1]);for(const t of e)t.transformation=x}get _quadMaterialParameters(){return{color:this._color,forceTransparentMode:!0,writeDepth:!1,polygonOffset:!0,renderOccluded:this._renderOccluded,isDecoration:this.isDecoration}}_updateQuadMaterial(){this.object3dResources.resources?.quadMaterial.setParameters(this._quadMaterialParameters),this.drapedResources.resources?.quadMaterial.setParameters(this._quadMaterialParameters)}get _outlineMaterialParameters(){return{color:this._outlineColor,width:this._outlineSize,renderOccluded:this._outlineRenderOccluded,isDecoration:this.isDecoration}}_updateOutlineMaterial(){this.object3dResources.resources?.outlineMaterial?.setParameters(this._outlineMaterialParameters),this.drapedResources.resources?.outlineMaterial?.setParameters(this._outlineMaterialParameters)}}function P(e){e.pixelRatioHandle.remove(),e.geometries=[]}function v(e,t,r,i){return new M(i,[[w.POSITION,new b([0,0,0,...t,...e,...r],[0,1,2,1,2,3],3,!0)]])}const x=i(),S=p(0,0,void 0,null);export{D as RightAngleQuadVisualElement};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{watch as e,initial as s}from"../../../../core/reactiveUtils.js";import{ContentObjectType as r}from"../../webgl-engine/lib/ContentObjectType.js";import{Object3D as t}from"../../webgl-engine/lib/Object3D.js";import{UpdatePolicy as o}from"../../webgl-engine/lib/UpdatePolicy.js";import{WebGLLayer as i}from"../../webgl-engine/lib/WebGLLayer.js";class c{constructor(e){this._resourceFactory=e,this._resources=null,this._visible=!0,this._attached=!1}destroy(){this._destroyResources()}get object(){return null!=this._resources?this._resources.object:null}get resources(){return null!=this._resources?this._resources.external:null}get visible(){return this._visible}set visible(e){e!==this._visible&&(this._visible=e,this._syncVisible())}get attached(){return this._attached}set attached(e){e!==this._attached&&(this._attached=e,this._createOrDestroyResources())}recreate(){this.attached&&this._createResources()}recreateGeometry(){if(!this._resourceFactory.recreateGeometry)return void this.recreate();const e=this._resourceFactory.view.stage;if(null==this._resources||!e)return;const s=this._resources.object;this._resources.external.forEach((s=>{s.type!==r.Mesh&&s.type!==r.Line&&s.type!==r.Point||e.remove(s)})),s.removeAllGeometries(),this._resourceFactory.recreateGeometry(this._resources.external,s,this._resources.layer),this._resources.external.forEach((s=>{s.type!==r.Mesh&&s.type!==r.Line&&s.type!==r.Point||e.add(s)}))}_createOrDestroyResources(){this._attached?this._resources||this._createResources():this._destroyResources()}_createResources(){this._destroyResources();const c=this._resourceFactory,a=c.view,h=a.stage;if(!h)return;const u=new i(h,{pickable:!1,updatePolicy:o.SYNC}),l=new t({castShadow:!1}),n=c.createResources(l,u);n.forEach((e=>{h.add(e),e.type===r.Texture&&e.load(h.renderView.renderingContext)})),h.add(l),u.add(l);const _=c.cameraChanged,y=_?e((()=>a.state.camera),(e=>_(e)),s):null;this._resources={layer:u,object:l,external:n,cameraHandle:y},this._syncVisible()}_destroyResources(){if(null==this._resources)return;const e=this._resourceFactory.view.stage;e&&(e.remove(this._resources.object),this._resources.layer.destroy(),this._resources.external.forEach((s=>{e.remove(s),s.type===r.Texture&&s.unload()}))),this._resources.object.dispose(),this._resources.cameraHandle?.remove(),this._resourceFactory.destroyResources(this._resources.external),this._resources=null}_syncVisible(){null!=this._resources&&(this._resources.object.visible=this._visible)}}export{c as VisualElementResources};
5
+ import{watch as e,initial as s}from"../../../../core/reactiveUtils.js";import{Object3D as r}from"../../webgl-engine/lib/Object3D.js";import{UpdatePolicy as t}from"../../webgl-engine/lib/UpdatePolicy.js";import{WebGLLayer as c}from"../../webgl-engine/lib/WebGLLayer.js";class i{constructor(e){this._resourceFactory=e,this._resources=null,this._visible=!0,this._attached=!1}destroy(){this._destroyResources()}get object(){return null!=this._resources?this._resources.object:null}get resources(){return null!=this._resources?this._resources.external:null}get visible(){return this._visible}set visible(e){e!==this._visible&&(this._visible=e,this._syncVisible())}get attached(){return this._attached}set attached(e){e!==this._attached&&(this._attached=e,this._createOrDestroyResources())}recreate(){this.attached&&this._createResources()}recreateGeometry(){if(!this._resourceFactory.recreateGeometry)return void this.recreate();const e=this._resourceFactory.view.stage;if(null==this._resources||!e)return;const s=this._resources.object;s.removeAllGeometries(),this._resourceFactory.recreateGeometry(this._resources.external,s,this._resources.layer)}_createOrDestroyResources(){this._attached?this._resources||this._createResources():this._destroyResources()}_createResources(){this._destroyResources();const i=this._resourceFactory,o=i.view,a=o.stage;if(!a)return;const u=new c(a,{pickable:!1,updatePolicy:t.SYNC}),h=new r({castShadow:!1}),l=i.createResources(h,u);a.add(h),u.add(h);const _=i.cameraChanged,n=_?e((()=>o.state.camera),(e=>_(e)),s):null;this._resources={layer:u,object:h,external:l,cameraHandle:n},this._syncVisible()}_destroyResources(){if(null==this._resources)return;const e=this._resourceFactory.view.stage;e&&(e.remove(this._resources.object),this._resources.layer.destroy()),this._resources.object.dispose(),this._resources.cameraHandle?.remove(),this._resourceFactory.destroyResources(this._resources.external),this._resources=null}_syncVisible(){null!=this._resources&&(this._resources.object.visible=this._visible)}}export{i as VisualElementResources};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../chunks/tslib.es6.js";import{forEach as t,result as r}from"../../../core/asyncUtils.js";import{makeHandle as i}from"../../../core/handleUtils.js";import a from"../../../core/Logger.js";import{abortMaybe as s}from"../../../core/maybe.js";import{isAbortError as o,onAbort as n,throwIfAborted as l,isAborted as m,createAbortError as h}from"../../../core/promiseUtils.js";import{whenOnce as g}from"../../../core/reactiveUtils.js";import"../../../core/has.js";import"../../../core/RandomLCG.js";import"../../../core/Error.js";import{subclass as d}from"../../../core/accessorSupport/decorators/subclass.js";import c from"../../../geometry/Extent.js";import{create as u,equals as p,width as f,height as w,copy as x,intersection as y}from"../../../geometry/support/aaBoundingRect.js";import{DrapeSourceType as _}from"./interfaces.js";import b from"./SubView3D.js";import{computeImageExportSize as E,createGeometryForExtent as R,createOuterImageGeometry as v}from"./support/overlayImageUtils.js";import{debugFlags as j}from"../support/debugFlags.js";import{OverlayIndex as S}from"../terrain/interfaces.js";import{DirtyOperation as A}from"../webgl-engine/lib/ModelDirtyTypes.js";import{RenderGeometry as I}from"../webgl-engine/lib/RenderGeometry.js";import{Texture as M}from"../webgl-engine/lib/Texture.js";import{UpdatePolicy as D}from"../webgl-engine/lib/UpdatePolicy.js";import{ImageMaterial as G}from"../webgl-engine/materials/ImageMaterial.js";import{TextureWrapMode as T}from"../../webgl/enums.js";let P=class extends b{constructor(e){super(e),this.drapeSourceType=_.RasterImage,this.updatePolicy=D.SYNC,this.maximumDataResolution=null,this._images=new Array,this._extents=new Array,this._overlays=new Array,this._drapeSourceRenderer=null}initialize(){this._drapeSourceRenderer=this.view.basemapTerrain.overlayManager.registerGeometryDrapeSource(this),this.addHandles(i((()=>this.view.basemapTerrain.overlayManager.unregisterDrapeSource(this))))}setDrapingExtent(e,t){this._spatialReference=t,e.forEach(((e,t)=>{this._overlays[t]=e,this._updateImageExtent(e,t)}))}destroy(){this.clear()}get spatialReference(){return this._spatialReference}_updateImageExtent(e,t){const r=this._clippedExtent(e.extent,O);if(null==r)return;const i=E(e.extent,r,e.resolution);let s=e.pixelRatio*this.view.state.pixelRatio;const{layer:n}=this;if("imageMaxWidth"in n&&null!=n.imageMaxWidth||"imageMaxHeight"in n&&null!=n.imageMaxHeight){const e=n.imageMaxWidth,t=n.imageMaxHeight;if(i.width>e){const t=e/i.width;i.height=Math.floor(i.height*t),i.width=e,s*=t}if(i.height>t){const e=t/i.height;i.width=Math.floor(i.width*e),i.height=t,s*=e}}const l=this._extents[t];l&&p(l.extent,r)&&this._imageSizeEquals(r,l.imageSize,i)||(this._extents[t]={extent:u(r),imageSize:i,pixelRatio:s},this.suspended||this._fetch(t).catch((e=>{o(e)||a.getLogger(this).error(e)})))}clear(){for(let e=0;e<this._images.length;e++)this._clearImage(e)}async doRefresh(e){const t=[];for(let r=0;r<this._extents.length;r++)this._extents[r]&&t.push(this._fetch(r,e));await Promise.allSettled(t)}async processResult(e,t,r){(t instanceof HTMLImageElement||t instanceof HTMLCanvasElement)&&(e.image=t)}findExtentInfoAt(e){for(const t of this._extents){const r=t.extent;if(new c(r[0],r[1],r[2],r[3],this._spatialReference).contains(e))return t}return null}async redraw(e,r){await t(this._images,(async(t,i)=>{t&&(await e(t,r),await this._createStageObjects(i,t.image,r))}))}_imageSizeEquals(e,t,r){if(!this.maximumDataResolution)return!1;const i=f(e)/this.maximumDataResolution.x,a=w(e)/this.maximumDataResolution.y,s=i/t.width,o=a/t.height,n=i/r.width,l=a/r.height,m=Math.abs(s-n),h=Math.abs(o-l),g=j.TESTS_DISABLE_OPTIMIZATIONS?0:1.5;return m<=g&&h<=g}async _fetch(e,t){if(this.suspended)return;const r=this._extents[e],i=r.extent;this._images[e]||(this._images[e]={texture:null,material:null,renderGeometry:null,loadingPromise:null,loadingAbortController:null,image:null,pixelData:null,renderExtent:u(i)});const g=this._images[e];g.loadingAbortController=s(g.loadingAbortController);const d=new c(i[0],i[1],i[2],i[3],this._spatialReference);if(0===d.width||0===d.height)return void this._clearImage(e);const p=new AbortController;g.loadingAbortController=p,n(t,(()=>p.abort()));const f=p.signal,w=this._waitFetchReady(f).then((async()=>{l(f);const t={requestAsImageElement:!0,pixelRatio:this._overlays[e].pixelRatio,...this.layerView.getFetchOptions(),signal:f},{height:i,width:a}=r.imageSize;return this.layer?"imagery"===this.layer.type?this.layer.internalFetchImage(d,a,i,t):this.layer.fetchImage(d,a,i,t):null})).then((e=>{if(m(f))throw a.getLogger(this).warnOnce("A call to fetchImage resolved even though the request was aborted. fetchImage should not resolve if options.signal.aborted is true."),h();return this.processResult(g,e)})).then((()=>{x(g.renderExtent,i)}));g.loadingPromise=w,await this.updatingHandles.addPromise(w.then((async()=>{l(f),await this._createStageObjects(e,g.image,f)})).catch((e=>{throw e&&!o(e)&&a.getLogger(this).error(e),e})).finally((()=>{w===g.loadingPromise&&(g.loadingPromise=null,g.loadingAbortController=null)})))}_clearImage(e){const t=this._images[e];if(t){null!=t.renderGeometry&&(this._drapeSourceRenderer.removeGeometries([t.renderGeometry],A.UPDATE),t.renderGeometry=null);const e=this.view.stage,r=t.texture;r?.unload(),e.remove(r),t.texture=null,e.remove(t.material),t.material=null,t.loadingAbortController=s(t.loadingAbortController),t.loadingPromise=null,t.image=null,t.pixelData=null}}async _createStageObjects(e,t,i){const a=this.view.stage,s=this._images[e],o=()=>{s.texture?.unload(),a.remove(s.texture),s.texture=null,s.renderGeometry&&(this._drapeSourceRenderer.removeGeometries([s.renderGeometry],A.UPDATE),s.renderGeometry=null)};if(t){const n=new M(t,{width:t.width,height:t.height,preMultiplyAlpha:!0,wrap:{s:T.CLAMP_TO_EDGE,t:T.CLAMP_TO_EDGE}});if(await r(this._images[e===S.INNER?S.OUTER:S.INNER].loadingPromise),l(i),o(),await a.schedule((()=>n.load(a.renderView.renderingContext)),i),!n.loaded)return void o();let m;if(a.add(n),s.texture=n,s.material??=new G({draped:!0,texture:n}),s.material.setParameters({texture:n}),e===S.INNER)m=R(s.material,s.renderExtent);else{const e=this._images[0].renderExtent;if(!e)return void o();m=v(s.material,e,s.renderExtent)}s.renderGeometry=new I(m),s.renderGeometry.localOrigin=this._overlays[e].renderLocalOrigin,this._drapeSourceRenderer.addGeometries([s.renderGeometry],A.UPDATE)}else o(),a.remove(s.material),s.material=null}_clippedExtent(e,t){if("local"!==this.view.viewingMode)return x(t,e);const r=this.view.basemapTerrain;return r.ready?y(e,r.extent,t):x(t,e)}async _waitFetchReady(e){await g((()=>this.view.stationary),e),l(e)}};P=e([d("esri.views.3d.layers.DrapedSubView3D")],P);const C=P,O=u();export{C as default};
5
+ import{_ as e}from"../../../chunks/tslib.es6.js";import{forEach as t,result as r}from"../../../core/asyncUtils.js";import{makeHandle as i}from"../../../core/handleUtils.js";import a from"../../../core/Logger.js";import{abortMaybe as s}from"../../../core/maybe.js";import{isAbortError as o,onAbort as n,throwIfAborted as l,isAborted as h,createAbortError as m}from"../../../core/promiseUtils.js";import{whenOnce as g}from"../../../core/reactiveUtils.js";import{property as d}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/RandomLCG.js";import{subclass as c}from"../../../core/accessorSupport/decorators/subclass.js";import u from"../../../geometry/Extent.js";import{create as p,equals as f,width as y,height as w,copy as x,intersection as _}from"../../../geometry/support/aaBoundingRect.js";import{DrapeSourceType as b}from"./interfaces.js";import R from"./SubView3D.js";import{computeImageExportSize as E,createGeometryForExtent as v,createOuterImageGeometry as j}from"./support/overlayImageUtils.js";import{debugFlags as S}from"../support/debugFlags.js";import{OverlayIndex as A}from"../terrain/interfaces.js";import{DirtyOperation as I}from"../webgl-engine/lib/ModelDirtyTypes.js";import{RenderGeometry as M}from"../webgl-engine/lib/RenderGeometry.js";import{Texture as D}from"../webgl-engine/lib/Texture.js";import{UpdatePolicy as G}from"../webgl-engine/lib/UpdatePolicy.js";import{ImageMaterial as T}from"../webgl-engine/materials/ImageMaterial.js";import{TextureWrapMode as P}from"../../webgl/enums.js";let C=class extends R{constructor(e){super(e),this.drapeSourceType=b.RasterImage,this.updatePolicy=G.SYNC,this.type="draped",this.maximumDataResolution=null,this._images=new Array,this._extents=new Array,this._overlays=new Array,this._drapeSourceRenderer=null}initialize(){this._drapeSourceRenderer=this.view.basemapTerrain.overlayManager.registerGeometryDrapeSource(this),this.addHandles(i((()=>this.view.basemapTerrain.overlayManager.unregisterDrapeSource(this))))}setDrapingExtent(e,t){this._spatialReference=t,e.forEach(((e,t)=>{this._overlays[t]=e,this._updateImageExtent(e,t)}))}destroy(){this.clear()}get spatialReference(){return this._spatialReference}_updateImageExtent(e,t){const r=this._clippedExtent(e.extent,L);if(null==r)return;const i=E(e.extent,r,e.resolution);let s=e.pixelRatio*this.view.state.pixelRatio;const{layer:n}=this;if("imageMaxWidth"in n&&null!=n.imageMaxWidth||"imageMaxHeight"in n&&null!=n.imageMaxHeight){const e=n.imageMaxWidth,t=n.imageMaxHeight;if(i.width>e){const t=e/i.width;i.height=Math.floor(i.height*t),i.width=e,s*=t}if(i.height>t){const e=t/i.height;i.width=Math.floor(i.width*e),i.height=t,s*=e}}const l=this._extents[t];l&&f(l.extent,r)&&this._imageSizeEquals(r,l.imageSize,i)||(this._extents[t]={extent:p(r),imageSize:i,pixelRatio:s},this.suspended||this._fetch(t).catch((e=>{o(e)||a.getLogger(this).error(e)})))}clear(){for(let e=0;e<this._images.length;e++)this._clearImage(e)}async doRefresh(e){const t=[];for(let r=0;r<this._extents.length;r++)this._extents[r]&&t.push(this._fetch(r,e));await Promise.allSettled(t)}async processResult(e,t,r){(t instanceof HTMLImageElement||t instanceof HTMLCanvasElement)&&(e.image=t)}findExtentInfoAt(e){for(const t of this._extents){const r=t.extent;if(new u(r[0],r[1],r[2],r[3],this._spatialReference).contains(e))return t}return null}async redraw(e,r){await t(this._images,(async(t,i)=>{t&&(await e(t,r),await this._createStageObjects(i,t.image,r))}))}_imageSizeEquals(e,t,r){if(!this.maximumDataResolution)return!1;const i=y(e)/this.maximumDataResolution.x,a=w(e)/this.maximumDataResolution.y,s=i/t.width,o=a/t.height,n=i/r.width,l=a/r.height,h=Math.abs(s-n),m=Math.abs(o-l),g=S.TESTS_DISABLE_OPTIMIZATIONS?0:1.5;return h<=g&&m<=g}async _fetch(e,t){if(this.suspended)return;const r=this._extents[e],i=r.extent;this._images[e]||(this._images[e]={texture:null,material:null,renderGeometry:null,loadingPromise:null,loadingAbortController:null,image:null,pixelData:null,renderExtent:p(i)});const g=this._images[e];g.loadingAbortController=s(g.loadingAbortController);const d=new u(i[0],i[1],i[2],i[3],this._spatialReference);if(0===d.width||0===d.height)return void this._clearImage(e);const c=new AbortController;g.loadingAbortController=c,n(t,(()=>c.abort()));const f=c.signal,y=this._waitFetchReady(f).then((async()=>{l(f);const t={requestAsImageElement:!0,pixelRatio:this._overlays[e].pixelRatio,...this.layerView.getFetchOptions(),signal:f},{height:i,width:a}=r.imageSize;return this.layer?"imagery"===this.layer.type?this.layer.internalFetchImage(d,a,i,t):this.layer.fetchImage(d,a,i,t):null})).then((e=>{if(h(f))throw a.getLogger(this).warnOnce("A call to fetchImage resolved even though the request was aborted. fetchImage should not resolve if options.signal.aborted is true."),m();return this.processResult(g,e)})).then((()=>{x(g.renderExtent,i)}));g.loadingPromise=y,await this.updatingHandles.addPromise(y.then((async()=>{l(f),await this._createStageObjects(e,g.image,f)})).catch((e=>{throw e&&!o(e)&&a.getLogger(this).error(e),e})).finally((()=>{y===g.loadingPromise&&(g.loadingPromise=null,g.loadingAbortController=null)})))}_clearImage(e){const t=this._images[e];if(t){null!=t.renderGeometry&&(this._drapeSourceRenderer.removeGeometries([t.renderGeometry],I.UPDATE),t.renderGeometry=null);const e=this.view.stage,r=t.texture;r?.unload(),e.remove(r),t.texture=null,t.material=null,t.loadingAbortController=s(t.loadingAbortController),t.loadingPromise=null,t.image=null,t.pixelData=null}}async _createStageObjects(e,t,i){const a=this.view.stage,s=this._images[e],o=()=>{s.texture?.unload(),a.remove(s.texture),s.texture=null,s.renderGeometry&&(this._drapeSourceRenderer.removeGeometries([s.renderGeometry],I.UPDATE),s.renderGeometry=null)};if(t){const n=new D(t,{width:t.width,height:t.height,preMultiplyAlpha:!0,wrap:{s:P.CLAMP_TO_EDGE,t:P.CLAMP_TO_EDGE}});if(await r(this._images[e===A.INNER?A.OUTER:A.INNER].loadingPromise),l(i),o(),await a.schedule((()=>n.load(a.renderView.renderingContext)),i),!n.loaded)return void o();let h;if(a.add(n),s.texture=n,s.material??=new T({draped:!0,texture:n}),s.material.setParameters({texture:n}),e===A.INNER)h=v(s.material,s.renderExtent);else{const e=this._images[0].renderExtent;if(!e)return void o();h=j(s.material,e,s.renderExtent)}s.renderGeometry=new M(h),s.renderGeometry.localOrigin=this._overlays[e].renderLocalOrigin,this._drapeSourceRenderer.addGeometries([s.renderGeometry],I.UPDATE)}else o(),s.material=null}_clippedExtent(e,t){if("local"!==this.view.viewingMode)return x(t,e);const r=this.view.basemapTerrain;return r.ready?_(e,r.extent,t):x(t,e)}async _waitFetchReady(e){await g((()=>this.view.stationary),e),l(e)}};e([d()],C.prototype,"type",void 0),C=e([c("esri.views.3d.layers.DrapedSubView3D")],C);const O=C,L=p();export{O as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../chunks/tslib.es6.js";import s from"../../../core/Logger.js";import{destroyMaybe as t}from"../../../core/maybe.js";import{debounce as i,isAbortError as r}from"../../../core/promiseUtils.js";import{property as o}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/RandomLCG.js";import{subclass as a}from"../../../core/accessorSupport/decorators/subclass.js";import n from"./DrapedSubView3D.js";import{LayerView3D as p}from"./LayerView3D.js";import l from"../../layers/LayerView.js";import d from"../../layers/RefreshableLayerView.js";import{isInEffectiveScaleRange as c}from"../../support/layerViewUtils.js";import{projectWithZConversionSilent as u}from"../../support/projectionUtils.js";let h=class extends(d(p(l))){constructor(){super(...arguments),this.fullExtentInLocalViewSpatialReference=null,this.refreshDebounced=i((async e=>{this.destroyed||await this._doRefresh(e).catch((e=>{r(e)||s.getLogger(this).error(e)}))}),2e3)}get visibleAtCurrentScale(){const e=this.layer,s="effectiveScaleRange"in e?e.effectiveScaleRange:null;return c(s,this.view.scale)}isUpdating(){return super.isUpdating()||this.subView.updating}initialize(){this._initSubView(),"local"===this.view.viewingMode&&this.addResolvingPromise((async()=>this.fullExtentInLocalViewSpatialReference=await u(this.layer.fullExtent,this.view.spatialReference))()),this._updatingHandles.add((()=>this.suspended),(()=>this._suspendedChangeHandler()))}destroy(){this.subView=t(this.subView)}_initSubView(){this.subView=new n({layerView:this})}async doRefresh(){return this._doRefresh()}async _doRefresh(e){this.suspended||await this.subView.doRefresh(e)}getFetchOptions(){}_suspendedChangeHandler(){this.suspended?this.subView.clear():this.refreshDebounced()}};e([o()],h.prototype,"layer",void 0),e([o()],h.prototype,"suspended",void 0),e([o()],h.prototype,"fullExtentInLocalViewSpatialReference",void 0),e([o({readOnly:!0})],h.prototype,"visibleAtCurrentScale",null),e([o()],h.prototype,"updating",void 0),e([o()],h.prototype,"subView",void 0),h=e([a("esri.views.3d.layers.DynamicLayerView3D")],h);const f=h;export{f as default};
5
+ import{_ as e}from"../../../chunks/tslib.es6.js";import"../../../core/has.js";import s from"../../../core/Logger.js";import{destroyMaybe as t}from"../../../core/maybe.js";import{debounce as i,isAbortError as r}from"../../../core/promiseUtils.js";import{property as o}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/RandomLCG.js";import{subclass as a}from"../../../core/accessorSupport/decorators/subclass.js";import n from"./DrapedSubView3D.js";import{LayerView3D as p}from"./LayerView3D.js";import l from"../../layers/LayerView.js";import d from"../../layers/RefreshableLayerView.js";import{isInEffectiveScaleRange as c}from"../../support/layerViewUtils.js";import{projectWithZConversionSilent as u}from"../../support/projectionUtils.js";let h=class extends(d(p(l))){constructor(){super(...arguments),this.fullExtentInLocalViewSpatialReference=null,this.refreshDebounced=i((async e=>{this.destroyed||await this._doRefresh(e).catch((e=>{r(e)||s.getLogger(this).error(e)}))}),2e3)}get visibleAtCurrentScale(){const e=this.layer,s="effectiveScaleRange"in e?e.effectiveScaleRange:null;return c(s,this.view.scale)}isUpdating(){return super.isUpdating()||this.subView.updating}initialize(){this._initSubView(),"local"===this.view.viewingMode&&this.addResolvingPromise((async()=>this.fullExtentInLocalViewSpatialReference=await u(this.layer.fullExtent,this.view.spatialReference))()),this._updatingHandles.add((()=>this.suspended),(()=>this._suspendedChangeHandler()))}destroy(){this.subView=t(this.subView)}_initSubView(){this.subView=new n({layerView:this})}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(){}};e([o()],h.prototype,"layer",void 0),e([o()],h.prototype,"suspended",void 0),e([o()],h.prototype,"fullExtentInLocalViewSpatialReference",void 0),e([o({readOnly:!0})],h.prototype,"visibleAtCurrentScale",null),e([o()],h.prototype,"updating",void 0),e([o()],h.prototype,"subView",void 0),h=e([a("esri.views.3d.layers.DynamicLayerView3D")],h);const f=h;export{f as default};
@@ -0,0 +1,5 @@
1
+ /*
2
+ All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
+ See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
+ */
5
+ import{_ as o}from"../../../chunks/tslib.es6.js";import{property as r}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as e}from"../../../core/accessorSupport/decorators/subclass.js";import s from"./SubView3D.js";let t=class extends s{constructor(o){super(o),this.type="flow"}doRefresh(o){throw new Error("Method not implemented.")}clear(){}};o([r()],t.prototype,"type",void 0),t=o([e("esri.views.3d.layers.FlowSubView3D")],t);const p=t;export{p as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../chunks/tslib.es6.js";import{destroyHandle as t}from"../../../core/handleUtils.js";import{watch as i,syncAndInitial as r}from"../../../core/reactiveUtils.js";import{property as s}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as a}from"../../../core/accessorSupport/decorators/subclass.js";import h from"./DynamicLayerView3D.js";import o from"./ImagerySubView3D.js";import{ImageHighlightHelper3D as p}from"./support/ImageHighlightHelper3D.js";import l from"../../layers/ImageryLayerView.js";let n=class extends(l(h)){constructor(){super(...arguments),this.type="imagery-3d"}_initSubView(){this.subView=new o({layerView:this})}get highlightOptions(){return null}get pixelData(){return null}initialize(){const e=()=>this._updatingHandles.addPromise(this.refreshDebounced());this._updatingHandles.add((()=>this.layer?.exportImageServiceParameters?.version),e),this._updatingHandles.add((()=>this.layer?.renderer),e),this._updatingHandles.add((()=>this.timeExtent),e),this._highlightHelper=new p({view:this.view,layer:this.layer,updatingHandles:this._updatingHandles}),this.addHandles([t(this._highlightHelper),i((()=>this.suspended),(e=>this._highlightHelper.suspended=e),r)])}getFetchOptions(){return{timeExtent:this.timeExtent}}highlight(e,t){return this._highlightHelper.highlight(e,t)}isUpdating(){return super.isUpdating()||this._highlightHelper.updating}};e([s()],n.prototype,"highlightOptions",null),e([s()],n.prototype,"pixelData",null),n=e([a("esri.views.3d.layers.ImageryLayerView3D")],n);const d=n;export{d as default};
5
+ import{_ as e}from"../../../chunks/tslib.es6.js";import{destroyHandle as t}from"../../../core/handleUtils.js";import{watch as i,syncAndInitial as r,initial as s}from"../../../core/reactiveUtils.js";import{property as a}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as o}from"../../../core/accessorSupport/decorators/subclass.js";import h from"./DynamicLayerView3D.js";import l from"./FlowSubView3D.js";import p from"./ImagerySubView3D.js";import{ImageHighlightHelper3D as n}from"./support/ImageHighlightHelper3D.js";import d from"../../layers/ImageryLayerView.js";let g=class extends(d(h)){constructor(){super(...arguments),this.type="imagery-3d"}get highlightOptions(){return null}get pixelData(){return null}initialize(){const e=()=>this._updatingHandles.addPromise(this.refreshDebounced());this._updatingHandles.add((()=>this.layer?.exportImageServiceParameters?.version),e),this._updatingHandles.add((()=>this.layer?.renderer),e),this._updatingHandles.add((()=>this.timeExtent),e),this._highlightHelper=new n({view:this.view,layer:this.layer,updatingHandles:this._updatingHandles}),this.addHandles([t(this._highlightHelper),i((()=>this.suspended),(e=>this._highlightHelper.suspended=e),r)])}_initSubView(){this.addHandles([i((()=>this.layer.renderer),(e=>this._recreateSubView(e)),s)])}_recreateSubView(e){const t="flow"===e?.type,i="flow"===this.subView?.type,r=this.subView;r&&t===i||(this.subView=t?new l({layerView:this}):new p({layerView:this}),r?.destroy())}getFetchOptions(){return{timeExtent:this.timeExtent}}highlight(e,t){return this._highlightHelper.highlight(e,t)}isUpdating(){return super.isUpdating()||this._highlightHelper.updating}};e([a()],g.prototype,"highlightOptions",null),e([a()],g.prototype,"pixelData",null),g=e([o("esri.views.3d.layers.ImageryLayerView3D")],g);const m=g;export{m as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../chunks/tslib.es6.js";import t from"../../../core/Error.js";import{whenOnce as r}from"../../../core/reactiveUtils.js";import{property as i}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as s}from"../../../core/accessorSupport/decorators/subclass.js";import{projectDatasetExtent as a}from"../../../layers/support/rasterFunctions/rasterProjectionHelper.js";import{LayerView3D as l}from"./LayerView3D.js";import{TiledLayerView3D as n}from"./TiledLayerView3D.js";import{RasterTile as o}from"../terrain/RasterTile.js";import m from"../../layers/ImageryTileLayerView.js";import p from"../../layers/LayerView.js";import h from"../../layers/RefreshableLayerView.js";import{createQueryGeometry as c}from"../../support/drapedUtils.js";import{getWebGLCapabilities as d}from"../../webgl/capabilities.js";let y=class extends(m(h(n(l(p))))){constructor(){super(...arguments),this.type="imagery-tile-3d",this._isAlignedMapTile=!0}initialize(){this.layer.increaseRasterJobHandlerUsage(),null==this.fullExtent&&this.addResolvingPromise(Promise.reject(new t("layerview:spatial-reference-incompatible","The layer extent cannot be projected to the view's spatial reference",{layer:this.layer})));const e=r((()=>this.view?.basemapTerrain?.tilingSchemeLocked)).then((()=>{const e=this.view.basemapTerrain.tilingScheme,t=this.layer.tileInfo;this._isAlignedMapTile=["png","png24","png32","jpg","mixed"].includes(t.format)&&e.compatibleWith(t),this.tileInfo=this._isAlignedMapTile?t:e.toTileInfo(),this._updatingHandles.add((()=>[this.layer.renderer,this.layer.interpolation,this.layer.bandIds,this.layer.multidimensionalDefinition,this.layer.multidimensionalSubset,this.layer.rasterFunction,this.timeExtent]),(()=>this.refresh()))}));this.addResolvingPromise(e)}destroy(){this.layer.decreaseRasterJobHandlerUsage()}get _blankTile(){const e=document.createElement("canvas"),t=e.getContext("2d"),[r,i]=this.tileInfo.size;return e.width=r,e.height=i,t.clearRect(0,0,r,i),t.getImageData(0,0,r,i)}get imageFormatIsOpaque(){return"jpg"===this.layer.tileInfo.format}get hasMixedImageFormats(){return"mixed"===this.layer.tileInfo.format}get dataLevelRange(){const e=this.layer.tileInfo,t=this.tileInfo.lodAt(0)?.scale,r=this.layer.tileInfo.lodAt(e.lods.length-1)?.scale;return this.levelRangeFromScaleRange(t,r)}_getFullExtent(){return a(this.layer.serviceRasterInfo,this.view.basemapTerrain?.spatialReference??this.view.spatialReference)}async fetchTile(e,t){const r=this.tileInfo,i=this._canSymbolizeInWebGL(),s={tileInfo:r,requestRawData:i,signal:t.signal,timeExtent:this.timeExtent,requestAsImageElement:this._isAlignedMapTile,noClip:!1},{layer:a}=this,[l,n,m]=e,p=await a.fetchTile(l,n,m,s);if(p instanceof HTMLImageElement)return p;let h=p?.pixelBlock;if(null==h)return this._blankTile;if(!i&&(h=await a.applyRenderer(p),null==h))return this._blankTile;const c=new o([l,n,m],h,r.size[0],r.size[1]);return i?(c.symbolizerRenderer=a.symbolizer.rendererJSON,c.symbolizerParameters=a.symbolizer.generateWebGLParameters(this._getSymbolizerOptions(l)),c.transformGrid=p.transformGrid,c.bandIds=a.bandIds):(c.isRendereredSource=!0,c.bandIds=null),c.interpolation=a.interpolation,c}_getSymbolizerOptions(e){const t=this.tileInfo.lodAt(e).resolution;return{pixelBlock:null,isGCS:null!=this.view.basemapTerrain?.spatialReference?this.view.basemapTerrain.spatialReference.isGeographic:this.view.spatialReference.isGeographic,resolution:{x:t,y:t},bandIds:this.layer.bandIds}}ensureSymbolizerParameters(e){this._canSymbolizeInWebGL()&&JSON.stringify(e.symbolizerRenderer)!==JSON.stringify(this.layer.symbolizer.rendererJSON)&&(e.symbolizerParameters=this.layer.symbolizer.generateWebGLParameters(this._getSymbolizerOptions(e.lij[0])))}createFetchPopupFeaturesQueryGeometry(e,t){return c(e,t,this.view)}refresh(){this.emit("data-changed")}async doRefresh(){this.suspended||this.emit("data-changed")}_canSymbolizeInWebGL(){const e=d(),{symbolizer:t}=this.layer,r=t.lookup.colormapLut?.indexedColormap,i=!!this.layer.rasterFunction?.hasClipFunction,s=r&&r.length>4*(e.maxTextureSize||4096);return t.canRenderInWebGL&&!s&&!i}};e([i({readOnly:!0})],y.prototype,"_blankTile",null),e([i({readOnly:!0})],y.prototype,"imageFormatIsOpaque",null),e([i({readOnly:!0})],y.prototype,"hasMixedImageFormats",null),e([i({readOnly:!0})],y.prototype,"dataLevelRange",null),y=e([s("esri.views.3d.layers.ImageryTileLayerView3D")],y);const u=y;export{u as default};
5
+ import{_ as e}from"../../../chunks/tslib.es6.js";import t from"../../../core/Error.js";import"../../../core/has.js";import{whenOnce as i,watch as r,initial as s}from"../../../core/reactiveUtils.js";import{property as a}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as l}from"../../../core/accessorSupport/decorators/subclass.js";import{projectDatasetExtent as n}from"../../../layers/support/rasterFunctions/rasterProjectionHelper.js";import o from"./FlowSubView3D.js";import{LayerView3D as m}from"./LayerView3D.js";import{TiledLayerView3D as h}from"./TiledLayerView3D.js";import{RasterTile as p}from"../terrain/RasterTile.js";import d from"../../layers/ImageryTileLayerView.js";import c from"../../layers/LayerView.js";import y from"../../layers/RefreshableLayerView.js";import{createQueryGeometry as u}from"../../support/drapedUtils.js";import{getWebGLCapabilities as f}from"../../webgl/capabilities.js";let g=class extends(d(y(h(m(c))))){constructor(){super(...arguments),this.type="imagery-tile-3d",this._isAlignedMapTile=!0,this._flowSubView=null}initialize(){this.layer.increaseRasterJobHandlerUsage(),null==this.fullExtent&&this.addResolvingPromise(Promise.reject(new t("layerview:spatial-reference-incompatible","The layer extent cannot be projected to the view's spatial reference",{layer:this.layer})));const e=i((()=>this.view?.basemapTerrain?.tilingSchemeLocked)).then((()=>{const e=this.view.basemapTerrain.tilingScheme,t=this.layer.tileInfo;this._isAlignedMapTile=["png","png24","png32","jpg","mixed"].includes(t.format)&&e.compatibleWith(t),this.tileInfo=this._isAlignedMapTile?t:e.toTileInfo(),this._updatingHandles.add((()=>[this.layer.renderer,this.layer.interpolation,this.layer.bandIds,this.layer.multidimensionalDefinition,this.layer.multidimensionalSubset,this.layer.rasterFunction,this.timeExtent]),(()=>this.refresh()))}));this.addResolvingPromise(e),this.addHandles(r((()=>this.layer.renderer),(e=>this._setSubView(e)),s))}destroy(){this.layer.decreaseRasterJobHandlerUsage()}_setSubView(e){const t="flow"===e?.type,i=this._flowSubView;t&&null!=i||(i?.destroy(),this._flowSubView=t?new o({layerView:this}):null)}get _blankTile(){const e=document.createElement("canvas"),t=e.getContext("2d"),[i,r]=this.tileInfo.size;return e.width=i,e.height=r,t.clearRect(0,0,i,r),t.getImageData(0,0,i,r)}get imageFormatIsOpaque(){return"jpg"===this.layer.tileInfo.format}get hasMixedImageFormats(){return"mixed"===this.layer.tileInfo.format}get dataLevelRange(){const e=this.layer.tileInfo,t=this.tileInfo.lodAt(0)?.scale,i=this.layer.tileInfo.lodAt(e.lods.length-1)?.scale;return this.levelRangeFromScaleRange(t,i)}_getFullExtent(){return n(this.layer.serviceRasterInfo,this.view.basemapTerrain?.spatialReference??this.view.spatialReference)}async fetchTile(e,t){const i=this.tileInfo,r=this._canSymbolizeInWebGL(),s={tileInfo:i,requestRawData:r,signal:t.signal,timeExtent:this.timeExtent,requestAsImageElement:this._isAlignedMapTile,noClip:!1},{layer:a}=this,[l,n,o]=e,m=await a.fetchTile(l,n,o,s);if(m instanceof HTMLImageElement)return m;let h=m?.pixelBlock;if(null==h)return this._blankTile;if(!r&&(h=await a.applyRenderer(m),null==h))return this._blankTile;const d=new p([l,n,o],h,i.size[0],i.size[1]);return r?(d.symbolizerRenderer=a.symbolizer.rendererJSON,d.symbolizerParameters=a.symbolizer.generateWebGLParameters(this._getSymbolizerOptions(l)),d.transformGrid=m.transformGrid,d.bandIds=a.bandIds):(d.isRendereredSource=!0,d.bandIds=null),d.interpolation=a.interpolation,d}_getSymbolizerOptions(e){const t=this.tileInfo.lodAt(e).resolution;return{pixelBlock:null,isGCS:null!=this.view.basemapTerrain?.spatialReference?this.view.basemapTerrain.spatialReference.isGeographic:this.view.spatialReference.isGeographic,resolution:{x:t,y:t},bandIds:this.layer.bandIds}}ensureSymbolizerParameters(e){this._canSymbolizeInWebGL()&&JSON.stringify(e.symbolizerRenderer)!==JSON.stringify(this.layer.symbolizer.rendererJSON)&&(e.symbolizerParameters=this.layer.symbolizer.generateWebGLParameters(this._getSymbolizerOptions(e.lij[0])))}createFetchPopupFeaturesQueryGeometry(e,t){return u(e,t,this.view)}refresh(){this.emit("data-changed")}async doRefresh(){this.suspended||(this._flowSubView&&await this._flowSubView.doRefresh(),this.emit("data-changed"))}isUpdating(){return this._flowSubView?.updating??!1}_canSymbolizeInWebGL(){const e=f(),{symbolizer:t}=this.layer,i=t.lookup.colormapLut?.indexedColormap,r=!!this.layer.rasterFunction?.hasClipFunction,s=i&&i.length>4*(e.maxTextureSize||4096);return t.canRenderInWebGL&&!s&&!r}get test(){}};e([a({readOnly:!0})],g.prototype,"_blankTile",null),e([a({readOnly:!0})],g.prototype,"imageFormatIsOpaque",null),e([a({readOnly:!0})],g.prototype,"hasMixedImageFormats",null),e([a({readOnly:!0})],g.prototype,"dataLevelRange",null),g=e([l("esri.views.3d.layers.ImageryTileLayerView3D")],g);const b=g;export{b as default};