@arcgis/core 4.34.0-next.53 → 4.34.0-next.55

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 (340) hide show
  1. package/analysis/ElevationProfile/ElevationProfileGroundLine.d.ts +4 -0
  2. package/analysis/ElevationProfile/ElevationProfileGroundLine.js +5 -0
  3. package/analysis/ElevationProfile/ElevationProfileInputLine.d.ts +4 -0
  4. package/analysis/ElevationProfile/ElevationProfileInputLine.js +5 -0
  5. package/analysis/ElevationProfile/ElevationProfileLine.d.ts +4 -0
  6. package/analysis/ElevationProfile/ElevationProfileLine.js +5 -0
  7. package/analysis/ElevationProfile/ElevationProfileLineChartOptions.d.ts +4 -0
  8. package/analysis/ElevationProfile/{LineChartOptions.js → ElevationProfileLineChartOptions.js} +1 -1
  9. package/analysis/ElevationProfile/ElevationProfileLineViewOptions.d.ts +4 -0
  10. package/analysis/ElevationProfile/{LineViewOptions.js → ElevationProfileLineViewOptions.js} +1 -1
  11. package/analysis/ElevationProfile/ElevationProfileQueryLine.d.ts +4 -0
  12. package/analysis/ElevationProfile/ElevationProfileQueryLine.js +5 -0
  13. package/analysis/ElevationProfile/ElevationProfileSceneLine.d.ts +4 -0
  14. package/analysis/ElevationProfile/ElevationProfileSceneLine.js +5 -0
  15. package/analysis/ElevationProfile/ElevationProfileUnits.d.ts +4 -0
  16. package/analysis/ElevationProfile/{Units.js → ElevationProfileUnits.js} +1 -1
  17. package/analysis/ElevationProfile/ElevationProfileViewOptions.d.ts +4 -0
  18. package/analysis/ElevationProfile/{ViewOptions.js → ElevationProfileViewOptions.js} +1 -1
  19. package/analysis/ElevationProfile/elevationProfileLineTypes.js +1 -1
  20. package/analysis/ElevationProfileAnalysis.js +1 -1
  21. package/applications/Components/formatUtils.d.ts +3 -0
  22. package/applications/Components/formatUtils.js +5 -0
  23. package/applications/KnowledgeStudio/resourceSerializationUtils.js +1 -1
  24. package/assets/esri/core/workers/RemoteClient.js +1 -1
  25. package/assets/esri/core/workers/chunks/01e8b9dc77a57d1c2a52.js +1 -0
  26. package/assets/esri/core/workers/chunks/027cfcde29fe87aa2ffe.js +1 -0
  27. package/assets/esri/core/workers/chunks/{e58336aafe8c95bb6831.js → 0eb728cee6e40cb30c01.js} +1 -1
  28. package/assets/esri/core/workers/chunks/18ceea59e469a0f2721b.js +1 -0
  29. package/assets/esri/core/workers/chunks/199a17b0a0f75cbaed16.js +1 -0
  30. package/assets/esri/core/workers/chunks/1eee7cf11df01a52c1bf.js +1 -0
  31. package/assets/esri/core/workers/chunks/{ac41b882f9cbf8d56f0c.js → 222f981e876f60ae282f.js} +1 -1
  32. package/assets/esri/core/workers/chunks/22334a464f798b5279b2.js +1 -0
  33. package/assets/esri/core/workers/chunks/{99b9392946d776a62997.js → 23e600e368ac829680b5.js} +1 -1
  34. package/assets/esri/core/workers/chunks/23f54b49742098def8ae.js +1 -0
  35. package/assets/esri/core/workers/chunks/24ac204d8a045aa821be.js +1 -0
  36. package/assets/esri/core/workers/chunks/252ee00fd6c4ae0ee7fa.js +1 -0
  37. package/assets/esri/core/workers/chunks/27197b0a2ffb2b6104ea.js +1 -0
  38. package/assets/esri/core/workers/chunks/{93af38d29d066f27ed28.js → 2cb14d040e67a261b31c.js} +1 -1
  39. package/assets/esri/core/workers/chunks/{0021118bafefd1e47ff7.js → 31c088966ccfff2ea1db.js} +1 -1
  40. package/assets/esri/core/workers/chunks/3b51b61a7b8a1ef87c9b.js +1 -0
  41. package/assets/esri/core/workers/chunks/3d800fbc449bea18b1cd.js +1 -0
  42. package/assets/esri/core/workers/chunks/435169b455fd2846799b.js +1 -0
  43. package/assets/esri/core/workers/chunks/4874aabdb5c60ca66216.js +1 -0
  44. package/assets/esri/core/workers/chunks/4d2473e680324dc17cfa.js +1 -0
  45. package/assets/esri/core/workers/chunks/{2da12a64d3baef4aaaa1.js → 4f8dab492331c9a2d67a.js} +1 -1
  46. package/assets/esri/core/workers/chunks/527557b603400189d49a.js +1 -0
  47. package/assets/esri/core/workers/chunks/{4bd92232928b832dea76.js → 5900dde7a201a7d47469.js} +1 -1
  48. package/assets/esri/core/workers/chunks/62ade6f18b375795ddfd.js +1 -0
  49. package/assets/esri/core/workers/chunks/63f3e46bfa820436161c.js +1 -0
  50. package/assets/esri/core/workers/chunks/{b0ee061747bef6729bb9.js → 6801b92bce7a918fda6f.js} +1 -1
  51. package/assets/esri/core/workers/chunks/6940bb6524938894a246.js +1 -0
  52. package/assets/esri/core/workers/chunks/69e6000044bfb03776ac.js +1 -0
  53. package/assets/esri/core/workers/chunks/6b11476b2004b4db576e.js +1 -0
  54. package/assets/esri/core/workers/chunks/71cac356874b36f9a383.js +1 -0
  55. package/assets/esri/core/workers/chunks/{69dc5a7abc1fda2474ad.js → 722931d1a60be461e521.js} +1 -1
  56. package/assets/esri/core/workers/chunks/79ab06fb4c91ac8da323.js +1 -0
  57. package/assets/esri/core/workers/chunks/{0a4357af5b8c0532b439.js → 7bdfc7c7ce1d94c00745.js} +1 -1
  58. package/assets/esri/core/workers/chunks/813efde41e90e652b7db.js +1 -0
  59. package/assets/esri/core/workers/chunks/82404ff7c298493ff6f4.js +1 -0
  60. package/assets/esri/core/workers/chunks/{0ce671588de2858516d2.js → 83737d86584bf1b32368.js} +1 -1
  61. package/assets/esri/core/workers/chunks/{98ea12c7a000a30f3dc0.js → 87f68c2b9361bd3f8cac.js} +1 -1
  62. package/assets/esri/core/workers/chunks/97ae2fdb6cb98249f5fa.js +1 -0
  63. package/assets/esri/core/workers/chunks/9a20390602126995f831.js +1 -0
  64. package/assets/esri/core/workers/chunks/9cdeead9d444e8d95477.js +1 -0
  65. package/assets/esri/core/workers/chunks/a778a72456fefdf40115.js +1 -0
  66. package/assets/esri/core/workers/chunks/a999f804fc2f00b2e7ae.js +1 -0
  67. package/assets/esri/core/workers/chunks/ae73ac81bd10614c2b53.js +1 -0
  68. package/assets/esri/core/workers/chunks/c7d4c296011c5393bcaa.js +1 -0
  69. package/assets/esri/core/workers/chunks/c86e339e45900c54c9f5.js +1 -0
  70. package/assets/esri/core/workers/chunks/{a1d3f1c221389eb6090c.js → c95e6bef8c97cf647869.js} +1 -1
  71. package/assets/esri/core/workers/chunks/cbec768cd98caff212f2.js +1 -0
  72. package/assets/esri/core/workers/chunks/d81c4afad4abe2d1d0b9.js +1 -0
  73. package/assets/esri/core/workers/chunks/dd120d562b63618e71c0.js +1 -0
  74. package/assets/esri/core/workers/chunks/dfb12f42b8d319ffa5fc.js +1 -0
  75. package/assets/esri/core/workers/chunks/e04951ee32f041faaeca.js +1 -0
  76. package/assets/esri/core/workers/chunks/e982cf44906eb26164f2.js +1 -0
  77. package/assets/esri/core/workers/chunks/{081b22fa73ef7b696409.js → ead1acf95c3385630da8.js} +2 -2
  78. package/assets/esri/core/workers/chunks/f1c50f37a81c672263a1.js +1 -0
  79. package/assets/esri/core/workers/chunks/fe5c37c69da3ec1e56ac.js +1 -0
  80. package/assets/esri/core/workers/chunks/ff323db554c9e09749e8.js +1 -0
  81. package/assets/esri/libs/parquet/pkg/bundle_bg.wasm +0 -0
  82. package/chunks/Laserlines.glsl.js +1 -1
  83. package/chunks/LineSeries.js +1 -1
  84. package/chunks/Theme.js +1 -1
  85. package/chunks/boundedPlane.js +1 -1
  86. package/chunks/bundle.js +1 -1
  87. package/chunks/chartUtilsAm5.js +1 -1
  88. package/chunks/sphere.js +1 -1
  89. package/chunks/vec42.js +1 -1
  90. package/config.js +1 -1
  91. package/core/ArrayPool.js +1 -1
  92. package/core/Collection.js +1 -1
  93. package/core/ObjectPool.js +1 -1
  94. package/core/accessorSupport/Properties.js +1 -1
  95. package/core/accessorSupport/watch.js +1 -1
  96. package/core/arrayUtils.js +1 -1
  97. package/core/libs/gl-matrix-2/math/quat.js +1 -1
  98. package/core/libs/gl-matrix-2/math/vec4.js +1 -1
  99. package/core/pbf.js +1 -1
  100. package/core/typedArrayUtil.js +1 -1
  101. package/geohash/GeohashCell.js +1 -1
  102. package/geohash/GeohashTree.js +1 -1
  103. package/geometry/operators/json/graphicBufferOperator.js +5 -0
  104. package/geometry/support/DoubleArray.js +1 -1
  105. package/geometry/support/boundedPlane.js +1 -1
  106. package/geometry/support/coordinateSystem.js +1 -1
  107. package/geometry/support/meshUtils/exporters/gltf/gltf.js +1 -1
  108. package/geometry/support/sphere.js +1 -1
  109. package/interfaces.d.ts +232 -322
  110. package/kernel.js +1 -1
  111. package/layers/graphics/controllers/I3SOnDemandController.js +1 -1
  112. package/layers/graphics/sources/ParquetSource.js +1 -1
  113. package/layers/graphics/sources/support/ParquetSourceWorker.js +1 -1
  114. package/networks/support/typeUtils.js +1 -1
  115. package/package.json +1 -1
  116. package/rest/knowledgeGraphService.js +1 -1
  117. package/rest/networks/support/Circuit.js +5 -0
  118. package/rest/networks/support/CircuitSection.js +1 -1
  119. package/rest/networks/support/Subcircuit.js +1 -1
  120. package/rest/print.js +1 -1
  121. package/support/revision.js +1 -1
  122. package/symbols/cim/CIMEffects.js +1 -1
  123. package/symbols/cim/CIMSymbolDrawHelper.js +1 -1
  124. package/symbols/cim/effects/EffectOffset.js +1 -1
  125. package/views/2d/analysisViewModuleImportUtils.js +5 -0
  126. package/views/2d/engine/Container.js +1 -1
  127. package/views/2d/engine/DisplayObject.js +1 -1
  128. package/views/2d/engine/flow/dataUtils.js +1 -1
  129. package/views/2d/engine/webgl/AttributeStoreView.js +1 -1
  130. package/views/2d/engine/webgl/DisplayEntity.js +1 -1
  131. package/views/2d/engine/webgl/DisplayRecord.js +1 -1
  132. package/views/2d/engine/webgl/FeatureDisplayList.js +1 -1
  133. package/views/2d/engine/webgl/FeatureTile.js +1 -1
  134. package/views/2d/engine/webgl/PooledUint32Array.js +1 -1
  135. package/views/2d/engine/webgl/cpuMapped/Buffer.js +1 -1
  136. package/views/2d/engine/webgl/cpuMapped/MappedMesh.js +1 -1
  137. package/views/2d/engine/webgl/shaderGraph/techniques/labels/LabelMeshWriter.js +1 -1
  138. package/views/2d/input/MapViewInputManager.js +1 -1
  139. package/views/2d/interactive/editingTools/TransformTool.js +1 -1
  140. package/views/2d/interactive/editingTools/manipulations/ScaleManipulation.js +1 -1
  141. package/views/2d/layers/FeatureLayerView2D.js +1 -1
  142. package/views/2d/layers/LayerView2D.js +1 -1
  143. package/views/2d/layers/features/FeatureContainer.js +1 -1
  144. package/views/2d/layers/features/FeaturePipelineWorker.js +1 -1
  145. package/views/2d/layers/features/FeatureSourceEventLog.js +1 -1
  146. package/views/2d/layers/features/FeatureSpatialIndex.js +1 -1
  147. package/views/2d/layers/features/Processor.js +1 -1
  148. package/views/2d/layers/features/RenderState.js +1 -1
  149. package/views/2d/layers/features/aggregation/AccumulatedStatistics.js +1 -1
  150. package/views/2d/layers/features/aggregation/GeohashSpatialIndex.js +1 -1
  151. package/views/2d/layers/features/aggregation/GridCell.js +1 -1
  152. package/views/2d/layers/features/aggregation/GridSpatialIndex.js +1 -1
  153. package/views/2d/layers/features/processor/AProcessorStrategy.js +1 -1
  154. package/views/2d/layers/features/schema/processor/LabelMatcherSchema.js +1 -1
  155. package/views/2d/layers/features/schema/processor/symbols/ComplexSymbolSchema.js +1 -1
  156. package/views/2d/layers/features/schema/processor/symbols/SymbolSchema.js +1 -1
  157. package/views/2d/layers/features/sources/FeatureSource.js +1 -1
  158. package/views/2d/layers/features/sources/strategies/chunks/ASourceChunk.js +1 -1
  159. package/views/2d/layers/features/sources/strategies/chunks/SourceChunkStore.js +1 -1
  160. package/views/2d/layers/features/support/AttributeStore.js +1 -1
  161. package/views/2d/layers/features/support/DisplayIdGenerator.js +1 -1
  162. package/views/2d/layers/features/support/FeatureSetCache.js +1 -1
  163. package/views/2d/layers/features/support/FeatureSetReader.js +1 -1
  164. package/views/2d/layers/features/support/FeatureSetReaderPBF.js +1 -1
  165. package/views/2d/layers/features/support/FeatureSetReaderPBFHeader.js +1 -1
  166. package/views/2d/layers/features/support/StaticBitSet.js +1 -1
  167. package/views/2d/tiling/TileCoverage.js +1 -1
  168. package/views/2d/tiling/TileKey.js +1 -1
  169. package/views/3d/FocusAreasView.js +1 -1
  170. package/views/3d/analysis/Dimension/LengthDimensionSubTool.js +1 -1
  171. package/views/3d/analysis/ElevationProfile/{HoveredPointVisualization.js → ElevationProfileHoveredPointVisualization.js} +1 -1
  172. package/views/3d/analysis/ElevationProfile/ElevationProfileHoveredPointsVisualization.js +5 -0
  173. package/views/3d/analysis/ElevationProfile/ElevationProfileInputVisualization.js +5 -0
  174. package/views/3d/analysis/ElevationProfile/ElevationProfileLinesVisualization.js +5 -0
  175. package/views/3d/analysis/ElevationProfile/ElevationProfileSceneLineComputation.js +5 -0
  176. package/views/3d/analysis/ElevationProfile/ElevationProfileVisualization.js +5 -0
  177. package/views/3d/analysis/ElevationProfileAnalysisView3D.js +1 -1
  178. package/views/3d/analysis/LineOfSight/LineOfSightRayIntersector.js +1 -1
  179. package/views/3d/analysis/Slice/SliceController.js +1 -1
  180. package/views/3d/analysis/Slice/SliceTool.js +1 -1
  181. package/views/3d/analysis/Slice/sliceToolUtils.js +1 -1
  182. package/views/3d/analysis/Viewshed/FieldOfViewManipulation.js +1 -1
  183. package/views/3d/analysisViewModuleImportUtils.js +5 -0
  184. package/views/3d/camera/constraintUtils/distance.js +1 -1
  185. package/views/3d/input/SceneInputManager.js +1 -1
  186. package/views/3d/interactive/editingTools/draw/DrawGraphicTool3D.js +1 -1
  187. package/views/3d/interactive/editingTools/manipulations/MoveManipulation.js +1 -1
  188. package/views/3d/interactive/editingTools/reshape/ReshapeOperation.js +1 -1
  189. package/views/3d/interactive/editingTools/transform/extentTransform/ExtentRotate.js +1 -1
  190. package/views/3d/interactive/editingTools/transform/extentTransform/ExtentScale.js +1 -1
  191. package/views/3d/interactive/editingTools/transform/extentTransform/extentUtils.js +1 -1
  192. package/views/3d/interactive/measurementTools/areaMeasurement3D/AreaMeasurement3DTool.js +1 -1
  193. package/views/3d/layers/I3SMeshView3D.js +1 -1
  194. package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
  195. package/views/3d/layers/graphics/Deconflictor.js +1 -1
  196. package/views/3d/layers/graphics/Graphics3DCore.js +1 -1
  197. package/views/3d/layers/graphics/Graphics3DExtrudeSymbolLayer.js +1 -1
  198. package/views/3d/layers/graphics/Graphics3DGraphic.js +1 -1
  199. package/views/3d/layers/graphics/Graphics3DPolygonFillSymbolLayer.js +1 -1
  200. package/views/3d/layers/graphics/objectResourceUtils.js +1 -1
  201. package/views/3d/layers/i3s/I3SClientMaterialUtil.js +1 -1
  202. package/views/3d/layers/i3s/I3SClientNodeLoader.js +1 -1
  203. package/views/3d/layers/i3s/I3SIndex.js +1 -1
  204. package/views/3d/layers/i3s/I3SNode.js +1 -1
  205. package/views/3d/layers/i3s/I3SViewportQueries.js +1 -1
  206. package/views/3d/state/ViewState.js +1 -1
  207. package/views/3d/state/ViewStateManager.js +1 -1
  208. package/views/3d/state/controllers/PinchAndPanControllerGlobal.js +1 -1
  209. package/views/3d/support/ViewSlice.js +1 -1
  210. package/views/3d/support/orientedBoundingBox.js +1 -1
  211. package/views/3d/support/pointsOfInterest/CameraOnSurface.js +1 -1
  212. package/views/3d/support/pointsOfInterest/CenterOnSurface.js +1 -1
  213. package/views/3d/support/pointsOfInterest/Focus.js +1 -1
  214. package/views/3d/support/pointsOfInterest/PointsOfInterest.js +1 -1
  215. package/views/3d/terrain/ScaleRangeQueries.js +1 -1
  216. package/views/3d/terrain/SphericalPatch.js +1 -1
  217. package/views/3d/terrain/TerrainRenderer.js +1 -1
  218. package/views/3d/terrain/TerrainSurface.js +1 -1
  219. package/views/3d/terrain/Tile.js +1 -1
  220. package/views/3d/terrain/TilePerLayerInfo.js +1 -1
  221. package/views/3d/webgl-engine/core/material/MaterialBase.js +1 -1
  222. package/views/3d/webgl-engine/effects/highlight/ShadowHighlight.js +1 -1
  223. package/views/3d/webgl-engine/lib/Object3D.js +1 -1
  224. package/views/3d/webgl-engine/lib/Octree.js +1 -1
  225. package/views/3d/webgl-engine/lib/RenderGeometry.js +1 -1
  226. package/views/3d/webgl-engine/lib/SliceHelper.js +1 -1
  227. package/views/3d/webgl-engine/lib/Viewshed.js +1 -1
  228. package/views/3d/webgl-engine/lib/depthRangeUtils.js +1 -1
  229. package/views/3d/webgl-engine/lib/edgeRendering/EdgeView.js +1 -1
  230. package/views/3d/webgl-engine/lib/lodRendering/InstanceOctree.js +1 -1
  231. package/views/3d/webgl-engine/lib/octreeUtils.js +1 -1
  232. package/views/3d/webgl-engine/materials/internal/MaterialUtil.js +1 -1
  233. package/views/SceneView.js +1 -1
  234. package/views/ToolViewManager.js +1 -1
  235. package/views/View.js +1 -1
  236. package/views/View2D.js +1 -1
  237. package/views/analysis/ElevationProfile/ElevationProfileController.js +5 -0
  238. package/views/analysis/ElevationProfile/{ProfileGenerationError.js → ElevationProfileGenerationError.js} +1 -1
  239. package/views/analysis/ElevationProfile/ElevationProfileGroundLineComputation.js +5 -0
  240. package/views/analysis/ElevationProfile/ElevationProfileInputLineComputation.js +5 -0
  241. package/views/analysis/ElevationProfile/ElevationProfileLineComputation.js +5 -0
  242. package/views/analysis/ElevationProfile/ElevationProfileQueryLineComputation.js +5 -0
  243. package/views/analysis/ElevationProfile/ElevationProfileResult.d.ts +4 -0
  244. package/views/analysis/ElevationProfile/ElevationProfileResult.js +5 -0
  245. package/views/analysis/ElevationProfile/elevationProfileGenerationUtils.js +5 -0
  246. package/views/analysis/ElevationProfile/elevationProfileGeometryUtils.js +5 -0
  247. package/views/draw/DrawGraphicTool.js +1 -1
  248. package/views/draw/DrawOperation.js +1 -1
  249. package/views/draw/LegacyDrawManipulator.js +1 -1
  250. package/views/input/InputManager.js +1 -1
  251. package/views/input/handlers/LatestPointer.js +1 -1
  252. package/views/interactive/InteractiveToolBase.js +1 -1
  253. package/views/interactive/ToolViewManagerManipulatorState.js +1 -1
  254. package/views/interactive/Tooltip.js +1 -1
  255. package/views/interactive/editGeometry/support/editPlaneUtils.js +1 -1
  256. package/views/interactive/sketch/constraints.js +1 -1
  257. package/views/interactive/snapping/featureSources/featureServiceSource/tileUtils.js +1 -1
  258. package/views/interactive/snapping/featureSources/sceneLayerSource/SceneLayerSnappingSourceWorker.js +1 -1
  259. package/views/interactive/snapping/featureSources/sceneLayerSource/sceneLayerSnappingUtils.js +1 -1
  260. package/views/layers/FeatureLayerView.js +1 -1
  261. package/views/support/AnalysisViewManager.js +5 -0
  262. package/views/support/PropertiesPool.js +1 -1
  263. package/widgets/ElevationProfile/ElevationProfileLine.d.ts +2 -2
  264. package/widgets/Feature/FeatureViewModel.js +1 -1
  265. package/widgets/Sketch/SketchViewModel.js +1 -1
  266. package/analysis/ElevationProfile/GroundLine.d.ts +0 -4
  267. package/analysis/ElevationProfile/GroundLine.js +0 -5
  268. package/analysis/ElevationProfile/InputLine.d.ts +0 -4
  269. package/analysis/ElevationProfile/InputLine.js +0 -5
  270. package/analysis/ElevationProfile/Line.d.ts +0 -4
  271. package/analysis/ElevationProfile/Line.js +0 -5
  272. package/analysis/ElevationProfile/LineChartOptions.d.ts +0 -4
  273. package/analysis/ElevationProfile/LineViewOptions.d.ts +0 -4
  274. package/analysis/ElevationProfile/QueryLine.d.ts +0 -4
  275. package/analysis/ElevationProfile/QueryLine.js +0 -5
  276. package/analysis/ElevationProfile/SceneLine.d.ts +0 -4
  277. package/analysis/ElevationProfile/SceneLine.js +0 -5
  278. package/analysis/ElevationProfile/Units.d.ts +0 -4
  279. package/analysis/ElevationProfile/ViewOptions.d.ts +0 -4
  280. package/assets/esri/core/workers/chunks/14c6ae4feb4859cfa7c5.js +0 -1
  281. package/assets/esri/core/workers/chunks/20a2b3d1f826e9059884.js +0 -1
  282. package/assets/esri/core/workers/chunks/250b1629becca0410f2a.js +0 -1
  283. package/assets/esri/core/workers/chunks/2b75212c31145cc07d16.js +0 -1
  284. package/assets/esri/core/workers/chunks/2efa4d8fe5454f8b2a05.js +0 -1
  285. package/assets/esri/core/workers/chunks/3149a86cd25684dcb0b3.js +0 -1
  286. package/assets/esri/core/workers/chunks/38f84294fb2fb4663ba5.js +0 -1
  287. package/assets/esri/core/workers/chunks/3eb3af0b6cf3c2f28131.js +0 -1
  288. package/assets/esri/core/workers/chunks/43bd338bb0de375b9bb7.js +0 -1
  289. package/assets/esri/core/workers/chunks/4622a3e64d3c4aafa56b.js +0 -1
  290. package/assets/esri/core/workers/chunks/47f2e905ef42e36897aa.js +0 -1
  291. package/assets/esri/core/workers/chunks/4c6862ad3af947c704f7.js +0 -1
  292. package/assets/esri/core/workers/chunks/50e9eafb118d2a221f10.js +0 -1
  293. package/assets/esri/core/workers/chunks/55588e668b6acb6aa390.js +0 -1
  294. package/assets/esri/core/workers/chunks/5b112471dca94b2e8462.js +0 -1
  295. package/assets/esri/core/workers/chunks/5dfe1aed10095385c066.js +0 -1
  296. package/assets/esri/core/workers/chunks/5fc414fc2cfc68828c5b.js +0 -1
  297. package/assets/esri/core/workers/chunks/7389841fabe0f319f1e5.js +0 -1
  298. package/assets/esri/core/workers/chunks/781b59ba0cabe78bc122.js +0 -1
  299. package/assets/esri/core/workers/chunks/8e0559cc6295008fcdf7.js +0 -1
  300. package/assets/esri/core/workers/chunks/944fa8261aad94ae0542.js +0 -1
  301. package/assets/esri/core/workers/chunks/9e479e7e2e51476c3d27.js +0 -1
  302. package/assets/esri/core/workers/chunks/a1e179dd6de9c8769b02.js +0 -1
  303. package/assets/esri/core/workers/chunks/a6493607b98783bf1ef2.js +0 -1
  304. package/assets/esri/core/workers/chunks/a829969ed44cdb814f27.js +0 -1
  305. package/assets/esri/core/workers/chunks/b2a035befeeff1a55ad8.js +0 -1
  306. package/assets/esri/core/workers/chunks/b4251e10621fb3ad03a3.js +0 -1
  307. package/assets/esri/core/workers/chunks/b877142a275188a16e17.js +0 -1
  308. package/assets/esri/core/workers/chunks/b9f5672093727c6f92c9.js +0 -1
  309. package/assets/esri/core/workers/chunks/ba45dccb4dab5a74d224.js +0 -1
  310. package/assets/esri/core/workers/chunks/cc0cb4906e4419f7c4a9.js +0 -1
  311. package/assets/esri/core/workers/chunks/cda27c0fafd687dfa72e.js +0 -1
  312. package/assets/esri/core/workers/chunks/ddd6597a66ec6b972f9c.js +0 -1
  313. package/assets/esri/core/workers/chunks/e28d3ed65c3a76a044c8.js +0 -1
  314. package/assets/esri/core/workers/chunks/e3f68f7b408a08d7cd5d.js +0 -1
  315. package/assets/esri/core/workers/chunks/e9716995ce0c3683eafc.js +0 -1
  316. package/assets/esri/core/workers/chunks/ed25bf087f52e5d3e71b.js +0 -1
  317. package/assets/esri/core/workers/chunks/f75ddd79be506423be09.js +0 -1
  318. package/assets/esri/core/workers/chunks/f8505bf69795f5293a79.js +0 -1
  319. package/assets/esri/core/workers/chunks/f92e608931b1c168cb45.js +0 -1
  320. package/assets/esri/core/workers/chunks/fb4950995f6780f6c22a.js +0 -1
  321. package/views/3d/analysis/AnalysisViewManager3D.js +0 -5
  322. package/views/3d/analysis/ElevationProfile/HoveredPointsVisualization.js +0 -5
  323. package/views/3d/analysis/ElevationProfile/InputVisualization.js +0 -5
  324. package/views/3d/analysis/ElevationProfile/ProfileLinesVisualization.js +0 -5
  325. package/views/3d/analysis/ElevationProfile/SceneLineComputation.js +0 -5
  326. package/views/3d/analysis/ElevationProfile/Visualization.js +0 -5
  327. package/views/analysis/ElevationProfile/Controller.js +0 -5
  328. package/views/analysis/ElevationProfile/GroundLineComputation.js +0 -5
  329. package/views/analysis/ElevationProfile/InputLineComputation.js +0 -5
  330. package/views/analysis/ElevationProfile/LineComputation.js +0 -5
  331. package/views/analysis/ElevationProfile/QueryLineComputation.js +0 -5
  332. package/views/analysis/ElevationProfile/Result.d.ts +0 -4
  333. package/views/analysis/ElevationProfile/Result.js +0 -5
  334. package/views/analysis/ElevationProfile/geometryUtils.js +0 -5
  335. package/views/analysis/ElevationProfile/profileGenerationUtils.js +0 -5
  336. /package/views/analysis/ElevationProfile/{elevationQuerySourceUtils.js → elevationProfileQuerySourceUtils.js} +0 -0
  337. /package/views/analysis/ElevationProfile/{statisticsUtils.js → elevationProfileStatisticsUtils.js} +0 -0
  338. /package/views/analysis/ElevationProfile/{traversalUtils.js → elevationProfileTraversalUtils.js} +0 -0
  339. /package/views/analysis/ElevationProfile/{unitUtils.js → elevationProfileUnitUtils.js} +0 -0
  340. /package/views/analysis/ElevationProfile/{visualizationUtils.js → elevationProfileVisualizationUtils.js} +0 -0
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as o}from"tslib";import r from"../../../core/Accessor.js";import"../../../core/has.js";import{destroyMaybe as t}from"../../../core/maybe.js";import{watch as e,initial as i,syncAndInitial as n}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 s}from"../../../core/accessorSupport/decorators/subclass.js";import{DoubleClickZoom as d}from"./handlers/DoubleClickZoom.js";import{DragRotate as m}from"./handlers/DragRotate.js";import{DragZoom as p}from"./handlers/DragZoom.js";import{GamepadNavigation as c}from"./handlers/GamepadNavigation.js";import{KeyboardNavigation as g}from"./handlers/KeyboardNavigation.js";import{MouseWheelZoom as u}from"./handlers/MouseWheelZoom.js";import{PinchAndPanNavigation as l}from"./handlers/PinchAndPanNavigation.js";import{PointerDownCancelAnimation as h}from"./handlers/PointerDownCancelAnimation.js";import{TwoFingerTilt as w}from"./handlers/TwoFingerTilt.js";import{BrowserEventSource as y}from"../../input/BrowserEventSource.js";import{InputManager as f,ViewEventPriorities as v}from"../../input/InputManager.js";import{PreventContextMenu as _}from"../../input/handlers/PreventContextMenu.js";import{getPointerActions as D}from"../../input/handlers/support.js";import{Drag as j}from"../../input/recognizers/Drag.js";import{ImmediateDoubleClick as A}from"../../input/recognizers/ImmediateDoubleClick.js";import{PointerClickHoldAndDrag as P}from"../../input/recognizers/PointerClickHoldAndDrag.js";import{SingleAndDoubleClick as M}from"../../input/recognizers/SingleAndDoubleClick.js";import{VerticalTwoFingerDrag as T}from"../../input/recognizers/VerticalTwoFingerDrag.js";let b=class extends r{constructor(){super(...arguments),this.mode="default",this._updateMode=({mode:o,dragPrimary:r,dragSecondary:t,dragTertiary:e})=>{"pro"===o&&(t="zoom",e="pan"===r?"rotate":"pan");const i={dragPrimary:r,dragSecondary:t,dragTertiary:e};this._modeDragPan&&(this._modeDragPan.pointerActions=D("pan",i)),this._modeDragRotate&&(this._modeDragRotate.pointerActions=D("rotate",i)),this._modeDragZoom&&(this._modeDragZoom.pointerActions=D("zoom",i))}}destroy(){this.disconnect()}get primaryDragAction(){return this.view.navigation.actionMap.dragPrimary}set primaryDragAction(o){const{actionMap:r}=this.view.navigation;r.dragPrimary=o,r.dragSecondary="pan"===o?"rotate":"pan"}get updating(){return!!this._inputManager?.updating}get latestPointerType(){return this._inputManager?.latestPointerType}get latestPointerLocation(){return this._inputManager?.latestPointerLocation}get multiTouchActive(){return this._inputManager?.multiTouchActive??!1}disconnect(){this.removeAllHandles(),this.view.viewEvents.disconnect(),this._modeDragPan=null,this._modeDragRotate=null,this._modeDragZoom=null,this._modeKeyboardNavigation=null,this._inputManager=t(this._inputManager),this._source=t(this._source)}connect(){const o=this.view;this._source=new y(this.view.surface,o.input);const r=[new A,new P,new M,new j(this.view.navigation),new T],t=new f({eventSource:this._source,recognizers:r});this._inputManager=t,t.installHandlers("prevent-context-menu",[new _],v.INTERNAL);const a={fov:"Shift",pan:{left:"ArrowLeft",right:"ArrowRight",forward:"ArrowUp",backward:"ArrowDown",up:["u","U"],down:["j","J"]},lookAround:{headingLeft:["a","A"],headingRight:["d","D"],tiltUp:["w","W"],tiltDown:["s","S"],modifier:"b"},zoom:{zoomIn:["+","="],zoomOut:["-","_"]},reset:{heading:["n","N"],tilt:["p","P"]}};this._modeDragPan=new l(o,["primary"]),this._modeDragRotate=new m(o,["secondary"],0),this._modeDragZoom=new p(o,["tertiary"],a.fov),this._modeKeyboardNavigation=new g(o,a),t.installHandlers("navigation",[new h(o),new d(o),new c(o),new u(o,a.fov),new m(o,["primary"],1,[a.lookAround.modifier]),new m(o,["secondary"],0,[a.lookAround.modifier]),new l(o,["tertiary"],[a.lookAround.modifier]),this._modeDragRotate,this._modeDragZoom,this._modeDragPan,this._modeKeyboardNavigation,new w(o)],v.INTERNAL),this.view.viewEvents.connect(t),this.addHandles([e(()=>this.view.navigation?.browserTouchPanEnabled,o=>{this._source.browserTouchPanningEnabled=!o},i),e(()=>{const{actionMap:o}=this.view.navigation,{dragPrimary:r,dragSecondary:t,dragTertiary:e}=o;return{mode:this.mode,dragPrimary:r,dragSecondary:t,dragTertiary:e}},this._updateMode,n)])}isModifierKeyDown(o){return this._inputManager?.isModifierKeyDown(o)??!1}get test(){}};o([a()],b.prototype,"view",void 0),o([a({type:["default","pro"]})],b.prototype,"mode",void 0),o([a({readOnly:!0})],b.prototype,"updating",null),o([a()],b.prototype,"latestPointerType",null),o([a()],b.prototype,"latestPointerLocation",null),o([a()],b.prototype,"multiTouchActive",null),o([a()],b.prototype,"_inputManager",void 0),b=o([s("esri.views.3d.input.SceneInputManager")],b);const S=b;export{S as default};
5
+ import{__decorate as o}from"tslib";import r from"../../../core/Accessor.js";import"../../../core/has.js";import{destroyMaybe as t}from"../../../core/maybe.js";import{watch as e,initial as i,syncAndInitial as n}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 s}from"../../../core/accessorSupport/decorators/subclass.js";import{DoubleClickZoom as d}from"./handlers/DoubleClickZoom.js";import{DragRotate as m}from"./handlers/DragRotate.js";import{DragZoom as p}from"./handlers/DragZoom.js";import{GamepadNavigation as c}from"./handlers/GamepadNavigation.js";import{KeyboardNavigation as g}from"./handlers/KeyboardNavigation.js";import{MouseWheelZoom as u}from"./handlers/MouseWheelZoom.js";import{PinchAndPanNavigation as l}from"./handlers/PinchAndPanNavigation.js";import{PointerDownCancelAnimation as h}from"./handlers/PointerDownCancelAnimation.js";import{TwoFingerTilt as w}from"./handlers/TwoFingerTilt.js";import{BrowserEventSource as f}from"../../input/BrowserEventSource.js";import{InputManager as v,ViewEventPriorities as y}from"../../input/InputManager.js";import{PreventContextMenu as _}from"../../input/handlers/PreventContextMenu.js";import{getPointerActions as D}from"../../input/handlers/support.js";import{Drag as j}from"../../input/recognizers/Drag.js";import{ImmediateDoubleClick as A}from"../../input/recognizers/ImmediateDoubleClick.js";import{PointerClickHoldAndDrag as P}from"../../input/recognizers/PointerClickHoldAndDrag.js";import{SingleAndDoubleClick as M}from"../../input/recognizers/SingleAndDoubleClick.js";import{VerticalTwoFingerDrag as b}from"../../input/recognizers/VerticalTwoFingerDrag.js";let T=class extends r{constructor(){super(...arguments),this.mode="default",this._updateMode=({mode:o,dragPrimary:r,dragSecondary:t,dragTertiary:e})=>{"pro"===o&&(t="zoom",e="pan"===r?"rotate":"pan");const i={dragPrimary:r,dragSecondary:t,dragTertiary:e};this._modeDragPan&&(this._modeDragPan.pointerActions=D("pan",i)),this._modeDragRotate&&(this._modeDragRotate.pointerActions=D("rotate",i)),this._modeDragZoom&&(this._modeDragZoom.pointerActions=D("zoom",i))}}destroy(){this.disconnect()}get primaryDragAction(){return this.view.navigation.actionMap.dragPrimary}set primaryDragAction(o){const{actionMap:r}=this.view.navigation;r.dragPrimary=o,r.dragSecondary="pan"===o?"rotate":"pan"}get updating(){return!!this._inputManager?.updating}get latestPointerInfo(){return this._inputManager?.latestPointerInfo}get multiTouchActive(){return this._inputManager?.multiTouchActive??!1}disconnect(){this.removeAllHandles(),this.view.viewEvents.disconnect(),this._modeDragPan=null,this._modeDragRotate=null,this._modeDragZoom=null,this._modeKeyboardNavigation=null,this._inputManager=t(this._inputManager),this._source=t(this._source)}connect(){const o=this.view;this._source=new f(this.view.surface,o.input);const r=[new A,new P,new M,new j(this.view.navigation),new b],t=new v({eventSource:this._source,recognizers:r});this._inputManager=t,t.installHandlers("prevent-context-menu",[new _],y.INTERNAL);const a={fov:"Shift",pan:{left:"ArrowLeft",right:"ArrowRight",forward:"ArrowUp",backward:"ArrowDown",up:["u","U"],down:["j","J"]},lookAround:{headingLeft:["a","A"],headingRight:["d","D"],tiltUp:["w","W"],tiltDown:["s","S"],modifier:"b"},zoom:{zoomIn:["+","="],zoomOut:["-","_"]},reset:{heading:["n","N"],tilt:["p","P"]}};this._modeDragPan=new l(o,["primary"]),this._modeDragRotate=new m(o,["secondary"],0),this._modeDragZoom=new p(o,["tertiary"],a.fov),this._modeKeyboardNavigation=new g(o,a),t.installHandlers("navigation",[new h(o),new d(o),new c(o),new u(o,a.fov),new m(o,["primary"],1,[a.lookAround.modifier]),new m(o,["secondary"],0,[a.lookAround.modifier]),new l(o,["tertiary"],[a.lookAround.modifier]),this._modeDragRotate,this._modeDragZoom,this._modeDragPan,this._modeKeyboardNavigation,new w(o)],y.INTERNAL),this.view.viewEvents.connect(t),this.addHandles([e(()=>this.view.navigation?.browserTouchPanEnabled,o=>{this._source.browserTouchPanningEnabled=!o},i),e(()=>{const{actionMap:o}=this.view.navigation,{dragPrimary:r,dragSecondary:t,dragTertiary:e}=o;return{mode:this.mode,dragPrimary:r,dragSecondary:t,dragTertiary:e}},this._updateMode,n)])}isModifierKeyDown(o){return this._inputManager?.isModifierKeyDown(o)??!1}get test(){}};o([a()],T.prototype,"view",void 0),o([a({type:["default","pro"]})],T.prototype,"mode",void 0),o([a({readOnly:!0})],T.prototype,"updating",null),o([a()],T.prototype,"latestPointerInfo",null),o([a()],T.prototype,"multiTouchActive",null),o([a()],T.prototype,"_inputManager",void 0),T=o([s("esri.views.3d.input.SceneInputManager")],T);const S=T;export{S 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.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import{unitRGBAFromColor as t}from"../../../../../core/colorUtils.js";import{handlesGroup as i,makeHandle as r}from"../../../../../core/handleUtils.js";import{destroyMaybe as s}from"../../../../../core/maybe.js";import{watch as o,syncAndInitial as n,initial as a,when as l}from"../../../../../core/reactiveUtils.js";import{property as c}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/has.js";import"../../../../../core/Logger.js";import"../../../../../core/RandomLCG.js";import{subclass as m}from"../../../../../core/accessorSupport/decorators/subclass.js";import{i as p}from"../../../../../chunks/vec32.js";import{create as h}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{getEffectiveElevationInfo as u,getEffectiveElevationMode as d}from"../../../../../support/elevationInfoUtils.js";import v from"../../../../../symbols/support/ElevationInfo.js";import{SegmentLabels3D as f}from"../../SegmentLabels3D.js";import{SnappingVisualizer3D as g}from"../../SnappingVisualizer3D.js";import{meshTransformFastUpdateHandles as y}from"../meshFastUpdateUtils.js";import{Settings as V}from"../settings.js";import{ExtendedLineVisualElement as w}from"../../visualElements/ExtendedLineVisualElement.js";import{OutlineVisualElement as E}from"../../visualElements/OutlineVisualElement.js";import{VerticesVisualElement as _}from"../../visualElements/VerticesVisualElement.js";import{evaluateElevationAlignmentAtPoint as j}from"../../../layers/graphics/elevationAlignmentUtils.js";import{ElevationContext as L}from"../../../layers/graphics/ElevationContext.js";import{GraphicState as I}from"../../../layers/graphics/GraphicState.js";import{DrawGraphicTool as S,geometryTypeToDrawOperationGeometryType as D}from"../../../../draw/DrawGraphicTool.js";import{DrawOperation as G}from"../../../../draw/DrawOperation.js";import{ElevationDrawSurface as x,SceneDrawSurface as C}from"../../../../draw/drawSurfaces.js";import{updateMeshTransformFromTooltipInfo as O}from"../../../../interactive/tooltip/tooltipCommonUtils.js";import{autorun as T}from"../../../../../core/accessorSupport/trackingUtils.js";let b=class extends S{constructor(e){super(e),this._activeVertexVisualElement=null,this._createGraphicState=null,this._outlineVisualElement=null,this._verticesVisualElement=null,this._verticalLineVisualElement=null,this._settings=new V({getTheme:()=>this.view.effectiveTheme}),this.geometryType=null,this.type="draw-3d"}initialize(){const{mode:e,offset:t,unit:i}=this.elevationInfo;this.internalGraphicsLayer.elevationInfo=new v({mode:e,offset:t,unit:i})}normalizeCtorArgs(e){if(!e.elevationInfo){const t=e.hasZ??!0;return{...e,elevationInfo:u(t)}}return e}initializeGraphic(e){const{view:t}=this,r=this._createGraphicState=new I({graphic:e});return i([t.maskOccludee(e),t.trackGraphicState(r),o(()=>({element:this._outlineVisualElement,isDraped:r.isDraped}),({element:e,isDraped:t})=>{e&&(e.isDraped=t)},n),T(()=>{O(this.tooltipInfos.mesh,this.geometryToPlace)}),this._setupLoadingIndicator(r),...y(r)])}makeDrawOperation(){const{geometryType:e}=this,t="circle"!==e&&"rectangle"!==e;return new G({view:this.view,manipulators:this.manipulators,geometryType:D(e),drawingMode:this.mode,hasZ:this.hasZ,defaultZ:this.defaultZ,snapToSceneEnabled:this.snapToScene,drawSurface:new C(this.view,this.elevationInfo,[this.internalGraphicsLayer]),elevationDrawSurface:new x(this.elevationInfo,this.defaultZ,this.view,this.internalGraphicsLayer),hasM:!1,elevationInfo:this.elevationInfo,snappingManager:this.snappingManager,snappingVisualizer:new g,segmentLabels:t?new f:null,labelOptions:this.sketchOptions.labels,isDraped:this._createGraphicState?this._createGraphicState.isDraped:"on-the-ground"===d(this.hasZ,this.elevationInfo),cursor:this.cursor,constraintsEnabled:!0,automaticLengthMeasurementUtils:this.automaticLengthMeasurementUtils})}onActiveVertexChanged(e){const{view:n}=this;if(this._activeVertexVisualElement)return this._activeVertexVisualElement.vertices=[e],this._activeVertexVisualElement.recreate(),this._updateVerticalLineVisualElement(e),r();const l=this._settings,c=l.manipulators.vertex,m=new _({view:n,spatialReference:n.spatialReference,vertices:[e],elevationInfo:this.internalGraphicsLayer.elevationInfo,size:c.size,outlineSize:c.outlineSize,renderOccluded:c.renderOccluded,attached:!1,isDecoration:!0});this._activeVertexVisualElement=m;const p=l.visualElements.zVerticalLine,h=new w({view:n,extensionType:p.extensionType,innerWidth:1,attached:!1,writeDepthEnabled:!1,renderOccluded:4,isDecoration:!0});this._verticalLineVisualElement=h;const u=i([o(()=>l.visualElements.zVerticalLine,e=>e.apply(h),a),o(()=>({selectedColor:t(l.colors.selected),outlineColor:t(l.manipulators.vertex.outlineColor)}),({selectedColor:e,outlineColor:t})=>{m.color=e,m.outlineColor=t},a),r(()=>{this._activeVertexVisualElement=s(this._activeVertexVisualElement),this._verticalLineVisualElement=s(this._verticalLineVisualElement)})]);return m.attached=!0,this._updateVerticalLineVisualElement(e),u}_updateVerticalLineVisualElement(e){const t=this._verticalLineVisualElement;if(!t)return;const{renderCoordsHelper:i,elevationProvider:r}=this.view;p(U,e[0],e[1],e[2]),z.setFromElevationInfo(this.elevationInfo),U[2]=j(U,r,z,i);i.toRenderCoords(U,this.view.spatialReference,U)?(t.setStartEndFromWorldDownAtLocation(U),t.attached=!0):t.attached=!1}onOutlineChanged(e){if(this._outlineVisualElement)return this._outlineVisualElement.geometry=e,r();const t=this.internalGraphicsLayer.elevationInfo,{view:n}=this,l=this._settings,c=new E({view:n,geometry:e,elevationInfo:t,isDraped:this._createGraphicState?this._createGraphicState.isDraped:"on-the-ground"===d(this.hasZ,t),attached:!1,isDecoration:!0});this._outlineVisualElement=c;const m=i([o(()=>l.visualElements.lineObjects.outline,e=>e.apply(c),a),o(()=>l.visualElements.lineObjects.shadowStyle,e=>e.apply(c),a),r(()=>{this._outlineVisualElement=s(this._outlineVisualElement)})]);return c.attached=!0,c.laserlineEnabled=!0,m}onRegularVerticesChanged(e){if(this._verticesVisualElement)return this._verticesVisualElement.vertices=e,r();const{view:n}=this,l=this._settings,c=l.manipulators.vertex,m=new _({view:n,spatialReference:n.spatialReference,vertices:e,elevationInfo:this.internalGraphicsLayer.elevationInfo,size:c.size,outlineSize:c.outlineSize,renderOccluded:c.renderOccluded,attached:!1,isDecoration:!0}),p=i([o(()=>({color:t(l.manipulators.vertex.color),outlineColor:t(l.manipulators.vertex.outlineColor)}),({color:e,outlineColor:t})=>{m.color=e,m.outlineColor=t},a),r(()=>{this._verticesVisualElement=s(this._verticesVisualElement)})]);return m.attached=!0,this._verticesVisualElement=m,p}updateGraphicGeometry(e){if("mesh"===this.geometryType&&"point"===e?.type){const t=this.geometryToPlace;t?.centerAt(e),O(this.tooltipInfos.mesh,t);const i=this._graphic;return void(t&&i.geometry===t||(i.geometry=t))}super.updateGraphicGeometry(e)}_setupLoadingIndicator(e){const{drawOperation:t}=this;if(!this.geometryToPlace)return t.loading=!1,null;t.loading=!0;const s=r(()=>{t.loading=!1});let o;const a=()=>o&&cancelAnimationFrame(o);return i([l(()=>e.displaying,()=>{a(),o=requestAnimationFrame(()=>s.remove())},{...n,once:!0}),r(a),s])}};e([c({constructOnly:!0})],b.prototype,"elevationInfo",void 0),e([c({constructOnly:!0})],b.prototype,"geometryType",void 0),e([c()],b.prototype,"type",void 0),e([c({constructOnly:!0})],b.prototype,"view",void 0),b=e([m("esri.views.3d.interactive.editingTools.draw.DrawGraphicTool3D")],b);const z=new L,U=h();export{b as DrawGraphicTool3D};
5
+ import{__decorate as e}from"tslib";import{unitRGBAFromColor as t}from"../../../../../core/colorUtils.js";import{handlesGroup as i,makeHandle as r}from"../../../../../core/handleUtils.js";import{destroyMaybe as s}from"../../../../../core/maybe.js";import{watch as o,syncAndInitial as n,initial as a,when as l}from"../../../../../core/reactiveUtils.js";import{property as c}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/has.js";import"../../../../../core/Logger.js";import"../../../../../core/RandomLCG.js";import{subclass as m}from"../../../../../core/accessorSupport/decorators/subclass.js";import{i as p}from"../../../../../chunks/vec32.js";import{create as h}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{getEffectiveElevationInfo as u,getEffectiveElevationMode as d}from"../../../../../support/elevationInfoUtils.js";import v from"../../../../../symbols/support/ElevationInfo.js";import{SegmentLabels3D as f}from"../../SegmentLabels3D.js";import{SnappingVisualizer3D as g}from"../../SnappingVisualizer3D.js";import{meshTransformFastUpdateHandles as y}from"../meshFastUpdateUtils.js";import{Settings as V}from"../settings.js";import{ExtendedLineVisualElement as w}from"../../visualElements/ExtendedLineVisualElement.js";import{OutlineVisualElement as E}from"../../visualElements/OutlineVisualElement.js";import{VerticesVisualElement as _}from"../../visualElements/VerticesVisualElement.js";import{evaluateElevationAlignmentAtPoint as j}from"../../../layers/graphics/elevationAlignmentUtils.js";import{ElevationContext as L}from"../../../layers/graphics/ElevationContext.js";import{GraphicState as I}from"../../../layers/graphics/GraphicState.js";import{DrawGraphicTool as S,geometryTypeToDrawOperationGeometryType as D}from"../../../../draw/DrawGraphicTool.js";import{DrawOperation as G}from"../../../../draw/DrawOperation.js";import{ElevationDrawSurface as x,SceneDrawSurface as C}from"../../../../draw/drawSurfaces.js";import{updateMeshTransformFromTooltipInfo as O}from"../../../../interactive/tooltip/tooltipCommonUtils.js";import{autorun as T}from"../../../../../core/accessorSupport/trackingUtils.js";let b=class extends S{constructor(e){super(e),this._activeVertexVisualElement=null,this._createGraphicState=null,this._outlineVisualElement=null,this._verticesVisualElement=null,this._verticalLineVisualElement=null,this._settings=new V({getTheme:()=>this.view.effectiveTheme}),this.geometryType=null,this.type="draw-3d"}initialize(){const{mode:e,offset:t,unit:i}=this.elevationInfo;this.internalGraphicsLayer.elevationInfo=new v({mode:e,offset:t,unit:i})}normalizeCtorArgs(e){if(!e.elevationInfo){const t=e.hasZ??!0;return{...e,elevationInfo:u(t)}}return e}initializeGraphic(e){const{view:t}=this,r=this._createGraphicState=new I({graphic:e});return i([t.maskOccludee(e),t.trackGraphicState(r),o(()=>({element:this._outlineVisualElement,isDraped:r.isDraped}),({element:e,isDraped:t})=>{e&&(e.isDraped=t)},n),T(()=>{O(this.tooltipInfos.mesh,this.geometryToPlace)}),this._setupLoadingIndicator(r),...y(r)])}makeDrawOperation(){const{geometryType:e}=this,t="circle"!==e&&"rectangle"!==e;return new G({view:this.view,manipulators:this.manipulators,geometryType:D(e),drawingMode:this.mode,hasZ:this.hasZ,defaultZ:this.defaultZ,snapToSceneEnabled:this.snapToScene,drawSurface:new C(this.view,this.elevationInfo,[this.internalGraphicsLayer]),elevationDrawSurface:new x(this.elevationInfo,this.defaultZ,this.view,this.internalGraphicsLayer),hasM:!1,elevationInfo:this.elevationInfo,snappingManager:this.snappingManager,snappingVisualizer:new g,segmentLabels:t?new f:null,labelOptions:this.sketchOptions.labels,isDraped:this._createGraphicState?this._createGraphicState.isDraped:"on-the-ground"===d(this.hasZ,this.elevationInfo),cursor:this.cursor,constraintsEnabled:!0,automaticLengthMeasurementUtils:this.automaticLengthMeasurementUtils})}onActiveVertexChanged(e){const{view:n}=this;if(this._activeVertexVisualElement)return this._activeVertexVisualElement.vertices=[e],this._activeVertexVisualElement.recreate(),this._updateVerticalLineVisualElement(e),r();const l=this._settings,c=l.manipulators.vertex,m=new _({view:n,spatialReference:n.spatialReference,vertices:[e],elevationInfo:this.internalGraphicsLayer.elevationInfo,size:c.size,outlineSize:c.outlineSize,renderOccluded:c.renderOccluded,attached:!1,isDecoration:!0});this._activeVertexVisualElement=m;const p=l.visualElements.zVerticalLine,h=new w({view:n,extensionType:p.extensionType,innerWidth:1,attached:!1,writeDepthEnabled:!1,renderOccluded:4,isDecoration:!0});this._verticalLineVisualElement=h;const u=i([o(()=>l.visualElements.zVerticalLine,e=>e.apply(h),a),o(()=>({selectedColor:t(l.colors.selected),outlineColor:t(l.manipulators.vertex.outlineColor)}),({selectedColor:e,outlineColor:t})=>{m.color=e,m.outlineColor=t},a),r(()=>{this._activeVertexVisualElement=s(this._activeVertexVisualElement),this._verticalLineVisualElement=s(this._verticalLineVisualElement)})]);return m.attached=!0,this._updateVerticalLineVisualElement(e),u}_updateVerticalLineVisualElement(e){const t=this._verticalLineVisualElement;if(!t)return;const{renderCoordsHelper:i,elevationProvider:r}=this.view;p(U,e[0],e[1],e[2]),z.setFromElevationInfo(this.elevationInfo),U[2]=j(U,r,z,i);i.toRenderCoords(U,this.view.spatialReference,U)?(t.setStartEndFromWorldDownAtLocation(U),t.attached=!0):t.attached=!1}onOutlineChanged(e){if(this._outlineVisualElement)return this._outlineVisualElement.geometry=e,r();const t=this.internalGraphicsLayer.elevationInfo,{view:n}=this,l=this._settings,c=new E({view:n,geometry:e,elevationInfo:t,isDraped:this._createGraphicState?this._createGraphicState.isDraped:"on-the-ground"===d(this.hasZ,t),attached:!1,isDecoration:!0});this._outlineVisualElement=c;const m=i([o(()=>l.visualElements.lineObjects.outline,e=>e.apply(c),a),o(()=>l.visualElements.lineObjects.shadowStyle,e=>e.apply(c),a),r(()=>{this._outlineVisualElement=s(this._outlineVisualElement)})]);return c.attached=!0,c.laserlineEnabled=!0,m}onRegularVerticesChanged(e){if(this._verticesVisualElement)return this._verticesVisualElement.vertices=e,r();const{view:n}=this,l=this._settings,c=l.manipulators.vertex,m=new _({view:n,spatialReference:n.spatialReference,vertices:e,elevationInfo:this.internalGraphicsLayer.elevationInfo,size:c.size,outlineSize:c.outlineSize,renderOccluded:c.renderOccluded,attached:!1,isDecoration:!0}),p=i([o(()=>({color:t(l.manipulators.vertex.color),outlineColor:t(l.manipulators.vertex.outlineColor)}),({color:e,outlineColor:t})=>{m.color=e,m.outlineColor=t},a),r(()=>{this._verticesVisualElement=s(this._verticesVisualElement)})]);return m.attached=!0,this._verticesVisualElement=m,p}updateGraphicGeometry(e){if("mesh"===this.geometryType&&"point"===e?.type){const t=this.geometryToPlace;t?.centerAt(e),O(this.tooltipInfos.mesh,t);const i=this._graphic;return void(t&&i.geometry===t||(i.geometry=t))}super.updateGraphicGeometry(e)}_setupLoadingIndicator(e){const{drawOperation:t}=this;if(!this.geometryToPlace||e.displaying)return t.loading=!1,null;t.loading=!0;const s=r(()=>{t.loading=!1});let o;const a=()=>{o&&cancelAnimationFrame(o)};return i([l(()=>e.displaying,()=>{a(),o=requestAnimationFrame(()=>s.remove())},{...n,once:!0}),r(a),s])}};e([c({constructOnly:!0})],b.prototype,"elevationInfo",void 0),e([c({constructOnly:!0})],b.prototype,"geometryType",void 0),e([c()],b.prototype,"type",void 0),e([c({constructOnly:!0})],b.prototype,"view",void 0),b=e([m("esri.views.3d.interactive.editingTools.draw.DrawGraphicTool3D")],b);const z=new L,U=h();export{b as DrawGraphicTool3D};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import i from"../../../../../core/Handles.js";import{handlesGroup as a}from"../../../../../core/handleUtils.js";import has from"../../../../../core/has.js";import{when as t}from"../../../../../core/reactiveUtils.js";import{discRadiusSmall as n,discRadius as e}from"./config.js";import{InteractiveManipulation as s}from"./InteractiveManipulation.js";import{MoveXYAxisManipulation as o}from"./MoveXYAxisManipulation.js";import{MoveXYDiscManipulation as l}from"./MoveXYDiscManipulation.js";import{MoveZManipulation as r}from"./MoveZManipulation.js";class p extends s{constructor(a){super(),this._handles=new i;const{tool:t,view:n,snapToScene:e,radius:s}=a;this._view=n,this.xyManipulation=new l({tool:t,view:n,snapToScene:e,radius:s}),this.xyAxisManipulation=new o({tool:t,view:n,radius:s}),this.zManipulation=new r({tool:t,view:n,radius:s}),this.xyManipulation.available=a.xyAvailable,this.xyAxisManipulation.available=a.xyAxisAvailable,this.zManipulation.available=a.zAvailable,this._autoHideXYAxis(),this.forEachManipulator(i=>this._handles.add(i.events.on("grab-changed",()=>this._updateManipulatorInteractivity())))}destroy(){this._handles.destroy(),this.xyManipulation.destroy(),this.xyAxisManipulation.destroy(),this.zManipulation.destroy()}createManipulatedObjectDragPipeline(i,t,n){return a([this.xyManipulation.createManipulatedObjectDragPipeline((a,t,n,e,s)=>i(0,a,t,n,e,s),t,n),this.xyAxisManipulation.createManipulatedObjectDragPipeline((a,t,n,e,s)=>i(1,a,t,n,e,s),t,n),this.zManipulation.createManipulatedObjectDragPipeline((a,t,n,e,s)=>i(2,a,t,n,e,s),t,n)])}createDragPipeline(i,t,n,e){return a([this.xyManipulation.createDragPipeline((a,t,n,e,s)=>i(0,a,t,n,e,s),t,n,e),this.xyAxisManipulation.createDragPipeline((a,t,n,e,s)=>i(1,a,t,n,e,s),t,n,e),this.zManipulation.createDragPipeline((a,t,n,e,s)=>i(2,a,t,n,e,s),n)])}set snapToScene(i){this.xyManipulation.snapToScene=i}set angle(i){this.xyAxisManipulation.angle=i}set radius(i){this.xyAxisManipulation.radius=i,this.xyManipulation.radius=i,this.zManipulation.radius=i}set displayScale(i){this.xyManipulation.displayScale=i,this.xyAxisManipulation.displayScale=i}forEachManipulator(i){this.xyManipulation.forEachManipulator(a=>i(a,1)),this.xyAxisManipulation.forEachManipulator(a=>i(a,1)),this.zManipulation.forEachManipulator(a=>i(a,0))}get _xyAxisVisible(){const i=this.xyManipulation.someManipulator(i=>i.focused)||this.xyAxisManipulation.someManipulator(i=>i.focused);return this._view.inputManager&&"touch"===this._view.inputManager.latestPointerType||i}_autoHideXYAxis(){const i=this.xyAxisManipulation,a=this.xyManipulation;if(has("esri-mobile"))return;const n=[];a.forEachManipulator(i=>n.push(i)),i.forEachManipulator(i=>n.push(i));const e=()=>{const a=[];this._xyAxisVisible||i.forEachManipulator(i=>a.push(i.disableDisplay())),this._handles.remove(u),this._handles.add(a,u)};for(const t of n)this._handles.add(t.events.on("focus-changed",e));this._view.inputManager&&this._handles.add(t(()=>this._view.inputManager?.latestPointerType,e)),e()}static radiusForSymbol(i){const a=null!=i&&"point-3d"===i.type&&i.symbolLayers;return!!a&&a.some(i=>"icon"===i.type)?n:e}}const u="disable-xy-axis-display";export{p as MoveManipulation};
5
+ import i from"../../../../../core/Handles.js";import{handlesGroup as a}from"../../../../../core/handleUtils.js";import has from"../../../../../core/has.js";import{when as t}from"../../../../../core/reactiveUtils.js";import{discRadiusSmall as n,discRadius as e}from"./config.js";import{InteractiveManipulation as s}from"./InteractiveManipulation.js";import{MoveXYAxisManipulation as o}from"./MoveXYAxisManipulation.js";import{MoveXYDiscManipulation as l}from"./MoveXYDiscManipulation.js";import{MoveZManipulation as r}from"./MoveZManipulation.js";class p extends s{constructor(a){super(),this._handles=new i;const{tool:t,view:n,snapToScene:e,radius:s}=a;this._view=n,this.xyManipulation=new l({tool:t,view:n,snapToScene:e,radius:s}),this.xyAxisManipulation=new o({tool:t,view:n,radius:s}),this.zManipulation=new r({tool:t,view:n,radius:s}),this.xyManipulation.available=a.xyAvailable,this.xyAxisManipulation.available=a.xyAxisAvailable,this.zManipulation.available=a.zAvailable,this._autoHideXYAxis(),this.forEachManipulator(i=>this._handles.add(i.events.on("grab-changed",()=>this._updateManipulatorInteractivity())))}destroy(){this._handles.destroy(),this.xyManipulation.destroy(),this.xyAxisManipulation.destroy(),this.zManipulation.destroy()}createManipulatedObjectDragPipeline(i,t,n){return a([this.xyManipulation.createManipulatedObjectDragPipeline((a,t,n,e,s)=>i(0,a,t,n,e,s),t,n),this.xyAxisManipulation.createManipulatedObjectDragPipeline((a,t,n,e,s)=>i(1,a,t,n,e,s),t,n),this.zManipulation.createManipulatedObjectDragPipeline((a,t,n,e,s)=>i(2,a,t,n,e,s),t,n)])}createDragPipeline(i,t,n,e){return a([this.xyManipulation.createDragPipeline((a,t,n,e,s)=>i(0,a,t,n,e,s),t,n,e),this.xyAxisManipulation.createDragPipeline((a,t,n,e,s)=>i(1,a,t,n,e,s),t,n,e),this.zManipulation.createDragPipeline((a,t,n,e,s)=>i(2,a,t,n,e,s),n)])}set snapToScene(i){this.xyManipulation.snapToScene=i}set angle(i){this.xyAxisManipulation.angle=i}set radius(i){this.xyAxisManipulation.radius=i,this.xyManipulation.radius=i,this.zManipulation.radius=i}set displayScale(i){this.xyManipulation.displayScale=i,this.xyAxisManipulation.displayScale=i}forEachManipulator(i){this.xyManipulation.forEachManipulator(a=>i(a,1)),this.xyAxisManipulation.forEachManipulator(a=>i(a,1)),this.zManipulation.forEachManipulator(a=>i(a,0))}get _xyAxisVisible(){const i=this.xyManipulation.someManipulator(i=>i.focused)||this.xyAxisManipulation.someManipulator(i=>i.focused);return this._view.inputManager&&"touch"===this._view.inputManager.latestPointerInfo?.type||i}_autoHideXYAxis(){const i=this.xyAxisManipulation,a=this.xyManipulation;if(has("esri-mobile"))return;const n=[];a.forEachManipulator(i=>n.push(i)),i.forEachManipulator(i=>n.push(i));const e=()=>{const a=[];this._xyAxisVisible||i.forEachManipulator(i=>a.push(i.disableDisplay())),this._handles.remove(u),this._handles.add(a,u)};for(const t of n)this._handles.add(t.events.on("focus-changed",e));this._view.inputManager&&this._handles.add(t(()=>this._view.inputManager?.latestPointerInfo?.type,e)),e()}static radiusForSymbol(i){const a=null!=i&&"point-3d"===i.type&&i.symbolLayers;return!!a&&a.some(i=>"icon"===i.type)?n:e}}const u="disable-xy-axis-display";export{p as MoveManipulation};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import t from"../../../../../core/Accessor.js";import{removeUnordered as i}from"../../../../../core/arrayUtils.js";import{unitRGBAFromColor as a}from"../../../../../core/colorUtils.js";import{EventEmitter as 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"../../../../../core/has.js";import{destroyMaybe as p,removeMaybe as h}from"../../../../../core/maybe.js";import{watch as d,on as u,initial as c,syncAndInitial as m,when as g,sync as f}from"../../../../../core/reactiveUtils.js";import{property as _}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/Logger.js";import{subclass as v}from"../../../../../core/accessorSupport/decorators/subclass.js";import{IDENTITY as M}from"../../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{l as b,d as x,m as y,i as O,f as E,g as j}from"../../../../../chunks/vec32.js";import{fromValues as I,create as S}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{UpdatingHandles as w}from"../../../../../core/support/UpdatingHandles.js";import H from"../../../../../geometry/Point.js";import V from"../../../../../geometry/Polyline.js";import D from"../../../../../geometry/SpatialReference.js";import{makeDehydratedPoint as T}from"../../../../../layers/graphics/dehydratedPoint.js";import{isVolumetricSymbol as A}from"../../../../../symbols/support/utils.js";import{Manipulator3D as P}from"../../Manipulator3D.js";import{createManipulatorMaterial as G,createManipulatorOutlineMaterial as k,placeAtObject as C}from"../../manipulatorUtils.js";import{RenderObject as L}from"../../RenderObject.js";import{SegmentLabels3D as U}from"../../SegmentLabels3D.js";import{SnappingVisualizer3D as z}from"../../SnappingVisualizer3D.js";import{screenToMapXYAtLocation as R,screenToRenderPlaneFromEvent as F,convertToMapCoordinates as Z}from"../dragEventPipeline3D.js";import{orientation as N}from"../geometryUtils.js";import{canMoveZOperations as q}from"../manipulatorUtils.js";import{Settings as X}from"../settings.js";import{createVisualElements as Y}from"../visualElementUtils.js";import{discRadiusSmall as B}from"../manipulations/config.js";import{MoveManipulation as W}from"../manipulations/MoveManipulation.js";import{MoveXYObjectManipulation as K}from"../manipulations/MoveXYObjectManipulation.js";import{getMapPointAtEdgeOffsetManipulatorElevation as J,createEdgeOffsetIntersectionPlane as Q,createEdgeOffsetOperation as $,edgeOffsetRotationMatrix as ee,screenEdgeLengthSquared as te,getDistanceInGeometrySR as ie}from"./edgeOffsetUtils.js";import{createTooltipInfos as ae,connectTooltipToManipulatedObject as ne,getUpdatedTranslateObjectTooltipInfo as oe,getUpdatedEdgeOffsetTooltipInfo as se}from"./reshapeTooltipUtils3D.js";import{OutlineVisualElement as re}from"../../visualElements/OutlineVisualElement.js";import{createExtrudedTriangle as le,createSphereGeometry as pe}from"../../../webgl-engine/lib/GeometryUtil.js";import{sceneSnappingAtLocation as he,addMapDelta as de,createManipulatorDragEventPipeline as ue,dragAtLocation as ce,addScreenDelta as me}from"../../../../interactive/dragEventPipeline.js";import{tooltipKeys as ge}from"../../../../interactive/keybindings.js";import{SnappingContext as fe}from"../../../../interactive/snapping/SnappingContext.js";import{createSnapDragEventPipelineStep as _e}from"../../../../interactive/snapping/SnappingDragPipelineStep.js";import{makeTooltip as ve,enterInputModeIfAvailable as Me}from"../../../../interactive/tooltip/tooltipCommonUtils.js";const be=Symbol();let xe=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=0,this._pendingEdgeOffsetInfo=null,this._updatingHandles=new w,this._recreatingManipulators=!1,this._settings=new X({getTheme:()=>this.view.effectiveTheme}),this.events=new n,this.activeTooltipInfo=null,this._vertexLaserLineVisualElement=null,this._tooltipCallbacks={onBeforeReshape:()=>this.tool.endDrag(),onReshapeStart:()=>this._updateEventState(2),onReshape:()=>this.events.emit("reshape",{type:"reshape",object:this.object}),onReshapeStop:()=>this._updateEventState(0,{forceEnd:!0}),onMoveStart:()=>this._updateEventState(1),onMove:()=>this.events.emit("move",{type:"move",object:this.object,dx:0,dy:0}),onMoveStop:()=>this._updateEventState(0,{forceEnd:!0})}}initialize(){const{view:e}=this,t=this._settings.manipulators,i=t.vertex;this.tooltipInfos=ae(this._sketchOptions,e),this._vertexManipulatorMaterial=G(a(i.color),i.renderOccluded),this._vertexManipulatorOutlineMaterial=k(a(i.outlineColor),i.renderOccluded),this._vertexManipulatorHoverOutlineMaterial=k(a(i.hoverOutlineColor),i.renderOccluded);const n=t.edge;this._edgeManipulatorMaterial=G(a(n.color),n.renderOccluded),this._edgeManipulatorOutlineMaterial=k(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=k(a(s.outlineColor),s.renderOccluded),this._selectedManipulatorHoverOutlineMaterial=k(a(s.hoverOutlineColor),s.renderOccluded),this.tooltip=ve(()=>({view:e,options:this._sketchOptions.tooltips})),this.addHandles([d(()=>{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)}),d(()=>this.object.visible,e=>{for(const t of this._manipulatorInfos)t.manipulator.available=e,Ie(t)&&(t.edgeManipulator.available=e)}),d(()=>this._numGrabbing+this._numDragging===0,e=>this._toggleAutoHideManipulators(e)),d(()=>({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),ne(this.tooltip,this.object,()=>this._tooltipsContext),d(()=>this.tooltip.mode,(e,t)=>{"input"===t&&"input"!==e&&this._resetTooltip()}),u(()=>this._operations,"vertex-update",e=>this._updateManipulatorPositions(e.vertices),{onListenerAdd:()=>this._recreateManipulators()}),u(()=>this._operations?.data,"change",e=>{"undo"!==e.operation&&"redo"!==e.operation||this._recreateManipulators()})])}destroy(){this._removeManipulators(),this._updatingHandles.destroy(),this._segmentLabels=p(this._segmentLabels),this.tooltip=p(this.tooltip)}get updating(){return this._updatingHandles.updating}get manipulators(){return this.tool.manipulators}get view(){return this.tool.view}get automaticAreaMeasurementUtils(){return this.tool.automaticAreaMeasurementUtils}get automaticLengthMeasurementUtils(){return this.tool.automaticLengthMeasurementUtils}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){return"key-down"===e.type&&e.key===ge.enterInputMode&&("reshape-edge-offset"===this.activeTooltipInfo?.type?this._enterInputModeDuringEdgeOffset(e):!!Me(e,this.tooltip)&&(this.tool.endDrag(),!0))}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{vertices:i,segments:a,index:n}of this._operations.data.parts){const o=e?.byPartIndex.get(n);for(const e of i){const i=o?.has(e.index);this._createVertexOrEdgeManipulator(e,t,i)}for(const e of a)"line"===e.type&&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 U({context:{view:this.view,editGeometryOperations:this._operations,elevationInfo:this.object.elevationInfo,labelOptions:e,automaticLengthMeasurementUtils:this.automaticLengthMeasurementUtils},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=1===e&&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(1),this.destroyed)return t;this.events.emit("move",{type:"move",dx:t.screenDeltaX,dy:t.screenDeltaY,object:this.object})}else{if(this._updateEventState(2),this.destroyed)return t;this.events.emit("reshape",{type:"reshape",object:this.object})}return t}_toggleAutoHideManipulators(e){this.autoHideManipulators&&(e?this.removeHandles(be):this.tool.manipulators.forEach(({manipulator:e})=>{const t=e.disableDisplay?.();t&&this.addHandles(t,be)}))}_isMultiVertexSelection(){return this._manipulatorInfos.reduce((e,t)=>"vertex"===t.type&&t.manipulator.selected?e+1:e,0)>1}_perVertexManipulatorDragAction(e){if(this._updateEventState(2),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,1),this.events.emit("reshape",{type:"reshape",object:this.object})}_updateEventState(e,t={}){if(e===this._reshapeEventState)return!1;switch(e){case 0:if(!t.forceEnd&&(0!==this._numGrabbing||0!==this._numDragging))return!1;switch(this._reshapeEventState){case 1:this.events.emit("move",{type:"move-stop",dx:0,dy:0,object:this.object});break;case 2:this.events.emit("reshape",{type:"reshape-stop",object:this.object})}break;case 1:switch(this._reshapeEventState){case 0:this.events.emit("move",{type:"move-start",dx:0,dy:0,object:this.object});break;case 2: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 2:switch(this._reshapeEventState){case 0:this.events.emit("reshape",{type:"reshape-start",object:this.object});break;case 1: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 i=this._reshapeEventState!==e;return this._reshapeEventState=e,i}_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(0,e)).next(e=>(this._updateTranslateObjectTooltip(0,e),e)).next(t=>{"end"===t.action&&(this._resetTooltip(),e=h(e))}),n.next(()=>this._onDragCancel(!0,()=>e=h(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&&q(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(0)),this._moveManipulation.xyAxisManipulation.forEachManipulator(o(1)),this._moveManipulation.zManipulation.forEachManipulator(o(2)),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:h}=_e({predicate:e=>!!e.info,snappingManager:i.snappingManager,snappingContext:new fe({editGeometryOperations:n,elevationInfo:e,pointer:l,excludeFeature:t.graphic,visualizer:new z}),updatingHandles:this._updatingHandles,useZ:!1});return r=r.next(e=>(this._onDragCancel(),e)).next(h),{steps:s=s.next(e=>this._trackNumDragging(e)).next(e=>{const t=this._manipulatorInfos.filter(e=>"vertex"===e.type&&e.manipulator.selected);return 1===e.manipulatorType&&1===t.length?{...e,info:t[0],snapOrigin:t[0].handle.pos}:e}).next(he(this.view,e,t.graphic??void 0)).next(...p).next(de()).next(e=>this._perObjectManipulatorDragAction(1,e)).next(e=>(this._updateTranslateTooltip(a,e),e)),cancel:r}},e,s,t.graphic),d(()=>t.visible,()=>this._updateMoveManipulationPosition(),c),t.on("committed",()=>{this._recreatingManipulators||this._updateMoveManipulationPosition()}),d(()=>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=Y({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,1)}},onManipulatorsChanged:e=>this.events.on("manipulators-changed",e)});null!=i&&(this._outlineVisualElement=i.visualElement instanceof re?i.visualElement:null);const a=this._outlineVisualElement;if(null!=a){const t=()=>{e.isDraped||this._updateMoveManipulationPosition()};this._manipulatorHandles.add(u(()=>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.part.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,h=p/2,d=p*Math.sqrt(3)/2,{height:u,offset:c}=o,m=this._edgeOffsetManipulatorMaterial;if(!this._edgeOffsetManipulatorGeometryInside){const e=le(m,d,h,h,u,c);this._edgeOffsetManipulatorGeometryInside=e}if(!this._edgeOffsetManipulatorGeometryOutside){const e=le(m,-d,h,h,u,-c);this._edgeOffsetManipulatorGeometryOutside=e}const g=[new L(this._edgeOffsetManipulatorGeometryInside.instantiate(),1),new L(this._edgeOffsetManipulatorGeometryInside.instantiate({material:this._edgeOffsetManipulatorHoverMaterial}),2),new L(this._edgeOffsetManipulatorGeometryOutside.instantiate(),1),new L(this._edgeOffsetManipulatorGeometryOutside.instantiate({material:this._edgeOffsetManipulatorHoverMaterial}),2)],f=new P({view:i,renderObjects:g,elevationInfo:"on-the-ground"!==t.mode||A(this.object.graphic?.symbol)?{mode:"absolute-height",offset:0}:t,worldOriented:!1,focusMultiplier:1,radius:l,available:this.object.visible,collisionType:{type:"disc",direction:I(0,0,1)},collisionPriority:1,metadata:{deleting:!1},location:je(n)}),_=new P({view:i,worldSized:!0,worldOriented:!1,available:this.object.visible,collisionPriority:-10,cursor:this.enableMoveObject?"move":"default",metadata:{deleting:!1},location:je(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()};return this._manipulatorHandles.add([v.locationUpdateHandle,this._watchAndUpdateGrabState(f,!0),this._watchAndUpdateGrabState(_,!0),ue(f,this._createEdgeOffsetPipeline(v,t,a)),ue(_,this._createEdgePipeline(v,t,a)),_.events.on("immediate-click",b),f.events.on("immediate-click",b),f.events.on("focus-changed",()=>this._resetTooltip()),f.events.on("grab-changed",({screenPoint:e,action:t})=>{v.grabMapPoint="start"===t?J(e,this.view,this.object,v):null})],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=h(e.visibilityHandle);const n=this._getManipulatorInfoFromHandle(e.handle.leftVertex),o=this._getManipulatorInfoFromHandle(e.handle.rightVertex),l=null!=n&&null!=o&&te(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(()=>{h(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=Q(this.view,e.manipulator.elevationAlignedLocation,$(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?ee(i,o,s):M;e.manipulator.modelTransform=r,e.edgeManipulator.elevationAlignedLocation=e.manipulator.elevationAlignedLocation,e.edgeManipulator.modelTransform=r;const l=b(x(we,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(ce(this.view,r)).next(R(this.view,r,t,s,e)).next(me()).next(de()).next(e=>this._perObjectManipulatorDragAction(0,e)).next(e=>(this._updateTranslateObjectTooltip(0,e),e)).next(e=>{"end"===e.action&&this._resetTooltip()}),o.next(()=>this._onDragCancel(!a.metadata.deleting))}}}_createEdgeOffsetPipeline(e,t,i){return(a,n,o)=>{const s=this._pendingEdgeOffsetInfo;if(s?.manipulatorInfo===e&&"drag"!==s.mode)return void o.execute({action:"cancel"});this._clearSelection();const{initializeStep:r,cleanup:l}=this._initializeEdgeOffset(e,t,i,o),p=this._applyEdgeOffsetStep(e);n.next(e=>this._trackNumDragging(e)).next(ce(this.view,a.elevationAlignedLocation)).next(r).next(F(this.view)).next(Z(this.view,i.data.spatialReference)).next(de()).next(ye()).next(e=>this._pendingEdgeOffsetInfo?e:p(e)).next(e=>{"end"!==e.action||this._pendingEdgeOffsetInfo||l()}),o.next(()=>{this._exitEdgeOffsetInputMode(),a.metadata.deleting||(l(),this._onDragCancel())})}}_initializeEdgeOffset(e,t,i,a){const{view:n,object:o}=this,r=$(i.data.coordinateHelper,e.handle,t),l=i.createUndoGroup(),p=Q(n,e.manipulator.elevationAlignedLocation,r);let d;this._splitEdgesBeforeEdgeOffset(e,r),this._selectEdgeOffsetArrow(e,r);const u=()=>{this._cleanEdgeOffsetCollapsedEdges(e,i),d=h(d)},c=this.events.on("undo",u);return d=s([this._initializeEdgeOffsetVisualElement(e,o,t,i),l,c,this._connectEdgeOffsetTooltip(e,r,i,()=>{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 V({paths:[[e.handle.leftVertex.pos,e.handle.rightVertex.pos]],spatialReference:n.data.spatialReference}),r=new re({view:this.view,isDraped:t.isDraped,geometry:o(),elevationInfo:i,width:this._settings.visualElements.lineObjects.outline.width,attached:!1,isDecoration:!0}),p=s([d(()=>({color:this._accentColor,draped:t.isDraped}),({color:e,draped:t})=>{r.color=a(e),r.isDraped=t},m),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(2),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,t){const i=e.handle.leftVertex.leftSegment?.leftVertex,a=e.handle.leftVertex,n=e.handle.rightVertex.rightSegment?.rightVertex,o=e.handle.rightVertex,s=t.data.coordinateHelper,r=this.view.pixelSizeAt(s.vectorToDehydratedPoint(a.pos),s.spatialReference),l=[];if(i&&s.distance(i.pos,a.pos)<He){const e=this._getManipulatorInfoFromHandle(a);null!=e&&l.push(e)}if(s.distance(a.pos,o.pos)<r||n&&s.distance(n.pos,o.pos)<He){const e=this._getManipulatorInfoFromHandle(o);null!=e&&l.push(e)}l.length&&this._removeVertices(l)}_enterInputModeDuringEdgeOffset(e){const t=this._findActiveEdgeOffsetManipulatorInfo();return!!t&&(!!Me(e,this.tooltip)&&(t.manipulator.dragging?(this._pendingEdgeOffsetInfo={manipulatorInfo:t,mode:"drag"},!0):(this._clearSelection(),this._pendingEdgeOffsetInfo={manipulatorInfo:t,mode:"hover"},this._connectEdgeOffsetTooltipOnHover(t),!0)))}_exitEdgeOffsetInputMode(){this.tooltip&&(this._pendingEdgeOffsetInfo=null,this._resetTooltip(),this.tooltip.exitInputMode())}_findActiveEdgeOffsetManipulatorInfo(){return this._manipulatorInfos.filter(Ie).find(({manipulator:e})=>e.hovering||e.grabbing||e.dragging)}_connectEdgeOffsetTooltipOnHover(e){const{_operations:t,object:i}=this;if(!t)return;const{elevationInfo:a}=i,n=$(t.data.coordinateHelper,e.handle,a);this._selectEdgeOffsetArrow(e,n),this.addHandles([this._initializeEdgeOffsetVisualElement(e,i,a,t),this._connectEdgeOffsetTooltip(e,n,t,()=>{this.removeHandles(n),this._exitEdgeOffsetInputMode()})],n)}_splitEdgesBeforeEdgeOffset(e,t){if(t.requiresSplitEdgeLeft){const t=this._getManipulatorInfoFromHandle(e.handle.leftVertex.leftSegment);null!=t&&this._splitEdgeManipulator(t,1)}if(t.requiresSplitEdgeRight){const t=this._getManipulatorInfoFromHandle(e.handle.rightVertex.rightSegment);null!=t&&this._splitEdgeManipulator(t,0)}}_selectEdgeOffsetArrow(e,t){const i=e.grabMapPoint??J(this.view.inputManager?.latestPointerLocation,this.view,this.object,e);i&&t.selectArrowFromStartPoint(i)}_connectEdgeOffsetTooltip(e,t,i,a){const n=()=>this.tooltipInfos.edgeOffset.distance.actual,o=n=>{a(),queueMicrotask(()=>{this.view.focus();const a=i.createUndoGroup();this._tooltipCallbacks.onReshapeStart?.(),this._splitEdgesBeforeEdgeOffset(e,t),this._offsetEdge(e,t,ie(n,e.manipulator.location,t,i)),this._tooltipCallbacks.onReshape?.(),this._tooltipCallbacks.onReshapeStop?.(),this._cleanEdgeOffsetCollapsedEdges(e,i),a.remove()})},r=()=>{const e=n();null!=e?o(e):a()};return s([g(()=>this.tooltip&&!this.tooltip.focused,()=>r(),f),this.tooltip.on("discard",a),this.tooltip.on("commit",e=>{"commit-and-exit"===e.type&&r()})])}_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("line"===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}=Oe(o.manipulators.vertex);this._vertexManipulatorGeometry=pe(this._vertexManipulatorMaterial,e,16,16),this._vertexManipulatorOutlineGeometry=pe(this._vertexManipulatorOutlineMaterial,t,16,16)}if(null==this._edgeManipulatorGeometry||null==this._edgeManipulatorOutlineGeometry){const{size:e,outlineSize:t}=Oe(o.manipulators.edge);this._edgeManipulatorGeometry=pe(this._edgeManipulatorMaterial,e,16,16),this._edgeManipulatorOutlineGeometry=pe(this._edgeManipulatorOutlineMaterial,t,16,16)}const p="point"===r||"mesh"===r?[]:[new L(this._vertexManipulatorGeometry.instantiate(),4|Ve),new L(this._vertexManipulatorOutlineGeometry.instantiate(),5|Ve),new L(this._vertexManipulatorOutlineGeometry.instantiate({material:this._vertexManipulatorHoverOutlineMaterial}),6|Ve),new L(this._vertexManipulatorGeometry.instantiate({material:this._selectedManipulatorMaterial}),8),new L(this._vertexManipulatorOutlineGeometry.instantiate({material:this._selectedManipulatorOutlineMaterial}),9),new L(this._vertexManipulatorOutlineGeometry.instantiate({material:this._selectedManipulatorHoverOutlineMaterial}),10)];this.enableMidpoints&&p.push(new L(this._edgeManipulatorGeometry.instantiate({material:this._vertexManipulatorMaterial}),6|De),new L(this._edgeManipulatorOutlineGeometry.instantiate({material:this._vertexManipulatorHoverOutlineMaterial}),6|De),new L(this._edgeManipulatorGeometry.instantiate(),5|De),new L(this._edgeManipulatorOutlineGeometry.instantiate(),5|De));const d=new P({view:a,renderObjects:p,elevationInfo:t,focusMultiplier:1,touchMultiplier:1,available:this.object.visible,metadata:{deleting:!1},location:je(l)});d.selected=i,this._setTypeSpecificManipulatorSettings(d,e,t);const u="vertex"===e.type?{manipulator:d,handle:e,type:"vertex",selectedIndex:0}:{manipulator:d,handle:e,locationUpdateHandle:null,type:"edge",selectedIndex:0};if(this._manipulatorInfos.push(u),this.manipulators.add(d),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,d)}this._manipulatorHandles.add(this._watchAndUpdateGrabState(d,!0),d);const c=ue(d,(e,i,o,s)=>{let r=null;const{snappingStep:p,cancelSnapping:d}=_e({predicate:()=>!this._isMultiVertexSelection(),snappingManager:this.tool.snappingManager,snappingContext:new fe({editGeometryOperations:n,elevationInfo:t,pointer:s,excludeFeature:this.object.graphic,visualizer:new z}),updatingHandles:this._updatingHandles,useZ:!1});o=o.next(t=>(this._onDragCancel(!e.metadata.deleting,()=>r=h(r)),t)).next(d);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(ce(a,c)).next(R(a,c,t,l,m)).next(he(a,t,m)).next(...p).next(de()).next(e=>{this._perVertexManipulatorDragAction(e),"end"===e.action&&(r=h(r)),this._resetTooltip()})});return this._manipulatorHandles.add([c,d.events.on("immediate-click",e=>this._manipulatorClickCallback(e,u)),d.events.on("select-changed",()=>{u.selectedIndex=++this._selectedIndex,this._updateMoveManipulationPosition(),this._resetTooltip()}),d.events.on("focus-changed",()=>{this._resetTooltip()})],d),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 0:break;case 1:this.events.emit("move",{type:"move",dx:0,dy:0,object:this.object});break;case 2:this.events.emit("reshape",{type:"reshape",object:this.object})}t?.(),this.destroyed||this._updateEventState(0)}_setTypeSpecificManipulatorSettings(e,t,i){const a=this._settings;switch(t.type){case"vertex":{e.state=Ve,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"line":{e.state=De,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||A(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(0),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,Ie(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);this._pendingEdgeOffsetInfo=null}_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){return this._manipulatorInfos.find(t=>t.handle===e)}_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,Se),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=T(r,l,p,t.data.spatialReference)}else y(we,n.renderLocation,o.renderLocation,.5),e.manipulator.renderLocation=we}}_splitEdgeManipulator(e,t=.5){const i=this._operations,a=i.splitSegment(e.handle,t).createdVertex;e.locationUpdateHandle=h(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.leftSegment&&"line"===a.leftSegment.type&&this._createVertexOrEdgeManipulator(a.leftSegment),a.rightSegment&&"line"===a.rightSegment.type&&this._createVertexOrEdgeManipulator(a.rightSegment),this._updateManipulatorPosition(o),this.enableEdgeOffset||this._resetTooltip(),this._updateSelection(e.manipulator);const s=this._updateEventState(2),r=i.data.coordinateHelper.vectorToArray(o.handle.pos),l=i.data.parts.indexOf(a.part);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(0),o}_updateMoveManipulationPosition(){const e=O(we,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++,E(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&&q(this._operations,o.elevationInfo),this._moveManipulation.angle=N(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&&q(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.leftSegment?.leftVertex?a.handle.leftSegment.leftVertex.pos:null,o=null==n&&a.handle.rightSegment?.rightVertex?a.handle.rightSegment.rightVertex.pos:null;t&&o?this._moveManipulation.xyAxisManipulation.available=!1:t?i=Ee(t,e):o&&(i=Ee(e,o))}this._moveManipulation.angle=i,this._moveManipulation.radius=B}0!==t&&i?(j(e,e,1/t),Se.spatialReference=this._operations.data.spatialReference,Se.hasZ=!0,this.view.renderCoordsHelper.fromRenderCoords(e,Se),this._moveManipulation.elevationAlignedLocation=Se):null==this._outlineVisualElement||this.object.isDraped||null==this._outlineVisualElement.attachmentOrigin?C(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.part;if("vertex"===a.type&&i.canRemoveVertex(e)){t.push(a.handle),this._removeManipulator(a),this._removeManipulator(this._getManipulatorInfoFromHandle(a.handle.leftSegment)),this._removeManipulator(this._getManipulatorInfoFromHandle(a.handle.rightSegment));const n=i.removeVertices([a.handle]),o=n.removedVertices?.[0].createdSegment;o&&"line"===o.type?this._createVertexOrEdgeManipulator(o):this.enableEdgeOffset&&e.vertices.length<=2&&this._removeManipulator(this._getManipulatorInfoFromHandle(e.segments[0]))}}if(t.length>0){const e=t.map(e=>{const t=i.data.parts.indexOf(e.part);return{coordinates:i.data.coordinateHelper.vectorToArray(e.pos),componentIndex:t,vertexIndex:e.index}}),a=this._updateEventState(2);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(0),this.destroyed))return;this._updateMoveManipulationPosition()}}}_moveVertices(e,t,i=("start"===t.action?0:1)){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&&2===e.button&&this._removeVertices([t])),"edge"===t.type&&0===e.button&&this._splitEdgeManipulator(t),e.stopPropagation()}_updateTranslateTooltip(e,t){null!=this._defaultTooltipInfo?this._resetTooltip():this._updateTranslateObjectTooltip(e,t)}_updateTranslateObjectTooltip(e,t){this._pendingEdgeOffsetInfo||(this.activeTooltipInfo=oe(e,t,this._tooltipsContext))}_updateEdgeOffsetTooltip(e){this._pendingEdgeOffsetInfo||(this.activeTooltipInfo=se(this.object,e,this._tooltipsContext))}_resetTooltip(){const e=this.activeTooltipInfo;if(this._pendingEdgeOffsetInfo&&"reshape-edge-offset"===e?.type)return;let t=null;t=this._pendingEdgeOffsetInfo||null!=this._findActiveEdgeOffsetManipulatorInfo()?se(this.object,null,this._tooltipsContext):this._defaultTooltipInfo,t!==e&&(null!=e&&null!=t&&"input"===this.tooltip.mode||(this.activeTooltipInfo=t))}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{tooltipInfos:e,activeTooltipInfo:t,automaticAreaMeasurementUtils:i,automaticLengthMeasurementUtils:a}=this;return{sketchOptions:this._sketchOptions,tooltipInfos:e,activeTooltipInfo:t,selectedVertexManipulatorInfo:this._selectedVertexManipulatorInfo,callbacks:this._tooltipCallbacks,automaticAreaMeasurementUtils:i,automaticLengthMeasurementUtils:a}}get test(){}};function ye(){return e=>{const{operation:t,mapEnd:i}=e;return null==t||null==i?e:{...e,signedDistance:t.signedDistanceToPoint(i)}}}function Oe(e){const t=e.size/2,i=t+e.collisionPadding;return{size:t/i,outlineSize:(t+e.outlineSize)/i}}function Ee(e,t){return Math.atan2(t[1]-e[1],t[0]-e[0])+Math.PI/2}function je(e){return new H({x:0,y:0,z:0,spatialReference:e})}function Ie(e){return"edge"===e.type&&"edgeManipulator"in e}e([_()],xe.prototype,"_numGrabbing",void 0),e([_()],xe.prototype,"_numDragging",void 0),e([_()],xe.prototype,"_pendingEdgeOffsetInfo",void 0),e([_()],xe.prototype,"_operations",null),e([_()],xe.prototype,"_segmentLabels",void 0),e([_({constructOnly:!0})],xe.prototype,"tool",void 0),e([_()],xe.prototype,"tooltip",void 0),e([_()],xe.prototype,"activeTooltipInfo",void 0),e([_({readOnly:!0})],xe.prototype,"updating",null),e([_()],xe.prototype,"manipulators",null),e([_()],xe.prototype,"view",null),e([_()],xe.prototype,"automaticAreaMeasurementUtils",null),e([_()],xe.prototype,"automaticLengthMeasurementUtils",null),e([_()],xe.prototype,"object",null),e([_()],xe.prototype,"enableZShape",null),e([_()],xe.prototype,"enableDeleteVertices",null),e([_()],xe.prototype,"enableZVertex",null),e([_()],xe.prototype,"autoHideManipulators",null),e([_()],xe.prototype,"enableMoveObject",null),e([_()],xe.prototype,"enableMidpoints",null),e([_()],xe.prototype,"enableEdgeOffset",null),e([_()],xe.prototype,"_sketchOptions",null),e([_()],xe.prototype,"_accentColor",null),e([_()],xe.prototype,"_tooltipsContext",null),xe=e([v("esri.views.3d.interactive.editingTools.reshape.ReshapeOperation")],xe);const Se=T(0,0,void 0,D.WGS84),we=S(),He=1e-6,Ve=16,De=32;export{xe as ReshapeOperation};
5
+ import{__decorate as e}from"tslib";import t from"../../../../../core/Accessor.js";import{removeUnordered as i}from"../../../../../core/arrayUtils.js";import{unitRGBAFromColor as a}from"../../../../../core/colorUtils.js";import{EventEmitter as 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"../../../../../core/has.js";import{destroyMaybe as p,removeMaybe as h}from"../../../../../core/maybe.js";import{watch as d,on as u,initial as c,syncAndInitial as m,when as g,sync as f}from"../../../../../core/reactiveUtils.js";import{property as _}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/Logger.js";import{subclass as v}from"../../../../../core/accessorSupport/decorators/subclass.js";import{IDENTITY as M}from"../../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{l as b,d as x,m as y,i as O,f as E,g as j}from"../../../../../chunks/vec32.js";import{fromValues as I,create as S}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{UpdatingHandles as w}from"../../../../../core/support/UpdatingHandles.js";import H from"../../../../../geometry/Point.js";import V from"../../../../../geometry/Polyline.js";import D from"../../../../../geometry/SpatialReference.js";import{makeDehydratedPoint as T}from"../../../../../layers/graphics/dehydratedPoint.js";import{isVolumetricSymbol as A}from"../../../../../symbols/support/utils.js";import{Manipulator3D as P}from"../../Manipulator3D.js";import{createManipulatorMaterial as G,createManipulatorOutlineMaterial as k,placeAtObject as C}from"../../manipulatorUtils.js";import{RenderObject as L}from"../../RenderObject.js";import{SegmentLabels3D as U}from"../../SegmentLabels3D.js";import{SnappingVisualizer3D as z}from"../../SnappingVisualizer3D.js";import{screenToMapXYAtLocation as R,screenToRenderPlaneFromEvent as F,convertToMapCoordinates as Z}from"../dragEventPipeline3D.js";import{orientation as N}from"../geometryUtils.js";import{canMoveZOperations as q}from"../manipulatorUtils.js";import{Settings as X}from"../settings.js";import{createVisualElements as Y}from"../visualElementUtils.js";import{discRadiusSmall as B}from"../manipulations/config.js";import{MoveManipulation as W}from"../manipulations/MoveManipulation.js";import{MoveXYObjectManipulation as K}from"../manipulations/MoveXYObjectManipulation.js";import{getMapPointAtEdgeOffsetManipulatorElevation as J,createEdgeOffsetIntersectionPlane as Q,createEdgeOffsetOperation as $,edgeOffsetRotationMatrix as ee,screenEdgeLengthSquared as te,getDistanceInGeometrySR as ie}from"./edgeOffsetUtils.js";import{createTooltipInfos as ae,connectTooltipToManipulatedObject as ne,getUpdatedTranslateObjectTooltipInfo as oe,getUpdatedEdgeOffsetTooltipInfo as se}from"./reshapeTooltipUtils3D.js";import{OutlineVisualElement as re}from"../../visualElements/OutlineVisualElement.js";import{createExtrudedTriangle as le,createSphereGeometry as pe}from"../../../webgl-engine/lib/GeometryUtil.js";import{sceneSnappingAtLocation as he,addMapDelta as de,createManipulatorDragEventPipeline as ue,dragAtLocation as ce,addScreenDelta as me}from"../../../../interactive/dragEventPipeline.js";import{tooltipKeys as ge}from"../../../../interactive/keybindings.js";import{SnappingContext as fe}from"../../../../interactive/snapping/SnappingContext.js";import{createSnapDragEventPipelineStep as _e}from"../../../../interactive/snapping/SnappingDragPipelineStep.js";import{makeTooltip as ve,enterInputModeIfAvailable as Me}from"../../../../interactive/tooltip/tooltipCommonUtils.js";const be=Symbol();let xe=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=0,this._pendingEdgeOffsetInfo=null,this._updatingHandles=new w,this._recreatingManipulators=!1,this._settings=new X({getTheme:()=>this.view.effectiveTheme}),this.events=new n,this.activeTooltipInfo=null,this._vertexLaserLineVisualElement=null,this._tooltipCallbacks={onBeforeReshape:()=>this.tool.endDrag(),onReshapeStart:()=>this._updateEventState(2),onReshape:()=>this.events.emit("reshape",{type:"reshape",object:this.object}),onReshapeStop:()=>this._updateEventState(0,{forceEnd:!0}),onMoveStart:()=>this._updateEventState(1),onMove:()=>this.events.emit("move",{type:"move",object:this.object,dx:0,dy:0}),onMoveStop:()=>this._updateEventState(0,{forceEnd:!0})}}initialize(){const{view:e}=this,t=this._settings.manipulators,i=t.vertex;this.tooltipInfos=ae(this._sketchOptions,e),this._vertexManipulatorMaterial=G(a(i.color),i.renderOccluded),this._vertexManipulatorOutlineMaterial=k(a(i.outlineColor),i.renderOccluded),this._vertexManipulatorHoverOutlineMaterial=k(a(i.hoverOutlineColor),i.renderOccluded);const n=t.edge;this._edgeManipulatorMaterial=G(a(n.color),n.renderOccluded),this._edgeManipulatorOutlineMaterial=k(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=k(a(s.outlineColor),s.renderOccluded),this._selectedManipulatorHoverOutlineMaterial=k(a(s.hoverOutlineColor),s.renderOccluded),this.tooltip=ve(()=>({view:e,options:this._sketchOptions.tooltips})),this.addHandles([d(()=>{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)}),d(()=>this.object.visible,e=>{for(const t of this._manipulatorInfos)t.manipulator.available=e,Ie(t)&&(t.edgeManipulator.available=e)}),d(()=>this._numGrabbing+this._numDragging===0,e=>this._toggleAutoHideManipulators(e)),d(()=>({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),ne(this.tooltip,this.object,()=>this._tooltipsContext),d(()=>this.tooltip.mode,(e,t)=>{"input"===t&&"input"!==e&&this._resetTooltip()}),u(()=>this._operations,"vertex-update",e=>this._updateManipulatorPositions(e.vertices),{onListenerAdd:()=>this._recreateManipulators()}),u(()=>this._operations?.data,"change",e=>{"undo"!==e.operation&&"redo"!==e.operation||this._recreateManipulators()})])}destroy(){this._removeManipulators(),this._updatingHandles.destroy(),this._segmentLabels=p(this._segmentLabels),this.tooltip=p(this.tooltip)}get updating(){return this._updatingHandles.updating}get manipulators(){return this.tool.manipulators}get view(){return this.tool.view}get automaticAreaMeasurementUtils(){return this.tool.automaticAreaMeasurementUtils}get automaticLengthMeasurementUtils(){return this.tool.automaticLengthMeasurementUtils}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){return"key-down"===e.type&&e.key===ge.enterInputMode&&("reshape-edge-offset"===this.activeTooltipInfo?.type?this._enterInputModeDuringEdgeOffset(e):!!Me(e,this.tooltip)&&(this.tool.endDrag(),!0))}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{vertices:i,segments:a,index:n}of this._operations.data.parts){const o=e?.byPartIndex.get(n);for(const e of i){const i=o?.has(e.index);this._createVertexOrEdgeManipulator(e,t,i)}for(const e of a)"line"===e.type&&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 U({context:{view:this.view,editGeometryOperations:this._operations,elevationInfo:this.object.elevationInfo,labelOptions:e,automaticLengthMeasurementUtils:this.automaticLengthMeasurementUtils},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=1===e&&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(1),this.destroyed)return t;this.events.emit("move",{type:"move",dx:t.screenDeltaX,dy:t.screenDeltaY,object:this.object})}else{if(this._updateEventState(2),this.destroyed)return t;this.events.emit("reshape",{type:"reshape",object:this.object})}return t}_toggleAutoHideManipulators(e){this.autoHideManipulators&&(e?this.removeHandles(be):this.tool.manipulators.forEach(({manipulator:e})=>{const t=e.disableDisplay?.();t&&this.addHandles(t,be)}))}_isMultiVertexSelection(){return this._manipulatorInfos.reduce((e,t)=>"vertex"===t.type&&t.manipulator.selected?e+1:e,0)>1}_perVertexManipulatorDragAction(e){if(this._updateEventState(2),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,1),this.events.emit("reshape",{type:"reshape",object:this.object})}_updateEventState(e,t={}){if(e===this._reshapeEventState)return!1;switch(e){case 0:if(!t.forceEnd&&(0!==this._numGrabbing||0!==this._numDragging))return!1;switch(this._reshapeEventState){case 1:this.events.emit("move",{type:"move-stop",dx:0,dy:0,object:this.object});break;case 2:this.events.emit("reshape",{type:"reshape-stop",object:this.object})}break;case 1:switch(this._reshapeEventState){case 0:this.events.emit("move",{type:"move-start",dx:0,dy:0,object:this.object});break;case 2: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 2:switch(this._reshapeEventState){case 0:this.events.emit("reshape",{type:"reshape-start",object:this.object});break;case 1: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 i=this._reshapeEventState!==e;return this._reshapeEventState=e,i}_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(0,e)).next(e=>(this._updateTranslateObjectTooltip(0,e),e)).next(t=>{"end"===t.action&&(this._resetTooltip(),e=h(e))}),n.next(()=>this._onDragCancel(!0,()=>e=h(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&&q(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(0)),this._moveManipulation.xyAxisManipulation.forEachManipulator(o(1)),this._moveManipulation.zManipulation.forEachManipulator(o(2)),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:h}=_e({predicate:e=>!!e.info,snappingManager:i.snappingManager,snappingContext:new fe({editGeometryOperations:n,elevationInfo:e,pointer:l,excludeFeature:t.graphic,visualizer:new z}),updatingHandles:this._updatingHandles,useZ:!1});return r=r.next(e=>(this._onDragCancel(),e)).next(h),{steps:s=s.next(e=>this._trackNumDragging(e)).next(e=>{const t=this._manipulatorInfos.filter(e=>"vertex"===e.type&&e.manipulator.selected);return 1===e.manipulatorType&&1===t.length?{...e,info:t[0],snapOrigin:t[0].handle.pos}:e}).next(he(this.view,e,t.graphic??void 0)).next(...p).next(de()).next(e=>this._perObjectManipulatorDragAction(1,e)).next(e=>(this._updateTranslateTooltip(a,e),e)),cancel:r}},e,s,t.graphic),d(()=>t.visible,()=>this._updateMoveManipulationPosition(),c),t.on("committed",()=>{this._recreatingManipulators||this._updateMoveManipulationPosition()}),d(()=>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=Y({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,1)}},onManipulatorsChanged:e=>this.events.on("manipulators-changed",e)});null!=i&&(this._outlineVisualElement=i.visualElement instanceof re?i.visualElement:null);const a=this._outlineVisualElement;if(null!=a){const t=()=>{e.isDraped||this._updateMoveManipulationPosition()};this._manipulatorHandles.add(u(()=>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.part.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,h=p/2,d=p*Math.sqrt(3)/2,{height:u,offset:c}=o,m=this._edgeOffsetManipulatorMaterial;if(!this._edgeOffsetManipulatorGeometryInside){const e=le(m,d,h,h,u,c);this._edgeOffsetManipulatorGeometryInside=e}if(!this._edgeOffsetManipulatorGeometryOutside){const e=le(m,-d,h,h,u,-c);this._edgeOffsetManipulatorGeometryOutside=e}const g=[new L(this._edgeOffsetManipulatorGeometryInside.instantiate(),1),new L(this._edgeOffsetManipulatorGeometryInside.instantiate({material:this._edgeOffsetManipulatorHoverMaterial}),2),new L(this._edgeOffsetManipulatorGeometryOutside.instantiate(),1),new L(this._edgeOffsetManipulatorGeometryOutside.instantiate({material:this._edgeOffsetManipulatorHoverMaterial}),2)],f=new P({view:i,renderObjects:g,elevationInfo:"on-the-ground"!==t.mode||A(this.object.graphic?.symbol)?{mode:"absolute-height",offset:0}:t,worldOriented:!1,focusMultiplier:1,radius:l,available:this.object.visible,collisionType:{type:"disc",direction:I(0,0,1)},collisionPriority:1,metadata:{deleting:!1},location:je(n)}),_=new P({view:i,worldSized:!0,worldOriented:!1,available:this.object.visible,collisionPriority:-10,cursor:this.enableMoveObject?"move":"default",metadata:{deleting:!1},location:je(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()};return this._manipulatorHandles.add([v.locationUpdateHandle,this._watchAndUpdateGrabState(f,!0),this._watchAndUpdateGrabState(_,!0),ue(f,this._createEdgeOffsetPipeline(v,t,a)),ue(_,this._createEdgePipeline(v,t,a)),_.events.on("immediate-click",b),f.events.on("immediate-click",b),f.events.on("focus-changed",()=>this._resetTooltip()),f.events.on("grab-changed",({screenPoint:e,action:t})=>{v.grabMapPoint="start"===t?J(e,this.view,this.object,v):null})],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=h(e.visibilityHandle);const n=this._getManipulatorInfoFromHandle(e.handle.leftVertex),o=this._getManipulatorInfoFromHandle(e.handle.rightVertex),l=null!=n&&null!=o&&te(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(()=>{h(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=Q(this.view,e.manipulator.elevationAlignedLocation,$(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?ee(i,o,s):M;e.manipulator.modelTransform=r,e.edgeManipulator.elevationAlignedLocation=e.manipulator.elevationAlignedLocation,e.edgeManipulator.modelTransform=r;const l=b(x(we,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(ce(this.view,r)).next(R(this.view,r,t,s,e)).next(me()).next(de()).next(e=>this._perObjectManipulatorDragAction(0,e)).next(e=>(this._updateTranslateObjectTooltip(0,e),e)).next(e=>{"end"===e.action&&this._resetTooltip()}),o.next(()=>this._onDragCancel(!a.metadata.deleting))}}}_createEdgeOffsetPipeline(e,t,i){return(a,n,o)=>{const s=this._pendingEdgeOffsetInfo;if(s?.manipulatorInfo===e&&"drag"!==s.mode)return void o.execute({action:"cancel"});this._clearSelection();const{initializeStep:r,cleanup:l}=this._initializeEdgeOffset(e,t,i,o),p=this._applyEdgeOffsetStep(e);n.next(e=>this._trackNumDragging(e)).next(ce(this.view,a.elevationAlignedLocation)).next(r).next(F(this.view)).next(Z(this.view,i.data.spatialReference)).next(de()).next(ye()).next(e=>this._pendingEdgeOffsetInfo?e:p(e)).next(e=>{"end"!==e.action||this._pendingEdgeOffsetInfo||l()}),o.next(()=>{this._exitEdgeOffsetInputMode(),a.metadata.deleting||(l(),this._onDragCancel())})}}_initializeEdgeOffset(e,t,i,a){const{view:n,object:o}=this,r=$(i.data.coordinateHelper,e.handle,t),l=i.createUndoGroup(),p=Q(n,e.manipulator.elevationAlignedLocation,r);let d;this._splitEdgesBeforeEdgeOffset(e,r),this._selectEdgeOffsetArrow(e,r);const u=()=>{this._cleanEdgeOffsetCollapsedEdges(e,i),d=h(d)},c=this.events.on("undo",u);return d=s([this._initializeEdgeOffsetVisualElement(e,o,t,i),l,c,this._connectEdgeOffsetTooltip(e,r,i,()=>{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 V({paths:[[e.handle.leftVertex.pos,e.handle.rightVertex.pos]],spatialReference:n.data.spatialReference}),r=new re({view:this.view,isDraped:t.isDraped,geometry:o(),elevationInfo:i,width:this._settings.visualElements.lineObjects.outline.width,attached:!1,isDecoration:!0}),p=s([d(()=>({color:this._accentColor,draped:t.isDraped}),({color:e,draped:t})=>{r.color=a(e),r.isDraped=t},m),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(2),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,t){const i=e.handle.leftVertex.leftSegment?.leftVertex,a=e.handle.leftVertex,n=e.handle.rightVertex.rightSegment?.rightVertex,o=e.handle.rightVertex,s=t.data.coordinateHelper,r=this.view.pixelSizeAt(s.vectorToDehydratedPoint(a.pos),s.spatialReference),l=[];if(i&&s.distance(i.pos,a.pos)<He){const e=this._getManipulatorInfoFromHandle(a);null!=e&&l.push(e)}if(s.distance(a.pos,o.pos)<r||n&&s.distance(n.pos,o.pos)<He){const e=this._getManipulatorInfoFromHandle(o);null!=e&&l.push(e)}l.length&&this._removeVertices(l)}_enterInputModeDuringEdgeOffset(e){const t=this._findActiveEdgeOffsetManipulatorInfo();return!!t&&(!!Me(e,this.tooltip)&&(t.manipulator.dragging?(this._pendingEdgeOffsetInfo={manipulatorInfo:t,mode:"drag"},!0):(this._clearSelection(),this._pendingEdgeOffsetInfo={manipulatorInfo:t,mode:"hover"},this._connectEdgeOffsetTooltipOnHover(t),!0)))}_exitEdgeOffsetInputMode(){this.tooltip&&(this._pendingEdgeOffsetInfo=null,this._resetTooltip(),this.tooltip.exitInputMode())}_findActiveEdgeOffsetManipulatorInfo(){return this._manipulatorInfos.filter(Ie).find(({manipulator:e})=>e.hovering||e.grabbing||e.dragging)}_connectEdgeOffsetTooltipOnHover(e){const{_operations:t,object:i}=this;if(!t)return;const{elevationInfo:a}=i,n=$(t.data.coordinateHelper,e.handle,a);this._selectEdgeOffsetArrow(e,n),this.addHandles([this._initializeEdgeOffsetVisualElement(e,i,a,t),this._connectEdgeOffsetTooltip(e,n,t,()=>{this.removeHandles(n),this._exitEdgeOffsetInputMode()})],n)}_splitEdgesBeforeEdgeOffset(e,t){if(t.requiresSplitEdgeLeft){const t=this._getManipulatorInfoFromHandle(e.handle.leftVertex.leftSegment);null!=t&&this._splitEdgeManipulator(t,1)}if(t.requiresSplitEdgeRight){const t=this._getManipulatorInfoFromHandle(e.handle.rightVertex.rightSegment);null!=t&&this._splitEdgeManipulator(t,0)}}_selectEdgeOffsetArrow(e,t){const i=e.grabMapPoint??J(this.view.inputManager?.latestPointerInfo?.location,this.view,this.object,e);i&&t.selectArrowFromStartPoint(i)}_connectEdgeOffsetTooltip(e,t,i,a){const n=()=>this.tooltipInfos.edgeOffset.distance.actual,o=n=>{a(),queueMicrotask(()=>{this.view.focus();const a=i.createUndoGroup();this._tooltipCallbacks.onReshapeStart?.(),this._splitEdgesBeforeEdgeOffset(e,t),this._offsetEdge(e,t,ie(n,e.manipulator.location,t,i)),this._tooltipCallbacks.onReshape?.(),this._tooltipCallbacks.onReshapeStop?.(),this._cleanEdgeOffsetCollapsedEdges(e,i),a.remove()})},r=()=>{const e=n();null!=e?o(e):a()};return s([g(()=>this.tooltip&&!this.tooltip.focused,()=>r(),f),this.tooltip.on("discard",a),this.tooltip.on("commit",e=>{"commit-and-exit"===e.type&&r()})])}_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("line"===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}=Oe(o.manipulators.vertex);this._vertexManipulatorGeometry=pe(this._vertexManipulatorMaterial,e,16,16),this._vertexManipulatorOutlineGeometry=pe(this._vertexManipulatorOutlineMaterial,t,16,16)}if(null==this._edgeManipulatorGeometry||null==this._edgeManipulatorOutlineGeometry){const{size:e,outlineSize:t}=Oe(o.manipulators.edge);this._edgeManipulatorGeometry=pe(this._edgeManipulatorMaterial,e,16,16),this._edgeManipulatorOutlineGeometry=pe(this._edgeManipulatorOutlineMaterial,t,16,16)}const p="point"===r||"mesh"===r?[]:[new L(this._vertexManipulatorGeometry.instantiate(),4|Ve),new L(this._vertexManipulatorOutlineGeometry.instantiate(),5|Ve),new L(this._vertexManipulatorOutlineGeometry.instantiate({material:this._vertexManipulatorHoverOutlineMaterial}),6|Ve),new L(this._vertexManipulatorGeometry.instantiate({material:this._selectedManipulatorMaterial}),8),new L(this._vertexManipulatorOutlineGeometry.instantiate({material:this._selectedManipulatorOutlineMaterial}),9),new L(this._vertexManipulatorOutlineGeometry.instantiate({material:this._selectedManipulatorHoverOutlineMaterial}),10)];this.enableMidpoints&&p.push(new L(this._edgeManipulatorGeometry.instantiate({material:this._vertexManipulatorMaterial}),6|De),new L(this._edgeManipulatorOutlineGeometry.instantiate({material:this._vertexManipulatorHoverOutlineMaterial}),6|De),new L(this._edgeManipulatorGeometry.instantiate(),5|De),new L(this._edgeManipulatorOutlineGeometry.instantiate(),5|De));const d=new P({view:a,renderObjects:p,elevationInfo:t,focusMultiplier:1,touchMultiplier:1,available:this.object.visible,metadata:{deleting:!1},location:je(l)});d.selected=i,this._setTypeSpecificManipulatorSettings(d,e,t);const u="vertex"===e.type?{manipulator:d,handle:e,type:"vertex",selectedIndex:0}:{manipulator:d,handle:e,locationUpdateHandle:null,type:"edge",selectedIndex:0};if(this._manipulatorInfos.push(u),this.manipulators.add(d),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,d)}this._manipulatorHandles.add(this._watchAndUpdateGrabState(d,!0),d);const c=ue(d,(e,i,o,s)=>{let r=null;const{snappingStep:p,cancelSnapping:d}=_e({predicate:()=>!this._isMultiVertexSelection(),snappingManager:this.tool.snappingManager,snappingContext:new fe({editGeometryOperations:n,elevationInfo:t,pointer:s,excludeFeature:this.object.graphic,visualizer:new z}),updatingHandles:this._updatingHandles,useZ:!1});o=o.next(t=>(this._onDragCancel(!e.metadata.deleting,()=>r=h(r)),t)).next(d);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(ce(a,c)).next(R(a,c,t,l,m)).next(he(a,t,m)).next(...p).next(de()).next(e=>{this._perVertexManipulatorDragAction(e),"end"===e.action&&(r=h(r)),this._resetTooltip()})});return this._manipulatorHandles.add([c,d.events.on("immediate-click",e=>this._manipulatorClickCallback(e,u)),d.events.on("select-changed",()=>{u.selectedIndex=++this._selectedIndex,this._updateMoveManipulationPosition(),this._resetTooltip()}),d.events.on("focus-changed",()=>{this._resetTooltip()})],d),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 0:break;case 1:this.events.emit("move",{type:"move",dx:0,dy:0,object:this.object});break;case 2:this.events.emit("reshape",{type:"reshape",object:this.object})}t?.(),this.destroyed||this._updateEventState(0)}_setTypeSpecificManipulatorSettings(e,t,i){const a=this._settings;switch(t.type){case"vertex":{e.state=Ve,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"line":{e.state=De,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||A(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(0),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,Ie(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);this._pendingEdgeOffsetInfo=null}_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){return this._manipulatorInfos.find(t=>t.handle===e)}_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,Se),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=T(r,l,p,t.data.spatialReference)}else y(we,n.renderLocation,o.renderLocation,.5),e.manipulator.renderLocation=we}}_splitEdgeManipulator(e,t=.5){const i=this._operations,a=i.splitSegment(e.handle,t).createdVertex;e.locationUpdateHandle=h(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.leftSegment&&"line"===a.leftSegment.type&&this._createVertexOrEdgeManipulator(a.leftSegment),a.rightSegment&&"line"===a.rightSegment.type&&this._createVertexOrEdgeManipulator(a.rightSegment),this._updateManipulatorPosition(o),this.enableEdgeOffset||this._resetTooltip(),this._updateSelection(e.manipulator);const s=this._updateEventState(2),r=i.data.coordinateHelper.vectorToArray(o.handle.pos),l=i.data.parts.indexOf(a.part);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(0),o}_updateMoveManipulationPosition(){const e=O(we,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++,E(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&&q(this._operations,o.elevationInfo),this._moveManipulation.angle=N(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&&q(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.leftSegment?.leftVertex?a.handle.leftSegment.leftVertex.pos:null,o=null==n&&a.handle.rightSegment?.rightVertex?a.handle.rightSegment.rightVertex.pos:null;t&&o?this._moveManipulation.xyAxisManipulation.available=!1:t?i=Ee(t,e):o&&(i=Ee(e,o))}this._moveManipulation.angle=i,this._moveManipulation.radius=B}0!==t&&i?(j(e,e,1/t),Se.spatialReference=this._operations.data.spatialReference,Se.hasZ=!0,this.view.renderCoordsHelper.fromRenderCoords(e,Se),this._moveManipulation.elevationAlignedLocation=Se):null==this._outlineVisualElement||this.object.isDraped||null==this._outlineVisualElement.attachmentOrigin?C(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.part;if("vertex"===a.type&&i.canRemoveVertex(e)){t.push(a.handle),this._removeManipulator(a),this._removeManipulator(this._getManipulatorInfoFromHandle(a.handle.leftSegment)),this._removeManipulator(this._getManipulatorInfoFromHandle(a.handle.rightSegment));const n=i.removeVertices([a.handle]),o=n.removedVertices?.[0].createdSegment;o&&"line"===o.type?this._createVertexOrEdgeManipulator(o):this.enableEdgeOffset&&e.vertices.length<=2&&this._removeManipulator(this._getManipulatorInfoFromHandle(e.segments[0]))}}if(t.length>0){const e=t.map(e=>{const t=i.data.parts.indexOf(e.part);return{coordinates:i.data.coordinateHelper.vectorToArray(e.pos),componentIndex:t,vertexIndex:e.index}}),a=this._updateEventState(2);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(0),this.destroyed))return;this._updateMoveManipulationPosition()}}}_moveVertices(e,t,i=("start"===t.action?0:1)){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&&2===e.button&&this._removeVertices([t])),"edge"===t.type&&0===e.button&&this._splitEdgeManipulator(t),e.stopPropagation()}_updateTranslateTooltip(e,t){null!=this._defaultTooltipInfo?this._resetTooltip():this._updateTranslateObjectTooltip(e,t)}_updateTranslateObjectTooltip(e,t){this._pendingEdgeOffsetInfo||(this.activeTooltipInfo=oe(e,t,this._tooltipsContext))}_updateEdgeOffsetTooltip(e){this._pendingEdgeOffsetInfo||(this.activeTooltipInfo=se(this.object,e,this._tooltipsContext))}_resetTooltip(){const e=this.activeTooltipInfo;if(this._pendingEdgeOffsetInfo&&"reshape-edge-offset"===e?.type)return;let t=null;t=this._pendingEdgeOffsetInfo||null!=this._findActiveEdgeOffsetManipulatorInfo()?se(this.object,null,this._tooltipsContext):this._defaultTooltipInfo,t!==e&&(null!=e&&null!=t&&"input"===this.tooltip.mode||(this.activeTooltipInfo=t))}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{tooltipInfos:e,activeTooltipInfo:t,automaticAreaMeasurementUtils:i,automaticLengthMeasurementUtils:a}=this;return{sketchOptions:this._sketchOptions,tooltipInfos:e,activeTooltipInfo:t,selectedVertexManipulatorInfo:this._selectedVertexManipulatorInfo,callbacks:this._tooltipCallbacks,automaticAreaMeasurementUtils:i,automaticLengthMeasurementUtils:a}}get test(){}};function ye(){return e=>{const{operation:t,mapEnd:i}=e;return null==t||null==i?e:{...e,signedDistance:t.signedDistanceToPoint(i)}}}function Oe(e){const t=e.size/2,i=t+e.collisionPadding;return{size:t/i,outlineSize:(t+e.outlineSize)/i}}function Ee(e,t){return Math.atan2(t[1]-e[1],t[0]-e[0])+Math.PI/2}function je(e){return new H({x:0,y:0,z:0,spatialReference:e})}function Ie(e){return"edge"===e.type&&"edgeManipulator"in e}e([_()],xe.prototype,"_numGrabbing",void 0),e([_()],xe.prototype,"_numDragging",void 0),e([_()],xe.prototype,"_pendingEdgeOffsetInfo",void 0),e([_()],xe.prototype,"_operations",null),e([_()],xe.prototype,"_segmentLabels",void 0),e([_({constructOnly:!0})],xe.prototype,"tool",void 0),e([_()],xe.prototype,"tooltip",void 0),e([_()],xe.prototype,"activeTooltipInfo",void 0),e([_({readOnly:!0})],xe.prototype,"updating",null),e([_()],xe.prototype,"manipulators",null),e([_()],xe.prototype,"view",null),e([_()],xe.prototype,"automaticAreaMeasurementUtils",null),e([_()],xe.prototype,"automaticLengthMeasurementUtils",null),e([_()],xe.prototype,"object",null),e([_()],xe.prototype,"enableZShape",null),e([_()],xe.prototype,"enableDeleteVertices",null),e([_()],xe.prototype,"enableZVertex",null),e([_()],xe.prototype,"autoHideManipulators",null),e([_()],xe.prototype,"enableMoveObject",null),e([_()],xe.prototype,"enableMidpoints",null),e([_()],xe.prototype,"enableEdgeOffset",null),e([_()],xe.prototype,"_sketchOptions",null),e([_()],xe.prototype,"_accentColor",null),e([_()],xe.prototype,"_tooltipsContext",null),xe=e([v("esri.views.3d.interactive.editingTools.reshape.ReshapeOperation")],xe);const Se=T(0,0,void 0,D.WGS84),we=S(),He=1e-6,Ve=16,De=32;export{xe 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.34/esri/copyright.txt for details.
4
4
  */
5
- import{rad2deg as t}from"../../../../../../core/mathUtils.js";import{rotateX as e}from"../../../../../../core/libs/gl-matrix-2/math/mat4.js";import{f as o,c as r}from"../../../../../../chunks/vec32.js";import{create as a}from"../../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{c as n}from"../../../../../../chunks/boundedPlane.js";import{create as s,intersectRay as i,getNormal as l}from"../../../../../../geometry/support/plane.js";import{sm4d as p,sv3d as u}from"../../../../../../geometry/support/vectorStacks.js";import{getRotateHeadingTexture as c}from"../../../../analysis/images/Factory.js";import{RotateManipulator as m}from"../../../../analysis/Slice/RotateManipulator.js";import{createRotatePlane as d}from"../../../../analysis/Slice/sliceToolUtils.js";import{calculateInputRotationTransform as h}from"../../../manipulatorUtils.js";import{screenToRenderPlane as g}from"../../dragEventPipeline3D.js";import{fromScreenNormalized as _}from"../../../../support/geometryUtils/ray.js";import{createManipulatorDragEventPipeline as f}from"../../../../../interactive/dragEventPipeline.js";import{ExtentRotateTooltipInfo as j}from"../../../../../interactive/tooltip/infos/ExtentRotateTooltipInfo.js";class v{get _object(){return this._tool.object}get _operations(){return this._object.operations}constructor(t,e,o){this._tool=t,this._bounds=e,this._snapRotation=o,this._rotateTooltipInfo=null,this._startAngle=0,this._endAngle=0;const r=this._tool,a=r.view,n=!a.stage?.renderView.renderingContext.driverTest.svgPremultipliesAlpha.result;this.rotateManipulator=new m(a,(t,e)=>c(a.stage.textures,{accentColor:t,contrastColor:e,preMultiplyAlpha:n})),r.addHandles([this.rotateManipulator.events.on("grab-changed",t=>this._onGrabChanged(t)),this._createRotateDragPipeline(this.rotateManipulator)]),r.manipulators.add(this.rotateManipulator),r.addHandles([r.events.on("rotate-start",t=>this._startAngle=t.angle),r.events.on("rotate",t=>this._endAngle=t.angle),r.events.on("rotate-stop",()=>{this._startAngle=0,this._endAngle=0})])}destroy(){this._tool.manipulators.remove(this.rotateManipulator),this.rotateManipulator.destroy()}forEachManipulator(t){t(this.rotateManipulator,3)}updateManipulators(t,r){const a=this._bounds.mapBounds.plane[2]<0?Math.PI:0,n=e(p.get(),t,a);n[12]=0,n[13]=0,n[14]=0,this.rotateManipulator.modelTransform=n,this.rotateManipulator.renderLocation=o(u.get(),r.origin,r.basis1)}getUpdatedTooltipInfo(){return this.rotateManipulator.focused?this._computeRotateTooltipInfo():null}_computeRotateTooltipInfo(){const t=this._rotateTooltipInfo??=new j({sketchOptions:this._tool.sketchOptions});return t.angle=this._startAngle-this._endAngle,t}_onGrabChanged({action:t,screenPoint:e}){const o=this._tool,r=this._bounds;if("start"!==t||!e)return;const a=d(r.displayBounds,o.view.renderCoordsHelper,1,s()),n=_(o.view.state.camera,e);i(a,n,u.get())&&(r.backupMapBounds(),o.inputState={type:"rotate",rotatePlane:a})}_createRotateDragPipeline(e){const{_tool:o,_object:r}=this;return f(e,(e,a,n)=>{const s=o.inputState;null!=s&&(a.next(t=>("start"===t.action&&o.events.emit("rotate-start",{object:r,angle:0}),t)).next(g(o.view,s.rotatePlane)).next(this._renderPlaneToAngle()).next(...this._snapRotation()).next(this._updateGeometry()).next(e=>{const a={object:r,angle:t(e.rotateAngle)};switch(e.action){case"start":case"update":o.events.emit("rotate",a);break;case"end":o.inputState=null,o.events.emit("rotate-stop",a)}return e}),n.next(()=>{null!=o.inputState&&o.events.emit("rotate-stop",{object:r,angle:0}),o.cancelDrag()}))})}_renderPlaneToAngle(){return t=>{const e=h(t.renderStart,t.renderEnd,this._bounds.displayBounds.origin,l(t.plane));return{...t,rotateAngle:e}}}_updateGeometry(){const t=this._bounds;return e=>{const o=r(a(),t.mapBoundsStart.origin),s="start"===e.action?0:1;if(this._operations){const r=this._operations.rotate(o,e.rotateAngle,s,1);n(t.mapBoundsStart,t.mapBounds),t.updateMapBoundsFromOperation(r)}return e}}}export{v as ExtentRotate};
5
+ import{rad2deg as t}from"../../../../../../core/mathUtils.js";import{rotateX as e}from"../../../../../../core/libs/gl-matrix-2/math/mat4.js";import{f as o,c as a}from"../../../../../../chunks/vec32.js";import{create as r}from"../../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{a as n}from"../../../../../../chunks/boundedPlane.js";import{create as s,intersectRay as i,getNormal as l}from"../../../../../../geometry/support/plane.js";import{sm4d as p,sv3d as u}from"../../../../../../geometry/support/vectorStacks.js";import{getRotateHeadingTexture as c}from"../../../../analysis/images/Factory.js";import{RotateManipulator as m}from"../../../../analysis/Slice/RotateManipulator.js";import{createRotatePlane as d}from"../../../../analysis/Slice/sliceToolUtils.js";import{calculateInputRotationTransform as h}from"../../../manipulatorUtils.js";import{screenToRenderPlane as g}from"../../dragEventPipeline3D.js";import{fromScreenNormalized as _}from"../../../../support/geometryUtils/ray.js";import{createManipulatorDragEventPipeline as f}from"../../../../../interactive/dragEventPipeline.js";import{ExtentRotateTooltipInfo as j}from"../../../../../interactive/tooltip/infos/ExtentRotateTooltipInfo.js";class v{get _object(){return this._tool.object}get _operations(){return this._object.operations}constructor(t,e,o){this._tool=t,this._bounds=e,this._snapRotation=o,this._rotateTooltipInfo=null,this._startAngle=0,this._endAngle=0;const a=this._tool,r=a.view,n=!r.stage?.renderView.renderingContext.driverTest.svgPremultipliesAlpha.result;this.rotateManipulator=new m(r,(t,e)=>c(r.stage.textures,{accentColor:t,contrastColor:e,preMultiplyAlpha:n})),a.addHandles([this.rotateManipulator.events.on("grab-changed",t=>this._onGrabChanged(t)),this._createRotateDragPipeline(this.rotateManipulator)]),a.manipulators.add(this.rotateManipulator),a.addHandles([a.events.on("rotate-start",t=>this._startAngle=t.angle),a.events.on("rotate",t=>this._endAngle=t.angle),a.events.on("rotate-stop",()=>{this._startAngle=0,this._endAngle=0})])}destroy(){this._tool.manipulators.remove(this.rotateManipulator),this.rotateManipulator.destroy()}forEachManipulator(t){t(this.rotateManipulator,3)}updateManipulators(t,a){const r=this._bounds.mapBounds.plane[2]<0?Math.PI:0,n=e(p.get(),t,r);n[12]=0,n[13]=0,n[14]=0,this.rotateManipulator.modelTransform=n,this.rotateManipulator.renderLocation=o(u.get(),a.origin,a.basis1)}getUpdatedTooltipInfo(){return this.rotateManipulator.focused?this._computeRotateTooltipInfo():null}_computeRotateTooltipInfo(){const t=this._rotateTooltipInfo??=new j({sketchOptions:this._tool.sketchOptions});return t.angle=this._startAngle-this._endAngle,t}_onGrabChanged({action:t,screenPoint:e}){const o=this._tool,a=this._bounds;if("start"!==t||!e)return;const r=d(a.displayBounds,o.view.renderCoordsHelper,1,s()),n=_(o.view.state.camera,e);i(r,n,u.get())&&(a.backupMapBounds(),o.inputState={type:"rotate",rotatePlane:r})}_createRotateDragPipeline(e){const{_tool:o,_object:a}=this;return f(e,(e,r,n)=>{const s=o.inputState;null!=s&&(r.next(t=>("start"===t.action&&o.events.emit("rotate-start",{object:a,angle:0}),t)).next(g(o.view,s.rotatePlane)).next(this._renderPlaneToAngle()).next(...this._snapRotation()).next(this._updateGeometry()).next(e=>{const r={object:a,angle:t(e.rotateAngle)};switch(e.action){case"start":case"update":o.events.emit("rotate",r);break;case"end":o.inputState=null,o.events.emit("rotate-stop",r)}return e}),n.next(()=>{null!=o.inputState&&o.events.emit("rotate-stop",{object:a,angle:0}),o.cancelDrag()}))})}_renderPlaneToAngle(){return t=>{const e=h(t.renderStart,t.renderEnd,this._bounds.displayBounds.origin,l(t.plane));return{...t,rotateAngle:e}}}_updateGeometry(){const t=this._bounds;return e=>{const o=a(r(),t.mapBoundsStart.origin),s="start"===e.action?0:1;if(this._operations){const a=this._operations.rotate(o,e.rotateAngle,s,1);n(t.mapBoundsStart,t.mapBounds),t.updateMapBoundsFromOperation(a)}return e}}}export{v as ExtentRotate};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{set as t,normalize as e}from"../../../../../../core/libs/gl-matrix-2/math/vec2.js";import{create as s}from"../../../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{c as a,b as i,d as o,l as r,e as n}from"../../../../../../chunks/vec32.js";import{create as c}from"../../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{a as p,c as l}from"../../../../../../chunks/boundedPlane.js";import{intersectRay as d}from"../../../../../../geometry/support/plane.js";import{sv3d as h}from"../../../../../../geometry/support/vectorStacks.js";import{ResizeManipulator as u}from"../../../../analysis/Slice/ResizeManipulator.js";import{updateResizeHandle as m,isDiagonalResizeHandle as _,calculateDiagonalResizeHandleScale as f}from"../../../../analysis/Slice/sliceToolUtils.js";import{screenToRenderPlane as S}from"../../dragEventPipeline3D.js";import{mapPlaneAutoSize2D as g}from"./extentUtils.js";import{fromScreenNormalized as y}from"../../../../support/geometryUtils/ray.js";import{createManipulatorDragEventPipeline as x}from"../../../../../interactive/dragEventPipeline.js";import{ExtentScaleTooltipInfo as M}from"../../../../../interactive/tooltip/infos/ExtentScaleTooltipInfo.js";class b{get _object(){return this._tool.object}get _operations(){return this._object.operations}get zMax(){if(!this._zMaxDirty||!this._operations)return this._zMax;const t=this._operations.data;if(t.geometry.hasZ){const e=t.coordinateHelper;this._zMax=Number.NEGATIVE_INFINITY;for(const s of t.parts)for(const t of s.vertices){const s=e.getZ(t.pos)??0;this._zMax=Math.max(s,this._zMax)}}else this._zMax=0;return this._zMaxDirty=!1,this._zMax}constructor(t,e,s){this._tool=t,this._bounds=e,this._preserveAspectRatioStep=s,this._resizeHandles=[{direction:[1,0]},{direction:[1,1]},{direction:[0,1]},{direction:[-1,1]},{direction:[-1,0]},{direction:[-1,-1]},{direction:[0,-1]},{direction:[1,-1]}],this._displayBoundsStart=p(),this._displayBoundsMarginStart=0,this._zMax=0,this._zMaxDirty=!0;const a=this._tool,i=a.view;this.resizeManipulators=this._resizeHandles.map(t=>{const e=new u(i,t);return a.addHandles([e.events.on("grab-changed",t=>this._onGrabChanged(t)),this._createResizeDragPipeline(e,t)]),e}),a.manipulators.addMany(this.resizeManipulators),this._operations&&a.addHandles(this._operations.data.on("change",()=>{"resize"!==a.inputState?.type&&(this._zMaxDirty=!0)}))}destroy(){this.forEachManipulator(t=>{this._tool.manipulators.remove(t),t.destroy()})}forEachManipulator(t){this.resizeManipulators.forEach(e=>t(e,2))}updateManipulators(t,e){this.resizeManipulators.forEach((s,a)=>{m(s,this._resizeHandles[a],t,e)})}getUpdatedTooltipInfo(){if(!this.resizeManipulators.some(t=>t.focused))return null;const t=this._tooltipInfo??=new M({sketchOptions:this._tool.sketchOptions}),e=g(this._bounds.mapBounds,this.zMax,this._bounds.spatialReference,this._tool.automaticLengthMeasurementUtils);return e&&(t.xSize=e.xSize,t.ySize=e.ySize),this.resizeManipulators.some(t=>t.dragging)||(t.xScale=1,t.yScale=1),t}_onGrabChanged({action:t,screenPoint:e}){const s=this._tool,a=this._bounds;if("start"!==t||!e)return;const i=y(s.view.state.camera,e);d(a.displayBounds.plane,i,h.get())&&(a.backupMapBounds(),l(a.displayBounds,this._displayBoundsStart),this._displayBoundsMarginStart=a.displayBoundsMargin,s.inputState={type:"resize"})}_createResizeDragPipeline(t,e){const{_tool:s,_object:a}=this;return x(t,(t,i,o)=>{null!=s.inputState&&(i.next(t=>("start"===t.action&&s.events.emit("scale-start",{object:a,xScale:1,yScale:1}),{...t,handle:e})).next(S(s.view,this._displayBoundsStart.plane)).next(this._renderPlaneToFactors()).next(...this._preserveAspectRatioStep()).next(this._updateGeometry()).next(t=>{const e=this._tooltipInfo;e&&(e.xScale=t.factor1,e.yScale=t.factor2);const i={object:a,xScale:t.factor1,yScale:t.factor2};switch(t.action){case"start":case"update":s.events.emit("scale",i);break;case"end":s.inputState=null,s.events.emit("scale-stop",i)}return t}),o.next(()=>{null!=s.inputState&&s.events.emit("scale-stop",{object:a,xScale:1,yScale:1}),s.cancelDrag()}))})}_renderPlaneToFactors(){const t=this._bounds;return e=>{const s=this._displayBoundsStart,c=e.handle.direction,p=t.displayBoundsMargin,l=this._displayBoundsMarginStart,d=a(h.get(),s.origin);i(d,d,s.basis1,-c[0]),i(d,d,s.basis2,-c[1]);const u=o(h.get(),e.renderEnd,d),m=o(h.get(),e.renderStart,d),S=_(e.handle),g=f(s),y=f(t.displayBounds)/g,x=(t,e)=>{if(0===t)return 1;let s=r(e),a=.5*t*n(e,u)/s;const i=a<0?-1:1;if(S){a+=(s-.5*t*n(e,m)/s)*i*y}const o=s<1.5*l?1:z;return s=Math.max(s-l,z),i>0&&(a-=p),i*Math.max(i*(a/s),o)};return{...e,factor1:x(c[0],s.basis1),factor2:x(c[1],s.basis2)}}}_updateGeometry(){const o=this._bounds;return r=>{const n=a(c(),o.mapBoundsStart.origin);i(n,n,o.mapBoundsStart.basis1,-r.handle.direction[0]),i(n,n,o.mapBoundsStart.basis2,-r.handle.direction[1]);const p=t(s(),o.mapBoundsStart.basis1[0],o.mapBoundsStart.basis1[1]);e(p,p);const d="start"===r.action?0:1;if(this._operations){const t=this._operations.scale(n,p,r.factor1,r.factor2,d,1);l(o.mapBoundsStart,o.mapBounds),o.updateMapBoundsFromOperation(t)}return r}}}const z=1e-6;export{b as ExtentScale,z as scaleEpsilon};
5
+ import{set as t,normalize as e}from"../../../../../../core/libs/gl-matrix-2/math/vec2.js";import{create as s}from"../../../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{c as a,b as i,d as o,l as r,e as n}from"../../../../../../chunks/vec32.js";import{create as c}from"../../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{c as p,a as l}from"../../../../../../chunks/boundedPlane.js";import{intersectRay as d}from"../../../../../../geometry/support/plane.js";import{sv3d as h}from"../../../../../../geometry/support/vectorStacks.js";import{ResizeManipulator as u}from"../../../../analysis/Slice/ResizeManipulator.js";import{updateResizeHandle as m,isDiagonalResizeHandle as _,calculateDiagonalResizeHandleScale as f}from"../../../../analysis/Slice/sliceToolUtils.js";import{screenToRenderPlane as S}from"../../dragEventPipeline3D.js";import{mapPlaneAutoSize2D as g}from"./extentUtils.js";import{fromScreenNormalized as y}from"../../../../support/geometryUtils/ray.js";import{createManipulatorDragEventPipeline as x}from"../../../../../interactive/dragEventPipeline.js";import{ExtentScaleTooltipInfo as M}from"../../../../../interactive/tooltip/infos/ExtentScaleTooltipInfo.js";class b{get _object(){return this._tool.object}get _operations(){return this._object.operations}get zMax(){if(!this._zMaxDirty||!this._operations)return this._zMax;const t=this._operations.data;if(t.geometry.hasZ){const e=t.coordinateHelper;this._zMax=Number.NEGATIVE_INFINITY;for(const s of t.parts)for(const t of s.vertices){const s=e.getZ(t.pos)??0;this._zMax=Math.max(s,this._zMax)}}else this._zMax=0;return this._zMaxDirty=!1,this._zMax}constructor(t,e,s){this._tool=t,this._bounds=e,this._preserveAspectRatioStep=s,this._resizeHandles=[{direction:[1,0]},{direction:[1,1]},{direction:[0,1]},{direction:[-1,1]},{direction:[-1,0]},{direction:[-1,-1]},{direction:[0,-1]},{direction:[1,-1]}],this._displayBoundsStart=p(),this._displayBoundsMarginStart=0,this._zMax=0,this._zMaxDirty=!0;const a=this._tool,i=a.view;this.resizeManipulators=this._resizeHandles.map(t=>{const e=new u(i,t);return a.addHandles([e.events.on("grab-changed",t=>this._onGrabChanged(t)),this._createResizeDragPipeline(e,t)]),e}),a.manipulators.addMany(this.resizeManipulators),this._operations&&a.addHandles(this._operations.data.on("change",()=>{"resize"!==a.inputState?.type&&(this._zMaxDirty=!0)}))}destroy(){this.forEachManipulator(t=>{this._tool.manipulators.remove(t),t.destroy()})}forEachManipulator(t){this.resizeManipulators.forEach(e=>t(e,2))}updateManipulators(t,e){this.resizeManipulators.forEach((s,a)=>{m(s,this._resizeHandles[a],t,e)})}getUpdatedTooltipInfo(){if(!this.resizeManipulators.some(t=>t.focused))return null;const t=this._tooltipInfo??=new M({sketchOptions:this._tool.sketchOptions}),e=g(this._bounds.mapBounds,this.zMax,this._bounds.spatialReference,this._tool.automaticLengthMeasurementUtils);return e&&(t.xSize=e.xSize,t.ySize=e.ySize),this.resizeManipulators.some(t=>t.dragging)||(t.xScale=1,t.yScale=1),t}_onGrabChanged({action:t,screenPoint:e}){const s=this._tool,a=this._bounds;if("start"!==t||!e)return;const i=y(s.view.state.camera,e);d(a.displayBounds.plane,i,h.get())&&(a.backupMapBounds(),l(a.displayBounds,this._displayBoundsStart),this._displayBoundsMarginStart=a.displayBoundsMargin,s.inputState={type:"resize"})}_createResizeDragPipeline(t,e){const{_tool:s,_object:a}=this;return x(t,(t,i,o)=>{null!=s.inputState&&(i.next(t=>("start"===t.action&&s.events.emit("scale-start",{object:a,xScale:1,yScale:1}),{...t,handle:e})).next(S(s.view,this._displayBoundsStart.plane)).next(this._renderPlaneToFactors()).next(...this._preserveAspectRatioStep()).next(this._updateGeometry()).next(t=>{const e=this._tooltipInfo;e&&(e.xScale=t.factor1,e.yScale=t.factor2);const i={object:a,xScale:t.factor1,yScale:t.factor2};switch(t.action){case"start":case"update":s.events.emit("scale",i);break;case"end":s.inputState=null,s.events.emit("scale-stop",i)}return t}),o.next(()=>{null!=s.inputState&&s.events.emit("scale-stop",{object:a,xScale:1,yScale:1}),s.cancelDrag()}))})}_renderPlaneToFactors(){const t=this._bounds;return e=>{const s=this._displayBoundsStart,c=e.handle.direction,p=t.displayBoundsMargin,l=this._displayBoundsMarginStart,d=a(h.get(),s.origin);i(d,d,s.basis1,-c[0]),i(d,d,s.basis2,-c[1]);const u=o(h.get(),e.renderEnd,d),m=o(h.get(),e.renderStart,d),S=_(e.handle),g=f(s),y=f(t.displayBounds)/g,x=(t,e)=>{if(0===t)return 1;let s=r(e),a=.5*t*n(e,u)/s;const i=a<0?-1:1;if(S){a+=(s-.5*t*n(e,m)/s)*i*y}const o=s<1.5*l?1:z;return s=Math.max(s-l,z),i>0&&(a-=p),i*Math.max(i*(a/s),o)};return{...e,factor1:x(c[0],s.basis1),factor2:x(c[1],s.basis2)}}}_updateGeometry(){const o=this._bounds;return r=>{const n=a(c(),o.mapBoundsStart.origin);i(n,n,o.mapBoundsStart.basis1,-r.handle.direction[0]),i(n,n,o.mapBoundsStart.basis2,-r.handle.direction[1]);const p=t(s(),o.mapBoundsStart.basis1[0],o.mapBoundsStart.basis1[1]);e(p,p);const d="start"===r.action?0:1;if(this._operations){const t=this._operations.scale(n,p,r.factor1,r.factor2,d,1);l(o.mapBoundsStart,o.mapBounds),o.updateMapBoundsFromOperation(t)}return r}}}const z=1e-6;export{b as ExtentScale,z as scaleEpsilon};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{on as s}from"../../../../../../core/reactiveUtils.js";import{scale as t}from"../../../../../../core/libs/gl-matrix-2/math/vec2.js";import{f as i,d as o,g as a,m as e,h as n,n as r,e as p,c as d,b 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 b}from"../../../../../../chunks/boundedPlane.js";import{fromPositionAndNormal as h,projectPoint as g}from"../../../../../../geometry/support/plane.js";import{sv3d as f}from"../../../../../../geometry/support/vectorStacks.js";import{mainAxis as B}from"../../geometryUtils.js";import{manipulatedObjectGeometry as M}from"../../manipulatedObjectUtils.js";import{evaluateElevationAlignmentAtPoint as y}from"../../../../layers/graphics/elevationAlignmentUtils.js";import{ElevationContext as j}from"../../../../layers/graphics/ElevationContext.js";import{apply as v,applyInverse as _,calculateOrientedBounds as R}from"../../../../../interactive/editGeometry/support/editPlaneUtils.js";import{autoSize2D as x}from"../../../../../support/extentUtils.js";class C{constructor(t,i){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=i}get displayBoundsMargin(){const{view:s,object:t}=this._tool,i=M(t),o=s.pointsOfInterest?.centerOnSurfaceFrequent.location??i?.extent?.center;return o?D*s.pixelSizeAt(o):0}backupMapBounds(){m(this.mapBounds,this.mapBoundsStart)}updateDisplayBounds(){this._calculateDisplayBounds(),this._onDisplayBoundsChanged?.()}updateMapBoundsFromOperation(s){v(s,this.mapBounds),this.updateDisplayBounds()}updateMapBoundsFromOperationInverse(s){_(s,this.mapBounds),this.updateDisplayBounds()}_resetMapBounds(){this._calculateMapBounds(),this.updateDisplayBounds()}_calculateMapBounds(){const{view:s,attachmentOrigin:i,object:o}=this._tool,a=o.operations?.data;if(!a)return;const e=a.geometry;this.spatialReference=e.spatialReference;const n=B(e);t(n,n,-1);const r=i?s.pixelSizeAt(i,e.spatialReference):0,p=O*r,d=a.coordinateHelper.hasZ()&&"on-the-ground"!==o.elevationInfo.mode;R(n,a,p,this.mapBounds,d)}_calculateDisplayBounds(){const{view:s,attachmentOrigin:t}=this._tool,i=t?.z??y(this.mapBounds.origin,s.elevationProvider,j.fromElevationInfo(this._tool.object.elevationInfo),s.renderCoordsHelper);U(this.mapBounds,i??0,s.renderCoordsHelper,this.spatialReference,this.displayBoundsMargin,this.displayBounds)}}const D=10,O=80;function U(s,t,c,l,m=0,B){B||(B=u());const M=f.get();i(M,s.origin,s.basis1),i(M,M,s.basis2),c.toRenderCoords(M,l,M);const y=f.get();i(y,s.origin,s.basis1),o(y,y,s.basis2),c.toRenderCoords(y,l,y);const j=f.get();o(j,s.origin,s.basis1),o(j,j,s.basis2),c.toRenderCoords(j,l,j);const v=f.get();o(v,s.origin,s.basis1),i(v,v,s.basis2),c.toRenderCoords(v,l,v),i(B.origin,M,y),i(B.origin,B.origin,j),i(B.origin,B.origin,v),a(B.origin,B.origin,.25),o(M,M,B.origin),o(y,y,B.origin),o(j,j,B.origin),o(v,v,B.origin);const _=e(f.get(),M,y,.5),R=e(f.get(),j,v,.5);a(R,R,-1),e(B.basis1,_,R,.5);const x=e(f.get(),M,v,.5),C=e(f.get(),y,j,.5);a(C,C,-1),e(B.basis2,x,C,.5);const D=n(f.get(),B.basis1,B.basis2);n(B.basis2,D,B.basis1),r(B.basis1,B.basis1);const O=Math.max(Math.abs(p(B.basis1,M)),Math.abs(p(B.basis1,y)),Math.abs(p(B.basis1,j)),Math.abs(p(B.basis1,v)));r(B.basis2,B.basis2);const U=Math.max(Math.abs(p(B.basis2,M)),Math.abs(p(B.basis2,y)),Math.abs(p(B.basis2,j)),Math.abs(p(B.basis2,v)));a(B.basis1,B.basis1,O+m),a(B.basis2,B.basis2,U+m);const S=d(f.get(),s.origin);return S[2]=t,c.toRenderCoords(S,l,S),h(S,D,B.plane),g(B.plane,B.origin,B.origin),b(B),B}function S(s,t,i,a){return o(H,o(H,s.origin,s.basis1),s.basis2),c(A,H,s.basis1,2),c(k,A,s.basis2,2),c(I,H,s.basis2,2),H[2]=A[2]=k[2]=I[2]=t,x({topLeft:I,topRight:k,bottomRight:A,bottomLeft:H,spatialReference:i,automaticLengthMeasurementUtils:a})}const I=l(),k=l(),A=l(),H=l();export{C 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{f as i,d as o,g as a,m as e,h as n,n as r,e as p,c as d,b as c}from"../../../../../../chunks/vec32.js";import{create as l}from"../../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{c as u,a as m,u as b}from"../../../../../../chunks/boundedPlane.js";import{fromPositionAndNormal as h,projectPoint as g}from"../../../../../../geometry/support/plane.js";import{sv3d as f}from"../../../../../../geometry/support/vectorStacks.js";import{mainAxis as B}from"../../geometryUtils.js";import{manipulatedObjectGeometry as M}from"../../manipulatedObjectUtils.js";import{evaluateElevationAlignmentAtPoint as y}from"../../../../layers/graphics/elevationAlignmentUtils.js";import{ElevationContext as j}from"../../../../layers/graphics/ElevationContext.js";import{apply as v,applyInverse as _,calculateOrientedBounds as R}from"../../../../../interactive/editGeometry/support/editPlaneUtils.js";import{autoSize2D as x}from"../../../../../support/extentUtils.js";class C{constructor(t,i){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=i}get displayBoundsMargin(){const{view:s,object:t}=this._tool,i=M(t),o=s.pointsOfInterest?.centerOnSurfaceFrequent.location??i?.extent?.center;return o?D*s.pixelSizeAt(o):0}backupMapBounds(){m(this.mapBounds,this.mapBoundsStart)}updateDisplayBounds(){this._calculateDisplayBounds(),this._onDisplayBoundsChanged?.()}updateMapBoundsFromOperation(s){v(s,this.mapBounds),this.updateDisplayBounds()}updateMapBoundsFromOperationInverse(s){_(s,this.mapBounds),this.updateDisplayBounds()}_resetMapBounds(){this._calculateMapBounds(),this.updateDisplayBounds()}_calculateMapBounds(){const{view:s,attachmentOrigin:i,object:o}=this._tool,a=o.operations?.data;if(!a)return;const e=a.geometry;this.spatialReference=e.spatialReference;const n=B(e);t(n,n,-1);const r=i?s.pixelSizeAt(i,e.spatialReference):0,p=O*r,d=a.coordinateHelper.hasZ()&&"on-the-ground"!==o.elevationInfo.mode;R(n,a,p,this.mapBounds,d)}_calculateDisplayBounds(){const{view:s,attachmentOrigin:t}=this._tool,i=t?.z??y(this.mapBounds.origin,s.elevationProvider,j.fromElevationInfo(this._tool.object.elevationInfo),s.renderCoordsHelper);U(this.mapBounds,i??0,s.renderCoordsHelper,this.spatialReference,this.displayBoundsMargin,this.displayBounds)}}const D=10,O=80;function U(s,t,c,l,m=0,B){B||(B=u());const M=f.get();i(M,s.origin,s.basis1),i(M,M,s.basis2),c.toRenderCoords(M,l,M);const y=f.get();i(y,s.origin,s.basis1),o(y,y,s.basis2),c.toRenderCoords(y,l,y);const j=f.get();o(j,s.origin,s.basis1),o(j,j,s.basis2),c.toRenderCoords(j,l,j);const v=f.get();o(v,s.origin,s.basis1),i(v,v,s.basis2),c.toRenderCoords(v,l,v),i(B.origin,M,y),i(B.origin,B.origin,j),i(B.origin,B.origin,v),a(B.origin,B.origin,.25),o(M,M,B.origin),o(y,y,B.origin),o(j,j,B.origin),o(v,v,B.origin);const _=e(f.get(),M,y,.5),R=e(f.get(),j,v,.5);a(R,R,-1),e(B.basis1,_,R,.5);const x=e(f.get(),M,v,.5),C=e(f.get(),y,j,.5);a(C,C,-1),e(B.basis2,x,C,.5);const D=n(f.get(),B.basis1,B.basis2);n(B.basis2,D,B.basis1),r(B.basis1,B.basis1);const O=Math.max(Math.abs(p(B.basis1,M)),Math.abs(p(B.basis1,y)),Math.abs(p(B.basis1,j)),Math.abs(p(B.basis1,v)));r(B.basis2,B.basis2);const U=Math.max(Math.abs(p(B.basis2,M)),Math.abs(p(B.basis2,y)),Math.abs(p(B.basis2,j)),Math.abs(p(B.basis2,v)));a(B.basis1,B.basis1,O+m),a(B.basis2,B.basis2,U+m);const S=d(f.get(),s.origin);return S[2]=t,c.toRenderCoords(S,l,S),h(S,D,B.plane),g(B.plane,B.origin,B.origin),b(B),B}function S(s,t,i,a){return o(H,o(H,s.origin,s.basis1),s.basis2),c(A,H,s.basis1,2),c(k,A,s.basis2,2),c(I,H,s.basis2,2),H[2]=A[2]=k[2]=I[2]=t,x({topLeft:I,topRight:k,bottomRight:A,bottomLeft:H,spatialReference:i,automaticLengthMeasurementUtils:a})}const I=l(),k=l(),A=l(),H=l();export{C as TransformBounds,S 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.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as t}from"tslib";import"../../../../../core/has.js";import{destroyMaybe as e}from"../../../../../core/maybe.js";import{memoize as i}from"../../../../../core/memoize.js";import{ignoreAbortErrors as a}from"../../../../../core/promiseUtils.js";import{syncAndInitial as n,when as s}from"../../../../../core/reactiveUtils.js";import{property as o}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/Logger.js";import"../../../../../core/RandomLCG.js";import{subclass as r}from"../../../../../core/accessorSupport/decorators/subclass.js";import{UpdatingHandles as p}from"../../../../../core/support/UpdatingHandles.js";import l from"../../../../../geometry/Point.js";import{clonePoint as h}from"../../../../../layers/graphics/hydratedFeatures.js";import{isPrimaryPointerAction as g}from"../../../analysis/support/measurementUtils.js";import{SnappingVisualizer3D as m}from"../../SnappingVisualizer3D.js";import{hideManipulatorWhileDragging as d,screenToMap3D as u}from"../../editingTools/dragEventPipeline3D.js";import c from"./AreaMeasurement3DView.js";import{PickRequest as y}from"../support/PickRequest.js";import{AnalysisToolBase as w}from"../../../../interactive/AnalysisToolBase.js";import{createCoordinateHelper as v}from"../../../../interactive/coordinateHelper.js";import{createManipulatorDragEventPipeline as _}from"../../../../interactive/dragEventPipeline.js";import{sketchKeys as f}from"../../../../interactive/keybindings.js";import{ManipulatorCollection as S}from"../../../../interactive/ManipulatorCollection.js";import{EditGeometry as P}from"../../../../interactive/editGeometry/EditGeometry.js";import{EditGeometryOperations as V}from"../../../../interactive/editGeometry/EditGeometryOperations.js";import{SnappingContext as D}from"../../../../interactive/snapping/SnappingContext.js";import{createSnapDragEventPipelineStep as j}from"../../../../interactive/snapping/SnappingDragPipelineStep.js";import{acquire as M}from"../../../../interactive/snapping/SnappingManagerPool.js";import{SnappingOperation as x}from"../../../../interactive/snapping/SnappingOperation.js";import{setupSnappingToggleHandles as O}from"../../../../interactive/snapping/snappingUtils.js";import{createScreenPointFromEvent as b}from"../../../../support/screenUtils.js";let k=class extends w{constructor(t){super(t),this._updatingHandles=new p,this.polygonState="initial",this.removeIncompleteOnCancel=!1,this.manipulators=new S,this._getSnappingContext=i(t=>new D({elevationInfo:{mode:"absolute-height",offset:0},pointer:t,editGeometryOperations:new V(new P("point",v(!0,!1,this.view.spatialReference)),this.view.state.viewingMode),visualizer:new m}))}initialize(){const{view:t,analysisViewData:e,manipulators:i,visible:o}=this;this.measurementView=new c({view:t,analysisViewData:e,toolState:this,manipulators:i,visible:o});const r=M(t);this._snappingManagerResult=r,this.addHandles(r),this._snappingOperation=new x({view:t}),this._updatingHandles.add(()=>this.stagedPoint,t=>{this.analysisViewData.stagedPoint=null!=t?h(t,new l):null},n),O(this,()=>{const t=this.view.inputManager.latestPointerType??"mouse",e=this._getSnappingContext(t);this._updatingHandles.addPromise(a(this._snappingOperation.snapAgainNearPreviousMapPoint(this._snappingManager,e)))}),this._setupManipulators(),this.addHandles([s(()=>"measured"===this.state,()=>this.finishToolCreation(),n),this.analysisViewData.path.on("change",()=>{const t=this.analysisViewData.path;"initial"!==this.polygonState||t.isEmptyPolygon||(t.isValidPolygon?this.polygonState="measured":this.polygonState="drawing")})])}destroy(){this.measurementView.destroy(),this._set("measurementView",null),this._updatingHandles=e(this._updatingHandles)}get _snappingManager(){return this._snappingManagerResult.snappingManager}get state(){return 0===this.analysisViewData.path.numVertices?"ready":this.analysisViewData.path.isValidPolygon&&"editing"!==this.polygonState?"measured":"measuring"}get cursor(){return this.active?"crosshair":null}get updating(){return this._updatingHandles.updating||this._snappingManager.updating}get stagedPoint(){return this._snappingOperation.stagedPoint}set stagedPoint(t){this._snappingOperation.stagedPoint=t}get snappingOptions(){return this._snappingManager.options}finishMeasurement(){const{path:t}=this.analysisViewData;t.numVertices<=2||(t.close(),this.polygonState="measured",this._resetSnappingState(),this.active&&(this.view.activeTool=null))}resetCreated(){super.resetCreated(),this._resetSnappingState(),this.polygonState="initial","measured"===this.state&&(this.polygonState="measured",this.finishToolCreation())}onShow(){this.measurementView.show()}onHide(){this.measurementView.hide()}onDeactivate(){this._resetSnappingState()}onInputEvent(t){switch(t.type){case"immediate-double-click":this._handleImmediateDoubleClick(t);break;case"immediate-click":this._handleImmediateClick(t);break;case"pointer-move":this._handlePointerMove(t);break;case"drag":this._handleDrag(t);break;case"key-down":this._handleKeyDown(t)}}_setupManipulators(){const t=t=>t.events.on("grab-changed",()=>{if(this.analysisViewData.path.isValidPolygon){const t=this.manipulators.some(t=>t.manipulator.grabbing);this.polygonState=t?"editing":"measured"}}),e=e=>{this.addHandles([_(e,(t,e,i,a)=>{const n=d(t),s=t.metadata,o=this._snappingManager,r=this._getSnappingContext(a),p=this._updatingHandles,{snappingStep:l,cancelSnapping:g}=j({snappingManager:o,snappingContext:r,updatingHandles:p});i=i.next(n).next(e=>(this.analysisViewData.lastDraggedVertex=null,this.analysisViewData.path.setVertexPosition(s,m),t.location=m,e)).next(g),e.next(n).next(u(this.view)).next(...l).next(e=>{t.location=e.mapEnd,this.analysisViewData.lastDraggedVertex="end"===e.action?null:s,this.analysisViewData.path.setVertexPosition(s,h(e.mapEnd))});const m=h(this.analysisViewData.path.getVertexPositionAsPoint(s))}),t(e)],e)};this.manipulators.forEach(({manipulator:t})=>{e(t)}),this.addHandles([this.manipulators.on("after-add",({item:{manipulator:t}})=>{e(t)}),this.manipulators.on("after-remove",({item:{manipulator:t}})=>this.removeHandles(t))])}_handleImmediateDoubleClick(t){g(t)&&("drawing"===this.polygonState&&this.finishMeasurement(),t.stopPropagation())}_handleDrag(t){"editing"===this.polygonState&&t.stopPropagation()}_handleImmediateClick(t){if(!g(t))return;const e=b(t),{pointerType:i}=t;if(this.active)switch(this.polygonState){case"initial":case"measured":if(this._addVertexAt(e,i))return this.stagedPoint=null,this.polygonState="drawing",void t.stopPropagation();break;case"drawing":{const a=this.measurementView.vertexHandleAt(e,i);if(null==a){if(this._addVertexAt(e,i))return this.stagedPoint=null,void t.stopPropagation()}else 0===a.index&&(this.finishMeasurement(),t.stopPropagation());break}}"mouse"===t.pointerType&&this._hoverAt(e)}_handlePointerMove(t){if("mouse"===t.pointerType){const e=b(t);this._hoverAt(e)}}_handleKeyDown(t){const{path:e}=this.analysisViewData;t.key===f.complete&&"drawing"===this.polygonState&&e.numVertices>=3&&(this.stagedPoint=null,this.finishMeasurement(),t.stopPropagation())}_hoverAt(t){const{polygonState:e}=this;if(this.active&&C.has(e)){const e=this._pick(t);if(null!=e?.mapPoint){const t=this._getSnappingContext("mouse");this._updatingHandles.addPromise(a(this._snappingOperation.snap({point:e.mapPoint},this._snappingManager,t)))}}else this.stagedPoint=null}_addVertexAt(t,e){const i=this._pick(t),a=i?.mapPoint;if(null==a)return!1;this.analysis.valid&&"measured"===this.polygonState&&(this.analysis.clear(),this._set("created",!1),this.polygonState="initial");const n=this._getSnappingContext(e),s=this._snappingOperation.update({point:a},this._snappingManager,n),o=h(s,new l);return this.analysisViewData.path.add(o),!0}_pick(t){const e=new y(t);return this.measurementView.pick(e)}_resetSnappingState(){this._snappingManager.doneSnapping(),this._snappingOperation.abort(),this._snappingOperation.stagedPoint=null}get test(){}};t([o({readOnly:!0})],k.prototype,"state",null),t([o()],k.prototype,"polygonState",void 0),t([o({readOnly:!0})],k.prototype,"cursor",null),t([o()],k.prototype,"measurementView",void 0),t([o()],k.prototype,"removeIncompleteOnCancel",void 0),t([o({constructOnly:!0})],k.prototype,"view",void 0),t([o({constructOnly:!0})],k.prototype,"analysis",void 0),t([o({constructOnly:!0})],k.prototype,"analysisViewData",void 0),t([o({readOnly:!0})],k.prototype,"manipulators",void 0),t([o()],k.prototype,"updating",null),t([o()],k.prototype,"stagedPoint",null),t([o()],k.prototype,"snappingOptions",null),k=t([r("esri.views.3d.interactive.measurementTools.areaMeasurement3D.AreaMeasurement3DTool")],k);const C=new Set(["initial","drawing","measured"]);export{k as default};
5
+ import{__decorate as t}from"tslib";import"../../../../../core/has.js";import{destroyMaybe as e}from"../../../../../core/maybe.js";import{memoize as i}from"../../../../../core/memoize.js";import{ignoreAbortErrors as a}from"../../../../../core/promiseUtils.js";import{syncAndInitial as n,when as s}from"../../../../../core/reactiveUtils.js";import{property as o}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/Logger.js";import"../../../../../core/RandomLCG.js";import{subclass as r}from"../../../../../core/accessorSupport/decorators/subclass.js";import{UpdatingHandles as p}from"../../../../../core/support/UpdatingHandles.js";import l from"../../../../../geometry/Point.js";import{clonePoint as h}from"../../../../../layers/graphics/hydratedFeatures.js";import{isPrimaryPointerAction as g}from"../../../analysis/support/measurementUtils.js";import{SnappingVisualizer3D as m}from"../../SnappingVisualizer3D.js";import{hideManipulatorWhileDragging as d,screenToMap3D as u}from"../../editingTools/dragEventPipeline3D.js";import c from"./AreaMeasurement3DView.js";import{PickRequest as y}from"../support/PickRequest.js";import{AnalysisToolBase as w}from"../../../../interactive/AnalysisToolBase.js";import{createCoordinateHelper as v}from"../../../../interactive/coordinateHelper.js";import{createManipulatorDragEventPipeline as _}from"../../../../interactive/dragEventPipeline.js";import{sketchKeys as f}from"../../../../interactive/keybindings.js";import{ManipulatorCollection as S}from"../../../../interactive/ManipulatorCollection.js";import{EditGeometry as P}from"../../../../interactive/editGeometry/EditGeometry.js";import{EditGeometryOperations as V}from"../../../../interactive/editGeometry/EditGeometryOperations.js";import{SnappingContext as D}from"../../../../interactive/snapping/SnappingContext.js";import{createSnapDragEventPipelineStep as j}from"../../../../interactive/snapping/SnappingDragPipelineStep.js";import{acquire as M}from"../../../../interactive/snapping/SnappingManagerPool.js";import{SnappingOperation as x}from"../../../../interactive/snapping/SnappingOperation.js";import{setupSnappingToggleHandles as O}from"../../../../interactive/snapping/snappingUtils.js";import{createScreenPointFromEvent as b}from"../../../../support/screenUtils.js";let k=class extends w{constructor(t){super(t),this._updatingHandles=new p,this.polygonState="initial",this.removeIncompleteOnCancel=!1,this.manipulators=new S,this._getSnappingContext=i(t=>new D({elevationInfo:{mode:"absolute-height",offset:0},pointer:t,editGeometryOperations:new V(new P("point",v(!0,!1,this.view.spatialReference)),this.view.state.viewingMode),visualizer:new m}))}initialize(){const{view:t,analysisViewData:e,manipulators:i,visible:o}=this;this.measurementView=new c({view:t,analysisViewData:e,toolState:this,manipulators:i,visible:o});const r=M(t);this._snappingManagerResult=r,this.addHandles(r),this._snappingOperation=new x({view:t}),this._updatingHandles.add(()=>this.stagedPoint,t=>{this.analysisViewData.stagedPoint=null!=t?h(t,new l):null},n),O(this,()=>{const t=this.view.inputManager.latestPointerInfo?.type??"mouse",e=this._getSnappingContext(t);this._updatingHandles.addPromise(a(this._snappingOperation.snapAgainNearPreviousMapPoint(this._snappingManager,e)))}),this._setupManipulators(),this.addHandles([s(()=>"measured"===this.state,()=>this.finishToolCreation(),n),this.analysisViewData.path.on("change",()=>{const t=this.analysisViewData.path;"initial"!==this.polygonState||t.isEmptyPolygon||(t.isValidPolygon?this.polygonState="measured":this.polygonState="drawing")})])}destroy(){this.measurementView.destroy(),this._set("measurementView",null),this._updatingHandles=e(this._updatingHandles)}get _snappingManager(){return this._snappingManagerResult.snappingManager}get state(){return 0===this.analysisViewData.path.numVertices?"ready":this.analysisViewData.path.isValidPolygon&&"editing"!==this.polygonState?"measured":"measuring"}get cursor(){return this.active?"crosshair":null}get updating(){return this._updatingHandles.updating||this._snappingManager.updating}get stagedPoint(){return this._snappingOperation.stagedPoint}set stagedPoint(t){this._snappingOperation.stagedPoint=t}get snappingOptions(){return this._snappingManager.options}finishMeasurement(){const{path:t}=this.analysisViewData;t.numVertices<=2||(t.close(),this.polygonState="measured",this._resetSnappingState(),this.active&&(this.view.activeTool=null))}resetCreated(){super.resetCreated(),this._resetSnappingState(),this.polygonState="initial","measured"===this.state&&(this.polygonState="measured",this.finishToolCreation())}onShow(){this.measurementView.show()}onHide(){this.measurementView.hide()}onDeactivate(){this._resetSnappingState()}onInputEvent(t){switch(t.type){case"immediate-double-click":this._handleImmediateDoubleClick(t);break;case"immediate-click":this._handleImmediateClick(t);break;case"pointer-move":this._handlePointerMove(t);break;case"drag":this._handleDrag(t);break;case"key-down":this._handleKeyDown(t)}}_setupManipulators(){const t=t=>t.events.on("grab-changed",()=>{if(this.analysisViewData.path.isValidPolygon){const t=this.manipulators.some(t=>t.manipulator.grabbing);this.polygonState=t?"editing":"measured"}}),e=e=>{this.addHandles([_(e,(t,e,i,a)=>{const n=d(t),s=t.metadata,o=this._snappingManager,r=this._getSnappingContext(a),p=this._updatingHandles,{snappingStep:l,cancelSnapping:g}=j({snappingManager:o,snappingContext:r,updatingHandles:p});i=i.next(n).next(e=>(this.analysisViewData.lastDraggedVertex=null,this.analysisViewData.path.setVertexPosition(s,m),t.location=m,e)).next(g),e.next(n).next(u(this.view)).next(...l).next(e=>{t.location=e.mapEnd,this.analysisViewData.lastDraggedVertex="end"===e.action?null:s,this.analysisViewData.path.setVertexPosition(s,h(e.mapEnd))});const m=h(this.analysisViewData.path.getVertexPositionAsPoint(s))}),t(e)],e)};this.manipulators.forEach(({manipulator:t})=>{e(t)}),this.addHandles([this.manipulators.on("after-add",({item:{manipulator:t}})=>{e(t)}),this.manipulators.on("after-remove",({item:{manipulator:t}})=>this.removeHandles(t))])}_handleImmediateDoubleClick(t){g(t)&&("drawing"===this.polygonState&&this.finishMeasurement(),t.stopPropagation())}_handleDrag(t){"editing"===this.polygonState&&t.stopPropagation()}_handleImmediateClick(t){if(!g(t))return;const e=b(t),{pointerType:i}=t;if(this.active)switch(this.polygonState){case"initial":case"measured":if(this._addVertexAt(e,i))return this.stagedPoint=null,this.polygonState="drawing",void t.stopPropagation();break;case"drawing":{const a=this.measurementView.vertexHandleAt(e,i);if(null==a){if(this._addVertexAt(e,i))return this.stagedPoint=null,void t.stopPropagation()}else 0===a.index&&(this.finishMeasurement(),t.stopPropagation());break}}"mouse"===t.pointerType&&this._hoverAt(e)}_handlePointerMove(t){if("mouse"===t.pointerType){const e=b(t);this._hoverAt(e)}}_handleKeyDown(t){const{path:e}=this.analysisViewData;t.key===f.complete&&"drawing"===this.polygonState&&e.numVertices>=3&&(this.stagedPoint=null,this.finishMeasurement(),t.stopPropagation())}_hoverAt(t){const{polygonState:e}=this;if(this.active&&C.has(e)){const e=this._pick(t);if(null!=e?.mapPoint){const t=this._getSnappingContext("mouse");this._updatingHandles.addPromise(a(this._snappingOperation.snap({point:e.mapPoint},this._snappingManager,t)))}}else this.stagedPoint=null}_addVertexAt(t,e){const i=this._pick(t),a=i?.mapPoint;if(null==a)return!1;this.analysis.valid&&"measured"===this.polygonState&&(this.analysis.clear(),this._set("created",!1),this.polygonState="initial");const n=this._getSnappingContext(e),s=this._snappingOperation.update({point:a},this._snappingManager,n),o=h(s,new l);return this.analysisViewData.path.add(o),!0}_pick(t){const e=new y(t);return this.measurementView.pick(e)}_resetSnappingState(){this._snappingManager.doneSnapping(),this._snappingOperation.abort(),this._snappingOperation.stagedPoint=null}get test(){}};t([o({readOnly:!0})],k.prototype,"state",null),t([o()],k.prototype,"polygonState",void 0),t([o({readOnly:!0})],k.prototype,"cursor",null),t([o()],k.prototype,"measurementView",void 0),t([o()],k.prototype,"removeIncompleteOnCancel",void 0),t([o({constructOnly:!0})],k.prototype,"view",void 0),t([o({constructOnly:!0})],k.prototype,"analysis",void 0),t([o({constructOnly:!0})],k.prototype,"analysisViewData",void 0),t([o({readOnly:!0})],k.prototype,"manipulators",void 0),t([o()],k.prototype,"updating",null),t([o()],k.prototype,"stagedPoint",null),t([o()],k.prototype,"snappingOptions",null),k=t([r("esri.views.3d.interactive.measurementTools.areaMeasurement3D.AreaMeasurement3DTool")],k);const C=new Set(["initial","drawing","measured"]);export{k as default};