@arcgis/core 4.31.0-next.20240708 → 4.31.0-next.20240710

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 (239) hide show
  1. package/assets/esri/core/workers/RemoteClient.js +1 -1
  2. package/assets/esri/core/workers/chunks/{0975e54c50383375cc09.js → 14cf7411e8318a1bccb9.js} +1 -1
  3. package/assets/esri/core/workers/chunks/{71852b8437ec66b9ef06.js → 2123ab24163a532ebc8d.js} +1 -1
  4. package/assets/esri/core/workers/chunks/{c91b3800cf3891bf2d59.js → 252ff37bf5e12dae0b18.js} +1 -1
  5. package/assets/esri/core/workers/chunks/2799007b5f3f4a2e364c.js +51 -0
  6. package/assets/esri/core/workers/chunks/{ff5e6d823d512f87a527.js → 2dddb8a989b9c96572fe.js} +1 -1
  7. package/assets/esri/core/workers/chunks/34b5bab6239c7277f854.js +1 -0
  8. package/assets/esri/core/workers/chunks/543f9db420c99d429637.js +1 -0
  9. package/assets/esri/core/workers/chunks/{5089a12084a8a8fb93d8.js → 61e5179fb49866241128.js} +1 -1
  10. package/assets/esri/core/workers/chunks/632e3ba2b8a881df29a0.js +1 -0
  11. package/assets/esri/core/workers/chunks/63eb1cc923bb8dcb3cb3.js +1 -0
  12. package/assets/esri/core/workers/chunks/{380e2654bc7e07163df0.js → 725a0eae5248a933db05.js} +1 -1
  13. package/assets/esri/core/workers/chunks/{1cc4a89c96a36d6b3d52.js → 7767559d56d16b644655.js} +1 -1
  14. package/assets/esri/core/workers/chunks/7baf288a07401f9e972d.js +1 -0
  15. package/assets/esri/core/workers/chunks/{43e83f4d827f59ff556a.js → 8087288f00dfdcc479b9.js} +1 -1
  16. package/assets/esri/core/workers/chunks/{a5fbe1c95e49093e5af4.js → 8cce4b218568638e6e64.js} +1 -1
  17. package/assets/esri/core/workers/chunks/{c7e2a97cb7bcd153bcef.js → 8e326def543268f8a08e.js} +1 -1
  18. package/assets/esri/core/workers/chunks/92cb45b18e151db007dc.js +1 -0
  19. package/assets/esri/core/workers/chunks/b2e8cc76381077b78d4c.js +1 -0
  20. package/assets/esri/core/workers/chunks/b6a8132708afcd988fa9.js +1 -0
  21. package/assets/esri/core/workers/chunks/{b4d850e82a8ae902d684.js → c44cc686774ff53c0a94.js} +1 -1
  22. package/assets/esri/core/workers/chunks/c52701477405c1fb2072.js +1 -0
  23. package/assets/esri/core/workers/chunks/{9ed11b9202013ca001ee.js → cfc2a1858a8bbb284979.js} +2 -2
  24. package/assets/esri/core/workers/chunks/{9ed11b9202013ca001ee.js.LICENSE.txt → cfc2a1858a8bbb284979.js.LICENSE.txt} +1 -1
  25. package/assets/esri/core/workers/chunks/d9863289c69d2550cd49.js +1 -0
  26. package/assets/esri/core/workers/chunks/e1f4df3a5b0b31521b3c.js +1 -0
  27. package/assets/esri/core/workers/chunks/ee72a006e25e94a4cd4a.js +1039 -0
  28. package/assets/esri/core/workers/chunks/{61505947371cebab9cbe.js → fdebfe55cd097714ec11.js} +1 -1
  29. package/assets/esri/themes/base/widgets/_OrientedImageryViewer.scss +13 -18
  30. package/assets/esri/themes/dark/main.css +1 -1
  31. package/assets/esri/themes/light/main.css +1 -1
  32. package/assets/esri/themes/light/view.css +1 -1
  33. package/chunks/AtmosphereCompositing.glsl.js +6 -9
  34. package/chunks/BlendLayers.glsl.js +1 -7
  35. package/chunks/BlendWeights.glsl.js +81 -86
  36. package/chunks/Blur.glsl.js +1 -3
  37. package/chunks/ChapmanAtmosphere.glsl.js +3 -8
  38. package/chunks/CheckerBoard.glsl.js +3 -9
  39. package/chunks/Clouds.glsl.js +21 -10
  40. package/chunks/CloudsComposition.glsl.js +3 -7
  41. package/chunks/ColorMaterial.glsl.js +3 -9
  42. package/chunks/ComponentShader.glsl.js +41 -75
  43. package/chunks/Compositing.glsl.js +5 -7
  44. package/chunks/DefaultMaterial.glsl.js +68 -73
  45. package/chunks/EdgeDetect.glsl.js +29 -39
  46. package/chunks/EdgeShader.glsl.js +37 -60
  47. package/chunks/Fog.glsl.js +4 -9
  48. package/chunks/HUDCompositing.glsl.js +1 -3
  49. package/chunks/HUDMaterial.glsl.js +11 -20
  50. package/chunks/Heatmap.glsl.js +3 -11
  51. package/chunks/HeatmapDensity.glsl.js +12 -15
  52. package/chunks/HighlightApply.glsl.js +130 -174
  53. package/chunks/HighlightDownsample.glsl.js +29 -32
  54. package/chunks/ImageMaterial.glsl.js +11 -21
  55. package/chunks/LaserlinePath.glsl.js +6 -10
  56. package/chunks/Laserlines.glsl.js +8 -20
  57. package/chunks/LineCallout.glsl.js +91 -108
  58. package/chunks/LineMarker.glsl.js +62 -53
  59. package/chunks/Magnifier.glsl.js +4 -9
  60. package/chunks/MeasurementArrow.glsl.js +9 -15
  61. package/chunks/NativeLine.glsl.js +8 -12
  62. package/chunks/NoiseTextureAtlas.glsl.js +89 -86
  63. package/chunks/OITCompositing.glsl.js +8 -12
  64. package/chunks/OverlayCompositing.glsl.js +2 -4
  65. package/chunks/Path.glsl.js +31 -55
  66. package/chunks/Pattern.glsl.js +16 -20
  67. package/chunks/PointRenderer.glsl.js +39 -48
  68. package/chunks/Precipitation.glsl.js +22 -39
  69. package/chunks/RasterColorizer.glsl.js +25 -33
  70. package/chunks/RealisticTree.glsl.js +53 -65
  71. package/chunks/RibbonLine.glsl.js +31 -36
  72. package/chunks/SSAO.glsl.js +7 -10
  73. package/chunks/SSAOBlur.glsl.js +10 -14
  74. package/chunks/ShadedColorMaterial.glsl.js +12 -15
  75. package/chunks/ShadowCastAccumulate.glsl.js +6 -8
  76. package/chunks/ShadowCastVisualize.glsl.js +12 -18
  77. package/chunks/ShadowHighlight.glsl.js +49 -51
  78. package/chunks/SimpleAtmosphere.glsl.js +4 -13
  79. package/chunks/SlicePlaneMaterial.glsl.js +3 -7
  80. package/chunks/Stars.glsl.js +3 -7
  81. package/chunks/Terrain.glsl.js +20 -61
  82. package/chunks/TextureOnly.glsl.js +2 -4
  83. package/chunks/Viewshed.glsl.js +20 -38
  84. package/chunks/WaterSurface.glsl.js +34 -60
  85. package/core/accessorSupport/tracking.js +1 -1
  86. package/core/workers/registry.js +1 -1
  87. package/geometry/Circle.js +1 -1
  88. package/geometry/Polygon.js +1 -1
  89. package/geometry/Polyline.js +1 -1
  90. package/geometry/support/geodesicUtils.js +1 -1
  91. package/interfaces.d.ts +34 -4
  92. package/layers/WCSLayer.js +1 -1
  93. package/layers/mixins/ArcGISImageService.js +1 -1
  94. package/layers/orientedImagery/transformations/imageToGroundUtils.js +1 -1
  95. package/layers/support/SubtypeSublayer.js +1 -1
  96. package/layers/support/rasterDatasets/WCSRaster.js +1 -1
  97. package/layers/support/rasterDatasets/multidimensionalUtils.js +1 -1
  98. package/layers/support/rasterDatasets/wcsCoverageParser.js +1 -1
  99. package/package.json +3 -3
  100. package/support/revision.js +1 -1
  101. package/views/2d/engine/flow/styles/Imagery.js +1 -1
  102. package/views/2d/engine/flow/styles/Particles.js +1 -1
  103. package/views/2d/engine/flow/styles/Streamlines.js +1 -1
  104. package/views/2d/engine/imagery/RasterVFDisplayObject.js +1 -1
  105. package/views/2d/engine/vectorTiles/RenderBucket.js +1 -1
  106. package/views/2d/engine/vectorTiles/shaders/VTLMaterial.js +1 -1
  107. package/views/2d/engine/webgl/BitBlitRenderer.js +1 -1
  108. package/views/2d/engine/webgl/DefaultVertexAttributeLayouts.js +1 -1
  109. package/views/2d/engine/webgl/Mesh2D.js +1 -1
  110. package/views/2d/engine/webgl/Overlay.js +1 -1
  111. package/views/2d/engine/webgl/OverlayMultipoint.js +1 -1
  112. package/views/2d/engine/webgl/Utils.js +1 -1
  113. package/views/2d/engine/webgl/VertexStream.js +1 -1
  114. package/views/2d/engine/webgl/brushes/WGLBrushStencil.js +1 -1
  115. package/views/2d/engine/webgl/brushes/WGLBrushTileDebugInfo.js +1 -1
  116. package/views/2d/engine/webgl/brushes/WGLBrushVTLBackground.js +1 -1
  117. package/views/2d/engine/webgl/cpuMapped/MappedMesh.js +1 -1
  118. package/views/2d/engine/webgl/effects/highlight/HighlightRenderer.js +1 -1
  119. package/views/2d/engine/webgl/mesh/MeshData.js +1 -1
  120. package/views/2d/engine/webgl/meshing/Mesh.js +1 -1
  121. package/views/2d/engine/webgl/shaderGraph/ShaderBuilder2D.js +1 -1
  122. package/views/2d/engine/webgl/shaderGraph/techniques/FeatureInstanceStore.js +1 -1
  123. package/views/2d/engine/webgl/shaderGraph/techniques/dotDensity/DotDensityTechnique.js +1 -1
  124. package/views/2d/engine/webgl/shaderGraph/techniques/heatmap/HeatmapTechnique.js +1 -1
  125. package/views/2d/layers/graphics/GraphicBoundsRenderer.js +1 -1
  126. package/views/2d/layers/support/DebugOverlay.js +1 -1
  127. package/views/2d/magnifier/MagnifierView2D.js +1 -1
  128. package/views/3d/environment/ChapmanAtmosphere.js +1 -1
  129. package/views/3d/environment/EnvironmentRenderer.js +1 -1
  130. package/views/3d/environment/LocalAtmosphere.js +1 -1
  131. package/views/3d/environment/MarsAtmosphere.js +1 -1
  132. package/views/3d/environment/Precipitation.js +1 -1
  133. package/views/3d/environment/Stars.js +1 -1
  134. package/views/3d/interactive/editingTools/reshape/ReshapeOperation.js +1 -1
  135. package/views/3d/interactive/editingTools/reshape/ReshapeTool3D.js +1 -1
  136. package/views/3d/interactive/editingTools/reshape/edgeOffsetUtils.js +1 -1
  137. package/views/3d/interactive/editingTools/reshape/reshapeTooltipUtils.js +1 -1
  138. package/views/3d/interactive/editingTools/transform/extentTransform/extentUtils.js +1 -1
  139. package/views/3d/layers/FeatureLayerViewBase3D.js +1 -1
  140. package/views/3d/layers/FeatureLikeLayerView3D.js +1 -1
  141. package/views/3d/layers/SceneLayerGraphicsView3D.js +1 -1
  142. package/views/3d/layers/StreamLayerView3D.js +1 -1
  143. package/views/3d/layers/graphics/Graphics3DFeatureProcessor.js +1 -1
  144. package/views/3d/layers/graphics/Graphics3DGraphicsPipeline.js +1 -1
  145. package/views/3d/layers/graphics/pipeline/Feature3DPipeline.js +5 -0
  146. package/views/3d/layers/graphics/pipeline/Feature3DPipelineWorker.js +5 -0
  147. package/views/3d/layers/graphics/pipeline/Feature3DPipelineWorkerHandle.js +5 -0
  148. package/views/3d/layers/graphics/pipeline/PBFPointFeaturesView.js +5 -0
  149. package/views/3d/layers/graphics/pipeline/TestSymbol.js +5 -0
  150. package/views/3d/layers/graphics/pipeline/Tile.js +5 -0
  151. package/views/3d/layers/graphics/pipeline/Tile3DFetcher.js +5 -0
  152. package/views/3d/layers/graphics/pipeline/Tile3DProcessor.js +5 -0
  153. package/views/3d/layers/i3s/PointRenderer.js +1 -1
  154. package/views/3d/layers/support/HeatmapFeatureProcessor.js +1 -1
  155. package/views/3d/layers/support/projectExtentUtils.js +1 -1
  156. package/views/3d/terrain/OverlayRenderer.js +1 -1
  157. package/views/3d/terrain/PatchGeometryFactory.js +1 -1
  158. package/views/3d/terrain/PatchRenderData.js +1 -1
  159. package/views/3d/terrain/TerrainRenderer.js +1 -1
  160. package/views/3d/terrain/TileCompositor.js +1 -1
  161. package/views/3d/webgl/ManagedFBObject.js +1 -1
  162. package/views/3d/webgl-engine/collections/Component/ComponentObjectCollection.js +1 -1
  163. package/views/3d/webgl-engine/core/FBOCache.js +1 -1
  164. package/views/3d/webgl-engine/core/renderPasses/RenderPass.js +1 -1
  165. package/views/3d/webgl-engine/core/shaderLibrary/ScreenSpacePass.glsl.js +3 -5
  166. package/views/3d/webgl-engine/core/shaderLibrary/Slice.glsl.js +3 -3
  167. package/views/3d/webgl-engine/core/shaderLibrary/default/DefaultMaterialAuxiliaryPasses.glsl.js +29 -59
  168. package/views/3d/webgl-engine/core/shaderLibrary/hud/HUDOcclusionPass.glsl.js +6 -12
  169. package/views/3d/webgl-engine/core/shaderLibrary/shading/LineStipple.glsl.js +11 -11
  170. package/views/3d/webgl-engine/core/shaderLibrary/shading/MarkerSizing.glsl.js +1 -1
  171. package/views/3d/webgl-engine/core/shaderLibrary/shading/MultipassTerrainTest.glsl.js +4 -7
  172. package/views/3d/webgl-engine/core/shaderLibrary/shading/ScreenSpaceReflections.glsl.js +1 -1
  173. package/views/3d/webgl-engine/core/shaderLibrary/shading/TextureTransformUV.glsl.js +6 -6
  174. package/views/3d/webgl-engine/core/shaderLibrary/shading/Water.glsl.js +4 -4
  175. package/views/3d/webgl-engine/core/shaderLibrary/terrain/TileComposite.glsl.js +2 -4
  176. package/views/3d/webgl-engine/core/shaderLibrary/util/LocalFromScreenSpace.glsl.js +2 -2
  177. package/views/3d/webgl-engine/core/shaderModules/ShaderBuilder.js +1 -1
  178. package/views/3d/webgl-engine/effects/RenderNodes.js +1 -1
  179. package/views/3d/webgl-engine/effects/ScreenSpaceGeometry.js +1 -1
  180. package/views/3d/webgl-engine/effects/blit/Blit.js +1 -1
  181. package/views/3d/webgl-engine/effects/debug/RenderNodeVisualizerNode.js +1 -1
  182. package/views/3d/webgl-engine/effects/highlight/Highlight.js +1 -1
  183. package/views/3d/webgl-engine/effects/laserlines/LaserLineRenderer.js +1 -1
  184. package/views/3d/webgl-engine/effects/laserlines/LaserlinePathData.js +1 -1
  185. package/views/3d/webgl-engine/effects/laserlines/LaserlinePathTechnique.js +1 -1
  186. package/views/3d/webgl-engine/effects/magnifier/MagnifierRenderNode.js +1 -1
  187. package/views/3d/webgl-engine/effects/smaa/SMAA.js +1 -1
  188. package/views/3d/webgl-engine/effects/ssao/SSAO.js +1 -1
  189. package/views/3d/webgl-engine/lib/DrapedHeatmapRenderer.js +1 -1
  190. package/views/3d/webgl-engine/lib/MainFramebuffer.js +1 -1
  191. package/views/3d/webgl-engine/lib/Renderer.js +1 -1
  192. package/views/3d/webgl-engine/lib/RenderingContext.js +1 -1
  193. package/views/3d/webgl-engine/lib/ShadowAccumulator.js +1 -1
  194. package/views/3d/webgl-engine/lib/ShadowMap.js +1 -1
  195. package/views/3d/webgl-engine/lib/Viewshed.js +1 -1
  196. package/views/3d/webgl-engine/lib/ViewshedShadowMap.js +1 -1
  197. package/views/3d/webgl-engine/lib/edgeRendering/EdgeRenderer.js +1 -1
  198. package/views/3d/webgl-engine/lib/edgeRendering/EdgeView.js +1 -1
  199. package/views/3d/webgl-engine/lib/glUtil3D.js +1 -1
  200. package/views/3d/webgl-engine/lib/lodRendering/LodComponentData.js +1 -1
  201. package/views/3d/webgl-engine/materials/DrawParameters.js +1 -1
  202. package/views/3d/webgl-engine/materials/renderers/MergedRenderer.js +1 -1
  203. package/views/3d/webgl-engine/materials/renderers/VaoCache.js +1 -1
  204. package/views/3d/webgl-engine/shaders/Heatmap.glsl.js +1 -1
  205. package/views/3d/webgl-engine/shaders/HighlightApply.glsl.js +1 -1
  206. package/views/3d/webgl-engine/shaders/OITCompositing.glsl.js +1 -1
  207. package/views/SceneView.js +1 -1
  208. package/views/draw/support/Box.js +1 -1
  209. package/views/interactive/tooltip/Tooltip.js +1 -1
  210. package/views/interactive/tooltip/fields/fields.js +1 -1
  211. package/views/webgl/RenderingContext.js +1 -1
  212. package/views/webgl/Util.js +1 -1
  213. package/views/webgl/VertexArrayObject.js +1 -1
  214. package/views/webgl/enums.js +1 -1
  215. package/views/webgl/heatmapTextureUtils.js +1 -1
  216. package/views/webgl/testDoublePrecisionArithmetic.js +1 -1
  217. package/views/webgl/testFloatBufferBlend.js +1 -1
  218. package/views/webgl/testSVGPremultipliedAlpha.js +1 -1
  219. package/widgets/ElevationProfile/ElevationProfileController.js +1 -1
  220. package/widgets/Feature/FeatureRelationship/FeatureRelationshipViewModel.js +1 -1
  221. package/widgets/Feature/support/relatedFeatureUtils.js +1 -1
  222. package/widgets/FeatureForm.js +1 -1
  223. package/widgets/OrientedImageryViewer/constants.js +1 -1
  224. package/widgets/OrientedImageryViewer.js +1 -1
  225. package/widgets/UtilityNetworkTrace/UtilityNetworkTraceViewModel.js +1 -1
  226. package/widgets/UtilityNetworkTrace.js +1 -1
  227. package/widgets/support/TimezonePicker.js +1 -1
  228. package/assets/esri/core/workers/chunks/0cb2eb96ffb1dbed00eb.js +0 -1
  229. package/assets/esri/core/workers/chunks/0d6ed27fc9948f4ea061.js +0 -1
  230. package/assets/esri/core/workers/chunks/225b947ba4b2fcfd5630.js +0 -1
  231. package/assets/esri/core/workers/chunks/7c7c3068da3bf7467685.js +0 -1
  232. package/assets/esri/core/workers/chunks/812e18c65aa6e398c338.js +0 -1
  233. package/assets/esri/core/workers/chunks/85e5cdd723f68dec8c25.js +0 -1
  234. package/assets/esri/core/workers/chunks/a7e2ca5ede46395f0787.js +0 -1
  235. package/assets/esri/core/workers/chunks/aed0db145187d9eb52f2.js +0 -51
  236. package/assets/esri/core/workers/chunks/cf9a32a03b3d3b66effb.js +0 -1
  237. package/assets/esri/core/workers/chunks/d85c51abde781660b1f5.js +0 -1
  238. package/assets/esri/core/workers/chunks/e840e54455eb500b501d.js +0 -1098
  239. package/assets/esri/core/workers/chunks/fec53ce15ae52f8cb802.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.31/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../../../chunks/tslib.es6.js";import t from"../../../../../core/Accessor.js";import{removeUnordered as i}from"../../../../../core/arrayUtils.js";import{unitRGBAFromColor as a}from"../../../../../core/colorUtils.js";import"../../../../../core/has.js";import n from"../../../../../core/Evented.js";import o from"../../../../../core/Handles.js";import{handlesGroup as s,makeHandle as r,destroyHandle as l}from"../../../../../core/handleUtils.js";import{destroyMaybe as p,removeMaybe as d}from"../../../../../core/maybe.js";import{watch as u,initial as h,on as c}from"../../../../../core/reactiveUtils.js";import{property as m}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/Logger.js";import{subclass as g}from"../../../../../core/accessorSupport/decorators/subclass.js";import{IDENTITY as _}from"../../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{l as f,f as v,o as M,s as b,g as x,j as y}from"../../../../../chunks/vec32.js";import{fromValues as O,create as E}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{UpdatingHandles as j}from"../../../../../core/support/UpdatingHandles.js";import I from"../../../../../geometry/Point.js";import S from"../../../../../geometry/Polyline.js";import H from"../../../../../geometry/SpatialReference.js";import{makeDehydratedPoint as V}from"../../../../../layers/graphics/dehydratedPoint.js";import{isVolumetricSymbol as w}from"../../../../../symbols/support/utils.js";import{Manipulator3D as T}from"../../Manipulator3D.js";import{createManipulatorMaterial as G,createManipulatorOutlineMaterial as A,placeAtObject as D}from"../../manipulatorUtils.js";import{RenderObject as L}from"../../RenderObject.js";import{SegmentLabels3D as P}from"../../SegmentLabels3D.js";import{SnappingVisualizer3D as C}from"../../SnappingVisualizer3D.js";import{screenToMapXYAtLocation as N,screenToRenderPlaneFromEvent as U,convertToMapCoordinates as R}from"../dragEventPipeline3D.js";import{orientation as k}from"../geometryUtils.js";import{ManipulatorType as F}from"../ManipulatorType.js";import{canMoveZOperations as z}from"../manipulatorUtils.js";import{Settings as Z}from"../settings.js";import{createVisualElements as X}from"../visualElementUtils.js";import{discRadiusSmall as Y}from"../manipulations/config.js";import{ManipulationType as q,MoveManipulation as W}from"../manipulations/MoveManipulation.js";import{MoveXYObjectManipulation as K}from"../manipulations/MoveXYObjectManipulation.js";import{createEdgeOffsetIntersectionPlane as B,createEdgeOffsetOperation as J,edgeOffsetRotationMatrix as Q,screenEdgeLengthSquared as $}from"./edgeOffsetUtils.js";import{createTooltipInfos as ee,connectTooltipToManipulatedObject as te,getUpdatedTranslateObjectTooltipInfo as ie,getUpdatedEdgeOffsetTooltipInfo as ae}from"./reshapeTooltipUtils.js";import{OutlineVisualElement as ne}from"../../visualElements/OutlineVisualElement.js";import{createExtrudedTriangle as oe,createSphereGeometry as se}from"../../../webgl-engine/lib/GeometryUtil.js";import{MouseButton as re}from"../../../../input/IViewEvents.js";import{sceneSnappingAtLocation as le,addMapDelta as pe,createManipulatorDragEventPipeline as de,dragAtLocation as ue,addScreenDelta as he}from"../../../../interactive/dragEventPipeline.js";import{ManipulatorStateCustomFlags as ce,ManipulatorStateFlags as me}from"../../../../interactive/interfaces.js";import{AccumulationBehavior as ge}from"../../../../interactive/editGeometry/interfaces.js";import{SnappingContext as _e}from"../../../../interactive/snapping/SnappingContext.js";import{createSnapDragEventPipelineStep as fe}from"../../../../interactive/snapping/SnappingDragPipelineStep.js";import{Tooltip as ve}from"../../../../interactive/tooltip/Tooltip.js";const Me=Symbol();let be=class extends t{get grabbingOrDragging(){return this._numGrabbing+this._numDragging>0}get _operations(){return this.object.operations}constructor(e){super(e),this._selectedIndex=0,this._manipulatorHandles=new o,this._manipulatorInfos=[],this._numGrabbing=0,this._numDragging=0,this._reshapeEventState=Ve.NONE,this._updatingHandles=new j,this._recreatingManipulators=!1,this._settings=new Z({getTheme:()=>this.view.effectiveTheme}),this.events=new n,this.activeTooltipInfo=null,this._vertexLaserLineVisualElement=null}initialize(){const{view:e}=this,t=this._settings.manipulators,i=t.vertex;this.tooltipInfos=ee(this._sketchOptions,e),this._vertexManipulatorMaterial=G(a(i.color),i.renderOccluded),this._vertexManipulatorOutlineMaterial=A(a(i.outlineColor),i.renderOccluded),this._vertexManipulatorHoverOutlineMaterial=A(a(i.hoverOutlineColor),i.renderOccluded);const n=t.edge;this._edgeManipulatorMaterial=G(a(n.color),n.renderOccluded),this._edgeManipulatorOutlineMaterial=A(a(n.outlineColor),n.renderOccluded);const o=t.edgeOffset;this._edgeOffsetManipulatorMaterial=G(a(o.color),o.renderOccluded,!1),this._edgeOffsetManipulatorHoverMaterial=G(a(o.hoverColor),o.renderOccluded,!1);const s=t.selected;this._selectedManipulatorMaterial=G(a(s.color),s.renderOccluded),this._selectedManipulatorOutlineMaterial=A(a(s.outlineColor),s.renderOccluded),this._selectedManipulatorHoverOutlineMaterial=A(a(s.hoverOutlineColor),s.renderOccluded),this.tooltip=new ve({view:e}),this.addHandles([u((()=>{const e=this._settings.manipulators;return{vertexSettings:e.vertex,edgeSettings:e.edge,edgeOffsetSettings:e.edgeOffset,selectedSettings:e.selected}}),(({vertexSettings:e,edgeSettings:t,edgeOffsetSettings:i,selectedSettings:a})=>{e.applyColor(this._vertexManipulatorMaterial),e.applyOutline(this._vertexManipulatorOutlineMaterial),e.applyHoverOutline(this._vertexManipulatorHoverOutlineMaterial),t.applyColor(this._edgeManipulatorMaterial),t.applyOutline(this._edgeManipulatorOutlineMaterial),i.applyColor(this._edgeOffsetManipulatorMaterial),i.applyHover(this._edgeOffsetManipulatorHoverMaterial),a.applyColor(this._selectedManipulatorMaterial),a.applyOutline(this._selectedManipulatorOutlineMaterial),a.applyHoverOutline(this._selectedManipulatorHoverOutlineMaterial)})),u((()=>this.object.visible),(e=>{for(const t of this._manipulatorInfos)t.manipulator.available=e,"edge"===t.type&&"edgeManipulator"in t&&(t.edgeManipulator.available=e)})),u((()=>this._numGrabbing+this._numDragging===0),(e=>this._toggleAutoHideManipulators(e))),u((()=>({labels:this._segmentLabels,enabled:this._sketchOptions.labels.enabled,edgeOffsetEnabled:this.enableEdgeOffset})),(({labels:e,enabled:t,edgeOffsetEnabled:i})=>{null!=e&&(e.visible=t,e.edgeDistance=i?"far":"default")}),h),te(this.tooltip,this.object,(()=>this._tooltipsContext)),c((()=>this._operations),"vertex-update",(e=>{this._updateManipulatorPositions(e.vertices)}),{onListenerAdd:()=>this._recreateManipulators()}),c((()=>this._operations?.data),"change",(e=>{"undo"!==e.operation&&"redo"!==e.operation||this._recreateManipulators()}))])}destroy(){this._segmentLabels=p(this._segmentLabels),this.tooltip=p(this.tooltip),this._removeManipulators(),this._updatingHandles.destroy()}get updating(){return this._updatingHandles.updating}get manipulators(){return this.tool.manipulators}get view(){return this.tool.view}get object(){return this.tool.object}get enableZShape(){return this.tool.enableZShape}get enableDeleteVertices(){return this.tool.enableDeleteVertices}get enableZVertex(){return this.tool.enableZVertex}get autoHideManipulators(){return this.tool.autoHideManipulators}get enableMoveObject(){return this.tool.enableMoveObject}get enableMidpoints(){return this.tool.enableMidpoints}get enableEdgeOffset(){return this.tool.enableEdgeOffset}get _sketchOptions(){return this.tool.sketchOptions}get _accentColor(){return this.view.effectiveTheme.accentColor}removeSelectedVertices(){const e=this._manipulatorInfos.filter((e=>e.manipulator.selected&&"vertex"===e.type));return this._removeVertices(e),e.length}onManipulatorSelectionChanged(){this.events.emit("manipulators-changed")}_removeManipulators(){this._manipulatorHandles.removeAll(),this._moveManipulation=p(this._moveManipulation),this._objectMoveManipulation=p(this._objectMoveManipulation),this.manipulators.removeAll(),this._manipulatorInfos=[],this._numGrabbing=0,this._numDragging=0}_createManipulators(e){if(null==this._operations)return;const t=this.object.elevationInfo;for(const i of this._operations.data.components){const a=e?.byComponentIndex.get(i.index);for(const e of i.vertices){const i=a?.has(e.index);this._createVertexOrEdgeManipulator(e,t,i)}for(const e of i.edges)this._createVertexOrEdgeManipulator(e,t)}this._createObjectMoveManipulation(),this._createMoveManipulation(t),this._createVisualElements()}get canRedo(){return null!=this._operations&&this._operations.canRedo}get canUndo(){return null!=this._operations&&this._operations.canUndo}redo(){return this._operations?.redo()}undo(){return this.events.emit("undo"),this._operations?.undo()}_recreateManipulators(){if(!this._recreatingManipulators){if(this._recreatingManipulators=!0,this._removeManipulators(),this._resetTooltip(),this._operations&&this._segmentLabels?.context?.editGeometryOperations===this._operations||(this._segmentLabels=p(this._segmentLabels)),this._createManipulators(),!this._segmentLabels&&this._operations){const e=this._sketchOptions.labels;this._segmentLabels=new P({context:{view:this.view,editGeometryOperations:this._operations,elevationInfo:this.object.elevationInfo,labelOptions:e},visible:e.enabled})}this._recreatingManipulators=!1}}_perObjectManipulatorDragAction(e,t){if("end"===t.action)return t;let i=0;const a=[],n=this._manipulatorInfos.some((e=>"vertex"===e.type&&e.manipulator.selected)),o=e===we.SELECTED_OR_ALL&&n;for(const s of this._manipulatorInfos)"vertex"===s.type&&(s.manipulator.grabbing||o&&!s.manipulator.selected||a.push(s),i++);this._moveVertices(a,t);if(a.length===i){if(this._updateEventState(Ve.MOVING),this.destroyed)return t;this.events.emit("move",{type:"move",dx:t.screenDeltaX,dy:t.screenDeltaY,object:this.object})}else{if(this._updateEventState(Ve.RESHAPING),this.destroyed)return t;this.events.emit("reshape",{type:"reshape",object:this.object})}return t}_toggleAutoHideManipulators(e){this.autoHideManipulators&&(e?this.removeHandles(Me):this.tool.manipulators.forEach((({manipulator:e})=>{const t=e.disableDisplay?.();t&&this.addHandles(t,Me)})))}_isMultiVertexSelection(){return this._manipulatorInfos.reduce(((e,t)=>"vertex"===t.type&&t.manipulator.selected?e+1:e),0)>1}_perVertexManipulatorDragAction(e){if(this._updateEventState(Ve.RESHAPING),this.destroyed)return;const{mapDeltaX:t,mapDeltaY:i,mapDeltaZ:a}=e;if(!t&&!i&&!a)return;const n=[];for(const o of this._manipulatorInfos)"vertex"===o.type&&(o.manipulator.selected&&!o.manipulator.grabbing||o===e.info)&&n.push(o);this._moveVertices(n,e,ge.ACCUMULATE_STEPS),this.events.emit("reshape",{type:"reshape",object:this.object})}_updateEventState(e){if(e===this._reshapeEventState)return!1;switch(e){case Ve.NONE:if(0!==this._numGrabbing||0!==this._numDragging)return!1;switch(this._reshapeEventState){case Ve.MOVING:this.events.emit("move",{type:"move-stop",dx:0,dy:0,object:this.object});break;case Ve.RESHAPING:this.events.emit("reshape",{type:"reshape-stop",object:this.object})}break;case Ve.MOVING:switch(this._reshapeEventState){case Ve.NONE:this.events.emit("move",{type:"move-start",dx:0,dy:0,object:this.object});break;case Ve.RESHAPING:this.events.emit("reshape",{type:"reshape-stop",object:this.object}),this.destroyed||this.events.emit("move",{type:"move-start",dx:0,dy:0,object:this.object})}break;case Ve.RESHAPING:switch(this._reshapeEventState){case Ve.NONE:this.events.emit("reshape",{type:"reshape-start",object:this.object});break;case Ve.MOVING:this.events.emit("move",{type:"move-stop",dx:0,dy:0,object:this.object}),this.destroyed||this.events.emit("reshape",{type:"reshape-start",object:this.object})}}if(this.destroyed)return!1;const t=this._reshapeEventState!==e;return this._reshapeEventState=e,t}_createObjectMoveManipulation(){const{tool:e,view:t,object:i,_operations:a}=this;if(a){if(this._objectMoveManipulation=new K({tool:e,view:t,object:i}),this.enableMoveObject){let e=null;this._manipulatorHandles.add(this._objectMoveManipulation.createDragPipeline(((t,i,n)=>{i.next((e=>this._trackNumDragging(e))).next((t=>("start"===t.action&&(e=a.createUndoGroup()),t))).next((e=>this._perObjectManipulatorDragAction(we.ALL,e))).next((e=>(this._updateTranslateObjectTooltip(q.XY,e),e))).next((t=>{"end"===t.action&&(this._resetTooltip(),e=d(e))})),n.next((()=>this._onDragCancel(!0,(()=>e=d(e)))))}))),this._objectMoveManipulation.forEachManipulator((e=>this._manipulatorHandles.add(this._watchAndUpdateGrabState(e,!1))))}else this._objectMoveManipulation.forEachManipulator((e=>{e.grabbable=!1,e.cursor=null}));this._objectMoveManipulation.forEachManipulator((e=>this._manipulatorHandles.add(e.events.on("immediate-click",(e=>{this._manipulatorInfos.some((e=>e.manipulator.selected))?this._clearSelection():this.events.emit("immediate-click",{...e,object:this.object}),e.stopPropagation()})))))}}_createMoveManipulation(e){const{object:t,tool:i,view:a,_operations:n}=this;if(!n)return;this._moveManipulation=new W({tool:i,view:a,xyAvailable:!0,xyAxisAvailable:!0,zAvailable:this.enableZShape&&z(t.operations,t.elevationInfo),snapToScene:!1,radius:W.radiusForSymbol(t.graphic?.symbol)}),this._moveManipulation.forEachManipulator((e=>this.addHandles([e.events.on("immediate-click",(t=>{this._moveManipulation.zManipulation.hasManipulator(e)||this._manipulatorInfos.some((e=>e.manipulator.selected))||this.events.emit("immediate-click",{...t,object:this.object}),t.stopPropagation()})),this._watchAndUpdateGrabState(e,!1)])));const o=e=>t=>{this.addHandles(t.events.on("focus-changed",(({action:t})=>{"focus"===t?this._updateTranslateTooltip(e):this._resetTooltip()})))};this._moveManipulation.xyManipulation.forEachManipulator(o(q.XY)),this._moveManipulation.xyAxisManipulation.forEachManipulator(o(q.XY_AXIS)),this._moveManipulation.zManipulation.forEachManipulator(o(q.Z)),this._moveManipulation.elevationInfo={mode:"absolute-height",offset:0};const s=n.data.spatialReference;this.addHandles([this._moveManipulation.createDragPipeline(((a,o,s,r,l)=>{const{snappingStep:p,cancelSnapping:d}=fe({predicate:e=>!!e.info,snappingManager:i.snappingManager,snappingContext:new _e({editGeometryOperations:n,elevationInfo:e,pointer:l,excludeFeature:t.graphic,visualizer:new C}),updatingHandles:this._updatingHandles,useZ:!1});return r=r.next((e=>(this._onDragCancel(),e))).next(d),{steps:s=s.next((e=>this._trackNumDragging(e))).next((e=>{const t=this._manipulatorInfos.filter((e=>"vertex"===e.type&&e.manipulator.selected));return e.manipulatorType===F.TRANSLATE_XY&&1===t.length?{...e,info:t[0],snapOrigin:t[0].handle.pos}:e})).next(le(this.view,e,t.graphic??void 0)).next(...p).next(pe()).next((e=>this._perObjectManipulatorDragAction(we.SELECTED_OR_ALL,e))).next((e=>(this._updateTranslateTooltip(a,e),e))),cancel:r}}),e,s,t.graphic),u((()=>t.visible),(()=>this._updateMoveManipulationPosition()),h),t.on("committed",(()=>{this._recreatingManipulators||this._updateMoveManipulationPosition()})),u((()=>t.isDraped),(e=>{this._updateMoveManipulationPosition();const t="align-move-manipulation";e?this.addHandles(this.view.elevationProvider.on("elevation-change",(()=>this._updateMoveManipulationPosition())),t):this.removeHandles(t)}),h)])}_createVisualElements(){const{object:e,view:t}=this,i=X({view:t,object:e,forEachManipulator:e=>{if(!this.destroyed&&!this._recreatingManipulators){this._objectMoveManipulation.forEachManipulator(e),this._moveManipulation.forEachManipulator(e);for(const t of this._manipulatorInfos)e(t.manipulator,F.TRANSLATE_XY)}},onManipulatorsChanged:e=>this.events.on("manipulators-changed",e)});null!=i&&(this._outlineVisualElement=i.visualElement instanceof ne?i.visualElement:null);const a=this._outlineVisualElement;if(null!=a){const t=()=>{e.isDraped||this._updateMoveManipulationPosition()};this._manipulatorHandles.add(c((()=>a.events),"attachment-origin-changed",t,{onListenerAdd:t}))}this._manipulatorHandles.add(i)}_createEdgeOffsetManipulator(e,t=this.object.elevationInfo){const i=this.view,a=this._operations;if(e.component.vertices.length<=2||!a)return null;const n=a.data.spatialReference,o=this._settings.manipulators.edgeOffset,r=o.size/2,l=r+o.collisionPadding,p=r/l,d=p*Math.sqrt(3)/2;null==this._edgeOffsetManipulatorGeometryInside&&(this._edgeOffsetManipulatorGeometryInside=oe(this._edgeOffsetManipulatorMaterial,d,p/2,p/2,o.height,o.offset)),null==this._edgeOffsetManipulatorGeometryOutside&&(this._edgeOffsetManipulatorGeometryOutside=oe(this._edgeOffsetManipulatorMaterial,-d,p/2,p/2,o.height,-o.offset));const u=[new L(this._edgeOffsetManipulatorGeometryInside.instantiate(),me.Unfocused),new L(this._edgeOffsetManipulatorGeometryInside.instantiate({material:this._edgeOffsetManipulatorHoverMaterial}),me.Focused),new L(this._edgeOffsetManipulatorGeometryOutside.instantiate(),me.Unfocused),new L(this._edgeOffsetManipulatorGeometryOutside.instantiate({material:this._edgeOffsetManipulatorHoverMaterial}),me.Focused)],h=new T({view:i,renderObjects:u,elevationInfo:"on-the-ground"!==t.mode||w(this.object.graphic?.symbol)?{mode:"absolute-height",offset:0}:t,worldOriented:!1,focusMultiplier:1,radius:l,available:this.object.visible,collisionType:{type:"disc",direction:O(0,0,1)},collisionPriority:1,metadata:{deleting:!1},location:Ee(n)}),c=new T({view:i,worldSized:!0,worldOriented:!1,available:this.object.visible,collisionPriority:-10,cursor:this.enableMoveObject?"move":"default",metadata:{deleting:!1},location:Ee(n)}),m={manipulator:h,handle:e,locationUpdateHandle:null,type:"edge",selectedIndex:0,edgeManipulator:c,elevationInfo:t,visibilityHandle:null};this._autoHideEdgeOffsetManipulator(m,o.minSquaredEdgeLength),this._updateEdgeOffsetManipulator(m);const g=[];for(const s of[e.leftVertex,e.rightVertex]){const e=this._getManipulatorInfoFromHandle(s);null!=e&&g.push(e.manipulator.events.on("location-update",(()=>this._updateEdgeOffsetManipulator(m))))}m.locationUpdateHandle=s(g),this._manipulatorHandles.add(m.locationUpdateHandle,h),this._manipulatorHandles.add([this._watchAndUpdateGrabState(h,!0),this._watchAndUpdateGrabState(c,!0)],h),this._manipulatorHandles.add(de(h,this._createEdgeOffsetPipeline(m,t)),h),this._manipulatorHandles.add(de(c,((e,n,o,s)=>{if("touch"===s){this._createEdgeOffsetPipeline(m,t)(e,n,o)}else if(this.enableMoveObject){const s=this.object.graphic,r=a.data.spatialReference,{elevationAlignedLocation:l}=e;n.next((e=>this._trackNumDragging(e))).next(ue(i,l)).next(N(i,l,t,r,s)).next(he()).next(pe()).next((e=>this._perObjectManipulatorDragAction(we.ALL,e))).next((e=>(this._updateTranslateObjectTooltip(q.XY,e),e))).next((e=>{"end"===e.action&&this._resetTooltip()})),o.next((()=>this._onDragCancel(!e.metadata.deleting)))}})),h);const _=e=>{this._manipulatorInfos.some((e=>e.manipulator.selected))?this._clearSelection():this.events.emit("immediate-click",{...e,object:this.object}),e.stopPropagation()};return this._manipulatorHandles.add([h.events.on("immediate-click",_),c.events.on("immediate-click",_),h.events.on("focus-changed",(({action:e})=>{"focus"===e?this._updateEdgeOffsetTooltip(null):this._resetTooltip()}))],h),this._manipulatorInfos.push(m),this.manipulators.addMany([h,c]),this.events.emit("manipulators-changed"),m}_autoHideEdgeOffsetManipulator(e,t){const i=e.manipulator,a=e.edgeManipulator,n=()=>{e.visibilityHandle=d(e.visibilityHandle);const n=this._getManipulatorInfoFromHandle(e.handle.leftVertex),o=this._getManipulatorInfoFromHandle(e.handle.rightVertex),l=null!=n&&null!=o&&$(n.manipulator.renderLocation,o.manipulator.renderLocation,this.view.state.camera)<t;(!i.focused&&!a.focused||l)&&(i.grabbable=!l,a.grabbable=!l,e.visibilityHandle=s([i.disableDisplay(),r((()=>{i.grabbable=!0,a.grabbable=this.enableMoveObject}))]))};this._manipulatorHandles.add([i.events.on("focus-changed",n),a.events.on("focus-changed",n),r((()=>{d(e.visibilityHandle),a.metadata.deleting=!0,this.manipulators.remove(a)}))],i),n()}_updateEdgeOffsetManipulator(e){if(!this._operations)return;this._updateManipulatorPosition(e);const{coordinateHelper:t}=this._operations.data,i=B(this.view,e.manipulator.elevationAlignedLocation,J(t,e.handle,e.manipulator.elevationInfo)),a=this._getManipulatorInfoFromHandle(e.handle.leftVertex),n=this._getManipulatorInfoFromHandle(e.handle.rightVertex);if(null==a||null==n)return;const o=a.manipulator.renderLocation,s=n.manipulator.renderLocation,r=null!=i?Q(i,o,s):_;e.manipulator.modelTransform=r,e.edgeManipulator.elevationAlignedLocation=e.manipulator.elevationAlignedLocation,e.edgeManipulator.modelTransform=r;const l=f(v(Ie,o,s))/2;e.edgeManipulator.collisionType={type:"line",paths:[[[-l,0,0],[l,0,0]]]}}_createEdgeOffsetPipeline(e,t){return(i,a,n)=>{const o=this._operations;if(!o)return;this._clearSelection();const{step:s,cleanup:r}=this._initializeEdgeOffset(e,t,o);a.next((e=>this._trackNumDragging(e))).next(ue(this.view,i.elevationAlignedLocation)).next(s).next(U(this.view)).next(R(this.view,o.data.spatialReference)).next(pe()).next(xe()).next(this._applyEdgeOffsetStep(e)).next(this._showEdgeOffsetTooltip()).next((e=>{"end"===e.action&&r()})),n.next((()=>{i.metadata.deleting||(r(),this._onDragCancel())}))}}_initializeEdgeOffset(e,t,i){const{view:n}=this,o=J(i.data.coordinateHelper,e.handle,t),r=i.createUndoGroup(),p=B(n,e.manipulator.elevationAlignedLocation,o);if(o.requiresSplitEdgeLeft){const t=this._getManipulatorInfoFromHandle(e.handle.leftVertex.leftEdge);null!=t&&this._splitEdgeManipulator(t,1)}if(o.requiresSplitEdgeRight){const t=this._getManipulatorInfoFromHandle(e.handle.rightVertex.rightEdge);null!=t&&this._splitEdgeManipulator(t,0)}const c=()=>new S({paths:[[e.handle.leftVertex.pos,e.handle.rightVertex.pos]],spatialReference:i.data.spatialReference}),m=this._settings,g=new ne({view:n,isDraped:this.object.isDraped,geometry:c(),elevationInfo:e.elevationInfo,width:m.visualElements.lineObjects.outline.width,attached:!1,isDecoration:!0});let _;const f=()=>{this._cleanEdgeOffsetCollapsedEdges(e),_=d(_)},v=this.events.on("undo",f);return _=s([u((()=>a(this._accentColor)),(e=>g.color=e),h),l(g),u((()=>this.object.isDraped),(e=>g.isDraped=e)),this.object.on("committed",(()=>g.geometry=c())),r,v]),g.attached=!0,{step:e=>null==o||null==p?(f(),null):{...e,operation:o,plane:p},cleanup:f}}_applyEdgeOffsetStep(e){return t=>{if(this.destroyed||null==t.operation)return t;this._updateEventState(Ve.RESHAPING);const{mapDeltaX:i,mapDeltaY:a,mapDeltaZ:n}=t;return(i||a||n)&&(this._offsetEdge(e,t),this.events.emit("reshape",{type:"reshape",object:this.object})),t}}_showEdgeOffsetTooltip(){return e=>(null!=e.signedDistance&&this.object.operations?this._updateEdgeOffsetTooltip(e):this._resetTooltip(),e)}_cleanEdgeOffsetCollapsedEdges(e){if(!this._operations)return;const t=e.handle.leftVertex.leftEdge?.leftVertex,i=e.handle.leftVertex,a=e.handle.rightVertex.rightEdge?.rightVertex,n=e.handle.rightVertex,o=this._operations.data.coordinateHelper,s=[];if(t&&o.distance(t.pos,i.pos)<Se){const e=this._getManipulatorInfoFromHandle(i);null!=e&&s.push(e)}if(o.distance(i.pos,n.pos)<Se||a&&o.distance(a.pos,n.pos)<Se){const e=this._getManipulatorInfoFromHandle(n);null!=e&&s.push(e)}s.length&&this._removeVertices(s)}_createVertexOrEdgeManipulator(e,t=this.object.elevationInfo,i=!1){const a=this.view,n=this._operations,o=this._settings;if(!n)return null;const r=n.data.type,l=n.data.spatialReference;if("edge"===e.type){if(this.enableEdgeOffset)return this._createEdgeOffsetManipulator(e,t);if(!this.enableMidpoints)return null}if(null==this._vertexManipulatorGeometry||null==this._vertexManipulatorOutlineGeometry){const{size:e,outlineSize:t}=ye(o.manipulators.vertex);this._vertexManipulatorGeometry=se(this._vertexManipulatorMaterial,e,16,16),this._vertexManipulatorOutlineGeometry=se(this._vertexManipulatorOutlineMaterial,t,16,16)}if(null==this._edgeManipulatorGeometry||null==this._edgeManipulatorOutlineGeometry){const{size:e,outlineSize:t}=ye(o.manipulators.edge);this._edgeManipulatorGeometry=se(this._edgeManipulatorMaterial,e,16,16),this._edgeManipulatorOutlineGeometry=se(this._edgeManipulatorOutlineMaterial,t,16,16)}const p="point"===r||"mesh"===r?[]:[new L(this._vertexManipulatorGeometry.instantiate(),He.Vertex|me.Unselected),new L(this._vertexManipulatorOutlineGeometry.instantiate(),He.Vertex|me.Unfocused|me.Unselected),new L(this._vertexManipulatorOutlineGeometry.instantiate({material:this._vertexManipulatorHoverOutlineMaterial}),He.Vertex|me.Focused|me.Unselected),new L(this._vertexManipulatorGeometry.instantiate({material:this._selectedManipulatorMaterial}),me.Selected),new L(this._vertexManipulatorOutlineGeometry.instantiate({material:this._selectedManipulatorOutlineMaterial}),me.Selected|me.Unfocused),new L(this._vertexManipulatorOutlineGeometry.instantiate({material:this._selectedManipulatorHoverOutlineMaterial}),me.Selected|me.Focused)];this.enableMidpoints&&p.push(new L(this._edgeManipulatorGeometry.instantiate({material:this._vertexManipulatorMaterial}),He.Edge|me.Focused|me.Unselected),new L(this._edgeManipulatorOutlineGeometry.instantiate({material:this._vertexManipulatorHoverOutlineMaterial}),He.Edge|me.Focused|me.Unselected),new L(this._edgeManipulatorGeometry.instantiate(),He.Edge|me.Unfocused|me.Unselected),new L(this._edgeManipulatorOutlineGeometry.instantiate(),He.Edge|me.Unfocused|me.Unselected));const u=new T({view:a,renderObjects:p,elevationInfo:t,focusMultiplier:1,touchMultiplier:1,available:this.object.visible,metadata:{deleting:!1},location:Ee(l)});u.selected=i,this._setTypeSpecificManipulatorSettings(u,e,t);const h="edge"===e.type?{manipulator:u,handle:e,locationUpdateHandle:null,type:"edge",selectedIndex:0}:{manipulator:u,handle:e,type:"vertex",selectedIndex:0};if(this._manipulatorInfos.push(h),this.manipulators.add(u),this._updateManipulatorPosition(h),"edge"===h.type){const e=[];for(const t of[h.handle.leftVertex,h.handle.rightVertex]){const i=this._getManipulatorInfoFromHandle(t);null!=i&&e.push(i.manipulator.events.on("location-update",(()=>this._updateManipulatorPosition(h))))}h.locationUpdateHandle=s(e),this._manipulatorHandles.add(h.locationUpdateHandle,u)}this._manipulatorHandles.add(this._watchAndUpdateGrabState(u,!0),u);const c=de(u,((e,i,o,s)=>{let r=null;const{snappingStep:p,cancelSnapping:u}=fe({predicate:()=>!this._isMultiVertexSelection(),snappingManager:this.tool.snappingManager,snappingContext:new _e({editGeometryOperations:n,elevationInfo:t,pointer:s,excludeFeature:this.object.graphic,visualizer:new C}),updatingHandles:this._updatingHandles,useZ:!1});o=o.next((t=>(this._onDragCancel(!e.metadata.deleting,(()=>r=d(r))),t))).next(u);const{elevationAlignedLocation:c}=e,m=this.object.graphic??void 0;i.next((e=>this._trackNumDragging(e))).next((e=>{if("start"===e.action&&n&&(r=n.createUndoGroup()),"edge"===h.type){const t=this._splitEdgeManipulator(h);return{...e,info:t,snapOrigin:t.handle.pos}}return{...e,info:h,snapOrigin:h.handle.pos}})).next(ue(a,c)).next(N(a,c,t,l,m)).next(le(a,t,m)).next(...p).next(pe()).next((e=>{this._perVertexManipulatorDragAction(e),"end"===e.action&&(r=d(r)),this._resetTooltip()}))}));return this._manipulatorHandles.add([c,u.events.on("immediate-click",(e=>this._manipulatorClickCallback(e,h))),u.events.on("select-changed",(()=>{h.selectedIndex=++this._selectedIndex,this._updateMoveManipulationPosition(),this._resetTooltip()})),u.events.on("focus-changed",(()=>{this._resetTooltip()}))],u),this.events.emit("manipulators-changed"),h}_trackNumDragging(e){switch(e.action){case"start":this._numDragging++;break;case"end":this._numDragging--}return e}_onDragCancel(e=!0,t){switch(this._numDragging--,e&&this.undo(),null!=this.tool.snappingManager&&this.tool.snappingManager.doneSnapping(),this._resetTooltip(),this._reshapeEventState){case Ve.NONE:break;case Ve.MOVING:this.events.emit("move",{type:"move",dx:0,dy:0,object:this.object});break;case Ve.RESHAPING:this.events.emit("reshape",{type:"reshape",object:this.object})}t&&t(),this.destroyed||this._updateEventState(Ve.NONE)}_setTypeSpecificManipulatorSettings(e,t,i){const a=this._settings;switch(t.type){case"vertex":{e.state=He.Vertex,e.selectable=!0,e.cursor="move",e.collisionPriority=2;const{size:t,collisionPadding:n}=a.manipulators.vertex;e.radius=t/2+n,e.elevationInfo=i;const o=this._operations?.data.type;e.interactive=null!=o&&"point"!==o&&"mesh"!==o;break}case"edge":{e.state=He.Edge,e.selectable=!1,e.cursor="copy",e.collisionPriority=-1;const{size:t,collisionPadding:n}=a.manipulators.edge;e.radius=t/2+n,e.elevationInfo="on-the-ground"!==i.mode||w(this.object.graphic?.symbol)?{mode:"absolute-height",offset:0}:i;break}}}_watchAndUpdateGrabState(e,t){return e.events.on("grab-changed",(i=>this._onGrabStateChanged(e,t,i.action,i.pointerType)))}_onGrabStateChanged(e,t,i,a="mouse"){if(!this._recreatingManipulators){if("start"===i)t&&this._updateSelection(e),this._numGrabbing++;else if(this._numGrabbing--,this._updateEventState(Ve.NONE),this.destroyed)return;this._moveManipulation.interactive=!this._numGrabbing,("touch"!==a||this.enableEdgeOffset)&&(this._manipulatorInfos.forEach((e=>{const{manipulator:t}=e,i=this._operations?.data.type;t.interactive=t.grabbing||!this._numGrabbing&&null!=i&&"point"!==i&&"mesh"!==i,"edgeManipulator"in e&&(e.edgeManipulator.interactive=e.edgeManipulator.grabbing||!this._numGrabbing)})),this._objectMoveManipulation.forEachManipulator((e=>{e.interactive=e.grabbing||!this._numGrabbing})))}}_clearSelection(){for(const e of this._manipulatorInfos)e.manipulator.grabbing||(e.manipulator.selected=!1)}_updateSelection(e){e.grabbing&&!e.selected&&e.selectable&&(this._clearSelection(),e.selected=!0,this.events.emit("manipulators-changed"))}_removeManipulator(e){null!=e&&(e.manipulator.metadata.deleting=!0,this.manipulators.remove(e.manipulator),this._manipulatorHandles.remove(e.manipulator),i(this._manipulatorInfos,e),this.events.emit("manipulators-changed"),this._resetTooltip())}_getManipulatorInfoFromHandle(e){if(e)for(const t of this._manipulatorInfos)if(e===t.handle)return t;return null}_updateManipulatorPositions(e){for(const t of e)this._updateManipulatorPosition(this._getManipulatorInfoFromHandle(t))}_updateManipulatorPosition(e){const t=this._operations;if(null!=e&&t)if("vertex"===e.type)e.manipulator.location=t.data.coordinateHelper.vectorToDehydratedPoint(e.handle.pos,je),e.manipulator.grabbing&&null!=this._vertexLaserLineVisualElement&&(this._vertexLaserLineVisualElement.visualElement.intersectsWorldUpAtLocation=e.manipulator.renderLocation);else if("edge"===e.type){const i=this._getManipulatorInfoFromHandle(e.handle.leftVertex),a=this._getManipulatorInfoFromHandle(e.handle.rightVertex);if(null==i||null==a)return;const n=i.manipulator,o=a.manipulator;if("on-the-ground"===e.manipulator.elevationInfo?.mode){const i=n.location,a=o.location,s=.5,r=i.x+s*(a.x-i.x),l=i.y+s*(a.y-i.y),p=i.hasZ&&a.hasZ?0:void 0;e.manipulator.location=V(r,l,p,t.data.spatialReference)}else M(Ie,n.renderLocation,o.renderLocation,.5),e.manipulator.renderLocation=Ie}}_splitEdgeManipulator(e,t=.5){const i=this._operations,a=i.splitEdge(e.handle,t).createdVertex;e.locationUpdateHandle=d(e.locationUpdateHandle);const n=this.object.elevationInfo;let o;this.enableEdgeOffset?(this._removeManipulator(e),o=this._createVertexOrEdgeManipulator(a)):(o=e,o.handle=a,o.type="vertex",this._setTypeSpecificManipulatorSettings(e.manipulator,e.handle,n)),a.leftEdge&&this._createVertexOrEdgeManipulator(a.leftEdge),a.rightEdge&&this._createVertexOrEdgeManipulator(a.rightEdge),this._updateManipulatorPosition(o),this.enableEdgeOffset||this._resetTooltip(),this._updateSelection(e.manipulator);const s=this._updateEventState(Ve.RESHAPING),r=i.data.coordinateHelper.vectorToArray(o.handle.pos),l=i.data.components.indexOf(a.component);return this.events.emit("vertex-add",{type:"vertex-add",object:this.object,vertices:[{coordinates:r,componentIndex:l,vertexIndex:a.index}],added:r}),s&&this._updateEventState(Ve.NONE),o}_updateMoveManipulationPosition(){const e=b(Ie,0,0,0);let t=0,i=!1,a=null,n=null;for(const r of this._manipulatorInfos)"vertex"===r.type&&(r.manipulator.selected?(t++,x(e,e,r.manipulator.renderLocation),null==a||r.selectedIndex>a.selectedIndex?(n=a,a=r):(null==n||r.selectedIndex>n.selectedIndex)&&(n=r)):i=!0);const o=this.object,s=this._operations?.data.geometry;if(0===t){const e=o.visible&&this.enableMoveObject;this._moveManipulation.xyManipulation.available=e,this._moveManipulation.xyAxisManipulation.available=e,this._moveManipulation.xyAxisManipulation.orthogonalAvailable=e,this._moveManipulation.zManipulation.available=e&&this.enableZShape&&z(this._operations,o.elevationInfo),this._moveManipulation.angle=k(s),this._moveManipulation.radius=W.radiusForSymbol(o.graphic?.symbol)}else{const e=o.visible;this._moveManipulation.xyManipulation.available=e,this._moveManipulation.xyAxisManipulation.available=e,this._moveManipulation.zManipulation.available=e&&this.enableZVertex&&z(this._operations,this.object.elevationInfo),this._moveManipulation.xyAxisManipulation.orthogonalAvailable=e&&1!==t;let i=0;if(null!=a){const e=a.handle.pos,t=null!=n?n.handle.pos:a.handle.leftEdge?.leftVertex?a.handle.leftEdge.leftVertex.pos:null,o=null==n&&a.handle.rightEdge?.rightVertex?a.handle.rightEdge.rightVertex.pos:null;t&&o?this._moveManipulation.xyAxisManipulation.available=!1:t?i=Oe(t,e):o&&(i=Oe(e,o))}this._moveManipulation.angle=i,this._moveManipulation.radius=Y}0!==t&&i?(y(e,e,1/t),je.spatialReference=this._operations.data.spatialReference,je.hasZ=!0,this.view.renderCoordsHelper.fromRenderCoords(e,je),this._moveManipulation.elevationAlignedLocation=je):null==this._outlineVisualElement||this.object.isDraped||null==this._outlineVisualElement.attachmentOrigin?D(this._moveManipulation,this.object):this._moveManipulation.elevationAlignedLocation=this._outlineVisualElement.attachmentOrigin}_removeVertices(e){const t=new Array,i=this._operations;if(i){for(const a of e){const e=a.handle.component;if("vertex"===a.type&&i.canRemoveVertex(e)){t.push(a.handle),this._removeManipulator(a),this._removeManipulator(this._getManipulatorInfoFromHandle(a.handle.leftEdge)),this._removeManipulator(this._getManipulatorInfoFromHandle(a.handle.rightEdge));const n=i.removeVertices([a.handle]),o=n.removedVertices?.[0].createdEdge;o?this._createVertexOrEdgeManipulator(o):this.enableEdgeOffset&&e.vertices.length<=2&&this._removeManipulator(this._getManipulatorInfoFromHandle(e.edges[0]))}}if(t.length>0){const e=t.map((e=>{const t=i.data.components.indexOf(e.component);return{coordinates:i.data.coordinateHelper.vectorToArray(e.pos),componentIndex:t,vertexIndex:e.index}})),a=this._updateEventState(Ve.RESHAPING);if(this.destroyed)return;if(this.events.emit("vertex-remove",{type:"vertex-remove",object:this.object,removed:e.map((e=>e.coordinates)),vertices:e}),this.destroyed)return;if(a&&(this._updateEventState(Ve.NONE),this.destroyed))return;this._updateMoveManipulationPosition()}}}_moveVertices(e,t,i=("start"===t.action?ge.NEW_STEP:ge.ACCUMULATE_STEPS)){const a=this._operations;if(a){e.length>0&&a.moveVertices(e.map((e=>e.handle)),t.mapDeltaX,t.mapDeltaY,t.mapDeltaZ,i);for(const t of e)this._updateManipulatorPosition(t)}}_offsetEdge(e,t){if(null==t.operation||null==t.signedDistance)return;const i=this._operations;if(!i)return;const a=t.operation.clone();a.distance=t.signedDistance,i.updateVertices([e.handle.leftVertex,e.handle.rightVertex],a),this._updateManipulatorPosition(this._getManipulatorInfoFromHandle(e.handle.leftVertex)),this._updateManipulatorPosition(this._getManipulatorInfoFromHandle(e.handle.rightVertex))}_manipulatorClickCallback(e,t){e.shiftKey||this._clearSelection(),"vertex"===t.type&&(t.manipulator.selected=!t.manipulator.selected,this.enableDeleteVertices&&e.button===re.Right&&this._removeVertices([t])),"edge"===t.type&&e.button===re.Left&&this._splitEdgeManipulator(t),e.stopPropagation()}_updateTranslateTooltip(e,t){null!=this._defaultTooltipInfo?this._resetTooltip():this._updateTranslateObjectTooltip(e,t)}_updateTranslateObjectTooltip(e,t){this.activeTooltipInfo=ie(e,t,this._tooltipsContext)}_updateEdgeOffsetTooltip(e){this.activeTooltipInfo=ae(this.object,e,this._tooltipsContext)}_resetTooltip(){this.activeTooltipInfo=this._defaultTooltipInfo}get _defaultTooltipInfo(){const e=this._operations?.data.type;switch(e){case"polyline":case"polygon":return this._selectedVertexManipulatorInfo?this.tooltipInfos.selectedVertex:null;case"point":case"mesh":return this.tooltipInfos.movePoint;default:return null}}get _selectedVertexManipulatorInfo(){const e=this._manipulatorInfos.filter((e=>"vertex"===e.type&&e.manipulator.selected));return 1===e.length?e[0]:null}get _tooltipsContext(){const{events:e}=this;return{sketchOptions:this._sketchOptions,tooltipInfos:this.tooltipInfos,activeTooltipInfo:this.activeTooltipInfo,selectedVertexManipulatorInfo:this._selectedVertexManipulatorInfo,callbacks:{onReshapeStart:()=>e.emit("reshape",{type:"reshape-start",object:this.object}),onReshape:()=>e.emit("reshape",{type:"reshape",object:this.object}),onReshapeStop:()=>e.emit("reshape",{type:"reshape-stop",object:this.object}),onMoveStart:()=>e.emit("move",{type:"move-start",object:this.object,dx:0,dy:0}),onMove:()=>e.emit("move",{type:"move",object:this.object,dx:0,dy:0}),onMoveStop:()=>e.emit("move",{type:"move-stop",object:this.object,dx:0,dy:0})}}}get test(){}};function xe(){return e=>{const{operation:t,mapEnd:i}=e;return null==t||null==i?e:("start"===e.action&&t.selectArrowFromStartPoint(i),{...e,signedDistance:t.signedDistanceToPoint(i)})}}function ye(e){const t=e.size/2,i=t+e.collisionPadding;return{size:t/i,outlineSize:(t+e.outlineSize)/i}}function Oe(e,t){return Math.atan2(t[1]-e[1],t[0]-e[0])+Math.PI/2}function Ee(e){return new I({x:0,y:0,z:0,spatialReference:e})}e([m()],be.prototype,"_numGrabbing",void 0),e([m()],be.prototype,"_numDragging",void 0),e([m()],be.prototype,"grabbingOrDragging",null),e([m()],be.prototype,"_operations",null),e([m()],be.prototype,"_segmentLabels",void 0),e([m({constructOnly:!0})],be.prototype,"tool",void 0),e([m()],be.prototype,"tooltip",void 0),e([m()],be.prototype,"activeTooltipInfo",void 0),e([m({readOnly:!0})],be.prototype,"updating",null),e([m()],be.prototype,"manipulators",null),e([m()],be.prototype,"view",null),e([m()],be.prototype,"object",null),e([m()],be.prototype,"enableZShape",null),e([m()],be.prototype,"enableDeleteVertices",null),e([m()],be.prototype,"enableZVertex",null),e([m()],be.prototype,"autoHideManipulators",null),e([m()],be.prototype,"enableMoveObject",null),e([m()],be.prototype,"enableMidpoints",null),e([m()],be.prototype,"enableEdgeOffset",null),e([m()],be.prototype,"_sketchOptions",null),e([m()],be.prototype,"_accentColor",null),e([m()],be.prototype,"_tooltipsContext",null),be=e([g("esri.views.3d.interactive.editingTools.reshape.ReshapeOperation")],be);const je=V(0,0,void 0,H.WGS84),Ie=E(),Se=1e-6;var He,Ve,we;!function(e){e.Vertex=ce.Custom1,e.Edge=ce.Custom2}(He||(He={})),function(e){e[e.NONE=0]="NONE",e[e.MOVING=1]="MOVING",e[e.RESHAPING=2]="RESHAPING"}(Ve||(Ve={})),function(e){e[e.ALL=0]="ALL",e[e.SELECTED_OR_ALL=1]="SELECTED_OR_ALL"}(we||(we={}));export{be as ReshapeOperation};
5
+ import{_ as e}from"../../../../../chunks/tslib.es6.js";import t from"../../../../../core/Accessor.js";import{removeUnordered as i}from"../../../../../core/arrayUtils.js";import{unitRGBAFromColor as a}from"../../../../../core/colorUtils.js";import"../../../../../core/has.js";import n from"../../../../../core/Evented.js";import o from"../../../../../core/Handles.js";import{handlesGroup as s,makeHandle as r,destroyHandle as l}from"../../../../../core/handleUtils.js";import{destroyMaybe as p,removeMaybe as d}from"../../../../../core/maybe.js";import{valueInUnit as h}from"../../../../../core/quantityUtils.js";import{watch as u,initial as c,on as m,syncAndInitial as g,when as f,sync as _}from"../../../../../core/reactiveUtils.js";import{getMetersPerUnitForSR as v}from"../../../../../core/unitUtils.js";import{property as M}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/Logger.js";import{subclass as b}from"../../../../../core/accessorSupport/decorators/subclass.js";import{IDENTITY as x}from"../../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{l as y,f as O,o as E,s as j,g as I,j as S}from"../../../../../chunks/vec32.js";import{fromValues as H,create as w}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{UpdatingHandles as V}from"../../../../../core/support/UpdatingHandles.js";import T from"../../../../../geometry/Point.js";import A from"../../../../../geometry/Polyline.js";import G from"../../../../../geometry/SpatialReference.js";import{makeDehydratedPoint as D}from"../../../../../layers/graphics/dehydratedPoint.js";import{isVolumetricSymbol as P}from"../../../../../symbols/support/utils.js";import{Manipulator3D as L}from"../../Manipulator3D.js";import{createManipulatorMaterial as C,createManipulatorOutlineMaterial as U,placeAtObject as N}from"../../manipulatorUtils.js";import{RenderObject as k}from"../../RenderObject.js";import{SegmentLabels3D as R}from"../../SegmentLabels3D.js";import{SnappingVisualizer3D as F}from"../../SnappingVisualizer3D.js";import{screenToMapXYAtLocation as z,screenToRenderPlaneFromEvent as Z,convertToMapCoordinates as X}from"../dragEventPipeline3D.js";import{orientation as Y}from"../geometryUtils.js";import{ManipulatorType as q}from"../ManipulatorType.js";import{canMoveZOperations as W}from"../manipulatorUtils.js";import{Settings as K}from"../settings.js";import{createVisualElements as B}from"../visualElementUtils.js";import{discRadiusSmall as J}from"../manipulations/config.js";import{ManipulationType as Q,MoveManipulation as $}from"../manipulations/MoveManipulation.js";import{MoveXYObjectManipulation as ee}from"../manipulations/MoveXYObjectManipulation.js";import{createEdgeOffsetIntersectionPlane as te,createEdgeOffsetOperation as ie,edgeOffsetRotationMatrix as ae,screenToMap as ne,screenEdgeLengthSquared as oe}from"./edgeOffsetUtils.js";import{createTooltipInfos as se,connectTooltipToManipulatedObject as re,getUpdatedTranslateObjectTooltipInfo as le,getUpdatedEdgeOffsetTooltipInfo as pe}from"./reshapeTooltipUtils.js";import{OutlineVisualElement as de}from"../../visualElements/OutlineVisualElement.js";import{createExtrudedTriangle as he,createSphereGeometry as ue}from"../../../webgl-engine/lib/GeometryUtil.js";import{MouseButton as ce}from"../../../../input/IViewEvents.js";import{sceneSnappingAtLocation as me,addMapDelta as ge,createManipulatorDragEventPipeline as fe,dragAtLocation as _e,addScreenDelta as ve}from"../../../../interactive/dragEventPipeline.js";import{ManipulatorStateCustomFlags as Me,ManipulatorStateFlags as be}from"../../../../interactive/interfaces.js";import{tooltipKeys as xe}from"../../../../interactive/keybindings.js";import{AccumulationBehavior as ye}from"../../../../interactive/editGeometry/interfaces.js";import{SnappingContext as Oe}from"../../../../interactive/snapping/SnappingContext.js";import{createSnapDragEventPipelineStep as Ee}from"../../../../interactive/snapping/SnappingDragPipelineStep.js";import{Tooltip as je}from"../../../../interactive/tooltip/Tooltip.js";import{enterInputModeIfAvailable as Ie}from"../../../../interactive/tooltip/tooltipCommonUtils.js";const Se=Symbol();let He=class extends t{get _operations(){return this.object.operations}constructor(e){super(e),this._selectedIndex=0,this._manipulatorHandles=new o,this._manipulatorInfos=[],this._numGrabbing=0,this._numDragging=0,this._reshapeEventState=Ue.NONE,this._pendingEdgeOffsetInfo=null,this._updatingHandles=new V,this._recreatingManipulators=!1,this._settings=new K({getTheme:()=>this.view.effectiveTheme}),this.events=new n,this.activeTooltipInfo=null,this._vertexLaserLineVisualElement=null}initialize(){const{view:e}=this,t=this._settings.manipulators,i=t.vertex;this.tooltipInfos=se(this._sketchOptions,e),this._vertexManipulatorMaterial=C(a(i.color),i.renderOccluded),this._vertexManipulatorOutlineMaterial=U(a(i.outlineColor),i.renderOccluded),this._vertexManipulatorHoverOutlineMaterial=U(a(i.hoverOutlineColor),i.renderOccluded);const n=t.edge;this._edgeManipulatorMaterial=C(a(n.color),n.renderOccluded),this._edgeManipulatorOutlineMaterial=U(a(n.outlineColor),n.renderOccluded);const o=t.edgeOffset;this._edgeOffsetManipulatorMaterial=C(a(o.color),o.renderOccluded,!1),this._edgeOffsetManipulatorHoverMaterial=C(a(o.hoverColor),o.renderOccluded,!1);const s=t.selected;this._selectedManipulatorMaterial=C(a(s.color),s.renderOccluded),this._selectedManipulatorOutlineMaterial=U(a(s.outlineColor),s.renderOccluded),this._selectedManipulatorHoverOutlineMaterial=U(a(s.hoverOutlineColor),s.renderOccluded),this.tooltip=new je({view:e}),this.addHandles([u((()=>{const e=this._settings.manipulators;return{vertexSettings:e.vertex,edgeSettings:e.edge,edgeOffsetSettings:e.edgeOffset,selectedSettings:e.selected}}),(({vertexSettings:e,edgeSettings:t,edgeOffsetSettings:i,selectedSettings:a})=>{e.applyColor(this._vertexManipulatorMaterial),e.applyOutline(this._vertexManipulatorOutlineMaterial),e.applyHoverOutline(this._vertexManipulatorHoverOutlineMaterial),t.applyColor(this._edgeManipulatorMaterial),t.applyOutline(this._edgeManipulatorOutlineMaterial),i.applyColor(this._edgeOffsetManipulatorMaterial),i.applyHover(this._edgeOffsetManipulatorHoverMaterial),a.applyColor(this._selectedManipulatorMaterial),a.applyOutline(this._selectedManipulatorOutlineMaterial),a.applyHoverOutline(this._selectedManipulatorHoverOutlineMaterial)})),u((()=>this.object.visible),(e=>{for(const t of this._manipulatorInfos)t.manipulator.available=e,Ge(t)&&(t.edgeManipulator.available=e)})),u((()=>this._numGrabbing+this._numDragging===0),(e=>this._toggleAutoHideManipulators(e))),u((()=>({labels:this._segmentLabels,enabled:this._sketchOptions.labels.enabled,edgeOffsetEnabled:this.enableEdgeOffset})),(({labels:e,enabled:t,edgeOffsetEnabled:i})=>{null!=e&&(e.visible=t,e.edgeDistance=i?"far":"default")}),c),re(this.tooltip,this.object,(()=>this._tooltipsContext)),m((()=>this._operations),"vertex-update",(e=>this._updateManipulatorPositions(e.vertices)),{onListenerAdd:()=>this._recreateManipulators()}),m((()=>this._operations?.data),"change",(e=>{"undo"!==e.operation&&"redo"!==e.operation||this._recreateManipulators()}))])}destroy(){this._segmentLabels=p(this._segmentLabels),this.tooltip=p(this.tooltip),this._removeManipulators(),this._updatingHandles.destroy()}get updating(){return this._updatingHandles.updating}get manipulators(){return this.tool.manipulators}get view(){return this.tool.view}get object(){return this.tool.object}get enableZShape(){return this.tool.enableZShape}get enableDeleteVertices(){return this.tool.enableDeleteVertices}get enableZVertex(){return this.tool.enableZVertex}get autoHideManipulators(){return this.tool.autoHideManipulators}get enableMoveObject(){return this.tool.enableMoveObject}get enableMidpoints(){return this.tool.enableMidpoints}get enableEdgeOffset(){return this.tool.enableEdgeOffset}get _sketchOptions(){return this.tool.sketchOptions}get _accentColor(){return this.view.effectiveTheme.accentColor}enterInputModeIfAvailable(e){if("key-down"!==e.type||e.key!==xe.enterInputMode)return!1;if("reshape-edge-offset"===this.activeTooltipInfo?.type)return this._enterInputModeDuringEdgeOffset(e);return!(this._numGrabbing+this._numDragging>0)&&Ie(e,this.tooltip)}removeSelectedVertices(){const e=this._manipulatorInfos.filter((e=>e.manipulator.selected&&"vertex"===e.type));return this._removeVertices(e),e.length}onManipulatorSelectionChanged(){this.events.emit("manipulators-changed")}_removeManipulators(){this._manipulatorHandles.removeAll(),this._moveManipulation=p(this._moveManipulation),this._objectMoveManipulation=p(this._objectMoveManipulation),this.manipulators.removeAll(),this._manipulatorInfos=[],this._numGrabbing=0,this._numDragging=0}_createManipulators(e){if(null==this._operations)return;const t=this.object.elevationInfo;for(const i of this._operations.data.components){const a=e?.byComponentIndex.get(i.index);for(const e of i.vertices){const i=a?.has(e.index);this._createVertexOrEdgeManipulator(e,t,i)}for(const e of i.edges)this._createVertexOrEdgeManipulator(e,t)}this._createObjectMoveManipulation(),this._createMoveManipulation(t),this._createVisualElements()}get canRedo(){return null!=this._operations&&this._operations.canRedo}get canUndo(){return null!=this._operations&&this._operations.canUndo}redo(){return this._operations?.redo()}undo(){return this.events.emit("undo"),this._operations?.undo()}_recreateManipulators(){if(!this._recreatingManipulators){if(this._recreatingManipulators=!0,this._removeManipulators(),this._resetTooltip(),this._operations&&this._segmentLabels?.context?.editGeometryOperations===this._operations||(this._segmentLabels=p(this._segmentLabels)),this._createManipulators(),!this._segmentLabels&&this._operations){const e=this._sketchOptions.labels;this._segmentLabels=new R({context:{view:this.view,editGeometryOperations:this._operations,elevationInfo:this.object.elevationInfo,labelOptions:e},visible:e.enabled})}this._recreatingManipulators=!1}}_perObjectManipulatorDragAction(e,t){if("end"===t.action)return t;let i=0;const a=[],n=this._manipulatorInfos.some((e=>"vertex"===e.type&&e.manipulator.selected)),o=e===Ne.SELECTED_OR_ALL&&n;for(const s of this._manipulatorInfos)"vertex"===s.type&&(s.manipulator.grabbing||o&&!s.manipulator.selected||a.push(s),i++);this._moveVertices(a,t);if(a.length===i){if(this._updateEventState(Ue.MOVING),this.destroyed)return t;this.events.emit("move",{type:"move",dx:t.screenDeltaX,dy:t.screenDeltaY,object:this.object})}else{if(this._updateEventState(Ue.RESHAPING),this.destroyed)return t;this.events.emit("reshape",{type:"reshape",object:this.object})}return t}_toggleAutoHideManipulators(e){this.autoHideManipulators&&(e?this.removeHandles(Se):this.tool.manipulators.forEach((({manipulator:e})=>{const t=e.disableDisplay?.();t&&this.addHandles(t,Se)})))}_isMultiVertexSelection(){return this._manipulatorInfos.reduce(((e,t)=>"vertex"===t.type&&t.manipulator.selected?e+1:e),0)>1}_perVertexManipulatorDragAction(e){if(this._updateEventState(Ue.RESHAPING),this.destroyed)return;const{mapDeltaX:t,mapDeltaY:i,mapDeltaZ:a}=e;if(!t&&!i&&!a)return;const n=[];for(const o of this._manipulatorInfos)"vertex"===o.type&&(o.manipulator.selected&&!o.manipulator.grabbing||o===e.info)&&n.push(o);this._moveVertices(n,e,ye.ACCUMULATE_STEPS),this.events.emit("reshape",{type:"reshape",object:this.object})}_updateEventState(e){if(e===this._reshapeEventState)return!1;switch(e){case Ue.NONE:if(0!==this._numGrabbing||0!==this._numDragging)return!1;switch(this._reshapeEventState){case Ue.MOVING:this.events.emit("move",{type:"move-stop",dx:0,dy:0,object:this.object});break;case Ue.RESHAPING:this.events.emit("reshape",{type:"reshape-stop",object:this.object})}break;case Ue.MOVING:switch(this._reshapeEventState){case Ue.NONE:this.events.emit("move",{type:"move-start",dx:0,dy:0,object:this.object});break;case Ue.RESHAPING:this.events.emit("reshape",{type:"reshape-stop",object:this.object}),this.destroyed||this.events.emit("move",{type:"move-start",dx:0,dy:0,object:this.object})}break;case Ue.RESHAPING:switch(this._reshapeEventState){case Ue.NONE:this.events.emit("reshape",{type:"reshape-start",object:this.object});break;case Ue.MOVING:this.events.emit("move",{type:"move-stop",dx:0,dy:0,object:this.object}),this.destroyed||this.events.emit("reshape",{type:"reshape-start",object:this.object})}}if(this.destroyed)return!1;const t=this._reshapeEventState!==e;return this._reshapeEventState=e,t}_createObjectMoveManipulation(){const{tool:e,view:t,object:i,_operations:a}=this;if(a){if(this._objectMoveManipulation=new ee({tool:e,view:t,object:i}),this.enableMoveObject){let e=null;this._manipulatorHandles.add(this._objectMoveManipulation.createDragPipeline(((t,i,n)=>{i.next((e=>this._trackNumDragging(e))).next((t=>("start"===t.action&&(e=a.createUndoGroup()),t))).next((e=>this._perObjectManipulatorDragAction(Ne.ALL,e))).next((e=>(this._updateTranslateObjectTooltip(Q.XY,e),e))).next((t=>{"end"===t.action&&(this._resetTooltip(),e=d(e))})),n.next((()=>this._onDragCancel(!0,(()=>e=d(e)))))}))),this._objectMoveManipulation.forEachManipulator((e=>this._manipulatorHandles.add(this._watchAndUpdateGrabState(e,!1))))}else this._objectMoveManipulation.forEachManipulator((e=>{e.grabbable=!1,e.cursor=null}));this._objectMoveManipulation.forEachManipulator((e=>this._manipulatorHandles.add(e.events.on("immediate-click",(e=>{this._manipulatorInfos.some((e=>e.manipulator.selected))?this._clearSelection():this.events.emit("immediate-click",{...e,object:this.object}),e.stopPropagation()})))))}}_createMoveManipulation(e){const{object:t,tool:i,view:a,_operations:n}=this;if(!n)return;this._moveManipulation=new $({tool:i,view:a,xyAvailable:!0,xyAxisAvailable:!0,zAvailable:this.enableZShape&&W(t.operations,t.elevationInfo),snapToScene:!1,radius:$.radiusForSymbol(t.graphic?.symbol)}),this._moveManipulation.forEachManipulator((e=>this.addHandles([e.events.on("immediate-click",(t=>{this._moveManipulation.zManipulation.hasManipulator(e)||this._manipulatorInfos.some((e=>e.manipulator.selected))||this.events.emit("immediate-click",{...t,object:this.object}),t.stopPropagation()})),this._watchAndUpdateGrabState(e,!1)])));const o=e=>t=>{this.addHandles(t.events.on("focus-changed",(({action:t})=>{"focus"===t?this._updateTranslateTooltip(e):this._resetTooltip()})))};this._moveManipulation.xyManipulation.forEachManipulator(o(Q.XY)),this._moveManipulation.xyAxisManipulation.forEachManipulator(o(Q.XY_AXIS)),this._moveManipulation.zManipulation.forEachManipulator(o(Q.Z)),this._moveManipulation.elevationInfo={mode:"absolute-height",offset:0};const s=n.data.spatialReference;this.addHandles([this._moveManipulation.createDragPipeline(((a,o,s,r,l)=>{const{snappingStep:p,cancelSnapping:d}=Ee({predicate:e=>!!e.info,snappingManager:i.snappingManager,snappingContext:new Oe({editGeometryOperations:n,elevationInfo:e,pointer:l,excludeFeature:t.graphic,visualizer:new F}),updatingHandles:this._updatingHandles,useZ:!1});return r=r.next((e=>(this._onDragCancel(),e))).next(d),{steps:s=s.next((e=>this._trackNumDragging(e))).next((e=>{const t=this._manipulatorInfos.filter((e=>"vertex"===e.type&&e.manipulator.selected));return e.manipulatorType===q.TRANSLATE_XY&&1===t.length?{...e,info:t[0],snapOrigin:t[0].handle.pos}:e})).next(me(this.view,e,t.graphic??void 0)).next(...p).next(ge()).next((e=>this._perObjectManipulatorDragAction(Ne.SELECTED_OR_ALL,e))).next((e=>(this._updateTranslateTooltip(a,e),e))),cancel:r}}),e,s,t.graphic),u((()=>t.visible),(()=>this._updateMoveManipulationPosition()),c),t.on("committed",(()=>{this._recreatingManipulators||this._updateMoveManipulationPosition()})),u((()=>t.isDraped),(e=>{this._updateMoveManipulationPosition();const t="align-move-manipulation";e?this.addHandles(this.view.elevationProvider.on("elevation-change",(()=>this._updateMoveManipulationPosition())),t):this.removeHandles(t)}),c)])}_createVisualElements(){const{object:e,view:t}=this,i=B({view:t,object:e,forEachManipulator:e=>{if(!this.destroyed&&!this._recreatingManipulators){this._objectMoveManipulation.forEachManipulator(e),this._moveManipulation.forEachManipulator(e);for(const t of this._manipulatorInfos)e(t.manipulator,q.TRANSLATE_XY)}},onManipulatorsChanged:e=>this.events.on("manipulators-changed",e)});null!=i&&(this._outlineVisualElement=i.visualElement instanceof de?i.visualElement:null);const a=this._outlineVisualElement;if(null!=a){const t=()=>{e.isDraped||this._updateMoveManipulationPosition()};this._manipulatorHandles.add(m((()=>a.events),"attachment-origin-changed",t,{onListenerAdd:t}))}this._manipulatorHandles.add(i)}_createEdgeOffsetManipulator(e,t=this.object.elevationInfo){const i=this.view,a=this._operations;if(e.component.vertices.length<=2||!a)return null;const n=a.data.spatialReference,o=this._settings.manipulators.edgeOffset,r=o.size/2,l=r+o.collisionPadding,p=r/l,d=p/2,h=p*Math.sqrt(3)/2,{height:u,offset:c}=o,m=this._edgeOffsetManipulatorMaterial;if(!this._edgeOffsetManipulatorGeometryInside){const e=he(m,h,d,d,u,c);this._edgeOffsetManipulatorGeometryInside=e}if(!this._edgeOffsetManipulatorGeometryOutside){const e=he(m,-h,d,d,u,-c);this._edgeOffsetManipulatorGeometryOutside=e}const g=[new k(this._edgeOffsetManipulatorGeometryInside.instantiate(),be.Unfocused),new k(this._edgeOffsetManipulatorGeometryInside.instantiate({material:this._edgeOffsetManipulatorHoverMaterial}),be.Focused),new k(this._edgeOffsetManipulatorGeometryOutside.instantiate(),be.Unfocused),new k(this._edgeOffsetManipulatorGeometryOutside.instantiate({material:this._edgeOffsetManipulatorHoverMaterial}),be.Focused)],f=new L({view:i,renderObjects:g,elevationInfo:"on-the-ground"!==t.mode||P(this.object.graphic?.symbol)?{mode:"absolute-height",offset:0}:t,worldOriented:!1,focusMultiplier:1,radius:l,available:this.object.visible,collisionType:{type:"disc",direction:H(0,0,1)},collisionPriority:1,metadata:{deleting:!1},location:Ae(n)}),_=new L({view:i,worldSized:!0,worldOriented:!1,available:this.object.visible,collisionPriority:-10,cursor:this.enableMoveObject?"move":"default",metadata:{deleting:!1},location:Ae(n)}),v={manipulator:f,handle:e,locationUpdateHandle:null,type:"edge",selectedIndex:0,edgeManipulator:_,visibilityHandle:null};this._autoHideEdgeOffsetManipulator(v,o.minSquaredEdgeLength);const M=()=>this._updateEdgeOffsetManipulator(v);M(),v.locationUpdateHandle=s([e.leftVertex,e.rightVertex].map((e=>{const t=this._getManipulatorInfoFromHandle(e);return t?.manipulator.events.on("location-update",M)})));const b=e=>{this._manipulatorInfos.some((e=>e.manipulator.selected))?this._clearSelection():this.events.emit("immediate-click",{...e,object:this.object}),e.stopPropagation()},x=({action:e})=>{"focus"===e?this._updateEdgeOffsetTooltip(null):this._resetTooltip()};return this._manipulatorHandles.add([v.locationUpdateHandle,this._watchAndUpdateGrabState(f,!0),this._watchAndUpdateGrabState(_,!0),fe(f,this._createEdgeOffsetPipeline(v,t,a)),fe(_,this._createEdgePipeline(v,t,a)),_.events.on("immediate-click",b),f.events.on("immediate-click",b),f.events.on("focus-changed",x)],f),this._manipulatorInfos.push(v),this.manipulators.addMany([f,_]),this.events.emit("manipulators-changed"),v}_autoHideEdgeOffsetManipulator(e,t){const i=e.manipulator,a=e.edgeManipulator,n=()=>{e.visibilityHandle=d(e.visibilityHandle);const n=this._getManipulatorInfoFromHandle(e.handle.leftVertex),o=this._getManipulatorInfoFromHandle(e.handle.rightVertex),l=null!=n&&null!=o&&oe(n.manipulator.renderLocation,o.manipulator.renderLocation,this.view.state.camera)<t;(!i.focused&&!a.focused||l)&&(i.grabbable=!l,a.grabbable=!l,e.visibilityHandle=s([i.disableDisplay(),r((()=>{i.grabbable=!0,a.grabbable=this.enableMoveObject}))]))};this._manipulatorHandles.add([i.events.on("focus-changed",n),a.events.on("focus-changed",n),r((()=>{d(e.visibilityHandle),a.metadata.deleting=!0,this.manipulators.remove(a)}))],i),n()}_updateEdgeOffsetManipulator(e){if(!this._operations)return;this._updateManipulatorPosition(e);const{coordinateHelper:t}=this._operations.data,i=te(this.view,e.manipulator.elevationAlignedLocation,ie(t,e.handle,e.manipulator.elevationInfo)),a=this._getManipulatorInfoFromHandle(e.handle.leftVertex),n=this._getManipulatorInfoFromHandle(e.handle.rightVertex);if(null==a||null==n)return;const o=a.manipulator.renderLocation,s=n.manipulator.renderLocation,r=null!=i?ae(i,o,s):x;e.manipulator.modelTransform=r,e.edgeManipulator.elevationAlignedLocation=e.manipulator.elevationAlignedLocation,e.edgeManipulator.modelTransform=r;const l=y(O(Pe,o,s))/2;e.edgeManipulator.collisionType={type:"line",paths:[[[-l,0,0],[l,0,0]]]}}_createEdgePipeline(e,t,i){return(a,n,o,s)=>{if("touch"===s){this._createEdgeOffsetPipeline(e,t,i)(a,n,o)}else if(this.enableMoveObject){const e=this.object.graphic,s=i.data.spatialReference,{elevationAlignedLocation:r}=a;n.next((e=>this._trackNumDragging(e))).next(_e(this.view,r)).next(z(this.view,r,t,s,e)).next(ve()).next(ge()).next((e=>this._perObjectManipulatorDragAction(Ne.ALL,e))).next((e=>(this._updateTranslateObjectTooltip(Q.XY,e),e))).next((e=>{"end"===e.action&&this._resetTooltip()})),o.next((()=>this._onDragCancel(!a.metadata.deleting)))}}}_createEdgeOffsetPipeline(e,t,i){return(a,n,o)=>{this._clearSelection();const{initializeStep:s,cleanup:r}=this._initializeEdgeOffset(e,t,i,o),l=this._applyEdgeOffsetStep(e);n.next((e=>this._trackNumDragging(e))).next(_e(this.view,a.elevationAlignedLocation)).next(s).next(Z(this.view)).next(X(this.view,i.data.spatialReference)).next(ge()).next(we()).next((e=>this._pendingEdgeOffsetInfo?e:l(e))).next((e=>{"end"!==e.action||this._pendingEdgeOffsetInfo||r()})),o.next((()=>{this._pendingEdgeOffsetInfo=null,a.metadata.deleting||(r(),this._onDragCancel())}))}}_initializeEdgeOffset(e,t,i,a){const{view:n,object:o}=this,r=ie(i.data.coordinateHelper,e.handle,t),l=i.createUndoGroup(),p=te(n,e.manipulator.elevationAlignedLocation,r);if(r.requiresSplitEdgeLeft){const t=this._getManipulatorInfoFromHandle(e.handle.leftVertex.leftEdge);null!=t&&this._splitEdgeManipulator(t,1)}if(r.requiresSplitEdgeRight){const t=this._getManipulatorInfoFromHandle(e.handle.rightVertex.rightEdge);null!=t&&this._splitEdgeManipulator(t,0)}let h;const u=()=>{this._cleanEdgeOffsetCollapsedEdges(e),h=d(h)},c=this.events.on("undo",u);return h=s([this._initializeEdgeOffsetVisualElement(e,o,t,i),l,c,this._connectEdgeOffsetTooltip(e,r,(()=>{a.execute({action:"cancel"})}))]),{initializeStep:e=>null==r||null==p?(u(),null):{...e,operation:r,plane:p},cleanup:u}}_initializeEdgeOffsetVisualElement(e,t,i,n){const o=()=>new A({paths:[[e.handle.leftVertex.pos,e.handle.rightVertex.pos]],spatialReference:n.data.spatialReference}),r=new de({view:this.view,isDraped:t.isDraped,geometry:o(),elevationInfo:i,width:this._settings.visualElements.lineObjects.outline.width,attached:!1,isDecoration:!0}),p=s([u((()=>({color:this._accentColor,draped:t.isDraped})),(({color:e,draped:t})=>{r.color=a(e),r.isDraped=t}),g),t.on("committed",(()=>{r.geometry=o()})),l(r)]);return r.attached=!0,p}_applyEdgeOffsetStep(e){return t=>(this.destroyed||null==t.operation||!this._operations||(this._updateEventState(Ue.RESHAPING),null==t.signedDistance?this._resetTooltip():((t.mapDeltaX||t.mapDeltaY||t.mapDeltaZ)&&(this._offsetEdge(e,t.operation,t.signedDistance),this.events.emit("reshape",{type:"reshape",object:this.object})),this._updateEdgeOffsetTooltip(t))),t)}_cleanEdgeOffsetCollapsedEdges(e){if(!this._operations)return;const t=e.handle.leftVertex.leftEdge?.leftVertex,i=e.handle.leftVertex,a=e.handle.rightVertex.rightEdge?.rightVertex,n=e.handle.rightVertex,o=this._operations.data.coordinateHelper,s=this.view.pixelSizeAt(o.vectorToDehydratedPoint(i.pos),o.spatialReference),r=[];if(t&&o.distance(t.pos,i.pos)<Le){const e=this._getManipulatorInfoFromHandle(i);null!=e&&r.push(e)}if(o.distance(i.pos,n.pos)<s||a&&o.distance(a.pos,n.pos)<Le){const e=this._getManipulatorInfoFromHandle(n);null!=e&&r.push(e)}r.length&&this._removeVertices(r)}_enterInputModeDuringEdgeOffset(e){const t=this._manipulatorInfos.filter(Ge).find((({manipulator:e})=>e.hovering||e.grabbing||e.dragging));return!!t&&(!!Ie(e,this.tooltip)&&(this._clearSelection(),this._pendingEdgeOffsetInfo=t,t.manipulator.grabbing||t.manipulator.dragging||this._connectEdgeOffsetTooltipOnHover(t),!0))}_connectEdgeOffsetTooltipOnHover(e){const{_operations:t,object:i,view:a}=this;if(!t)return;const{elevationInfo:n}=i,{coordinateHelper:o,spatialReference:s}=t.data,l=ie(o,e.handle,n),p=a.inputManager?.latestPointerLocation,d=ne(a,p,s);d&&l.selectArrowFromStartPoint(d),this.addHandles([this._initializeEdgeOffsetVisualElement(e,i,n,t),this._connectEdgeOffsetTooltip(e,l,(()=>{this.removeHandles(l),this._pendingEdgeOffsetInfo=null,this._resetTooltip()})),r((()=>this._cleanEdgeOffsetCollapsedEdges(e)))],l)}_connectEdgeOffsetTooltip(e,t,i){const a=()=>this.tooltipInfos.edgeOffset.distance.committed,n=a=>{const n=h(a,"meters")*t.selectedArrow,o=this._operations?.data.spatialReference,s=n/v(o);i(),queueMicrotask((()=>this._offsetEdge(e,t,s)))};return s([f((()=>!this.tooltip.focused),(()=>{const e=a();null!=e?n(e):i()}),_),f(a,n,_)])}_createVertexOrEdgeManipulator(e,t=this.object.elevationInfo,i=!1){const a=this.view,n=this._operations,o=this._settings;if(!n)return null;const r=n.data.type,l=n.data.spatialReference;if("edge"===e.type){if(this.enableEdgeOffset)return this._createEdgeOffsetManipulator(e,t);if(!this.enableMidpoints)return null}if(null==this._vertexManipulatorGeometry||null==this._vertexManipulatorOutlineGeometry){const{size:e,outlineSize:t}=Ve(o.manipulators.vertex);this._vertexManipulatorGeometry=ue(this._vertexManipulatorMaterial,e,16,16),this._vertexManipulatorOutlineGeometry=ue(this._vertexManipulatorOutlineMaterial,t,16,16)}if(null==this._edgeManipulatorGeometry||null==this._edgeManipulatorOutlineGeometry){const{size:e,outlineSize:t}=Ve(o.manipulators.edge);this._edgeManipulatorGeometry=ue(this._edgeManipulatorMaterial,e,16,16),this._edgeManipulatorOutlineGeometry=ue(this._edgeManipulatorOutlineMaterial,t,16,16)}const p="point"===r||"mesh"===r?[]:[new k(this._vertexManipulatorGeometry.instantiate(),Ce.Vertex|be.Unselected),new k(this._vertexManipulatorOutlineGeometry.instantiate(),Ce.Vertex|be.Unfocused|be.Unselected),new k(this._vertexManipulatorOutlineGeometry.instantiate({material:this._vertexManipulatorHoverOutlineMaterial}),Ce.Vertex|be.Focused|be.Unselected),new k(this._vertexManipulatorGeometry.instantiate({material:this._selectedManipulatorMaterial}),be.Selected),new k(this._vertexManipulatorOutlineGeometry.instantiate({material:this._selectedManipulatorOutlineMaterial}),be.Selected|be.Unfocused),new k(this._vertexManipulatorOutlineGeometry.instantiate({material:this._selectedManipulatorHoverOutlineMaterial}),be.Selected|be.Focused)];this.enableMidpoints&&p.push(new k(this._edgeManipulatorGeometry.instantiate({material:this._vertexManipulatorMaterial}),Ce.Edge|be.Focused|be.Unselected),new k(this._edgeManipulatorOutlineGeometry.instantiate({material:this._vertexManipulatorHoverOutlineMaterial}),Ce.Edge|be.Focused|be.Unselected),new k(this._edgeManipulatorGeometry.instantiate(),Ce.Edge|be.Unfocused|be.Unselected),new k(this._edgeManipulatorOutlineGeometry.instantiate(),Ce.Edge|be.Unfocused|be.Unselected));const h=new L({view:a,renderObjects:p,elevationInfo:t,focusMultiplier:1,touchMultiplier:1,available:this.object.visible,metadata:{deleting:!1},location:Ae(l)});h.selected=i,this._setTypeSpecificManipulatorSettings(h,e,t);const u="edge"===e.type?{manipulator:h,handle:e,locationUpdateHandle:null,type:"edge",selectedIndex:0}:{manipulator:h,handle:e,type:"vertex",selectedIndex:0};if(this._manipulatorInfos.push(u),this.manipulators.add(h),this._updateManipulatorPosition(u),"edge"===u.type){const e=[];for(const t of[u.handle.leftVertex,u.handle.rightVertex]){const i=this._getManipulatorInfoFromHandle(t);null!=i&&e.push(i.manipulator.events.on("location-update",(()=>this._updateManipulatorPosition(u))))}u.locationUpdateHandle=s(e),this._manipulatorHandles.add(u.locationUpdateHandle,h)}this._manipulatorHandles.add(this._watchAndUpdateGrabState(h,!0),h);const c=fe(h,((e,i,o,s)=>{let r=null;const{snappingStep:p,cancelSnapping:h}=Ee({predicate:()=>!this._isMultiVertexSelection(),snappingManager:this.tool.snappingManager,snappingContext:new Oe({editGeometryOperations:n,elevationInfo:t,pointer:s,excludeFeature:this.object.graphic,visualizer:new F}),updatingHandles:this._updatingHandles,useZ:!1});o=o.next((t=>(this._onDragCancel(!e.metadata.deleting,(()=>r=d(r))),t))).next(h);const{elevationAlignedLocation:c}=e,m=this.object.graphic??void 0;i.next((e=>this._trackNumDragging(e))).next((e=>{if("start"===e.action&&n&&(r=n.createUndoGroup()),"edge"===u.type){const t=this._splitEdgeManipulator(u);return{...e,info:t,snapOrigin:t.handle.pos}}return{...e,info:u,snapOrigin:u.handle.pos}})).next(_e(a,c)).next(z(a,c,t,l,m)).next(me(a,t,m)).next(...p).next(ge()).next((e=>{this._perVertexManipulatorDragAction(e),"end"===e.action&&(r=d(r)),this._resetTooltip()}))}));return this._manipulatorHandles.add([c,h.events.on("immediate-click",(e=>this._manipulatorClickCallback(e,u))),h.events.on("select-changed",(()=>{u.selectedIndex=++this._selectedIndex,this._updateMoveManipulationPosition(),this._resetTooltip()})),h.events.on("focus-changed",(()=>{this._resetTooltip()}))],h),this.events.emit("manipulators-changed"),u}_trackNumDragging(e){switch(e.action){case"start":this._numDragging++;break;case"end":this._numDragging--}return e}_onDragCancel(e=!0,t){switch(this._numDragging--,e&&this.undo(),this.tool.snappingManager?.doneSnapping(),this._resetTooltip(),this._reshapeEventState){case Ue.NONE:break;case Ue.MOVING:this.events.emit("move",{type:"move",dx:0,dy:0,object:this.object});break;case Ue.RESHAPING:this.events.emit("reshape",{type:"reshape",object:this.object})}t?.(),this.destroyed||this._updateEventState(Ue.NONE)}_setTypeSpecificManipulatorSettings(e,t,i){const a=this._settings;switch(t.type){case"vertex":{e.state=Ce.Vertex,e.selectable=!0,e.cursor="move",e.collisionPriority=2;const{size:t,collisionPadding:n}=a.manipulators.vertex;e.radius=t/2+n,e.elevationInfo=i;const o=this._operations?.data.type;e.interactive=null!=o&&"point"!==o&&"mesh"!==o;break}case"edge":{e.state=Ce.Edge,e.selectable=!1,e.cursor="copy",e.collisionPriority=-1;const{size:t,collisionPadding:n}=a.manipulators.edge;e.radius=t/2+n,e.elevationInfo="on-the-ground"!==i.mode||P(this.object.graphic?.symbol)?{mode:"absolute-height",offset:0}:i;break}}}_watchAndUpdateGrabState(e,t){return e.events.on("grab-changed",(i=>this._onGrabStateChanged(e,t,i.action,i.pointerType)))}_onGrabStateChanged(e,t,i,a="mouse"){if(!this._recreatingManipulators){if("start"===i)t&&this._updateSelection(e),this._numGrabbing++;else if(this._numGrabbing--,this._updateEventState(Ue.NONE),this.destroyed)return;this._moveManipulation.interactive=!this._numGrabbing,("touch"!==a||this.enableEdgeOffset)&&(this._manipulatorInfos.forEach((e=>{const{manipulator:t}=e,i=this._operations?.data.type;t.interactive=t.grabbing||!this._numGrabbing&&null!=i&&"point"!==i&&"mesh"!==i,Ge(e)&&(e.edgeManipulator.interactive=e.edgeManipulator.grabbing||!this._numGrabbing)})),this._objectMoveManipulation.forEachManipulator((e=>{e.interactive=e.grabbing||!this._numGrabbing})))}}_clearSelection(){for(const e of this._manipulatorInfos)e.manipulator.grabbing||(e.manipulator.selected=!1)}_updateSelection(e){e.grabbing&&!e.selected&&e.selectable&&(this._clearSelection(),e.selected=!0,this.events.emit("manipulators-changed"))}_removeManipulator(e){null!=e&&(e.manipulator.metadata.deleting=!0,this.manipulators.remove(e.manipulator),this._manipulatorHandles.remove(e.manipulator),i(this._manipulatorInfos,e),this.events.emit("manipulators-changed"),this._resetTooltip())}_getManipulatorInfoFromHandle(e){if(e)for(const t of this._manipulatorInfos)if(e===t.handle)return t;return null}_updateManipulatorPositions(e){for(const t of e)this._updateManipulatorPosition(this._getManipulatorInfoFromHandle(t))}_updateManipulatorPosition(e){const t=this._operations;if(null!=e&&t)if("vertex"===e.type)e.manipulator.location=t.data.coordinateHelper.vectorToDehydratedPoint(e.handle.pos,De),e.manipulator.grabbing&&null!=this._vertexLaserLineVisualElement&&(this._vertexLaserLineVisualElement.visualElement.intersectsWorldUpAtLocation=e.manipulator.renderLocation);else if("edge"===e.type){const i=this._getManipulatorInfoFromHandle(e.handle.leftVertex),a=this._getManipulatorInfoFromHandle(e.handle.rightVertex);if(null==i||null==a)return;const n=i.manipulator,o=a.manipulator;if("on-the-ground"===e.manipulator.elevationInfo?.mode){const i=n.location,a=o.location,s=.5,r=i.x+s*(a.x-i.x),l=i.y+s*(a.y-i.y),p=i.hasZ&&a.hasZ?0:void 0;e.manipulator.location=D(r,l,p,t.data.spatialReference)}else E(Pe,n.renderLocation,o.renderLocation,.5),e.manipulator.renderLocation=Pe}}_splitEdgeManipulator(e,t=.5){const i=this._operations,a=i.splitEdge(e.handle,t).createdVertex;e.locationUpdateHandle=d(e.locationUpdateHandle);const n=this.object.elevationInfo;let o;this.enableEdgeOffset?(this._removeManipulator(e),o=this._createVertexOrEdgeManipulator(a)):(o=e,o.handle=a,o.type="vertex",this._setTypeSpecificManipulatorSettings(e.manipulator,e.handle,n)),a.leftEdge&&this._createVertexOrEdgeManipulator(a.leftEdge),a.rightEdge&&this._createVertexOrEdgeManipulator(a.rightEdge),this._updateManipulatorPosition(o),this.enableEdgeOffset||this._resetTooltip(),this._updateSelection(e.manipulator);const s=this._updateEventState(Ue.RESHAPING),r=i.data.coordinateHelper.vectorToArray(o.handle.pos),l=i.data.components.indexOf(a.component);return this.events.emit("vertex-add",{type:"vertex-add",object:this.object,vertices:[{coordinates:r,componentIndex:l,vertexIndex:a.index}],added:r}),s&&this._updateEventState(Ue.NONE),o}_updateMoveManipulationPosition(){const e=j(Pe,0,0,0);let t=0,i=!1,a=null,n=null;for(const r of this._manipulatorInfos)"vertex"===r.type&&(r.manipulator.selected?(t++,I(e,e,r.manipulator.renderLocation),null==a||r.selectedIndex>a.selectedIndex?(n=a,a=r):(null==n||r.selectedIndex>n.selectedIndex)&&(n=r)):i=!0);const o=this.object,s=this._operations?.data.geometry;if(0===t){const e=o.visible&&this.enableMoveObject;this._moveManipulation.xyManipulation.available=e,this._moveManipulation.xyAxisManipulation.available=e,this._moveManipulation.xyAxisManipulation.orthogonalAvailable=e,this._moveManipulation.zManipulation.available=e&&this.enableZShape&&W(this._operations,o.elevationInfo),this._moveManipulation.angle=Y(s),this._moveManipulation.radius=$.radiusForSymbol(o.graphic?.symbol)}else{const e=o.visible;this._moveManipulation.xyManipulation.available=e,this._moveManipulation.xyAxisManipulation.available=e,this._moveManipulation.zManipulation.available=e&&this.enableZVertex&&W(this._operations,this.object.elevationInfo),this._moveManipulation.xyAxisManipulation.orthogonalAvailable=e&&1!==t;let i=0;if(null!=a){const e=a.handle.pos,t=null!=n?n.handle.pos:a.handle.leftEdge?.leftVertex?a.handle.leftEdge.leftVertex.pos:null,o=null==n&&a.handle.rightEdge?.rightVertex?a.handle.rightEdge.rightVertex.pos:null;t&&o?this._moveManipulation.xyAxisManipulation.available=!1:t?i=Te(t,e):o&&(i=Te(e,o))}this._moveManipulation.angle=i,this._moveManipulation.radius=J}0!==t&&i?(S(e,e,1/t),De.spatialReference=this._operations.data.spatialReference,De.hasZ=!0,this.view.renderCoordsHelper.fromRenderCoords(e,De),this._moveManipulation.elevationAlignedLocation=De):null==this._outlineVisualElement||this.object.isDraped||null==this._outlineVisualElement.attachmentOrigin?N(this._moveManipulation,this.object):this._moveManipulation.elevationAlignedLocation=this._outlineVisualElement.attachmentOrigin}_removeVertices(e){const t=new Array,i=this._operations;if(i){for(const a of e){const e=a.handle.component;if("vertex"===a.type&&i.canRemoveVertex(e)){t.push(a.handle),this._removeManipulator(a),this._removeManipulator(this._getManipulatorInfoFromHandle(a.handle.leftEdge)),this._removeManipulator(this._getManipulatorInfoFromHandle(a.handle.rightEdge));const n=i.removeVertices([a.handle]),o=n.removedVertices?.[0].createdEdge;o?this._createVertexOrEdgeManipulator(o):this.enableEdgeOffset&&e.vertices.length<=2&&this._removeManipulator(this._getManipulatorInfoFromHandle(e.edges[0]))}}if(t.length>0){const e=t.map((e=>{const t=i.data.components.indexOf(e.component);return{coordinates:i.data.coordinateHelper.vectorToArray(e.pos),componentIndex:t,vertexIndex:e.index}})),a=this._updateEventState(Ue.RESHAPING);if(this.destroyed)return;if(this.events.emit("vertex-remove",{type:"vertex-remove",object:this.object,removed:e.map((e=>e.coordinates)),vertices:e}),this.destroyed)return;if(a&&(this._updateEventState(Ue.NONE),this.destroyed))return;this._updateMoveManipulationPosition()}}}_moveVertices(e,t,i=("start"===t.action?ye.NEW_STEP:ye.ACCUMULATE_STEPS)){const a=this._operations;if(a){e.length>0&&a.moveVertices(e.map((e=>e.handle)),t.mapDeltaX,t.mapDeltaY,t.mapDeltaZ,i);for(const t of e)this._updateManipulatorPosition(t)}}_offsetEdge(e,t,i){if(!this._operations)return;const a=t.clone();a.distance=i,this._operations.updateVertices([e.handle.leftVertex,e.handle.rightVertex],a),this._updateManipulatorPosition(this._getManipulatorInfoFromHandle(e.handle.leftVertex)),this._updateManipulatorPosition(this._getManipulatorInfoFromHandle(e.handle.rightVertex))}_manipulatorClickCallback(e,t){e.shiftKey||this._clearSelection(),"vertex"===t.type&&(t.manipulator.selected=!t.manipulator.selected,this.enableDeleteVertices&&e.button===ce.Right&&this._removeVertices([t])),"edge"===t.type&&e.button===ce.Left&&this._splitEdgeManipulator(t),e.stopPropagation()}_updateTranslateTooltip(e,t){null!=this._defaultTooltipInfo?this._resetTooltip():this._updateTranslateObjectTooltip(e,t)}_updateTranslateObjectTooltip(e,t){this._pendingEdgeOffsetInfo||(this.activeTooltipInfo=le(e,t,this._tooltipsContext))}_updateEdgeOffsetTooltip(e){this._pendingEdgeOffsetInfo||(this.activeTooltipInfo=pe(this.object,e,this._tooltipsContext))}_resetTooltip(){this._pendingEdgeOffsetInfo||(this.activeTooltipInfo=this._defaultTooltipInfo)}get _defaultTooltipInfo(){const e=this._operations?.data.type;switch(e){case"polyline":case"polygon":return this._selectedVertexManipulatorInfo?this.tooltipInfos.selectedVertex:null;case"point":case"mesh":return this.tooltipInfos.movePoint;default:return null}}get _selectedVertexManipulatorInfo(){const e=this._manipulatorInfos.filter((e=>"vertex"===e.type&&e.manipulator.selected));return 1===e.length?e[0]:null}get _tooltipsContext(){const{events:e}=this;return{sketchOptions:this._sketchOptions,tooltipInfos:this.tooltipInfos,activeTooltipInfo:this.activeTooltipInfo,selectedVertexManipulatorInfo:this._selectedVertexManipulatorInfo,callbacks:{onReshapeStart:()=>e.emit("reshape",{type:"reshape-start",object:this.object}),onReshape:()=>e.emit("reshape",{type:"reshape",object:this.object}),onReshapeStop:()=>e.emit("reshape",{type:"reshape-stop",object:this.object}),onMoveStart:()=>e.emit("move",{type:"move-start",object:this.object,dx:0,dy:0}),onMove:()=>e.emit("move",{type:"move",object:this.object,dx:0,dy:0}),onMoveStop:()=>e.emit("move",{type:"move-stop",object:this.object,dx:0,dy:0})}}}get test(){}};function we(){return e=>{const{operation:t,mapEnd:i}=e;return null==t||null==i?e:("start"===e.action&&t.selectArrowFromStartPoint(i),{...e,signedDistance:t.signedDistanceToPoint(i)})}}function Ve(e){const t=e.size/2,i=t+e.collisionPadding;return{size:t/i,outlineSize:(t+e.outlineSize)/i}}function Te(e,t){return Math.atan2(t[1]-e[1],t[0]-e[0])+Math.PI/2}function Ae(e){return new T({x:0,y:0,z:0,spatialReference:e})}function Ge(e){return"edge"===e.type&&"edgeManipulator"in e}e([M()],He.prototype,"_numGrabbing",void 0),e([M()],He.prototype,"_numDragging",void 0),e([M()],He.prototype,"_pendingEdgeOffsetInfo",void 0),e([M()],He.prototype,"_operations",null),e([M()],He.prototype,"_segmentLabels",void 0),e([M({constructOnly:!0})],He.prototype,"tool",void 0),e([M()],He.prototype,"tooltip",void 0),e([M()],He.prototype,"activeTooltipInfo",void 0),e([M({readOnly:!0})],He.prototype,"updating",null),e([M()],He.prototype,"manipulators",null),e([M()],He.prototype,"view",null),e([M()],He.prototype,"object",null),e([M()],He.prototype,"enableZShape",null),e([M()],He.prototype,"enableDeleteVertices",null),e([M()],He.prototype,"enableZVertex",null),e([M()],He.prototype,"autoHideManipulators",null),e([M()],He.prototype,"enableMoveObject",null),e([M()],He.prototype,"enableMidpoints",null),e([M()],He.prototype,"enableEdgeOffset",null),e([M()],He.prototype,"_sketchOptions",null),e([M()],He.prototype,"_accentColor",null),e([M()],He.prototype,"_tooltipsContext",null),He=e([b("esri.views.3d.interactive.editingTools.reshape.ReshapeOperation")],He);const De=D(0,0,void 0,G.WGS84),Pe=w(),Le=1e-6;var Ce,Ue,Ne;!function(e){e.Vertex=Me.Custom1,e.Edge=Me.Custom2}(Ce||(Ce={})),function(e){e[e.NONE=0]="NONE",e[e.MOVING=1]="MOVING",e[e.RESHAPING=2]="RESHAPING"}(Ue||(Ue={})),function(e){e[e.ALL=0]="ALL",e[e.SELECTED_OR_ALL=1]="SELECTED_OR_ALL"}(Ne||(Ne={}));export{He as ReshapeOperation};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.31/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../../../chunks/tslib.es6.js";import t from"../../../../../core/Evented.js";import"../../../../../core/has.js";import{destroyMaybe as o}from"../../../../../core/maybe.js";import{property as i}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/Logger.js";import"../../../../../core/RandomLCG.js";import{subclass as n}from"../../../../../core/accessorSupport/decorators/subclass.js";import{ReshapeOperation as r}from"./ReshapeOperation.js";import{InteractiveToolBase as s}from"../../../../interactive/InteractiveToolBase.js";import{sketchKeys as p}from"../../../../interactive/keybindings.js";import a from"../../../../interactive/sketch/SketchOptions.js";import{enterInputModeIfAvailable as h}from"../../../../interactive/tooltip/tooltipCommonUtils.js";let l=class extends s{constructor(e){super(e),this.events=new t,this.enableZShape=!0,this.enableZVertex=!0,this.enableMoveObject=!0,this.enableDeleteVertices=!0,this.autoHideManipulators=!1,this.enableMidpoints=!0,this.enableEdgeOffset=!1,this.type="reshape-3d",this.sketchOptions=new a,this.snappingManager=null,this.automaticManipulatorSelection=!1}initialize(){const e=this._reshapeOperation=new r({tool:this});this.addHandles([e.events.on("reshape",(e=>this.events.emit("reshape",e))),e.events.on("move",(e=>this.events.emit("move",e))),e.events.on("vertex-add",(e=>this.events.emit("vertex-add",e))),e.events.on("vertex-remove",(e=>this.events.emit("vertex-remove",e))),e.events.on("immediate-click",(e=>this.events.emit("immediate-click",{...e,object:this.object}))),this.view.on("pointer-down",["Shift"],(e=>e.stopPropagation()))]),this.finishToolCreation()}destroy(){this._reshapeOperation=o(this._reshapeOperation)}get updating(){return((this.object.updating??!1)||this._reshapeOperation?.updating)??!1}get activeTooltipInfo(){return this._reshapeOperation?.activeTooltipInfo??null}get tooltip(){return this._reshapeOperation?.tooltip??null}onManipulatorSelectionChanged(){this._reshapeOperation&&this._reshapeOperation.onManipulatorSelectionChanged()}get canUndo(){return this._reshapeOperation.canUndo??!1}undo(){null!=this.snappingManager&&this.snappingManager.doneSnapping(),this._reshapeOperation.undo()}get canRedo(){return this._reshapeOperation.canRedo??!1}redo(){null!=this.snappingManager&&this.snappingManager.doneSnapping(),this._reshapeOperation.redo()}onInputEvent(e){const t=this._reshapeOperation;if((!t||t.grabbingOrDragging||!h(e,t.tooltip))&&this.enableDeleteVertices&&"key-down"===e.type&&p.delete.includes(e.key)){this._reshapeOperation.removeSelectedVertices()>0&&e.stopPropagation()}}reset(){}get test(){}};e([i()],l.prototype,"_reshapeOperation",void 0),e([i()],l.prototype,"view",void 0),e([i({constructOnly:!0})],l.prototype,"object",void 0),e([i()],l.prototype,"enableZShape",void 0),e([i()],l.prototype,"enableZVertex",void 0),e([i()],l.prototype,"enableMoveObject",void 0),e([i()],l.prototype,"enableDeleteVertices",void 0),e([i()],l.prototype,"autoHideManipulators",void 0),e([i()],l.prototype,"enableMidpoints",void 0),e([i()],l.prototype,"enableEdgeOffset",void 0),e([i()],l.prototype,"type",void 0),e([i({type:a})],l.prototype,"sketchOptions",void 0),e([i()],l.prototype,"snappingManager",void 0),e([i()],l.prototype,"updating",null),e([i()],l.prototype,"activeTooltipInfo",null),e([i()],l.prototype,"tooltip",null),e([i()],l.prototype,"automaticManipulatorSelection",void 0),l=e([n("esri.views.3d.interactive.editingTools.reshape.ReshapeTool3D")],l);export{l as ReshapeTool3D};
5
+ import{_ as e}from"../../../../../chunks/tslib.es6.js";import t from"../../../../../core/Evented.js";import"../../../../../core/has.js";import{destroyMaybe as o}from"../../../../../core/maybe.js";import{property as i}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/Logger.js";import"../../../../../core/RandomLCG.js";import{subclass as n}from"../../../../../core/accessorSupport/decorators/subclass.js";import{ReshapeOperation as r}from"./ReshapeOperation.js";import{InteractiveToolBase as s}from"../../../../interactive/InteractiveToolBase.js";import{sketchKeys as p}from"../../../../interactive/keybindings.js";import a from"../../../../interactive/sketch/SketchOptions.js";let h=class extends s{constructor(e){super(e),this.events=new t,this.enableZShape=!0,this.enableZVertex=!0,this.enableMoveObject=!0,this.enableDeleteVertices=!0,this.autoHideManipulators=!1,this.enableMidpoints=!0,this.enableEdgeOffset=!1,this.type="reshape-3d",this.sketchOptions=new a,this.snappingManager=null,this.automaticManipulatorSelection=!1}initialize(){const e=this._reshapeOperation=new r({tool:this});this.addHandles([e.events.on("reshape",(e=>this.events.emit("reshape",e))),e.events.on("move",(e=>this.events.emit("move",e))),e.events.on("vertex-add",(e=>this.events.emit("vertex-add",e))),e.events.on("vertex-remove",(e=>this.events.emit("vertex-remove",e))),e.events.on("immediate-click",(e=>this.events.emit("immediate-click",{...e,object:this.object}))),this.view.on("pointer-down",["Shift"],(e=>e.stopPropagation()))]),this.finishToolCreation()}destroy(){this._reshapeOperation=o(this._reshapeOperation)}get updating(){return((this.object.updating??!1)||this._reshapeOperation?.updating)??!1}get activeTooltipInfo(){return this._reshapeOperation?.activeTooltipInfo??null}get tooltip(){return this._reshapeOperation?.tooltip??null}onManipulatorSelectionChanged(){this._reshapeOperation&&this._reshapeOperation.onManipulatorSelectionChanged()}get canUndo(){return this._reshapeOperation.canUndo??!1}undo(){null!=this.snappingManager&&this.snappingManager.doneSnapping(),this._reshapeOperation.undo()}get canRedo(){return this._reshapeOperation.canRedo??!1}redo(){null!=this.snappingManager&&this.snappingManager.doneSnapping(),this._reshapeOperation.redo()}onInputEvent(e){if(!this._reshapeOperation?.enterInputModeIfAvailable(e)&&this.enableDeleteVertices&&"key-down"===e.type&&p.delete.includes(e.key)){this._reshapeOperation.removeSelectedVertices()>0&&e.stopPropagation()}}reset(){}get test(){}};e([i()],h.prototype,"_reshapeOperation",void 0),e([i()],h.prototype,"view",void 0),e([i({constructOnly:!0})],h.prototype,"object",void 0),e([i()],h.prototype,"enableZShape",void 0),e([i()],h.prototype,"enableZVertex",void 0),e([i()],h.prototype,"enableMoveObject",void 0),e([i()],h.prototype,"enableDeleteVertices",void 0),e([i()],h.prototype,"autoHideManipulators",void 0),e([i()],h.prototype,"enableMidpoints",void 0),e([i()],h.prototype,"enableEdgeOffset",void 0),e([i()],h.prototype,"type",void 0),e([i({type:a})],h.prototype,"sketchOptions",void 0),e([i()],h.prototype,"snappingManager",void 0),e([i()],h.prototype,"updating",null),e([i()],h.prototype,"activeTooltipInfo",null),e([i()],h.prototype,"tooltip",null),e([i()],h.prototype,"automaticManipulatorSelection",void 0),h=e([n("esri.views.3d.interactive.editingTools.reshape.ReshapeTool3D")],h);export{h as ReshapeTool3D};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.31/esri/copyright.txt for details.
4
4
  */
5
- import{createRenderScreenPointArray3 as e}from"../../../../../core/screenUtils.js";import{fromValues as r}from"../../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{b as o,E as n,q as t,f as s}from"../../../../../chunks/vec32.js";import{create as c}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{getNormal as i,fromPositionAndNormal as l,create as d}from"../../../../../geometry/support/plane.js";import{makeDehydratedPoint as f}from"../../../../../layers/graphics/dehydratedPoint.js";import{PlaneType as u,OffsetEdgeVertex as a}from"../../../../interactive/editGeometry/operations/OffsetEdgeVertex.js";function m(e,r,o){const n="on-the-ground"===o.mode?u.XY:u.XYZ;return new a(e,n,r,0)}function p(e,r,n){const t=c();if(!e.renderCoordsHelper.toRenderCoords(r,t))return null;const s=j(e,r,i(n.plane)),f=j(e,r,n.edgeDirection);if(null==s||null==f)return null;const u=o(c(),s,f);return l(t,u,d())}function j(e,r,o){const t=f(r.x+o[0],r.y+o[1],r.z+o[2],r.spatialReference),s=c(),i=c();return e.renderCoordsHelper.toRenderCoords(r,s)&&e.renderCoordsHelper.toRenderCoords(t,i)?n(i,s,i):null}function g(e,t,s){const l=i(e),d=n(c(),t,s),f=o(c(),d,l),u=o(c(),d,f);return r(d[0],d[1],d[2],0,f[0],f[1],f[2],0,u[0],u[1],u[2],0,0,0,0,1)}function C(r,o,n){const c=n.projectToRenderScreen(r,e()),i=n.projectToRenderScreen(o,e());return null!=c&&null!=i?t(s(c,c,i)):0}export{p as createEdgeOffsetIntersectionPlane,m as createEdgeOffsetOperation,g as edgeOffsetRotationMatrix,C as screenEdgeLengthSquared};
5
+ import{createRenderScreenPointArray3 as r}from"../../../../../core/screenUtils.js";import{fromValues as e}from"../../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{b as o,E as n,q as t,f as s}from"../../../../../chunks/vec32.js";import{create as i}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{projectPoint as c}from"../../../../../geometry/projection.js";import{getNormal as l,fromPositionAndNormal as u,create as f}from"../../../../../geometry/support/plane.js";import{makeDehydratedPoint as m}from"../../../../../layers/graphics/dehydratedPoint.js";import{PlaneType as p,OffsetEdgeVertex as d}from"../../../../interactive/editGeometry/operations/OffsetEdgeVertex.js";function a(r,e,o){const n="on-the-ground"===o.mode?p.XY:p.XYZ;return new d(r,n,e,0)}function j(r,e,n){const t=i();if(!r.renderCoordsHelper.toRenderCoords(e,t))return null;const s=g(r,e,l(n.plane)),c=g(r,e,n.edgeDirection);if(null==s||null==c)return null;const m=o(i(),s,c);return u(t,m,f())}function g(r,e,o){const t=m(e.x+o[0],e.y+o[1],e.z+o[2],e.spatialReference),s=i(),c=i();return r.renderCoordsHelper.toRenderCoords(e,s)&&r.renderCoordsHelper.toRenderCoords(t,c)?n(c,s,c):null}function y(r,t,s){const c=l(r),u=n(i(),t,s),f=o(i(),u,c),m=o(i(),u,f);return e(u[0],u[1],u[2],0,f[0],f[1],f[2],0,m[0],m[1],m[2],0,0,0,0,1)}function C(e,o,n){const i=n.projectToRenderScreen(e,r()),c=n.projectToRenderScreen(o,r());return null!=i&&null!=c?t(s(i,i,c)):0}function R(r,e,o){if(!e)return null;const n=r.toMap(e);return n&&c(n,n,o)?n:null}export{j as createEdgeOffsetIntersectionPlane,a as createEdgeOffsetOperation,y as edgeOffsetRotationMatrix,C as screenEdgeLengthSquared,R as screenToMap};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.31/esri/copyright.txt for details.
4
4
  */
5
- import{handlesGroup as t}from"../../../../../core/handleUtils.js";import{zeroMeters as e,createLength as o,scale as i}from"../../../../../core/quantityUtils.js";import{watch as n,syncAndInitial as a,sync as s}from"../../../../../core/reactiveUtils.js";import{getMetersPerUnitForSR as r}from"../../../../../core/unitUtils.js";import{projectPoint as p}from"../../../../../geometry/support/plane.js";import{sv3d as l}from"../../../../../geometry/support/vectorStacks.js";import{manipulatedObjectGeometry as c}from"../manipulatedObjectUtils.js";import{updateXYZFromTooltipInfo as m,updateTooltipInfoFromManipulatedObject as f,updateElevationFromPoint as u}from"../tooltipUtils3D.js";import{ManipulationType as v}from"../manipulations/MoveManipulation.js";import{axisConstrainedDragSign as y}from"../manipulations/moveUtils.js";import{AccumulationBehavior as d}from"../../../../interactive/editGeometry/interfaces.js";import{connectPasteEvent as h,getXYZDeltasFromTooltipInfo as g}from"../../../../interactive/tooltip/tooltipCommonUtils.js";import{MovePointTooltipInfo as k}from"../../../../interactive/tooltip/infos/MovePointTooltipInfo.js";import{ReshapeEdgeOffsetTooltipInfo as T}from"../../../../interactive/tooltip/infos/ReshapeEdgeOffsetTooltipInfo.js";import{SelectedVertexTooltipInfo as j}from"../../../../interactive/tooltip/infos/SelectedVertexTooltipInfo.js";import{TranslateTooltipInfo as I}from"../../../../interactive/tooltip/infos/TranslateTooltipInfo.js";import{TranslateXYTooltipInfo as w}from"../../../../interactive/tooltip/infos/TranslateXYTooltipInfo.js";import{TranslateZTooltipInfo as O}from"../../../../interactive/tooltip/infos/TranslateZTooltipInfo.js";import{autoArea2D as b}from"../../../../support/automaticAreaMeasurementUtils.js";import{autoLength2D as x,autoDistanceBetweenPoints2D as U}from"../../../../support/automaticLengthMeasurementUtils.js";import{verticalSignedDistanceBetweenPoints as M}from"../../../../support/euclideanLengthMeasurementUtils.js";import{geodesicDistance as L}from"../../../../support/geodesicLengthMeasurementUtils.js";function S(t,e){const o=e?.type;return{edgeOffset:new T({sketchOptions:t,viewType:o}),movePoint:new k({sketchOptions:t,viewType:o}),selectedVertex:new j({sketchOptions:t,viewType:o}),translate:new I({sketchOptions:t,viewType:o}),translateXY:new w({sketchOptions:t,viewType:o}),translateZ:new O({sketchOptions:t,viewType:o})}}function X(e,o,i){function r(){const t=i(),e=t.sketchOptions.tooltips.effectiveEnabled?t.activeTooltipInfo:null;return{...t,activeTooltipInfo:e}}let p=!1;function l(t){p=!0,V(o,t),e.info=t.activeTooltipInfo,p=!1}return t([n(r,l,a),n((()=>{const t=r(),{activeTooltipInfo:e}=t;if(e&&"key"in e)return{context:t,activeTooltipInfo:e,key:e.key,geometry:c(o)}}),((t,e)=>{t&&!p&&e&&e.key!==t.key&&E(t.activeTooltipInfo,o,t.context)}),s),o.on("committed",(()=>l(r()))),h(e)])}function E(t,e,{selectedVertexManipulatorInfo:o,callbacks:i}){const n=c(e);switch(n?.type){case"mesh":"move-point"===t.type&&m(t,n.origin,e,i);break;case"point":"move-point"===t.type&&m(t,n,e,i);break;case"polyline":case"polygon":"selected-vertex"===t.type&&R(t,o,e,i)}}function R(t,e,o,i){if("vertex"!==e?.type)return;const{dx:n,dy:a,dz:s}=g(t,e.manipulator.location);0===n&&0===a&&0===s||(i.onReshapeStart?.(),o.operations?.moveVertices([e.handle],n,a,s,d.NEW_STEP),i.onReshape?.(),i.onReshapeStop?.())}function V(t,{activeTooltipInfo:e,selectedVertexManipulatorInfo:o,sketchOptions:i}){if(e)switch(e.sketchOptions=i,e?.type){case"move-point":f(e,t);break;case"selected-vertex":Y(e,o,t)}}function Y(t,e,o){if(!t||"selected-vertex"!==t.type)return;const i=e?.manipulator.location;t.setLocationFromPoint(i),u(t,i,o);const n=o.operations?.data.geometry;switch(n?.type){case"polygon":t.geometryType="polygon",t.totalLength.visible=!1,t.area.actual=b(n);break;case"polyline":t.geometryType="polyline",t.totalLength.actual=x(n),t.area.visible=!1}}function Z(t,e,{sketchOptions:o,tooltipInfos:n}){let a=null;switch(t){case v.XY:a=n.translate,P(a,e,((t,e)=>U(t,e)));break;case v.XY_AXIS:a=n.translateXY,P(a,e,((t,o)=>i(U(t,o),y(e))));break;case v.Z:a=n.translateZ,P(a,e,M)}return a.sketchOptions=o,a}function P(t,o,i){if(null!=o&&"end"!==o.action){const{mapStart:n,mapEnd:a}=o,s=i(n,a);t.distance=null!=s?s:e}else t.distance=e}function A(t,o,{sketchOptions:i,tooltipInfos:n}){const a=n.edgeOffset;if(a.distance.actual=e,null!=o&&"end"!==o.action){const e=t.operations,{mapEnd:i,signedDistance:n,operation:s}=o;if(null!=n&&null!=e){const o=e.data.coordinateHelper,r=n*s.selectedArrow;a.distance.actual=D(t.isDraped,r,i,s.plane,o)}}const s=t.operations?.data.geometry;switch(a.area.actual=null,a.area.visible=!1,a.totalLength.actual=null,a.totalLength.visible=!1,s?.type){case"polygon":a.area.actual=b(s),a.area.visible=!0;break;case"polyline":a.totalLength.actual=x(s),a.totalLength.visible=!0}return a.sketchOptions=i,a}function D(t,e,i,n,a){if(t){const t=a.toXYZ(a.pointToVector(i)),s=p(n,t,l.get()),r=L(s,t,a.spatialReference);if(null!=r)return o(r.value*Math.sign(e),r.unit)}return o(e*r(i.spatialReference),"meters")}export{X as connectTooltipToManipulatedObject,S as createTooltipInfos,A as getUpdatedEdgeOffsetTooltipInfo,Z as getUpdatedTranslateObjectTooltipInfo};
5
+ import{handlesGroup as t}from"../../../../../core/handleUtils.js";import{zeroMeters as e,createLength as o,scale as i}from"../../../../../core/quantityUtils.js";import{watch as n,syncAndInitial as a,sync as s}from"../../../../../core/reactiveUtils.js";import{getMetersPerUnitForSR as r}from"../../../../../core/unitUtils.js";import{projectPoint as l}from"../../../../../geometry/support/plane.js";import{sv3d as p}from"../../../../../geometry/support/vectorStacks.js";import{manipulatedObjectGeometry as c}from"../manipulatedObjectUtils.js";import{updateXYZFromTooltipInfo as m,updateTooltipInfoFromManipulatedObject as f,updateElevationFromPoint as u}from"../tooltipUtils3D.js";import{ManipulationType as v}from"../manipulations/MoveManipulation.js";import{axisConstrainedDragSign as y}from"../manipulations/moveUtils.js";import{AccumulationBehavior as d}from"../../../../interactive/editGeometry/interfaces.js";import{connectPasteEvent as h,getXYZDeltasFromTooltipInfo as g}from"../../../../interactive/tooltip/tooltipCommonUtils.js";import{MovePointTooltipInfo as k}from"../../../../interactive/tooltip/infos/MovePointTooltipInfo.js";import{ReshapeEdgeOffsetTooltipInfo as T}from"../../../../interactive/tooltip/infos/ReshapeEdgeOffsetTooltipInfo.js";import{SelectedVertexTooltipInfo as j}from"../../../../interactive/tooltip/infos/SelectedVertexTooltipInfo.js";import{TranslateTooltipInfo as I}from"../../../../interactive/tooltip/infos/TranslateTooltipInfo.js";import{TranslateXYTooltipInfo as w}from"../../../../interactive/tooltip/infos/TranslateXYTooltipInfo.js";import{TranslateZTooltipInfo as O}from"../../../../interactive/tooltip/infos/TranslateZTooltipInfo.js";import{autoArea2D as b}from"../../../../support/automaticAreaMeasurementUtils.js";import{autoLength2D as x,autoDistanceBetweenPoints2D as U}from"../../../../support/automaticLengthMeasurementUtils.js";import{verticalSignedDistanceBetweenPoints as M}from"../../../../support/euclideanLengthMeasurementUtils.js";import{geodesicDistance as L}from"../../../../support/geodesicLengthMeasurementUtils.js";function S(t,e){const o=e?.type;return{edgeOffset:new T({sketchOptions:t,viewType:o}),movePoint:new k({sketchOptions:t,viewType:o}),selectedVertex:new j({sketchOptions:t,viewType:o}),translate:new I({sketchOptions:t,viewType:o}),translateXY:new w({sketchOptions:t,viewType:o}),translateZ:new O({sketchOptions:t,viewType:o})}}function X(e,o,i){function r(){const t=i(),e=t.sketchOptions.tooltips.effectiveEnabled?t.activeTooltipInfo:null;return{...t,activeTooltipInfo:e}}let l=!1;function p(t){l=!0,V(o,t),e.info=t.activeTooltipInfo,l=!1}return t([n(r,p,a),n((()=>{const t=r(),{activeTooltipInfo:e}=t;if(e&&"key"in e)return{context:t,activeTooltipInfo:e,key:e.key,geometry:c(o)}}),((t,e)=>{t&&!l&&e&&e.key!==t.key&&E(t.activeTooltipInfo,o,t.context)}),s),o.on("committed",(()=>p(r()))),h(e)])}function E(t,e,{selectedVertexManipulatorInfo:o,callbacks:i}){const n=c(e);switch(n?.type){case"mesh":"move-point"===t.type&&m(t,n.origin,e,i);break;case"point":"move-point"===t.type&&m(t,n,e,i);break;case"polyline":case"polygon":"selected-vertex"===t.type&&R(t,o,e,i)}}function R(t,e,o,i){if("vertex"!==e?.type)return;const{dx:n,dy:a,dz:s}=g(t,e.manipulator.location);0===n&&0===a&&0===s||(i.onReshapeStart?.(),o.operations?.moveVertices([e.handle],n,a,s,d.NEW_STEP),i.onReshape?.(),i.onReshapeStop?.())}function V(t,{activeTooltipInfo:e,selectedVertexManipulatorInfo:o,sketchOptions:i}){if(e)switch(e.sketchOptions=i,e?.type){case"move-point":f(e,t);break;case"selected-vertex":Y(e,o,t)}}function Y(t,e,o){if(!t||"selected-vertex"!==t.type)return;const i=e?.manipulator.location;t.setLocationFromPoint(i),u(t,i,o);const n=o.operations?.data.geometry;switch(n?.type){case"polygon":t.geometryType="polygon",t.totalLength.visible=!1,t.area.actual=b(n);break;case"polyline":t.geometryType="polyline",t.totalLength.actual=x(n),t.area.visible=!1}}function Z(t,e,{sketchOptions:o,tooltipInfos:n}){let a=null;switch(t){case v.XY:a=n.translate,P(a,e,((t,e)=>U(t,e)));break;case v.XY_AXIS:a=n.translateXY,P(a,e,((t,o)=>i(U(t,o),y(e))));break;case v.Z:a=n.translateZ,P(a,e,M)}return a.sketchOptions=o,a}function P(t,o,i){if(null!=o&&"end"!==o.action){const{mapStart:n,mapEnd:a}=o,s=i(n,a);t.distance=null!=s?s:e}else t.distance=e}function A(t,o,{sketchOptions:i,tooltipInfos:n}){const a=n.edgeOffset;if(a.distance.actual=e,a.distance.committed=null,null!=o&&"end"!==o.action){const e=t.operations,{mapEnd:i,signedDistance:n,operation:s}=o;if(null!=n&&null!=e){const o=e.data.coordinateHelper,r=n*s.selectedArrow;a.distance.actual=D(t.isDraped,r,i,s.plane,o)}}const s=t.operations?.data.geometry;switch(a.area.actual=null,a.area.visible=!1,a.totalLength.actual=null,a.totalLength.visible=!1,s?.type){case"polygon":a.area.actual=b(s),a.area.visible=!0;break;case"polyline":a.totalLength.actual=x(s),a.totalLength.visible=!0}return a.sketchOptions=i,a}function D(t,e,i,n,a){if(t){const t=a.toXYZ(a.pointToVector(i)),s=l(n,t,p.get()),r=L(s,t,a.spatialReference);if(null!=r)return o(r.value*Math.sign(e),r.unit)}return o(e*r(i.spatialReference),"meters")}export{X as connectTooltipToManipulatedObject,S as createTooltipInfos,A as getUpdatedEdgeOffsetTooltipInfo,Z as getUpdatedTranslateObjectTooltipInfo};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.31/esri/copyright.txt for details.
4
4
  */
5
- import{on as s}from"../../../../../../core/reactiveUtils.js";import{getMetersPerCartesianUnitForSR as t,getMetersPerUnitForSR as o}from"../../../../../../core/unitUtils.js";import{scale as i}from"../../../../../../core/libs/gl-matrix-2/math/vec2.js";import{g as e,f as a,o as n,b as r,n as p,j as d,m as c,l,r as u}from"../../../../../../chunks/vec32.js";import{create as m}from"../../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{a as g,c as h,u as b}from"../../../../../../chunks/boundedPlane.js";import{sv3d as f}from"../../../../../../geometry/support/vectorStacks.js";import{mainAxis as B}from"../../geometryUtils.js";import{manipulatedObjectGeometry as j}from"../../manipulatedObjectUtils.js";import{evaluateElevationAlignmentAtPoint as y}from"../../../../layers/graphics/elevationAlignmentUtils.js";import{ElevationContext as v}from"../../../../layers/graphics/ElevationContext.js";import{apply as _,applyInverse as R,calculateOrientedBounds as C}from"../../../../../interactive/editGeometry/support/editPlaneUtils.js";import{autoSize2D as M}from"../../../../../support/extentUtils.js";class x{constructor(t,o){this._tool=t,this.mapBounds=g(),this.mapBoundsStart=g(),this.displayBounds=g(),t.addHandles(s((()=>t.object),"modified-externally",(()=>this._resetMapBounds()),{onListenerAdd:()=>this._resetMapBounds()})),this._onDisplayBoundsChanged=o}get displayBoundsMargin(){const{view:s,object:t}=this._tool,o=j(t),i=s.pointsOfInterest?.centerOnSurfaceFrequent.location??o?.extent?.center;return i?D*s.pixelSizeAt(i):0}backupMapBounds(){h(this.mapBounds,this.mapBoundsStart)}updateDisplayBounds(){this._calculateDisplayBounds(),this._onDisplayBoundsChanged?.()}updateMapBoundsFromOperation(s){_(s,this.mapBounds),this.updateDisplayBounds()}updateMapBoundsFromOperationInverse(s){R(s,this.mapBounds),this.updateDisplayBounds()}_resetMapBounds(){this._calculateMapBounds(),this.updateDisplayBounds()}_calculateMapBounds(){const{view:s,attachmentOrigin:e,object:a}=this._tool,n=a.operations?.data;if(!n)return;const r=n.geometry;this.spatialReference=r.spatialReference;const p=B(r);i(p,p,-1);const d=s.spatialReference,c=r.spatialReference,l=e?s.pixelSizeAt(e)*t(d)/o(c):0;C(p,n,O*l,this.mapBounds)}_calculateDisplayBounds(){const{view:s,attachmentOrigin:t}=this._tool,o=t?.z??y(this.mapBounds.origin,s.elevationProvider,v.fromElevationInfo(this._tool.object.elevationInfo),s.renderCoordsHelper),i=h(this.mapBounds);i.origin[2]=o??0,U(i,s.renderCoordsHelper,this.spatialReference,this.displayBoundsMargin,this.displayBounds)}}const D=10,O=80;function U(s,t,o,i=0,u){u||(u=g()),t.toRenderCoords(s.origin,o,u.origin);const m=f.get();e(m,s.origin,s.basis1),e(m,m,s.basis2),t.toRenderCoords(m,o,m);const h=f.get();e(h,s.origin,s.basis1),a(h,h,s.basis2),t.toRenderCoords(h,o,h);const B=f.get();a(B,s.origin,s.basis1),a(B,B,s.basis2),t.toRenderCoords(B,o,B);const j=f.get();a(j,s.origin,s.basis1),e(j,j,s.basis2),t.toRenderCoords(j,o,j);const y=n(f.get(),m,h,.5);a(y,y,u.origin);const v=n(f.get(),B,j,.5);a(v,u.origin,v),n(u.basis1,y,v,.5);const _=n(f.get(),j,m,.5);a(_,_,u.origin);const R=n(f.get(),h,B,.5);a(R,u.origin,R),n(u.basis2,_,R,.5);const C=r(f.get(),u.basis1,u.basis2),M=r(C,C,u.basis1);return p(M,M),d(u.basis2,M,c(u.basis2,M)),d(u.basis1,u.basis1,1+i/l(u.basis1)),d(u.basis2,u.basis2,1+i/l(u.basis2)),b(u),u}function S(s,t,o){return a(w,a(w,s.origin,s.basis1),s.basis2),u(I,w,s.basis1,2),u(A,I,s.basis2,2),u(k,w,s.basis2,2),w[2]=I[2]=A[2]=k[2]=t,M({topLeft:k,topRight:A,bottomRight:I,bottomLeft:w,spatialReference:o})}const k=m(),A=m(),I=m(),w=m();export{x as TransformBounds,S as mapPlaneAutoSize2D};
5
+ import{on as s}from"../../../../../../core/reactiveUtils.js";import{scale as t}from"../../../../../../core/libs/gl-matrix-2/math/vec2.js";import{g as o,f as i,o as e,b as a,n,j as r,m as p,l as d,r as c}from"../../../../../../chunks/vec32.js";import{create as l}from"../../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{a as u,c as m,u as g}from"../../../../../../chunks/boundedPlane.js";import{sv3d as h}from"../../../../../../geometry/support/vectorStacks.js";import{mainAxis as b}from"../../geometryUtils.js";import{manipulatedObjectGeometry as f}from"../../manipulatedObjectUtils.js";import{evaluateElevationAlignmentAtPoint as B}from"../../../../layers/graphics/elevationAlignmentUtils.js";import{ElevationContext as y}from"../../../../layers/graphics/ElevationContext.js";import{apply as j,applyInverse as v,calculateOrientedBounds as _}from"../../../../../interactive/editGeometry/support/editPlaneUtils.js";import{autoSize2D as R}from"../../../../../support/extentUtils.js";class C{constructor(t,o){this._tool=t,this.mapBounds=u(),this.mapBoundsStart=u(),this.displayBounds=u(),t.addHandles(s((()=>t.object),"modified-externally",(()=>this._resetMapBounds()),{onListenerAdd:()=>this._resetMapBounds()})),this._onDisplayBoundsChanged=o}get displayBoundsMargin(){const{view:s,object:t}=this._tool,o=f(t),i=s.pointsOfInterest?.centerOnSurfaceFrequent.location??o?.extent?.center;return i?M*s.pixelSizeAt(i):0}backupMapBounds(){m(this.mapBounds,this.mapBoundsStart)}updateDisplayBounds(){this._calculateDisplayBounds(),this._onDisplayBoundsChanged?.()}updateMapBoundsFromOperation(s){j(s,this.mapBounds),this.updateDisplayBounds()}updateMapBoundsFromOperationInverse(s){v(s,this.mapBounds),this.updateDisplayBounds()}_resetMapBounds(){this._calculateMapBounds(),this.updateDisplayBounds()}_calculateMapBounds(){const{view:s,attachmentOrigin:o,object:i}=this._tool,e=i.operations?.data;if(!e)return;const a=e.geometry;this.spatialReference=a.spatialReference;const n=b(a);t(n,n,-1);const r=o?s.pixelSizeAt(o,a.spatialReference):0;_(n,e,x*r,this.mapBounds)}_calculateDisplayBounds(){const{view:s,attachmentOrigin:t}=this._tool,o=t?.z??B(this.mapBounds.origin,s.elevationProvider,y.fromElevationInfo(this._tool.object.elevationInfo),s.renderCoordsHelper),i=m(this.mapBounds);i.origin[2]=o??0,D(i,s.renderCoordsHelper,this.spatialReference,this.displayBoundsMargin,this.displayBounds)}}const M=10,x=80;function D(s,t,c,l=0,m){m||(m=u()),t.toRenderCoords(s.origin,c,m.origin);const b=h.get();o(b,s.origin,s.basis1),o(b,b,s.basis2),t.toRenderCoords(b,c,b);const f=h.get();o(f,s.origin,s.basis1),i(f,f,s.basis2),t.toRenderCoords(f,c,f);const B=h.get();i(B,s.origin,s.basis1),i(B,B,s.basis2),t.toRenderCoords(B,c,B);const y=h.get();i(y,s.origin,s.basis1),o(y,y,s.basis2),t.toRenderCoords(y,c,y);const j=e(h.get(),b,f,.5);i(j,j,m.origin);const v=e(h.get(),B,y,.5);i(v,m.origin,v),e(m.basis1,j,v,.5);const _=e(h.get(),y,b,.5);i(_,_,m.origin);const R=e(h.get(),f,B,.5);i(R,m.origin,R),e(m.basis2,_,R,.5);const C=a(h.get(),m.basis1,m.basis2),M=a(C,C,m.basis1);return n(M,M),r(m.basis2,M,p(m.basis2,M)),r(m.basis1,m.basis1,1+l/d(m.basis1)),r(m.basis2,m.basis2,1+l/d(m.basis2)),g(m),m}function O(s,t,o){return i(A,i(A,s.origin,s.basis1),s.basis2),c(k,A,s.basis1,2),c(U,k,s.basis2,2),c(S,A,s.basis2,2),A[2]=k[2]=U[2]=S[2]=t,R({topLeft:S,topRight:U,bottomRight:k,bottomLeft:A,spatialReference:o})}const S=l(),U=l(),k=l(),A=l();export{C as TransformBounds,O as mapPlaneAutoSize2D};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.31/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../chunks/tslib.es6.js";import r from"../../../core/Error.js";import"../../../core/has.js";import{destroyMaybe as t}from"../../../core/maybe.js";import{watch as i,syncAndInitial as s}from"../../../core/reactiveUtils.js";import{property as a}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as o}from"../../../core/accessorSupport/decorators/subclass.js";import{getObjectId as u}from"../../../layers/graphics/dehydratedFeatures.js";import{FeatureLikeLayerView3D as n}from"./FeatureLikeLayerView3D.js";import{LayerView3D as p}from"./LayerView3D.js";import{FeatureGraphics3DGraphicsPipeline as l}from"./graphics/FeatureGraphics3DGraphicsPipeline.js";import{updatingProgress as m}from"../support/updatingProperties.js";import{UpdatePolicy as c}from"../webgl-engine/lib/UpdatePolicy.js";import d from"../../layers/FeatureLayerView.js";import h from"../../layers/LayerView.js";import y from"../../layers/RefreshableLayerView.js";let f=class extends(y(n(d(p(h))))){constructor(e){super(e)}initialize(){this.addHandles(i((()=>this._updatingRequiredFieldsPromise),(e=>this._updatingHandles.addPromise(e)),s))}destroy(){this._updatingHandles.removeAll(),this._fetcherContext=t(this._fetcherContext)}get maximumNumberOfFeatures(){return this.graphicsPipeline.maximumNumberOfFeatures}set maximumNumberOfFeatures(e){this.graphicsPipeline.maximumNumberOfFeatures=e}get maximumNumberOfFeaturesExceeded(){return null!=this.graphicsPipeline&&!this.suspended&&this.graphicsPipeline.maximumNumberOfFeaturesExceeded}get updatingProgressValue(){return this.graphicsPipeline?.updatingProgressValue??0}get updatePolicy(){return this.graphicsPipeline?.updatePolicy??c.ASYNC}get hasZ(){const e=this.layer,r=e.capabilities&&e.capabilities.data;return!(!r||!r.supportsZ)&&("returnZ"in e&&null!=e.returnZ?e.returnZ:r.supportsZ)}get hasM(){const e=this.layer,r=e.capabilities&&e.capabilities.data;return!(!r||!r.supportsM)&&("returnM"in e&&null!=e.returnM&&e.returnM)}setVisibility(e,r){this.graphicsPipeline?.setVisibility(e,r)}createQuery(){return super.createQuery()}queryFeatures(e,r){const t=()=>super.queryFeatures(e,r);return"mesh"===this.layer.geometryType?this._queryFeaturesMesh(this._ensureQuery(e),t):t()}createGraphicsPipeline(){return new l({layerView:this})}async doRefresh(e){return await this.graphicsPipeline.doRefresh(e)}_popupFeatureHasRequiredFields(e,r){if(!super._popupFeatureHasRequiredFields(e,r))return!1;const t=u(e,this.layer.objectIdField);if(null==t)return!0;const i=this.graphicsPipeline.getMissingAttributesForFeature(t);if(null==i)return!0;for(const s of r)if(i.has(s))return!1;return!0}get usedMemory(){return this.graphicsPipeline?.usedMemory??0}get unloadedMemory(){return this.graphicsPipeline?.unloadedMemory??0}get ignoresMemoryFactor(){return this.graphicsPipeline?.ignoresMemoryFactor??!1}async _queryFeaturesMesh(e,r){await this._validateQueryFeaturesMesh(e);const t=await r(),i=this.graphicsPipeline;if(e?.outStatistics||null==i)return t;const s=this.layer.objectIdField,a=[];for(const o of t.features)if(o.geometry){const e=i.getHydratedGeometry(o.attributes[s]);e&&(o.geometry=e,a.push(o))}else a.push(o);return t.features=a,t}async _validateQueryFeaturesMesh(e){if(!e)return;const t=e=>{throw new r("feature-layer-view:unsupported-query",`Queries on Mesh feature collection layers do not support '${e}'`)},i=["quantizationParameters","geometryPrecision","maxAllowableOffset"];for(const r of i)null!=e[r]&&t(r);"returnM"in e&&e.returnM&&t("returnM"),"returnCentroid"in e&&e.returnCentroid&&t("returnCentroid"),null==e.outSpatialReference||e.outSpatialReference.equals(this.view.spatialReference)||t("outSpatialReference")}get test(){}};e([a()],f.prototype,"layer",void 0),e([a()],f.prototype,"graphicsPipeline",void 0),e([a()],f.prototype,"maximumNumberOfFeatures",null),e([a()],f.prototype,"maximumNumberOfFeaturesExceeded",null),e([a(m)],f.prototype,"updatingProgress",void 0),e([a({readOnly:!0})],f.prototype,"updatingProgressValue",null),e([a({readOnly:!0})],f.prototype,"updatePolicy",null),e([a({readOnly:!0})],f.prototype,"hasZ",null),e([a({readOnly:!0})],f.prototype,"hasM",null),f=e([o("esri.views.3d.layers.FeatureLayerViewBase3D")],f);const g=f;export{g as default};
5
+ import{_ as e}from"../../../chunks/tslib.es6.js";import r from"../../../core/Error.js";import has from"../../../core/has.js";import{destroyMaybe as t}from"../../../core/maybe.js";import{watch as i,syncAndInitial as s}from"../../../core/reactiveUtils.js";import{property as a}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as o}from"../../../core/accessorSupport/decorators/subclass.js";import{getObjectId as u}from"../../../layers/graphics/dehydratedFeatures.js";import{FeatureLikeLayerView3D as n}from"./FeatureLikeLayerView3D.js";import{LayerView3D as p}from"./LayerView3D.js";import{FeatureGraphics3DGraphicsPipeline as l}from"./graphics/FeatureGraphics3DGraphicsPipeline.js";import{updatingProgress as c}from"../support/updatingProperties.js";import{UpdatePolicy as m}from"../webgl-engine/lib/UpdatePolicy.js";import d from"../../layers/FeatureLayerView.js";import h from"../../layers/LayerView.js";import y from"../../layers/RefreshableLayerView.js";let f=class extends(y(n(d(p(h))))){constructor(e){super(e)}initialize(){this.addHandles(i((()=>this._updatingRequiredFieldsPromise),(e=>this._updatingHandles.addPromise(e)),s))}destroy(){this._updatingHandles.removeAll(),this._fetcherContext=t(this._fetcherContext)}get maximumNumberOfFeatures(){return this.graphicsPipeline.maximumNumberOfFeatures}set maximumNumberOfFeatures(e){this.graphicsPipeline.maximumNumberOfFeatures=e}get maximumNumberOfFeaturesExceeded(){return null!=this.graphicsPipeline&&!this.suspended&&this.graphicsPipeline.maximumNumberOfFeaturesExceeded}get updatingProgressValue(){return this.graphicsPipeline?.updatingProgressValue??0}get updatePolicy(){return this.graphicsPipeline?.updatePolicy??m.ASYNC}get hasZ(){const e=this.layer,r=e.capabilities&&e.capabilities.data;return!(!r||!r.supportsZ)&&("returnZ"in e&&null!=e.returnZ?e.returnZ:r.supportsZ)}get hasM(){const e=this.layer,r=e.capabilities&&e.capabilities.data;return!(!r||!r.supportsM)&&("returnM"in e&&null!=e.returnM&&e.returnM)}setVisibility(e,r){this.graphicsPipeline?.setVisibility(e,r)}createQuery(){return super.createQuery()}queryFeatures(e,r){const t=()=>super.queryFeatures(e,r);return"mesh"===this.layer.geometryType?this._queryFeaturesMesh(this._ensureQuery(e),t):t()}async createGraphicsPipeline(){if(has("feature-pipeline-3d-test")){const{Feature3DPipeline:e}=await import("./graphics/pipeline/Feature3DPipeline.js");return new e({layerView:this})}return new l({layerView:this})}async doRefresh(e){return await this.graphicsPipeline.doRefresh(e)}_popupFeatureHasRequiredFields(e,r){if(!super._popupFeatureHasRequiredFields(e,r))return!1;const t=u(e,this.layer.objectIdField);if(null==t)return!0;const i=this.graphicsPipeline.getMissingAttributesForFeature(t);if(null==i)return!0;for(const s of r)if(i.has(s))return!1;return!0}get usedMemory(){return this.graphicsPipeline?.usedMemory??0}get unloadedMemory(){return this.graphicsPipeline?.unloadedMemory??0}get ignoresMemoryFactor(){return this.graphicsPipeline?.ignoresMemoryFactor??!1}async _queryFeaturesMesh(e,r){await this._validateQueryFeaturesMesh(e);const t=await r(),i=this.graphicsPipeline;if(e?.outStatistics||null==i)return t;const s=this.layer.objectIdField,a=[];for(const o of t.features)if(o.geometry){const e=i.getHydratedGeometry(o.attributes[s]);e&&(o.geometry=e,a.push(o))}else a.push(o);return t.features=a,t}async _validateQueryFeaturesMesh(e){if(!e)return;const t=e=>{throw new r("feature-layer-view:unsupported-query",`Queries on Mesh feature collection layers do not support '${e}'`)},i=["quantizationParameters","geometryPrecision","maxAllowableOffset"];for(const r of i)null!=e[r]&&t(r);"returnM"in e&&e.returnM&&t("returnM"),"returnCentroid"in e&&e.returnCentroid&&t("returnCentroid"),null==e.outSpatialReference||e.outSpatialReference.equals(this.view.spatialReference)||t("outSpatialReference")}get test(){}};e([a()],f.prototype,"layer",void 0),e([a()],f.prototype,"graphicsPipeline",void 0),e([a()],f.prototype,"maximumNumberOfFeatures",null),e([a()],f.prototype,"maximumNumberOfFeaturesExceeded",null),e([a(c)],f.prototype,"updatingProgress",void 0),e([a({readOnly:!0})],f.prototype,"updatingProgressValue",null),e([a({readOnly:!0})],f.prototype,"updatePolicy",null),e([a({readOnly:!0})],f.prototype,"hasZ",null),e([a({readOnly:!0})],f.prototype,"hasM",null),f=e([o("esri.views.3d.layers.FeatureLayerViewBase3D")],f);const g=f;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.31/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../chunks/tslib.es6.js";import t from"../../../core/Error.js";import{destroyMaybe as r}from"../../../core/maybe.js";import{property as i}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as s}from"../../../core/accessorSupport/decorators/subclass.js";import{hydrateGraphic as n}from"../../../layers/graphics/hydratedFeatures.js";import{combineTimeExtent as p}from"../../../layers/support/timeSupport.js";import a from"../../../rest/support/Query.js";import{toViewIfLocal as o}from"./support/projectExtentUtils.js";import{UpdatePolicy as l}from"../webgl-engine/lib/UpdatePolicy.js";const u=u=>{let h=class extends u{constructor(){super(...arguments),this.updatePolicy=l.SYNC,this.slicePlaneEnabled=!1,this.fullExtentInLocalViewSpatialReference=null,this.supportsHeightUnitConversion=!0}initialize(){const e=this.layer;"isTable"in e&&e.isTable?this.addResolvingPromise(Promise.reject(new t("featurelayerview:table-not-supported","table feature layer can't be displayed",{layer:e}))):(this.addResolvingPromise(this._validateGeometryType()),this.addResolvingPromise((async()=>{const e=await o(this);this.fullExtentInLocalViewSpatialReference=e;const t=this.createGraphicsPipeline();this.graphicsPipeline=t,await t.when()})()),this.notifyChange("updating"))}destroy(){this.graphicsPipeline=r(this.graphicsPipeline)}get dataUpdating(){return!!this.graphicsPipeline?.dataUpdating}get legendEnabled(){return this.canResume()&&this.graphicsPipeline?.legendEnabled}get visibleAtCurrentScale(){return!this.graphicsPipeline?.scaleVisibilitySuspended}get symbologySnappingSupported(){return this.graphicsPipeline.symbologySnappingSupported}get hasAllFeatures(){return this.graphicsPipeline.hasAllFeatures}get hasAllFeaturesInView(){return this.graphicsPipeline.hasAllFeaturesInView}get hasFullGeometries(){return this.graphicsPipeline.hasFullGeometries}get timeExtent(){return p(this.layer,this.view?.timeExtent,this._get("timeExtent"))}get queryEngine(){return this.graphicsPipeline.queryEngine}getHit(e){const t=this.graphicsPipeline.findGraphic((t=>t.uid===e));if(null==t)return null;const r=n(t,this.layer);return{type:"graphic",graphic:r,layer:r.layer}}whenGraphicBounds(e,t){return this.graphicsPipeline?.whenGraphicBounds(e,t)}computeAttachmentOrigin(e,t){return this.graphicsPipeline?.computeAttachmentOrigin(e,t)}async elevationAlignPointsInFeatures(e,t){return this.graphicsPipeline.elevationAlignPointsInFeatures(e,t)}async queryForSymbologySnapping(e,t){return this.graphicsPipeline.queryForSymbologySnapping(e,t)}queryFeatures(e,t){return this.queryEngine.executeQuery(this._ensureQuery(e),t?.signal)}queryObjectIds(e,t){return this.queryEngine.executeQueryForIds(this._ensureQuery(e),t?.signal)}queryFeatureCount(e,t){return this.queryEngine.executeQueryForCount(this._ensureQuery(e),t?.signal)}queryExtent(e,t){return this.queryEngine.executeQueryForExtent(this._ensureQuery(e),t?.signal)}_ensureQuery(e){return null==e?this.createQuery():a.from(e)}highlight(e){return this.graphicsPipeline.highlight(e)}maskOccludee(e){return this.graphicsPipeline.maskOccludee(e)}getSuspendInfo(){return{...super.getSuspendInfo(),...this.graphicsPipeline.suspendInfo}}isUpdating(){return!(!this.graphicsPipeline||this.graphicsPipeline.destroyed)&&!(!this.graphicsPipeline?.updating&&this.view?.basemapTerrain?.ready)}async _validateGeometryType(){switch(this.layer.geometryType){case"multipatch":case"multipoint":throw new t("featurelayerview3d:unsupported-geometry-type","Unsupported geometry type ${geometryType}",{geometryType:this.layer.geometryType})}}get performanceInfo(){return this.graphicsPipeline.performanceInfo}};return e([i()],h.prototype,"graphicsPipeline",void 0),e([i({readOnly:!0})],h.prototype,"dataUpdating",null),e([i()],h.prototype,"suspended",void 0),e([i({readOnly:!0})],h.prototype,"legendEnabled",null),e([i({readOnly:!0})],h.prototype,"visibleAtCurrentScale",null),e([i()],h.prototype,"updating",void 0),e([i({readOnly:!0})],h.prototype,"updatePolicy",void 0),e([i({type:Boolean})],h.prototype,"slicePlaneEnabled",void 0),e([i({readOnly:!0})],h.prototype,"suspendInfo",void 0),e([i()],h.prototype,"symbologySnappingSupported",null),e([i({readOnly:!0})],h.prototype,"hasAllFeatures",null),e([i({readOnly:!0})],h.prototype,"hasAllFeaturesInView",null),e([i({readOnly:!0})],h.prototype,"hasFullGeometries",null),e([i({readOnly:!0})],h.prototype,"timeExtent",null),h=e([s("esri.views.3d.layers.FeatureLikeLayerView3D")],h),h};export{u as FeatureLikeLayerView3D};
5
+ import{_ as e}from"../../../chunks/tslib.es6.js";import t from"../../../core/Error.js";import{destroyMaybe as r}from"../../../core/maybe.js";import{property as i}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as s}from"../../../core/accessorSupport/decorators/subclass.js";import{hydrateGraphic as n}from"../../../layers/graphics/hydratedFeatures.js";import{combineTimeExtent as a}from"../../../layers/support/timeSupport.js";import p from"../../../rest/support/Query.js";import{toViewIfLocal as o}from"./support/projectExtentUtils.js";import{UpdatePolicy as l}from"../webgl-engine/lib/UpdatePolicy.js";const u=u=>{let h=class extends u{constructor(){super(...arguments),this.updatePolicy=l.SYNC,this.slicePlaneEnabled=!1,this.fullExtentInLocalViewSpatialReference=null,this.supportsHeightUnitConversion=!0}initialize(){const e=this.layer;"isTable"in e&&e.isTable?this.addResolvingPromise(Promise.reject(new t("featurelayerview:table-not-supported","table feature layer can't be displayed",{layer:e}))):(this.addResolvingPromise(this._validateGeometryType()),this.addResolvingPromise((async()=>{const e=await o(this);if(this.destroyed)return;this.fullExtentInLocalViewSpatialReference=e;const t=await this.createGraphicsPipeline();this.destroyed?t.destroy():(this.graphicsPipeline=t,await t.when())})()),this.notifyChange("updating"))}destroy(){this.graphicsPipeline=r(this.graphicsPipeline)}get dataUpdating(){return!!this.graphicsPipeline?.dataUpdating}get legendEnabled(){return this.canResume()&&this.graphicsPipeline?.legendEnabled}get visibleAtCurrentScale(){return!this.graphicsPipeline?.scaleVisibilitySuspended}get symbologySnappingSupported(){return this.graphicsPipeline.symbologySnappingSupported}get hasAllFeatures(){return this.graphicsPipeline.hasAllFeatures}get hasAllFeaturesInView(){return this.graphicsPipeline.hasAllFeaturesInView}get hasFullGeometries(){return this.graphicsPipeline.hasFullGeometries}get timeExtent(){return a(this.layer,this.view?.timeExtent,this._get("timeExtent"))}get queryEngine(){return this.graphicsPipeline.queryEngine}getHit(e){const t=this.graphicsPipeline.findGraphic((t=>t.uid===e));if(null==t)return null;const r=n(t,this.layer);return{type:"graphic",graphic:r,layer:r.layer}}whenGraphicBounds(e,t){return this.graphicsPipeline?.whenGraphicBounds(e,t)}computeAttachmentOrigin(e,t){return this.graphicsPipeline?.computeAttachmentOrigin(e,t)}async elevationAlignPointsInFeatures(e,t){return this.graphicsPipeline.elevationAlignPointsInFeatures(e,t)}async queryForSymbologySnapping(e,t){return this.graphicsPipeline.queryForSymbologySnapping(e,t)}queryFeatures(e,t){return this.queryEngine.executeQuery(this._ensureQuery(e),t?.signal)}queryObjectIds(e,t){return this.queryEngine.executeQueryForIds(this._ensureQuery(e),t?.signal)}queryFeatureCount(e,t){return this.queryEngine.executeQueryForCount(this._ensureQuery(e),t?.signal)}queryExtent(e,t){return this.queryEngine.executeQueryForExtent(this._ensureQuery(e),t?.signal)}_ensureQuery(e){return null==e?this.createQuery():p.from(e)}highlight(e){return this.graphicsPipeline.highlight(e)}maskOccludee(e){return this.graphicsPipeline.maskOccludee(e)}getSuspendInfo(){return{...super.getSuspendInfo(),...this.graphicsPipeline.suspendInfo}}isUpdating(){return!(!this.graphicsPipeline||this.graphicsPipeline.destroyed)&&!(!this.graphicsPipeline?.updating&&this.view?.basemapTerrain?.ready)}async _validateGeometryType(){switch(this.layer.geometryType){case"multipatch":case"multipoint":throw new t("featurelayerview3d:unsupported-geometry-type","Unsupported geometry type ${geometryType}",{geometryType:this.layer.geometryType})}}get performanceInfo(){return this.graphicsPipeline.performanceInfo}};return e([i()],h.prototype,"graphicsPipeline",void 0),e([i({readOnly:!0})],h.prototype,"dataUpdating",null),e([i()],h.prototype,"suspended",void 0),e([i({readOnly:!0})],h.prototype,"legendEnabled",null),e([i({readOnly:!0})],h.prototype,"visibleAtCurrentScale",null),e([i()],h.prototype,"updating",void 0),e([i({readOnly:!0})],h.prototype,"updatePolicy",void 0),e([i({type:Boolean})],h.prototype,"slicePlaneEnabled",void 0),e([i({readOnly:!0})],h.prototype,"suspendInfo",void 0),e([i()],h.prototype,"symbologySnappingSupported",null),e([i({readOnly:!0})],h.prototype,"hasAllFeatures",null),e([i({readOnly:!0})],h.prototype,"hasAllFeaturesInView",null),e([i({readOnly:!0})],h.prototype,"hasFullGeometries",null),e([i({readOnly:!0})],h.prototype,"timeExtent",null),h=e([s("esri.views.3d.layers.FeatureLikeLayerView3D")],h),h};export{u as FeatureLikeLayerView3D};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.31/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../chunks/tslib.es6.js";import{binaryIndexOf as t}from"../../../core/arrayUtils.js";import"../../../core/has.js";import r from"../../../core/Logger.js";import{destroyMaybe as i}from"../../../core/maybe.js";import{initial as s,watch as o}from"../../../core/reactiveUtils.js";import{estimateSize as a}from"../../../core/typedArrayUtil.js";import{generateUID as n}from"../../../core/uid.js";import{property as l}from"../../../core/accessorSupport/decorators/property.js";import{subclass as d}from"../../../core/accessorSupport/decorators/subclass.js";import{s as u}from"../../../chunks/vec32.js";import{ZEROS as h,create as p}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{projectBuffer as c}from"../../../geometry/projection/projectBuffer.js";import{projectVectorToVector as g}from"../../../geometry/projection/projectVectorToVector.js";import{extentContainsCoords3D as m,extentContainsCoords2D as y}from"../../../geometry/support/contains.js";import{newDoubleArray as f,doubleArrayFrom as _}from"../../../geometry/support/DoubleArray.js";import{getGeometryZScaler as b}from"../../../geometry/support/zscale.js";import{fallbackObjectIDAttribute as v}from"../../../layers/LayerConstants.js";import{estimateSize as I}from"../../../layers/graphics/dehydratedFeatures.js";import{makeDehydratedPoint as x}from"../../../layers/graphics/dehydratedPoint.js";import{hydrateGraphic as E}from"../../../layers/graphics/hydratedFeatures.js";import w from"../../../layers/graphics/controllers/I3SOnDemandController.js";import N from"../../../layers/support/FeatureFilter.js";import j from"../../../rest/support/Query.js";import{isBasemapLayer as O}from"../../../support/basemapUtils.js";import{I3SPointsWorkerHandle as C}from"./I3SPointsWorkerHandle.js";import{LayerView3D as F}from"./LayerView3D.js";import{Graphics3DFeatureProcessor as S}from"./graphics/Graphics3DFeatureProcessor.js";import{QueryEngine as D}from"./graphics/QueryEngine.js";import{createInteractiveEditSession as G,normalizeEditResultsEvent as A,processAttributeEdits as P}from"./i3s/featureEditing.js";import{I3SGraphicsMap as L}from"./i3s/I3SGraphicsMap.js";import{I3SOverrides as V}from"./i3s/I3SOverrides.js";import{checkRecyclable as R,checkSpatialReferences as M,containsDraco as H,whenGraphicAttributes as Q,getCachedAttributeValue as q}from"./i3s/I3SUtil.js";import{DefinitionExpressionSceneLayerView as U}from"./support/DefinitionExpressionSceneLayerView.js";import{defineFieldProperties as T}from"./support/fieldProperties.js";import{LayerViewPerformanceInfo as B}from"./support/LayerViewPerformanceInfo.js";import{PopupSceneLayerView as k}from"./support/PopupSceneLayerView.js";import{SceneLayerViewRequiredFields as z}from"./support/SceneLayerViewRequiredFields.js";import{TemporalSceneLayerView as W}from"./support/TemporalSceneLayerView.js";import{debugFlags as Z}from"../support/debugFlags.js";import{compute as K}from"../support/orientedBoundingBox.js";import{updatingProgress as Y}from"../support/updatingProperties.js";import{Vertices as $}from"../webgl-engine/lib/Attribute.js";import{UpdatePolicy as J}from"../webgl-engine/lib/UpdatePolicy.js";import X from"../../layers/SceneLayerView.js";import{hasPopupTemplate as ee}from"../../layers/support/popupUtils.js";import{TaskPriority as te}from"../../support/Scheduler.js";const re=T();class ie{constructor(e,t,r,i){this.graphics=e,this.featureIds=t,this.attributeInfo=r,this.node=i}}let se=class extends(W(U(k(F(X))))){constructor(){super(...arguments),this.type="scene-layer-graphics-3d",this._queryEngine=null,this._memCache=null,this._interactiveEditingSessions=new Map,this._pendingEditsQueue=Promise.resolve(),this.loadedGraphics=new L(((e,t,r)=>le(e,t,r)),(e=>this.processor.graphicsCore.recreateGraphics(e))),this.holeFilling="always",this.progressiveLoadFactor=1,this.supportsHeightUnitConversion=!0,this._coordinatesOutsideExtentErrors=0,this._maxCoordinatesOutsideExtentErrors=20}tryRecycleWith(e,t){return e.url===this.layer.url&&this._i3sOverrides.isEmpty?e.load(t).then((()=>{R(this.layer,e,this._i3sOverrides),this.layer=e,this._i3sOverrides.destroy();const t=this.view.resourceController?.memoryController;this._i3sOverrides=new V({view:this.view,layer:e,memoryController:t}),i(this._queryEngine),this._setupQueryEngine(),this.processor.resetObjectStates()})):null}initialize(){this.addResolvingPromise(this.layer.indexInfo);const e=this.view.resourceController?.memoryController;this._i3sOverrides=new V({view:this.view,layer:this.layer,memoryController:e}),M(this.layer,this.view.spatialReference,this.view.viewingMode),this._fieldsHelper=new z({layerView:this}),this._updatingHandles.add((()=>this.layer.rangeInfos),(e=>this._rangeInfosChanged(e)),s),this._updatingHandles.add((()=>this.layer.renderer),((e,t)=>this._rendererChange(e,t))),this._updatingHandles.add((()=>[this.parsedDefinitionExpression,this._excludeObjectIdsSorted]),(()=>this._filterChange())),this.addHandles(o((()=>Z.I3S_TREE_SHOW_TILES),(e=>{if(e&&!this._treeDebugger){const e=this._controller.crsIndex;import("./support/I3STreeDebugger.js").then((({I3STreeDebugger:t})=>{!this._treeDebugger&&Z.I3S_TREE_SHOW_TILES&&(this._treeDebugger=new t({lv:this,view:this.view,nodeSR:e}))}))}else e||!this._treeDebugger||Z.I3S_TREE_SHOW_TILES||(this._treeDebugger.destroy(),this._treeDebugger=null)}),s)),this._set("processor",new S({owner:this,preferredUpdatePolicy:J.ASYNC,scaleVisibilityEnabled:!0,filterVisibilityEnabled:!0,timeExtentEnabled:!1,frustumVisibilityEnabled:!1,elevationAlignmentEnabled:!0,elevationFeatureExpressionEnabled:!1,setUidToIdOnAdd:!1,dataExtent:this.layer.fullExtent,updateClippingExtent:e=>this._updateClippingExtent(e)})),this.processor.elevationAlignment?.events.on("invalidate-elevation",(({extent:e,spatialReference:t})=>this._controller.updateElevationChanged(e,t))),this.supportsHeightUnitConversion&&(this._verticalScale=b("point",this.layer.spatialReference,this.view.spatialReference)),this.addResolvingPromise(this.processor.initializePromise),this._memCache=this.view.resourceController.memoryController.newCache(`psl-${this.uid}`),this._controller=new w({layerView:this}),H(this.layer.geometryDefinitions)&&(this._worker=new C((e=>this.view.resourceController.immediate.schedule(e)))),this.addHandles(this.layer.on("apply-edits",(e=>this._updatingHandles.addPromise(e.result)))),this.addHandles(this.layer.on("edits",(e=>{const t=this._pendingEditsQueue.then((()=>this._handleEdits(e))).then();this._pendingEditsQueue=t,this._updatingHandles.addPromise(t)}))),this.when((()=>{this._setupQueryEngine(),this._updatingHandles.add((()=>this.maximumNumberOfFeatures),(e=>this._controller.featureTarget=e),s),this._updatingHandles.add((()=>this.suspended),(e=>{e&&this._removeAllNodeData()}))}))}destroy(){this._treeDebugger=i(this._treeDebugger),this._i3sOverrides=i(this._i3sOverrides),this._set("processor",i(this.processor)),this._controller=i(this._controller),this._queryEngine=i(this._queryEngine),this._worker=i(this._worker),this._memCache=i(this._memCache),this.loadedGraphics.clear(),this._fieldsHelper=i(this._fieldsHelper)}get i3slayer(){return this.layer}get updatingProgressValue(){return this._controller?.updatingProgress??1}get requiredFields(){return this._fieldsHelper?.requiredFields??[]}get maximumNumberOfFeatures(){const e=this.processor?.graphicsCore?.displayFeatureLimit;return e?.maximumNumberOfFeatures??0}set maximumNumberOfFeatures(e){null!=e?(this._override("maximumNumberOfFeatures",e),this._controller.fixedFeatureTarget=!0):(this._clearOverride("maximumNumberOfFeatures"),this._controller.fixedFeatureTarget=!1)}get maximumNumberOfFeaturesExceeded(){return!this.suspended&&(!!this._controller?.useMaximumNumberOfFeatures&&!this._controller.leavesReached)}get _excludeObjectIdsSorted(){const e=this.layer.excludeObjectIds;return e.length?e.toArray().sort(((e,t)=>e-t)):null}get lodFactor(){return"Labels"===this.layer.semantic?1:this.view.qualitySettings.sceneService.point.lodFactor}get hasM(){return!1}get hasZ(){return!0}get contentVisible(){return!this.suspended&&!!this._controller?.rootNodeVisible}get legendEnabled(){return this.contentVisible&&!0===this.i3slayer?.legendEnabled}async whenGraphicAttributes(e,t){return Q(this.layer,e,this._getObjectIdField(),t,(()=>[...this.loadedGraphics.nodes()]))}getHit(e){if(!this.loadedGraphics)return null;const t=E(this.loadedGraphics.find((t=>t.uid===e)),this.layer),r=this._getObjectIdField();return t?.attributes?.[r]?(t.layer=this.layer,t.sourceLayer=this.layer,{type:"graphic",graphic:t,layer:t.layer}):null}whenGraphicBounds(e,t){return this.processor.whenGraphicBounds(e,t)}computeAttachmentOrigin(e,t){return this.processor.computeAttachmentOrigin(e,t)}isUpdating(){return!!(this._controller?.updating||this.processor?.updating||this._fieldsHelper?.updating||this.layerFilterUpdating)}highlight(e){return this.processor.highlight(e,this.layer.objectIdField)}get updatePolicy(){return this.processor.graphicsCore.effectiveUpdatePolicy}createInteractiveEditSession(e){return G(this._attributeEditingContext,e)}async _decompressBinaryPointData(e,t){const r={geometryBuffer:e.geometryBuffer};null==this._worker&&(this._worker=new C((e=>this.view.resourceController.immediate.schedule(e))));const i=await this._worker.invoke(r,t);if(null==i)throw new Error("Failed to decompress Draco point data");return{positionData:i.positions,featureIds:i.featureIds}}async addNode(e,t,i){if(!ne(t)&&!ae(t))throw new Error;if(this.loadedGraphics.hasNode(e.index))return void r.getLogger(this).error("I3S node "+e.id+" already added");const s=null!=this.layer.fullExtent?ue(this.layer.fullExtent.clone(),.5):null,{featureIds:o,pointPositions:a}=ne(t)?await this._extractBinaryPointPositions(e,t,i):this._extractLegacyPointPositions(t),n=new Array;this._validatePositions(e,o,a,s,n);const l=this._controller.crsVertex,d=this.view.spatialReference;c(a,l,0,a,d,0,o.length);const u=ne(t)?e.level:0,h=this._createGraphics(o,a,e.index,u),p=new ie(h,o,t.attributeDataInfo,e);if(await this._i3sOverrides.applyAttributeOverrides(p.featureIds,t.attributeDataInfo,i),e.numFeatures=p.graphics.length,this._updateNodeMemory(e),de(p),n.length>0&&(this._computeObb(e,n,l),this._controller.updateVisibility(e.index)),!this._controller.isGeometryVisible(e))return void this._cacheNodeData(p);if(null!=this._verticalScale)for(const r of p.graphics)this._verticalScale(r.geometry);const g=this.view._stage.renderView.objectAndLayerIdRenderHelper;if(null!=g){const e=O(this.view.map,this.layer.uid);for(let t=0;t<p.featureIds.length;t++){const r=p.featureIds[t];g.setUidToObjectAndLayerId(r,p.graphics[t].uid,this.layer.id,this.layer.uid,this.layer.popupEnabled&&!e&&ee(this.layer,this.view.popup?.defaultPopupTemplateEnabled),p.node.resources.attributes,t)}}this.loadedGraphics.addNode(e.index,p),this._controller.updateLoadStatus(e.index,!0),this._filterNode(p),this._treeDebugger&&this._treeDebugger.update()}_computeObb(e,t,r){const i=this._controller.crsIndex,s=i.isGeographic?this.view.renderSpatialReference:i;c(t,r,0,t,s,0,t.length/3),e.serviceObbInIndexSR=K(new $(t,3)),i.isGeographic&&(g(e.serviceObbInIndexSR.center,s,pe,i),e.serviceObbInIndexSR.center=pe)}isNodeLoaded(e){return this.loadedGraphics.hasNode(e)}isNodeReloading(){return!1}updateNodeState(){}async _extractBinaryPointPositions(e,t,r){const i=await this._decompressBinaryPointData(t,r),s=i.positionData,o=3,a=s.length/o,n=f(3*a),l=null!=e.serviceObbInIndexSR?e.serviceObbInIndexSR.center:h,d=Math.abs(l[2])*2**-20;for(let u=0;u<a;u++){const e=u*o;n[e]=s[e]+l[0],n[e+1]=s[e+1]+l[1],n[e+2]=s[e+2]+l[2],Math.abs(n[e+2])<d&&(n[e+2]=0)}return{featureIds:i.featureIds?_(i.featureIds):[],pointPositions:n}}_extractLegacyPointPositions(e){const t=e.pointData.length,r=f(3*t),i=new Array;for(let s=0;s<t;s++){const t=e.pointData[s],o=t.featureDataPosition,a=o.length,n=t.geometries?.[0]??he[a],l=t.featureIds[0];if("Embedded"!==n.type||"points"!==n.params.type||a<2||a>3)continue;const d=n.params.vertexAttributes?.position??[0,0,0],u=3*i.length;r[u]=o[0]+d[0],r[u+1]=o[1]+d[1],r[u+2]=3===a?o[2]+d[2]:NaN,i.push(l)}return{featureIds:i,pointPositions:r}}_validatePositions(e,t,i,s,o){if(null==s&&e.serviceObbInIndexSR)return;const a=t.length,n=3;for(let l=0;l<a;l++){const t=l*n;u(pe,i[t],i[t+1],i[t+2]);const a=!Number.isNaN(i[2]);null==s||(a?m(s,pe):y(s,pe))||(this._coordinatesOutsideExtentErrors<this._maxCoordinatesOutsideExtentErrors&&r.getLogger(this).error("Service Error: Coordinates outside of layer extent"),this._coordinatesOutsideExtentErrors+1===this._maxCoordinatesOutsideExtentErrors&&r.getLogger(this).error("Maximum number of errors reached. Further errors are ignored."),this._coordinatesOutsideExtentErrors++),e.serviceObbInIndexSR||o.push(pe[0],pe[1],pe[2])}}_createGraphics(e,t,r,i){const s=e.length,o=3,a=this._getObjectIdField(),l=this.processor.graphicsCore,d=new Array,u=this.view.spatialReference;for(let h=0;h<s;h++){const s=e[h],p={};null!=s&&(p[a]=s);const c=s??n(),g=h*o,m=isNaN(t[g+2])?void 0:t[g+2],y=x(t[g],t[g+1],m,u),f=this.loadedGraphics.get(c);if(null!=f)(null==f.level||f.level<i)&&(ce.property="geometry",ce.graphic=f,ce.oldValue=f.geometry,ce.newValue=y,f.geometry=y,f.level=i,l.graphicUpdateHandler(ce)),d.push(f);else{const e=n();d.push({objectId:c,uid:e,geometry:y,attributes:p,visible:!0,nodeIndex:r,level:i})}}return d}_updateNodeMemory(e){e.memory=4096+(null!=e.numFeatures?e.numFeatures*this.processor.graphicsCore.usedMemoryPerGraphic:0)}_cacheNodeData(e){const t=e.graphics.reduce(((e,t)=>I(t)+e),a(e.featureIds)+1024);this._memCache.put(this._getMemCacheKey(e.node),e,t)}_getMemCacheKey(e){return`${e.index}`}_removeAllNodeData(){this.loadedGraphics.forEachNode(((e,t)=>{if(e){const t=e.node;this._updateNodeMemory(t),this._cacheNodeData(e)}this._controller.updateLoadStatus(t,!1)})),this._treeDebugger&&this._treeDebugger.update(),this.loadedGraphics.clear()}removeNode(e){const t=this._removeNodeStageData(e);t&&(this._updateNodeMemory(t.node),this._cacheNodeData(t))}_removeNodeStageData(e){const t=this.loadedGraphics.getNode(e);return null==t?null:(this._controller.updateLoadStatus(e,!1),this.loadedGraphics.removeNode(e),this._treeDebugger&&this._treeDebugger.update(),t)}async loadCachedNodeData(e){return this._memCache?.pop(this._getMemCacheKey(e))}async addCachedNodeData(e,t,i,s){this.loadedGraphics.hasNode(e.index)?r.getLogger(this).error("I3S node "+e.id+" already added"):(await this._i3sOverrides.applyAttributeOverrides(t.featureIds,i,s),t.attributeInfo=i,this.loadedGraphics.addNode(e.index,t),this._controller.updateLoadStatus(e.index,!0),this._updateNodeMemory(e),de(t),this._filterNode(t),this._treeDebugger&&this._treeDebugger.update())}getLoadedNodeIds(){const e=[];return this.loadedGraphics.forEachNode((t=>e.push(t.node.id))),e.sort()}getVisibleNodes(){const e=new Array;return this.loadedGraphics.forEachNode((t=>e.push(t.node))),e}getLoadedNodeIndices(e){this.loadedGraphics.forEachNode(((t,r)=>e.push(r)))}getLoadedAttributes(e){const t=this.loadedGraphics.getNode(e);if(null!=t?.attributeInfo)return t.attributeInfo.loadedAttributes}getAttributeData(e){const t=this.loadedGraphics.getNode(e);if(null!=t?.attributeInfo)return t.attributeInfo.attributeData}_setAttributeData(e,t){const r=this.loadedGraphics.getNode(e);null!=r?.attributeInfo&&(r.attributeInfo.attributeData=t,this._attributeValuesChanged(r))}async updateAttributes(e,t,r){const i=this.loadedGraphics.getNode(e);null!=i&&(await this._i3sOverrides.applyAttributeOverrides(i.featureIds,t,r),i.attributeInfo=t,this._attributeValuesChanged(i))}_attributeValuesChanged(e){de(e),this._filterNode(e);const{processor:t}=this,{graphicsCore:r}=t;if(r.labelsEnabled){const t=e.node.index,i=new Array;e.graphics.forEach((e=>e.nodeIndex===t&&i.push(e.uid))),r.updateLabelingInfo(i)}t.refreshFilter()}_updateClippingExtent(e){return this._controller&&this._controller.updateClippingArea(e),!1}_getObjectIdField(){return this.layer.objectIdField||v}_getGlobalIdField(){return this.layer.associatedLayer?.globalIdField}async _rendererChange(e,t){const{layer:{fieldsIndex:r}}=this,i=new Set;let s,o;e?(await e.collectRequiredFields(i,r),s=Array.from(i).sort()):s=[],i.clear(),t?(await t.collectRequiredFields(i,r),o=Array.from(i).sort()):o=[],s.length===o.length&&s.every(((e,t)=>s[t]===o[t]))||this._reloadAllNodes()}_rangeInfosChanged(e){null!=e&&e.length>0&&r.getLogger(this).warn("Unsupported property: rangeInfos are currently only serialized to and from web scenes but do not affect rendering.")}_filterChange(){this.loadedGraphics.forEachNode((e=>this._filterNode(e)))}_reloadAllNodes(){this._removeAllNodeData(),this._controller&&this._controller.restartNodeLoading()}_filterNode(e){const r=this.parsedDefinitionExpression,i=this._excludeObjectIdsSorted,s=this._getObjectIdField();for(const o of e.graphics){const e=o.visible,a=!r||this._evaluateClause(r,o),n=null==i||t(i,o.attributes[s])<0;o.visible=a&&n,e!==o.visible&&(ce.graphic=o,ce.property="visible",ce.oldValue=e,ce.newValue=o.visible,this.processor.graphicsCore.graphicUpdateHandler(ce))}}createQuery(){const e={outFields:["*"],returnGeometry:!0,outSpatialReference:this.view.spatialReference};return null!=this.filter?this.filter.createQuery(e):new j(e)}queryFeatures(e,t){return this._queryEngine.executeQuery(this._ensureQuery(e),t?.signal)}queryObjectIds(e,t){return this._queryEngine.executeQueryForIds(this._ensureQuery(e),t?.signal)}queryFeatureCount(e,t){return this._queryEngine.executeQueryForCount(this._ensureQuery(e),t?.signal)}queryExtent(e,t){return this._queryEngine.executeQueryForExtent(this._ensureQuery(e),t?.signal)}_ensureQuery(e){return this._addDefinitionExpressionToQuery(null==e?this.createQuery():j.from(e))}_setupQueryEngine(){const e=()=>this.processor.featureStore;this._queryEngine=new D({context:{spatialReference:this.view.spatialReference,layer:this.layer,scheduler:this.view.resourceController.scheduler,get featureStore(){return e()},hasZ:this.hasZ,hasM:this.hasM},priority:te.FEATURE_QUERY_ENGINE})}get usedMemory(){return this.processor?.graphicsCore?.usedMemory??0}get unloadedMemory(){return.8*((this._controller?.unloadedMemoryEstimate??0)+(this.processor?.graphicsCore?.unprocessedMemoryEstimate??0))}get ignoresMemoryFactor(){return this._controller&&this._controller.fixedFeatureTarget}async _handleEdits(e){const t=this._attributeEditingContext,r=await A(t,e);P(t,r)}get _attributeEditingContext(){const e=this._getObjectIdField(),t=this._getGlobalIdField();return{sessions:this._interactiveEditingSessions,fieldsIndex:this.layer.fieldsIndex,objectIdField:e,globalIdField:t,forEachNode:e=>this.loadedGraphics.forEachNode((t=>e(t.node,t.featureIds))),attributeStorageInfo:this.i3slayer.attributeStorageInfo??[],i3sOverrides:this._i3sOverrides,getAttributeData:e=>this.getAttributeData(e),setAttributeData:(t,r,i)=>{this._setAttributeData(t,r);const s=this.loadedGraphics.getNode(t);if(null!=i){const t=this.loadedGraphics.get(i.attributes[e]);null!=t&&this.processor.graphicsCore.recreateGraphics([t])}else null!=s&&this.processor.graphicsCore.recreateGraphics(s.graphics)},clearMemCache:()=>{}}}get performanceInfo(){return new B(this.usedMemory,this.loadedGraphics.length,-1,this.maximumNumberOfFeatures,this.loadedGraphics.nodeCount,this.processor.graphicsCore.performanceInfo)}get test(){}};e([l()],se.prototype,"processor",void 0),e([l({type:N})],se.prototype,"filter",void 0),e([l()],se.prototype,"loadedGraphics",void 0),e([l()],se.prototype,"i3slayer",null),e([l()],se.prototype,"_controller",void 0),e([l()],se.prototype,"updating",void 0),e([l()],se.prototype,"suspended",void 0),e([l()],se.prototype,"holeFilling",void 0),e([l(Y)],se.prototype,"updatingProgress",void 0),e([l()],se.prototype,"updatingProgressValue",null),e([l(re.requiredFields)],se.prototype,"requiredFields",null),e([l(re.availableFields)],se.prototype,"availableFields",void 0),e([l()],se.prototype,"_fieldsHelper",void 0),e([l({type:Number})],se.prototype,"maximumNumberOfFeatures",null),e([l({readOnly:!0})],se.prototype,"maximumNumberOfFeaturesExceeded",null),e([l()],se.prototype,"_excludeObjectIdsSorted",null),e([l({readOnly:!0})],se.prototype,"lodFactor",null),e([l({readOnly:!0})],se.prototype,"hasM",null),e([l({readOnly:!0})],se.prototype,"hasZ",null),e([l()],se.prototype,"contentVisible",null),e([l({readOnly:!0})],se.prototype,"legendEnabled",null),se=e([d("esri.views.3d.layers.SceneLayerGraphicsView3D")],se);const oe=se;function ae(e){return"pointData"in e}function ne(e){return"geometryBuffer"in e&&null!==e.geometryBuffer}function le(e,t,r){const i=t.attributeInfo;if(null==i?.loadedAttributes||null==i.attributeData)return!1;let s=!1;for(const{name:o}of i.loadedAttributes)if(i.attributeData[o]){const t=q(i.attributeData[o],r);t!==e.attributes[o]&&(e.attributes[o]=t,s=!0)}return s}function de(e){const t=e.attributeInfo,r=e.node.index;if(null!=t?.loadedAttributes&&null!=t.attributeData)for(let i=0;i<e.graphics.length;i++){const s=e.graphics[i];if(s.nodeIndex===r){s.attributes||(s.attributes={});for(const{name:e}of t.loadedAttributes)t.attributeData[e]&&(s.attributes[e]=q(t.attributeData[e],i))}}}function ue(e,t){return e.xmin-=t,e.ymin-=t,e.xmax+=t,e.ymax+=t,null!=e.zmin&&null!=e.zmax&&(e.zmin-=t,e.zmax+=t),null!=e.mmin&&null!=e.mmax&&(e.mmin-=t,e.mmax+=t),e}const he={2:{type:"Embedded",params:{type:"points",vertexAttributes:{position:[0,0]}}},3:{type:"Embedded",params:{type:"points",vertexAttributes:{position:[0,0,0]}}}},pe=p(),ce={graphic:null,property:null,oldValue:null,newValue:null};export{oe as default};
5
+ import{_ as e}from"../../../chunks/tslib.es6.js";import{binaryIndexOf as t}from"../../../core/arrayUtils.js";import"../../../core/has.js";import r from"../../../core/Logger.js";import{destroyMaybe as i}from"../../../core/maybe.js";import{initial as s,watch as o}from"../../../core/reactiveUtils.js";import{estimateSize as a}from"../../../core/typedArrayUtil.js";import{generateUID as n}from"../../../core/uid.js";import{property as l}from"../../../core/accessorSupport/decorators/property.js";import{subclass as d}from"../../../core/accessorSupport/decorators/subclass.js";import{s as u}from"../../../chunks/vec32.js";import{ZEROS as h,create as p}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{projectBuffer as c}from"../../../geometry/projection/projectBuffer.js";import{projectVectorToVector as g}from"../../../geometry/projection/projectVectorToVector.js";import{extentContainsCoords3D as m,extentContainsCoords2D as y}from"../../../geometry/support/contains.js";import{newDoubleArray as f,doubleArrayFrom as _}from"../../../geometry/support/DoubleArray.js";import{getGeometryZScaler as b}from"../../../geometry/support/zscale.js";import{fallbackObjectIDAttribute as v}from"../../../layers/LayerConstants.js";import{estimateSize as I}from"../../../layers/graphics/dehydratedFeatures.js";import{makeDehydratedPoint as x}from"../../../layers/graphics/dehydratedPoint.js";import{hydrateGraphic as E}from"../../../layers/graphics/hydratedFeatures.js";import w from"../../../layers/graphics/controllers/I3SOnDemandController.js";import N from"../../../layers/support/FeatureFilter.js";import j from"../../../rest/support/Query.js";import{isBasemapLayer as O}from"../../../support/basemapUtils.js";import{I3SPointsWorkerHandle as C}from"./I3SPointsWorkerHandle.js";import{LayerView3D as F}from"./LayerView3D.js";import{Graphics3DFeatureProcessor as S}from"./graphics/Graphics3DFeatureProcessor.js";import{QueryEngine as D}from"./graphics/QueryEngine.js";import{createInteractiveEditSession as G,normalizeEditResultsEvent as A,processAttributeEdits as P}from"./i3s/featureEditing.js";import{I3SGraphicsMap as L}from"./i3s/I3SGraphicsMap.js";import{I3SOverrides as V}from"./i3s/I3SOverrides.js";import{checkRecyclable as R,checkSpatialReferences as M,containsDraco as H,whenGraphicAttributes as Q,getCachedAttributeValue as q}from"./i3s/I3SUtil.js";import{DefinitionExpressionSceneLayerView as U}from"./support/DefinitionExpressionSceneLayerView.js";import{defineFieldProperties as T}from"./support/fieldProperties.js";import{LayerViewPerformanceInfo as B}from"./support/LayerViewPerformanceInfo.js";import{PopupSceneLayerView as k}from"./support/PopupSceneLayerView.js";import{SceneLayerViewRequiredFields as z}from"./support/SceneLayerViewRequiredFields.js";import{TemporalSceneLayerView as W}from"./support/TemporalSceneLayerView.js";import{debugFlags as Z}from"../support/debugFlags.js";import{compute as K}from"../support/orientedBoundingBox.js";import{updatingProgress as Y}from"../support/updatingProperties.js";import{Vertices as $}from"../webgl-engine/lib/Attribute.js";import{UpdatePolicy as J}from"../webgl-engine/lib/UpdatePolicy.js";import X from"../../layers/SceneLayerView.js";import{hasPopupTemplate as ee}from"../../layers/support/popupUtils.js";import{TaskPriority as te}from"../../support/Scheduler.js";const re=T();class ie{constructor(e,t,r,i){this.graphics=e,this.featureIds=t,this.attributeInfo=r,this.node=i}}let se=class extends(W(U(k(F(X))))){constructor(){super(...arguments),this.type="scene-layer-graphics-3d",this._queryEngine=null,this._memCache=null,this._interactiveEditingSessions=new Map,this._pendingEditsQueue=Promise.resolve(),this.loadedGraphics=new L(((e,t,r)=>le(e,t,r)),(e=>this.processor.graphicsCore.recreateGraphics(e))),this.holeFilling="always",this.progressiveLoadFactor=1,this.supportsHeightUnitConversion=!0,this._coordinatesOutsideExtentErrors=0,this._maxCoordinatesOutsideExtentErrors=20}tryRecycleWith(e,t){return e.url===this.layer.url&&this._i3sOverrides.isEmpty?e.load(t).then((()=>{R(this.layer,e,this._i3sOverrides),this.layer=e,this._i3sOverrides.destroy();const t=this.view.resourceController?.memoryController;this._i3sOverrides=new V({view:this.view,layer:e,memoryController:t}),i(this._queryEngine),this._setupQueryEngine(),this.processor.resetObjectStates()})):null}initialize(){this.addResolvingPromise(this.layer.indexInfo);const e=this.view.resourceController?.memoryController;this._i3sOverrides=new V({view:this.view,layer:this.layer,memoryController:e}),M(this.layer,this.view.spatialReference,this.view.viewingMode),this._fieldsHelper=new z({layerView:this}),this._updatingHandles.add((()=>this.layer.rangeInfos),(e=>this._rangeInfosChanged(e)),s),this._updatingHandles.add((()=>this.layer.renderer),((e,t)=>this._rendererChange(e,t))),this._updatingHandles.add((()=>[this.parsedDefinitionExpression,this._excludeObjectIdsSorted]),(()=>this._filterChange())),this.addHandles(o((()=>Z.I3S_TREE_SHOW_TILES),(e=>{if(e&&!this._treeDebugger){const e=this._controller.crsIndex;import("./support/I3STreeDebugger.js").then((({I3STreeDebugger:t})=>{!this._treeDebugger&&Z.I3S_TREE_SHOW_TILES&&(this._treeDebugger=new t({lv:this,view:this.view,nodeSR:e}))}))}else e||!this._treeDebugger||Z.I3S_TREE_SHOW_TILES||(this._treeDebugger.destroy(),this._treeDebugger=null)}),s)),this._set("processor",new S({owner:this,preferredUpdatePolicy:J.ASYNC,scaleVisibilityEnabled:!0,filterVisibilityEnabled:!0,timeExtentEnabled:!1,frustumVisibilityEnabled:!1,elevationAlignmentEnabled:!0,elevationFeatureExpressionEnabled:!1,setUidToIdOnAdd:!1,dataExtent:this.layer.fullExtent,updateClippingExtent:e=>this._updateClippingExtent(e)})),this.processor.elevationAlignment?.events.on("invalidate-elevation",(({extent:e,spatialReference:t})=>this._controller.updateElevationChanged(e,t))),this.supportsHeightUnitConversion&&(this._verticalScale=b("point",this.layer.spatialReference,this.view.spatialReference)),this.addResolvingPromise(this.processor.when()),this._memCache=this.view.resourceController.memoryController.newCache(`psl-${this.uid}`),this._controller=new w({layerView:this}),H(this.layer.geometryDefinitions)&&(this._worker=new C((e=>this.view.resourceController.immediate.schedule(e)))),this.addHandles(this.layer.on("apply-edits",(e=>this._updatingHandles.addPromise(e.result)))),this.addHandles(this.layer.on("edits",(e=>{const t=this._pendingEditsQueue.then((()=>this._handleEdits(e))).then();this._pendingEditsQueue=t,this._updatingHandles.addPromise(t)}))),this.when((()=>{this._setupQueryEngine(),this._updatingHandles.add((()=>this.maximumNumberOfFeatures),(e=>this._controller.featureTarget=e),s),this._updatingHandles.add((()=>this.suspended),(e=>{e&&this._removeAllNodeData()}))}))}destroy(){this._treeDebugger=i(this._treeDebugger),this._i3sOverrides=i(this._i3sOverrides),this._set("processor",i(this.processor)),this._controller=i(this._controller),this._queryEngine=i(this._queryEngine),this._worker=i(this._worker),this._memCache=i(this._memCache),this.loadedGraphics.clear(),this._fieldsHelper=i(this._fieldsHelper)}get i3slayer(){return this.layer}get updatingProgressValue(){return this._controller?.updatingProgress??1}get requiredFields(){return this._fieldsHelper?.requiredFields??[]}get maximumNumberOfFeatures(){const e=this.processor?.graphicsCore?.displayFeatureLimit;return e?.maximumNumberOfFeatures??0}set maximumNumberOfFeatures(e){null!=e?(this._override("maximumNumberOfFeatures",e),this._controller.fixedFeatureTarget=!0):(this._clearOverride("maximumNumberOfFeatures"),this._controller.fixedFeatureTarget=!1)}get maximumNumberOfFeaturesExceeded(){return!this.suspended&&(!!this._controller?.useMaximumNumberOfFeatures&&!this._controller.leavesReached)}get _excludeObjectIdsSorted(){const e=this.layer.excludeObjectIds;return e.length?e.toArray().sort(((e,t)=>e-t)):null}get lodFactor(){return"Labels"===this.layer.semantic?1:this.view.qualitySettings.sceneService.point.lodFactor}get hasM(){return!1}get hasZ(){return!0}get contentVisible(){return!this.suspended&&!!this._controller?.rootNodeVisible}get legendEnabled(){return this.contentVisible&&!0===this.i3slayer?.legendEnabled}async whenGraphicAttributes(e,t){return Q(this.layer,e,this._getObjectIdField(),t,(()=>[...this.loadedGraphics.nodes()]))}getHit(e){if(!this.loadedGraphics)return null;const t=E(this.loadedGraphics.find((t=>t.uid===e)),this.layer),r=this._getObjectIdField();return t?.attributes?.[r]?(t.layer=this.layer,t.sourceLayer=this.layer,{type:"graphic",graphic:t,layer:t.layer}):null}whenGraphicBounds(e,t){return this.processor.whenGraphicBounds(e,t)}computeAttachmentOrigin(e,t){return this.processor.computeAttachmentOrigin(e,t)}isUpdating(){return!!(this._controller?.updating||this.processor?.updating||this._fieldsHelper?.updating||this.layerFilterUpdating)}highlight(e){return this.processor.highlight(e,this.layer.objectIdField)}get updatePolicy(){return this.processor.graphicsCore.effectiveUpdatePolicy}createInteractiveEditSession(e){return G(this._attributeEditingContext,e)}async _decompressBinaryPointData(e,t){const r={geometryBuffer:e.geometryBuffer};null==this._worker&&(this._worker=new C((e=>this.view.resourceController.immediate.schedule(e))));const i=await this._worker.invoke(r,t);if(null==i)throw new Error("Failed to decompress Draco point data");return{positionData:i.positions,featureIds:i.featureIds}}async addNode(e,t,i){if(!ne(t)&&!ae(t))throw new Error;if(this.loadedGraphics.hasNode(e.index))return void r.getLogger(this).error("I3S node "+e.id+" already added");const s=null!=this.layer.fullExtent?ue(this.layer.fullExtent.clone(),.5):null,{featureIds:o,pointPositions:a}=ne(t)?await this._extractBinaryPointPositions(e,t,i):this._extractLegacyPointPositions(t),n=new Array;this._validatePositions(e,o,a,s,n);const l=this._controller.crsVertex,d=this.view.spatialReference;c(a,l,0,a,d,0,o.length);const u=ne(t)?e.level:0,h=this._createGraphics(o,a,e.index,u),p=new ie(h,o,t.attributeDataInfo,e);if(await this._i3sOverrides.applyAttributeOverrides(p.featureIds,t.attributeDataInfo,i),e.numFeatures=p.graphics.length,this._updateNodeMemory(e),de(p),n.length>0&&(this._computeObb(e,n,l),this._controller.updateVisibility(e.index)),!this._controller.isGeometryVisible(e))return void this._cacheNodeData(p);if(null!=this._verticalScale)for(const r of p.graphics)this._verticalScale(r.geometry);const g=this.view._stage.renderView.objectAndLayerIdRenderHelper;if(null!=g){const e=O(this.view.map,this.layer.uid);for(let t=0;t<p.featureIds.length;t++){const r=p.featureIds[t];g.setUidToObjectAndLayerId(r,p.graphics[t].uid,this.layer.id,this.layer.uid,this.layer.popupEnabled&&!e&&ee(this.layer,this.view.popup?.defaultPopupTemplateEnabled),p.node.resources.attributes,t)}}this.loadedGraphics.addNode(e.index,p),this._controller.updateLoadStatus(e.index,!0),this._filterNode(p),this._treeDebugger&&this._treeDebugger.update()}_computeObb(e,t,r){const i=this._controller.crsIndex,s=i.isGeographic?this.view.renderSpatialReference:i;c(t,r,0,t,s,0,t.length/3),e.serviceObbInIndexSR=K(new $(t,3)),i.isGeographic&&(g(e.serviceObbInIndexSR.center,s,pe,i),e.serviceObbInIndexSR.center=pe)}isNodeLoaded(e){return this.loadedGraphics.hasNode(e)}isNodeReloading(){return!1}updateNodeState(){}async _extractBinaryPointPositions(e,t,r){const i=await this._decompressBinaryPointData(t,r),s=i.positionData,o=3,a=s.length/o,n=f(3*a),l=null!=e.serviceObbInIndexSR?e.serviceObbInIndexSR.center:h,d=Math.abs(l[2])*2**-20;for(let u=0;u<a;u++){const e=u*o;n[e]=s[e]+l[0],n[e+1]=s[e+1]+l[1],n[e+2]=s[e+2]+l[2],Math.abs(n[e+2])<d&&(n[e+2]=0)}return{featureIds:i.featureIds?_(i.featureIds):[],pointPositions:n}}_extractLegacyPointPositions(e){const t=e.pointData.length,r=f(3*t),i=new Array;for(let s=0;s<t;s++){const t=e.pointData[s],o=t.featureDataPosition,a=o.length,n=t.geometries?.[0]??he[a],l=t.featureIds[0];if("Embedded"!==n.type||"points"!==n.params.type||a<2||a>3)continue;const d=n.params.vertexAttributes?.position??[0,0,0],u=3*i.length;r[u]=o[0]+d[0],r[u+1]=o[1]+d[1],r[u+2]=3===a?o[2]+d[2]:NaN,i.push(l)}return{featureIds:i,pointPositions:r}}_validatePositions(e,t,i,s,o){if(null==s&&e.serviceObbInIndexSR)return;const a=t.length,n=3;for(let l=0;l<a;l++){const t=l*n;u(pe,i[t],i[t+1],i[t+2]);const a=!Number.isNaN(i[2]);null==s||(a?m(s,pe):y(s,pe))||(this._coordinatesOutsideExtentErrors<this._maxCoordinatesOutsideExtentErrors&&r.getLogger(this).error("Service Error: Coordinates outside of layer extent"),this._coordinatesOutsideExtentErrors+1===this._maxCoordinatesOutsideExtentErrors&&r.getLogger(this).error("Maximum number of errors reached. Further errors are ignored."),this._coordinatesOutsideExtentErrors++),e.serviceObbInIndexSR||o.push(pe[0],pe[1],pe[2])}}_createGraphics(e,t,r,i){const s=e.length,o=3,a=this._getObjectIdField(),l=this.processor.graphicsCore,d=new Array,u=this.view.spatialReference;for(let h=0;h<s;h++){const s=e[h],p={};null!=s&&(p[a]=s);const c=s??n(),g=h*o,m=isNaN(t[g+2])?void 0:t[g+2],y=x(t[g],t[g+1],m,u),f=this.loadedGraphics.get(c);if(null!=f)(null==f.level||f.level<i)&&(ce.property="geometry",ce.graphic=f,ce.oldValue=f.geometry,ce.newValue=y,f.geometry=y,f.level=i,l.graphicUpdateHandler(ce)),d.push(f);else{const e=n();d.push({objectId:c,uid:e,geometry:y,attributes:p,visible:!0,nodeIndex:r,level:i})}}return d}_updateNodeMemory(e){e.memory=4096+(null!=e.numFeatures?e.numFeatures*this.processor.graphicsCore.usedMemoryPerGraphic:0)}_cacheNodeData(e){const t=e.graphics.reduce(((e,t)=>I(t)+e),a(e.featureIds)+1024);this._memCache.put(this._getMemCacheKey(e.node),e,t)}_getMemCacheKey(e){return`${e.index}`}_removeAllNodeData(){this.loadedGraphics.forEachNode(((e,t)=>{if(e){const t=e.node;this._updateNodeMemory(t),this._cacheNodeData(e)}this._controller.updateLoadStatus(t,!1)})),this._treeDebugger&&this._treeDebugger.update(),this.loadedGraphics.clear()}removeNode(e){const t=this._removeNodeStageData(e);t&&(this._updateNodeMemory(t.node),this._cacheNodeData(t))}_removeNodeStageData(e){const t=this.loadedGraphics.getNode(e);return null==t?null:(this._controller.updateLoadStatus(e,!1),this.loadedGraphics.removeNode(e),this._treeDebugger&&this._treeDebugger.update(),t)}async loadCachedNodeData(e){return this._memCache?.pop(this._getMemCacheKey(e))}async addCachedNodeData(e,t,i,s){this.loadedGraphics.hasNode(e.index)?r.getLogger(this).error("I3S node "+e.id+" already added"):(await this._i3sOverrides.applyAttributeOverrides(t.featureIds,i,s),t.attributeInfo=i,this.loadedGraphics.addNode(e.index,t),this._controller.updateLoadStatus(e.index,!0),this._updateNodeMemory(e),de(t),this._filterNode(t),this._treeDebugger&&this._treeDebugger.update())}getLoadedNodeIds(){const e=[];return this.loadedGraphics.forEachNode((t=>e.push(t.node.id))),e.sort()}getVisibleNodes(){const e=new Array;return this.loadedGraphics.forEachNode((t=>e.push(t.node))),e}getLoadedNodeIndices(e){this.loadedGraphics.forEachNode(((t,r)=>e.push(r)))}getLoadedAttributes(e){const t=this.loadedGraphics.getNode(e);if(null!=t?.attributeInfo)return t.attributeInfo.loadedAttributes}getAttributeData(e){const t=this.loadedGraphics.getNode(e);if(null!=t?.attributeInfo)return t.attributeInfo.attributeData}_setAttributeData(e,t){const r=this.loadedGraphics.getNode(e);null!=r?.attributeInfo&&(r.attributeInfo.attributeData=t,this._attributeValuesChanged(r))}async updateAttributes(e,t,r){const i=this.loadedGraphics.getNode(e);null!=i&&(await this._i3sOverrides.applyAttributeOverrides(i.featureIds,t,r),i.attributeInfo=t,this._attributeValuesChanged(i))}_attributeValuesChanged(e){de(e),this._filterNode(e);const{processor:t}=this,{graphicsCore:r}=t;if(r.labelsEnabled){const t=e.node.index,i=new Array;e.graphics.forEach((e=>e.nodeIndex===t&&i.push(e.uid))),r.updateLabelingInfo(i)}t.refreshFilter()}_updateClippingExtent(e){return this._controller&&this._controller.updateClippingArea(e),!1}_getObjectIdField(){return this.layer.objectIdField||v}_getGlobalIdField(){return this.layer.associatedLayer?.globalIdField}async _rendererChange(e,t){const{layer:{fieldsIndex:r}}=this,i=new Set;let s,o;e?(await e.collectRequiredFields(i,r),s=Array.from(i).sort()):s=[],i.clear(),t?(await t.collectRequiredFields(i,r),o=Array.from(i).sort()):o=[],s.length===o.length&&s.every(((e,t)=>s[t]===o[t]))||this._reloadAllNodes()}_rangeInfosChanged(e){null!=e&&e.length>0&&r.getLogger(this).warn("Unsupported property: rangeInfos are currently only serialized to and from web scenes but do not affect rendering.")}_filterChange(){this.loadedGraphics.forEachNode((e=>this._filterNode(e)))}_reloadAllNodes(){this._removeAllNodeData(),this._controller&&this._controller.restartNodeLoading()}_filterNode(e){const r=this.parsedDefinitionExpression,i=this._excludeObjectIdsSorted,s=this._getObjectIdField();for(const o of e.graphics){const e=o.visible,a=!r||this._evaluateClause(r,o),n=null==i||t(i,o.attributes[s])<0;o.visible=a&&n,e!==o.visible&&(ce.graphic=o,ce.property="visible",ce.oldValue=e,ce.newValue=o.visible,this.processor.graphicsCore.graphicUpdateHandler(ce))}}createQuery(){const e={outFields:["*"],returnGeometry:!0,outSpatialReference:this.view.spatialReference};return null!=this.filter?this.filter.createQuery(e):new j(e)}queryFeatures(e,t){return this._queryEngine.executeQuery(this._ensureQuery(e),t?.signal)}queryObjectIds(e,t){return this._queryEngine.executeQueryForIds(this._ensureQuery(e),t?.signal)}queryFeatureCount(e,t){return this._queryEngine.executeQueryForCount(this._ensureQuery(e),t?.signal)}queryExtent(e,t){return this._queryEngine.executeQueryForExtent(this._ensureQuery(e),t?.signal)}_ensureQuery(e){return this._addDefinitionExpressionToQuery(null==e?this.createQuery():j.from(e))}_setupQueryEngine(){const e=()=>this.processor.featureStore;this._queryEngine=new D({context:{spatialReference:this.view.spatialReference,layer:this.layer,scheduler:this.view.resourceController.scheduler,get featureStore(){return e()},hasZ:this.hasZ,hasM:this.hasM},priority:te.FEATURE_QUERY_ENGINE})}get usedMemory(){return this.processor?.graphicsCore?.usedMemory??0}get unloadedMemory(){return.8*((this._controller?.unloadedMemoryEstimate??0)+(this.processor?.graphicsCore?.unprocessedMemoryEstimate??0))}get ignoresMemoryFactor(){return this._controller&&this._controller.fixedFeatureTarget}async _handleEdits(e){const t=this._attributeEditingContext,r=await A(t,e);P(t,r)}get _attributeEditingContext(){const e=this._getObjectIdField(),t=this._getGlobalIdField();return{sessions:this._interactiveEditingSessions,fieldsIndex:this.layer.fieldsIndex,objectIdField:e,globalIdField:t,forEachNode:e=>this.loadedGraphics.forEachNode((t=>e(t.node,t.featureIds))),attributeStorageInfo:this.i3slayer.attributeStorageInfo??[],i3sOverrides:this._i3sOverrides,getAttributeData:e=>this.getAttributeData(e),setAttributeData:(t,r,i)=>{this._setAttributeData(t,r);const s=this.loadedGraphics.getNode(t);if(null!=i){const t=this.loadedGraphics.get(i.attributes[e]);null!=t&&this.processor.graphicsCore.recreateGraphics([t])}else null!=s&&this.processor.graphicsCore.recreateGraphics(s.graphics)},clearMemCache:()=>{}}}get performanceInfo(){return new B(this.usedMemory,this.loadedGraphics.length,-1,this.maximumNumberOfFeatures,this.loadedGraphics.nodeCount,this.processor.graphicsCore.performanceInfo)}get test(){}};e([l()],se.prototype,"processor",void 0),e([l({type:N})],se.prototype,"filter",void 0),e([l()],se.prototype,"loadedGraphics",void 0),e([l()],se.prototype,"i3slayer",null),e([l()],se.prototype,"_controller",void 0),e([l()],se.prototype,"updating",void 0),e([l()],se.prototype,"suspended",void 0),e([l()],se.prototype,"holeFilling",void 0),e([l(Y)],se.prototype,"updatingProgress",void 0),e([l()],se.prototype,"updatingProgressValue",null),e([l(re.requiredFields)],se.prototype,"requiredFields",null),e([l(re.availableFields)],se.prototype,"availableFields",void 0),e([l()],se.prototype,"_fieldsHelper",void 0),e([l({type:Number})],se.prototype,"maximumNumberOfFeatures",null),e([l({readOnly:!0})],se.prototype,"maximumNumberOfFeaturesExceeded",null),e([l()],se.prototype,"_excludeObjectIdsSorted",null),e([l({readOnly:!0})],se.prototype,"lodFactor",null),e([l({readOnly:!0})],se.prototype,"hasM",null),e([l({readOnly:!0})],se.prototype,"hasZ",null),e([l()],se.prototype,"contentVisible",null),e([l({readOnly:!0})],se.prototype,"legendEnabled",null),se=e([d("esri.views.3d.layers.SceneLayerGraphicsView3D")],se);const oe=se;function ae(e){return"pointData"in e}function ne(e){return"geometryBuffer"in e&&null!==e.geometryBuffer}function le(e,t,r){const i=t.attributeInfo;if(null==i?.loadedAttributes||null==i.attributeData)return!1;let s=!1;for(const{name:o}of i.loadedAttributes)if(i.attributeData[o]){const t=q(i.attributeData[o],r);t!==e.attributes[o]&&(e.attributes[o]=t,s=!0)}return s}function de(e){const t=e.attributeInfo,r=e.node.index;if(null!=t?.loadedAttributes&&null!=t.attributeData)for(let i=0;i<e.graphics.length;i++){const s=e.graphics[i];if(s.nodeIndex===r){s.attributes||(s.attributes={});for(const{name:e}of t.loadedAttributes)t.attributeData[e]&&(s.attributes[e]=q(t.attributeData[e],i))}}}function ue(e,t){return e.xmin-=t,e.ymin-=t,e.xmax+=t,e.ymax+=t,null!=e.zmin&&null!=e.zmax&&(e.zmin-=t,e.zmax+=t),null!=e.mmin&&null!=e.mmax&&(e.mmin-=t,e.mmax+=t),e}const he={2:{type:"Embedded",params:{type:"points",vertexAttributes:{position:[0,0]}}},3:{type:"Embedded",params:{type:"points",vertexAttributes:{position:[0,0,0]}}}},pe=p(),ce={graphic:null,property:null,oldValue:null,newValue:null};export{oe 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.31/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../chunks/tslib.es6.js";import r from"../../../core/Error.js";import{watch as t}from"../../../core/reactiveUtils.js";import{property as i}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as o}from"../../../core/accessorSupport/decorators/subclass.js";import{StreamController as s}from"../../../layers/graphics/controllers/StreamController.js";import n from"../../../rest/support/Query.js";import{FeatureLikeLayerView3D as a}from"./FeatureLikeLayerView3D.js";import{LayerView3D as p}from"./LayerView3D.js";import{StreamGraphics3DGraphicsPipeline as c}from"./graphics/StreamGraphics3DGraphicsPipeline.js";import{UpdatePolicy as l}from"../webgl-engine/lib/UpdatePolicy.js";import h from"../../layers/LayerView.js";import m from"../../layers/StreamLayerView.js";let u=class extends(m(a(p(h)))){constructor(){super(...arguments),this.type="stream-3d",this.updatePolicy=l.ASYNC,this.hasZ=!0,this.hasM=!1}initialize(){this.addHandles(t((()=>this.suspended),(e=>{this.graphicsPipeline&&this._onSuspendedChange(e)})))}get connectionError(){const e=this.graphicsPipeline?.connection?.errorString;return e?new r("stream-controller",e):null}createQuery(){return new n({outFields:["*"],returnGeometry:!0,outSpatialReference:this.view.spatialReference})}queryLatestObservations(e,r){return this.queryEngine.executeQueryForLatestObservations(this._ensureQuery(e),r?.signal)}get _streamConnectionStatus(){return this.graphicsPipeline?.connection?.connectionStatus??"disconnected"}createGraphicsPipeline(){return new c({layerView:this})}createController(){return new s({layer:this.layer,layerView:this})}beforeSetController(){}_doPause(){this.graphicsPipeline?.pause()}_doResume(){this.graphicsPipeline?.resume()}_doDisconnect(){this.graphicsPipeline?.disconnect(),this._doPause()}_doConnect(){this.graphicsPipeline?.connect(),this.resume()}_doClear(){this.graphicsPipeline?.clear()}};e([i({readOnly:!0})],u.prototype,"updatePolicy",void 0),e([i({readOnly:!0})],u.prototype,"connectionError",null),e([i()],u.prototype,"graphicsPipeline",void 0),e([i({readOnly:!0})],u.prototype,"hasZ",void 0),e([i({readOnly:!0})],u.prototype,"hasM",void 0),e([i({readOnly:!0})],u.prototype,"_streamConnectionStatus",null),u=e([o("esri.views.3d.layers.StreamLayerView3D")],u);const d=u;export{d as default};
5
+ import{_ as e}from"../../../chunks/tslib.es6.js";import r from"../../../core/Error.js";import{watch as t}from"../../../core/reactiveUtils.js";import{property as i}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as s}from"../../../core/accessorSupport/decorators/subclass.js";import{StreamController as o}from"../../../layers/graphics/controllers/StreamController.js";import n from"../../../rest/support/Query.js";import{FeatureLikeLayerView3D as a}from"./FeatureLikeLayerView3D.js";import{LayerView3D as p}from"./LayerView3D.js";import{StreamGraphics3DGraphicsPipeline as c}from"./graphics/StreamGraphics3DGraphicsPipeline.js";import{UpdatePolicy as l}from"../webgl-engine/lib/UpdatePolicy.js";import h from"../../layers/LayerView.js";import m from"../../layers/StreamLayerView.js";let u=class extends(m(a(p(h)))){constructor(){super(...arguments),this.type="stream-3d",this.updatePolicy=l.ASYNC,this.hasZ=!0,this.hasM=!1}initialize(){this.addHandles(t((()=>this.suspended),(e=>{this.graphicsPipeline&&this._onSuspendedChange(e)})))}get connectionError(){const e=this.graphicsPipeline?.connection?.errorString;return e?new r("stream-controller",e):null}createQuery(){return new n({outFields:["*"],returnGeometry:!0,outSpatialReference:this.view.spatialReference})}queryLatestObservations(e,r){return this.queryEngine.executeQueryForLatestObservations(this._ensureQuery(e),r?.signal)}get _streamConnectionStatus(){return this.graphicsPipeline?.connection?.connectionStatus??"disconnected"}async createGraphicsPipeline(){return new c({layerView:this})}createController(){return new o({layer:this.layer,layerView:this})}beforeSetController(){}_doPause(){this.graphicsPipeline?.pause()}_doResume(){this.graphicsPipeline?.resume()}_doDisconnect(){this.graphicsPipeline?.disconnect(),this._doPause()}_doConnect(){this.graphicsPipeline?.connect(),this.resume()}_doClear(){this.graphicsPipeline?.clear()}};e([i({readOnly:!0})],u.prototype,"updatePolicy",void 0),e([i({readOnly:!0})],u.prototype,"connectionError",null),e([i()],u.prototype,"graphicsPipeline",void 0),e([i({readOnly:!0})],u.prototype,"hasZ",void 0),e([i({readOnly:!0})],u.prototype,"hasM",void 0),e([i({readOnly:!0})],u.prototype,"_streamConnectionStatus",null),u=e([s("esri.views.3d.layers.StreamLayerView3D")],u);const y=u;export{y as default};