@arcgis/core 4.24.0-next.20220427 → 4.24.0-next.20220430

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 (276) hide show
  1. package/WebMap.js +1 -1
  2. package/analysis/LineOfSightAnalysis.js +1 -1
  3. package/assets/esri/core/workers/RemoteClient.js +1 -1
  4. package/assets/esri/core/workers/chunks/{3a43a2918b44781aaf85.js → 055a0ebf22a82f859474.js} +1 -1
  5. package/assets/esri/core/workers/chunks/{3273b6be43eeb49ee842.js → 0b12ff7b2ed2838afbb8.js} +1 -1
  6. package/assets/esri/core/workers/chunks/0e25548573baf855e394.js +1 -0
  7. package/assets/esri/core/workers/chunks/0edd4c3ca6e7d749d0e5.js +1 -0
  8. package/assets/esri/core/workers/chunks/133f971e72a1a6277ac4.js +1 -0
  9. package/assets/esri/core/workers/chunks/{c388ac33496f004d56f3.js → 135a90ae61f3b3cae91b.js} +1 -1
  10. package/assets/esri/core/workers/chunks/{54f9b1ab9d472bf4baca.js → 1facbda248863cf72cbd.js} +1 -1
  11. package/assets/esri/core/workers/chunks/1fb2d7abe6c8efa84695.js +1 -0
  12. package/assets/esri/core/workers/chunks/2133499e642193f6738f.js +1 -0
  13. package/assets/esri/core/workers/chunks/{dee63bfc108b4e5893a3.js → 2cf3934b3ecabdf207c8.js} +1 -1
  14. package/assets/esri/core/workers/chunks/{3c572629f46e5093223c.js → 30333a95dc0a44e23fb5.js} +1 -1
  15. package/assets/esri/core/workers/chunks/{7afe89eafab00afb31f2.js → 30837d93116f0337972f.js} +1 -1
  16. package/assets/esri/core/workers/chunks/31df729c17470245288c.js +2 -0
  17. package/assets/esri/core/workers/chunks/{c0bf663240df7be68131.js.LICENSE.txt → 31df729c17470245288c.js.LICENSE.txt} +1 -1
  18. package/assets/esri/core/workers/chunks/4130ea1f5a9f197168d7.js +1 -0
  19. package/assets/esri/core/workers/chunks/{417ee7a88575cb8f9aaf.js → 492b65fe99641f5740f0.js} +1 -1
  20. package/assets/esri/core/workers/chunks/4cdd29e1f3a1c7a39af7.js +1 -0
  21. package/assets/esri/core/workers/chunks/{9a0073d43b7dbaeba736.js → 541e644fc77dbe527124.js} +1 -1
  22. package/assets/esri/core/workers/chunks/{5a61a12b2492c6eae592.js → 59e341b2db44351bf557.js} +1 -1
  23. package/assets/esri/core/workers/chunks/{73630d52768e3d932f30.js → 5a10b58533b4116115ac.js} +1 -1
  24. package/assets/esri/core/workers/chunks/5fd787f63362defc984f.js +1 -0
  25. package/assets/esri/core/workers/chunks/682a8f15f352de76df69.js +1 -0
  26. package/assets/esri/core/workers/chunks/6a06635089761ee3e6d4.js +972 -0
  27. package/assets/esri/core/workers/chunks/{ab0c0c29d54f2ed954d6.js → 86b31ae136f931d7884a.js} +1 -1
  28. package/assets/esri/core/workers/chunks/{dc193247a1980360ec4f.js → 8e98ff9404a802352037.js} +1 -1
  29. package/assets/esri/core/workers/chunks/{863cfe35ee640bac103f.js → 94e51fe1c539df6257c2.js} +1 -1
  30. package/assets/esri/core/workers/chunks/{cbe7e6283a427a618d4b.js → 9519a02b9b8db88a3150.js} +1 -1
  31. package/assets/esri/core/workers/chunks/9f3a094aa4b47e4eb046.js +1 -0
  32. package/assets/esri/core/workers/chunks/{50d256bc3b213c8a1b09.js → a0ebf25c9c9a7f839b93.js} +1 -1
  33. package/assets/esri/core/workers/chunks/{d8a992dee594a6a64fde.js → a25f0a195f9217665530.js} +1 -1
  34. package/assets/esri/core/workers/chunks/a59ee7d2b98c85f27dd2.js +1 -0
  35. package/assets/esri/core/workers/chunks/{92ef9b0c61640e0ecbb4.js → a5dbab94697757c87c49.js} +1 -1
  36. package/assets/esri/core/workers/chunks/{147d3ee9aa81d7b2b7fa.js → a6406a248b7b2ed65f35.js} +1 -1
  37. package/assets/esri/core/workers/chunks/{ebdf61eb364ac0856f40.js → acbd0f4d72d1f5d8e4e8.js} +1 -1
  38. package/assets/esri/core/workers/chunks/acc97a210f36bff2d1b0.js +1 -0
  39. package/assets/esri/core/workers/chunks/ad68fe924456d6d7d4f0.js +1 -0
  40. package/assets/esri/core/workers/chunks/b06c949fc7d08e376a5f.js +1 -0
  41. package/assets/esri/core/workers/chunks/b4405e9fe6c0cf7250d3.js +1 -0
  42. package/assets/esri/core/workers/chunks/b97a34d2e7cceef1ac41.js +1 -0
  43. package/assets/esri/core/workers/chunks/bc08fe3b03767bd694c5.js +1 -0
  44. package/assets/esri/core/workers/chunks/c9b09099488d0e719dfb.js +1 -0
  45. package/assets/esri/core/workers/chunks/{4a05d0dfa73ff570e1fa.js → d15e6662d90718411d62.js} +1 -1
  46. package/assets/esri/core/workers/chunks/{b74b9dceabbf7b1aec39.js → d16aac3461af9cee0c29.js} +1 -1
  47. package/assets/esri/core/workers/chunks/{bb678bc2e2fc48112e07.js → d60dd3e1028f714f2258.js} +1 -1
  48. package/assets/esri/core/workers/chunks/{31c1ae0532dd991da63d.js → d6c150c243ca1f6108f9.js} +1 -1
  49. package/assets/esri/core/workers/chunks/{cab6decfcb3f596a3837.js → d8c59b1d73650c060dfb.js} +1 -1
  50. package/assets/esri/core/workers/chunks/{d24339b37cc9316e6d99.js → dcb6e1b33402d7fa455b.js} +1 -1
  51. package/assets/esri/core/workers/chunks/{a8da24116180d708cf81.js → df653bca2b14dffc82d1.js} +1 -1
  52. package/assets/esri/core/workers/chunks/{a3db91d04fe1fca0fe4f.js → e06461703e6f1acfcfdc.js} +1 -1
  53. package/assets/esri/core/workers/chunks/{423e199c2f695e913c0e.js → e3e1d87b8532bf84a18d.js} +1 -1
  54. package/assets/esri/core/workers/chunks/e7744b7e0c16bba93151.js +1 -0
  55. package/assets/esri/core/workers/chunks/ea50effc5c39870dc871.js +1 -0
  56. package/assets/esri/core/workers/chunks/fc4fd9db056579e09bfe.js +1 -0
  57. package/assets/esri/core/workers/chunks/fc9b5f40c5179a8c90de.js +1 -0
  58. package/assets/esri/core/workers/chunks/fd35b69872ac9393924f.js +1 -0
  59. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_ar.json +1 -1
  60. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_bg.json +1 -1
  61. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_bs.json +1 -1
  62. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_ca.json +1 -1
  63. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_cs.json +1 -1
  64. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_da.json +1 -1
  65. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_de.json +1 -1
  66. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_el.json +1 -1
  67. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_es.json +1 -1
  68. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_et.json +1 -1
  69. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_fi.json +1 -1
  70. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_fr.json +1 -1
  71. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_he.json +1 -1
  72. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_hr.json +1 -1
  73. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_hu.json +1 -1
  74. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_id.json +1 -1
  75. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_it.json +1 -1
  76. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_ja.json +1 -1
  77. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_ko.json +1 -1
  78. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_lt.json +1 -1
  79. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_lv.json +1 -1
  80. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_nb.json +1 -1
  81. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_nl.json +1 -1
  82. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_pl.json +1 -1
  83. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_pt-BR.json +1 -1
  84. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_pt-PT.json +1 -1
  85. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_ro.json +1 -1
  86. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_ru.json +1 -1
  87. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_sk.json +1 -1
  88. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_sl.json +1 -1
  89. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_sr.json +1 -1
  90. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_sv.json +1 -1
  91. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_th.json +1 -1
  92. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_tr.json +1 -1
  93. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_uk.json +1 -1
  94. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_vi.json +1 -1
  95. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_zh-CN.json +1 -1
  96. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_zh-HK.json +1 -1
  97. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_zh-TW.json +1 -1
  98. package/assets/esri/widgets/Weather/t9n/Weather_ar.json +1 -1
  99. package/assets/esri/widgets/Weather/t9n/Weather_bg.json +1 -1
  100. package/assets/esri/widgets/Weather/t9n/Weather_bs.json +1 -1
  101. package/assets/esri/widgets/Weather/t9n/Weather_ca.json +1 -1
  102. package/assets/esri/widgets/Weather/t9n/Weather_cs.json +1 -1
  103. package/assets/esri/widgets/Weather/t9n/Weather_da.json +1 -1
  104. package/assets/esri/widgets/Weather/t9n/Weather_de.json +1 -1
  105. package/assets/esri/widgets/Weather/t9n/Weather_el.json +1 -1
  106. package/assets/esri/widgets/Weather/t9n/Weather_es.json +1 -1
  107. package/assets/esri/widgets/Weather/t9n/Weather_et.json +1 -1
  108. package/assets/esri/widgets/Weather/t9n/Weather_fi.json +1 -1
  109. package/assets/esri/widgets/Weather/t9n/Weather_fr.json +1 -1
  110. package/assets/esri/widgets/Weather/t9n/Weather_he.json +1 -1
  111. package/assets/esri/widgets/Weather/t9n/Weather_hr.json +1 -1
  112. package/assets/esri/widgets/Weather/t9n/Weather_hu.json +1 -1
  113. package/assets/esri/widgets/Weather/t9n/Weather_id.json +1 -1
  114. package/assets/esri/widgets/Weather/t9n/Weather_it.json +1 -1
  115. package/assets/esri/widgets/Weather/t9n/Weather_ja.json +1 -1
  116. package/assets/esri/widgets/Weather/t9n/Weather_ko.json +1 -1
  117. package/assets/esri/widgets/Weather/t9n/Weather_lt.json +1 -1
  118. package/assets/esri/widgets/Weather/t9n/Weather_lv.json +1 -1
  119. package/assets/esri/widgets/Weather/t9n/Weather_nb.json +1 -1
  120. package/assets/esri/widgets/Weather/t9n/Weather_nl.json +1 -1
  121. package/assets/esri/widgets/Weather/t9n/Weather_pl.json +1 -1
  122. package/assets/esri/widgets/Weather/t9n/Weather_pt-BR.json +1 -1
  123. package/assets/esri/widgets/Weather/t9n/Weather_pt-PT.json +1 -1
  124. package/assets/esri/widgets/Weather/t9n/Weather_ro.json +1 -1
  125. package/assets/esri/widgets/Weather/t9n/Weather_ru.json +1 -1
  126. package/assets/esri/widgets/Weather/t9n/Weather_sk.json +1 -1
  127. package/assets/esri/widgets/Weather/t9n/Weather_sl.json +1 -1
  128. package/assets/esri/widgets/Weather/t9n/Weather_sr.json +1 -1
  129. package/assets/esri/widgets/Weather/t9n/Weather_sv.json +1 -1
  130. package/assets/esri/widgets/Weather/t9n/Weather_th.json +1 -1
  131. package/assets/esri/widgets/Weather/t9n/Weather_tr.json +1 -1
  132. package/assets/esri/widgets/Weather/t9n/Weather_uk.json +1 -1
  133. package/assets/esri/widgets/Weather/t9n/Weather_vi.json +1 -1
  134. package/assets/esri/widgets/Weather/t9n/Weather_zh-CN.json +1 -1
  135. package/assets/esri/widgets/Weather/t9n/Weather_zh-HK.json +1 -1
  136. package/assets/esri/widgets/Weather/t9n/Weather_zh-TW.json +1 -1
  137. package/chunks/ColorMaterial.glsl.js +4 -4
  138. package/chunks/LineMarker.glsl.js +12 -12
  139. package/chunks/Pattern.glsl.js +17 -17
  140. package/chunks/RibbonLine.glsl.js +34 -34
  141. package/chunks/ShadedColorMaterial.glsl.js +11 -11
  142. package/chunks/index.js +1 -1
  143. package/chunks/sphere.js +1 -1
  144. package/config.js +1 -1
  145. package/core/workers/RemoteClient.js +1 -1
  146. package/core/workers/WorkerHandle.js +1 -1
  147. package/geometry/support/sphere.js +1 -1
  148. package/interfaces.d.ts +74 -20
  149. package/layers/mixins/PortalLayer.js +1 -1
  150. package/layers/support/LercDecoder.js +1 -1
  151. package/package.json +2 -2
  152. package/request.js +1 -1
  153. package/support/elevationInfoUtils.js +1 -1
  154. package/support/revision.js +1 -1
  155. package/symbols/support/previewSymbol2D.js +1 -1
  156. package/views/2d/engine/brushes.js +1 -1
  157. package/views/2d/engine/vectorTiles/TileParser.js +1 -1
  158. package/views/2d/engine/webgl/GraphicDisplayList.js +1 -1
  159. package/views/2d/engine/webgl/Painter.js +1 -1
  160. package/views/2d/engine/webgl/WGLRendererInfo.js +1 -1
  161. package/views/2d/engine/webgl/brushes/WGLBrushDotDensity.js +5 -0
  162. package/views/2d/engine/webgl/brushes/WGLBrushHeatmap.js +5 -0
  163. package/views/2d/engine/webgl/brushes/WGLGeometryBrush.js +1 -1
  164. package/views/2d/engine/webgl/brushes/WGLGeometryBrushFill.js +1 -1
  165. package/views/2d/engine/webgl/brushes/WGLGeometryBrushLabel.js +1 -1
  166. package/views/2d/engine/webgl/brushes/WGLGeometryBrushLine.js +1 -1
  167. package/views/2d/engine/webgl/brushes/WGLGeometryBrushMarker.js +1 -1
  168. package/views/2d/engine/webgl/brushes/WGLGeometryBrushText.js +1 -1
  169. package/views/2d/engine/webgl/shaders/sources/shaderRepository.js +1 -1
  170. package/views/2d/engine/webgl/techniques/Technique.js +5 -0
  171. package/views/2d/engine/webgl/techniques/dotDensity/TechniqueDotDensity.js +5 -0
  172. package/views/2d/engine/webgl/techniques/heatmap/TechniqueHeatmap.js +5 -0
  173. package/views/2d/engine/webgl/techniques/utils.js +5 -0
  174. package/views/2d/layers/features/schemaUtils.js +1 -1
  175. package/views/2d/layers/features/support/AttributeStore.js +1 -1
  176. package/views/2d/layers/features/support/GraphicsReader.js +1 -1
  177. package/views/2d/layers/features/tileRenderers/support/WGLFeatureView.js +1 -1
  178. package/views/2d/layers/graphics/GraphicsView2D.js +1 -1
  179. package/views/3d/analysis/Slice/SliceTool.js +1 -1
  180. package/views/3d/camera/constraintUtils/distance.js +1 -1
  181. package/views/3d/camera/constraintUtils/tilt.js +1 -1
  182. package/views/3d/interactive/SnappingVisualizer3D.js +1 -1
  183. package/views/3d/interactive/analysisTools/lineOfSight/LineOfSightTool.js +1 -1
  184. package/views/3d/interactive/measurementTools/areaMeasurement3D/AreaMeasurement3DTool.js +1 -1
  185. package/views/3d/interactive/measurementTools/areaMeasurement3D/AreaMeasurement3DView.js +1 -1
  186. package/views/3d/interactive/measurementTools/directLineMeasurement3D/DirectLineMeasurement3DView.js +1 -1
  187. package/views/3d/layers/I3SMeshView3D.js +1 -1
  188. package/views/3d/layers/I3SMeshWorkerHandle.js +1 -1
  189. package/views/3d/layers/I3SPointsWorkerHandle.js +1 -1
  190. package/views/3d/layers/PointCloudWorkerHandle.js +1 -1
  191. package/views/3d/layers/graphics/Deconflictor.js +1 -1
  192. package/views/3d/layers/i3s/I3SElevationProvider.js +1 -1
  193. package/views/3d/layers/i3s/I3SNode.js +1 -1
  194. package/views/3d/layers/support/HeatmapFeatureProcessor.js +1 -1
  195. package/views/3d/state/controllers/GamepadKeyboardController.js +1 -1
  196. package/views/3d/state/utils/navigationUtils.js +1 -1
  197. package/views/3d/support/PBFDecoder.js +1 -1
  198. package/views/3d/support/geometryUtils/sphere.js +1 -1
  199. package/views/3d/terrain/OverlayManager.js +1 -1
  200. package/views/3d/terrain/OverlayRenderer.js +1 -1
  201. package/views/3d/terrain/PatchRenderData.js +1 -1
  202. package/views/3d/terrain/TerrainSurface.js +1 -1
  203. package/views/3d/terrain/Tile.js +1 -1
  204. package/views/3d/terrain/tileUtils.js +1 -1
  205. package/views/3d/webgl-engine/collections/Component/ComponentObjectCollection.js +1 -1
  206. package/views/3d/webgl-engine/collections/Component/IndexRange/ComponentRangeRunLengthEncoded.js +1 -1
  207. package/views/3d/webgl-engine/lib/DrapedHeatmapRenderer.js +1 -1
  208. package/views/3d/webgl-engine/lib/Octree.js +1 -1
  209. package/views/3d/webgl-engine/lib/edgeRendering/EdgeProcessingWorker.js +1 -1
  210. package/views/3d/webgl-engine/lib/edgeRendering/EdgeView.js +1 -1
  211. package/views/3d/webgl-engine/lib/edgeRendering/EdgeWorkerHandle.js +1 -1
  212. package/views/3d/webgl-engine/lib/verticalOffsetUtils.js +1 -1
  213. package/views/3d/webgl-engine/materials/HeatmapDensityMaterial.js +1 -1
  214. package/views/3d/webgl-engine/shaders/HeatmapTechnique.js +1 -1
  215. package/views/interactive/snapping/FeatureSnappingEngine.js +1 -1
  216. package/views/interactive/snapping/LineSnapper.js +1 -1
  217. package/views/interactive/snapping/ParallelLineSnapper.js +1 -1
  218. package/views/interactive/snapping/RightAngleSnapper.js +1 -1
  219. package/views/interactive/snapping/RightAngleTriangleSnapper.js +1 -1
  220. package/views/interactive/snapping/SnappingManager.js +1 -1
  221. package/views/interactive/snapping/candidates/EdgeSnappingCandidate.js +1 -1
  222. package/views/interactive/snapping/candidates/FeatureSnappingCandidate.js +1 -1
  223. package/views/interactive/snapping/candidates/IntersectionSnappingCandidate.js +1 -1
  224. package/views/interactive/snapping/candidates/LineSnappingCandidate.js +1 -1
  225. package/views/interactive/snapping/candidates/ParallelLineSnappingCandidate.js +1 -1
  226. package/views/interactive/snapping/candidates/RightAngleSnappingCandidate.js +1 -1
  227. package/views/interactive/snapping/candidates/RightAngleTriangleSnappingCandidate.js +1 -1
  228. package/views/interactive/snapping/candidates/SnappingCandidate.js +1 -1
  229. package/views/interactive/snapping/candidates/VertexSnappingCandidate.js +1 -1
  230. package/views/interactive/snapping/featureSources/FeatureCollectionSnappingSource.js +1 -1
  231. package/views/interactive/snapping/featureSources/FeatureServiceSnappingSource.js +1 -1
  232. package/views/interactive/snapping/featureSources/GraphicsSnappingSource.js +1 -1
  233. package/views/interactive/snapping/featureSources/SceneLayerSnappingSource.js +5 -0
  234. package/views/interactive/snapping/featureSources/featureServiceSource/FeatureServiceSnappingSourceWorkerHandle.js +1 -1
  235. package/views/interactive/snapping/featureSources/queryEngineUtils.js +1 -1
  236. package/views/interactive/snapping/featureSources/sceneLayerSource/SceneLayerSnappingSourceWorker.js +5 -0
  237. package/views/interactive/snapping/featureSources/sceneLayerSource/SceneLayerSnappingSourceWorkerHandle.js +5 -0
  238. package/views/interactive/snapping/hints/IntersectionSnappingHint.js +1 -1
  239. package/views/interactive/snapping/hints/LineSnappingHint.js +1 -1
  240. package/views/interactive/snapping/hints/ParallelSnappingHint.js +1 -1
  241. package/views/interactive/snapping/hints/PointSnappingHint.js +1 -1
  242. package/views/interactive/snapping/hints/RightAngleSnappingHint.js +1 -1
  243. package/views/interactive/snapping/hints/SnappingHint.js +1 -1
  244. package/views/interactive/snapping/snappingUtils.js +1 -1
  245. package/views/support/colorUtils.js +1 -1
  246. package/webmap/Bookmark.js +1 -1
  247. package/widgets/AreaMeasurement3D/AreaMeasurement3DViewModel.js +1 -1
  248. package/widgets/DirectLineMeasurement3D/DirectLineMeasurement3DViewModel.js +1 -1
  249. package/widgets/FeatureTable/Grid/Grid.js +2 -2
  250. package/widgets/LineOfSight/LineOfSightViewModel.js +1 -1
  251. package/widgets/Sketch/SketchViewModel.js +1 -1
  252. package/widgets/Slice/SliceViewModel.js +1 -1
  253. package/widgets/support/AnalysisViewModel.js +1 -1
  254. package/widgets/support/InteractiveAnalysisViewModel.js +1 -1
  255. package/assets/esri/core/workers/chunks/2266d6388444ac5d50b3.js +0 -1
  256. package/assets/esri/core/workers/chunks/3f6b17c9d2629ed396da.js +0 -1
  257. package/assets/esri/core/workers/chunks/404f1d7bce014c7e6965.js +0 -1
  258. package/assets/esri/core/workers/chunks/4e4994665549435f51ee.js +0 -1
  259. package/assets/esri/core/workers/chunks/503226c5c612feab4115.js +0 -1
  260. package/assets/esri/core/workers/chunks/528033aa0d663b4d41bf.js +0 -1
  261. package/assets/esri/core/workers/chunks/54af957c5330933805a3.js +0 -1
  262. package/assets/esri/core/workers/chunks/6ef8de3aa9a8d9c22161.js +0 -1
  263. package/assets/esri/core/workers/chunks/72d8b2ad36f0d0a40a0d.js +0 -1
  264. package/assets/esri/core/workers/chunks/756befc4aa3354e1db1d.js +0 -972
  265. package/assets/esri/core/workers/chunks/8a4e2831e8fdde530b21.js +0 -1
  266. package/assets/esri/core/workers/chunks/9b9821772b6cbe189fe0.js +0 -1
  267. package/assets/esri/core/workers/chunks/9c4d41f20c1a94147344.js +0 -1
  268. package/assets/esri/core/workers/chunks/9cfd66ee9e6328b3693a.js +0 -1
  269. package/assets/esri/core/workers/chunks/b548bf032c8af34fe155.js +0 -1
  270. package/assets/esri/core/workers/chunks/bbcae04235830debd814.js +0 -1
  271. package/assets/esri/core/workers/chunks/bc6f5927f07c5993b998.js +0 -1
  272. package/assets/esri/core/workers/chunks/c0bf663240df7be68131.js +0 -2
  273. package/assets/esri/core/workers/chunks/cd9668acbe3babd2b188.js +0 -1
  274. package/assets/esri/core/workers/chunks/d53c7a9ede56be749f2b.js +0 -1
  275. package/assets/esri/core/workers/chunks/e07930ab66f89d215666.js +0 -1
  276. package/assets/esri/core/workers/chunks/f72de828ede4d0c5e9d7.js +0 -1
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.24/esri/copyright.txt for details.
4
4
  */
5
- import e from"../../../../../core/Logger.js";import{isSome as t,isNone as o,applySome as r,unwrap as n}from"../../../../../core/maybe.js";import i from"../../../../../core/PooledArray.js";import{e as s,t as a}from"../../../../../chunks/mat3.js";import{c as m}from"../../../../../chunks/mat3f32.js";import{d as c,v as l,t as p}from"../../../../../chunks/vec3.js";import{c as h}from"../../../../../chunks/vec3f64.js";import{c as u}from"../../../../../chunks/vec4f32.js";import{ColorMixModeEnum as f,encodeSymbolColor as b}from"../../../layers/support/symbolColorUtils.js";import{clone as g,radius as d}from"../../../support/orientedBoundingBox.js";import{glLayout as y}from"../../../support/buffer/glUtil.js";import{newLayout as C}from"../../../support/buffer/InterleavedLayout.js";import j from"./ComponentData.js";import{State as x,ComponentObject as M}from"./ComponentObject.js";import{isVaryingComponentParameters as w}from"./interface.js";import _ from"./IntersectionGeometry.js";import{Renderable as v}from"./Renderable.js";import{RenderGeometry as S}from"./RenderGeometry.js";import{RenderSubmitSystem as D}from"./RenderSubmitSystem.js";import{createVertexBufferLayout as A}from"./SourceGeometry.js";import{ComponentParametersVarying as O,ComponentParametersUniform as P,ComponentParameterSummary as k,ComponentMaterial as I}from"./Material/ComponentMaterial.js";import{getVisibility as R,updateVisibilityWithCount as U}from"../../lib/ComponentUtils.js";import{assert as B}from"../../lib/Util.js";import{VertexAttribute as T}from"../../lib/VertexAttribute.js";import{BufferManager as G}from"../../lib/TextureBackedBuffer/BufferManager.js";import{BufferObject as V}from"../../../../webgl/BufferObject.js";import{Usage as E,PrimitiveType as N}from"../../../../webgl/enums.js";import{VertexArrayObject as L}from"../../../../webgl/VertexArrayObject.js";const H=e.getLogger("esri.views.3d.webgl-engine.collections.Component.ComponentObjectCollection");class q{constructor(e){this._renderManager=e,this._objects=[new i,new i],this._renderSubmit=new D(this),this._renderManager.register(this._renderSubmit),this._componentBufferManager=new G(e.rctx)}dispose(){B(0===this._objects[x.Hidden].length&&0===this._objects[x.Visible].length,"ObjectCollection should be empty upon disposal"),this._componentBufferManager.destroy()}createObject(e){const t=new M;return t.toMapSpace=e.toMapSpace,t.transform=e.transform,t.obb=g(e.obb),t.components=new j(this._componentBufferManager,e.geometry.componentOffsets),t.renderable=this._createRenderable(e,t.components),t.intersectionGeometry=new _(e.geometry.positionData,t.components),this._objects[t.visible].push(t),t}destroyObject(e){const t=e;this._objects[t.visible].removeUnordered(t),t.dispose(),this._notifyDirty()}setObjectVisibility(e,t){const o=e;t!==o.visible&&(this._objects[o.visible].removeUnordered(o),this._objects[t].push(o),o.visible=t,this._notifyDirty())}preSubmit(e){const t=e.camera.eye;this.visibleObjects.forAll((e=>e.renderable.meta.cameraDepthSquared=c(t,e.obb.center)))}getMaterial(e){return e.renderable.material}updateMaterial(e,t){const o=e.renderable.material;t(o),o.dirty&&this._notifyDirty()}setAllComponentVisibilities(e,t){const o=e;o.components.visibility.reset(t),o.components.visibilityDirty(),this._notifyDirty()}forEachVisibleComponent(e,t){return e.components.visibility.forEachComponent(t)}getComponentCount(e){const t=e,o=t.components.visibility.componentCount();return{visible:o,invisible:t.components.count-o}}setComponentData(e,t){const o=e,r=o.renderable.material;if(w(t)){const e=o.components,n=e.materialDataBuffer,i=e.materialDataIndices,s={castShadows:!0,pickable:!0,externalColor:u(),externalColorMixMode:f.Multiply},a=n.textureBuffer,m=new Uint8Array(4),c=new Uint32Array(m.buffer);let l=0,p=0,h=0,g=!1,d=0;for(let o=0;o<e.count;o++)t(o,s),l+=+(s.externalColor[3]<1),p+=+(s.externalColorMixMode===f.Replace&&1===s.externalColor[3]),h+=+s.castShadows,b(s.externalColor,s.externalColorMixMode,m),m[2]=254&m[2]|+s.castShadows,a.setData(i[o],0,m[0],m[1],m[2],m[3]),g=g||o>0&&d!==c[0],d=c[0],s.pickable!==R(e.pickability,o)&&(e.pickability=U(e.pickability,e.count,o,s.pickable));g?(r.componentParameters=new O,r.componentParameters.castShadows=W(h,e.count),r.componentParameters.transparent=W(l,e.count),r.componentParameters.opaqueOverride=W(p,e.count),r.componentParameters.texture=a,a.updateTexture()):(r.componentParameters=new P,r.componentParameters.castShadows=s.castShadows?k.All:k.None,r.componentParameters.externalColor=s.externalColor,r.componentParameters.externalColorMixMode=s.externalColorMixMode)}else r.componentParameters=new P,r.componentParameters.castShadows=t.castShadows?k.All:k.None,r.componentParameters.externalColor=t.externalColor,r.componentParameters.externalColorMixMode=t.externalColorMixMode;this._notifyDirty()}getComponentAabb(e,t,o){return e.intersectionGeometry.getComponentAabb(t,o)}getComponentObb(e){return e.obb}getObjectTransform(e){return e.transform}getComponentPositions(e,t,o){return e.intersectionGeometry.getComponentPositions(t,o)}intersect(e,o,r,n,i,m){const c=e;t(i)&&(i.localOrigin=c.transform.position);const h=s(X,c.transform.rotationScale);l(F,o,c.transform.position),l(J,r,c.transform.position),p(F,F,h),p(J,J,h);const u=a(X,h);return c.intersectionGeometry.intersect(F,J,n,u,i,m)}addEdges(e,t,o,r){const n=e,{indices:i,positions:s}=n.intersectionGeometry,a=n.components.offsets;return t.addComponentObject(e,n.transform,{center:n.obb.center,radius:d(n.obb)},s,i,a,o,r)}addComponentHighlight(e,t){const r=e.components;o(r.highlightCounts)&&(r.highlightCounts=new Uint32Array(r.count+1));0===r.highlightCounts[t]++&&(r.highlightsDirty(),this._notifyDirty()),r.highlightCounts[r.count]++}removeComponentHighlight(e,t){const r=e.components;if(o(r.highlightCounts))return void H.warn("Removing non-existing highlight.");const n=r.highlightCounts[t],i=r.highlightCounts[r.count];if(0!==n){if(n>1)return r.highlightCounts[t]=n-1,void(r.highlightCounts[r.count]=i-1);r.highlightCounts[t]=0,r.highlightsDirty(),this._notifyDirty(),1===i?r.highlightCounts=null:r.highlightCounts[r.count]=i-1}else H.warn("Removing non-existing highlight.")}clearHighlights(e){const o=e.components;t(o.highlightCounts)&&(o.highlightCounts=null,o.highlightsDirty(),this._notifyDirty())}getObjectGPUMemoryUsage(e){return e.renderable.meta.gpuMemoryEstimate}get visibleObjects(){return this._objects[x.Visible]}_createRenderable(e,o){const i=this._renderManager.rctx,s=e.geometry,a=s.vertices.layoutParameters,m=V.createVertex(i,E.STATIC_DRAW,s.vertices.data),c=r(s.indices,(e=>V.createIndex(i,E.STATIC_DRAW,e))),l=y(A(a)),p=new Uint16Array(s.vertices.count);for(let r=0;r<o.count;r++){const e=o.offsets[r],n=o.offsets[r+1],i=o.materialDataIndices[r];if(t(s.indices))for(let t=e;t<n;t++){p[s.indices[t]]=i}else for(let t=e;t<n;t++)p[t]=i}const h=V.createVertex(i,E.STATIC_DRAW,p.buffer),u=new I(e.transform,e.toMapSpace),f=new L(i,u.attributeLocations,{data:l,componentIndices:z},{data:m,componentIndices:h},n(c)),b=new S(f,N.TRIANGLES,a,t(c)),g={cameraDepthSquared:.5,gpuMemoryEstimate:m.byteSize+h.byteSize+(t(c)?c.byteSize:0)};return new v(u,b,g)}_notifyDirty(){this._renderManager.notifyDirty()}}const z=y(C().u16(T.COMPONENTINDEX));function W(e,t){return e===t?k.All:0===e?k.None:k.Some}const X=m(),F=h(),J=h();export{q as ComponentObjectCollection};
5
+ import e from"../../../../../core/Logger.js";import{isSome as t,isNone as o,applySome as n,unwrap as r}from"../../../../../core/maybe.js";import i from"../../../../../core/PooledArray.js";import{e as s,t as a}from"../../../../../chunks/mat3.js";import{c}from"../../../../../chunks/mat3f32.js";import{d as m,v as l,t as p}from"../../../../../chunks/vec3.js";import{a as f,c as h}from"../../../../../chunks/vec3f64.js";import{c as u}from"../../../../../chunks/vec4f32.js";import{a as b}from"../../../../../chunks/vec32.js";import{c as g}from"../../../../../chunks/vec33.js";import{ColorMixModeEnum as d,encodeSymbolColor as y}from"../../../layers/support/symbolColorUtils.js";import{clone as C,radius as j}from"../../../support/orientedBoundingBox.js";import{glLayout as x}from"../../../support/buffer/glUtil.js";import{newLayout as w}from"../../../support/buffer/InterleavedLayout.js";import _ from"./ComponentData.js";import{State as v,ComponentObject as M}from"./ComponentObject.js";import{isVaryingComponentParameters as S}from"./interface.js";import D from"./IntersectionGeometry.js";import{Renderable as A}from"./Renderable.js";import{RenderGeometry as P}from"./RenderGeometry.js";import{RenderSubmitSystem as I}from"./RenderSubmitSystem.js";import{createVertexBufferLayout as O}from"./SourceGeometry.js";import{ComponentParametersVarying as E,ComponentParametersUniform as R,ComponentParameterSummary as k,ComponentMaterial as B}from"./Material/ComponentMaterial.js";import{getVisibility as U,updateVisibilityWithCount as T}from"../../lib/ComponentUtils.js";import{assert as V}from"../../lib/Util.js";import{VertexAttribute as G}from"../../lib/VertexAttribute.js";import{EdgeInputBufferLayout as L}from"../../lib/edgeRendering/bufferLayouts.js";import{extractComponentsEdgeLocationsLayout as N}from"../../lib/edgeRendering/EdgeProcessingWorker.js";import{BufferManager as H}from"../../lib/TextureBackedBuffer/BufferManager.js";import{BufferObject as W}from"../../../../webgl/BufferObject.js";import{Usage as q,PrimitiveType as z}from"../../../../webgl/enums.js";import{VertexArrayObject as X}from"../../../../webgl/VertexArrayObject.js";const Y=e.getLogger("esri.views.3d.webgl-engine.collections.Component.ComponentObjectCollection");class F{constructor(e){this._renderManager=e,this._objects=[new i,new i],this._renderSubmit=new I(this),this._renderManager.register(this._renderSubmit),this._componentBufferManager=new H(e.rctx)}dispose(){V(0===this._objects[v.Hidden].length&&0===this._objects[v.Visible].length,"ObjectCollection should be empty upon disposal"),this._componentBufferManager.destroy()}createObject(e){const t=new M;return t.toMapSpace=e.toMapSpace,t.transform=e.transform,t.obb=C(e.obb),t.components=new _(this._componentBufferManager,e.geometry.componentOffsets),t.renderable=this._createRenderable(e,t.components),t.intersectionGeometry=new D(e.geometry.positionData,t.components),this._objects[t.visible].push(t),t}destroyObject(e){const t=e;this._objects[t.visible].removeUnordered(t),t.dispose(),this._notifyDirty()}setObjectVisibility(e,t){const o=e;t!==o.visible&&(this._objects[o.visible].removeUnordered(o),this._objects[t].push(o),o.visible=t,this._notifyDirty())}preSubmit(e){const t=e.camera.eye;this.visibleObjects.forAll((e=>e.renderable.meta.cameraDepthSquared=m(t,e.obb.center)))}getMaterial(e){return e.renderable.material}updateMaterial(e,t){const o=e.renderable.material;t(o),o.dirty&&this._notifyDirty()}setAllComponentVisibilities(e,t){const o=e;o.components.visibility.reset(t),o.components.visibilityDirty(),this._notifyDirty()}forEachVisibleComponent(e,t){return e.components.visibility.forEachComponent(t)}getComponentCount(e){const t=e,o=t.components.visibility.componentCount();return{visible:o,invisible:t.components.count-o}}setComponentData(e,t){const o=e,n=o.renderable.material;if(S(t)){const e=o.components,r=e.materialDataBuffer,i=e.materialDataIndices,s={castShadows:!0,pickable:!0,externalColor:u(),externalColorMixMode:d.Multiply},a=r.textureBuffer,c=new Uint8Array(4),m=new Uint32Array(c.buffer);let l=0,p=0,f=0,h=!1,b=0;for(let o=0;o<e.count;o++)t(o,s),l+=+(s.externalColor[3]<1),p+=+(s.externalColorMixMode===d.Replace&&1===s.externalColor[3]),f+=+s.castShadows,y(s.externalColor,s.externalColorMixMode,c),c[2]=254&c[2]|+s.castShadows,a.setData(i[o],0,c[0],c[1],c[2],c[3]),h=h||o>0&&b!==m[0],b=m[0],s.pickable!==U(e.pickability,o)&&(e.pickability=T(e.pickability,e.count,o,s.pickable));h?(n.componentParameters=new E,n.componentParameters.castShadows=K(f,e.count),n.componentParameters.transparent=K(l,e.count),n.componentParameters.opaqueOverride=K(p,e.count),n.componentParameters.texture=a,a.updateTexture()):(n.componentParameters=new R,n.componentParameters.castShadows=s.castShadows?k.All:k.None,n.componentParameters.externalColor=s.externalColor,n.componentParameters.externalColorMixMode=s.externalColorMixMode)}else n.componentParameters=new R,n.componentParameters.castShadows=t.castShadows?k.All:k.None,n.componentParameters.externalColor=t.externalColor,n.componentParameters.externalColorMixMode=t.externalColorMixMode;this._notifyDirty()}getComponentAabb(e,t,o){return e.intersectionGeometry.getComponentAabb(t,o)}getComponentObb(e){return e.obb}getObjectTransform(e){return e.transform}getComponentPositions(e,t,o){return e.intersectionGeometry.getComponentPositions(t,o)}intersect(e,o,n,r,i,c){const m=e;t(i)&&(i.localOrigin=m.transform.position);const f=s(Q,m.transform.rotationScale);l(Z,o,m.transform.position),l($,n,m.transform.position),p(Z,Z,f),p($,$,f);const h=a(Q,f);return m.intersectionGeometry.intersect(Z,$,r,h,i,c)}addEdges(e,t,o,n){const r=e,{indices:i,positions:s}=r.intersectionGeometry,a=r.components.offsets;return t.addComponentObject(e,r.transform,{center:r.obb.center,radius:j(r.obb)},s,i,a,o,n)}async extractEdgeInformation(e,t,o){const n=e,r=n.components.visibility;if(r.allInvisible())return{buffer:N.createBuffer(0),origin:[0,0,0]};const{indices:i,positions:s}=n.intersectionGeometry,a=n.components.offsets,c=L.createBuffer(s.count);g(c.position,s),b(c.position,c.position,n.transform.rotationScale),this._setComponentIndices(c.componentIndex,i,a);const m=c.count,l=this._computeVisibilityIndices(i,r,a,m);return{origin:f(n.transform.position),buffer:await t.extractComponentsEdgeLocations({indices:l,indicesLength:l.length,skipDeduplicate:!0,data:c,writerSettings:{reducedPrecision:!1,variants:0}},o)}}_setComponentIndices(e,t,o){let n=0;for(let r=0;r<o.length-1;r++){const i=o[r],s=o[r+1];for(let o=i;o<s;o++){const r=t?t[o]:o;e.set(r,n)}n++}}_computeVisibilityIndices(e,t,o,n){if(e&&t.allVisible())return e;let r=0;t.forEachComponentRange(((e,t)=>(r+=o[t]-o[e],!0)));const i=2===(null==e?void 0:e.BYTES_PER_ELEMENT)||n<=65536?new Uint16Array(r):new Uint32Array(r);let s=0;return t.forEachComponentRange(((t,n)=>{const r=o[t],a=o[n];for(let o=r;o<a;o++)i[s++]=e?e[o]:o;return!0})),i}addComponentHighlight(e,t){const n=e.components;o(n.highlightCounts)&&(n.highlightCounts=new Uint32Array(n.count+1));0===n.highlightCounts[t]++&&(n.highlightsDirty(),this._notifyDirty()),n.highlightCounts[n.count]++}removeComponentHighlight(e,t){const n=e.components;if(o(n.highlightCounts))return void Y.warn("Removing non-existing highlight.");const r=n.highlightCounts[t],i=n.highlightCounts[n.count];if(0!==r){if(r>1)return n.highlightCounts[t]=r-1,void(n.highlightCounts[n.count]=i-1);n.highlightCounts[t]=0,n.highlightsDirty(),this._notifyDirty(),1===i?n.highlightCounts=null:n.highlightCounts[n.count]=i-1}else Y.warn("Removing non-existing highlight.")}clearHighlights(e){const o=e.components;t(o.highlightCounts)&&(o.highlightCounts=null,o.highlightsDirty(),this._notifyDirty())}getObjectGPUMemoryUsage(e){return e.renderable.meta.gpuMemoryEstimate}get visibleObjects(){return this._objects[v.Visible]}_createRenderable(e,o){const i=this._renderManager.rctx,s=e.geometry,a=s.vertices.layoutParameters,c=W.createVertex(i,q.STATIC_DRAW,s.vertices.data),m=n(s.indices,(e=>W.createIndex(i,q.STATIC_DRAW,e))),l=x(O(a)),p=new Uint16Array(s.vertices.count);for(let n=0;n<o.count;n++){const e=o.offsets[n],r=o.offsets[n+1],i=o.materialDataIndices[n];if(t(s.indices))for(let t=e;t<r;t++){p[s.indices[t]]=i}else for(let t=e;t<r;t++)p[t]=i}const f=W.createVertex(i,q.STATIC_DRAW,p.buffer),h=new B(e.transform,e.toMapSpace),u=new X(i,h.attributeLocations,{data:l,componentIndices:J},{data:c,componentIndices:f},r(m)),b=new P(u,z.TRIANGLES,a,t(m)),g={cameraDepthSquared:.5,gpuMemoryEstimate:c.byteSize+f.byteSize+(t(m)?m.byteSize:0)};return new A(h,b,g)}_notifyDirty(){this._renderManager.notifyDirty()}}const J=x(w().u16(G.COMPONENTINDEX));function K(e,t){return e===t?k.All:0===e?k.None:k.Some}const Q=c(),Z=h(),$=h();export{F as ComponentObjectCollection};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.24/esri/copyright.txt for details.
4
4
  */
5
- class t{constructor(t){this._totalCount=t,this._indexRanges=[0,t]}componentCount(){const t=this._indexRanges;let n=0;for(let e=0;e<t.length;e+=2)n+=t[e+1];return n}reset(t){"all"===t||t.length===this._totalCount?this._indexRanges=[0,this._totalCount]:this._indexRanges=n(t)}forEachComponent(t){const n=this._indexRanges;for(let e=0;e<n.length;e+=2){const s=n[e],o=s+n[e+1];for(let n=s;n<o;n++)if(!t(n))return!1}return!0}forEachComponentRange(t){const n=this._indexRanges;for(let e=0;e<n.length;e+=2){const s=n[e];if(!t(s,s+n[e+1]))return!1}return!0}computeOffsetRanges(t){const n=new Array(this._indexRanges.length),e=this._indexRanges;for(let s=0;s<e.length;s+=2){const o=e[s],r=o+e[s+1],h=t[o],i=t[r];n[s]=h,n[s+1]=i-h}return n}}function n(t){const n=new Array;if(0===t.length)return n;let e=t[0],s=1;for(let o=1;o<t.length;o++){const r=t[o];e+s===r?s+=1:(n.push(e),n.push(s),e=r,s=1)}return n.push(e),n.push(s),n}export{t as ComponentRangeRunLengthEncoded};
5
+ class t{constructor(t){this._totalCount=t,this._indexRanges=[0,t]}allVisible(){return this.componentCount()===this._totalCount}allInvisible(){return 0===this._indexRanges.length}componentCount(){const t=this._indexRanges;let n=0;for(let e=0;e<t.length;e+=2)n+=t[e+1];return n}reset(t){"all"===t||t.length===this._totalCount?this._indexRanges=[0,this._totalCount]:this._indexRanges=n(t)}forEachComponent(t){const n=this._indexRanges;for(let e=0;e<n.length;e+=2){const s=n[e],o=s+n[e+1];for(let n=s;n<o;n++)if(!t(n))return!1}return!0}forEachComponentRange(t){const n=this._indexRanges;for(let e=0;e<n.length;e+=2){const s=n[e];if(!t(s,s+n[e+1]))return!1}return!0}computeOffsetRanges(t){const n=new Array(this._indexRanges.length),e=this._indexRanges;for(let s=0;s<e.length;s+=2){const o=e[s],r=o+e[s+1],i=t[o],l=t[r];n[s]=i,n[s+1]=l-i}return n}}function n(t){const n=new Array;if(0===t.length)return n;let e=t[0],s=1;for(let o=1;o<t.length;o++){const r=t[o];e+s===r?s+=1:(n.push(e),n.push(s),e=r,s=1)}return n.push(e),n.push(s),n}export{t as ComponentRangeRunLengthEncoded};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.24/esri/copyright.txt for details.
4
4
  */
5
- import{_ as t}from"../../../../chunks/tslib.es6.js";import{releaseMaybe as e,disposeMaybe as r,isSome as i}from"../../../../core/maybe.js";import"../../../../core/Logger.js";import"../../../../core/accessorSupport/ensureType.js";import"../../../../core/arrayUtils.js";import"../../../../core/has.js";import"../../../../core/accessorSupport/set.js";import{subclass as s}from"../../../../core/accessorSupport/decorators/subclass.js";import{ViewingMode as a}from"../../../ViewingMode.js";import{createQuadVAO as o}from"./glUtil3D.js";import{SortedRenderGeometryRenderer as h}from"./SortedRenderGeometryRenderer.js";import{isHeatMapDensityMaterial as n}from"../materials/HeatmapDensityMaterial.js";import{HeatmapTechnique as c,HeatmapTechniqueConfiguration as m}from"../shaders/HeatmapTechnique.js";import{TargetType as p,DepthStencilTargetType as l,TextureType as d,PixelFormat as u,SizedPixelFormat as _,PixelType as g,TextureSamplingMode as R,TextureWrapMode as f,ClearBufferBit as x}from"../../../webgl/enums.js";import{FramebufferObject as y}from"../../../webgl/FramebufferObject.js";import{Texture as w}from"../../../webgl/Texture.js";import{vertexCount as T}from"../../../webgl/Util.js";let b=class extends h{constructor(){super(...arguments),this.type="draped-heatmap"}initialize(){super.initialize();const t={colorTarget:p.TEXTURE,depthStencilTarget:l.NONE,width:0,height:0},{capabilities:e}=this.rctx,{R32F:r}=e.colorBufferFloat,{textureFloatLinear:i}=e.textureFloat,s=null!=r,h={target:d.TEXTURE_2D,pixelFormat:s?u.RED:u.RGBA,internalFormat:s?_.R32F:u.RGBA,dataType:g.FLOAT,samplingMode:i?R.LINEAR:R.NEAREST,wrapMode:f.CLAMP_TO_EDGE,width:0,height:0};this._densityMap=new y(this.rctx,t,h),this._quad=o(this.rctx);const n={target:d.TEXTURE_2D,pixelFormat:u.RGBA,dataType:g.UNSIGNED_BYTE,samplingMode:R.LINEAR,wrapMode:f.CLAMP_TO_EDGE,width:1,height:1},x=new w(this.rctx,n,new Uint8ClampedArray(4));this._colorRamp=x,this._technique=new c({rctx:this.rctx,viewingMode:a.Local},new m),this._heatmapParameters={colorRamp:x,densityMap:this._densityMap.colorTexture,searchRadius:1,minDensity:0,maxDensity:100,fieldTotal:0,__tagStrict:"NoParameters"}}destroy(){this._technique=e(this._technique),this._densityMap=r(this._densityMap),this._quad=r(this._quad),this._colorRamp=r(this._colorRamp)}get hasHighlights(){return!1}get hasWater(){return!1}get rendersOccluded(){return!1}get _heatmapDensityMaterialRenderers(){return this._sortedMaterialRenderers.filter(D)}render(t,e){const r=this._heatmapDensityMaterialRenderers,s=r.length;if(s<1)return;const a=this.rctx.getBoundFramebufferObject(),o=this.rctx.getViewport(),h=r[0].material.parameters,{pixelRatio:n}=h,c=Math.ceil(o.width*n),m=Math.ceil(o.height*n);this._densityMap.resize(c,m),this.rctx.bindFramebuffer(this._densityMap),this.rctx.setViewport(0,0,c,m),this.rctx.clear(x.COLOR_BUFFER_BIT);let p=!1;for(let i=0;i<s;i++){const s=r[i];s.material.shouldRender(t)&&(p=p||s.materialRenderer.render(t.pass,e))}if(this.rctx.bindFramebuffer(a),this.rctx.setViewport(o.x,o.y,o.width,o.height),!p)return;const{searchRadius:l,minDensity:d,maxDensity:u,fieldTotal:_,colorRampData:g}=h,R=this._heatmapParameters;if(R.searchRadius=l,R.fieldTotal=_,R.searchRadius=l,R.minDensity=d,R.maxDensity=u,i(g)&&g!==this._colorRampData){const{colorRamp:t}=R,e=t.descriptor.width,r=g.length/4;r!==e&&t.resize(r,1),t.setData(g),this._colorRampData=g}this.rctx.bindVAO(this._quad),this.rctx.useProgram(this._technique.program),this._technique.bindPipelineState(this.rctx),this._technique.bindPass(R,t.bindParameters),this.rctx.drawArrays(this._technique.primitiveType,0,T(this._quad,"geometry"))}};function D(t){return n(t.material)}b=t([s("esri.views.3d.webgl-engine.lib.DrapedHeatmapRenderer")],b);export{b as DrapedHeatmapRenderer};
5
+ import{_ as t}from"../../../../chunks/tslib.es6.js";import{equalsShallow as e}from"../../../../core/lang.js";import{releaseMaybe as r,disposeMaybe as a,isSome as i}from"../../../../core/maybe.js";import{watch as s}from"../../../../core/reactiveUtils.js";import{property as o}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/accessorSupport/ensureType.js";import{subclass as h}from"../../../../core/accessorSupport/decorators/subclass.js";import{ViewingMode as m}from"../../../ViewingMode.js";import{createQuadVAO as n}from"./glUtil3D.js";import{SortedRenderGeometryRenderer as p}from"./SortedRenderGeometryRenderer.js";import{HeatmapPassParameters as l,HeatmapTechnique as c,HeatmapTechniqueConfiguration as d}from"../shaders/HeatmapTechnique.js";import{TargetType as u,DepthStencilTargetType as _,TextureType as R,PixelFormat as y,SizedPixelFormat as g,PixelType as f,TextureSamplingMode as x,TextureWrapMode as D,ClearBufferBit as T}from"../../../webgl/enums.js";import{FramebufferObject as w}from"../../../webgl/FramebufferObject.js";import{Texture as P}from"../../../webgl/Texture.js";import{vertexCount as b}from"../../../webgl/Util.js";let E=class extends p{constructor(t){super(t),this.pixelRatio=1,this._colorRampData=new Uint8ClampedArray(4),this.type="draped-heatmap",this._heatmapParameters=new l}initialize(){const t={colorTarget:u.TEXTURE,depthStencilTarget:_.NONE,width:0,height:0},{capabilities:r}=this.rctx,{R32F:a}=r.colorBufferFloat,{textureFloatLinear:i}=r.textureFloat,o=null!=a,h={target:R.TEXTURE_2D,pixelFormat:o?y.RED:y.RGBA,internalFormat:o?g.R32F:y.RGBA,dataType:f.FLOAT,samplingMode:i?x.LINEAR:x.NEAREST,wrapMode:D.CLAMP_TO_EDGE,width:0,height:0};this._densityMap=new w(this.rctx,t,h),this._quad=n(this.rctx);const p=this._colorRampData,l={target:R.TEXTURE_2D,pixelFormat:y.RGBA,dataType:f.UNSIGNED_BYTE,samplingMode:x.LINEAR,wrapMode:D.CLAMP_TO_EDGE,width:p.length/4,height:1};this._colorRamp=new P(this.rctx,l,p),this._technique=new c({rctx:this.rctx,viewingMode:m.Local},new d),this._heatmapParameters.densityMap=this._densityMap.colorTexture,this.own(s((()=>[this.colorRampData,this.minDensity,this.maxDensity,this.fieldTotal,this.pixelRatio,this.searchRadius]),(()=>this.rendererContext.notifyContentChanged()),{equals:e}))}destroy(){this._technique=r(this._technique),this._densityMap=a(this._densityMap),this._quad=a(this._quad),this._colorRamp=a(this._colorRamp)}get searchRadius(){return this._heatmapParameters.searchRadius}set searchRadius(t){t!==this._heatmapParameters.searchRadius&&(this._heatmapParameters.searchRadius=t,this.notifyChange("searchRadius"))}get minDensity(){return this._heatmapParameters.minDensity}set minDensity(t){t!==this._heatmapParameters.minDensity&&(this._heatmapParameters.minDensity=t,this.notifyChange("minDensity"))}get maxDensity(){return this._heatmapParameters.maxDensity}set maxDensity(t){t!==this._heatmapParameters.maxDensity&&(this._heatmapParameters.maxDensity=t,this.notifyChange("maxDensity"))}get fieldTotal(){return this._heatmapParameters.fieldTotal}set fieldTotal(t){this._heatmapParameters.fieldTotal=t,this.notifyChange("fieldTotal")}get colorRampData(){return this._colorRampData}set colorRampData(t){const{colorRamp:e}=this._heatmapParameters;if(i(e)&&t!==this._colorRampData){const r=e.descriptor.width,a=t.length/4;a!==r&&e.resize(a,1),e.setData(t)}this._colorRampData=t}get _colorRamp(){return this._heatmapParameters.colorRamp}set _colorRamp(t){this._heatmapParameters.colorRamp=t}get hasHighlights(){return!1}get hasWater(){return!1}get rendersOccluded(){return!1}render(t,e){const r=this._sortedMaterialRenderers,a=r.length;if(a<1)return;const i=this.rctx.getBoundFramebufferObject(),s=this.rctx.getViewport(),{pixelRatio:o}=this,h=Math.ceil(s.width*o),m=Math.ceil(s.height*o);this._densityMap.resize(h,m),this.rctx.bindFramebuffer(this._densityMap),this.rctx.setViewport(0,0,h,m),this.rctx.clear(T.COLOR_BUFFER_BIT);let n=!1;for(let p=0;p<a;p++){const a=r.getItemAt(p);a.material.shouldRender(t)&&(n=n||a.materialRenderer.render(t.pass,e))}this.rctx.bindFramebuffer(i),this.rctx.setViewport(s.x,s.y,s.width,s.height),n&&(this.rctx.bindVAO(this._quad),this.rctx.useProgram(this._technique.program),this._technique.bindPipelineState(this.rctx),this._technique.bindPass(this._heatmapParameters,t.bindParameters),this.rctx.drawArrays(this._technique.primitiveType,0,b(this._quad,"geometry")))}};t([o()],E.prototype,"searchRadius",null),t([o()],E.prototype,"minDensity",null),t([o()],E.prototype,"maxDensity",null),t([o()],E.prototype,"fieldTotal",null),t([o()],E.prototype,"pixelRatio",void 0),t([o()],E.prototype,"colorRampData",null),t([o()],E.prototype,"_colorRampData",void 0),E=t([h("esri.views.3d.webgl-engine.lib.DrapedHeatmapRenderer")],E);export{E as DrapedHeatmapRenderer};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.24/esri/copyright.txt for details.
4
4
  */
5
- import{isSome as e}from"../../../../core/maybe.js";import t from"../../../../core/ObjectPool.js";import n from"../../../../core/PooledArray.js";import{g as i,a as o,c as r,h as s}from"../../../../chunks/vec3.js";import{f as h,c as a}from"../../../../chunks/vec3f64.js";import{intersectsSphere as d}from"../../../../geometry/support/frustum.js";import{wrap as l}from"../../../../geometry/support/ray.js";import{b as c,i as u,c as f,g as _}from"../../../../chunks/sphere.js";import{rayBoxTest as m}from"./Util.js";class p{constructor(e,t){this._objectToBoundingSphere=e,this._maximumObjectsPerNode=10,this._maximumDepth=20,this._degenerateObjects=new Set,this._root=new b,this._objectCount=0,t&&(void 0!==t.maximumObjectsPerNode&&(this._maximumObjectsPerNode=t.maximumObjectsPerNode),void 0!==t.maximumDepth&&(this._maximumDepth=t.maximumDepth))}get bounds(){return this._root.bounds}get halfSize(){return this._root.halfSize}get root(){return this._root.node}get maximumObjectsPerNode(){return this._maximumObjectsPerNode}get maximumDepth(){return this._maximumDepth}get objectCount(){return this._objectCount}destroy(){this._degenerateObjects.clear(),b.clearPool(),D[0]=null,k.prune(),L.prune()}add(e,t=e.length){this._objectCount+=t,this._grow(e,t);const n=b.acquire();for(let i=0;i<t;i++){const t=e[i];this._isDegenerate(t)?this._degenerateObjects.add(t):(n.init(this._root),this._add(t,n))}b.release(n)}remove(t,n=null){this._objectCount-=t.length;const i=b.acquire();for(const o of t){const t=e(n)?n:c(this._objectToBoundingSphere(o),q);M(t[3])?(i.init(this._root),this._remove(o,t,i)):this._degenerateObjects.delete(o)}b.release(i),this._shrink()}update(e,t){if(!M(t[3])&&this._isDegenerate(e))return;const n=v(e);this.remove(n,t),this.add(n)}forEachAlongRay(e,t,n){const i=l(e,t);this._forEachNode(this._root,(e=>{if(!this._intersectsNode(i,e))return!1;const t=e.node;return t.terminals.forAll((e=>{this._intersectsObject(i,e)&&n(e)})),null!==t.residents&&t.residents.forAll((e=>{this._intersectsObject(i,e)&&n(e)})),!0}))}forEachAlongRayWithVerticalOffset(e,t,n,i){const o=l(e,t);this._forEachNode(this._root,(e=>{if(!this._intersectsNodeWithOffset(o,e,i))return!1;const t=e.node;return t.terminals.forAll((e=>{this._intersectsObjectWithOffset(o,e,i)&&n(e)})),null!==t.residents&&t.residents.forAll((e=>{this._intersectsObjectWithOffset(o,e,i)&&n(e)})),!0}))}forEach(e){this._forEachNode(this._root,(t=>{const n=t.node;return n.terminals.forAll(e),null!==n.residents&&n.residents.forAll(e),!0})),this._degenerateObjects.forEach(e)}forEachDegenerateObject(e){this._degenerateObjects.forEach(e)}findClosest(e,t,n,r=(()=>!0),s=1/0){let h=1/0,a=1/0,l=null;const c=N(e,t),u=i=>{if(--s,!r(i))return;const o=this._objectToBoundingSphere(i);if(!d(n,o))return;const c=T(e,t,_(o)),u=c-o[3],f=c+o[3];u<h&&(h=u,a=f,l=i)};return this._forEachNodeDepthOrdered(this._root,(r=>{if(s<=0||!d(n,r.bounds))return!1;i(R,c,r.halfSize),o(R,R,r.bounds);if(T(e,t,R)>a)return!1;const h=r.node;return h.terminals.forAll((e=>u(e))),null!==h.residents&&h.residents.forAll((e=>u(e))),!0}),e,t),l}forEachInDepthRange(e,t,n,r,s,h,a){let l=-1/0,c=1/0;const u={setRange:e=>{n===p.DepthOrder.FRONT_TO_BACK?(l=Math.max(l,e.near),c=Math.min(c,e.far)):(l=Math.max(l,-e.far),c=Math.min(c,-e.near))}};u.setRange(r);const f=T(t,n,e),m=N(t,n),b=N(t,-n),g=e=>{if(!a(e))return;const i=this._objectToBoundingSphere(e),o=_(i),r=T(t,n,o)-f,m=r-i[3],p=r+i[3];m>c||p<l||!d(h,i)||s(e,u)};this._forEachNodeDepthOrdered(this._root,(e=>{if(!d(h,e.bounds))return!1;i(R,m,e.halfSize),o(R,R,e.bounds);if(T(t,n,R)-f>c)return!1;i(R,b,e.halfSize),o(R,R,e.bounds);if(T(t,n,R)-f<l)return!1;const r=e.node;return r.terminals.forAll((e=>g(e))),null!==r.residents&&r.residents.forAll((e=>g(e))),!0}),t,n)}forEachNode(e){this._forEachNode(this._root,(t=>e(t.node,t.bounds,t.halfSize)))}_intersectsNode(e,t){return j(t.bounds,2*-t.halfSize,y),j(t.bounds,2*t.halfSize,F),m(e.origin,e.direction,y,F)}_intersectsNodeWithOffset(e,t,n){return j(t.bounds,2*-t.halfSize,y),j(t.bounds,2*t.halfSize,F),n.applyToMinMax(y,F),m(e.origin,e.direction,y,F)}_intersectsObject(e,t){const n=this._objectToBoundingSphere(t);return!(n[3]>0)||u(n,e)}_intersectsObjectWithOffset(e,t,n){const i=this._objectToBoundingSphere(t);return!(i[3]>0)||u(n.applyToBoundingSphere(i),e)}_forEachNode(e,t){let n=b.acquire().init(e);const i=[n];for(;0!==i.length;){if(n=i.pop(),t(n)&&!n.isLeaf())for(let e=0;e<n.node.children.length;e++){n.node.children[e]&&i.push(b.acquire().init(n).advance(e))}b.release(n)}}_forEachNodeDepthOrdered(e,t,n,i=p.DepthOrder.FRONT_TO_BACK){let o=b.acquire().init(e);const r=[o];for(x(n,i,K);0!==r.length;){if(o=r.pop(),t(o)&&!o.isLeaf())for(let e=7;e>=0;--e){const t=K[e];o.node.children[t]&&r.push(b.acquire().init(o).advance(t))}b.release(o)}}_remove(e,t,n){k.clear();const i=n.advanceTo(t,((e,t)=>{k.push(e.node),k.push(t)}))?n.node.terminals:n.node.residents;if(i.removeUnordered(e),0===i.length)for(let o=k.length-2;o>=0;o-=2){const e=k.data[o],t=k.data[o+1];if(!this._purge(e,t))break}}_nodeIsEmpty(e){if(0!==e.terminals.length)return!1;if(null!==e.residents)return 0===e.residents.length;for(let t=0;t<e.children.length;t++)if(e.children[t])return!1;return!0}_purge(e,t){return t>=0&&(e.children[t]=null),!!this._nodeIsEmpty(e)&&(null===e.residents&&(e.residents=new n({shrink:!0})),!0)}_add(e,t){t.advanceTo(this._objectToBoundingSphere(e))?t.node.terminals.push(e):(t.node.residents.push(e),t.node.residents.length>this._maximumObjectsPerNode&&t.depth<this._maximumDepth&&this._split(t))}_split(e){const t=e.node.residents;e.node.residents=null;for(let n=0;n<t.length;n++){const i=b.acquire().init(e);this._add(t.getItemAt(n),i),b.release(i)}}_grow(e,t){if(0!==t&&(S(e,t,(e=>this._objectToBoundingSphere(e)),w),M(w[3])&&!this._fitsInsideTree(w)))if(this._nodeIsEmpty(this._root.node))c(w,this._root.bounds),this._root.halfSize=1.25*w[3];else{const e=this._rootBoundsForRootAsSubNode(w);this._placingRootViolatesMaxDepth(e)?this._rebuildTree(w,e):this._growRootAsSubNode(e),b.release(e)}}_rebuildTree(e,t){r(C,t.bounds),C[3]=t.halfSize,S([e,C],2,(e=>e),I);const n=b.acquire().init(this._root);this._root.initFrom(null,I,1.25*I[3]),this._forEachNode(n,(e=>(this.add(e.node.terminals.data,e.node.terminals.length),null!==e.node.residents&&this.add(e.node.residents.data,e.node.residents.length),!0))),b.release(n)}_placingRootViolatesMaxDepth(e){const t=Math.log(e.halfSize/this._root.halfSize)*Math.LOG2E;let n=0;return this._forEachNode(this._root,(e=>(n=Math.max(n,e.depth),n+t<=this._maximumDepth))),n+t>this._maximumDepth}_rootBoundsForRootAsSubNode(e){const t=e[3],n=e;let i=-1/0;const o=this._root.bounds,r=this._root.halfSize;for(let s=0;s<3;s++){const e=o[s]-r-(n[s]-t),h=n[s]+t-(o[s]+r),a=Math.max(0,Math.ceil(e/(2*r))),d=Math.max(0,Math.ceil(h/(2*r)))+1,l=2**Math.ceil(Math.log(a+d)*Math.LOG2E);i=Math.max(i,l),P[s].min=a,P[s].max=d}for(let s=0;s<3;s++){let e=P[s].min,t=P[s].max;const n=(i-(e+t))/2;e+=Math.ceil(n),t+=Math.floor(n);const h=o[s]-r-e*r*2;B[s]=h+(t+e)*r}return B[3]=i*r*A,b.acquire().initFrom(null,B,i*r,0)}_growRootAsSubNode(e){const t=this._root.node;r(w,this._root.bounds),w[3]=this._root.halfSize,this._root.init(e),e.advanceTo(w,null,!0),e.node.children=t.children,e.node.residents=t.residents,e.node.terminals=t.terminals}_shrink(){for(;;){const e=this._findShrinkIndex();if(-1===e)break;this._root.advance(e),this._root.depth=0}}_findShrinkIndex(){if(0!==this._root.node.terminals.length||this._root.isLeaf())return-1;let e=null;const t=this._root.node.children;let n=0,i=0;for(;i<t.length&&null==e;)n=i++,e=t[n];for(;i<t.length;)if(t[i++])return-1;return n}_isDegenerate(e){return!M(this._objectToBoundingSphere(e)[3])}_fitsInsideTree(e){const t=this._root.bounds,n=this._root.halfSize;return e[3]<=n&&e[0]>=t[0]-n&&e[0]<=t[0]+n&&e[1]>=t[1]-n&&e[1]<=t[1]+n&&e[2]>=t[2]-n&&e[2]<=t[2]+n}}class b{constructor(){this.bounds=f(),this.halfSize=0,this.initFrom(null,null,0,0)}init(e){return this.initFrom(e.node,e.bounds,e.halfSize,e.depth)}initFrom(t,n,i,o=this.depth){return this.node=e(t)?t:b.createEmptyNode(),e(n)&&c(n,this.bounds),this.halfSize=i,this.depth=o,this}advance(e){let t=this.node.children[e];t||(t=b.createEmptyNode(),this.node.children[e]=t),this.node=t,this.halfSize/=2,this.depth++;const n=z[e];return this.bounds[0]+=n[0]*this.halfSize,this.bounds[1]+=n[1]*this.halfSize,this.bounds[2]+=n[2]*this.halfSize,this.bounds[3]=this.halfSize*A,this}advanceTo(e,t,n=!1){for(;;){if(this.isTerminalFor(e))return t&&t(this,-1),!0;if(this.isLeaf()){if(!n)return t&&t(this,-1),!1;this.node.residents=null}const i=this._childIndex(e);t&&t(this,i),this.advance(i)}}isLeaf(){return null!=this.node.residents}isTerminalFor(e){return e[3]>this.halfSize/2}_childIndex(e){const t=this.bounds;return(t[0]<e[0]?1:0)+(t[1]<e[1]?2:0)+(t[2]<e[2]?4:0)}static createEmptyNode(){return{children:[null,null,null,null,null,null,null,null],terminals:new n({shrink:!0}),residents:new n({shrink:!0})}}static acquire(){return b._pool.acquire()}static release(e){b._pool.release(e)}static clearPool(){b._pool.prune()}}function g(e,t){e[0]=Math.min(e[0],t[0]-t[3]),e[1]=Math.min(e[1],t[1]-t[3]),e[2]=Math.min(e[2],t[2]-t[3])}function O(e,t){e[0]=Math.max(e[0],t[0]+t[3]),e[1]=Math.max(e[1],t[1]+t[3]),e[2]=Math.max(e[2],t[2]+t[3])}function j(e,t,n){n[0]=e[0]+t,n[1]=e[1]+t,n[2]=e[2]+t}function S(e,t,n,i){if(1===t){const t=n(e[0]);c(t,i)}else{y[0]=1/0,y[1]=1/0,y[2]=1/0,F[0]=-1/0,F[1]=-1/0,F[2]=-1/0;for(let i=0;i<t;i++){const t=n(e[i]);M(t[3])&&(g(y,t),O(F,t))}s(i,y,F,.5),i[3]=Math.max(F[0]-y[0],F[1]-y[1],F[2]-y[2])/2}}function x(e,t,n){if(!L.length)for(let i=0;i<8;++i)L.push({index:0,distance:0});for(let i=0;i<8;++i){const n=z[i];L.data[i].index=i,L.data[i].distance=T(e,t,n)}L.sort(((e,t)=>e.distance-t.distance));for(let i=0;i<8;++i)n[i]=L.data[i].index}function N(e,t){let n=1/0,i=null;for(let o=0;o<8;++o){const r=T(e,t,E[o]);r<n&&(n=r,i=E[o])}return i}function T(e,t,n){return t*(e[0]*n[0]+e[1]*n[1]+e[2]*n[2])}function M(e){return!isNaN(e)&&e!==-1/0&&e!==1/0&&e>0}b._pool=new t(b),function(e){var t;(t=e.DepthOrder||(e.DepthOrder={}))[t.FRONT_TO_BACK=1]="FRONT_TO_BACK",t[t.BACK_TO_FRONT=-1]="BACK_TO_FRONT"}(p||(p={}));const z=[h(-1,-1,-1),h(1,-1,-1),h(-1,1,-1),h(1,1,-1),h(-1,-1,1),h(1,-1,1),h(-1,1,1),h(1,1,1)],E=[h(-1,-1,-1),h(-1,-1,1),h(-1,1,-1),h(-1,1,1),h(1,-1,-1),h(1,-1,1),h(1,1,-1),h(1,1,1)],A=Math.sqrt(3),D=[null];function v(e){return D[0]=e,D}const B=f(),R=a(),y=a(),F=a(),k=new n,q=f(),w=f(),C=f(),I=f(),P=[{min:0,max:0},{min:0,max:0},{min:0,max:0}],L=new n,K=[0,0,0,0,0,0,0,0],W=p;export{W as default};
5
+ import{isSome as e}from"../../../../core/maybe.js";import t from"../../../../core/ObjectPool.js";import n from"../../../../core/PooledArray.js";import{g as o,a as s,d as r,c as i,h}from"../../../../chunks/vec3.js";import{f as a,c as d}from"../../../../chunks/vec3f64.js";import{intersectsSphere as l}from"../../../../geometry/support/frustum.js";import{wrap as c}from"../../../../geometry/support/ray.js";import{b as u,d as f,g as _,i as m,c as p}from"../../../../chunks/sphere.js";import{rayBoxTest as b}from"./Util.js";class g{constructor(e,t){this._objectToBoundingSphere=e,this._maximumObjectsPerNode=10,this._maximumDepth=20,this._degenerateObjects=new Set,this._root=new O,this._objectCount=0,t&&(void 0!==t.maximumObjectsPerNode&&(this._maximumObjectsPerNode=t.maximumObjectsPerNode),void 0!==t.maximumDepth&&(this._maximumDepth=t.maximumDepth))}get bounds(){return this._root.bounds}get halfSize(){return this._root.halfSize}get root(){return this._root.node}get maximumObjectsPerNode(){return this._maximumObjectsPerNode}get maximumDepth(){return this._maximumDepth}get objectCount(){return this._objectCount}destroy(){this._degenerateObjects.clear(),O.clearPool(),B[0]=null,w.prune(),W.prune()}add(e,t=e.length){this._objectCount+=t,this._grow(e,t);const n=O.acquire();for(let o=0;o<t;o++){const t=e[o];this._isDegenerate(t)?this._degenerateObjects.add(t):(n.init(this._root),this._add(t,n))}O.release(n)}remove(t,n=null){this._objectCount-=t.length;const o=O.acquire();for(const s of t){const t=e(n)?n:u(this._objectToBoundingSphere(s),C);z(t[3])?(o.init(this._root),this._remove(s,t,o)):this._degenerateObjects.delete(s)}O.release(o),this._shrink()}update(e,t){if(!z(t[3])&&this._isDegenerate(e))return;const n=R(e);this.remove(n,t),this.add(n)}forEachAlongRay(e,t,n){const o=c(e,t);this._forEachNode(this._root,(e=>{if(!this._intersectsNode(o,e))return!1;const t=e.node;return t.terminals.forAll((e=>{this._intersectsObject(o,e)&&n(e)})),null!==t.residents&&t.residents.forAll((e=>{this._intersectsObject(o,e)&&n(e)})),!0}))}forEachAlongRayWithVerticalOffset(e,t,n,o){const s=c(e,t);this._forEachNode(this._root,(e=>{if(!this._intersectsNodeWithOffset(s,e,o))return!1;const t=e.node;return t.terminals.forAll((e=>{this._intersectsObjectWithOffset(s,e,o)&&n(e)})),null!==t.residents&&t.residents.forAll((e=>{this._intersectsObjectWithOffset(s,e,o)&&n(e)})),!0}))}forEach(e){this._forEachNode(this._root,(t=>{const n=t.node;return n.terminals.forAll(e),null!==n.residents&&n.residents.forAll(e),!0})),this._degenerateObjects.forEach(e)}forEachDegenerateObject(e){this._degenerateObjects.forEach(e)}findClosest(e,t,n,r=(()=>!0),i=1/0){let h=1/0,a=1/0,d=null;const c=E(e,t),u=o=>{if(--i,!r(o))return;const s=this._objectToBoundingSphere(o);if(!l(n,s))return;const c=M(e,t,_(s)),u=c-s[3],f=c+s[3];u<h&&(h=u,a=f,d=o)};return this._forEachNodeDepthOrdered(this._root,(r=>{if(i<=0||!l(n,r.bounds))return!1;o(F,c,r.halfSize),s(F,F,r.bounds);if(M(e,t,F)>a)return!1;const h=r.node;return h.terminals.forAll((e=>u(e))),null!==h.residents&&h.residents.forAll((e=>u(e))),!0}),e,t),d}forEachInDepthRange(e,t,n,r,i,h,a){let d=-1/0,c=1/0;const u={setRange:e=>{n===g.DepthOrder.FRONT_TO_BACK?(d=Math.max(d,e.near),c=Math.min(c,e.far)):(d=Math.max(d,-e.far),c=Math.min(c,-e.near))}};u.setRange(r);const f=M(t,n,e),m=E(t,n),p=E(t,-n),b=e=>{if(!a(e))return;const o=this._objectToBoundingSphere(e),s=_(o),r=M(t,n,s)-f,m=r-o[3],p=r+o[3];m>c||p<d||!l(h,o)||i(e,u)};this._forEachNodeDepthOrdered(this._root,(e=>{if(!l(h,e.bounds))return!1;o(F,m,e.halfSize),s(F,F,e.bounds);if(M(t,n,F)-f>c)return!1;o(F,p,e.halfSize),s(F,F,e.bounds);if(M(t,n,F)-f<d)return!1;const r=e.node;return r.terminals.forAll((e=>b(e))),null!==r.residents&&r.residents.forAll((e=>b(e))),!0}),t,n)}forEachNode(e){this._forEachNode(this._root,(t=>e(t.node,t.bounds,t.halfSize)))}forEachNeighbor(e,t){const n=f(t),o=_(t),s=t=>{const s=this._objectToBoundingSphere(t),i=f(s),h=n+i;r(_(s),o)-h*h<=0&&e(t)};this._forEachNode(this._root,(e=>{const t=f(e.bounds),i=n+t;if(r(_(e.bounds),o)-i*i>0)return!1;const h=e.node;return h.terminals.forAll((e=>s(e))),null!==h.residents&&h.residents.forAll((e=>s(e))),!0})),this.forEachDegenerateObject(s)}_intersectsNode(e,t){return x(t.bounds,2*-t.halfSize,k),x(t.bounds,2*t.halfSize,q),b(e.origin,e.direction,k,q)}_intersectsNodeWithOffset(e,t,n){return x(t.bounds,2*-t.halfSize,k),x(t.bounds,2*t.halfSize,q),n.applyToMinMax(k,q),b(e.origin,e.direction,k,q)}_intersectsObject(e,t){const n=this._objectToBoundingSphere(t);return!(n[3]>0)||m(n,e)}_intersectsObjectWithOffset(e,t,n){const o=this._objectToBoundingSphere(t);return!(o[3]>0)||m(n.applyToBoundingSphere(o),e)}_forEachNode(e,t){let n=O.acquire().init(e);const o=[n];for(;0!==o.length;){if(n=o.pop(),t(n)&&!n.isLeaf())for(let e=0;e<n.node.children.length;e++){n.node.children[e]&&o.push(O.acquire().init(n).advance(e))}O.release(n)}}_forEachNodeDepthOrdered(e,t,n,o=g.DepthOrder.FRONT_TO_BACK){let s=O.acquire().init(e);const r=[s];for(T(n,o,V);0!==r.length;){if(s=r.pop(),t(s)&&!s.isLeaf())for(let e=7;e>=0;--e){const t=V[e];s.node.children[t]&&r.push(O.acquire().init(s).advance(t))}O.release(s)}}_remove(e,t,n){w.clear();const o=n.advanceTo(t,((e,t)=>{w.push(e.node),w.push(t)}))?n.node.terminals:n.node.residents;if(o.removeUnordered(e),0===o.length)for(let s=w.length-2;s>=0;s-=2){const e=w.data[s],t=w.data[s+1];if(!this._purge(e,t))break}}_nodeIsEmpty(e){if(0!==e.terminals.length)return!1;if(null!==e.residents)return 0===e.residents.length;for(let t=0;t<e.children.length;t++)if(e.children[t])return!1;return!0}_purge(e,t){return t>=0&&(e.children[t]=null),!!this._nodeIsEmpty(e)&&(null===e.residents&&(e.residents=new n({shrink:!0})),!0)}_add(e,t){t.advanceTo(this._objectToBoundingSphere(e))?t.node.terminals.push(e):(t.node.residents.push(e),t.node.residents.length>this._maximumObjectsPerNode&&t.depth<this._maximumDepth&&this._split(t))}_split(e){const t=e.node.residents;e.node.residents=null;for(let n=0;n<t.length;n++){const o=O.acquire().init(e);this._add(t.getItemAt(n),o),O.release(o)}}_grow(e,t){if(0!==t&&(N(e,t,(e=>this._objectToBoundingSphere(e)),I),z(I[3])&&!this._fitsInsideTree(I)))if(this._nodeIsEmpty(this._root.node))u(I,this._root.bounds),this._root.halfSize=1.25*I[3];else{const e=this._rootBoundsForRootAsSubNode(I);this._placingRootViolatesMaxDepth(e)?this._rebuildTree(I,e):this._growRootAsSubNode(e),O.release(e)}}_rebuildTree(e,t){i(P,t.bounds),P[3]=t.halfSize,N([e,P],2,(e=>e),L);const n=O.acquire().init(this._root);this._root.initFrom(null,L,1.25*L[3]),this._forEachNode(n,(e=>(this.add(e.node.terminals.data,e.node.terminals.length),null!==e.node.residents&&this.add(e.node.residents.data,e.node.residents.length),!0))),O.release(n)}_placingRootViolatesMaxDepth(e){const t=Math.log(e.halfSize/this._root.halfSize)*Math.LOG2E;let n=0;return this._forEachNode(this._root,(e=>(n=Math.max(n,e.depth),n+t<=this._maximumDepth))),n+t>this._maximumDepth}_rootBoundsForRootAsSubNode(e){const t=e[3],n=e;let o=-1/0;const s=this._root.bounds,r=this._root.halfSize;for(let i=0;i<3;i++){const e=s[i]-r-(n[i]-t),h=n[i]+t-(s[i]+r),a=Math.max(0,Math.ceil(e/(2*r))),d=Math.max(0,Math.ceil(h/(2*r)))+1,l=2**Math.ceil(Math.log(a+d)*Math.LOG2E);o=Math.max(o,l),K[i].min=a,K[i].max=d}for(let i=0;i<3;i++){let e=K[i].min,t=K[i].max;const n=(o-(e+t))/2;e+=Math.ceil(n),t+=Math.floor(n);const h=s[i]-r-e*r*2;y[i]=h+(t+e)*r}return y[3]=o*r*v,O.acquire().initFrom(null,y,o*r,0)}_growRootAsSubNode(e){const t=this._root.node;i(I,this._root.bounds),I[3]=this._root.halfSize,this._root.init(e),e.advanceTo(I,null,!0),e.node.children=t.children,e.node.residents=t.residents,e.node.terminals=t.terminals}_shrink(){for(;;){const e=this._findShrinkIndex();if(-1===e)break;this._root.advance(e),this._root.depth=0}}_findShrinkIndex(){if(0!==this._root.node.terminals.length||this._root.isLeaf())return-1;let e=null;const t=this._root.node.children;let n=0,o=0;for(;o<t.length&&null==e;)n=o++,e=t[n];for(;o<t.length;)if(t[o++])return-1;return n}_isDegenerate(e){return!z(this._objectToBoundingSphere(e)[3])}_fitsInsideTree(e){const t=this._root.bounds,n=this._root.halfSize;return e[3]<=n&&e[0]>=t[0]-n&&e[0]<=t[0]+n&&e[1]>=t[1]-n&&e[1]<=t[1]+n&&e[2]>=t[2]-n&&e[2]<=t[2]+n}}class O{constructor(){this.bounds=p(),this.halfSize=0,this.initFrom(null,null,0,0)}init(e){return this.initFrom(e.node,e.bounds,e.halfSize,e.depth)}initFrom(t,n,o,s=this.depth){return this.node=e(t)?t:O.createEmptyNode(),e(n)&&u(n,this.bounds),this.halfSize=o,this.depth=s,this}advance(e){let t=this.node.children[e];t||(t=O.createEmptyNode(),this.node.children[e]=t),this.node=t,this.halfSize/=2,this.depth++;const n=A[e];return this.bounds[0]+=n[0]*this.halfSize,this.bounds[1]+=n[1]*this.halfSize,this.bounds[2]+=n[2]*this.halfSize,this.bounds[3]=this.halfSize*v,this}advanceTo(e,t,n=!1){for(;;){if(this.isTerminalFor(e))return t&&t(this,-1),!0;if(this.isLeaf()){if(!n)return t&&t(this,-1),!1;this.node.residents=null}const o=this._childIndex(e);t&&t(this,o),this.advance(o)}}isLeaf(){return null!=this.node.residents}isTerminalFor(e){return e[3]>this.halfSize/2}_childIndex(e){const t=this.bounds;return(t[0]<e[0]?1:0)+(t[1]<e[1]?2:0)+(t[2]<e[2]?4:0)}static createEmptyNode(){return{children:[null,null,null,null,null,null,null,null],terminals:new n({shrink:!0}),residents:new n({shrink:!0})}}static acquire(){return O._pool.acquire()}static release(e){O._pool.release(e)}static clearPool(){O._pool.prune()}}function j(e,t){e[0]=Math.min(e[0],t[0]-t[3]),e[1]=Math.min(e[1],t[1]-t[3]),e[2]=Math.min(e[2],t[2]-t[3])}function S(e,t){e[0]=Math.max(e[0],t[0]+t[3]),e[1]=Math.max(e[1],t[1]+t[3]),e[2]=Math.max(e[2],t[2]+t[3])}function x(e,t,n){n[0]=e[0]+t,n[1]=e[1]+t,n[2]=e[2]+t}function N(e,t,n,o){if(1===t){const t=n(e[0]);u(t,o)}else{k[0]=1/0,k[1]=1/0,k[2]=1/0,q[0]=-1/0,q[1]=-1/0,q[2]=-1/0;for(let o=0;o<t;o++){const t=n(e[o]);z(t[3])&&(j(k,t),S(q,t))}h(o,k,q,.5),o[3]=Math.max(q[0]-k[0],q[1]-k[1],q[2]-k[2])/2}}function T(e,t,n){if(!W.length)for(let o=0;o<8;++o)W.push({index:0,distance:0});for(let o=0;o<8;++o){const n=A[o];W.data[o].index=o,W.data[o].distance=M(e,t,n)}W.sort(((e,t)=>e.distance-t.distance));for(let o=0;o<8;++o)n[o]=W.data[o].index}function E(e,t){let n=1/0,o=null;for(let s=0;s<8;++s){const r=M(e,t,D[s]);r<n&&(n=r,o=D[s])}return o}function M(e,t,n){return t*(e[0]*n[0]+e[1]*n[1]+e[2]*n[2])}function z(e){return!isNaN(e)&&e!==-1/0&&e!==1/0&&e>0}O._pool=new t(O),function(e){var t;(t=e.DepthOrder||(e.DepthOrder={}))[t.FRONT_TO_BACK=1]="FRONT_TO_BACK",t[t.BACK_TO_FRONT=-1]="BACK_TO_FRONT"}(g||(g={}));const A=[a(-1,-1,-1),a(1,-1,-1),a(-1,1,-1),a(1,1,-1),a(-1,-1,1),a(1,-1,1),a(-1,1,1),a(1,1,1)],D=[a(-1,-1,-1),a(-1,-1,1),a(-1,1,-1),a(-1,1,1),a(1,-1,-1),a(1,-1,1),a(1,1,-1),a(1,1,1)],v=Math.sqrt(3),B=[null];function R(e){return B[0]=e,B}const y=p(),F=d(),k=d(),q=d(),w=new n,C=p(),I=p(),P=p(),L=p(),K=[{min:0,max:0},{min:0,max:0},{min:0,max:0}],W=new n,V=[0,0,0,0,0,0,0,0],G=g;export{G as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.24/esri/copyright.txt for details.
4
4
  */
5
- import{deduplicate as e}from"../../../../../geometry/support/meshUtils/deduplicate.js";import{computeNeighbors as t}from"../../../support/meshProcessing.js";import{packInterleavedBuffer as n}from"../../../support/buffer/workerHelper.js";import{EdgeInputBufferLayout as r}from"./bufferLayouts.js";import{RegularEdgeBufferWriter as i,SilhouetteEdgeBufferWriter as s}from"./edgeBufferWriters.js";import{extractEdges as o}from"./edgePreprocessing.js";async function a(e){const t=u(e),n=f(t),r=[t.data.buffer];return{result:c(n,r),transferList:r}}function f(e){const t=g(e.data,e.skipDeduplicate,e.indices,e.indicesLength);return d.updateSettings(e.writerSettings),l.updateSettings(e.writerSettings),o(t,d,l)}function u(e){return{data:r.createView(e.dataBuffer),indices:"Uint32Array"===e.indicesType?new Uint32Array(e.indicesBuffer):"Uint16Array"===e.indicesType?new Uint16Array(e.indicesBuffer):void 0,indicesLength:e.indicesLength,writerSettings:e.writerSettings,skipDeduplicate:e.skipDeduplicate}}function c(e,t){t.push(e.regular.lodInfo.lengths.buffer),t.push(e.silhouette.lodInfo.lengths.buffer);return{regular:{instancesData:n(e.regular.instancesData,t),lodInfo:{lengths:e.regular.lodInfo.lengths.buffer}},silhouette:{instancesData:n(e.silhouette.instancesData,t),lodInfo:{lengths:e.silhouette.lodInfo.lengths.buffer}},averageEdgeLength:e.averageEdgeLength}}function g(n,i,s,o){if(i){return{faces:s,facesLength:o,neighbors:t(s,o,n.count),vertices:n}}const a=e(n.buffer,n.stride/4,{originalIndices:s,originalIndicesLength:o}),f=t(a.indices,o,a.uniqueCount);return{faces:a.indices,facesLength:a.indices.length,neighbors:f,vertices:r.createView(a.buffer)}}const d=new i,l=new s;export{f as work,a as wrappedWork};
5
+ import{deduplicate as e}from"../../../../../geometry/support/meshUtils/deduplicate.js";import{computeNeighbors as t}from"../../../support/meshProcessing.js";import{newLayout as n}from"../../../support/buffer/InterleavedLayout.js";import{packInterleavedBuffer as r}from"../../../support/buffer/workerHelper.js";import{VertexAttribute as i}from"../VertexAttribute.js";import{EdgeInputBufferLayout as s}from"./bufferLayouts.js";import{RegularEdgeBufferWriter as o,SilhouetteEdgeBufferWriter as a}from"./edgeBufferWriters.js";import{extractEdges as c}from"./edgePreprocessing.js";class u{async extract(e){const t=l(e),n=f(t),r=[t.data.buffer];return{result:d(n,r),transferList:r}}async extractComponentsEdgeLocations(e){const t=l(e),n=p(t.data,t.skipDeduplicate,t.indices,t.indicesLength),i=c(n,L,D),s=[];return{result:r(i.regular.instancesData,s),transferList:s}}async extractEdgeLocations(e){const t=l(e),n=p(t.data,t.skipDeduplicate,t.indices,t.indicesLength),i=c(n,w,D),s=[];return{result:r(i.regular.instancesData,s),transferList:s}}}function f(e){const t=p(e.data,e.skipDeduplicate,e.indices,e.indicesLength);return g.updateSettings(e.writerSettings),h.updateSettings(e.writerSettings),c(t,g,h)}function l(e){return{data:s.createView(e.dataBuffer),indices:"Uint32Array"===e.indicesType?new Uint32Array(e.indicesBuffer):"Uint16Array"===e.indicesType?new Uint16Array(e.indicesBuffer):void 0,indicesLength:e.indicesLength,writerSettings:e.writerSettings,skipDeduplicate:e.skipDeduplicate}}function d(e,t){t.push(e.regular.lodInfo.lengths.buffer),t.push(e.silhouette.lodInfo.lengths.buffer);return{regular:{instancesData:r(e.regular.instancesData,t),lodInfo:{lengths:e.regular.lodInfo.lengths.buffer}},silhouette:{instancesData:r(e.silhouette.instancesData,t),lodInfo:{lengths:e.silhouette.lodInfo.lengths.buffer}},averageEdgeLength:e.averageEdgeLength}}function p(n,r,i,o){if(r){return{faces:i,facesLength:o,neighbors:t(i,o,n.count),vertices:n}}const a=e(n.buffer,n.stride/4,{originalIndices:i,originalIndicesLength:o}),c=t(a.indices,o,a.uniqueCount);return{faces:a.indices,facesLength:a.indices.length,neighbors:c,vertices:s.createView(a.buffer)}}const g=new o,h=new a;class m{allocate(e){return b.createBuffer(e)}trim(e,t){return e.slice(0,t)}write(e,t,n){e.position0.setVec(t,n.position0),e.position1.setVec(t,n.position1)}}class I{allocate(e){return y.createBuffer(e)}trim(e,t){return e.slice(0,t)}write(e,t,n){e.position0.setVec(t,n.position0),e.position1.setVec(t,n.position1),e.componentIndex.set(t,n.componentIndex)}}const w=new m,L=new I,D={allocate:()=>null,write:()=>{},trim:()=>null},b=n().vec3f(i.POSITION0).vec3f(i.POSITION1),y=n().vec3f(i.POSITION0).vec3f(i.POSITION1).u16(i.COMPONENTINDEX).u16(i.U16PADDING,{glPadding:!0});function v(){return new u}export{u as EdgeProcessingWorker,v as default,f as extract,y as extractComponentsEdgeLocationsLayout,b as extractEdgeLocationsLayout};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.24/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../../../chunks/tslib.es6.js";import t from"../../../../../core/Accessor.js";import{equals as r}from"../../../../../core/arrayUtils.js";import s from"../../../../../core/Logger.js";import{clamp as o}from"../../../../../core/mathUtils.js";import{disposeMaybe as n,destroyMaybe as i,isNone as a,isSome as c}from"../../../../../core/maybe.js";import{property as d}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/has.js";import"../../../../../core/accessorSupport/ensureType.js";import{subclass as l}from"../../../../../core/accessorSupport/decorators/subclass.js";import{f as g,t as u,e as m}from"../../../../../chunks/mat3.js";import{c as h}from"../../../../../chunks/mat3f64.js";import{I as p,c as f}from"../../../../../chunks/mat4f64.js";import{s as b,c as y,v as j,e as O}from"../../../../../chunks/vec3.js";import{c as v}from"../../../../../chunks/vec3f64.js";import{WatchUpdatingTracking as w}from"../../../../../core/support/WatchUpdatingTracking.js";import{g as E,l as R}from"../../../../../chunks/sphere.js";import{c as x}from"../../../../../chunks/vec33.js";import{TwoVectorPosition as T}from"../../core/util/TwoVectorPosition.js";import{GridLocalOriginFactory as _}from"../GridLocalOriginFactory.js";import{applyToModelMatrix as M}from"../localOriginHelper.js";import{LocalOriginManager as C}from"../LocalOriginManager.js";import{Object3D as P}from"../Object3D.js";import{VertexAttribute as S}from"../VertexAttribute.js";import{VertexLayout as D,EdgeShaderAttributeLocations as A,glVertexLayout as k,EdgeInputBufferLayout as I}from"./bufferLayouts.js";import{RegularEdgeBufferWriter as B,SilhouetteEdgeBufferWriter as L}from"./edgeBufferWriters.js";import{EdgeType as U}from"./edgePreprocessing.js";import{EdgeRenderer as V,LINE_WIDTH_FRACTION_FACTOR as N,EXTENSION_LENGTH_OFFSET as H}from"./EdgeRenderer.js";import{EdgePassParameters as z}from"./EdgeShaderParameters.js";import W from"./EdgeWorkerHandle.js";import{Transparency as q}from"./interfaces.js";import{generateStrokesTexture as K}from"./strokes.js";import{determineRendererType as G,determineEdgeTransparency as F,determineObjectTransparency as Q,fillComponenBufferIndices as J,computeEdgeCount as X}from"./util.js";import{BufferManager as Y}from"../TextureBackedBuffer/BufferManager.js";import{BufferObject as Z}from"../../../../webgl/BufferObject.js";import{Usage as $}from"../../../../webgl/enums.js";import{VertexArrayObject as ee}from"../../../../webgl/VertexArrayObject.js";const te=s.getLogger("esri.views.3d.webgl-engine.lib.edgeRendering.EdgeView");let re=class extends t{constructor(e){super(e),this.updatingHandles=new w,this.perObjectData=new Map,this.perObjectDataEvictionCache=new Set,this.renderers=new Map,this.numberOfRenderedEdges={[q.TRANSPARENT]:0,[q.OPAQUE]:0},this.gpuMemoryUsage=0,this.workerAbort=new AbortController,this.tmpModelPosition=v(),this.localOrigins=new C(new _(e.renderSR))}initialize(){this.worker=new W(this.schedule),this.componentColorManager=new Y(this.rctx,2);const e=D.createBuffer(4);for(let t=0;t<4;t++)e.sideness.set(t,0,0===t||3===t?0:1),e.sideness.set(t,1,0===t||1===t?0:1);this.verticesBufferObject=Z.createVertex(this.rctx,$.STATIC_DRAW,e.buffer)}destroy(){this.destroyed||(this.perObjectData.forEach((e=>this._discardObjectEntry(e))),this.perObjectData.clear(),this.strokesTexture=n(this.strokesTexture),this.componentColorManager=i(this.componentColorManager),this.workerAbort.abort(),this.worker.destroy(),this.verticesBufferObject=n(this.verticesBufferObject),this.renderers.clear(),this.updatingHandles.destroy())}get updating(){return this.updatingHandles.updating}get usedMemory(){return this.gpuMemoryUsage}get numberOfRenderedPrimitives(){return this.numberOfRenderedEdges[q.TRANSPARENT]+this.numberOfRenderedEdges[q.OPAQUE]}shouldRender(){return this.renderers.size>0}async addComponentObject(e,t,r,s,o,n,i,a){if(this.hasObject(e))return this.getObjectMemoryUsage(e);let c;const d=new ne(new Promise((e=>c=e)),r.center,r.radius);this.perObjectData.set(e,d);const l=await this.updatingHandles.addPromise(this._addComponentGeometry(t,d,s,o,n,i,a));return this.setNeedsRender(),c(),l}async addOrUpdateObject3D(e,t,r,s){if(this.destroyed)return void te.warn("Attempt to add an object to a destroyed instance");const o=this.perObjectData.get(e);let n;(null==o?void 0:o.renderables.length)>0&&this.perObjectDataEvictionCache.add(o);const i=e.boundingVolumeWorldSpace.bounds,a=new ne(new Promise((e=>n=e)),E(i),R(i));this.perObjectData.set(e,a);const c=new Array;if(r.mergeGeometries&&e.geometries.length>1&&oe(e))c.push(this._addObjectMergedGeometries(e,a,t,r,s));else for(let d=0;d<e.geometries.length;d++){const o=e.geometryRecords[d];if(!o.material.supportsEdges)continue;const n=e.geometries[d];c.push(this._addGeometry(e,a,n,o,t[0],r,s))}await this.updatingHandles.addPromise(Promise.all(c)),this.perObjectDataEvictionCache.delete(a),this._discardObjectEntry(o),this.setNeedsRender(),n()}_discardObjectEntry(e){e&&(e.renderables.length&&(e.renderables.forEach((e=>this._removeRenderable(e))),this.setNeedsRender()),e.loaded=null)}hasObject(e){return this.perObjectData.has(e)}async updateAllComponentOpacities(e,t){const r=t instanceof Array?e=>t[e]:()=>t;(await this.updatingHandles.addPromise(this._getObjectEntry(e))).renderables.forEach((e=>{const t=e.components.meta.length;for(let s=0;s<t;s++){const t=r(s),o=e.components.meta[s],n=o.index;o.material.opacity=t,e.components.buffer.textureBuffer.setDataElement(n,1,3,255*t)}this._updateTransparency(e)})),this.setNeedsRender()}async getObjectMemoryUsage(e){return(await this._getObjectEntry(e)).renderables.reduce(((e,t)=>e+t.statistics.gpuMemoryUsage),0)}async updateAllComponentMaterials(e,t,r,s){const o=e instanceof P,n=!!r.hasSlicePlane,i=G(t),a=V.getKey(i,n,o);(await this.updatingHandles.addPromise(this._getObjectEntry(e))).renderables.forEach((e=>{if(a!==e.rendererKey){const t=this.renderers.get(e.rendererKey),r=this._acquireRenderer(i,n,o);t.removeRenderable(e),t.refCount.decrement(),e.rendererKey=a,r.addRenderable(e)}for(let r=0;r<t.length;r++)e.components.meta[r].material=t[r];s&&this._updateComponentBuffer(e.components),this._updateTransparency(e)})),this.setNeedsRender()}async updateObjectVisibility(e,t){(await this.updatingHandles.addPromise(this._getObjectEntry(e))).renderables.forEach((e=>e.visible=t)),this.setNeedsRender()}removeObject(e){const t=this.perObjectData.get(e);t&&(this.perObjectData.delete(e),this._discardObjectEntry(t))}async _getObjectEntry(e){const t=this.perObjectData.get(e);if(!t)throw"no object";return await t.loaded,t}removeAll(){this.perObjectData.forEach(((e,t)=>this.removeObject(t)))}render(e,t){if(this.numberOfRenderedEdges[t]=0,a(this.componentColorManager))return;this.localOrigins.updateViewMatrices(e.camera.viewMatrix);const r=e.camera.viewInverseTransposeMatrix,s=v(),o=new T;let n=0,i=0;if(this.renderers.forEach((r=>{0===r.refCount.value?(this.renderers.delete(r.key),r.dispose()):r.forEachRenderable((t=>{t.visible&&(n+=t.statistics.averageEdgeLength,i++,t.regular&&r.updateTechnique(e,!1),t.silhouette&&r.updateTechnique(e,!0))}),t)})),this.componentColorManager.garbageCollect(),this.componentColorManager.updateTextures(),0===i)return;const c=40*n/i,d=e.camera.perScreenPixelRatio,l=new z(c,d,t);b(s,r[3],r[7],r[11]),o.set(s),y(l.transformWorldFromViewTH,o.high),y(l.transformWorldFromViewTL,o.low),g(l.transformViewFromCameraRelativeRS,e.camera.viewMatrix),u(ie,l.transformViewFromCameraRelativeRS),m(l.transformNormalViewFromGlobal,ie),l.transformProjFromView=e.camera.projectionMatrix,this._updateObjectCameraDistances(e),this.renderers.forEach((t=>{this._renderRegularEdges(t,e,l),this._renderSilhouetteEdges(t,e,l)}))}_updateTransparency(e){const t=F(e.components.meta),r=Q(e.components.meta);t===e.edgeTransparency&&r===e.objectTransparency||(e.edgeTransparency=t,e.objectTransparency=r,this.renderers.get(e.rendererKey).setRenderablesDirty())}_computeModelTransformWithLocalOrigin(e,t,r){if(e.getCombinedStaticTransformation(t,r),c(t.origin))this.localOrigins.register(t.origin);else{const e=b(this.tmpModelPosition,r[12],r[13],r[14]);t.origin=this.localOrigins.acquire(e)}return M(t.origin.vec3,r),t.origin}_updateComponentBuffer(e){const{meta:t,buffer:r}=e;for(let s=0;s<t.length;s++){const e=t[s].material,n=t[s].index,i=o(Math.round(e.size*N),0,255),a=o(e.extensionLength,-H,255-H)+H,c="solid"===e.type?U.SOLID:U.SKETCH,d=255*e.opacity,l=e.color,g=255*l[0],u=255*l[1],m=255*l[2],h=255*l[3];r.textureBuffer.setData(n,0,g,u,m,h),r.textureBuffer.setData(n,1,i,a,c,d)}}_createComponentBuffers(e){if(a(this.componentColorManager))return null;const t=new Array,r=this.componentColorManager.getBuffer(e.length);for(let o=0;o<e.length;o++){const s=e[o],n=r.acquireIndex();t.push({index:n,material:s})}const s={meta:t,buffer:r};return this._updateComponentBuffer(s),s}_extractEdges(e,t,r,s,o,n=o.length){return this.worker.process({data:t,indices:o,indicesLength:n,writerSettings:e,skipDeduplicate:r},this.workerAbort.signal,s)}_createEdgeResources(e){const t={};if(a(this.verticesBufferObject))return t;if(e.regular.lodInfo.lengths.length>0){const r=new ee(this.rctx,A,{vertices:k,instances:B.glLayout},{vertices:this.verticesBufferObject,instances:Z.createVertex(this.rctx,$.STATIC_DRAW,e.regular.instancesData.buffer)});t.regular={vao:r,lod:e.regular.lodInfo}}if(e.silhouette.lodInfo.lengths.length>0){const r=new ee(this.rctx,A,{vertices:k,instances:L.glLayout},{vertices:this.verticesBufferObject,instances:Z.createVertex(this.rctx,$.STATIC_DRAW,e.silhouette.instancesData.buffer)});t.silhouette={vao:r,lod:e.silhouette.lodInfo}}return t}async _addGeometry(e,t,r,s,o,n,i){const a=r.vertexAttributes.get(S.POSITION),c=r.indices.get(S.POSITION),d=f(),l={position:a,indices:c,modelTransform:d,origin:this._computeModelTransformWithLocalOrigin(e,s,d)};return this._addPositionData(t,l,r.edgeIndicesLength,o,n,i)}async _addPositionData(e,t,r,s,o,n=!1){if(null==e.loaded)return;const i=this._createComponentBuffers([s]);if(a(i)||r<=0)return;const c=this._acquireRenderer(s.type,!!o.hasSlicePlane,!0),{modelTransform:d,origin:l}=t,g=t.indices,u=t.position,m=u.data.length/u.size,h=I.createBuffer(m);for(let a=0;a<m;a++)h.position.set(a,0,u.data[a*u.size+0]),h.position.set(a,1,u.data[a*u.size+1]),h.position.set(a,2,u.data[a*u.size+2]);J(i.meta,[0,h.componentIndex.count],h.componentIndex);const p=await this.updatingHandles.addPromise(this._extractEdges(c.writerSettings,h,!1,n,g,r));if(null==e.loaded)return;const{regular:f,silhouette:b}=this._createEdgeResources(p),y=(f?f.vao.size:0)+(b?b.vao.size:0),j={regular:f,silhouette:b,transform:{modelMatrix:d,origin:l},statistics:{gpuMemoryUsage:y,externalMemoryUsage:!1,averageEdgeLength:p.averageEdgeLength},components:i,visible:!0,edgeTransparency:F(i.meta),objectTransparency:Q(i.meta),distanceToCamera:0,rendererKey:c.key};e.renderables.push(j),c.addRenderable(j),this.gpuMemoryUsage+=y}async _addComponentGeometry(e,t,r,s,o,n,i){if(null==t.loaded)return 0;const c=this._createComponentBuffers(n);if(a(c))return 0;const d=G(n),l=this._acquireRenderer(d,i.hasSlicePlane||!1,!1),g=I.createBuffer(r.count);x(g.position,r),J(c.meta,o,g.componentIndex,s);const u=!0,m=l.writerSettings,h=await this.updatingHandles.addPromise(this._extractEdges(m,g,u,!1,s));if(null==t.loaded)return 0;const{regular:p,silhouette:f}=this._createEdgeResources(h),b=(p?p.vao.size:0)+(f?f.vao.size:0),y={regular:p,silhouette:f,transform:e,statistics:{gpuMemoryUsage:b,externalMemoryUsage:!0,averageEdgeLength:h.averageEdgeLength},components:c,visible:!0,edgeTransparency:F(c.meta),objectTransparency:Q(c.meta),distanceToCamera:0,rendererKey:l.key};return t.renderables.push(y),l.addRenderable(y),b}async _addObjectMergedGeometries(e,t,r,s,o){const n=new Map;let i=0,a=null,c=0;for(let f=0;f<e.geometries.length;f++){const t=e.geometries[f],r=e.geometryRecords[f];if(!r.material.supportsEdges)continue;!a&&r.origin&&(a=r);const s=t.vertexAttributes.get(S.POSITION);c+=s.data.length/s.size,i+=t.edgeIndicesLength}const d=c>=65536?Uint32Array:Uint16Array,l=i?new d(i):null,g=[];let u=0;for(let f=0;f<e.geometries.length;f++){const t=e.geometries[f];if(!e.geometryRecords[f].material.supportsEdges)continue;const r=t.vertexAttributes.get(S.POSITION),s=t.indices.get(S.POSITION);let o=n.get(r.data);if(null==o){o=g.length/3;for(let e=0;e<r.data.length;e+=r.size)g.push(r.data[e+0]),g.push(r.data[e+1]),g.push(r.data[e+2]);n.set(r.data,o)}if(s)for(let e=0;e<t.edgeIndicesLength;e++)l[u++]=o+s[e]}const m=a||e.geometryRecords[0],h=f(),p=this._computeModelTransformWithLocalOrigin(e,m,h);for(let f=0;f<e.geometryRecords.length;f++)e.geometryRecords[f].origin=p;const b={position:{data:g,size:3},indices:l,modelTransform:h,origin:p};await this.updatingHandles.addPromise(this._addPositionData(t,b,l.length,r[0],s,o))}_acquireRenderer(e,t,r){const s=V.getKey(e,t,r);let o=this.renderers.get(s);return a(this.strokesTexture)&&(this.strokesTexture=K(this.rctx)),o||(o=new V(this.rctx,this.techniqueRepository,{type:e,hasSlicePlane:t,strokesTexture:this.strokesTexture,legacy:r}),this.renderers.set(s,o)),o.refCount.increment(),o}_removeRenderable(e){se(e);const t=this.renderers.get(e.rendererKey);if(t){t.removeRenderable(e),t.refCount.decrement(),"origin"in e.transform&&this.localOrigins.release(e.transform.origin),this.gpuMemoryUsage-=e.statistics.externalMemoryUsage?0:e.statistics.gpuMemoryUsage;for(const t of e.components.meta)e.components.buffer.releaseIndex(t.index)}}_updateObjectCameraDistances(e){const t=e.camera.eye,r=e.camera.viewForward,s=v(),o=e=>{const{center:o,radius:n}=e;j(s,o,t);const i=O(s,r),a=i<-n?1/0:i<n?0:i-n;e.renderables.forEach((e=>e.distanceToCamera=a))};this.perObjectData.forEach(o),this.perObjectDataEvictionCache.forEach(o)}_renderRegularEdges(e,t,r){const s=e.bindRegularEdges(r,t),o=r.transparency;e.forEachRenderable((n=>{if(!n.visible||!n.regular)return;const i=X(n.regular.lod.lengths,n.distanceToCamera,r),a="origin"in n.transform?this.localOrigins.getViewMatrix(n.transform.origin):p;e.renderRegularEdges(s,n,t,i,a),this.numberOfRenderedEdges[o]+=i}),o)}_renderSilhouetteEdges(e,t,r){const s=e.bindSilhouetteEdges(r,t),o=r.transparency;e.forEachRenderable((n=>{if(!n.visible||!n.silhouette)return;const i=X(n.silhouette.lod.lengths,n.distanceToCamera,r),a="origin"in n.transform?this.localOrigins.getViewMatrix(n.transform.origin):p;e.renderSilhouetteEdges(s,n,t,i,a),this.numberOfRenderedEdges[o]+=i}),o)}};function se(e){e.regular&&(e.regular.vao.vertexBuffers.instances.dispose(),e.regular.vao.dispose(!1),e.regular.vao=null),e.silhouette&&(e.silhouette.vao.vertexBuffers.instances.dispose(),e.silhouette.vao.dispose(!1),e.silhouette.vao=null)}function oe(e){let t=null,s=null;for(let n=0;n<e.geometries.length;n++){var o;const i=e.geometryRecords[n];if(i.material.supportsEdges){if(t){if(!r(t,i.transformation))return!1}else t=i.transformation;if(!s&&c(i.origin))s=i;else if(c(null==(o=s)?void 0:o.origin)&&c(i.origin)&&s.origin.id!==i.origin.id)return!1}}return!0}e([d({constructOnly:!0})],re.prototype,"rctx",void 0),e([d({constructOnly:!0})],re.prototype,"renderSR",void 0),e([d({constructOnly:!0})],re.prototype,"techniqueRepository",void 0),e([d({constructOnly:!0})],re.prototype,"setNeedsRender",void 0),e([d({constructOnly:!0})],re.prototype,"schedule",void 0),e([d({readOnly:!0})],re.prototype,"updatingHandles",void 0),e([d({readOnly:!0})],re.prototype,"updating",null),re=e([l("esri.views.3d.webgl-engine.lib.edgeRendering.EdgeView")],re);class ne{constructor(e,t,r){this.center=t,this.radius=r,this.renderables=new Array,this.loaded=e,this.loaded.then((()=>{null!=this.loaded&&(this.loaded=!0)}))}}const ie=h();export{re as EdgeView};
5
+ import{_ as e}from"../../../../../chunks/tslib.es6.js";import t from"../../../../../core/Accessor.js";import{equals as r}from"../../../../../core/arrayUtils.js";import s from"../../../../../core/Logger.js";import{clamp as o}from"../../../../../core/mathUtils.js";import{disposeMaybe as n,destroyMaybe as i,isNone as a,isSome as c}from"../../../../../core/maybe.js";import{property as d}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/has.js";import"../../../../../core/accessorSupport/ensureType.js";import{subclass as l}from"../../../../../core/accessorSupport/decorators/subclass.js";import{f as g,t as u,e as m}from"../../../../../chunks/mat3.js";import{c as h}from"../../../../../chunks/mat3f64.js";import{I as p,c as f}from"../../../../../chunks/mat4f64.js";import{s as b,c as y,v as j,e as O}from"../../../../../chunks/vec3.js";import{c as v}from"../../../../../chunks/vec3f64.js";import{WatchUpdatingTracking as w}from"../../../../../core/support/WatchUpdatingTracking.js";import{g as E,d as R}from"../../../../../chunks/sphere.js";import{c as x}from"../../../../../chunks/vec33.js";import{TwoVectorPosition as T}from"../../core/util/TwoVectorPosition.js";import{GridLocalOriginFactory as _}from"../GridLocalOriginFactory.js";import{applyToModelMatrix as M}from"../localOriginHelper.js";import{LocalOriginManager as C}from"../LocalOriginManager.js";import{Object3D as P}from"../Object3D.js";import{VertexAttribute as S}from"../VertexAttribute.js";import{VertexLayout as D,EdgeShaderAttributeLocations as A,glVertexLayout as k,EdgeInputBufferLayout as I}from"./bufferLayouts.js";import{RegularEdgeBufferWriter as B,SilhouetteEdgeBufferWriter as L}from"./edgeBufferWriters.js";import{EdgeType as U}from"./edgePreprocessing.js";import{EdgeRenderer as V,LINE_WIDTH_FRACTION_FACTOR as N,EXTENSION_LENGTH_OFFSET as H}from"./EdgeRenderer.js";import{EdgePassParameters as z}from"./EdgeShaderParameters.js";import W from"./EdgeWorkerHandle.js";import{Transparency as q}from"./interfaces.js";import{generateStrokesTexture as K}from"./strokes.js";import{determineRendererType as G,determineEdgeTransparency as F,determineObjectTransparency as Q,fillComponenBufferIndices as J,computeEdgeCount as X}from"./util.js";import{BufferManager as Y}from"../TextureBackedBuffer/BufferManager.js";import{BufferObject as Z}from"../../../../webgl/BufferObject.js";import{Usage as $}from"../../../../webgl/enums.js";import{VertexArrayObject as ee}from"../../../../webgl/VertexArrayObject.js";const te=s.getLogger("esri.views.3d.webgl-engine.lib.edgeRendering.EdgeView");let re=class extends t{constructor(e){super(e),this.updatingHandles=new w,this.perObjectData=new Map,this.perObjectDataEvictionCache=new Set,this.renderers=new Map,this.numberOfRenderedEdges={[q.TRANSPARENT]:0,[q.OPAQUE]:0},this.gpuMemoryUsage=0,this.workerAbort=new AbortController,this.tmpModelPosition=v(),this.localOrigins=new C(new _(e.renderSR))}initialize(){this.worker=new W(this.schedule),this.componentColorManager=new Y(this.rctx,2);const e=D.createBuffer(4);for(let t=0;t<4;t++)e.sideness.set(t,0,0===t||3===t?0:1),e.sideness.set(t,1,0===t||1===t?0:1);this.verticesBufferObject=Z.createVertex(this.rctx,$.STATIC_DRAW,e.buffer)}destroy(){this.destroyed||(this.perObjectData.forEach((e=>this._discardObjectEntry(e))),this.perObjectData.clear(),this.strokesTexture=n(this.strokesTexture),this.componentColorManager=i(this.componentColorManager),this.workerAbort.abort(),this.worker.destroy(),this.verticesBufferObject=n(this.verticesBufferObject),this.renderers.clear(),this.updatingHandles.destroy())}get updating(){return this.updatingHandles.updating}get usedMemory(){return this.gpuMemoryUsage}get numberOfRenderedPrimitives(){return this.numberOfRenderedEdges[q.TRANSPARENT]+this.numberOfRenderedEdges[q.OPAQUE]}shouldRender(){return this.renderers.size>0}async addComponentObject(e,t,r,s,o,n,i,a){if(this.hasObject(e))return this.getObjectMemoryUsage(e);let c;const d=new ne(new Promise((e=>c=e)),r.center,r.radius);this.perObjectData.set(e,d);const l=await this.updatingHandles.addPromise(this._addComponentGeometry(t,d,s,o,n,i,a));return this.setNeedsRender(),c(),l}async addOrUpdateObject3D(e,t,r,s){if(this.destroyed)return void te.warn("Attempt to add an object to a destroyed instance");const o=this.perObjectData.get(e);let n;(null==o?void 0:o.renderables.length)>0&&this.perObjectDataEvictionCache.add(o);const i=e.boundingVolumeWorldSpace.bounds,a=new ne(new Promise((e=>n=e)),E(i),R(i));this.perObjectData.set(e,a);const c=new Array;if(r.mergeGeometries&&e.geometries.length>1&&oe(e))c.push(this._addObjectMergedGeometries(e,a,t,r,s));else for(let d=0;d<e.geometries.length;d++){const o=e.geometryRecords[d];if(!o.material.supportsEdges)continue;const n=e.geometries[d];c.push(this._addGeometry(e,a,n,o,t[0],r,s))}await this.updatingHandles.addPromise(Promise.all(c)),this.perObjectDataEvictionCache.delete(a),this._discardObjectEntry(o),this.setNeedsRender(),n()}_discardObjectEntry(e){e&&(e.renderables.length&&(e.renderables.forEach((e=>this._removeRenderable(e))),this.setNeedsRender()),e.loaded=null)}hasObject(e){return this.perObjectData.has(e)}async updateAllComponentOpacities(e,t){const r=t instanceof Array?e=>t[e]:()=>t;(await this.updatingHandles.addPromise(this._getObjectEntry(e))).renderables.forEach((e=>{const t=e.components.meta.length;for(let s=0;s<t;s++){const t=r(s),o=e.components.meta[s],n=o.index;o.material.opacity=t,e.components.buffer.textureBuffer.setDataElement(n,1,3,255*t)}this._updateTransparency(e)})),this.setNeedsRender()}async getObjectMemoryUsage(e){return(await this._getObjectEntry(e)).renderables.reduce(((e,t)=>e+t.statistics.gpuMemoryUsage),0)}async updateAllComponentMaterials(e,t,r,s){const o=e instanceof P,n=!!r.hasSlicePlane,i=G(t),a=V.getKey(i,n,o);(await this.updatingHandles.addPromise(this._getObjectEntry(e))).renderables.forEach((e=>{if(a!==e.rendererKey){const t=this.renderers.get(e.rendererKey),r=this._acquireRenderer(i,n,o);t.removeRenderable(e),t.refCount.decrement(),e.rendererKey=a,r.addRenderable(e)}for(let r=0;r<t.length;r++)e.components.meta[r].material=t[r];s&&this._updateComponentBuffer(e.components),this._updateTransparency(e)})),this.setNeedsRender()}async updateObjectVisibility(e,t){(await this.updatingHandles.addPromise(this._getObjectEntry(e))).renderables.forEach((e=>e.visible=t)),this.setNeedsRender()}removeObject(e){const t=this.perObjectData.get(e);t&&(this.perObjectData.delete(e),this._discardObjectEntry(t))}async _getObjectEntry(e){const t=this.perObjectData.get(e);if(!t)throw"no object";return await t.loaded,t}removeAll(){this.perObjectData.forEach(((e,t)=>this.removeObject(t)))}render(e,t){if(this.numberOfRenderedEdges[t]=0,a(this.componentColorManager))return;this.localOrigins.updateViewMatrices(e.camera.viewMatrix);const r=e.camera.viewInverseTransposeMatrix,s=v(),o=new T;let n=0,i=0;if(this.renderers.forEach((r=>{0===r.refCount.value?(this.renderers.delete(r.key),r.dispose()):r.forEachRenderable((t=>{t.visible&&(n+=t.statistics.averageEdgeLength,i++,t.regular&&r.updateTechnique(e,!1),t.silhouette&&r.updateTechnique(e,!0))}),t)})),this.componentColorManager.garbageCollect(),this.componentColorManager.updateTextures(),0===i)return;const c=40*n/i,d=e.camera.perScreenPixelRatio,l=new z(c,d,t);b(s,r[3],r[7],r[11]),o.set(s),y(l.transformWorldFromViewTH,o.high),y(l.transformWorldFromViewTL,o.low),g(l.transformViewFromCameraRelativeRS,e.camera.viewMatrix),u(ie,l.transformViewFromCameraRelativeRS),m(l.transformNormalViewFromGlobal,ie),l.transformProjFromView=e.camera.projectionMatrix,this._updateObjectCameraDistances(e),this.renderers.forEach((t=>{this._renderRegularEdges(t,e,l),this._renderSilhouetteEdges(t,e,l)}))}_updateTransparency(e){const t=F(e.components.meta),r=Q(e.components.meta);t===e.edgeTransparency&&r===e.objectTransparency||(e.edgeTransparency=t,e.objectTransparency=r,this.renderers.get(e.rendererKey).setRenderablesDirty())}_computeModelTransformWithLocalOrigin(e,t,r){if(e.getCombinedStaticTransformation(t,r),c(t.origin))this.localOrigins.register(t.origin);else{const e=b(this.tmpModelPosition,r[12],r[13],r[14]);t.origin=this.localOrigins.acquire(e)}return M(t.origin.vec3,r),t.origin}_updateComponentBuffer(e){const{meta:t,buffer:r}=e;for(let s=0;s<t.length;s++){const e=t[s].material,n=t[s].index,i=o(Math.round(e.size*N),0,255),a=o(e.extensionLength,-H,255-H)+H,c="solid"===e.type?U.SOLID:U.SKETCH,d=255*e.opacity,l=e.color,g=255*l[0],u=255*l[1],m=255*l[2],h=255*l[3];r.textureBuffer.setData(n,0,g,u,m,h),r.textureBuffer.setData(n,1,i,a,c,d)}}_createComponentBuffers(e){if(a(this.componentColorManager))return null;const t=new Array,r=this.componentColorManager.getBuffer(e.length);for(let o=0;o<e.length;o++){const s=e[o],n=r.acquireIndex();t.push({index:n,material:s})}const s={meta:t,buffer:r};return this._updateComponentBuffer(s),s}_extractEdges(e,t,r,s,o,n=o.length){return this.worker.process({data:t,indices:o,indicesLength:n,writerSettings:e,skipDeduplicate:r},this.workerAbort.signal,s)}_createEdgeResources(e){const t={};if(a(this.verticesBufferObject))return t;if(e.regular.lodInfo.lengths.length>0){const r=new ee(this.rctx,A,{vertices:k,instances:B.glLayout},{vertices:this.verticesBufferObject,instances:Z.createVertex(this.rctx,$.STATIC_DRAW,e.regular.instancesData.buffer)});t.regular={vao:r,lod:e.regular.lodInfo}}if(e.silhouette.lodInfo.lengths.length>0){const r=new ee(this.rctx,A,{vertices:k,instances:L.glLayout},{vertices:this.verticesBufferObject,instances:Z.createVertex(this.rctx,$.STATIC_DRAW,e.silhouette.instancesData.buffer)});t.silhouette={vao:r,lod:e.silhouette.lodInfo}}return t}async _addGeometry(e,t,r,s,o,n,i){const a=r.vertexAttributes.get(S.POSITION),c=r.indices.get(S.POSITION),d=f(),l={position:a,indices:c,modelTransform:d,origin:this._computeModelTransformWithLocalOrigin(e,s,d)};return this._addPositionData(t,l,r.edgeIndicesLength,o,n,i)}async _addPositionData(e,t,r,s,o,n=!1){if(null==e.loaded)return;const i=this._createComponentBuffers([s]);if(a(i)||r<=0)return;const c=this._acquireRenderer(s.type,!!o.hasSlicePlane,!0),{modelTransform:d,origin:l}=t,g=t.indices,u=t.position,m=u.data.length/u.size,h=I.createBuffer(m);for(let a=0;a<m;a++)h.position.set(a,0,u.data[a*u.size+0]),h.position.set(a,1,u.data[a*u.size+1]),h.position.set(a,2,u.data[a*u.size+2]);J(i.meta,[0,h.componentIndex.count],h.componentIndex);const p=await this.updatingHandles.addPromise(this._extractEdges(c.writerSettings,h,!1,n,g,r));if(null==e.loaded)return;const{regular:f,silhouette:b}=this._createEdgeResources(p),y=(f?f.vao.size:0)+(b?b.vao.size:0),j={regular:f,silhouette:b,transform:{modelMatrix:d,origin:l},statistics:{gpuMemoryUsage:y,externalMemoryUsage:!1,averageEdgeLength:p.averageEdgeLength},components:i,visible:!0,edgeTransparency:F(i.meta),objectTransparency:Q(i.meta),distanceToCamera:0,rendererKey:c.key};e.renderables.push(j),c.addRenderable(j),this.gpuMemoryUsage+=y}async _addComponentGeometry(e,t,r,s,o,n,i){if(null==t.loaded)return 0;const c=this._createComponentBuffers(n);if(a(c))return 0;const d=G(n),l=this._acquireRenderer(d,i.hasSlicePlane||!1,!1),g=I.createBuffer(r.count);x(g.position,r),J(c.meta,o,g.componentIndex,s);const u=!0,m=l.writerSettings,h=await this.updatingHandles.addPromise(this._extractEdges(m,g,u,!1,s));if(null==t.loaded)return 0;const{regular:p,silhouette:f}=this._createEdgeResources(h),b=(p?p.vao.size:0)+(f?f.vao.size:0),y={regular:p,silhouette:f,transform:e,statistics:{gpuMemoryUsage:b,externalMemoryUsage:!0,averageEdgeLength:h.averageEdgeLength},components:c,visible:!0,edgeTransparency:F(c.meta),objectTransparency:Q(c.meta),distanceToCamera:0,rendererKey:l.key};return t.renderables.push(y),l.addRenderable(y),b}async _addObjectMergedGeometries(e,t,r,s,o){const n=new Map;let i=0,a=null,c=0;for(let f=0;f<e.geometries.length;f++){const t=e.geometries[f],r=e.geometryRecords[f];if(!r.material.supportsEdges)continue;!a&&r.origin&&(a=r);const s=t.vertexAttributes.get(S.POSITION);c+=s.data.length/s.size,i+=t.edgeIndicesLength}const d=c>=65536?Uint32Array:Uint16Array,l=i?new d(i):null,g=[];let u=0;for(let f=0;f<e.geometries.length;f++){const t=e.geometries[f];if(!e.geometryRecords[f].material.supportsEdges)continue;const r=t.vertexAttributes.get(S.POSITION),s=t.indices.get(S.POSITION);let o=n.get(r.data);if(null==o){o=g.length/3;for(let e=0;e<r.data.length;e+=r.size)g.push(r.data[e+0]),g.push(r.data[e+1]),g.push(r.data[e+2]);n.set(r.data,o)}if(s)for(let e=0;e<t.edgeIndicesLength;e++)l[u++]=o+s[e]}const m=a||e.geometryRecords[0],h=f(),p=this._computeModelTransformWithLocalOrigin(e,m,h);for(let f=0;f<e.geometryRecords.length;f++)e.geometryRecords[f].origin=p;const b={position:{data:g,size:3},indices:l,modelTransform:h,origin:p};await this.updatingHandles.addPromise(this._addPositionData(t,b,l.length,r[0],s,o))}_acquireRenderer(e,t,r){const s=V.getKey(e,t,r);let o=this.renderers.get(s);return a(this.strokesTexture)&&(this.strokesTexture=K(this.rctx)),o||(o=new V(this.rctx,this.techniqueRepository,{type:e,hasSlicePlane:t,strokesTexture:this.strokesTexture,legacy:r}),this.renderers.set(s,o)),o.refCount.increment(),o}_removeRenderable(e){se(e);const t=this.renderers.get(e.rendererKey);if(t){t.removeRenderable(e),t.refCount.decrement(),"origin"in e.transform&&this.localOrigins.release(e.transform.origin),this.gpuMemoryUsage-=e.statistics.externalMemoryUsage?0:e.statistics.gpuMemoryUsage;for(const t of e.components.meta)e.components.buffer.releaseIndex(t.index)}}_updateObjectCameraDistances(e){const t=e.camera.eye,r=e.camera.viewForward,s=v(),o=e=>{const{center:o,radius:n}=e;j(s,o,t);const i=O(s,r),a=i<-n?1/0:i<n?0:i-n;e.renderables.forEach((e=>e.distanceToCamera=a))};this.perObjectData.forEach(o),this.perObjectDataEvictionCache.forEach(o)}_renderRegularEdges(e,t,r){const s=e.bindRegularEdges(r,t),o=r.transparency;e.forEachRenderable((n=>{if(!n.visible||!n.regular)return;const i=X(n.regular.lod.lengths,n.distanceToCamera,r),a="origin"in n.transform?this.localOrigins.getViewMatrix(n.transform.origin):p;e.renderRegularEdges(s,n,t,i,a),this.numberOfRenderedEdges[o]+=i}),o)}_renderSilhouetteEdges(e,t,r){const s=e.bindSilhouetteEdges(r,t),o=r.transparency;e.forEachRenderable((n=>{if(!n.visible||!n.silhouette)return;const i=X(n.silhouette.lod.lengths,n.distanceToCamera,r),a="origin"in n.transform?this.localOrigins.getViewMatrix(n.transform.origin):p;e.renderSilhouetteEdges(s,n,t,i,a),this.numberOfRenderedEdges[o]+=i}),o)}};function se(e){e.regular&&(e.regular.vao.vertexBuffers.instances.dispose(),e.regular.vao.dispose(!1),e.regular.vao=null),e.silhouette&&(e.silhouette.vao.vertexBuffers.instances.dispose(),e.silhouette.vao.dispose(!1),e.silhouette.vao=null)}function oe(e){let t=null,s=null;for(let n=0;n<e.geometries.length;n++){var o;const i=e.geometryRecords[n];if(i.material.supportsEdges){if(t){if(!r(t,i.transformation))return!1}else t=i.transformation;if(!s&&c(i.origin))s=i;else if(c(null==(o=s)?void 0:o.origin)&&c(i.origin)&&s.origin.id!==i.origin.id)return!1}}return!0}e([d({constructOnly:!0})],re.prototype,"rctx",void 0),e([d({constructOnly:!0})],re.prototype,"renderSR",void 0),e([d({constructOnly:!0})],re.prototype,"techniqueRepository",void 0),e([d({constructOnly:!0})],re.prototype,"setNeedsRender",void 0),e([d({constructOnly:!0})],re.prototype,"schedule",void 0),e([d({readOnly:!0})],re.prototype,"updatingHandles",void 0),e([d({readOnly:!0})],re.prototype,"updating",null),re=e([l("esri.views.3d.webgl-engine.lib.edgeRendering.EdgeView")],re);class ne{constructor(e,t,r){this.center=t,this.radius=r,this.renderables=new Array,this.loaded=e,this.loaded.then((()=>{null!=this.loaded&&(this.loaded=!0)}))}}const ie=h();export{re as EdgeView};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.24/esri/copyright.txt for details.
4
4
  */
5
- import{isUint32Array as e}from"../../../../../core/typedArrayUtil.js";import{WorkerHandle as r}from"../../../../../core/workers/WorkerHandle.js";import{unpackInterleavedBuffer as t}from"../../../support/buffer/workerHelper.js";import{work as n}from"./EdgeProcessingWorker.js";class s extends r{constructor(e){super("EdgeProcessingWorker","wrappedWork",e)}async process(e,r,t){if(t)return n(e);const s=this._packInput(e),a=await this.invoke(s,r);return this._unpackOutput(a)}getTransferList(e){return[e.dataBuffer]}_packInput(r){return{dataBuffer:r.data.buffer,writerSettings:r.writerSettings,skipDeduplicate:r.skipDeduplicate,indicesBuffer:r.indices.buffer,indicesType:e(r.indices)?"Uint32Array":"Uint16Array",indicesLength:r.indicesLength}}_unpackOutput(e){return{regular:{instancesData:t(e.regular.instancesData),lodInfo:{lengths:new Float32Array(e.regular.lodInfo.lengths)}},silhouette:{instancesData:t(e.silhouette.instancesData),lodInfo:{lengths:new Float32Array(e.silhouette.lodInfo.lengths)}},averageEdgeLength:e.averageEdgeLength}}}export{s as default};
5
+ import{isUint32Array as t}from"../../../../../core/typedArrayUtil.js";import{WorkerHandle as e}from"../../../../../core/workers/WorkerHandle.js";import{unpackInterleavedBuffer as r}from"../../../support/buffer/workerHelper.js";import{extract as a}from"./EdgeProcessingWorker.js";class n extends e{constructor(t){super("EdgeProcessingWorker","extract",{extract:t=>[t.dataBuffer],extractComponentsEdgeLocations:t=>[t.dataBuffer],extractEdgeLocations:t=>[t.dataBuffer]},t)}async process(t,e,r){if(r)return a(t);const n=this._packInput(t),s=await this.invoke(n,e);return this._unpackOutput(s)}async extractEdgeLocations(t,e){const a=this._packInput(t),n=await this.invokeMethod("extractEdgeLocations",a,e);return r(n)}async extractComponentsEdgeLocations(t,e){const a=this._packInput(t),n=await this.invokeMethod("extractComponentsEdgeLocations",a,e);return r(n)}_packInput(e){return{dataBuffer:e.data.buffer,writerSettings:e.writerSettings,skipDeduplicate:e.skipDeduplicate,indicesBuffer:e.indices.buffer,indicesType:t(e.indices)?"Uint32Array":"Uint16Array",indicesLength:e.indicesLength}}_unpackOutput(t){return{regular:{instancesData:r(t.regular.instancesData),lodInfo:{lengths:new Float32Array(t.regular.lodInfo.lengths)}},silhouette:{instancesData:r(t.silhouette.instancesData),lodInfo:{lengths:new Float32Array(t.silhouette.lodInfo.lengths)}},averageEdgeLength:t.averageEdgeLength}}}export{n as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.24/esri/copyright.txt for details.
4
4
  */
5
- import{isSome as t}from"../../../../core/maybe.js";import{n as s}from"../../../../chunks/mat3.js";import{c as r}from"../../../../chunks/mat3f64.js";import{a as e,t as i,c as o,m as n}from"../../../../chunks/mat4.js";import{c as a}from"../../../../chunks/mat4f64.js";import{c as h}from"../../../../chunks/quat.js";import{a as f}from"../../../../chunks/quatf64.js";import{q as l,a as m,b as c}from"../../../../chunks/vec3.js";import{c as b}from"../../../../chunks/vec3f32.js";import{c as p}from"../../../../chunks/vec3f64.js";import{c as u}from"../../../../chunks/vec4f64.js";import{c as v}from"../../../../chunks/sphere.js";class z{constructor(){this._transform=a(),this._transformInverse=new T({value:this._transform},e,a),this._transformInverseTranspose=new T(this._transformInverse,i,a),this._transformTranspose=new T({value:this._transform},i,a),this._transformInverseRotation=new T({value:this._transform},s,r)}_invalidateLazyTransforms(){this._transformInverse.invalidate(),this._transformInverseTranspose.invalidate(),this._transformTranspose.invalidate(),this._transformInverseRotation.invalidate()}get transform(){return this._transform}get inverse(){return this._transformInverse.value}get inverseTranspose(){return this._transformInverseTranspose.value}get inverseRotation(){return this._transformInverseRotation.value}get transpose(){return this._transformTranspose.value}setTransformMatrix(t){o(this._transform,t)}multiplyTransform(t){n(this._transform,this._transform,t)}set(t){o(this._transform,t),this._invalidateLazyTransforms()}setAndInvalidateLazyTransforms(t,s){this.setTransformMatrix(t),this.multiplyTransform(s),this._invalidateLazyTransforms()}}class T{constructor(t,s,r){this.original=t,this.update=s,this.dirty=!0,this.transform=r()}invalidate(){this.dirty=!0}get value(){return this.dirty&&(this.update(this.transform,this.original.value),this.dirty=!1),this.transform}}class S{constructor(t=0){this.offset=t,this.tmpVertex=p()}applyToVertex(t,s,r){const e=t+this.localOrigin[0],i=s+this.localOrigin[1],o=r+this.localOrigin[2],n=this.offset/Math.sqrt(e*e+i*i+o*o);return this.tmpVertex[0]=t+e*n,this.tmpVertex[1]=s+i*n,this.tmpVertex[2]=r+o*n,this.tmpVertex}applyToAabb(t){for(let i=0;i<3;++i)g[i]=t[0+i]+this.localOrigin[i],x[i]=t[3+i]+this.localOrigin[i],_[i]=g[i];const s=this.applyToVertex(g[0],g[1],g[2]);for(let i=0;i<3;++i)t[i]=s[i],t[i+3]=s[i];const r=s=>{const r=this.applyToVertex(s[0],s[1],s[2]);for(let e=0;e<3;++e)t[e+0]=Math.min(t[e+0],r[e]),t[e+3]=Math.max(t[e+3],r[e])};for(let i=1;i<8;++i){for(let t=0;t<3;++t)_[t]=0==(i&1<<t)?g[t]:x[t];r(_)}let e=0;for(let i=0;i<3;++i){g[i]*x[i]<0&&(e|=1<<i)}if(0!==e&&7!==e)for(let i=0;i<8;++i)if(0==(e&i)){for(let t=0;t<3;++t)e[t]?_[t]=0:_[t]=0!=(i&1<<t)?g[t]:x[t];r(_)}for(let i=0;i<3;++i)t[i+0]-=this.localOrigin[i],t[i+3]-=this.localOrigin[i];return t}}const g=p(),x=p(),_=p();class y{constructor(t=0){this.offset=t,this.componentLocalOriginLength=0,this.tmpVertex=p(),this.mbs=u(),this.obb={center:p(),halfSize:b(),quaternion:null}}set localOrigin(t){this.componentLocalOriginLength=Math.sqrt(t[0]*t[0]+t[1]*t[1]+t[2]*t[2])}applyToVertex(t,s,r){const e=t,i=s,o=r+this.componentLocalOriginLength,n=this.offset/Math.sqrt(e*e+i*i+o*o);return this.tmpVertex[0]=t+e*n,this.tmpVertex[1]=s+i*n,this.tmpVertex[2]=r+o*n,this.tmpVertex}applyToAabb(t){const s=t[0],r=t[1],e=t[2]+this.componentLocalOriginLength,i=t[3],o=t[4],n=t[5]+this.componentLocalOriginLength,a=this.offset/Math.sqrt(s*s+r*r+e*e);t[0]+=s*a,t[1]+=r*a,t[2]+=e*a;const h=this.offset/Math.sqrt(i*i+o*o+n*n);return t[3]+=i*h,t[4]+=o*h,t[5]+=n*h,t}applyToMbs(t){const s=Math.sqrt(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]),r=this.offset/s;return this.mbs[0]=t[0]+t[0]*r,this.mbs[1]=t[1]+t[1]*r,this.mbs[2]=t[2]+t[2]*r,this.mbs[3]=t[3]+t[3]*this.offset/s,this.mbs}applyToObb(t){const s=t.center,r=this.offset/Math.sqrt(s[0]*s[0]+s[1]*s[1]+s[2]*s[2]);this.obb.center[0]=s[0]+s[0]*r,this.obb.center[1]=s[1]+s[1]*r,this.obb.center[2]=s[2]+s[2]*r,l(this.obb.halfSize,t.halfSize,t.quaternion),m(this.obb.halfSize,this.obb.halfSize,t.center);const e=this.offset/Math.sqrt(this.obb.halfSize[0]*this.obb.halfSize[0]+this.obb.halfSize[1]*this.obb.halfSize[1]+this.obb.halfSize[2]*this.obb.halfSize[2]);return this.obb.halfSize[0]+=this.obb.halfSize[0]*e,this.obb.halfSize[1]+=this.obb.halfSize[1]*e,this.obb.halfSize[2]+=this.obb.halfSize[2]*e,c(this.obb.halfSize,this.obb.halfSize,t.center),h(I,t.quaternion),l(this.obb.halfSize,this.obb.halfSize,I),this.obb.halfSize[0]*=this.obb.halfSize[0]<0?-1:1,this.obb.halfSize[1]*=this.obb.halfSize[1]<0?-1:1,this.obb.halfSize[2]*=this.obb.halfSize[2]<0?-1:1,this.obb.quaternion=t.quaternion,this.obb}}class q{constructor(t=0){this.offset=t,this.sphere=v(),this.tmpVertex=p()}applyToVertex(t,s,r){const e=this.objectTransform.transform;let i=e[0]*t+e[4]*s+e[8]*r+e[12],o=e[1]*t+e[5]*s+e[9]*r+e[13],n=e[2]*t+e[6]*s+e[10]*r+e[14];const a=this.offset/Math.sqrt(i*i+o*o+n*n);i+=i*a,o+=o*a,n+=n*a;const h=this.objectTransform.inverse;return this.tmpVertex[0]=h[0]*i+h[4]*o+h[8]*n+h[12],this.tmpVertex[1]=h[1]*i+h[5]*o+h[9]*n+h[13],this.tmpVertex[2]=h[2]*i+h[6]*o+h[10]*n+h[14],this.tmpVertex}applyToMinMax(t,s){const r=this.offset/Math.sqrt(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);t[0]+=t[0]*r,t[1]+=t[1]*r,t[2]+=t[2]*r;const e=this.offset/Math.sqrt(s[0]*s[0]+s[1]*s[1]+s[2]*s[2]);s[0]+=s[0]*e,s[1]+=s[1]*e,s[2]+=s[2]*e}applyToAabb(t){const s=this.offset/Math.sqrt(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);t[0]+=t[0]*s,t[1]+=t[1]*s,t[2]+=t[2]*s;const r=this.offset/Math.sqrt(t[3]*t[3]+t[4]*t[4]+t[5]*t[5]);return t[3]+=t[3]*r,t[4]+=t[4]*r,t[5]+=t[5]*r,t}applyToBoundingSphere(t){const s=Math.sqrt(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]),r=this.offset/s;return this.sphere[0]=t[0]+t[0]*r,this.sphere[1]=t[1]+t[1]*r,this.sphere[2]=t[2]+t[2]*r,this.sphere[3]=t[3]+t[3]*this.offset/s,this.sphere}}const M=new q;function V(s){return t(s)?(M.offset=s,M):null}const d=new y;function j(s){return t(s)?(d.offset=s,d):null}const L=new S;function O(s){return t(s)?(L.offset=s,L):null}const k="terrain",I=f();export{y as I3SVerticalOffsetGlobalViewingMode,z as IntersectorTransform,q as Object3DVerticalOffsetGlobalViewingMode,k as TERRAIN_ID,S as TerrainVerticalOffsetGlobalViewingMode,j as getVerticalOffsetI3S,V as getVerticalOffsetObject3D,O as getVerticalOffsetTerrain};
5
+ import{isSome as t}from"../../../../core/maybe.js";import{n as s}from"../../../../chunks/mat3.js";import{c as r}from"../../../../chunks/mat3f64.js";import{a as e,t as i,c as o,m as n}from"../../../../chunks/mat4.js";import{c as a}from"../../../../chunks/mat4f64.js";import{c as h}from"../../../../chunks/quat.js";import{a as f}from"../../../../chunks/quatf64.js";import{q as l,a as m,b as c}from"../../../../chunks/vec3.js";import{c as b}from"../../../../chunks/vec3f32.js";import{c as p}from"../../../../chunks/vec3f64.js";import{c as u}from"../../../../chunks/sphere.js";class v{constructor(){this._transform=a(),this._transformInverse=new z({value:this._transform},e,a),this._transformInverseTranspose=new z(this._transformInverse,i,a),this._transformTranspose=new z({value:this._transform},i,a),this._transformInverseRotation=new z({value:this._transform},s,r)}_invalidateLazyTransforms(){this._transformInverse.invalidate(),this._transformInverseTranspose.invalidate(),this._transformTranspose.invalidate(),this._transformInverseRotation.invalidate()}get transform(){return this._transform}get inverse(){return this._transformInverse.value}get inverseTranspose(){return this._transformInverseTranspose.value}get inverseRotation(){return this._transformInverseRotation.value}get transpose(){return this._transformTranspose.value}setTransformMatrix(t){o(this._transform,t)}multiplyTransform(t){n(this._transform,this._transform,t)}set(t){o(this._transform,t),this._invalidateLazyTransforms()}setAndInvalidateLazyTransforms(t,s){this.setTransformMatrix(t),this.multiplyTransform(s),this._invalidateLazyTransforms()}}class z{constructor(t,s,r){this.original=t,this.update=s,this.dirty=!0,this.transform=r()}invalidate(){this.dirty=!0}get value(){return this.dirty&&(this.update(this.transform,this.original.value),this.dirty=!1),this.transform}}class T{constructor(t=0){this.offset=t,this.tmpVertex=p()}applyToVertex(t,s,r){const e=t+this.localOrigin[0],i=s+this.localOrigin[1],o=r+this.localOrigin[2],n=this.offset/Math.sqrt(e*e+i*i+o*o);return this.tmpVertex[0]=t+e*n,this.tmpVertex[1]=s+i*n,this.tmpVertex[2]=r+o*n,this.tmpVertex}applyToAabb(t){for(let i=0;i<3;++i)S[i]=t[0+i]+this.localOrigin[i],g[i]=t[3+i]+this.localOrigin[i],x[i]=S[i];const s=this.applyToVertex(S[0],S[1],S[2]);for(let i=0;i<3;++i)t[i]=s[i],t[i+3]=s[i];const r=s=>{const r=this.applyToVertex(s[0],s[1],s[2]);for(let e=0;e<3;++e)t[e+0]=Math.min(t[e+0],r[e]),t[e+3]=Math.max(t[e+3],r[e])};for(let i=1;i<8;++i){for(let t=0;t<3;++t)x[t]=0==(i&1<<t)?S[t]:g[t];r(x)}let e=0;for(let i=0;i<3;++i){S[i]*g[i]<0&&(e|=1<<i)}if(0!==e&&7!==e)for(let i=0;i<8;++i)if(0==(e&i)){for(let t=0;t<3;++t)e[t]?x[t]=0:x[t]=0!=(i&1<<t)?S[t]:g[t];r(x)}for(let i=0;i<3;++i)t[i+0]-=this.localOrigin[i],t[i+3]-=this.localOrigin[i];return t}}const S=p(),g=p(),x=p();class _{constructor(t=0){this.offset=t,this.componentLocalOriginLength=0,this.tmpVertex=p(),this.mbs=u(),this.obb={center:p(),halfSize:b(),quaternion:null}}set localOrigin(t){this.componentLocalOriginLength=Math.sqrt(t[0]*t[0]+t[1]*t[1]+t[2]*t[2])}applyToVertex(t,s,r){const e=t,i=s,o=r+this.componentLocalOriginLength,n=this.offset/Math.sqrt(e*e+i*i+o*o);return this.tmpVertex[0]=t+e*n,this.tmpVertex[1]=s+i*n,this.tmpVertex[2]=r+o*n,this.tmpVertex}applyToAabb(t){const s=t[0],r=t[1],e=t[2]+this.componentLocalOriginLength,i=t[3],o=t[4],n=t[5]+this.componentLocalOriginLength,a=this.offset/Math.sqrt(s*s+r*r+e*e);t[0]+=s*a,t[1]+=r*a,t[2]+=e*a;const h=this.offset/Math.sqrt(i*i+o*o+n*n);return t[3]+=i*h,t[4]+=o*h,t[5]+=n*h,t}applyToMbs(t){const s=Math.sqrt(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]),r=this.offset/s;return this.mbs[0]=t[0]+t[0]*r,this.mbs[1]=t[1]+t[1]*r,this.mbs[2]=t[2]+t[2]*r,this.mbs[3]=t[3]+t[3]*this.offset/s,this.mbs}applyToObb(t){const s=t.center,r=this.offset/Math.sqrt(s[0]*s[0]+s[1]*s[1]+s[2]*s[2]);this.obb.center[0]=s[0]+s[0]*r,this.obb.center[1]=s[1]+s[1]*r,this.obb.center[2]=s[2]+s[2]*r,l(this.obb.halfSize,t.halfSize,t.quaternion),m(this.obb.halfSize,this.obb.halfSize,t.center);const e=this.offset/Math.sqrt(this.obb.halfSize[0]*this.obb.halfSize[0]+this.obb.halfSize[1]*this.obb.halfSize[1]+this.obb.halfSize[2]*this.obb.halfSize[2]);return this.obb.halfSize[0]+=this.obb.halfSize[0]*e,this.obb.halfSize[1]+=this.obb.halfSize[1]*e,this.obb.halfSize[2]+=this.obb.halfSize[2]*e,c(this.obb.halfSize,this.obb.halfSize,t.center),h(I,t.quaternion),l(this.obb.halfSize,this.obb.halfSize,I),this.obb.halfSize[0]*=this.obb.halfSize[0]<0?-1:1,this.obb.halfSize[1]*=this.obb.halfSize[1]<0?-1:1,this.obb.halfSize[2]*=this.obb.halfSize[2]<0?-1:1,this.obb.quaternion=t.quaternion,this.obb}}class y{constructor(t=0){this.offset=t,this.sphere=u(),this.tmpVertex=p()}applyToVertex(t,s,r){const e=this.objectTransform.transform;let i=e[0]*t+e[4]*s+e[8]*r+e[12],o=e[1]*t+e[5]*s+e[9]*r+e[13],n=e[2]*t+e[6]*s+e[10]*r+e[14];const a=this.offset/Math.sqrt(i*i+o*o+n*n);i+=i*a,o+=o*a,n+=n*a;const h=this.objectTransform.inverse;return this.tmpVertex[0]=h[0]*i+h[4]*o+h[8]*n+h[12],this.tmpVertex[1]=h[1]*i+h[5]*o+h[9]*n+h[13],this.tmpVertex[2]=h[2]*i+h[6]*o+h[10]*n+h[14],this.tmpVertex}applyToMinMax(t,s){const r=this.offset/Math.sqrt(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);t[0]+=t[0]*r,t[1]+=t[1]*r,t[2]+=t[2]*r;const e=this.offset/Math.sqrt(s[0]*s[0]+s[1]*s[1]+s[2]*s[2]);s[0]+=s[0]*e,s[1]+=s[1]*e,s[2]+=s[2]*e}applyToAabb(t){const s=this.offset/Math.sqrt(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);t[0]+=t[0]*s,t[1]+=t[1]*s,t[2]+=t[2]*s;const r=this.offset/Math.sqrt(t[3]*t[3]+t[4]*t[4]+t[5]*t[5]);return t[3]+=t[3]*r,t[4]+=t[4]*r,t[5]+=t[5]*r,t}applyToBoundingSphere(t){const s=Math.sqrt(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]),r=this.offset/s;return this.sphere[0]=t[0]+t[0]*r,this.sphere[1]=t[1]+t[1]*r,this.sphere[2]=t[2]+t[2]*r,this.sphere[3]=t[3]+t[3]*this.offset/s,this.sphere}}const q=new y;function M(s){return t(s)?(q.offset=s,q):null}const V=new _;function d(s){return t(s)?(V.offset=s,V):null}const L=new T;function O(s){return t(s)?(L.offset=s,L):null}const j="terrain",I=f();export{_ as I3SVerticalOffsetGlobalViewingMode,v as IntersectorTransform,y as Object3DVerticalOffsetGlobalViewingMode,j as TERRAIN_ID,T as TerrainVerticalOffsetGlobalViewingMode,d as getVerticalOffsetI3S,M as getVerticalOffsetObject3D,O as getVerticalOffsetTerrain};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.24/esri/copyright.txt for details.
4
4
  */
5
- import{newLayout as e}from"../../support/buffer/InterleavedLayout.js";import t from"../lib/GLMaterial.js";import{MaterialParameters as r,Material as s}from"../lib/Material.js";import{RenderPass as i}from"../lib/RenderPass.js";import{RenderSlot as n}from"../lib/RenderSlot.js";import{VertexAttribute as u}from"../lib/VertexAttribute.js";import{writePosition as a,writeBufferFloat as o}from"./internal/bufferWriterUtils.js";import{HeatmapDensityTechniqueConfiguration as l,HeatmapDensityTechnique as c}from"../shaders/HeatmapDensityTechnique.js";export{RadiusMode}from"../shaders/HeatmapDensityTechnique.js";class f extends r{constructor(){super(...arguments),this.searchRadius=128,this.resolutionForScale=0,this.isAttributeDriven=!1,this.minDensity=0,this.maxDensity=100,this.fieldTotal=0,this.pixelRatio=1}}class h extends s{constructor(e){super(e,new f),this._techniqueConfig=new l}requiresSlot(e,t){return e===n.DRAPED_MATERIAL&&t===i.MATERIAL}getConfiguration(){return this._techniqueConfig.isAttributeDriven=this.parameters.isAttributeDriven,this._techniqueConfig}createGLMaterial(e){return new m(e)}intersect(){}createBufferWriter(){return new p(this.parameters.isAttributeDriven?d:T)}}class m extends t{constructor(e){super(e)}beginSlot(e){return this.updateParameters(e)}updateParameters(e){return this.ensureTechnique(c,e)}}class p{constructor(e){this.vertexBufferLayout=e}allocate(e){return this.vertexBufferLayout.createBuffer(e)}elementCount(e){return e.indices.get(u.POSITION).length*A}write(e,t,r,s){a(t.indices.get(u.POSITION),t.vertexAttributes.get(u.POSITION).data,e.transformation,r.position,s,A);const i=t.indices.get(u.POSITION).length,n=r.uv0;let l=s;for(let u=0;u<i;++u)n.setValues(l++,-1,-1),n.setValues(l++,1,-1),n.setValues(l++,1,1),n.setValues(l++,1,1),n.setValues(l++,-1,1),n.setValues(l++,-1,-1);const c="featureAttribute"in r?r.featureAttribute:null;c&&o(t.indices.get(u.FEATUREATTRIBUTE),t.vertexAttributes.get(u.FEATUREATTRIBUTE).data,c,s,A)}}const T=e().vec3f(u.POSITION).vec2f(u.UV0),d=T.clone().f32(u.FEATUREATTRIBUTE),A=6;function b(e){return e instanceof h}export{h as HeatmapDensityMaterial,f as HeatmapDensityMaterialParameters,b as isHeatMapDensityMaterial};
5
+ import{newLayout as e}from"../../support/buffer/InterleavedLayout.js";import t from"../lib/GLMaterial.js";import{MaterialParameters as r,Material as s}from"../lib/Material.js";import{RenderPass as i}from"../lib/RenderPass.js";import{RenderSlot as n}from"../lib/RenderSlot.js";import{VertexAttribute as u}from"../lib/VertexAttribute.js";import{writePosition as a,writeBufferFloat as o}from"./internal/bufferWriterUtils.js";import{HeatmapDensityTechniqueConfiguration as c,HeatmapDensityTechnique as l}from"../shaders/HeatmapDensityTechnique.js";export{RadiusMode}from"../shaders/HeatmapDensityTechnique.js";class f extends r{constructor(){super(...arguments),this.searchRadius=128,this.resolutionForScale=0,this.isAttributeDriven=!1}}class m extends s{constructor(e){super(e,new f),this._techniqueConfig=new c}requiresSlot(e,t){return e===n.DRAPED_MATERIAL&&t===i.MATERIAL}getConfiguration(){return this._techniqueConfig.isAttributeDriven=this.parameters.isAttributeDriven,this._techniqueConfig}createGLMaterial(e){return new h(e)}intersect(){}createBufferWriter(){return new p(this.parameters.isAttributeDriven?A:T)}}class h extends t{constructor(e){super(e)}beginSlot(e){return this.updateParameters(e)}updateParameters(e){return this.ensureTechnique(l,e)}}class p{constructor(e){this.vertexBufferLayout=e}allocate(e){return this.vertexBufferLayout.createBuffer(e)}elementCount(e){return e.indices.get(u.POSITION).length*d}write(e,t,r,s){a(t.indices.get(u.POSITION),t.vertexAttributes.get(u.POSITION).data,e.transformation,r.position,s,d);const i=t.indices.get(u.POSITION).length,n=r.uv0;let c=s;for(let u=0;u<i;++u)n.setValues(c++,-1,-1),n.setValues(c++,1,-1),n.setValues(c++,1,1),n.setValues(c++,1,1),n.setValues(c++,-1,1),n.setValues(c++,-1,-1);const l="featureAttribute"in r?r.featureAttribute:null;l&&o(t.indices.get(u.FEATUREATTRIBUTE),t.vertexAttributes.get(u.FEATUREATTRIBUTE).data,l,s,d)}}const T=e().vec3f(u.POSITION).vec2f(u.UV0),A=T.clone().f32(u.FEATUREATTRIBUTE),d=6;function b(e){return e instanceof m}export{m as HeatmapDensityMaterial,f as HeatmapDensityMaterialParameters,b as isHeatMapDensityMaterial};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.24/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../../chunks/tslib.es6.js";import{ReloadableShaderModule as r}from"../core/shaderTechnique/ReloadableShaderModule.js";import{ShaderTechnique as t}from"../core/shaderTechnique/ShaderTechnique.js";import{parameter as o,ShaderTechniqueConfiguration as s}from"../core/shaderTechnique/ShaderTechniqueConfiguration.js";import{Default3D as i}from"../lib/DefaultVertexAttributeLocations.js";import{blendingDefault as n}from"../lib/OrderIndependentTransparency.js";import{Program as a}from"../lib/Program.js";import{H as m}from"../../../../chunks/Heatmap.glsl.js";import{PrimitiveType as l}from"../../../webgl/enums.js";import{makePipelineState as p,defaultColorWriteParams as d}from"../../../webgl/renderState.js";import{H as u}from"../../../../chunks/HeatmapDensity.glsl.js";export{H as HeatmapMode}from"../../../../chunks/HeatmapDensity.glsl.js";class c extends t{constructor(e,r){super(e,r,(()=>this.destroy()))}initializeProgram(e){const r=c.shader.get().build({mode:this.configuration.mode});return new a(e.rctx,r,i)}initializePipeline(){return p({blending:n,colorWrite:d,depthTest:null,depthWrite:null})}get primitiveType(){return l.TRIANGLE_STRIP}}c.shader=new r(m,(()=>import("./Heatmap.glsl.js")));class h extends s{constructor(){super(...arguments),this.mode=u.GaussianBlur}}e([o()],h.prototype,"mode",void 0);export{c as HeatmapTechnique,h as HeatmapTechniqueConfiguration};
5
+ import{_ as e}from"../../../../chunks/tslib.es6.js";import{NoParameters as r}from"../core/shaderModules/interfaces.js";import{ReloadableShaderModule as s}from"../core/shaderTechnique/ReloadableShaderModule.js";import{ShaderTechnique as t}from"../core/shaderTechnique/ShaderTechnique.js";import{parameter as i,ShaderTechniqueConfiguration as o}from"../core/shaderTechnique/ShaderTechniqueConfiguration.js";import{Default3D as n}from"../lib/DefaultVertexAttributeLocations.js";import{blendingDefault as a}from"../lib/OrderIndependentTransparency.js";import{Program as m}from"../lib/Program.js";import{H as l}from"../../../../chunks/Heatmap.glsl.js";import{PrimitiveType as p}from"../../../webgl/enums.js";import{makePipelineState as d,defaultColorWriteParams as u}from"../../../webgl/renderState.js";import{H as c}from"../../../../chunks/HeatmapDensity.glsl.js";export{H as HeatmapMode}from"../../../../chunks/HeatmapDensity.glsl.js";class h extends r{constructor(){super(...arguments),this.colorRamp=null,this.densityMap=null,this.searchRadius=1,this.fieldTotal=0,this.minDensity=0,this.maxDensity=100}}class f extends t{constructor(e,r){super(e,r,(()=>this.destroy()))}initializeProgram(e){const r=f.shader.get().build({mode:this.configuration.mode});return new m(e.rctx,r,n)}initializePipeline(){return d({blending:a,colorWrite:u,depthTest:null,depthWrite:null})}get primitiveType(){return p.TRIANGLE_STRIP}}f.shader=new s(l,(()=>import("./Heatmap.glsl.js")));class j extends o{constructor(){super(...arguments),this.mode=c.GaussianBlur}}e([i()],j.prototype,"mode",void 0);export{h as HeatmapPassParameters,f as HeatmapTechnique,j as HeatmapTechniqueConfiguration};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.24/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../chunks/tslib.es6.js";import{HandleOwner as t}from"../../../core/HandleOwner.js";import r from"../../../core/Handles.js";import{someMap as o}from"../../../core/MapUtils.js";import{isSome as i,unwrap as n,isNone as a}from"../../../core/maybe.js";import{eachAlwaysValues as s,throwIfAborted as c}from"../../../core/promiseUtils.js";import{sync as u,watch as l,syncAndInitial as d}from"../../../core/reactiveUtils.js";import{property as p}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/arrayUtils.js";import"../../../core/has.js";import"../../../core/accessorSupport/ensureType.js";import{subclass as h}from"../../../core/accessorSupport/decorators/subclass.js";import{c as g}from"../../../chunks/vec3f64.js";import{SnappingTypes as y}from"../../../layers/graphics/data/QueryEngineResult.js";import{RayConstraint as f}from"./SnappingConstraint.js";import{sortCandidatesInPlace as S,anyMapPointToRender as m,anyMapPointToScreenPoint as v}from"./snappingUtils.js";import{EdgeSnappingCandidate as w}from"./candidates/EdgeSnappingCandidate.js";import{FeatureSnappingCandidate as _}from"./candidates/FeatureSnappingCandidate.js";import{RightAngleSnappingCandidate as j,OtherVertexType as x}from"./candidates/RightAngleSnappingCandidate.js";let C=class extends t{constructor(e){super(e),this.sourceModules={featureService:{module:null,loader:null},featureCollection:{module:null,loader:null},graphics:{module:null,loader:null}}}get updating(){return o(this.snappingSources,(({snappingSource:e})=>e.updating))||this.updatingHandles.updating}get snappingSources(){var e;const t=this._get("snappingSources")||new Map,r=new Map;if(null!=(e=this.options)&&e.featureSources)for(const o of this.options.featureSources.items){const e=o.layer.uid,n=t.get(e);if(n){t.delete(e),r.set(e,n);continue}if(!o.layer.loaded){this.updatingHandles.addPromise(o.layer.load());continue}const a=this._createSourceInfo(o);i(a)&&r.set(e,a)}for(const[,o]of t)o.destroy();return r}initialize(){this.updatingHandles.add((()=>this.snappingSources),(()=>this.notifyChange("updating")),u),i(this.view)&&this.handles.add([this.view.on("layerview-create",(e=>this._updateLayerView(e.layer,e.layerView))),this.view.on("layerview-destroy",(e=>this._updateLayerView(e.layer,null)))])}_updateLayerView(e,t){for(const[,r]of this.snappingSources)r.snappingSource.layerSource.layer===e&&(r.layerView=t)}destroy(){this._set("options",null);for(const[,e]of this.snappingSources)e.destroy()}async fetchCandidates(e,t,r){if(!this.options.effectiveFeatureEnabled)return[];const o=[],n=this._computeScreeenSizeDistanceParameters(e,t),a={distance:n,point:e,coordinateHelper:t.coordinateHelper,types:this.types,filter:null};for(const[,{snappingSource:s,layerView:c}]of this.snappingSources)!s.layerSource.enabled||i(c)&&c.suspended||o.push(s.fetchCandidates(a,r).then((e=>e.filter((e=>!this._candidateIsExcluded(s,e,t.excludeFeature))))));const u=(await s(o)).flat();return this._addRightAngleCandidates(u,e,n,t),c(r),S(e,u),u}_addRightAngleCandidates(e,t,r,o){var a,s,c,u,l,d,p,h;const g=i(o.vertexHandle)?null==(a=o.vertexHandle.rightEdge)||null==(s=a.rightVertex)?void 0:s.pos:i(o.editGeometryOperations)&&"polygon"===o.editGeometryOperations.data.type?null==(c=n(null==(u=o.editGeometryOperations.data.components[0])?void 0:u.getFirstVertex()))?void 0:c.pos:null,y=i(o.vertexHandle)?null==(l=o.vertexHandle.leftEdge)||null==(d=l.leftVertex)?void 0:d.pos:i(o.editGeometryOperations)?null==(p=n(null==(h=o.editGeometryOperations.data.components[0])?void 0:h.getLastVertex()))?void 0:p.pos:null,f=e.length;for(let i=0;i<f;i++)this._addRightAngleCandidate(e[i],y,t,r,o,e),this._addRightAngleCandidate(e[i],g,t,r,o,e)}_addRightAngleCandidate(e,t,r,o,i,n){if(a(t)||!(e instanceof w))return;const s=e.constraint.closestTo(t),c=(s[0]-r[0])/o.x,u=(s[1]-r[1])/o.y;if(c*c+u*u<=1){const r=i.coordinateHelper;n.push(new j({coordinateHelper:r,targetPoint:s,otherVertex:t,otherVertexType:x.NEXT,previousVertex:e.constraint.start,constraint:new f(r,t,s),objectId:e.objectId}))}}_computeScreeenSizeDistanceParameters(e,t){const r=this.options.distance*("touch"===t.pointer?this.options.touchSensitivityMultiplier:1);return a(this.view)?{x:r,y:r}:"2d"===this.view.type?{x:r*this.view.resolution,y:r*this.view.resolution}:this._computeScreeenSizeDistanceParameters3D(e,r,this.view,t)}_computeScreeenSizeDistanceParameters3D(e,t,r,o){const{coordinateHelper:i,elevationInfo:n}=o,a=r.state.camera.computeScreenPixelSizeAt(m(e,i,n,r,M))*r.renderCoordsHelper.unitInMeters/r.mapCoordsHelper.unitInMeters,s=t*a;return{x:s/this._computeScreenMagnitudeOfMapOffset(e,a,0,r,o),y:s/this._computeScreenMagnitudeOfMapOffset(e,0,a,r,o)}}_computeScreenMagnitudeOfMapOffset(e,t,r,o,{coordinateHelper:i,elevationInfo:n}){const a=i.clone(e);a[0]+=t,a[1]+=r;const s=v(e,i,n,o),c=v(a,i,n,o),u=c.x-s.x,l=c.y-s.y;return Math.sqrt(u*u+l*l)}get types(){return y.EDGE|y.VERTEX}_candidateIsExcluded(e,t,r){if(a(r))return!1;const o=this._getCandidateObjectId(t);if(a(o))return!1;const i=e.layerSource.layer;return"graphics"===i.type?r.uid===o:r.sourceLayer===i&&(!(!r.attributes||!("objectIdField"in i))&&r.attributes[i.objectIdField]===o)}_getCandidateObjectId(e){return e instanceof _?e.objectId:null}_createSourceInfo(e){const t=this._createFeatureSnappingSourceType(e);if(a(t))return null;if("loading"in t)return this.updatingHandles.addPromise(t.loading.then((()=>{this.destroyed||this.notifyChange("snappingSources")}))),null;const r=i(this.view)?this.view.allLayerViews.find((t=>t.layer===e.layer)):null;return new H(t.source,r)}_createFeatureSnappingSourceType(e){switch(e.layer.type){case"feature":case"geojson":case"csv":case"subtype-group":case"wfs":return this._createFeatureSnappingSourceFeatureLayer(e);case"graphics":return this._createFeatureSnappingSourceGraphicsLayer(e)}return null}_createFeatureSnappingSourceFeatureLayer(e){switch(e.layer.source.type){case"feature-layer":{const t=this._getSourceModule("featureService");return i(t.module)?{source:new t.module.FeatureServiceSnappingSource({spatialReference:this.spatialReference,view:this.view,layerSource:e})}:{loading:t.loader}}case"memory":case"csv":case"geojson":case"wfs":{if("mesh"===e.layer.geometryType)return null;const t=this._getSourceModule("featureCollection");return i(t.module)?{source:new t.module.FeatureCollectionSnappingSource({layerSource:e})}:{loading:t.loader}}}return null}_createFeatureSnappingSourceGraphicsLayer(e){const t=this._getSourceModule("graphics");return i(t.module)?{source:new t.module.GraphicsSnappingSource({spatialReference:this.spatialReference,view:this.view,layerSource:e})}:{loading:t.loader}}_getSourceModule(e){const t=this.sourceModules[e];if(a(t.loader)){const r=this._loadSourceModule(e).then((e=>{t.module=e}));return t.loader=r,{module:t.module,loader:r}}return{module:t.module,loader:t.loader}}_loadSourceModule(e){switch(e){case"featureService":return this.updatingHandles.addPromise(import("./featureSources/FeatureServiceSnappingSource.js"));case"featureCollection":return this.updatingHandles.addPromise(import("./featureSources/FeatureCollectionSnappingSource.js"));case"graphics":return this.updatingHandles.addPromise(import("./featureSources/GraphicsSnappingSource.js"))}return null}};e([p({constructOnly:!0})],C.prototype,"spatialReference",void 0),e([p({constructOnly:!0})],C.prototype,"view",void 0),e([p()],C.prototype,"options",void 0),e([p({readOnly:!0})],C.prototype,"updating",null),e([p({readOnly:!0})],C.prototype,"snappingSources",null),C=e([h("esri.views.interactive.snapping.FeatureSnappingEngine")],C);class H{constructor(e,t){this.snappingSource=e,this.layerView=t,this.handles=new r;const o=this.snappingSource.layerSource.layer;if("refresh"in o){const t=o;this.handles.add(t.on("refresh",(()=>e.refresh())))}this.handles.add([l((()=>e.updating),(t=>e.layerSource.updating=t),d),l((()=>e.availability),(t=>e.layerSource.availability=t),d)])}destroy(){this.snappingSource.destroy(),this.handles.destroy()}}const M=g();export{C as FeatureSnappingEngine};
5
+ import{_ as e}from"../../../chunks/tslib.es6.js";import{HandleOwner as t}from"../../../core/HandleOwner.js";import r from"../../../core/Handles.js";import{someMap as i}from"../../../core/MapUtils.js";import{isSome as n,unwrap as o,isNone as a}from"../../../core/maybe.js";import{eachAlwaysValues as s,throwIfAborted as c}from"../../../core/promiseUtils.js";import{sync as u,watch as l,syncAndInitial as d}from"../../../core/reactiveUtils.js";import{property as p}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/arrayUtils.js";import"../../../core/has.js";import"../../../core/accessorSupport/ensureType.js";import{subclass as h}from"../../../core/accessorSupport/decorators/subclass.js";import{c as g}from"../../../chunks/vec3f64.js";import{SnappingTypes as f}from"../../../layers/graphics/data/QueryEngineResult.js";import{RayConstraint as y}from"./SnappingConstraint.js";import{sortCandidatesInPlace as S,anyMapPointToRender as m,anyMapPointToScreenPoint as v}from"./snappingUtils.js";import{EdgeSnappingCandidate as w}from"./candidates/EdgeSnappingCandidate.js";import{FeatureSnappingCandidate as _}from"./candidates/FeatureSnappingCandidate.js";import{RightAngleSnappingCandidate as j,OtherVertexType as x}from"./candidates/RightAngleSnappingCandidate.js";let C=class extends t{constructor(e){super(e),this.sourceModules={featureService:{module:null,loader:null},featureCollection:{module:null,loader:null},graphics:{module:null,loader:null}}}get updating(){return i(this.snappingSources,(({snappingSource:e})=>e.updating))||this.updatingHandles.updating}get snappingSources(){var e;const t=this._get("snappingSources")||new Map,r=new Map;if(null!=(e=this.options)&&e.featureSources)for(const i of this.options.featureSources.items){const e=i.layer.uid,o=t.get(e);if(o){t.delete(e),r.set(e,o);continue}if(!i.layer.loaded){this.updatingHandles.addPromise(i.layer.load());continue}const a=this._createSourceInfo(i);n(a)&&r.set(e,a)}for(const[,i]of t)i.destroy();return r}initialize(){this.updatingHandles.add((()=>this.snappingSources),(()=>this.notifyChange("updating")),u),n(this.view)&&this.handles.add([this.view.on("layerview-create",(e=>this._updateLayerView(e.layer,e.layerView))),this.view.on("layerview-destroy",(e=>this._updateLayerView(e.layer,null)))])}_updateLayerView(e,t){for(const[,r]of this.snappingSources)r.snappingSource.layerSource.layer===e&&(r.layerView=t)}destroy(){this._set("options",null);for(const[,e]of this.snappingSources)e.destroy()}async fetchCandidates(e,t,r){if(!this.options.effectiveFeatureEnabled)return[];const i=[],o=this._computeScreeenSizeDistanceParameters(e,t),a={distance:o,point:e,coordinateHelper:t.coordinateHelper,types:this.types,filter:null};for(const[,{snappingSource:s,layerView:c}]of this.snappingSources)!s.layerSource.enabled||n(c)&&c.suspended||i.push(s.fetchCandidates(a,r).then((e=>e.filter((e=>!this._candidateIsExcluded(s,e,t.excludeFeature))))));const u=(await s(i)).flat();return this._addRightAngleCandidates(u,e,o,t),c(r),S(e,u),u}_addRightAngleCandidates(e,t,r,i){var a,s,c,u,l,d,p,h;const g=n(i.vertexHandle)?null==(a=i.vertexHandle.rightEdge)||null==(s=a.rightVertex)?void 0:s.pos:n(i.editGeometryOperations)&&"polygon"===i.editGeometryOperations.data.type?null==(c=o(null==(u=i.editGeometryOperations.data.components[0])?void 0:u.getFirstVertex()))?void 0:c.pos:null,f=n(i.vertexHandle)?null==(l=i.vertexHandle.leftEdge)||null==(d=l.leftVertex)?void 0:d.pos:n(i.editGeometryOperations)?null==(p=o(null==(h=i.editGeometryOperations.data.components[0])?void 0:h.getLastVertex()))?void 0:p.pos:null,y=e.length;for(let n=0;n<y;n++)this._addRightAngleCandidate(e[n],f,t,r,i,e),this._addRightAngleCandidate(e[n],g,t,r,i,e)}_addRightAngleCandidate(e,t,r,i,n,o){if(a(t)||!(e instanceof w))return;const s=e.constraint.closestTo(t),c=(s[0]-r[0])/i.x,u=(s[1]-r[1])/i.y;if(c*c+u*u<=1){const r=n.coordinateHelper;o.push(new j({coordinateHelper:r,targetPoint:s,otherVertex:t,otherVertexType:x.NEXT,previousVertex:e.constraint.start,constraint:new y(r,t,s),objectId:e.objectId,elevationInfo:e.elevationInfo}))}}_computeScreeenSizeDistanceParameters(e,t){const r=this.options.distance*("touch"===t.pointer?this.options.touchSensitivityMultiplier:1);if(a(this.view))return{x:r,y:r,pixelSize:r};if("2d"===this.view.type){const e=r*this.view.resolution;return{x:e,y:e,pixelSize:e}}return this._computeScreeenSizeDistanceParameters3D(e,r,this.view,t)}_computeScreeenSizeDistanceParameters3D(e,t,r,i){const{coordinateHelper:n,elevationInfo:o}=i,a=r.state.camera.computeScreenPixelSizeAt(m(e,n,o,r,M)),s=a*r.renderCoordsHelper.unitInMeters/r.mapCoordsHelper.unitInMeters,c=t*s;return{x:c/this._computeScreenMagnitudeOfMapOffset(e,s,0,r,i),y:c/this._computeScreenMagnitudeOfMapOffset(e,0,s,r,i),pixelSize:a}}_computeScreenMagnitudeOfMapOffset(e,t,r,i,{coordinateHelper:n,elevationInfo:o}){const a=n.clone(e);a[0]+=t,a[1]+=r;const s=v(e,n,o,i),c=v(a,n,o,i),u=c.x-s.x,l=c.y-s.y;return Math.sqrt(u*u+l*l)}get types(){return f.EDGE|f.VERTEX}_candidateIsExcluded(e,t,r){if(a(r))return!1;const i=this._getCandidateObjectId(t);if(a(i))return!1;const n=e.layerSource.layer;return"graphics"===n.type?r.uid===i:r.sourceLayer===n&&(!(!r.attributes||!("objectIdField"in n))&&r.attributes[n.objectIdField]===i)}_getCandidateObjectId(e){return e instanceof _?e.objectId:null}_createSourceInfo(e){const t=this._createFeatureSnappingSourceType(e);if(a(t))return null;if("loading"in t)return this.updatingHandles.addPromise(t.loading.then((()=>{this.destroyed||this.notifyChange("snappingSources")}))),null;const r=n(this.view)?this.view.allLayerViews.find((t=>t.layer===e.layer)):null;return new H(t.source,r)}_createFeatureSnappingSourceType(e){switch(e.layer.type){case"feature":case"geojson":case"csv":case"subtype-group":case"wfs":return this._createFeatureSnappingSourceFeatureLayer(e);case"graphics":return this._createFeatureSnappingSourceGraphicsLayer(e)}return null}_createFeatureSnappingSourceFeatureLayer(e){switch(e.layer.source.type){case"feature-layer":{const t=this._getSourceModule("featureService");return n(t.module)?{source:new t.module.FeatureServiceSnappingSource({spatialReference:this.spatialReference,view:this.view,layerSource:e})}:{loading:t.loader}}case"memory":case"csv":case"geojson":case"wfs":{if("mesh"===e.layer.geometryType)return null;const t=this._getSourceModule("featureCollection");return n(t.module)?{source:new t.module.FeatureCollectionSnappingSource({layerSource:e})}:{loading:t.loader}}}return null}_createFeatureSnappingSourceGraphicsLayer(e){const t=this._getSourceModule("graphics");return n(t.module)?{source:new t.module.GraphicsSnappingSource({spatialReference:this.spatialReference,view:this.view,layerSource:e})}:{loading:t.loader}}_getSourceModule(e){const t=this.sourceModules[e];if(a(t.loader)){const r=this._loadSourceModule(e).then((e=>{t.module=e}));return t.loader=r,{module:t.module,loader:r}}return{module:t.module,loader:t.loader}}_loadSourceModule(e){switch(e){case"featureService":return this.updatingHandles.addPromise(import("./featureSources/FeatureServiceSnappingSource.js"));case"featureCollection":return this.updatingHandles.addPromise(import("./featureSources/FeatureCollectionSnappingSource.js"));case"graphics":return this.updatingHandles.addPromise(import("./featureSources/GraphicsSnappingSource.js"))}return null}};e([p({constructOnly:!0})],C.prototype,"spatialReference",void 0),e([p({constructOnly:!0})],C.prototype,"view",void 0),e([p()],C.prototype,"options",void 0),e([p({readOnly:!0})],C.prototype,"updating",null),e([p({readOnly:!0})],C.prototype,"snappingSources",null),C=e([h("esri.views.interactive.snapping.FeatureSnappingEngine")],C);class H{constructor(e,t){this.snappingSource=e,this.layerView=t,this.handles=new r;const i=this.snappingSource.layerSource.layer;if("refresh"in i){const t=i;this.handles.add(t.on("refresh",(()=>e.refresh())))}this.handles.add([l((()=>e.updating),(t=>e.layerSource.updating=t),d),l((()=>e.availability),(t=>e.layerSource.availability=t),d)])}destroy(){this.snappingSource.destroy(),this.handles.destroy()}}const M=g();export{C as FeatureSnappingEngine};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.24/esri/copyright.txt for details.
4
4
  */
5
- import{unwrap as e}from"../../../core/maybe.js";import{a as t}from"../../../chunks/vec2f64.js";import{SnappingAlgorithm as o}from"./SnappingAlgorithm.js";import{anyMapPointToScreenPoint as r,squareDistance as s}from"./snappingUtils.js";import{LineSnappingCandidate as i}from"./candidates/LineSnappingCandidate.js";import{projectPointToLine as n}from"../../support/geometry2dUtils.js";class d extends o{snapNewVertex(e,t){const o=t.editGeometryOperations.data.components[0],s=o.edges.length,i=[];if(s<1)return i;const n=t.coordinateHelper,d=r(e,n,t.elevationInfo,this.view),p=o.edges[s-1];let a=p;do{this.edgeExceedsShortLineThreshold(a,t)&&this._processCandidateProposal(a.leftVertex.pos,a.rightVertex.pos,e,d,t,i),a=a.leftVertex.leftEdge}while(a&&a!==p);return i}snapExistingVertex(t,o){const s=[],i=e(o.vertexHandle),n=i.component;if(n.edges.length<2)return s;const d=o.coordinateHelper,p=r(t,d,o.elevationInfo,this.view),a=i.leftEdge,h=i.rightEdge;a&&h&&this.edgeExceedsShortLineThreshold(a,o)&&this.edgeExceedsShortLineThreshold(h,o)&&this._processCandidateProposal(a.leftVertex.pos,h.rightVertex.pos,t,p,o,s);const l=n.edges[0];let g=l;do{g!==i.leftEdge&&g!==i.rightEdge&&this.edgeExceedsShortLineThreshold(g,o)&&this._processCandidateProposal(g.leftVertex.pos,g.rightVertex.pos,t,p,o,s),g=g.rightVertex.rightEdge}while(g&&g!==l);return s}_processCandidateProposal(e,o,d,p,a,h){const l=n(t(),d,e,o),g=a.coordinateHelper,c=g.fromXYZ(l,g.getZ(d,0));s(p,r(c,g,a.elevationInfo,this.view))<this.squaredProximityTreshold(a.pointer)&&h.push(new i({coordinateHelper:a.coordinateHelper,lineStart:e,lineEnd:o,targetPoint:c}))}}export{d as LineSnapper};
5
+ import{unwrap as e}from"../../../core/maybe.js";import{a as t}from"../../../chunks/vec2f64.js";import{SnappingAlgorithm as o}from"./SnappingAlgorithm.js";import{anyMapPointToScreenPoint as r,squareDistance as s}from"./snappingUtils.js";import{LineSnappingCandidate as i}from"./candidates/LineSnappingCandidate.js";import{projectPointToLine as n}from"../../support/geometry2dUtils.js";class d extends o{snapNewVertex(e,t){const o=t.editGeometryOperations.data.components[0],s=o.edges.length,i=[];if(s<1)return i;const n=t.coordinateHelper,d=r(e,n,t.elevationInfo,this.view),a=o.edges[s-1];let p=a;do{this.edgeExceedsShortLineThreshold(p,t)&&this._processCandidateProposal(p.leftVertex.pos,p.rightVertex.pos,e,d,t,i),p=p.leftVertex.leftEdge}while(p&&p!==a);return i}snapExistingVertex(t,o){const s=[],i=e(o.vertexHandle),n=i.component;if(n.edges.length<2)return s;const d=o.coordinateHelper,a=r(t,d,o.elevationInfo,this.view),p=i.leftEdge,h=i.rightEdge;p&&h&&this.edgeExceedsShortLineThreshold(p,o)&&this.edgeExceedsShortLineThreshold(h,o)&&this._processCandidateProposal(p.leftVertex.pos,h.rightVertex.pos,t,a,o,s);const l=n.edges[0];let g=l;do{g!==i.leftEdge&&g!==i.rightEdge&&this.edgeExceedsShortLineThreshold(g,o)&&this._processCandidateProposal(g.leftVertex.pos,g.rightVertex.pos,t,a,o,s),g=g.rightVertex.rightEdge}while(g&&g!==l);return s}_processCandidateProposal(e,o,d,a,p,h){const l=n(t(),d,e,o),{coordinateHelper:g,elevationInfo:c,pointer:f}=p,m=g.fromXYZ(l,g.getZ(d,0));s(a,r(m,g,c,this.view))<this.squaredProximityTreshold(f)&&h.push(new i({coordinateHelper:g,lineStart:e,lineEnd:o,targetPoint:m,elevationInfo:c}))}}export{d as LineSnapper};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.24/esri/copyright.txt for details.
4
4
  */
5
- import{unwrap as e}from"../../../core/maybe.js";import{s as t}from"../../../chunks/vec2.js";import{a as r}from"../../../chunks/vec2f64.js";import{defaults as i}from"./Settings.js";import{SnappingAlgorithm as o}from"./SnappingAlgorithm.js";import{anyMapPointToScreenPoint as s,squareDistance as n}from"./snappingUtils.js";import{ParallelLineSnappingCandidate as l}from"./candidates/ParallelLineSnappingCandidate.js";import{projectPointToLine as a}from"../../support/geometry2dUtils.js";class c extends o{constructor(){super(...arguments),this._tmpProjection=r()}snapNewVertex(e,t){const r=t.editGeometryOperations.data.components[0],i=r.edges.length,o=r.vertices.length,n=[];if(i<2)return n;const l=s(e,t.coordinateHelper,t.elevationInfo,this.view),a=r.vertices[o-1],c=r.vertices[0],h=r.edges[i-1];let p=h;do{this.edgeExceedsShortLineThreshold(p,t)&&(this._checkEdgeForParalleLines(p,a.pos,e,l,t,n),this._checkEdgeForParalleLines(p,c.pos,e,l,t,n)),p=p.leftVertex.leftEdge}while(p&&p!==h);return n}snapExistingVertex(t,r){const i=[],o=e(r.vertexHandle),n=o.component;if(n.edges.length<3)return i;const l=s(t,r.coordinateHelper,r.elevationInfo,this.view),a=o.leftEdge,c=o.rightEdge,h=n.vertices[0],p=n.vertices.length,d=n.vertices[p-1],g=n.edges[0];let m=g;do{m!==a&&m!==c&&this.edgeExceedsShortLineThreshold(m,r)&&(a&&this._checkEdgeForParalleLines(m,a.leftVertex.pos,t,l,r,i),c&&this._checkEdgeForParalleLines(m,c.rightVertex.pos,t,l,r,i),o===h?this._checkEdgeForParalleLines(m,d.pos,t,l,r,i):o===d&&this._checkEdgeForParalleLines(m,h.pos,t,l,r,i)),m=m.rightVertex.rightEdge}while(m&&m!==g);return i}_checkEdgeForParalleLines(e,r,o,c,h,p){const d=e.leftVertex.pos,g=e.rightVertex.pos;if(a(this._tmpProjection,r,d,g),t(this._tmpProjection,r)<i.parallelLineThreshold)return;a(this._tmpProjection,o,d,g,r);const m=h.coordinateHelper,f=m.fromXYZ(this._tmpProjection,m.getZ(o,0));if(n(c,s(f,m,h.elevationInfo,this.view))<this.squaredProximityTreshold(h.pointer)){if(this._parallelToPreviousCandidate(e,p))return;p.push(new l({coordinateHelper:m,referenceLine:e,lineStart:r,targetPoint:f}))}}_parallelToPreviousCandidate(e,r){const o=e.leftVertex.pos,s=e.rightVertex.pos;for(const n of r)if(a(this._tmpProjection,s,n.constraint.start,n.constraint.end,o),t(this._tmpProjection,s)<i.parallelLineThreshold)return n.addReferenceLine(e),!0;return!1}}export{c as ParallelLineSnapper};
5
+ import{unwrap as e}from"../../../core/maybe.js";import{s as t}from"../../../chunks/vec2.js";import{a as r}from"../../../chunks/vec2f64.js";import{defaults as o}from"./Settings.js";import{SnappingAlgorithm as i}from"./SnappingAlgorithm.js";import{anyMapPointToScreenPoint as s,squareDistance as n}from"./snappingUtils.js";import{ParallelLineSnappingCandidate as l}from"./candidates/ParallelLineSnappingCandidate.js";import{projectPointToLine as a}from"../../support/geometry2dUtils.js";class c extends i{constructor(){super(...arguments),this._tmpProjection=r()}snapNewVertex(e,t){const r=t.editGeometryOperations.data.components[0],o=r.edges.length,i=r.vertices.length,n=[];if(o<2)return n;const l=s(e,t.coordinateHelper,t.elevationInfo,this.view),a=r.vertices[i-1],c=r.vertices[0],h=r.edges[o-1];let p=h;do{this.edgeExceedsShortLineThreshold(p,t)&&(this._checkEdgeForParalleLines(p,a.pos,e,l,t,n),this._checkEdgeForParalleLines(p,c.pos,e,l,t,n)),p=p.leftVertex.leftEdge}while(p&&p!==h);return n}snapExistingVertex(t,r){const o=[],i=e(r.vertexHandle),n=i.component;if(n.edges.length<3)return o;const l=s(t,r.coordinateHelper,r.elevationInfo,this.view),a=i.leftEdge,c=i.rightEdge,h=n.vertices[0],p=n.vertices.length,d=n.vertices[p-1],g=n.edges[0];let m=g;do{m!==a&&m!==c&&this.edgeExceedsShortLineThreshold(m,r)&&(a&&this._checkEdgeForParalleLines(m,a.leftVertex.pos,t,l,r,o),c&&this._checkEdgeForParalleLines(m,c.rightVertex.pos,t,l,r,o),i===h?this._checkEdgeForParalleLines(m,d.pos,t,l,r,o):i===d&&this._checkEdgeForParalleLines(m,h.pos,t,l,r,o)),m=m.rightVertex.rightEdge}while(m&&m!==g);return o}_checkEdgeForParalleLines(e,r,i,c,h,p){const d=e.leftVertex.pos,g=e.rightVertex.pos;if(a(this._tmpProjection,r,d,g),t(this._tmpProjection,r)<o.parallelLineThreshold)return;a(this._tmpProjection,i,d,g,r);const{coordinateHelper:m,elevationInfo:f,pointer:P}=h,v=m.fromXYZ(this._tmpProjection,m.getZ(i,0));if(n(c,s(v,m,f,this.view))<this.squaredProximityTreshold(P)){if(this._parallelToPreviousCandidate(e,p))return;p.push(new l({coordinateHelper:m,referenceLine:e,lineStart:r,targetPoint:v,elevationInfo:f}))}}_parallelToPreviousCandidate(e,r){const i=e.leftVertex.pos,s=e.rightVertex.pos;for(const n of r)if(a(this._tmpProjection,s,n.constraint.start,n.constraint.end,i),t(this._tmpProjection,s)<o.parallelLineThreshold)return n.addReferenceLine(e),!0;return!1}}export{c as ParallelLineSnapper};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.24/esri/copyright.txt for details.
4
4
  */
5
- import{unwrap as e}from"../../../core/maybe.js";import{h as t,i as r,u as i,v as o}from"../../../chunks/vec2.js";import{a as s,f as n}from"../../../chunks/vec2f64.js";import{SnappingAlgorithm as p}from"./SnappingAlgorithm.js";import{RayConstraint as g}from"./SnappingConstraint.js";import{anyMapPointToScreenPoint as h,squareDistance as a}from"./snappingUtils.js";import{RightAngleSnappingCandidate as d,OtherVertexType as c}from"./candidates/RightAngleSnappingCandidate.js";class f extends p{constructor(){super(...arguments),this._tmp=s()}snapNewVertex(e,t){const r=t.editGeometryOperations.data.components[0],i=r.vertices.length,o=[];if(i<2)return o;const s=h(e,t.coordinateHelper,t.elevationInfo,this.view),n=r.vertices[i-1];this._checkForSnappingCandidate(o,n.leftEdge,n.pos,e,n.leftEdge.leftVertex.pos,n.pos,t,e,s);const p=r.vertices[0];return this._checkForSnappingCandidate(o,p.rightEdge,p.pos,e,p.rightEdge.rightVertex.pos,p.pos,t,e,s),o}snapExistingVertex(t,r){const i=[],o=e(r.vertexHandle),s=o.component,n=s.vertices.length;if(n<3)return i;const p=h(t,r.coordinateHelper,r.elevationInfo,this.view),g=o.leftEdge,a=o.rightEdge,d=s.vertices[0],c=s.vertices[n-1];if(!g)return this._checkForSnappingCandidate(i,d.rightEdge.rightVertex.rightEdge,d.rightEdge.rightVertex.pos,t,d.rightEdge.rightVertex.rightEdge.rightVertex.pos,d.rightEdge.rightVertex.pos,r,t,p),i;if(!a)return this._checkForSnappingCandidate(i,c.leftEdge.leftVertex.leftEdge,c.leftEdge.leftVertex.pos,t,c.leftEdge.leftVertex.leftEdge.leftVertex.pos,c.leftEdge.leftVertex.pos,r,t,p),i;if(g&&g.leftVertex.leftEdge){const e=g.leftVertex.leftEdge;this._checkForSnappingCandidate(i,e,g.leftVertex.pos,t,e.leftVertex.pos,g.leftVertex.pos,r,t,p)}if(a&&a.rightVertex.rightEdge){const e=a.rightVertex.rightEdge;this._checkForSnappingCandidate(i,e,a.rightVertex.pos,t,e.rightVertex.pos,a.rightVertex.pos,r,t,p)}return i}_checkForSnappingCandidate(e,p,f,l,x,V,m,E,v){if(!this.edgeExceedsShortLineThreshold(p,m))return;t(this._tmp,p.rightVertex.pos,p.leftVertex.pos);const u=n(this._tmp[1],-this._tmp[0]),_=r(u,t(this._tmp,l,f))/i(u),S=m.coordinateHelper,C=S.fromXYZ(o(s(),V,u,_),S.getZ(E,0));a(v,h(C,S,m.elevationInfo,this.view))<this.squaredProximityTreshold(m.pointer)&&e.push(new d({coordinateHelper:S,targetPoint:C,constraint:new g(S,V,o(S.createVector(),V,u,Math.sign(_))),previousVertex:x,otherVertex:V,otherVertexType:c.CENTER}))}}export{f as RightAngleSnapper};
5
+ import{unwrap as e}from"../../../core/maybe.js";import{h as t,i as r,u as i,v as o}from"../../../chunks/vec2.js";import{a as s,f as n}from"../../../chunks/vec2f64.js";import{SnappingAlgorithm as p}from"./SnappingAlgorithm.js";import{RayConstraint as g}from"./SnappingConstraint.js";import{anyMapPointToScreenPoint as h,squareDistance as a}from"./snappingUtils.js";import{RightAngleSnappingCandidate as d,OtherVertexType as c}from"./candidates/RightAngleSnappingCandidate.js";class f extends p{constructor(){super(...arguments),this._tmp=s()}snapNewVertex(e,t){const r=t.editGeometryOperations.data.components[0],i=r.vertices.length,o=[];if(i<2)return o;const s=h(e,t.coordinateHelper,t.elevationInfo,this.view),n=r.vertices[i-1];this._checkForSnappingCandidate(o,n.leftEdge,n.pos,e,n.leftEdge.leftVertex.pos,n.pos,t,e,s);const p=r.vertices[0];return this._checkForSnappingCandidate(o,p.rightEdge,p.pos,e,p.rightEdge.rightVertex.pos,p.pos,t,e,s),o}snapExistingVertex(t,r){const i=[],o=e(r.vertexHandle),s=o.component,n=s.vertices.length;if(n<3)return i;const p=h(t,r.coordinateHelper,r.elevationInfo,this.view),g=o.leftEdge,a=o.rightEdge,d=s.vertices[0],c=s.vertices[n-1];if(!g)return this._checkForSnappingCandidate(i,d.rightEdge.rightVertex.rightEdge,d.rightEdge.rightVertex.pos,t,d.rightEdge.rightVertex.rightEdge.rightVertex.pos,d.rightEdge.rightVertex.pos,r,t,p),i;if(!a)return this._checkForSnappingCandidate(i,c.leftEdge.leftVertex.leftEdge,c.leftEdge.leftVertex.pos,t,c.leftEdge.leftVertex.leftEdge.leftVertex.pos,c.leftEdge.leftVertex.pos,r,t,p),i;if(g&&g.leftVertex.leftEdge){const e=g.leftVertex.leftEdge;this._checkForSnappingCandidate(i,e,g.leftVertex.pos,t,e.leftVertex.pos,g.leftVertex.pos,r,t,p)}if(a&&a.rightVertex.rightEdge){const e=a.rightVertex.rightEdge;this._checkForSnappingCandidate(i,e,a.rightVertex.pos,t,e.rightVertex.pos,a.rightVertex.pos,r,t,p)}return i}_checkForSnappingCandidate(e,p,f,l,x,V,m,E,v){if(!this.edgeExceedsShortLineThreshold(p,m))return;t(this._tmp,p.rightVertex.pos,p.leftVertex.pos);const u=n(this._tmp[1],-this._tmp[0]),_=r(u,t(this._tmp,l,f))/i(u),{coordinateHelper:S,elevationInfo:C,pointer:k}=m,j=S.fromXYZ(o(s(),V,u,_),S.getZ(E,0));a(v,h(j,S,C,this.view))<this.squaredProximityTreshold(k)&&e.push(new d({coordinateHelper:S,targetPoint:j,constraint:new g(S,V,o(S.createVector(),V,u,Math.sign(_))),previousVertex:x,otherVertex:V,otherVertexType:c.CENTER,elevationInfo:C}))}}export{f as RightAngleSnapper};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.24/esri/copyright.txt for details.
4
4
  */
5
- import{unwrap as e}from"../../../core/maybe.js";import{l as t,a as o}from"../../../chunks/vec2.js";import{a as r}from"../../../chunks/vec2f64.js";import{SnappingAlgorithm as s}from"./SnappingAlgorithm.js";import{anyMapPointToScreenPoint as i,squareDistance as n}from"./snappingUtils.js";import{RightAngleTriangleSnappingCandidate as p}from"./candidates/RightAngleTriangleSnappingCandidate.js";import{projectPointToCircle as a}from"../../support/geometry2dUtils.js";class d extends s{snapNewVertex(e,t){const o=t.editGeometryOperations.data.components[0],r=[],s=o.vertices.length;if("polygon"!==t.editGeometryOperations.data.type||s<2)return r;const i=o.vertices[0],n=o.vertices[s-1];return this._processCandidateProposal(i.pos,n.pos,e,t,r),r}snapExistingVertex(t,o){const r=[],s=e(o.vertexHandle),i=s.component;return i.edges.length<2?r:"polyline"!==o.editGeometryOperations.data.type||0!==s.index&&s.index!==i.vertices.length-1?(this._processCandidateProposal(s.leftEdge.leftVertex.pos,s.rightEdge.rightVertex.pos,t,o,r),r):r}_processCandidateProposal(e,s,d,l,m){if(!this.exceedsShortLineThreshold(e,s,l))return;const c=t(r(),e,s,.5),g=.5*o(e,s),h=a(r(),d,c,g),f=l.coordinateHelper,x=f.fromXYZ(h,f.getZ(d,0)),v=i(d,f,l.elevationInfo,this.view);n(v,i(x,f,l.elevationInfo,this.view))<this.squaredProximityTreshold(l.pointer)&&m.push(new p({coordinateHelper:f,targetPoint:x,point1:e,point2:s}))}}export{d as RightAngleTriangleSnapper};
5
+ import{unwrap as e}from"../../../core/maybe.js";import{l as t,a as o}from"../../../chunks/vec2.js";import{a as r}from"../../../chunks/vec2f64.js";import{SnappingAlgorithm as s}from"./SnappingAlgorithm.js";import{anyMapPointToScreenPoint as i,squareDistance as n}from"./snappingUtils.js";import{RightAngleTriangleSnappingCandidate as p}from"./candidates/RightAngleTriangleSnappingCandidate.js";import{projectPointToCircle as a}from"../../support/geometry2dUtils.js";class d extends s{snapNewVertex(e,t){const o=t.editGeometryOperations.data.components[0],r=[],s=o.vertices.length;if("polygon"!==t.editGeometryOperations.data.type||s<2)return r;const i=o.vertices[0],n=o.vertices[s-1];return this._processCandidateProposal(i.pos,n.pos,e,t,r),r}snapExistingVertex(t,o){const r=[],s=e(o.vertexHandle),i=s.component;return i.edges.length<2?r:"polyline"!==o.editGeometryOperations.data.type||0!==s.index&&s.index!==i.vertices.length-1?(this._processCandidateProposal(s.leftEdge.leftVertex.pos,s.rightEdge.rightVertex.pos,t,o,r),r):r}_processCandidateProposal(e,s,d,l,m){if(!this.exceedsShortLineThreshold(e,s,l))return;const c=t(r(),e,s,.5),g=.5*o(e,s),h=a(r(),d,c,g),{coordinateHelper:f,elevationInfo:x,pointer:v}=l,y=f.fromXYZ(h,f.getZ(d,0)),u=i(d,f,x,this.view);n(u,i(y,f,x,this.view))<this.squaredProximityTreshold(v)&&m.push(new p({coordinateHelper:f,targetPoint:y,point1:e,point2:s,elevationInfo:x}))}}export{d as RightAngleTriangleSnapper};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.24/esri/copyright.txt for details.
4
4
  */
5
- import{_ as t}from"../../../chunks/tslib.es6.js";import e from"../../../core/Evented.js";import{HandleOwner as i}from"../../../core/HandleOwner.js";import{isSome as n}from"../../../core/maybe.js";import{isAborted as s}from"../../../core/promiseUtils.js";import{watch as o,sync as r,syncAndInitial as a}from"../../../core/reactiveUtils.js";import{property as d}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/arrayUtils.js";import"../../../core/has.js";import"../../../core/accessorSupport/ensureType.js";import{subclass as c}from"../../../core/accessorSupport/decorators/subclass.js";import{s as h}from"../../../chunks/vec2.js";import p from"../../../geometry/SpatialReference.js";import{FeatureSnappingEngine as l}from"./FeatureSnappingEngine.js";import{SelfSnappingEngine as u}from"./SelfSnappingEngine.js";import f from"./SnappingOptions.js";import{squareDistance as v,anyMapPointToScreenPoint as m,sortCandidatesInPlace as g}from"./snappingUtils.js";import{IntersectionSnappingCandidate as _}from"./candidates/IntersectionSnappingCandidate.js";let y=class extends(e.EventedMixin(i)){constructor(t){super(t),this.options=new f,this.engines=[],this._currentMainCandidate=null,this._currentOtherActiveCandidates=[]}initialize(){this.handles.add([o((()=>{const{effectiveFeatureEnabled:t,effectiveSelfEnabled:e,touchSensitivityMultiplier:i,distance:n}=this.options;return{effectiveFeatureEnabled:t,effectiveSelfEnabled:e,touchSensitivityMultiplier:i,distance:n}}),(()=>{this.doneSnapping(),this.emit("changed")}),r),o((()=>this.options),(t=>{for(const e of this.engines)e.options=t}),r),o((()=>({ready:this.view.ready,spatialReference:this.view.spatialReference})),(({ready:t,spatialReference:e})=>this._onViewChange(t,e)),a)])}destroy(){this._destroyEngines()}get updating(){return this.engines.some((t=>t.updating))}_onViewChange(t,e){this._destroyEngines(),t&&(this.engines=[new u({view:this.view,options:this.options}),new l({view:this.view,spatialReference:null!=e?e:p.WGS84,options:this.options})])}_destroyEngines(){for(const t of this.engines)t.destroy();this.engines.length=0}get squaredMouseProximityTreshold(){return this.options.distance*this.options.distance}get squaredTouchProximityThreshold(){const{distance:t,touchSensitivityMultiplier:e}=this.options,i=t*e;return i*i}async snap(t,e,i){const o=e.coordinateHelper.pointToVector(t),r=await this._fetchCandidates(o,e,i);return{get valid(){return!s(i)},apply:()=>{const{snappedPoint:t,hints:i}=this._processCandidates(o,r,e);return this._removeVisualization(),n(e.visualizer)&&this.handles.add(e.visualizer.draw(i,{coordinateHelper:e.coordinateHelper,elevationInfo:e.elevationInfo,view:this.view}),C),t}}}update(t,e){this._removeVisualization();let i=t;const s=[];if(n(this._currentMainCandidate)){const n=e.coordinateHelper,o=n.pointToVector(t),r=this._currentMainCandidate.constraint.closestTo(o);if(v(m(o,n,e.elevationInfo,this.view),m(r,n,e.elevationInfo,this.view))<this._squaredPointProximityThreshold(e.pointer)){i=n.vectorToDehydratedPoint(r),this._currentMainCandidate.targetPoint=r,s.push(...this._currentMainCandidate.hints);for(const t of this._currentOtherActiveCandidates)t.targetPoint=r,s.push(...t.hints)}else this._currentMainCandidate=null,this._currentOtherActiveCandidates=[]}return n(e.visualizer)&&this.handles.add(e.visualizer.draw(s,{coordinateHelper:e.coordinateHelper,elevationInfo:e.elevationInfo,view:this.view}),C),i}doneSnapping(){this._removeVisualization(),this._currentMainCandidate=null,this._currentOtherActiveCandidates=[]}_removeVisualization(){this.handles.remove(C)}async _fetchCandidates(t,e,i){return(await Promise.all(this.engines.map((n=>n.fetchCandidates(t,e,i))))).flat()}_processCandidates(t,e,i){if(e.length<1)return this.doneSnapping(),{snappedPoint:i.coordinateHelper.vectorToDehydratedPoint(t),hints:[]};g(t,e);const s=this._currentMainCandidate;if(n(s)){const n=this._findOldConstraintInNewCandidates(s,e);if(n>=0){if(!(e[n]instanceof _))return this._intersectWithOtherCandidates(n,e,t,i);if(h(t,s.targetPoint)<this._squaredPointProximityThreshold(i.pointer))return this._updateSnappingCandidate(s,e,i)}}return this._intersectWithOtherCandidates(0,e,t,i)}_findOldConstraintInNewCandidates(t,e){return t instanceof _?this._findOldCandidateIndex(e,t.first)>=0&&this._findOldCandidateIndex(e,t.second)>=0?0:-1:this._findOldCandidateIndex(e,t)}_intersectWithOtherCandidates(t,e,i,n){const s=e[t],o=[],r=n.coordinateHelper;for(let a=0;a<e.length;++a){if(a===t)continue;const d=e[a];for(const t of s.constraint.intersect(d.constraint)){const e=r.fromXYZ(t.intersection,s.targetPoint[2]);o.push([new _(r,e,s,d),v(m(i,n.coordinateHelper,n.elevationInfo,this.view),m(e,n.coordinateHelper,n.elevationInfo,this.view))])}}return o.length>0&&(o.sort(((t,e)=>t[1]-e[1])),o[0][1]<this._squaredPointProximityThreshold(n.pointer))?this._updateSnappingCandidate(o[0][0],e,n):this._updateSnappingCandidate(s,e,n)}_updateSnappingCandidate(t,e,i){this.doneSnapping(),this._currentMainCandidate=t;const n=this._currentMainCandidate.targetPoint,s=[];s.push(...t.hints);for(const o of e){if(t instanceof _){if(o.constraint.objectEqual(t.first.constraint)||o.constraint.objectEqual(t.second.constraint))continue}else if(o.constraint.objectEqual(t.constraint))continue;o.constraint.check(n)&&(o.targetPoint=n,this._currentOtherActiveCandidates.push(o),s.push(...o.hints))}return{snappedPoint:i.coordinateHelper.vectorToDehydratedPoint(n),hints:s}}_squaredPointProximityThreshold(t){return"touch"===t?this.squaredTouchProximityThreshold:this.squaredMouseProximityTreshold}_findOldCandidateIndex(t,e){let i=-1;for(let n=0;n<t.length;++n)if(e.constraint.objectEqual(t[n].constraint)){i=n;break}return i}get test(){return{visualizationsActive:this.handles.has(C),engines:this.engines}}};t([d({constructOnly:!0})],y.prototype,"view",void 0),t([d()],y.prototype,"options",void 0),t([d({readOnly:!0})],y.prototype,"updating",null),t([d()],y.prototype,"engines",void 0),t([d()],y.prototype,"squaredMouseProximityTreshold",null),t([d()],y.prototype,"squaredTouchProximityThreshold",null),y=t([c("esri.views.interactive.snapping.SnappingManager")],y);const C="visualization-handle";export{y as SnappingManager};
5
+ import{_ as t}from"../../../chunks/tslib.es6.js";import e from"../../../core/Evented.js";import{HandleOwner as i}from"../../../core/HandleOwner.js";import{isSome as n}from"../../../core/maybe.js";import{isAborted as s}from"../../../core/promiseUtils.js";import{watch as o,sync as r,syncAndInitial as a}from"../../../core/reactiveUtils.js";import{property as d}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/arrayUtils.js";import"../../../core/has.js";import"../../../core/accessorSupport/ensureType.js";import{subclass as c}from"../../../core/accessorSupport/decorators/subclass.js";import{s as h}from"../../../chunks/vec2.js";import p from"../../../geometry/SpatialReference.js";import{FeatureSnappingEngine as l}from"./FeatureSnappingEngine.js";import{SelfSnappingEngine as u}from"./SelfSnappingEngine.js";import f from"./SnappingOptions.js";import{squareDistance as v,anyMapPointToScreenPoint as m,sortCandidatesInPlace as g}from"./snappingUtils.js";import{IntersectionSnappingCandidate as _}from"./candidates/IntersectionSnappingCandidate.js";let y=class extends(e.EventedMixin(i)){constructor(t){super(t),this.options=new f,this.engines=[],this._currentMainCandidate=null,this._currentOtherActiveCandidates=[]}initialize(){this.handles.add([o((()=>{const{effectiveFeatureEnabled:t,effectiveSelfEnabled:e,touchSensitivityMultiplier:i,distance:n}=this.options;return{effectiveFeatureEnabled:t,effectiveSelfEnabled:e,touchSensitivityMultiplier:i,distance:n}}),(()=>{this.doneSnapping(),this.emit("changed")}),r),o((()=>this.options),(t=>{for(const e of this.engines)e.options=t}),r),o((()=>({ready:this.view.ready,spatialReference:this.view.spatialReference})),(({ready:t,spatialReference:e})=>this._onViewChange(t,e)),a)])}destroy(){this._destroyEngines()}get updating(){return this.engines.some((t=>t.updating))}_onViewChange(t,e){this._destroyEngines(),t&&(this.engines=[new u({view:this.view,options:this.options}),new l({view:this.view,spatialReference:null!=e?e:p.WGS84,options:this.options})])}_destroyEngines(){for(const t of this.engines)t.destroy();this.engines.length=0}get squaredMouseProximityTreshold(){return this.options.distance*this.options.distance}get squaredTouchProximityThreshold(){const{distance:t,touchSensitivityMultiplier:e}=this.options,i=t*e;return i*i}async snap(t,e,i){const o=e.coordinateHelper.pointToVector(t),r=await this._fetchCandidates(o,e,i);return{get valid(){return!s(i)},apply:()=>{const{snappedPoint:t,hints:i}=this._processCandidates(o,r,e);return this._removeVisualization(),n(e.visualizer)&&this.handles.add(e.visualizer.draw(i,{coordinateHelper:e.coordinateHelper,elevationInfo:e.elevationInfo,view:this.view}),C),t}}}update(t,e){this._removeVisualization();let i=t;const s=[];if(n(this._currentMainCandidate)){const n=e.coordinateHelper,o=n.pointToVector(t),r=this._currentMainCandidate.constraint.closestTo(o);if(v(m(o,n,e.elevationInfo,this.view),m(r,n,e.elevationInfo,this.view))<this._squaredPointProximityThreshold(e.pointer)){i=n.vectorToDehydratedPoint(r),this._currentMainCandidate.targetPoint=r,s.push(...this._currentMainCandidate.hints);for(const t of this._currentOtherActiveCandidates)t.targetPoint=r,s.push(...t.hints)}else this._currentMainCandidate=null,this._currentOtherActiveCandidates=[]}return n(e.visualizer)&&this.handles.add(e.visualizer.draw(s,{coordinateHelper:e.coordinateHelper,elevationInfo:e.elevationInfo,view:this.view}),C),i}doneSnapping(){this._removeVisualization(),this._currentMainCandidate=null,this._currentOtherActiveCandidates=[]}_removeVisualization(){this.handles.remove(C)}async _fetchCandidates(t,e,i){return(await Promise.all(this.engines.map((n=>n.fetchCandidates(t,e,i))))).flat()}_processCandidates(t,e,i){if(e.length<1)return this.doneSnapping(),{snappedPoint:i.coordinateHelper.vectorToDehydratedPoint(t),hints:[]};g(t,e);const s=this._currentMainCandidate;if(n(s)){const n=this._findOldConstraintInNewCandidates(s,e);if(n>=0){if(!(e[n]instanceof _))return this._intersectWithOtherCandidates(n,e,t,i);if(h(t,s.targetPoint)<this._squaredPointProximityThreshold(i.pointer))return this._updateSnappingCandidate(s,e,i)}}return this._intersectWithOtherCandidates(0,e,t,i)}_findOldConstraintInNewCandidates(t,e){return t instanceof _?this._findOldCandidateIndex(e,t.first)>=0&&this._findOldCandidateIndex(e,t.second)>=0?0:-1:this._findOldCandidateIndex(e,t)}_intersectWithOtherCandidates(t,e,i,n){const s=e[t],o=[],r=n.coordinateHelper;for(let a=0;a<e.length;++a){if(a===t)continue;const d=e[a];for(const t of s.constraint.intersect(d.constraint)){const e=r.fromXYZ(t.intersection,s.targetPoint[2]);o.push([new _(r,e,s,d,d.elevationInfo),v(m(i,n.coordinateHelper,n.elevationInfo,this.view),m(e,n.coordinateHelper,n.elevationInfo,this.view))])}}return o.length>0&&(o.sort(((t,e)=>t[1]-e[1])),o[0][1]<this._squaredPointProximityThreshold(n.pointer))?this._updateSnappingCandidate(o[0][0],e,n):this._updateSnappingCandidate(s,e,n)}_updateSnappingCandidate(t,e,i){this.doneSnapping(),this._currentMainCandidate=t;const n=this._currentMainCandidate.targetPoint,s=[];s.push(...t.hints);for(const o of e){if(t instanceof _){if(o.constraint.objectEqual(t.first.constraint)||o.constraint.objectEqual(t.second.constraint))continue}else if(o.constraint.objectEqual(t.constraint))continue;o.constraint.check(n)&&(o.targetPoint=n,this._currentOtherActiveCandidates.push(o),s.push(...o.hints))}return{snappedPoint:i.coordinateHelper.vectorToDehydratedPoint(n),hints:s}}_squaredPointProximityThreshold(t){return"touch"===t?this.squaredTouchProximityThreshold:this.squaredMouseProximityTreshold}_findOldCandidateIndex(t,e){let i=-1;for(let n=0;n<t.length;++n)if(e.constraint.objectEqual(t[n].constraint)){i=n;break}return i}get test(){return{visualizationsActive:this.handles.has(C),engines:this.engines}}};t([d({constructOnly:!0})],y.prototype,"view",void 0),t([d()],y.prototype,"options",void 0),t([d({readOnly:!0})],y.prototype,"updating",null),t([d()],y.prototype,"engines",void 0),t([d()],y.prototype,"squaredMouseProximityTreshold",null),t([d()],y.prototype,"squaredTouchProximityThreshold",null),y=t([c("esri.views.interactive.snapping.SnappingManager")],y);const C="visualization-handle";export{y as SnappingManager};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.24/esri/copyright.txt for details.
4
4
  */
5
- import{LineConstraint as t}from"../SnappingConstraint.js";import{LineSegmentHintType as n}from"../snappingUtils.js";import{FeatureSnappingCandidate as r}from"./FeatureSnappingCandidate.js";import{LineSnappingHint as i}from"../hints/LineSnappingHint.js";class e extends r{constructor(n){super({...n,constraint:new t(n.coordinateHelper,n.edgeStart,n.edgeEnd)})}get hints(){return[new i(n.REFERENCE,this.constraint.start,this.constraint.end)]}}export{e as EdgeSnappingCandidate};
5
+ import{LineConstraint as t}from"../SnappingConstraint.js";import{LineSegmentHintType as n}from"../snappingUtils.js";import{FeatureSnappingCandidate as i}from"./FeatureSnappingCandidate.js";import{LineSnappingHint as r}from"../hints/LineSnappingHint.js";class e extends i{constructor(n){super({...n,constraint:new t(n.coordinateHelper,n.edgeStart,n.edgeEnd)})}get hints(){return[new r(n.REFERENCE,this.constraint.start,this.constraint.end,this.elevationInfo)]}}export{e as EdgeSnappingCandidate};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.24/esri/copyright.txt for details.
4
4
  */
5
- import{SnappingCandidate as t}from"./SnappingCandidate.js";class e extends t{constructor({coordinateHelper:t,targetPoint:e,objectId:o,constraint:r}){super(t,e,r),this.objectId=o}}export{e as FeatureSnappingCandidate};
5
+ import{SnappingCandidate as t}from"./SnappingCandidate.js";class e extends t{constructor({coordinateHelper:t,targetPoint:e,objectId:o,constraint:n,elevationInfo:r}){super(t,e,n,r),this.objectId=o}}export{e as FeatureSnappingCandidate};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.24/esri/copyright.txt for details.
4
4
  */
5
- import{IntersectionConstraint as t}from"../SnappingConstraint.js";import{SnappingCandidate as i}from"./SnappingCandidate.js";import{IntersectionSnappingHint as n}from"../hints/IntersectionSnappingHint.js";class s extends i{constructor(i,n,s,r){super(i,n,new t(i,n,s.constraint,r.constraint)),this.first=s,this.second=r}get hints(){return this.first.targetPoint=this.targetPoint,this.second.targetPoint=this.targetPoint,[...this.first.hints,...this.second.hints,new n(this.targetPoint)]}}export{s as IntersectionSnappingCandidate};
5
+ import{IntersectionConstraint as t}from"../SnappingConstraint.js";import{SnappingCandidate as i}from"./SnappingCandidate.js";import{IntersectionSnappingHint as n}from"../hints/IntersectionSnappingHint.js";class s extends i{constructor(i,n,s,r,o){super(i,n,new t(i,n,s.constraint,r.constraint),o),this.first=s,this.second=r}get hints(){return this.first.targetPoint=this.targetPoint,this.second.targetPoint=this.targetPoint,[...this.first.hints,...this.second.hints,new n(this.targetPoint,this.elevationInfo)]}}export{s as IntersectionSnappingCandidate};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.24/esri/copyright.txt for details.
4
4
  */
5
- import{i as t,h as n}from"../../../../chunks/vec2.js";import{a as i}from"../../../../chunks/vec2f64.js";import{LineConstraint as e}from"../SnappingConstraint.js";import{LineSegmentHintType as s}from"../snappingUtils.js";import{SnappingCandidate as r}from"./SnappingCandidate.js";import{LineSnappingHint as o}from"../hints/LineSnappingHint.js";class a extends r{constructor({coordinateHelper:t,lineStart:n,lineEnd:i,targetPoint:r}){super(t,r,new e(t,n,i)),this.referenceLineHint=new o(s.REFERENCE_EXTENSION,n,i)}get hints(){return[this.referenceLineHint,new o(s.TARGET,this._lineEndClosestToTarget(),this.targetPoint)]}_lineEndClosestToTarget(){const i=this.constraint.start,e=this.constraint.end;return Math.sign(t(n(c,e,i),n(p,this.targetPoint,i)))>0?e:i}}const p=i(),c=i();export{a as LineSnappingCandidate};
5
+ import{i as t,h as n}from"../../../../chunks/vec2.js";import{a as e}from"../../../../chunks/vec2f64.js";import{LineConstraint as i}from"../SnappingConstraint.js";import{LineSegmentHintType as s}from"../snappingUtils.js";import{SnappingCandidate as r}from"./SnappingCandidate.js";import{LineSnappingHint as o}from"../hints/LineSnappingHint.js";class a extends r{constructor({coordinateHelper:t,lineStart:n,lineEnd:e,targetPoint:r,elevationInfo:a}){super(t,r,new i(t,n,e),a),this.referenceLineHint=new o(s.REFERENCE_EXTENSION,n,e,a)}get hints(){return[this.referenceLineHint,new o(s.TARGET,this._lineEndClosestToTarget(),this.targetPoint,this.elevationInfo)]}_lineEndClosestToTarget(){const e=this.constraint.start,i=this.constraint.end;return Math.sign(t(n(c,i,e),n(p,this.targetPoint,e)))>0?i:e}}const p=e(),c=e();export{a as LineSnappingCandidate};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.24/esri/copyright.txt for details.
4
4
  */
5
- import{h as e,f as t}from"../../../../chunks/vec2.js";import{LineConstraint as r}from"../SnappingConstraint.js";import{LineSegmentHintType as n}from"../snappingUtils.js";import{SnappingCandidate as i}from"./SnappingCandidate.js";import{LineSnappingHint as s}from"../hints/LineSnappingHint.js";import{ParallelSnappingHint as a}from"../hints/ParallelSnappingHint.js";class f extends i{constructor({coordinateHelper:n,referenceLine:i,lineStart:s,targetPoint:a}){const f=n.clone(s);e(f,t(f,f,i.rightVertex.pos),i.leftVertex.pos),super(n,a,new r(n,s,f)),this._referenceLines=[{edge:i,fadeLeft:!0,fadeRight:!0}]}get hints(){return[new s(n.TARGET,this.constraint.start,this.targetPoint),new a(this.constraint.start,this.targetPoint),...this._referenceLines.map((e=>new s(n.REFERENCE,e.edge.leftVertex.pos,e.edge.rightVertex.pos,e.fadeLeft,e.fadeRight)))]}addReferenceLine(e){const t={edge:e,fadeLeft:!0,fadeRight:!0};this._referenceLines.forEach((r=>{e.rightVertex.rightEdge===r.edge&&(r.fadeLeft=!1,t.fadeRight=!1),e.leftVertex.leftEdge===r.edge&&(r.fadeRight=!1,t.fadeLeft=!1)})),this._referenceLines.push(t)}}export{f as ParallelLineSnappingCandidate};
5
+ import{h as e,f as t}from"../../../../chunks/vec2.js";import{LineConstraint as n}from"../SnappingConstraint.js";import{LineSegmentHintType as i}from"../snappingUtils.js";import{SnappingCandidate as r}from"./SnappingCandidate.js";import{LineSnappingHint as s}from"../hints/LineSnappingHint.js";import{ParallelSnappingHint as a}from"../hints/ParallelSnappingHint.js";class o extends r{constructor({coordinateHelper:i,referenceLine:r,lineStart:s,targetPoint:a,elevationInfo:o}){const f=i.clone(s);e(f,t(f,f,r.rightVertex.pos),r.leftVertex.pos),super(i,a,new n(i,s,f),o),this._referenceLines=[{edge:r,fadeLeft:!0,fadeRight:!0}]}get hints(){const e=this.elevationInfo;return[new s(i.TARGET,this.constraint.start,this.targetPoint,e),new a(this.constraint.start,this.targetPoint,e),...this._referenceLines.map((t=>new s(i.REFERENCE,t.edge.leftVertex.pos,t.edge.rightVertex.pos,e,t.fadeLeft,t.fadeRight)))]}addReferenceLine(e){const t={edge:e,fadeLeft:!0,fadeRight:!0};this._referenceLines.forEach((n=>{e.rightVertex.rightEdge===n.edge&&(n.fadeLeft=!1,t.fadeRight=!1),e.leftVertex.leftEdge===n.edge&&(n.fadeRight=!1,t.fadeLeft=!1)})),this._referenceLines.push(t)}}export{o as ParallelLineSnappingCandidate};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.24/esri/copyright.txt for details.
4
4
  */
5
- import{LineSegmentHintType as t}from"../snappingUtils.js";import{SnappingCandidate as e}from"./SnappingCandidate.js";import{LineSnappingHint as r}from"../hints/LineSnappingHint.js";import{RightAngleSnappingHint as i}from"../hints/RightAngleSnappingHint.js";class o extends e{constructor({coordinateHelper:t,targetPoint:e,constraint:r,previousVertex:i,otherVertex:o,otherVertexType:s,objectId:n}){super(t,e,r),this.previousVertex=i,this.otherVertex=o,this.otherVertexType=s,this.objectId=n}get hints(){const e=this.previousVertex,o=this.otherVertexType===s.CENTER?this.otherVertex:this.targetPoint,n=this.otherVertexType===s.CENTER?this.targetPoint:this.otherVertex;return[new r(t.TARGET,o,n),new r(t.REFERENCE,e,o),new i(this.previousVertex,o,n)]}}var s;!function(t){t[t.NEXT=0]="NEXT",t[t.CENTER=1]="CENTER"}(s||(s={}));export{s as OtherVertexType,o as RightAngleSnappingCandidate};
5
+ import{LineSegmentHintType as t}from"../snappingUtils.js";import{SnappingCandidate as e}from"./SnappingCandidate.js";import{LineSnappingHint as r}from"../hints/LineSnappingHint.js";import{RightAngleSnappingHint as i}from"../hints/RightAngleSnappingHint.js";class o extends e{constructor({coordinateHelper:t,targetPoint:e,constraint:r,previousVertex:i,otherVertex:o,otherVertexType:n,objectId:s,elevationInfo:h}){super(t,e,r,h),this.previousVertex=i,this.otherVertex=o,this.otherVertexType=n,this.objectId=s}get hints(){const e=this.previousVertex,o=this.otherVertexType===n.CENTER?this.otherVertex:this.targetPoint,s=this.otherVertexType===n.CENTER?this.targetPoint:this.otherVertex,h=this.elevationInfo;return[new r(t.TARGET,o,s,h),new r(t.REFERENCE,e,o,h),new i(this.previousVertex,o,s,h)]}}var n;!function(t){t[t.NEXT=0]="NEXT",t[t.CENTER=1]="CENTER"}(n||(n={}));export{n as OtherVertexType,o as RightAngleSnappingCandidate};