@arcgis/core 5.0.0-next.45 → 5.0.0-next.46

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 (273) hide show
  1. package/assets/esri/core/workers/RemoteClient.js +1 -1
  2. package/assets/esri/core/workers/chunks/063045ac5553e91c0c4c.js +1 -0
  3. package/assets/esri/core/workers/chunks/{20ad34f9d45c64392022.js → 08c1ea29678da27136f3.js} +1 -1
  4. package/assets/esri/core/workers/chunks/{5dc2f2e28c30386efadf.js → 10094eb2b94e98dd4a8a.js} +1 -1
  5. package/assets/esri/core/workers/chunks/169be08394c5e7703628.js +1 -0
  6. package/assets/esri/core/workers/chunks/1a6f3531ef3d671e0289.js +1 -0
  7. package/assets/esri/core/workers/chunks/{b809d499ff050976d9ed.js → 1c58064ea80e6a4a4a3b.js} +1 -1
  8. package/assets/esri/core/workers/chunks/1c816aff8613d1e4bf38.js +1 -0
  9. package/assets/esri/core/workers/chunks/{ee67c8a7c1f8b482cd99.js → 1ced78750c61600b2d4e.js} +1 -1
  10. package/assets/esri/core/workers/chunks/{98175b454e807b1a3c5f.js → 1e152a34e368bd810a0f.js} +1 -1
  11. package/assets/esri/core/workers/chunks/1e17ad6cdffa5016a3db.js +1 -0
  12. package/assets/esri/core/workers/chunks/1e2d42e9984ed3437ba2.js +1 -0
  13. package/assets/esri/core/workers/chunks/2008b22f76071a2dde4e.js +1 -0
  14. package/assets/esri/core/workers/chunks/2107c93d1fe87f3b8dfa.js +1 -0
  15. package/assets/esri/core/workers/chunks/2209550b6510e25da375.js +1 -0
  16. package/assets/esri/core/workers/chunks/229e1ed4282005aa0b83.js +1 -0
  17. package/assets/esri/core/workers/chunks/22b8eaa6afab0e5ffc47.js +1 -0
  18. package/assets/esri/core/workers/chunks/{1c0fb4795a52204882a8.js → 2550d2ba935cfdf30236.js} +1 -1
  19. package/assets/esri/core/workers/chunks/{49e6219dd08cb6c27023.js → 273ac1066095d63d6a6f.js} +1 -1
  20. package/assets/esri/core/workers/chunks/2e2867bc66c94aba7dc7.js +1 -0
  21. package/assets/esri/core/workers/chunks/{cda5c95fd49b8901f7d4.js → 3298e96d3f2e49e338d2.js} +1 -1
  22. package/assets/esri/core/workers/chunks/34613b288cf174983f8b.js +1 -0
  23. package/assets/esri/core/workers/chunks/{e5baa30944061418cb13.js → 35f086a2ae0585348ae6.js} +1 -1
  24. package/assets/esri/core/workers/chunks/{f441fc74451330384fb0.js → 37ea150dec5e491f691e.js} +1 -1
  25. package/assets/esri/core/workers/chunks/3c94db7ecdcd38eeb1b1.js +1 -0
  26. package/assets/esri/core/workers/chunks/3f7749f06ae54a4437d9.js +1 -0
  27. package/assets/esri/core/workers/chunks/40a722933af28823953b.js +1 -0
  28. package/assets/esri/core/workers/chunks/{7aa730e5ac7b268e3c98.js → 424daef7b5dec1b99aba.js} +1 -1
  29. package/assets/esri/core/workers/chunks/456684b1c1417ed0e611.js +1 -0
  30. package/assets/esri/core/workers/chunks/{d14e75b160aa432233c6.js → 461093ce28ceadd7853d.js} +1 -1
  31. package/assets/esri/core/workers/chunks/4a48b8ec5f3f2fd139b5.js +1 -0
  32. package/assets/esri/core/workers/chunks/4b084f985bc4100e7aec.js +1 -0
  33. package/assets/esri/core/workers/chunks/4b1de1fcd13677b615a8.js +1 -0
  34. package/assets/esri/core/workers/chunks/{31186e83fe009aa0fd36.js → 4d933de84afb2e3b7d18.js} +1 -1
  35. package/assets/esri/core/workers/chunks/{83aa39fbb1fad3b9d143.js → 4ff771942531fb2755c4.js} +1 -1
  36. package/assets/esri/core/workers/chunks/{e0017c6739d2532793e6.js → 513a4ef960e27500f986.js} +1 -1
  37. package/assets/esri/core/workers/chunks/56b693baa376bb990925.js +1 -0
  38. package/assets/esri/core/workers/chunks/{1d4ea8db272655c0608c.js → 57fd5e1260269002d18a.js} +1 -1
  39. package/assets/esri/core/workers/chunks/5fe40bb0e9ab333f6854.js +1 -0
  40. package/assets/esri/core/workers/chunks/{b56c07c0b43cb1999070.js → 60362c5651ef41fa7e5f.js} +1 -1
  41. package/assets/esri/core/workers/chunks/{e8a9971c8354569cb81d.js → 609919428305d8c8c243.js} +1 -1
  42. package/assets/esri/core/workers/chunks/{ab88577987cf2fe1cb32.js → 61373d2fa7e7638d3395.js} +1 -1
  43. package/assets/esri/core/workers/chunks/6202922b1c2637e9aaa5.js +1 -0
  44. package/assets/esri/core/workers/chunks/633368ae6fbb46373328.js +1 -0
  45. package/assets/esri/core/workers/chunks/6d702cb26cef46a76963.js +1 -0
  46. package/assets/esri/core/workers/chunks/{35272810c2ed04eb403d.js → 6f3943bebe2d5f4994f7.js} +1 -1
  47. package/assets/esri/core/workers/chunks/708aba69a1870ea41a61.js +1 -0
  48. package/assets/esri/core/workers/chunks/{7ba13b52fce1060fbb2a.js → 7147fc7502b385b302b2.js} +1 -1
  49. package/assets/esri/core/workers/chunks/{9ba8a2e1c0fb4e1efc7c.js → 7364fb5e99933533890d.js} +1 -1
  50. package/assets/esri/core/workers/chunks/74b1028e95f7cfff387b.js +1 -0
  51. package/assets/esri/core/workers/chunks/78fccea3445fb2f9120a.js +1 -0
  52. package/assets/esri/core/workers/chunks/7ba31425caa404f86424.js +1 -0
  53. package/assets/esri/core/workers/chunks/{040f3d8e1099c4843390.js → 81a60dfa600b690098f9.js} +1 -1
  54. package/assets/esri/core/workers/chunks/833fd2bc42c5cb459084.js +1 -0
  55. package/assets/esri/core/workers/chunks/{75643711d9585ee26a15.js → 83c8e5a92d8d6193cb32.js} +1 -1
  56. package/assets/esri/core/workers/chunks/{e537e1d37f3fcb14fce2.js → 870022661376442411e4.js} +1 -1
  57. package/assets/esri/core/workers/chunks/898ab7db220e81e921c6.js +1 -0
  58. package/assets/esri/core/workers/chunks/{31b074ae2162a3508d2a.js → 8b578ffc3a83089aa782.js} +1 -1
  59. package/assets/esri/core/workers/chunks/{48c8ef4170e803a564d6.js → 8b75861196d1ce5cba63.js} +1 -1
  60. package/assets/esri/core/workers/chunks/8be61e13530fd0dc2fd1.js +1 -0
  61. package/assets/esri/core/workers/chunks/90b8ccee883738917a6d.js +1 -0
  62. package/assets/esri/core/workers/chunks/90bc9c299ae0e8b8b5e5.js +1 -0
  63. package/assets/esri/core/workers/chunks/91d9ade78854f40a962d.js +1 -0
  64. package/assets/esri/core/workers/chunks/{74881340e040bfd0580f.js → 934bc1028b287f8df4aa.js} +1 -1
  65. package/assets/esri/core/workers/chunks/96055de47831e59a28bf.js +1 -0
  66. package/assets/esri/core/workers/chunks/963ba863e0f87abfca25.js +1 -0
  67. package/assets/esri/core/workers/chunks/9aa8d60483ad905fe13b.js +1 -0
  68. package/assets/esri/core/workers/chunks/9fed9946241bb2a5cfa4.js +1 -0
  69. package/assets/esri/core/workers/chunks/a2662e98857f0abf8e82.js +1 -0
  70. package/assets/esri/core/workers/chunks/a5a9b0a35849b9f2e86d.js +1 -0
  71. package/assets/esri/core/workers/chunks/a60006c9ccf6817fc0d2.js +1 -0
  72. package/assets/esri/core/workers/chunks/a627b7eb94b7fca33210.js +1 -0
  73. package/assets/esri/core/workers/chunks/a651dc3b8f1fc1ab34cc.js +1 -0
  74. package/assets/esri/core/workers/chunks/{bf5f9da0837ed09729c6.js → aab93e885b6c7c6aa76e.js} +1 -1
  75. package/assets/esri/core/workers/chunks/adfe28c1c1619cdd3ca1.js +1019 -0
  76. package/assets/esri/core/workers/chunks/b88dc7d8ae105747e6a4.js +1 -0
  77. package/assets/esri/core/workers/chunks/b90c786dd474ea1a409c.js +1 -0
  78. package/assets/esri/core/workers/chunks/b92e9e5df8154a128982.js +1 -0
  79. package/assets/esri/core/workers/chunks/{9a855a10798348a21bab.js → bff814d34b38ec80c44d.js} +1 -1
  80. package/assets/esri/core/workers/chunks/c36d699a75b6e8fb93eb.js +1 -0
  81. package/assets/esri/core/workers/chunks/c50fdf723f2d4316862e.js +1 -0
  82. package/assets/esri/core/workers/chunks/{9461cc37ab3397265270.js → c5e8ff4721b15ac3c6eb.js} +1 -1
  83. package/assets/esri/core/workers/chunks/{4cda42b94e9cb58dd372.js → ca61077e0a598654f33f.js} +1 -1
  84. package/assets/esri/core/workers/chunks/{61a9ffd4cf07d8bb7a9b.js → ca81be5bdb88ef557bf3.js} +1 -1
  85. package/assets/esri/core/workers/chunks/{ca1c65eb7f5900c60170.js → cd8fec3500e6503ae020.js} +1 -1
  86. package/assets/esri/core/workers/chunks/ce90e8489143228262e7.js +1 -0
  87. package/assets/esri/core/workers/chunks/d0320ca67abca4f8b0d2.js +1 -0
  88. package/assets/esri/core/workers/chunks/{4b6a44c6265c8959abd8.js → d3db7244fac7398cc700.js} +1 -1
  89. package/assets/esri/core/workers/chunks/{19820cddba13a3585c0b.js → d561624ddb9388732b25.js} +1 -1
  90. package/assets/esri/core/workers/chunks/d65ca3b8fccae8c3c3fa.js +1 -0
  91. package/assets/esri/core/workers/chunks/{630eba99f48ea79a9560.js → d705410c369bd03b1875.js} +1 -1
  92. package/assets/esri/core/workers/chunks/{9c7682b300b877f60095.js → d76513a6260d9ec4ea25.js} +1 -1
  93. package/assets/esri/core/workers/chunks/d82e17522ed946c2d809.js +1 -0
  94. package/assets/esri/core/workers/chunks/d8dc130ea559be1f68c6.js +1 -0
  95. package/assets/esri/core/workers/chunks/{768ae52b4e5c3e571ef5.js → dc29cb16704e2e4d0a46.js} +1 -1
  96. package/assets/esri/core/workers/chunks/e8c2e2fbe9cef4c8a8c6.js +1 -0
  97. package/assets/esri/core/workers/chunks/{3f33708eb39c7169a226.js → f2ba50eb29f93df885d6.js} +1 -1
  98. package/assets/esri/core/workers/chunks/{6e5d41f51572e3e7cf92.js → f7163048146ddaedfc36.js} +1 -1
  99. package/assets/esri/core/workers/chunks/fdaa10a588db394e2f65.js +1 -0
  100. package/chunks/Laserlines.glsl.js +1 -1
  101. package/chunks/boundedPlane.js +1 -1
  102. package/chunks/cameraUtilsSpherical.js +1 -1
  103. package/chunks/vec32.js +1 -1
  104. package/config.js +1 -1
  105. package/core/libs/gl-matrix-2/math/quat.js +1 -1
  106. package/core/libs/gl-matrix-2/math/vec3.js +1 -1
  107. package/geometry/FlatGeometry.js +1 -1
  108. package/geometry/operators/support/apiConverter.js +1 -1
  109. package/geometry/operators/support/jsonConverter.js +1 -1
  110. package/geometry/support/curves/circleUtils.js +1 -1
  111. package/geometry/support/lineSegment.js +1 -1
  112. package/geometry/support/meshUtils/loadGLTFMesh.js +1 -1
  113. package/geometry/support/meshUtils/merge.js +1 -1
  114. package/geometry/support/sphere.js +1 -1
  115. package/interfaces.d.ts +122 -14
  116. package/kernel.js +1 -1
  117. package/layers/VoxelWasmPerSceneView.js +1 -1
  118. package/layers/orientedImagery/transformations/worldToImage.js +1 -1
  119. package/layers/support/tiles3DUtils.js +1 -1
  120. package/layers/voxel/VoxelVolume.js +1 -1
  121. package/package.json +1 -1
  122. package/support/revision.js +1 -1
  123. package/symbols/cim/effects/EffectSuppress.js +1 -1
  124. package/views/2d/interactive/SegmentLabels2D.js +1 -1
  125. package/views/3d/analysis/AreaMeasurement/support/MeasurementData.js +1 -1
  126. package/views/3d/analysis/Dimension/lengthDimensionConstraintUtils.js +1 -1
  127. package/views/3d/analysis/Dimension/lengthDimensionUtils.js +1 -1
  128. package/views/3d/analysis/LineOfSight/LineOfSightController.js +1 -1
  129. package/views/3d/analysis/LineOfSight/LineOfSightIntersectionResult.js +1 -1
  130. package/views/3d/analysis/Slice/sliceToolUtils.js +1 -1
  131. package/views/3d/analysis/Viewshed/ViewshedScaleOrientManipulation.js +1 -1
  132. package/views/3d/analysis/Viewshed/ViewshedSubTool.js +1 -1
  133. package/views/3d/analysis/Viewshed/ViewshedSubVisualization.js +1 -1
  134. package/views/3d/analysis/Viewshed/ViewshedTool.js +1 -1
  135. package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementCutFillController.js +1 -1
  136. package/views/3d/animation/pointToPoint/Camera.js +1 -1
  137. package/views/3d/camera/constraintUtils/distance.js +1 -1
  138. package/views/3d/camera/constraintUtils/tilt.js +1 -1
  139. package/views/3d/environment/ChapmanAtmosphere.js +1 -1
  140. package/views/3d/environment/CloudsParameters.js +1 -1
  141. package/views/3d/environment/EnvironmentManager.js +1 -1
  142. package/views/3d/environment/MarsAtmosphere.js +1 -1
  143. package/views/3d/glTF/internal/Resource.js +1 -1
  144. package/views/3d/glTF/loader.js +1 -1
  145. package/views/3d/interactive/SegmentLabels3D.js +1 -1
  146. package/views/3d/interactive/editingTools/manipulations/MoveZManipulation.js +1 -1
  147. package/views/3d/interactive/editingTools/media/MediaElementManipulator3D.js +1 -1
  148. package/views/3d/interactive/editingTools/reshape/edgeOffsetUtils.js +1 -1
  149. package/views/3d/interactive/visualElements/MeasurementArrowVisualElement.js +1 -1
  150. package/views/3d/interactive/visualElements/RightAngleQuadVisualElement.js +1 -1
  151. package/views/3d/layers/I3SMeshView3D.js +1 -1
  152. package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
  153. package/views/3d/layers/graphics/Graphics3DFrustumVisibility.js +1 -1
  154. package/views/3d/layers/graphics/Graphics3DObjectSymbolLayer.js +1 -1
  155. package/views/3d/layers/graphics/ObjectResourceCache.js +1 -1
  156. package/views/3d/layers/graphics/objectResourceUtils.js +1 -1
  157. package/views/3d/layers/i3s/I3SMaterialUtil.js +1 -1
  158. package/views/3d/layers/i3s/I3SViewportQueries.js +1 -1
  159. package/views/3d/layers/i3s/PointCloudRenderer.js +1 -1
  160. package/views/3d/layers/support/FeatureTileMeasurements3D.js +1 -1
  161. package/views/3d/layers/support/FeatureTileVisibility3D.js +1 -1
  162. package/views/3d/state/Frustum.js +1 -1
  163. package/views/3d/state/controllers/FovController.js +1 -1
  164. package/views/3d/state/controllers/GamepadKeyboardController.js +1 -1
  165. package/views/3d/state/controllers/momentum/ZoomPlanarMomentumController.js +1 -1
  166. package/views/3d/support/FrustumExtentIntersection.js +1 -1
  167. package/views/3d/support/cameraUtils.js +1 -1
  168. package/views/3d/support/intersectionUtils.js +1 -1
  169. package/views/3d/support/orientedBoundingBox.js +1 -1
  170. package/views/3d/support/pointsOfInterest/CameraOnSurface.js +1 -1
  171. package/views/3d/support/pointsOfInterest/CenterOnSurface.js +1 -1
  172. package/views/3d/support/pointsOfInterest/Focus.js +1 -1
  173. package/views/3d/support/viewpointUtils.js +1 -1
  174. package/views/3d/terrain/OverlayManager.js +1 -1
  175. package/views/3d/terrain/PatchRenderData.js +1 -1
  176. package/views/3d/terrain/SphericalPatch.js +1 -1
  177. package/views/3d/terrain/Tile.js +1 -1
  178. package/views/3d/webgl/RenderCamera.js +1 -1
  179. package/views/3d/webgl-engine/core/FBOCache.js +1 -1
  180. package/views/3d/webgl-engine/effects/haze/Haze.js +1 -1
  181. package/views/3d/webgl-engine/lib/GaussianSplatRenderNode.js +1 -1
  182. package/views/3d/webgl-engine/lib/Object3D.js +1 -1
  183. package/views/3d/webgl-engine/lib/Renderer.js +1 -1
  184. package/views/3d/webgl-engine/lib/ShadowAccumulator.js +1 -1
  185. package/views/3d/webgl-engine/lib/Viewshed.js +1 -1
  186. package/views/3d/webgl-engine/lib/edgeRendering/edgePreprocessing.js +1 -1
  187. package/views/3d/webgl-engine/lib/geometryDataUtils.js +1 -1
  188. package/views/3d/webgl-engine/lib/triangleIntersectionUtils.js +1 -1
  189. package/views/3d/webgl-engine/materials/HUDMaterial.js +1 -1
  190. package/views/3d/webgl-engine/materials/LineMarkerMaterial.js +1 -1
  191. package/views/3d/webgl-engine/materials/MeasurementArrowMaterial.js +1 -1
  192. package/views/3d/webgl-engine/materials/NativeLineMaterial.js +1 -1
  193. package/views/3d/webgl-engine/materials/RibbonLineMaterial.js +1 -1
  194. package/views/3d/webgl-engine/materials/pbrUtils.js +1 -1
  195. package/views/3d/webgl-engine/shaders/SphereDepthInterpolate.glsl.js +1 -1
  196. package/views/draw/support/Reshape.js +1 -1
  197. package/views/interactive/GraphicManipulator.js +1 -1
  198. package/views/interactive/coordinateHelper.js +1 -1
  199. package/views/interactive/editGeometry/operations/OffsetEdgeVertex.js +1 -1
  200. package/views/interactive/sketch/constraints.js +1 -1
  201. package/views/interactive/snapping/featureSources/sceneLayerSource/SceneLayerSnappingSourceWorker.js +1 -1
  202. package/views/interactive/snapping/featureSources/sceneLayerSource/sceneLayerSnappingUtils.js +1 -1
  203. package/views/interactive/snapping/hints/LineSnappingHint.js +1 -1
  204. package/views/interactive/tooltip/tooltipCommonUtils.js +1 -1
  205. package/views/navigation/PanSphericalMomentumEstimator.js +1 -1
  206. package/views/support/euclideanAreaMeasurementUtils.js +1 -1
  207. package/views/support/euclideanLengthMeasurementUtils.js +1 -1
  208. package/views/support/geometry3dUtils.js +1 -1
  209. package/widgets/BatchAttributeForm/BatchAttributeFormViewModel.js +1 -1
  210. package/widgets/BatchAttributeForm/css.js +1 -1
  211. package/widgets/BatchAttributeForm/inputs/SingleFeatureInput.d.ts +4 -0
  212. package/widgets/BatchAttributeForm/inputs/SingleFeatureInput.js +5 -0
  213. package/widgets/BatchAttributeForm/inputs/TextElementInput.d.ts +4 -0
  214. package/widgets/BatchAttributeForm/inputs/TextElementInput.js +5 -0
  215. package/widgets/BatchAttributeForm/inputs/support/createBatchFormInputs.js +1 -1
  216. package/widgets/BatchAttributeForm/inputs/support/inputUtils.js +1 -1
  217. package/widgets/BatchAttributeForm/templates/GroupElementTemplate.js +1 -1
  218. package/widgets/BatchAttributeForm/templates/TextElementTemplate.js +5 -0
  219. package/widgets/BatchAttributeForm/templates/support/createBatchFormTemplate.js +1 -1
  220. package/widgets/BatchAttributeForm/templates/support/hashElementTemplate.js +1 -1
  221. package/widgets/BatchAttributeForm/templates/support/templateUtils.js +1 -1
  222. package/widgets/BatchAttributeForm.js +1 -1
  223. package/widgets/FeatureForm/TextElementInput.d.ts +2 -2
  224. package/widgets/PanoramicViewer/PanoramicVideoViewerViewModel.js +1 -1
  225. package/widgets/PanoramicViewer/PanoramicViewerViewModel.js +1 -1
  226. package/widgets/PanoramicViewer/PanoramicZoomManager.js +1 -1
  227. package/widgets/PanoramicViewer/support/PanoramicMedia.js +5 -0
  228. package/widgets/PanoramicViewer/support/PanoramicMediaCollection.js +5 -0
  229. package/widgets/PanoramicViewer/support/PanoramicMediaError.js +5 -0
  230. package/widgets/PanoramicViewer/utils.js +1 -1
  231. package/widgets/PanoramicViewer.js +1 -1
  232. package/assets/esri/core/workers/chunks/04a0685ee53ef74883aa.js +0 -1
  233. package/assets/esri/core/workers/chunks/1e0e7cef7ef947894bbe.js +0 -1019
  234. package/assets/esri/core/workers/chunks/20988e116f3723228f36.js +0 -1
  235. package/assets/esri/core/workers/chunks/2613e482450b57f2d4f5.js +0 -1
  236. package/assets/esri/core/workers/chunks/274f2b5e6dbc58505142.js +0 -1
  237. package/assets/esri/core/workers/chunks/27dfbe3d903b95d4c67a.js +0 -1
  238. package/assets/esri/core/workers/chunks/28a5a7c6b3d6902146f6.js +0 -1
  239. package/assets/esri/core/workers/chunks/2c4218306747f5d15575.js +0 -1
  240. package/assets/esri/core/workers/chunks/2db7a7607657f1d669f7.js +0 -1
  241. package/assets/esri/core/workers/chunks/3767617c0dfc7d801441.js +0 -1
  242. package/assets/esri/core/workers/chunks/44b6b7418cbf7f778bef.js +0 -1
  243. package/assets/esri/core/workers/chunks/4675ed3ca3e0104d00bf.js +0 -1
  244. package/assets/esri/core/workers/chunks/4df7cc3477bc46fc39af.js +0 -1
  245. package/assets/esri/core/workers/chunks/538ddb267aa328814865.js +0 -1
  246. package/assets/esri/core/workers/chunks/555a0ea44ba77819d493.js +0 -1
  247. package/assets/esri/core/workers/chunks/55818fe7a7aa1e5c8bbd.js +0 -1
  248. package/assets/esri/core/workers/chunks/5f781ef46ce7c4048c2f.js +0 -1
  249. package/assets/esri/core/workers/chunks/60f2de8dd8876bfd715a.js +0 -1
  250. package/assets/esri/core/workers/chunks/679088064420a906aa7f.js +0 -1
  251. package/assets/esri/core/workers/chunks/706423d801fa9cbf2e90.js +0 -1
  252. package/assets/esri/core/workers/chunks/71dd80231ea656a6380c.js +0 -1
  253. package/assets/esri/core/workers/chunks/725819839434c59102f3.js +0 -1
  254. package/assets/esri/core/workers/chunks/72cebf18da5ec5eeb666.js +0 -1
  255. package/assets/esri/core/workers/chunks/768d9b6eaba7bfa18dde.js +0 -1
  256. package/assets/esri/core/workers/chunks/77b45957cfe42523c1c8.js +0 -1
  257. package/assets/esri/core/workers/chunks/852de585a72d902344a6.js +0 -1
  258. package/assets/esri/core/workers/chunks/871dd5e1f016a04b8d98.js +0 -1
  259. package/assets/esri/core/workers/chunks/892c417f5130b003889d.js +0 -1
  260. package/assets/esri/core/workers/chunks/907083c427d7fb4354e9.js +0 -1
  261. package/assets/esri/core/workers/chunks/93c5f097bb7b380bb175.js +0 -1
  262. package/assets/esri/core/workers/chunks/9f0172b83f25ef5f8d40.js +0 -1
  263. package/assets/esri/core/workers/chunks/ae793d814cf32db9fbde.js +0 -1
  264. package/assets/esri/core/workers/chunks/b21cf62652ca772108c8.js +0 -1
  265. package/assets/esri/core/workers/chunks/c5c02ace54fe4ab9214b.js +0 -1
  266. package/assets/esri/core/workers/chunks/c82a974c8448407885e6.js +0 -1
  267. package/assets/esri/core/workers/chunks/d08ee45c501102deea20.js +0 -1
  268. package/assets/esri/core/workers/chunks/d239a4ef60e348cfb05a.js +0 -1
  269. package/assets/esri/core/workers/chunks/da2ba40bc017bff0fe49.js +0 -1
  270. package/assets/esri/core/workers/chunks/dc3a4ad62bc041a4f899.js +0 -1
  271. package/assets/esri/core/workers/chunks/e093e745708f722bc1b9.js +0 -1
  272. package/assets/esri/core/workers/chunks/e501d68a1464805c4b4e.js +0 -1
  273. package/assets/esri/core/workers/chunks/f3c232fc56a29d51196a.js +0 -1
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import e from"../../../../core/Logger.js";import{clamp as t}from"../../../../core/mathUtils.js";import{createRenderScreenPointArray3 as r}from"../../../../core/screenUtils.js";import{copy as o}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{h as i,e as s,g as n,j as a,i as c,d as l,b as m,C as u}from"../../../../chunks/vec32.js";import{create as f}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{ONES as p}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{distance2 as h,fromPoints as g,create as d,closestLineSegmentPoint as j}from"../../../../geometry/support/lineSegment.js";import{fromPoints as b,create as x,signedDistance as L,getNormal as v}from"../../../../geometry/support/plane.js";import{isColorHighlightOrOLID as y}from"../core/shaderLibrary/ShaderOutput.js";import S from"../lib/GLMaterial.js";import{Material as M,MaterialParameters as _}from"../lib/Material.js";import{isTranslationMatrix as w}from"../lib/Util.js";import{DefaultBufferWriter as C}from"./DefaultBufferWriter.js";import{PositionColorLayout as T,PositionLayout as A}from"./DefaultLayouts.js";import{NativeLineTechnique as V}from"../shaders/NativeLineTechnique.js";import{NativeLineTechniqueConfiguration as N}from"../shaders/NativeLineTechniqueConfiguration.js";import{alphaCutoff as R}from"../../../../webscene/support/AlphaCutoff.js";class U extends M{constructor(e){super(e,P),this._configuration=new N,this.produces=new Map([[2,e=>y(e)]])}getConfiguration(e,t){return super.getConfiguration(e,t,this._configuration),this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.hasVertexColors=this.parameters.hasVertexColors,this._configuration.transparent=this.parameters.color[3]<1||this.parameters.width<1,this._configuration.hasOccludees=t.hasOccludees,this._configuration}get visible(){return this.parameters.color[3]>=R}intersect(t,r,f,p,d,x){const{options:y,camera:S,rayBegin:M,rayEnd:_}=f;if(!y.selectionMode||!t.visible||!S)return;if(!w(r))return void e.getLogger("esri.views.3d.webgl-engine.materials.NativeLineMaterial").error("intersection assumes a translation-only matrix");const C=t.attributes.get("position").data,T=H;o(T,f.point);const A=2;i(I[0],T[0]-A,T[1]+A,0),i(I[1],T[0]+A,T[1]+A,0),i(I[2],T[0]+A,T[1]-A,0),i(I[3],T[0]-A,T[1]-A,0);for(let e=0;e<4;e++)if(!S.unprojectFromRenderScreen(I[e],J[e]))return;b(S.eye,J[0],J[1],K),b(S.eye,J[1],J[2],Q),b(S.eye,J[2],J[3],Y),b(S.eye,J[3],J[0],Z);let V=Number.MAX_VALUE,N=0;for(let e=0;e<C.length-5;e+=3){if(q[0]=C[e]+r[12],q[1]=C[e+1]+r[13],q[2]=C[e+2]+r[14],B[0]=C[e+3]+r[12],B[1]=C[e+4]+r[13],B[2]=C[e+5]+r[14],L(K,q)<0&&L(K,B)<0||L(Q,q)<0&&L(Q,B)<0||L(Y,q)<0&&L(Y,B)<0||L(Z,q)<0&&L(Z,B)<0)continue;const t=S.projectToRenderScreen(q,W),o=S.projectToRenderScreen(B,X);if(null==t||null==o)continue;if(t[2]<0&&o[2]>0){s(D,q,B);const e=S.frustum,r=-L(e[4],q)/n(D,v(e[4]));if(a(D,D,r),c(q,q,D),!S.projectToRenderScreen(q,t))continue}else if(t[2]>0&&o[2]<0){s(D,B,q);const e=S.frustum,t=-L(e[4],B)/n(D,v(e[4]));if(a(D,D,t),c(B,B,D),!S.projectToRenderScreen(B,o))continue}else if(t[2]<0&&o[2]<0)continue;t[2]=0,o[2]=0;const i=h(g(t,o,z),T);i<V&&(V=i,l(G,q),l(k,B),N=e/3)}if(V<A*A){let e=Number.MAX_VALUE;if(j(g(G,k,z),g(M,_,F),O)){s(O,O,M);const t=m(O);a(O,O,1/t),e=t/u(M,_)}x(e,O,N)}}intersectDraped(e,r,o,i,s){if(!r.options.selectionMode)return;const n=e.attributes.get("position").data,a=e.attributes.get("size"),c=a?a.data[0]:0,l=o[0],m=o[1],u=((c+1)/2+4)*e.screenToWorldRatio;let f=Number.MAX_VALUE,p=0;for(let h=0;h<n.length-5;h+=3){const e=n[h],r=n[h+1],o=l-e,i=m-r,s=n[h+3]-e,a=n[h+4]-r,c=t((s*o+a*i)/(s*s+a*a),0,1),u=s*c-o,g=a*c-i,d=u*u+g*g;d<f&&(f=d,p=h/3)}f<u*u&&i(s.distance,s.normal,p)}createGLMaterial(e){return new E(e)}createBufferWriter(){const e=this.parameters.hasVertexColors?T:A;return new C(e)}}class E extends S{beginSlot(e){return this.getTechnique(V,e)}}class P extends _{constructor(){super(...arguments),this.color=p,this.hasVertexColors=!1,this.hasSlicePlane=!1,this.width=1}}const q=f(),B=f(),D=f(),O=f(),W=r(),X=r(),G=f(),k=f(),z=d(),F=d(),H=f(),I=[r(),r(),r(),r()],J=[f(),f(),f(),f()],K=x(),Q=x(),Y=x(),Z=x();export{U as NativeLineMaterial,P as Parameters};
5
+ import e from"../../../../core/Logger.js";import{clamp as t}from"../../../../core/mathUtils.js";import{createRenderScreenPointArray3 as r}from"../../../../core/screenUtils.js";import{copy as o}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{h as i,e as s,g as n,j as a,i as c,d as l,b as m,D as u}from"../../../../chunks/vec32.js";import{create as f}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{ONES as p}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{distance2 as h,fromPoints as g,create as d,closestLineSegmentPoint as j}from"../../../../geometry/support/lineSegment.js";import{fromPoints as b,create as x,signedDistance as L,getNormal as v}from"../../../../geometry/support/plane.js";import{isColorHighlightOrOLID as y}from"../core/shaderLibrary/ShaderOutput.js";import S from"../lib/GLMaterial.js";import{Material as M,MaterialParameters as _}from"../lib/Material.js";import{isTranslationMatrix as w}from"../lib/Util.js";import{DefaultBufferWriter as C}from"./DefaultBufferWriter.js";import{PositionColorLayout as T,PositionLayout as A}from"./DefaultLayouts.js";import{NativeLineTechnique as V}from"../shaders/NativeLineTechnique.js";import{NativeLineTechniqueConfiguration as N}from"../shaders/NativeLineTechniqueConfiguration.js";import{alphaCutoff as R}from"../../../../webscene/support/AlphaCutoff.js";class U extends M{constructor(e){super(e,E),this._configuration=new N,this.produces=new Map([[2,e=>y(e)]])}getConfiguration(e,t){return super.getConfiguration(e,t,this._configuration),this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.hasVertexColors=this.parameters.hasVertexColors,this._configuration.transparent=this.parameters.color[3]<1||this.parameters.width<1,this._configuration.hasOccludees=t.hasOccludees,this._configuration}get visible(){return this.parameters.color[3]>=R}intersect(t,r,f,p,d,x){const{options:y,camera:S,rayBegin:M,rayEnd:_}=f;if(!y.selectionMode||!t.visible||!S)return;if(!w(r))return void e.getLogger("esri.views.3d.webgl-engine.materials.NativeLineMaterial").error("intersection assumes a translation-only matrix");const C=t.attributes.get("position").data,T=H;o(T,f.point);const A=2;i(I[0],T[0]-A,T[1]+A,0),i(I[1],T[0]+A,T[1]+A,0),i(I[2],T[0]+A,T[1]-A,0),i(I[3],T[0]-A,T[1]-A,0);for(let e=0;e<4;e++)if(!S.unprojectFromRenderScreen(I[e],J[e]))return;b(S.eye,J[0],J[1],K),b(S.eye,J[1],J[2],Q),b(S.eye,J[2],J[3],Y),b(S.eye,J[3],J[0],Z);let V=Number.MAX_VALUE,N=0;for(let e=0;e<C.length-5;e+=3){if(P[0]=C[e]+r[12],P[1]=C[e+1]+r[13],P[2]=C[e+2]+r[14],q[0]=C[e+3]+r[12],q[1]=C[e+4]+r[13],q[2]=C[e+5]+r[14],L(K,P)<0&&L(K,q)<0||L(Q,P)<0&&L(Q,q)<0||L(Y,P)<0&&L(Y,q)<0||L(Z,P)<0&&L(Z,q)<0)continue;const t=S.projectToRenderScreen(P,W),o=S.projectToRenderScreen(q,X);if(null==t||null==o)continue;if(t[2]<0&&o[2]>0){s(B,P,q);const e=S.frustum,r=-L(e[4],P)/n(B,v(e[4]));if(a(B,B,r),c(P,P,B),!S.projectToRenderScreen(P,t))continue}else if(t[2]>0&&o[2]<0){s(B,q,P);const e=S.frustum,t=-L(e[4],q)/n(B,v(e[4]));if(a(B,B,t),c(q,q,B),!S.projectToRenderScreen(q,o))continue}else if(t[2]<0&&o[2]<0)continue;t[2]=0,o[2]=0;const i=h(g(t,o,z),T);i<V&&(V=i,l(G,P),l(k,q),N=e/3)}if(V<A*A){let e=Number.MAX_VALUE;if(j(g(G,k,z),g(M,_,F),O)){s(O,O,M);const t=m(O);a(O,O,1/t),e=t/u(M,_)}x(e,O,N)}}intersectDraped(e,r,o,i,s){if(!r.options.selectionMode)return;const n=e.attributes.get("position").data,a=e.attributes.get("size"),c=a?a.data[0]:0,l=o[0],m=o[1],u=((c+1)/2+4)*e.screenToWorldRatio;let f=Number.MAX_VALUE,p=0;for(let h=0;h<n.length-5;h+=3){const e=n[h],r=n[h+1],o=l-e,i=m-r,s=n[h+3]-e,a=n[h+4]-r,c=t((s*o+a*i)/(s*s+a*a),0,1),u=s*c-o,g=a*c-i,d=u*u+g*g;d<f&&(f=d,p=h/3)}f<u*u&&i(s.distance,s.normal,p)}createGLMaterial(e){return new D(e)}createBufferWriter(){const e=this.parameters.hasVertexColors?T:A;return new C(e)}}class D extends S{beginSlot(e){return this.getTechnique(V,e)}}class E extends _{constructor(){super(...arguments),this.color=p,this.hasVertexColors=!1,this.hasSlicePlane=!1,this.width=1}}const P=f(),q=f(),B=f(),O=f(),W=r(),X=r(),G=f(),k=f(),z=d(),F=d(),H=f(),I=[r(),r(),r(),r()],J=[f(),f(),f(),f()],K=x(),Q=x(),Y=x(),Z=x();export{U as NativeLineMaterial,E as Parameters};
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import t from"../../../../core/Logger.js";import{clamp as e}from"../../../../core/mathUtils.js";import{createRenderScreenPointArray3 as i}from"../../../../core/screenUtils.js";import{secondsFromMilliseconds as r}from"../../../../core/time.js";import{copy as s}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{h as a,e as n,g as o,j as l,i as h,d as c,b as m,C as p,p as u}from"../../../../chunks/vec32.js";import{create as f}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{c as d}from"../../../../chunks/vec42.js";import{ONES as g,create as b}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{makeFloat16Array as _}from"../../../../geometry/support/float16.js";import{distance2 as S,fromPoints as v,create as P,closestLineSegmentPoint as j}from"../../../../geometry/support/lineSegment.js";import{fromPoints as E,create as w,signedDistance as y,getNormal as T}from"../../../../geometry/support/plane.js";import{isHighlightOrOLID as z,isColor as A,isDepth as C,isColorHighlightOLIDOrDepth as O,is2DGeometryOutput as L}from"../core/shaderLibrary/ShaderOutput.js";import{olidEnabled as M}from"../effects/geometry/olidUtils.js";import V from"../lib/GLMaterial.js";import{Material as R}from"../lib/Material.js";import{isTranslationMatrix as x}from"../lib/Util.js";import{VisualVariablePassParameters as F}from"./VisualVariablePassParameters.js";import{writeDeltaF16Vector as k}from"./internal/bufferWriterUtils.js";import{r as N}from"../../../../chunks/RibbonLine.glsl.js";import{getLayout as U,RibbonLineTechnique as D}from"../shaders/RibbonLineTechnique.js";import{RibbonLineTechniqueConfiguration as B}from"../shaders/RibbonLineTechniqueConfiguration.js";import{alphaCutoff as W}from"../../../../webscene/support/AlphaCutoff.js";class J extends R{constructor(t,e){super(t,q),this.produces=new Map([[2,t=>z(t)||A(t)&&8===this.parameters.renderOccluded],[3,t=>C(t)],[11,t=>O(t)&&8===this.parameters.renderOccluded],[12,t=>O(t)&&8===this.parameters.renderOccluded],[4,t=>A(t)&&this.parameters.writeDepth&&8!==this.parameters.renderOccluded],[9,t=>A(t)&&!this.parameters.writeDepth&&8!==this.parameters.renderOccluded],[19,t=>L(t)]]),this._configuration=new B(e)}getConfiguration(t,e){super.getConfiguration(t,e,this._configuration),this._configuration.oitPass=e.oitPass,this._configuration.draped=19===e.slot;const i=null!=this.parameters.stipplePattern&&8!==t;return this._configuration.stippleEnabled=i,this._configuration.stippleOffColorEnabled=i&&null!=this.parameters.stippleOffColor,this._configuration.stipplePreferContinuous=i&&this.parameters.stipplePreferContinuous,this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.roundJoins="round"===this.parameters.join,this._configuration.capType=this.parameters.cap,this._configuration.applyMarkerOffset=null!=this.parameters.markerParameters&&H(this.parameters.markerParameters),this._configuration.hasPolygonOffset=this.parameters.hasPolygonOffset,this._configuration.writeDepth=this.parameters.writeDepth,this._configuration.hasVVSize=this.parameters.hasVVSize,this._configuration.hasVVColor=this.parameters.hasVVColor,this._configuration.hasVVOpacity=this.parameters.hasVVOpacity,this._configuration.innerColorEnabled=this.parameters.innerWidth>0&&null!=this.parameters.innerColor,this._configuration.falloffEnabled=this.parameters.falloff>0,this._configuration.hasOccludees=e.hasOccludees,this._configuration.occluder=8===this.parameters.renderOccluded,this._configuration.terrainDepthTest=e.terrainDepthTest&&A(t),this._configuration.cullAboveTerrain=e.cullAboveTerrain,this._configuration.wireframe=this.parameters.wireframe,this._configuration.animation=this.parameters.animation,this._configuration.emissionSource=this.hasEmissions?1:0,this._configuration.hasScreenSizePerspective=!!this.parameters.screenSizePerspective,this._configuration}get visible(){return this.parameters.color[3]>=W||null!=this.parameters.stipplePattern&&(this.parameters.stippleOffColor?.[3]??0)>W}setParameters(t,e){t.animation=this.parameters.animation,super.setParameters(t,e)}intersectDraped({attributes:t,screenToWorldRatio:i},r,s,a,n){if(!r.options.selectionMode)return;const o=t.get("size");let l=this.parameters.width;if(this.parameters.vvSize){const i=t.get("sizeFeatureAttribute").data[0];Number.isNaN(i)?l*=this.parameters.vvSize.fallback[0]:l*=e(this.parameters.vvSize.offset[0]+i*this.parameters.vvSize.factor[0],this.parameters.vvSize.minSize[0],this.parameters.vvSize.maxSize[0])}else o&&(l*=o.data[0]);const h=s[0],c=s[1],m=(l/2+4)*i;let p=Number.MAX_VALUE,u=0;const f=t.get("position").data,d=I(this.parameters,t)?f.length-2:f.length-5;for(let g=0;g<d;g+=3){const t=f[g],i=f[g+1],r=(g+3)%f.length,s=h-t,a=c-i,n=f[r]-t,o=f[r+1]-i,l=e((n*s+o*a)/(n*n+o*o),0,1),m=n*l-s,d=o*l-a,b=m*m+d*d;b<p&&(p=b,u=g/3)}p<m*m&&a(n.distance,n.normal,u)}intersect(i,r,u,f,d,g){const{options:b,camera:_,rayBegin:P,rayEnd:w}=u;if(!b.selectionMode||!i.visible||!_)return;if(!x(r))return void t.getLogger("esri.views.3d.webgl-engine.materials.RibbonLineMaterial").error("intersection assumes a translation-only matrix");const z=i.attributes,A=z.get("position").data;let C=this.parameters.width;if(this.parameters.vvSize){const t=z.get("sizeFeatureAttribute").data[0];Number.isNaN(t)||(C*=e(this.parameters.vvSize.offset[0]+t*this.parameters.vvSize.factor[0],this.parameters.vvSize.minSize[0],this.parameters.vvSize.maxSize[0]))}else z.has("size")&&(C*=z.get("size").data[0]);const O=tt;s(O,u.point);const L=C*_.pixelRatio/2+4*_.pixelRatio;a(mt[0],O[0]-L,O[1]+L,0),a(mt[1],O[0]+L,O[1]+L,0),a(mt[2],O[0]+L,O[1]-L,0),a(mt[3],O[0]-L,O[1]-L,0);for(let t=0;t<4;t++)if(!_.unprojectFromRenderScreen(mt[t],pt[t]))return;E(_.eye,pt[0],pt[1],ut),E(_.eye,pt[1],pt[2],ft),E(_.eye,pt[2],pt[3],dt),E(_.eye,pt[3],pt[0],gt);let M=Number.MAX_VALUE,V=0;const R=I(this.parameters,z)?A.length-2:A.length-5;for(let t=0;t<R;t+=3){K[0]=A[t]+r[12],K[1]=A[t+1]+r[13],K[2]=A[t+2]+r[14];const e=(t+3)%A.length;if(Q[0]=A[e]+r[12],Q[1]=A[e+1]+r[13],Q[2]=A[e+2]+r[14],y(ut,K)<0&&y(ut,Q)<0||y(ft,K)<0&&y(ft,Q)<0||y(dt,K)<0&&y(dt,Q)<0||y(gt,K)<0&&y(gt,Q)<0)continue;const i=_.projectToRenderScreen(K,et),s=_.projectToRenderScreen(Q,it);if(null==i||null==s)continue;if(i[2]<0&&s[2]>0){n(Z,K,Q);const t=_.frustum,e=-y(t[4],K)/o(Z,T(t[4]));if(l(Z,Z,e),h(K,K,Z),!_.projectToRenderScreen(K,i))continue}else if(i[2]>0&&s[2]<0){n(Z,Q,K);const t=_.frustum,e=-y(t[4],Q)/o(Z,T(t[4]));if(l(Z,Z,e),h(Q,Q,Z),!_.projectToRenderScreen(Q,s))continue}else if(i[2]<0&&s[2]<0)continue;i[2]=0,s[2]=0;const a=S(v(i,s,at),O);a<M&&(M=a,c(rt,K),c(st,Q),V=t/3)}if(M<L*L){let t=Number.MAX_VALUE;if(j(v(rt,st,at),v(P,w,nt),$)){n($,$,P);const e=m($);l($,$,1/e),t=e/p(P,w)}g(t,$,V)}}get hasEmissions(){return this.parameters.emissiveStrength>0}createBufferWriter(){return new X(U(this.parameters),this.parameters)}createGLMaterial(t){return new Y(t)}validateParameters(t){"miter"!==t.join&&(t.miterLimit=0),null!=t.markerParameters&&(t.markerScale=t.markerParameters.width/t.width)}update(t){return!!this.parameters.hasAnimation&&(this.setParameters({timeElapsed:r(t.time)},!1),0!==t.dt)}}class Y extends V{constructor(){super(...arguments),this._stipplePattern=null}dispose(){super.dispose(),this._stippleTextures?.release(this._stipplePattern),this._stipplePattern=null}beginSlot(t){const e=this._material.parameters.stipplePattern;return this._stipplePattern!==e&&(this._material.setParameters({stippleTexture:this._stippleTextures.swap(e,this._stipplePattern)}),this._stipplePattern=e),this.getTechnique(D,t)}}class q extends F{constructor(){super(...arguments),this.width=0,this.color=g,this.join="miter",this.cap=0,this.miterLimit=5,this.writeDepth=!0,this.hasPolygonOffset=!1,this.stippleTexture=null,this.stipplePreferContinuous=!0,this.markerParameters=null,this.markerScale=1,this.hasSlicePlane=!1,this.vvFastUpdate=!1,this.isClosed=!1,this.falloff=0,this.innerWidth=0,this.wireframe=!1,this.timeElapsed=0,this.animation=0,this.animationSpeed=1,this.trailLength=1,this.startTime=0,this.endTime=1/0,this.fadeInTime=0,this.fadeOutTime=1/0,this.emissiveStrength=0}get transparent(){return this.color[3]<1||this.hasAnimation||null!=this.stipplePattern&&(this.stippleOffColor?.[3]??0)<1}get hasAnimation(){return 0!==this.animation}}class X{constructor(t,e){this.layout=t,this._parameters=e;const i=e.stipplePattern?1:0;switch(this._parameters.join){case"miter":case"bevel":this.numJoinSubdivisions=i;break;case"round":this.numJoinSubdivisions=N+i}}_isClosed(t){return I(this._parameters,t)}allocate(t){return this.layout.createBuffer(t)}elementCount(t){const e=2,i=t.get("position").indices.length/2+1,r=this._isClosed(t);let s=r?2:2*e;return s+=((r?i:i-1)-(r?0:1))*(2*this.numJoinSubdivisions+4),s+=2,this._parameters.wireframe&&(s=2+4*(s-2)),s}write(t,e,i,r,s,n){const o=this.layout,l=i.get("position"),h=l.indices,m=l.data.length/3,f=i.get("distanceToStart")?.data;h&&h.length!==2*(m-1)&&console.warn("RibbonLineMaterial does not support indices");const g=o.fields.has("sizeFeatureAttribute");let b=1,S=null;if(g){const t=i.get("sizeFeatureAttribute");1===t.data.length?b=t.data[0]:S=t.data}else b=i.get("size")?.data[0]??1;let v=[1,1,1,1],P=0,j=null;const E=o.fields.has("colorFeatureAttribute");if(E){const t=i.get("colorFeatureAttribute");1===t.data.length?P=t.data[0]:j=t.data}else v=i.get("color")?.data??v;const w=i.get("timeStamps")?.data,y=w&&o.fields.has("timeStamps"),T=o.fields.has("opacityFeatureAttribute");let z=0,A=null;if(T){const t=i.get("opacityFeatureAttribute");1===t.data.length?z=t.data[0]:A=t.data}const C=new Float32Array(s.buffer),O=_(s.buffer),L=new Uint8Array(s.buffer),V=o.stride/4;let R=n*V;const x=R;let F=0;const N=f?(t,e,i)=>F=f[i]:(t,e,i)=>F+=p(t,e),U=C.BYTES_PER_ELEMENT/O.BYTES_PER_ELEMENT,D=4/U,B=M(),W=(t,e,i,s,a,n,o,l)=>{C[R++]=e[0],C[R++]=e[1],C[R++]=e[2],k(t,e,O,R*U),R+=D,k(i,e,O,R*U),R+=D,C[R++]=l;let h=R*U;if(O[h++]=a,O[h++]=n,R=Math.ceil(h/U),E)C[R]=j?.[o]??P;else{const t=Math.min(4*o,v.length-4),e=4*R;L[e]=255*v[t],L[e+1]=255*v[t+1],L[e+2]=255*v[t+2],L[e+3]=255*v[t+3]}if(R++,C[R++]=S?.[o]??b,T&&(C[R++]=A?.[o]??z),B){let t=4*R;r?(L[t++]=r[0],L[t++]=r[1],L[t++]=r[2],L[t++]=r[3]):(L[t++]=0,L[t++]=0,L[t++]=0,L[t++]=0),R=Math.ceil(.25*t)}y&&(h=R*U,O[h++]=s[0],O[h++]=s[1],O[h++]=s[2],O[h++]=s[3],R=Math.ceil(h/U))};R+=V,a(lt,l.data[0],l.data[1],l.data[2]),y&&d(ct,w[0],w[1],w[2],w[3]),t&&u(lt,lt,t);const J=this._isClosed(i);if(J){const e=l.data.length-3;a(ot,l.data[e],l.data[e+1],l.data[e+2]),t&&u(ot,ot,t)}else a(ht,l.data[3],l.data[4],l.data[5]),t&&u(ht,ht,t),W(lt,lt,ht,ct,1,-4,0,0),W(lt,lt,ht,ct,1,4,0,0),c(ot,lt),c(lt,ht),y&&d(ct,w[4],w[5],w[6],w[7]);const Y=J?0:1,q=J?m:m-1;for(let p=Y;p<q;p++){const e=(p+1)%m*3;a(ht,l.data[e],l.data[e+1],l.data[e+2]),t&&u(ht,ht,t),N(ot,lt,p),W(ot,lt,ht,ct,0,-1,p,F),W(ot,lt,ht,ct,0,1,p,F);const i=this.numJoinSubdivisions;for(let t=0;t<i;++t){const e=(t+1)/(i+1);W(ot,lt,ht,ct,e,-1,p,F),W(ot,lt,ht,ct,e,1,p,F)}if(W(ot,lt,ht,ct,1,-2,p,F),W(ot,lt,ht,ct,1,2,p,F),c(ot,lt),c(lt,ht),y){const t=(p+1)%m*4;d(ct,w[t],w[t+1],w[t+2],w[t+3])}}J?(a(ht,l.data[3],l.data[4],l.data[5]),t&&u(ht,ht,t),F=N(ot,lt,q),W(ot,lt,ht,ct,0,-1,Y,F),W(ot,lt,ht,ct,0,1,Y,F)):(F=N(ot,lt,q),W(ot,lt,lt,ct,0,-5,q,F),W(ot,lt,lt,ct,0,5,q,F)),G(C,x+V,C,x,V);return R=G(C,R-V,C,R,V),this._parameters.wireframe&&this._addWireframeVertices(s,x,R,V),null}_addWireframeVertices(t,e,i,r){const s=new Float32Array(t.buffer,i*Float32Array.BYTES_PER_ELEMENT),a=new Float32Array(t.buffer,e*Float32Array.BYTES_PER_ELEMENT,i-e);let n=0;const o=t=>n=G(a,t,s,n,r);for(let l=0;l<a.length-1;l+=2*r)o(l),o(l+2*r),o(l+1*r),o(l+2*r),o(l+1*r),o(l+3*r)}}function G(t,e,i,r,s){for(let a=0;a<s;a++)i[r++]=t[e++];return r}function I(t,e){if(!t.isClosed)return!1;return e.get("position").indices.length>2}function H(t){return 1===t.anchor&&t.hideOnShortSegments&&"begin-end"===t.placement&&t.worldSpace}const K=f(),Q=f(),Z=f(),$=f(),tt=f(),et=i(),it=i(),rt=f(),st=f(),at=P(),nt=P(),ot=f(),lt=f(),ht=f(),ct=b(),mt=[i(),i(),i(),i()],pt=[f(),f(),f(),f()],ut=w(),ft=w(),dt=w(),gt=w();export{q as Parameters,J as RibbonLineMaterial};
5
+ import t from"../../../../core/Logger.js";import{clamp as e}from"../../../../core/mathUtils.js";import{createRenderScreenPointArray3 as i}from"../../../../core/screenUtils.js";import{secondsFromMilliseconds as r}from"../../../../core/time.js";import{copy as s}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{h as a,e as n,g as o,j as l,i as h,d as c,b as m,D as p,p as u}from"../../../../chunks/vec32.js";import{create as f}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{c as d}from"../../../../chunks/vec42.js";import{ONES as g,create as b}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{makeFloat16Array as _}from"../../../../geometry/support/float16.js";import{distance2 as S,fromPoints as v,create as P,closestLineSegmentPoint as j}from"../../../../geometry/support/lineSegment.js";import{fromPoints as E,create as w,signedDistance as y,getNormal as T}from"../../../../geometry/support/plane.js";import{isHighlightOrOLID as z,isColor as A,isDepth as C,isColorHighlightOLIDOrDepth as O,is2DGeometryOutput as L}from"../core/shaderLibrary/ShaderOutput.js";import{olidEnabled as M}from"../effects/geometry/olidUtils.js";import V from"../lib/GLMaterial.js";import{Material as R}from"../lib/Material.js";import{isTranslationMatrix as x}from"../lib/Util.js";import{VisualVariablePassParameters as F}from"./VisualVariablePassParameters.js";import{writeDeltaF16Vector as k}from"./internal/bufferWriterUtils.js";import{r as N}from"../../../../chunks/RibbonLine.glsl.js";import{getLayout as U,RibbonLineTechnique as D}from"../shaders/RibbonLineTechnique.js";import{RibbonLineTechniqueConfiguration as B}from"../shaders/RibbonLineTechniqueConfiguration.js";import{alphaCutoff as W}from"../../../../webscene/support/AlphaCutoff.js";class J extends R{constructor(t,e){super(t,q),this.produces=new Map([[2,t=>z(t)||A(t)&&8===this.parameters.renderOccluded],[3,t=>C(t)],[11,t=>O(t)&&8===this.parameters.renderOccluded],[12,t=>O(t)&&8===this.parameters.renderOccluded],[4,t=>A(t)&&this.parameters.writeDepth&&8!==this.parameters.renderOccluded],[9,t=>A(t)&&!this.parameters.writeDepth&&8!==this.parameters.renderOccluded],[19,t=>L(t)]]),this._configuration=new B(e)}getConfiguration(t,e){super.getConfiguration(t,e,this._configuration),this._configuration.oitPass=e.oitPass,this._configuration.draped=19===e.slot;const i=null!=this.parameters.stipplePattern&&8!==t;return this._configuration.stippleEnabled=i,this._configuration.stippleOffColorEnabled=i&&null!=this.parameters.stippleOffColor,this._configuration.stipplePreferContinuous=i&&this.parameters.stipplePreferContinuous,this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.roundJoins="round"===this.parameters.join,this._configuration.capType=this.parameters.cap,this._configuration.applyMarkerOffset=null!=this.parameters.markerParameters&&H(this.parameters.markerParameters),this._configuration.hasPolygonOffset=this.parameters.hasPolygonOffset,this._configuration.writeDepth=this.parameters.writeDepth,this._configuration.hasVVSize=this.parameters.hasVVSize,this._configuration.hasVVColor=this.parameters.hasVVColor,this._configuration.hasVVOpacity=this.parameters.hasVVOpacity,this._configuration.innerColorEnabled=this.parameters.innerWidth>0&&null!=this.parameters.innerColor,this._configuration.falloffEnabled=this.parameters.falloff>0,this._configuration.hasOccludees=e.hasOccludees,this._configuration.occluder=8===this.parameters.renderOccluded,this._configuration.terrainDepthTest=e.terrainDepthTest&&A(t),this._configuration.cullAboveTerrain=e.cullAboveTerrain,this._configuration.wireframe=this.parameters.wireframe,this._configuration.animation=this.parameters.animation,this._configuration.emissionSource=this.hasEmissions?1:0,this._configuration.hasScreenSizePerspective=!!this.parameters.screenSizePerspective,this._configuration}get visible(){return this.parameters.color[3]>=W||null!=this.parameters.stipplePattern&&(this.parameters.stippleOffColor?.[3]??0)>W}setParameters(t,e){t.animation=this.parameters.animation,super.setParameters(t,e)}intersectDraped({attributes:t,screenToWorldRatio:i},r,s,a,n){if(!r.options.selectionMode)return;const o=t.get("size");let l=this.parameters.width;if(this.parameters.vvSize){const i=t.get("sizeFeatureAttribute").data[0];Number.isNaN(i)?l*=this.parameters.vvSize.fallback[0]:l*=e(this.parameters.vvSize.offset[0]+i*this.parameters.vvSize.factor[0],this.parameters.vvSize.minSize[0],this.parameters.vvSize.maxSize[0])}else o&&(l*=o.data[0]);const h=s[0],c=s[1],m=(l/2+4)*i;let p=Number.MAX_VALUE,u=0;const f=t.get("position").data,d=I(this.parameters,t)?f.length-2:f.length-5;for(let g=0;g<d;g+=3){const t=f[g],i=f[g+1],r=(g+3)%f.length,s=h-t,a=c-i,n=f[r]-t,o=f[r+1]-i,l=e((n*s+o*a)/(n*n+o*o),0,1),m=n*l-s,d=o*l-a,b=m*m+d*d;b<p&&(p=b,u=g/3)}p<m*m&&a(n.distance,n.normal,u)}intersect(i,r,u,f,d,g){const{options:b,camera:_,rayBegin:P,rayEnd:w}=u;if(!b.selectionMode||!i.visible||!_)return;if(!x(r))return void t.getLogger("esri.views.3d.webgl-engine.materials.RibbonLineMaterial").error("intersection assumes a translation-only matrix");const z=i.attributes,A=z.get("position").data;let C=this.parameters.width;if(this.parameters.vvSize){const t=z.get("sizeFeatureAttribute").data[0];Number.isNaN(t)||(C*=e(this.parameters.vvSize.offset[0]+t*this.parameters.vvSize.factor[0],this.parameters.vvSize.minSize[0],this.parameters.vvSize.maxSize[0]))}else z.has("size")&&(C*=z.get("size").data[0]);const O=tt;s(O,u.point);const L=C*_.pixelRatio/2+4*_.pixelRatio;a(mt[0],O[0]-L,O[1]+L,0),a(mt[1],O[0]+L,O[1]+L,0),a(mt[2],O[0]+L,O[1]-L,0),a(mt[3],O[0]-L,O[1]-L,0);for(let t=0;t<4;t++)if(!_.unprojectFromRenderScreen(mt[t],pt[t]))return;E(_.eye,pt[0],pt[1],ut),E(_.eye,pt[1],pt[2],ft),E(_.eye,pt[2],pt[3],dt),E(_.eye,pt[3],pt[0],gt);let M=Number.MAX_VALUE,V=0;const R=I(this.parameters,z)?A.length-2:A.length-5;for(let t=0;t<R;t+=3){K[0]=A[t]+r[12],K[1]=A[t+1]+r[13],K[2]=A[t+2]+r[14];const e=(t+3)%A.length;if(Q[0]=A[e]+r[12],Q[1]=A[e+1]+r[13],Q[2]=A[e+2]+r[14],y(ut,K)<0&&y(ut,Q)<0||y(ft,K)<0&&y(ft,Q)<0||y(dt,K)<0&&y(dt,Q)<0||y(gt,K)<0&&y(gt,Q)<0)continue;const i=_.projectToRenderScreen(K,et),s=_.projectToRenderScreen(Q,it);if(null==i||null==s)continue;if(i[2]<0&&s[2]>0){n(Z,K,Q);const t=_.frustum,e=-y(t[4],K)/o(Z,T(t[4]));if(l(Z,Z,e),h(K,K,Z),!_.projectToRenderScreen(K,i))continue}else if(i[2]>0&&s[2]<0){n(Z,Q,K);const t=_.frustum,e=-y(t[4],Q)/o(Z,T(t[4]));if(l(Z,Z,e),h(Q,Q,Z),!_.projectToRenderScreen(Q,s))continue}else if(i[2]<0&&s[2]<0)continue;i[2]=0,s[2]=0;const a=S(v(i,s,at),O);a<M&&(M=a,c(rt,K),c(st,Q),V=t/3)}if(M<L*L){let t=Number.MAX_VALUE;if(j(v(rt,st,at),v(P,w,nt),$)){n($,$,P);const e=m($);l($,$,1/e),t=e/p(P,w)}g(t,$,V)}}get hasEmissions(){return this.parameters.emissiveStrength>0}createBufferWriter(){return new X(U(this.parameters),this.parameters)}createGLMaterial(t){return new Y(t)}validateParameters(t){"miter"!==t.join&&(t.miterLimit=0),null!=t.markerParameters&&(t.markerScale=t.markerParameters.width/t.width)}update(t){return!!this.parameters.hasAnimation&&(this.setParameters({timeElapsed:r(t.time)},!1),0!==t.dt)}}class Y extends V{constructor(){super(...arguments),this._stipplePattern=null}dispose(){super.dispose(),this._stippleTextures?.release(this._stipplePattern),this._stipplePattern=null}beginSlot(t){const e=this._material.parameters.stipplePattern;return this._stipplePattern!==e&&(this._material.setParameters({stippleTexture:this._stippleTextures.swap(e,this._stipplePattern)}),this._stipplePattern=e),this.getTechnique(D,t)}}class q extends F{constructor(){super(...arguments),this.width=0,this.color=g,this.join="miter",this.cap=0,this.miterLimit=5,this.writeDepth=!0,this.hasPolygonOffset=!1,this.stippleTexture=null,this.stipplePreferContinuous=!0,this.markerParameters=null,this.markerScale=1,this.hasSlicePlane=!1,this.vvFastUpdate=!1,this.isClosed=!1,this.falloff=0,this.innerWidth=0,this.wireframe=!1,this.timeElapsed=0,this.animation=0,this.animationSpeed=1,this.trailLength=1,this.startTime=0,this.endTime=1/0,this.fadeInTime=0,this.fadeOutTime=1/0,this.emissiveStrength=0}get transparent(){return this.color[3]<1||this.hasAnimation||null!=this.stipplePattern&&(this.stippleOffColor?.[3]??0)<1}get hasAnimation(){return 0!==this.animation}}class X{constructor(t,e){this.layout=t,this._parameters=e;const i=e.stipplePattern?1:0;switch(this._parameters.join){case"miter":case"bevel":this.numJoinSubdivisions=i;break;case"round":this.numJoinSubdivisions=N+i}}_isClosed(t){return I(this._parameters,t)}allocate(t){return this.layout.createBuffer(t)}elementCount(t){const e=2,i=t.get("position").indices.length/2+1,r=this._isClosed(t);let s=r?2:2*e;return s+=((r?i:i-1)-(r?0:1))*(2*this.numJoinSubdivisions+4),s+=2,this._parameters.wireframe&&(s=2+4*(s-2)),s}write(t,e,i,r,s,n){const o=this.layout,l=i.get("position"),h=l.indices,m=l.data.length/3,f=i.get("distanceToStart")?.data;h&&h.length!==2*(m-1)&&console.warn("RibbonLineMaterial does not support indices");const g=o.fields.has("sizeFeatureAttribute");let b=1,S=null;if(g){const t=i.get("sizeFeatureAttribute");1===t.data.length?b=t.data[0]:S=t.data}else b=i.get("size")?.data[0]??1;let v=[1,1,1,1],P=0,j=null;const E=o.fields.has("colorFeatureAttribute");if(E){const t=i.get("colorFeatureAttribute");1===t.data.length?P=t.data[0]:j=t.data}else v=i.get("color")?.data??v;const w=i.get("timeStamps")?.data,y=w&&o.fields.has("timeStamps"),T=o.fields.has("opacityFeatureAttribute");let z=0,A=null;if(T){const t=i.get("opacityFeatureAttribute");1===t.data.length?z=t.data[0]:A=t.data}const C=new Float32Array(s.buffer),O=_(s.buffer),L=new Uint8Array(s.buffer),V=o.stride/4;let R=n*V;const x=R;let F=0;const N=f?(t,e,i)=>F=f[i]:(t,e,i)=>F+=p(t,e),U=C.BYTES_PER_ELEMENT/O.BYTES_PER_ELEMENT,D=4/U,B=M(),W=(t,e,i,s,a,n,o,l)=>{C[R++]=e[0],C[R++]=e[1],C[R++]=e[2],k(t,e,O,R*U),R+=D,k(i,e,O,R*U),R+=D,C[R++]=l;let h=R*U;if(O[h++]=a,O[h++]=n,R=Math.ceil(h/U),E)C[R]=j?.[o]??P;else{const t=Math.min(4*o,v.length-4),e=4*R;L[e]=255*v[t],L[e+1]=255*v[t+1],L[e+2]=255*v[t+2],L[e+3]=255*v[t+3]}if(R++,C[R++]=S?.[o]??b,T&&(C[R++]=A?.[o]??z),B){let t=4*R;r?(L[t++]=r[0],L[t++]=r[1],L[t++]=r[2],L[t++]=r[3]):(L[t++]=0,L[t++]=0,L[t++]=0,L[t++]=0),R=Math.ceil(.25*t)}y&&(h=R*U,O[h++]=s[0],O[h++]=s[1],O[h++]=s[2],O[h++]=s[3],R=Math.ceil(h/U))};R+=V,a(lt,l.data[0],l.data[1],l.data[2]),y&&d(ct,w[0],w[1],w[2],w[3]),t&&u(lt,lt,t);const J=this._isClosed(i);if(J){const e=l.data.length-3;a(ot,l.data[e],l.data[e+1],l.data[e+2]),t&&u(ot,ot,t)}else a(ht,l.data[3],l.data[4],l.data[5]),t&&u(ht,ht,t),W(lt,lt,ht,ct,1,-4,0,0),W(lt,lt,ht,ct,1,4,0,0),c(ot,lt),c(lt,ht),y&&d(ct,w[4],w[5],w[6],w[7]);const Y=J?0:1,q=J?m:m-1;for(let p=Y;p<q;p++){const e=(p+1)%m*3;a(ht,l.data[e],l.data[e+1],l.data[e+2]),t&&u(ht,ht,t),N(ot,lt,p),W(ot,lt,ht,ct,0,-1,p,F),W(ot,lt,ht,ct,0,1,p,F);const i=this.numJoinSubdivisions;for(let t=0;t<i;++t){const e=(t+1)/(i+1);W(ot,lt,ht,ct,e,-1,p,F),W(ot,lt,ht,ct,e,1,p,F)}if(W(ot,lt,ht,ct,1,-2,p,F),W(ot,lt,ht,ct,1,2,p,F),c(ot,lt),c(lt,ht),y){const t=(p+1)%m*4;d(ct,w[t],w[t+1],w[t+2],w[t+3])}}J?(a(ht,l.data[3],l.data[4],l.data[5]),t&&u(ht,ht,t),F=N(ot,lt,q),W(ot,lt,ht,ct,0,-1,Y,F),W(ot,lt,ht,ct,0,1,Y,F)):(F=N(ot,lt,q),W(ot,lt,lt,ct,0,-5,q,F),W(ot,lt,lt,ct,0,5,q,F)),G(C,x+V,C,x,V);return R=G(C,R-V,C,R,V),this._parameters.wireframe&&this._addWireframeVertices(s,x,R,V),null}_addWireframeVertices(t,e,i,r){const s=new Float32Array(t.buffer,i*Float32Array.BYTES_PER_ELEMENT),a=new Float32Array(t.buffer,e*Float32Array.BYTES_PER_ELEMENT,i-e);let n=0;const o=t=>n=G(a,t,s,n,r);for(let l=0;l<a.length-1;l+=2*r)o(l),o(l+2*r),o(l+1*r),o(l+2*r),o(l+1*r),o(l+3*r)}}function G(t,e,i,r,s){for(let a=0;a<s;a++)i[r++]=t[e++];return r}function I(t,e){if(!t.isClosed)return!1;return e.get("position").indices.length>2}function H(t){return 1===t.anchor&&t.hideOnShortSegments&&"begin-end"===t.placement&&t.worldSpace}const K=f(),Q=f(),Z=f(),$=f(),tt=f(),et=i(),it=i(),rt=f(),st=f(),at=P(),nt=P(),ot=f(),lt=f(),ht=f(),ct=b(),mt=[i(),i(),i(),i()],pt=[f(),f(),f(),f()],ut=w(),ft=w(),dt=w(),gt=w();export{q as Parameters,J as RibbonLineMaterial};
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{m as l}from"../../../../chunks/vec32.js";import{freeze as e,ZEROS as u}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";function n({normalTexture:e,metallicRoughnessTexture:n,metallicFactor:r,roughnessFactor:t,emissiveTexture:o,emissiveFactor:s,occlusionTexture:c}){return null==e&&null==n&&null==o&&(null==s||l(s,u))&&null==c&&(null==t||1===t)&&(null==r||1===r)}function r({normalTexture:e,metallicRoughnessTexture:n,metallicFactor:r,roughnessFactor:t,emissiveTexture:o,emissiveFactor:s,occlusionTexture:c}){return null==e&&null==n&&null==o&&(null==s||l(s,u))&&null==c&&(null==t||1===t)&&(null==r||1===r||0===r)}const t=e(1,1,.5),o=e(0,.6,.2),s=e(0,1,.2);export{t as advancedMRRFactors,s as esriSymbologyMRRFactors,o as schematicMRRFactors,n as useSchematicPBR,r as useSchematicPBRI3S};
5
+ import{m as e}from"../../../../chunks/vec32.js";import{freeze as l,ZEROS as r}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";function o({normalTexture:l,metallicRoughnessTexture:o,metallicFactor:t,roughnessFactor:u,emissiveTexture:n,emissiveFactor:s,occlusionTexture:c}){return null==l&&null==o&&null==n&&(null==s||e(s,r))&&null==c&&(null==u||1===u)&&(null==t||1===t)}const t=l(1,1,.5),u=l(0,.6,.2),n=l(0,1,.2);export{t as advancedMRRFactors,n as esriSymbologyMRRFactors,u as schematicMRRFactors,o as useSchematicPBR};
@@ -2,7 +2,7 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{smoothstep as e}from"../../../../core/mathUtils.js";import{E as r}from"../../../../chunks/vec32.js";import{fromValues as t}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{Float3BindUniform as a}from"../core/shaderModules/Float3BindUniform.js";import{Float4BindUniform as o}from"../core/shaderModules/Float4BindUniform.js";import{glsl as s}from"../core/shaderModules/glsl.js";import{SphereIntersect as n}from"./SphereIntersect.glsl.js";function i(i,h){i.fragment.uniforms.add(new o("heightParameters",a=>{const o=a.camera,s=r(o.eye),n=Math.sqrt(s),i=h.radius,l=s-i*i;let m=e(4e6,5e6,n-i);return m=Math.min(m,.98),t(m,l,0,0)}),new a("cameraPosition",e=>e.camera.eye)),i.fragment.include(n),i.fragment.code.add(s`float sphereFade() {return heightParameters[0];}
5
+ import{smoothstep as e}from"../../../../core/mathUtils.js";import{F as r}from"../../../../chunks/vec32.js";import{fromValues as t}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{Float3BindUniform as a}from"../core/shaderModules/Float3BindUniform.js";import{Float4BindUniform as o}from"../core/shaderModules/Float4BindUniform.js";import{glsl as s}from"../core/shaderModules/glsl.js";import{SphereIntersect as n}from"./SphereIntersect.glsl.js";function i(i,h){i.fragment.uniforms.add(new o("heightParameters",a=>{const o=a.camera,s=r(o.eye),n=Math.sqrt(s),i=h.radius,l=s-i*i;let m=e(4e6,5e6,n-i);return m=Math.min(m,.98),t(m,l,0,0)}),new a("cameraPosition",e=>e.camera.eye)),i.fragment.include(n),i.fragment.code.add(s`float sphereFade() {return heightParameters[0];}
6
6
  float sphereDepthInterpolate(vec3 worldRay, vec3 viewRay, float currentLinearDepth) {
7
7
  vec2 rayPlanetIntersect = sphereIntersect(cameraPosition, worldRay, heightParameters[1]);
8
8
  bool hitsPlanet = (rayPlanetIntersect.x <= rayPlanetIntersect.y) && rayPlanetIntersect.x > 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/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as t}from"tslib";import e from"../../../Graphic.js";import{createTask as i}from"../../../core/asyncUtils.js";import s from"../../../core/Collection.js";import o from"../../../core/Error.js";import{EventedAccessor as r}from"../../../core/Evented.js";import n from"../../../core/Logger.js";import{getOrCreateMapValue as a}from"../../../core/MapUtils.js";import{destroyMaybe as h,abortMaybe as p,assertIsSome as l}from"../../../core/maybe.js";import{pausable as c,when as d,watch as m,initial as u,sync as v}from"../../../core/reactiveUtils.js";import{property as y,subclass as _}from"../../../core/accessorSupport/decorators.js";import{UpdatingHandles as g}from"../../../core/support/UpdatingHandles.js";import f from"../../../geometry/Point.js";import b from"../../../geometry/Polyline.js";import{fromGeometry as G,toGeometry as x}from"../../../geometry/operators/support/apiConverter.js";import{closeRingsAndFixWinding as M,geometryToCoordinates as C}from"../../../geometry/support/coordsUtils.js";import{isPoint as S}from"../../../geometry/support/typeUtils.js";import{interpolateCircle as E}from"../../../geometry/support/curves/circleUtils.js";import{deriveCircleFromCircularArc as O,toEllipticArc7 as w}from"../../../geometry/support/curves/circularArcUtils.js";import{getEndpoint as I,isCircularArc as L,isEllipticArc4 as H,isBezierCurve as k,isCoordinate as V,isEllipticArc7 as P}from"../../../geometry/support/curves/curveUtils.js";import{deriveCircleFromEllipticArc4 as R}from"../../../geometry/support/curves/ellipticArc4Utils.js";import{wrapAtan2 as T}from"../../../geometry/support/curves/mathUtils.js";import A from"../../../layers/GraphicsLayer.js";import{SnappingVisualizer2D as U}from"../../2d/interactive/SnappingVisualizer2D.js";import{ConnectedReshapeManager as j}from"./ConnectedReshapeManager.js";import{screenDeltaToMapDelta as F,cloneMove as D}from"./drawUtils.js";import z from"./GraphicMover.js";import K from"./HighlightHelper.js";import{addUniqueLayer as N,isConnectedReshapeSupportedLayer as q}from"./layerUtils.js";import{createTooltipInfos as Z,connectTooltip as $,updateTranslateTooltipInfo as B,updateTranslateVertexTooltipInfo as J}from"./reshapeTooltipUtils.js";import{defaultSymbols as Q,createMidpointGraphics as W,createVertexGraphics as X,createCurveControlPointGraphics as Y,createCurveConstructionLineGraphics as tt,attributeKeys as et,getMidpoint as it,controlPointKinds as st,saveUpdatedCurveOrCoordinate as ot,toolIdAttribute as rt,splitCurve as nt,isSingleSegmentCircle as at,isSingleSegmentEllipse as ht}from"./reshapeUtils.js";import{ViewEventPriorities as pt}from"../../input/InputManager.js";import{createCoordinateHelper as lt}from"../../interactive/coordinateHelper.js";import{sketchKeys as ct}from"../../interactive/keybindings.js";import{EditGeometryOperations as dt}from"../../interactive/editGeometry/EditGeometryOperations.js";import mt from"../../interactive/sketch/SketchOptions.js";import{SnappingContext as ut}from"../../interactive/snapping/SnappingContext.js";import{makeTooltip as vt,enterInputModeIfAvailable as yt}from"../../interactive/tooltip/tooltipCommonUtils.js";const _t=Symbol(),gt={mode:"on-the-ground",offset:0};let ft=class extends r{constructor(t){super(t),this._updateHandlesOnExternalGeometryChange=null,this._activeOperationInfo=null,this._connectedReshapeManager=null,this._editGeometryOperations=null,this._segmentLabels=null,this._segmentLabelsImportTask=null,this._mover=null,this._snappingContext=null,this._snappingGraphicsLayer=null,this._hoverGraphic=null,this._snappingTask=null,this._stagedVertex=null,this._updatingHandles=new g,this.callbacks={onReshapeStart(){},onReshape(){},onReshapeStop(){},onMoveStart(){},onMove(){},onMoveStop(){},onGraphicClick(){}},this.connectedReshapeProviders=null,this.enableMidpoints=!0,this.enableCurveOnMidpoint=!1,this.enableMovement=!0,this.enableVertices=!0,this.graphic=null,this.highlightName=null,this.highlightsEnabled=!0,this.layer=null,this.snappingManager=null,this.symbols=Q,this.tooltip=null,this.activeTooltipInfo=null,this.sketchOptions=new mt,this.type="reshape",this.vertexGraphics=new s,this.curveControlPointGraphics=new s,this.constructionLineGraphics=new s,this.midpointGraphics=new s,this.selectedManipulators=new s,this.view=null}initialize(){const t=this.view;this._highlightHelper=new K({view:t}),this._setup(),this._updateHandlesOnExternalGeometryChange=c(()=>this.graphic?.geometry,t=>{if(!t)return;const e=new Set(this.selectedManipulators.map(It));this._highlightHelper.removeAll(),this._setUpHighlights(),this._setupGraphics(),this._clearSelection(),this.vertexGraphics.filter(t=>e.has(It(t))).forEach(t=>this._addToSelection(t));const{enableMovement:i,_mover:s,graphic:o,midpointGraphics:r,vertexGraphics:n,curveControlPointGraphics:a}=this,h=n.concat(r,a).toArray();i&&h.push(o),s?.set("graphics",h)},v),this.tooltip=vt(()=>({view:t,options:this.sketchOptions.tooltips})),this.tooltipInfos=Z(this.sketchOptions),this.addHandles([d(()=>t?.ready,()=>{const{layer:t,view:e}=this;N(e,t),this.addHandles(e.on("key-down",t=>this._keyDownHandler(t),pt.TOOL))},{once:!0,initial:!0}),m(()=>this.graphic,()=>this.refresh()),m(()=>this.layer,(t,e)=>{e&&(this._clearSelection(),this._resetGraphics(e)),this.refresh()}),m(()=>[this.highlightsEnabled,this.highlightName],()=>{this._highlightHelper?.removeAll(),this._setUpHighlights()}),m(()=>this.enableMidpoints,()=>this.refresh()),$(this.tooltip,()=>this._tooltipsContext),m(()=>this.sketchOptions.labels.enabled,t=>{this._segmentLabels?this._segmentLabels.visible=t:this._setUpGeometryHelper()}),m(()=>this.view.effectiveTheme.accentColor,()=>this._updateSymbolsForTheme(),u),this._updateHandlesOnExternalGeometryChange]),this._updateTooltip()}destroy(){this._reset(),this._mover=h(this._mover),this._connectedReshapeManager=h(this._connectedReshapeManager),this.tooltip=h(this.tooltip),this._segmentLabelsImportTask=p(this._segmentLabelsImportTask),this._segmentLabels=h(this._segmentLabels),this._updatingHandles=h(this._updatingHandles)}get _coordinateHelper(){return this._editGeometryOperations?.data.coordinateHelper??lt(!!this.graphic.geometry?.hasZ,!!this.graphic.geometry?.hasM,this.view.spatialReference)}get test(){return{segmentLabels:this._segmentLabels}}get _selectedManipulator(){return 1===this.selectedManipulators.length?this.selectedManipulators.at(0):void 0}get _tooltipsContext(){const{automaticAreaMeasurementUtils:t,automaticLengthMeasurementUtils:e,sketchOptions:i,activeTooltipInfo:s,graphic:o}=this;return{sketchOptions:i,activeTooltipInfo:s,graphic:o,selectedVertex:this._selectedManipulator,automaticAreaMeasurementUtils:t,automaticLengthMeasurementUtils:e,updateGeometry:(t,e,i,s,o)=>{this._setUpGeometryHelper();const r=t===this.graphic;r?this._emitMoveStartEvent(0,0):this._emitReshapeStartEvent(t);const n=!0;if(this._syncGeometryAfterVertexMove(t,e,s,o,n),r){const{view:t}=this,s=t.toScreen(i),o=t.toScreen(e),r=(o?.x??0)-(s?.x??0),n=(o?.y??0)-(s?.y??0);this._emitMoveEvent(r,n),this._emitMoveStopEvent(r,n)}else this._emitReshapeEvent(t),this._emitReshapeStopEvent(t)}}}get state(){const t=this.view.ready,e=!(!this.graphic||!this.layer);return t&&e?"active":t?"ready":"disabled"}get updating(){return this._updatingHandles.updating}isUIGraphic(t){return t===this.graphic||this._isMidpoint(t)||this._isCurveControlPoint(t)||this._isVertex(t)||this._isConstructionLine(t)}refresh(){this._reset(),this._setup()}reset(){this.graphic=null}clearSelection(){this._clearSelection()}removeSelectedVertices(){const{selectedManipulators:t}=this;t.length&&this._removeVertices(t)}_setup(){const{graphic:t,layer:e}=this;if(!e||null==t?.geometry)return;const i=t.geometry;"mesh"!==i.type&&"extent"!==i.type?("polygon"===i.type&&M(i),this._setUpHighlights(),this._setupGraphics(),this._setupMover(),this._setupConnectedReshapeManager(),this._setUpGeometryHelper()):this._logGeometryTypeError()}_setUpHighlights(){this.highlightsEnabled&&this.graphic&&this._highlightHelper?.add(this.graphic,this.highlightName)}_setUpGeometryHelper(){const t=this.graphic.geometry;if(null==t||"mesh"===t.type||"extent"===t.type)return this._segmentLabels=h(this._segmentLabels),void this._logGeometryTypeError();this._editGeometryOperations?this._syncEditGeometryOperations(t):this._editGeometryOperations=dt.fromGeometry(t,2,{allowCurves:!0}),this._updatingHandles.addPromise(this._setupSegmentLabels())}_saveSnappingContextForHandle(t,e){this._snappingGraphicsLayer=new A({listMode:"hide",internal:!0,title:"Reshape snapping layer"}),this.view.map.layers.add(this._snappingGraphicsLayer);const i=this._editGeometryOperations;l(i),this._snappingContext=new ut({editGeometryOperations:i,elevationInfo:gt,pointer:e.viewEvent?.pointerType||"mouse",excludeFeature:this.graphic,feature:this.graphic,visualizer:new U(this._snappingGraphicsLayer),vertexHandle:this._getVertexFromEditGeometry(t)})}_reset(){this._clearSelection(),this._highlightHelper?.removeAll(),this._updateTooltip(),this._resetGraphics(),this._resetSnappingStateVars(),this._segmentLabelsImportTask=p(this._segmentLabelsImportTask),this._segmentLabels=h(this._segmentLabels),this._activeOperationInfo=null,this._mover=h(this._mover),this.removeHandles(_t)}_resetSnappingStateVars(){null!=this.snappingManager&&this.snappingManager.doneSnapping(),null!=this._snappingGraphicsLayer&&(this.view?.map&&this.view.map.layers.remove(this._snappingGraphicsLayer),this._snappingGraphicsLayer.destroy()),this._snappingTask=p(this._snappingTask),this._snappingTask=null,this._snappingContext=null,this._stagedVertex=null}_resetGraphics(t){this._removeMidpointGraphics(t),this._removeVertexGraphics(t),this._removeCurveGraphics(t),this._updateTooltip()}_removeMidpointGraphics(t=this.layer){const{midpointGraphics:e}=this;t?.removeMany(e.items),e.drain(h)}_removeVertexGraphics(t=this.layer){const{vertexGraphics:e}=this;t?.removeMany(e.items),e.drain(h)}_removeCurveGraphics(t=this.layer){const{curveControlPointGraphics:e,constructionLineGraphics:i}=this;t?.removeMany(e.items),t?.removeMany(i.items),e.drain(h),i.drain(h)}_setupGraphics(){const t=this.graphic.geometry;if(null!=t&&("polyline"===t.type||"polygon"===t.type||"multipoint"===t.type)){const e=bt(t);this.enableMidpoints&&"multipoint"!==t.type&&this._setUpMidpointGraphics(e),this.enableVertices&&(this._setUpVertexGraphics(e),this._setupCurveGraphics(e))}}_setUpMidpointGraphics(t){this._removeMidpointGraphics();const e=W(t,this.symbols,this._coordinateHelper,"polygon"===this.graphic.geometry?.type);this.midpointGraphics.addMany(e),this.layer.addMany(e)}_setUpVertexGraphics(t){this._removeVertexGraphics();const e=X(t,this.symbols,this._coordinateHelper);this.vertexGraphics.addMany(e),this._storeRelatedVertexIndices(),this.layer.addMany(e)}_setupCurveGraphics(t){this._removeCurveGraphics();const e=Y(t,this.symbols,this._coordinateHelper),i=tt(t,this.symbols,this._coordinateHelper);this.curveControlPointGraphics.addMany(e),this.constructionLineGraphics.addMany(i),this.layer.addMany(i),this.layer.addMany(e)}async _setupSegmentLabels(){const t=this._editGeometryOperations,e=this.sketchOptions.labels.enabled;if(t&&this._segmentLabels?.context?.editGeometryOperations===t&&e||(this._segmentLabels=h(this._segmentLabels)),!this._segmentLabels&&t&&e){const e=this._segmentLabelsImportTask??=i(async t=>{const e=import("../../2d/interactive/SegmentLabels2D.js"),{SegmentLabels2D:i}=await this._updatingHandles.addPromise(e);return t.aborted?null:i}),s=await e.promise;if(!s)return;this._segmentLabels=h(this._segmentLabels),this._segmentLabels=new s({context:{view:this.view,editGeometryOperations:t,elevationInfo:gt,labelOptions:this.sketchOptions.labels,automaticLengthMeasurementUtils:this.automaticLengthMeasurementUtils},visible:!0})}}_updateSymbolsForTheme(){const t=this.view.effectiveTheme.accentColor;this.symbols={vertices:{...this.symbols.vertices,default:this.symbols.vertices.default.clone().set("color",t),hover:this.symbols.vertices.hover?.clone().set("color",t)},controlPoints:{...this.symbols.controlPoints,default:this.symbols.controlPoints.default.clone().set("color",t),hover:this.symbols.controlPoints.hover?.clone().set("color",t)},midpoints:{...this.symbols.midpoints},constructionLines:this.symbols.constructionLines.clone().set("color",t)};for(const e of this.vertexGraphics)this._isSelected(e)?e.symbol=this.symbols.vertices.selected:this._hoverGraphic===e?e.symbol=this.symbols.vertices.hover:e.symbol=this.symbols.vertices.default;for(const e of this.curveControlPointGraphics)this._isSelected(e)?e.symbol=this.symbols.controlPoints.selected:this._hoverGraphic===e?e.symbol=this.symbols.controlPoints.hover:e.symbol=this.symbols.controlPoints.default;for(const e of this.constructionLineGraphics)e.symbol=this.symbols.constructionLines}_storeRelatedVertexIndices(){const t=this.vertexGraphics.items;if(!t)return;const e=t.map(({geometry:t})=>({x:t.x,y:t.y}));for(let i=0;i<e.length;i++){const s=[];for(let t=0;t<e.length;t++){if(i===t)continue;const o=e[i],r=e[t];o.x===r.x&&o.y===r.y&&s.push(t)}t[i].attributes[et.relatedGraphicIndices]=s}}_setupMover(){const{enableMovement:t,graphic:e,midpointGraphics:i,vertexGraphics:s,view:o}=this,r=s.concat(i,this.curveControlPointGraphics).toArray();t&&"multipoint"!==e.geometry?.type&&r.push(e),this._mover=new z({enableMoveAllGraphics:!1,highlightsEnabled:!1,indicatorsEnabled:!1,graphics:r,view:o,callbacks:{onGraphicClick:t=>this._onGraphicClickCallback(t),onGraphicMoveStart:t=>this._onGraphicMoveStartCallback(t),onGraphicMove:t=>this._onGraphicMoveCallback(t),onGraphicMoveStop:t=>this._onGraphicMoveStopCallback(t),onGraphicPointerOver:t=>this._onGraphicPointerOverCallback(t),onGraphicPointerOut:t=>this._onGraphicPointerOutCallback(t)}})}_setupConnectedReshapeManager(){const{connectedReshapeProviders:t}=this;null!=t&&0!==t.length&&(this._connectedReshapeManager=new j({providerFactories:t,view:this.view}))}_onGraphicClickCallback(t){t.viewEvent.stopPropagation();const e=t.graphic,i=this._isCurveControlPoint(e);if(e===this.graphic)this.clearSelection(),this.emit("graphic-click",t),this.callbacks.onGraphicClick?.(t);else if(this._isMidpoint(e)){if(2===t.viewEvent.button)return;const i=this.graphic.clone(),s=this._handleMidpointClickOrStartMove(t);this.refresh(),s.length&&this._emitVertexAddEvent([e],i,s)}else if(this._isVertex(e)||i){if(t.viewEvent.stopPropagation(),2===t.viewEvent.button)return void(i||this._removeVertices(e));t.viewEvent.native.shiftKey||this._clearSelection(),this.selectedManipulators.includes(e)?this._removeFromSelection(e,!0):this._addToSelection(e)}}_setUpOperation(t){const{graphic:e,dx:i,dy:s}=t,o=e===this.graphic;this._resetSnappingStateVars(),this._setUpGeometryHelper(),this._saveSnappingContextForHandle(e,t),this._activeOperationInfo={target:this.graphic,mover:e,operationType:o?"move":"reshape",totalDx:i,totalDy:s}}_onGraphicMoveStartCallback(t){const{dx:e,dy:i,graphic:s}=t,o=this._connectedReshapeManager,r=o?Ht(this.graphic):null;if(s===this.graphic){const{geometry:n}=s;return this._setUpOperation(t),this._emitMoveStartEvent(e,i),r&&o?.startFeatureMove([r]),void(null!=n&&"point"===n.type&&this._onHandleMove(s,e,i,t,()=>{this._updateTooltip(this.graphic,t.viewEvent),this._emitMoveEvent(e,i)}))}const{selectedManipulators:n}=this;if(!n.includes(s)){if(this._clearSelection(),this._isMidpoint(s)){const e=this.graphic.clone(),i=this._handleMidpointClickOrStartMove(t);i.length&&(this._emitVertexAddEvent([s],e,i),this._refreshGraphicIndicesAttributes(i[0]))}this._addToSelection(s)}if(this._setUpOperation(t),r){const t=n.filter(t=>this._isVertex(t));o?.startVertexMove(r,kt(t))}this._emitReshapeStartEvent(s),this._onHandleMove(s,e,i,t,()=>{this._updateTooltip(s,t.viewEvent),this._emitReshapeEvent(s)})}_onGraphicMoveCallback(t){const e=this._activeOperationInfo;if(!e)return;const{dx:i,dy:s,graphic:o}=t;e.totalDx+=i,e.totalDy+=s;const{operationType:r}=e,{geometry:n}=o;if(null!=n)if("move"!==r)this._onHandleMove(o,i,s,t,()=>{this._updateTooltip(o,t.viewEvent),this._emitReshapeEvent(o)});else{if("point"===n.type)this._onHandleMove(o,i,s,t,()=>{this._updateTooltip(this.graphic,t.viewEvent),this._emitMoveEvent(i,s)});else if("polyline"===n.type||"polygon"===n.type){const e=bt(n);this._updateVertexGraphicLocations(e);const{dxMap:o,dyMap:r}=F(i,s,this.view);this._connectedReshapeManager?.translate(o,r,0),this._updateTooltip(this.graphic,t.viewEvent),this._emitMoveEvent(i,s)}this._syncEditGeometryOperations(n)}}_onGraphicMoveStopCallback(t){const e=this._activeOperationInfo;if(!e)return;const{dx:i,dy:s,graphic:o}=t,{operationType:r}=e;e.totalDx+=i,e.totalDy+=s,this._onHandleMove(o,i,s,t,()=>"move"===r?this._emitMoveStopEvent():this._emitReshapeStopEvent(o)),this._isMidpoint(o)||o.getAttribute(et.curveFromStraightEdgeFlag)?this.refresh():(this._updateTooltip(this._isVertex(o)?o:null),this._resetSnappingStateVars(),this._connectedReshapeManager?.finish(),this._activeOperationInfo=null)}_updateVertexGraphicLocations(t){const{_coordinateHelper:e}=this;for(const i of this.vertexGraphics){const{pathIndex:s,pointIndex:o}=i.attributes;i.geometry=e.arrayToPoint(I(t[s][o]))}this._updateMidpointGraphicLocations(t),this._updateCurveGraphicLocations(t)}_updateMidpointGraphicLocations(t){const{_coordinateHelper:e}=this;for(const i of this.midpointGraphics){const{pathIndex:s,pointIndexStart:o,pointIndexEnd:r}=i.attributes,n=t[s];i.geometry=it(n[o],n[r],e)}}_updateCurveGraphicLocations(t){const{spatialReference:e}=this._coordinateHelper,i=new Map;for(const s of this.selectedManipulators){const[t,e]=wt(s);null!=t&&null!=e&&s.getAttribute(et.controlPointKind)&&a(i,t,()=>new Set)?.add(e)}for(const s of this.curveControlPointGraphics){const[e,o]=wt(s);if(i.get(e)?.has(o))continue;const r=t[e][o];if(L(r)||H(r)){const i=I(t[e][o-1]),n=L(r)?O(i,r):R(i,r),[a,h]=E(n,.25);s.geometry=new f({x:a,y:h,spatialReference:this._coordinateHelper.spatialReference})}else if(k(r)){const t=s.getAttribute(et.controlPointKind),[e,i]=t===st.bezier.cp1?r.b[1]:r.b[2];s.geometry=new f({x:e,y:i,spatialReference:this._coordinateHelper.spatialReference})}}for(const s of this.constructionLineGraphics){const i=s.getAttribute(et.controlPointKind),[o,r]=wt(s),n=t[o],a=I(n[r-1]),h=I(n[r]),p=t[o][r];i===st.bezier.line1?s.geometry=new b({paths:[[[a[0],a[1]],[...p.b[1]]]],spatialReference:e}):s.geometry=new b({paths:[[[h[0],h[1]],[...p.b[2]]]],spatialReference:e})}}_refreshGraphicIndicesAttributes(t){const{componentIndex:e,vertexIndex:i}=t,s=t=>{const[s,o]=wt(t);s===e&&o>=i&&t.setAttribute(et.pointIndex,o+1)};this.vertexGraphics.forEach(s),this.curveControlPointGraphics.forEach(s),this.constructionLineGraphics.forEach(s);for(const o of this.midpointGraphics){if(o.getAttribute(et.pathIndex)!==e)continue;const t=o.getAttribute(et.pointIndexStart);t>=i&&(o.setAttribute(et.pointIndexStart,t+1),o.setAttribute(et.pointIndexEnd,o.getAttribute(et.pointIndexEnd)+1))}}_getVertexFromEditGeometry(t){const[e,i]=wt(t);return l(this._editGeometryOperations),this._editGeometryOperations.data.parts[e].vertices[i]}_onHandleMove(t,e,s,o,r){p(this._snappingTask);const n=this._snappingContext;if(!n)return;const a=t.geometry,h="graphic-move-stop"===o.type;if(a&&S(a))if(null!=this.snappingManager&&this.selectedManipulators.length<2&&!h){const o=this.snappingManager;this._stagedVertex=o.update({point:a,context:n}),this._syncGeometryAfterVertexMove(t,new f(this._stagedVertex),e,s,h),r(),this._snappingTask=i(async i=>{const p=await o.snap({point:a,context:n,signal:i});p.valid&&(this._stagedVertex=p.apply(),this._syncGeometryAfterVertexMove(t,new f(this._stagedVertex),e,s,h),r())})}else{const i=null!=this._stagedVertex?new f(this._stagedVertex):a;this._syncGeometryAfterVertexMove(t,i,e,s,h),r()}else r()}_syncGeometryAfterVertexMove(t,e,i,s,o=!1){const r=this._editGeometryOperations?.data.geometry.clone();if(!r)return;const{_coordinateHelper:n}=this,a=n.pointToVector(e),h=this._getVertexFromEditGeometry(t);if(h){const t=n.getZ(a),e=a[0]-h.pos[0],i=a[1]-h.pos[1],s=null!=t?t-h.pos[2]:0;"point"!==r.type&&"mesh"!==r.type||this._editGeometryOperations?.moveVertices([h],e,i,s),this._connectedReshapeManager?.translate(e,i,s)}if("point"===r.type)t.geometry=e;else if("mesh"===r.type)t.geometry=r.centerAt(e);else{if(t!==this.graphic){const o=n.spatialReference,[a,h]=wt(t);let p=Gt(r);const l=n.pointToArray(e);this._updateGeometryFromGraphic(t,p,a,h,l,o,"polygon"===r.type),this._isVertex(t)||this._isCurveControlPoint(t)?(p=this._moveRelatedCoordinates(p,t,l),p=this._moveSelectedHandleCoordinates(p,t,i,s,"polygon"===r.type),this._updateMidpointGraphicLocations(p),this._updateCurveGraphicLocations(p)):this._isMidpoint(t)&&this._updateCurveGraphicLocations(p),ot(r,p)}this._updateGraphicGeometry(r),this._syncEditGeometryOperations(r),o&&(this._mover?this._mover.updateGeometry(this._mover.graphics.indexOf(t),e):t.geometry=e)}}_syncEditGeometryOperations(t){const e=this._editGeometryOperations?.trySetGeometry(t);e||(this._editGeometryOperations=null,this._setUpGeometryHelper())}_moveRelatedCoordinates(t,e,i){const{relatedGraphicIndices:s}=e.attributes,o=this._coordinateHelper.spatialReference;if(!s?.length)return t;for(const r of s){const s=this.vertexGraphics.at(r),[n,a]=wt(s);Ot(t,n,a,i,o),s.geometry=e.geometry}return t}_moveSelectedHandleCoordinates(t,e,i,s,o){const r=this._coordinateHelper.spatialReference;for(const n of this.selectedManipulators)if(n!==e){const[e,a]=wt(n),h=n.getAttribute(et.relatedGraphicIndices),p=D(n.geometry,i,s,this.view),l=C(p);if(n.geometry=p,this._updateGeometryFromGraphic(n,t,e,a,l,r,o),h?.length)for(const i of h){const e=this.vertexGraphics.at(i),[s,o]=wt(e);Ot(t,s,o,l,r),e.geometry=p}}return t}_updateGeometryFromGraphic(t,e,i,s,o,r,n){const a=e[i].length-1;this._isCurveControlPoint(t)?Mt(e,i,s,[o[0],o[1]],t.getAttribute(et.controlPointKind)):(Ot(e,i,s,o,r),n&&(0===s?Ot(e,i,a,o,r):s===a&&(e[i][0]=o)))}_onGraphicPointerOverCallback(t){const e=t.graphic;this._hoverGraphic=e;const i=this._isVertex(e);i&&!this._isSelected(e)?e.symbol=this.symbols.vertices.hover:this._isCurveControlPoint(e)&&!this._isSelected(e)&&(e.symbol=this.symbols.controlPoints.hover),this._updateTooltip(i?e:null),this._updateHoverCursor(e)}_onGraphicPointerOutCallback(t){const e=t.graphic;this._hoverGraphic=null,this._isVertex(e)&&!this._isSelected(e)&&(e.symbol=this.symbols.vertices.default),this._isCurveControlPoint(e)&&!this._isSelected(e)&&(e.symbol=this.symbols.controlPoints.default),this.removeHandles(_t),this._updateTooltip()}_handleMidpointClickOrStartMove(t){const{graphic:e}=t,i=this.graphic.geometry;if(null==i||"polygon"!==i.type&&"polyline"!==i.type)return[];const s=i.clone(),o=[],{[et.pathIndex]:r,[et.pointIndexStart]:n,[et.pointIndexEnd]:a}=e.attributes,h=C(e.geometry),p=0===a?n+1:a;e.attributes={[et.tool]:rt,[et.pathIndex]:r,[et.pointIndex]:p,[et.relatedGraphicIndices]:[]};const l=Gt(s),c=l[r][a];if(V(c)){if(this.enableCurveOnMidpoint&&t.viewEvent.native.shiftKey){const t=I(l[r][p]);l[r].splice(p,1,{c:[t,[h[0],h[1]]]}),e.setAttribute(et.controlPointKind,st.circle.interior),e.setAttribute(et.curveFromStraightEdgeFlag,!0),this.midpointGraphics.remove(e),this.curveControlPointGraphics.push(e),ot(s,l)}else l[r].splice(p,0,h),o.push({coordinates:l[r][p],componentIndex:r,vertexIndex:p})}else{const t=I(l[r][n]),e=nt(t,c,.5,this._coordinateHelper);l[r].splice(a,1,...e),o.push({coordinates:I(l[r][p]),componentIndex:r,vertexIndex:p})}return this._updateGraphicGeometry(s),this._syncEditGeometryOperations(s),o}_addToSelection(t){const e=Lt(t);for(const i of e)this._isCurveControlPoint(i)?i.symbol=this.symbols.controlPoints.selected:i.symbol=this.symbols.vertices.selected,this.selectedManipulators.add(i),this._updateTooltip(i);this._emitSelectEvent(e)}_removeFromSelection(t,e){if(this._isVertex(t)){const{vertices:i}=this.symbols;t.symbol=e?i.hover:i.default}else if(this._isCurveControlPoint(t)){const{controlPoints:i}=this.symbols;t.symbol=e?i.hover:i.default}this.selectedManipulators.remove(t),this._emitDeselectEvent([t]),this._updateTooltip()}_clearSelection(){const t=this.selectedManipulators.toArray(),{controlPoints:e,vertices:i}=this.symbols;if(t.length>0){for(const s of t)this._isVertex(s)?s.symbol=i.default:this._isCurveControlPoint(s)&&(s.symbol=e.default);this.selectedManipulators.removeAll(),this._emitDeselectEvent(t),this._updateTooltip()}}_keyDownHandler(t){null==this._activeOperationInfo&&yt(t,this.tooltip)||ct.delete.includes(t.key)&&!t.repeat&&this.selectedManipulators.length&&(this._removeVertices(this.selectedManipulators),t.stopPropagation())}_removeVertices(t){const e=this.graphic.geometry,i=this.vertexGraphics.length;if(null==e||"polygon"!==e.type&&"polyline"!==e.type&&"multipoint"!==e.type)return;if("polygon"===e.type&&i<4||"multipoint"===e.type&&i<2||"polyline"===e.type&&i<3)return;const s=this.graphic.clone(),o=e.clone();let r=Gt(o);const n=[],a=Lt(t);for(const h of a){if(this._isCurveControlPoint(h))continue;const{x:t,y:e}=h.geometry;for(let i=0;i<r.length;i++){const s=r[i];for(let o=0;o<s.length;o++){const[a,h]=I(s[o]);if(t===a&&e===h){n.push({coordinates:I(r[i][o]),componentIndex:i,vertexIndex:o}),r[i].splice(Number(o),1);const t=r[i][o];t&&!V(t)&&(r[i][o]=I(t))}}}}if("polygon"===o.type)r=r.filter(t=>{if(t.length<2)return!1;const[e,i]=I(t[0]),[s,o]=I(t[t.length-1]);return(2!==t.length||e!==s||i!==o)&&(e===s&&i===o||t.push(t[0]),!0)});else if("polyline"===o.type)for(const h of r)1===h.length&&r.splice(r.indexOf(h),1);ot(o,r),this._updateGraphicGeometry(o),this.refresh(),this._emitVertexRemoveEvent(a,s,n)}_isVertex(t){return this.vertexGraphics.includes(t)}_isCurveControlPoint(t){return this.curveControlPointGraphics.includes(t)}_isConstructionLine(t){return this.constructionLineGraphics.includes(t)}_isSelected(t){return(this._isVertex(t)||this.curveControlPointGraphics.includes(t))&&this.selectedManipulators.includes(t)}_isMidpoint(t){return this.midpointGraphics.includes(t)}_updateHoverCursor(t){const e=this._isMidpoint(t)?"copy":"move";this.addHandles(this.view.acquireCursor(e,"high"),_t)}_updateTooltip(t,e){let i=null;const{graphic:s,view:o,tooltipInfos:r}=this,n=s?.geometry;"point"===n?.type?i=r.movePoint:this._selectedManipulator?i=r.selectedVertex:t===this.graphic?(i=r.translateGraphic,B(i,o,this._tooltipsContext,e)):t&&this.selectedManipulators.length>1&&(i=r.translateVertices,J(i,o,n,this._tooltipsContext,e)),this.activeTooltipInfo=i}_updateGraphicGeometry(t){this._updateHandlesOnExternalGeometryChange?.pause(),this.graphic.geometry=t,this._updateHandlesOnExternalGeometryChange?.resume()}_emitMoveStartEvent(t,e){const i={type:"move-start",mover:this.graphic,dx:t,dy:e};this.emit("move-start",i),this.callbacks.onMoveStart?.(i)}_emitMoveEvent(t,e){const i={type:"move",mover:this.graphic,dx:t,dy:e};this.emit("move",i),this.callbacks.onMove?.(i)}_emitMoveStopEvent(t,e){if(null==t||null==e){const i=this._activeOperationInfo;if(!i)return;t=i.totalDx,e=i.totalDy}const i={type:"move-stop",mover:this.graphic,dx:t,dy:e};this.emit("move-stop",i),this.callbacks.onMoveStop?.(i)}_emitReshapeStartEvent(t){const e={type:"reshape-start",graphic:this.graphic,mover:t,selected:this.selectedManipulators.toArray()};this.emit("reshape-start",e),this.callbacks.onReshapeStart?.(e)}_emitReshapeEvent(t){const e={type:"reshape",graphic:this.graphic,mover:t,selected:this.selectedManipulators.toArray()};this.emit("reshape",e),this.callbacks.onReshape?.(e)}_emitReshapeStopEvent(t){const e={type:"reshape-stop",graphic:this.graphic,mover:t,selected:this.selectedManipulators.toArray()};this.emit("reshape-stop",e),this.callbacks.onReshapeStop?.(e)}_emitSelectEvent(t){const e={type:"vertex-select",added:t};this.emit("select",e),this.callbacks.onVertexSelect?.(e)}_emitDeselectEvent(t){const e={type:"vertex-deselect",removed:t};this.emit("deselect",e),this.callbacks.onVertexDeselect?.(e)}_emitVertexAddEvent(t,e,i){const s={type:"vertex-add",added:t,graphic:this.graphic,oldGraphic:e,vertices:i};this.emit("vertex-add",s),this.callbacks.onVertexAdd?.(s)}_emitVertexRemoveEvent(t,e,i){const s={type:"vertex-remove",removed:t,graphic:this.graphic,oldGraphic:e,vertices:i};this.emit("vertex-remove",s),this.callbacks.onVertexRemove?.(s)}_logGeometryTypeError(){n.getLogger(this).error(new o("reshape:invalid-geometry","Reshape operation not supported for the provided graphic. The geometry type is not supported."))}};function bt(t){const e=Gt(t.clone());if("polygon"===t.type)for(const i of e){const t=i[i.length-1];if(!V(t))continue;const e=i[0];e[0]===t[0]&&e[1]===t[1]&&i.length>2&&i.pop()}return e}function Gt(t){return"polygon"===t.type?t.curveRings?.slice()??t.rings.slice():"polyline"===t.type?t.curvePaths?.slice()??t.paths.slice():t.points.map(t=>[t])}function xt(t,e,i,s){const o=t[e][i];if(L(o))o.c[1]=s;else if(H(o)){const o=I(t[e][i]);t[e][i]={c:[o,s]}}}function Mt(t,e,i,s,o){switch(o){case st.circle.interior:xt(t,e,i,s);break;case st.bezier.cp1:t[e][i].b[1]=s;break;case st.bezier.cp2:t[e][i].b[2]=s}}function Ct(t,e){return t<1e-8*e}function St(t,{cx:e,cy:i,isInvalid:s,thetaStart:o,thetaEnd:r},n,a){const[h,p]=t,[l,c]=n,d=l-h,m=c-p;e-=h,i-=p;const u=a?o>r:o<r,[v,y]=s?[e,i]:u?[-i,e]:[i,-e],[_,g]=[d,m],[f,b]=[v,y],G=_*b-g*f,x=(d**2+m**2)/2;if(Ct(Math.abs(G),x))return[(h+l)/2,(p+c)/2];const[M,C]=[b/G*x,-f/G*x],S=M**2+C**2,[E,O]=[d/2-M,m/2-C];if(Ct(E**2+O**2,S)){const[t,e]=u?[-C,M]:[C,-M];return[t+M+h,e+C+p]}const w=Math.sqrt((M**2+C**2)/(E**2+O**2))*Math.sign(d*v+m*y);return[E*w+M+h,O*w+C+p]}function Et(t,e,i){const s=G(new b({curvePaths:[[t,e]],spatialReference:i})),{curvePaths:o}=x(s,i),r=o[0][1];return P(r)?r:w(t,r)}function Ot(t,e,i,s,o){const r=t[e][i],n=t[e].at(i+1);if(at(t,e)){const i=t[e][1];return t[e][0]=[...s],void(t[e][1]={a:[[...s],[...i.a[1]],0,0]})}if(ht(t,e)){const i=t[e][1],[o,r]=i.a[1],[n,a]=s,h=Math.hypot(n-o,a-r),[p,l]=[n-o,a-r],c=T(l,p);return t[e][0]=[...s],void(t[e][1]={a:[[...s],[...i.a[1]],0,0,c,h,i.a[6]]})}const a=I(r);if(V(r))r.splice(0,r.length,...s);else if(k(r))r.b[0].splice(0,r.b[0].length,...s);else if(L(r)||H(r)){const o=I(t[e][i-1]),n=L(r)?O(o,r):R(o,r);t[e].splice(i,1,{c:[[...s],St(o,n,s,!0)]})}else if(P(r)){r.a[0].splice(0,r.a[0].length,...s);const n=I(t[e][i-1]);r.a=Et(n,r,o).a}if(n&&!V(n)&&!k(r))if(L(n)||H(n)){const o=I(n),r=L(n)?O(a,n):R(a,n);t[e].splice(i+1,1,{c:[o,St(o,r,s,!1)]})}else if(P(n)){const t=I(r);n.a=Et(t,n,o).a}}function wt({attributes:t}){return[t?.[et.pathIndex]||0,t?.[et.pointIndex]||0]}function It({attributes:t}){return`${t?.[et.pathIndex]}-${t?.[et.pointIndex]}`}function Lt(t){return t instanceof e?[t]:[...t]}function Ht(t){const e=t.sourceLayer??t.layer;return q(e)?{graphic:t,layer:e}:null}function kt(t){return t.toArray().map(({attributes:t})=>({pathIndex:t[et.pathIndex],vertexIndex:t[et.pointIndex]}))}t([y()],ft.prototype,"_activeOperationInfo",void 0),t([y()],ft.prototype,"_connectedReshapeManager",void 0),t([y()],ft.prototype,"_coordinateHelper",null),t([y()],ft.prototype,"_editGeometryOperations",void 0),t([y()],ft.prototype,"_segmentLabels",void 0),t([y()],ft.prototype,"test",null),t([y()],ft.prototype,"_segmentLabelsImportTask",void 0),t([y()],ft.prototype,"_updatingHandles",void 0),t([y()],ft.prototype,"_selectedManipulator",null),t([y()],ft.prototype,"_tooltipsContext",null),t([y()],ft.prototype,"callbacks",void 0),t([y()],ft.prototype,"connectedReshapeProviders",void 0),t([y()],ft.prototype,"enableMidpoints",void 0),t([y()],ft.prototype,"enableCurveOnMidpoint",void 0),t([y()],ft.prototype,"enableMovement",void 0),t([y()],ft.prototype,"enableVertices",void 0),t([y()],ft.prototype,"graphic",void 0),t([y()],ft.prototype,"highlightName",void 0),t([y()],ft.prototype,"highlightsEnabled",void 0),t([y()],ft.prototype,"layer",void 0),t([y()],ft.prototype,"snappingManager",void 0),t([y({readOnly:!0})],ft.prototype,"state",null),t([y()],ft.prototype,"symbols",void 0),t([y()],ft.prototype,"tooltip",void 0),t([y()],ft.prototype,"tooltipInfos",void 0),t([y()],ft.prototype,"activeTooltipInfo",void 0),t([y({constructOnly:!0})],ft.prototype,"automaticAreaMeasurementUtils",void 0),t([y({constructOnly:!0})],ft.prototype,"automaticLengthMeasurementUtils",void 0),t([y()],ft.prototype,"updating",null),t([y({type:mt})],ft.prototype,"sketchOptions",void 0),t([y({readOnly:!0})],ft.prototype,"type",void 0),t([y({readOnly:!0})],ft.prototype,"vertexGraphics",void 0),t([y({readOnly:!0})],ft.prototype,"curveControlPointGraphics",void 0),t([y({readOnly:!0})],ft.prototype,"constructionLineGraphics",void 0),t([y({readOnly:!0})],ft.prototype,"midpointGraphics",void 0),t([y({readOnly:!0})],ft.prototype,"selectedManipulators",void 0),t([y()],ft.prototype,"view",void 0),ft=t([_("esri.views.draw.support.Reshape")],ft);const Vt=ft;export{Vt as default};
5
+ import{__decorate as t}from"tslib";import e from"../../../Graphic.js";import{createTask as i}from"../../../core/asyncUtils.js";import s from"../../../core/Collection.js";import o from"../../../core/Error.js";import{EventedAccessor as r}from"../../../core/Evented.js";import n from"../../../core/Logger.js";import{getOrCreateMapValue as a}from"../../../core/MapUtils.js";import{destroyMaybe as h,abortMaybe as p,assertIsSome as l}from"../../../core/maybe.js";import{pausable as c,when as d,watch as m,initial as u,sync as v}from"../../../core/reactiveUtils.js";import{property as y,subclass as _}from"../../../core/accessorSupport/decorators.js";import{UpdatingHandles as g}from"../../../core/support/UpdatingHandles.js";import f from"../../../geometry/Point.js";import b from"../../../geometry/Polyline.js";import{fromPolylineUsingImportOperator as G,toGeometry as x}from"../../../geometry/operators/support/apiConverter.js";import{closeRingsAndFixWinding as M,geometryToCoordinates as C}from"../../../geometry/support/coordsUtils.js";import{isPoint as S}from"../../../geometry/support/typeUtils.js";import{interpolateCircle as E}from"../../../geometry/support/curves/circleUtils.js";import{deriveCircleFromCircularArc as O,toEllipticArc7 as w}from"../../../geometry/support/curves/circularArcUtils.js";import{getEndpoint as I,isCircularArc as L,isEllipticArc4 as H,isBezierCurve as k,isCoordinate as V,isEllipticArc7 as P}from"../../../geometry/support/curves/curveUtils.js";import{deriveCircleFromEllipticArc4 as R}from"../../../geometry/support/curves/ellipticArc4Utils.js";import{wrapAtan2 as T}from"../../../geometry/support/curves/mathUtils.js";import A from"../../../layers/GraphicsLayer.js";import{SnappingVisualizer2D as U}from"../../2d/interactive/SnappingVisualizer2D.js";import{ConnectedReshapeManager as j}from"./ConnectedReshapeManager.js";import{screenDeltaToMapDelta as F,cloneMove as D}from"./drawUtils.js";import z from"./GraphicMover.js";import K from"./HighlightHelper.js";import{addUniqueLayer as N,isConnectedReshapeSupportedLayer as q}from"./layerUtils.js";import{createTooltipInfos as Z,connectTooltip as $,updateTranslateTooltipInfo as B,updateTranslateVertexTooltipInfo as J}from"./reshapeTooltipUtils.js";import{defaultSymbols as Q,createMidpointGraphics as W,createVertexGraphics as X,createCurveControlPointGraphics as Y,createCurveConstructionLineGraphics as tt,attributeKeys as et,getMidpoint as it,controlPointKinds as st,saveUpdatedCurveOrCoordinate as ot,toolIdAttribute as rt,splitCurve as nt,isSingleSegmentCircle as at,isSingleSegmentEllipse as ht}from"./reshapeUtils.js";import{ViewEventPriorities as pt}from"../../input/InputManager.js";import{createCoordinateHelper as lt}from"../../interactive/coordinateHelper.js";import{sketchKeys as ct}from"../../interactive/keybindings.js";import{EditGeometryOperations as dt}from"../../interactive/editGeometry/EditGeometryOperations.js";import mt from"../../interactive/sketch/SketchOptions.js";import{SnappingContext as ut}from"../../interactive/snapping/SnappingContext.js";import{makeTooltip as vt,enterInputModeIfAvailable as yt}from"../../interactive/tooltip/tooltipCommonUtils.js";const _t=Symbol(),gt={mode:"on-the-ground",offset:0};let ft=class extends r{constructor(t){super(t),this._updateHandlesOnExternalGeometryChange=null,this._activeOperationInfo=null,this._connectedReshapeManager=null,this._editGeometryOperations=null,this._segmentLabels=null,this._segmentLabelsImportTask=null,this._mover=null,this._snappingContext=null,this._snappingGraphicsLayer=null,this._hoverGraphic=null,this._snappingTask=null,this._stagedVertex=null,this._updatingHandles=new g,this.callbacks={onReshapeStart(){},onReshape(){},onReshapeStop(){},onMoveStart(){},onMove(){},onMoveStop(){},onGraphicClick(){}},this.connectedReshapeProviders=null,this.enableMidpoints=!0,this.enableCurveOnMidpoint=!1,this.enableMovement=!0,this.enableVertices=!0,this.graphic=null,this.highlightName=null,this.highlightsEnabled=!0,this.layer=null,this.snappingManager=null,this.symbols=Q,this.tooltip=null,this.activeTooltipInfo=null,this.sketchOptions=new mt,this.type="reshape",this.vertexGraphics=new s,this.curveControlPointGraphics=new s,this.constructionLineGraphics=new s,this.midpointGraphics=new s,this.selectedManipulators=new s,this.view=null}initialize(){const t=this.view;this._highlightHelper=new K({view:t}),this._setup(),this._updateHandlesOnExternalGeometryChange=c(()=>this.graphic?.geometry,t=>{if(!t)return;const e=new Set(this.selectedManipulators.map(It));this._highlightHelper.removeAll(),this._setUpHighlights(),this._setupGraphics(),this._clearSelection(),this.vertexGraphics.filter(t=>e.has(It(t))).forEach(t=>this._addToSelection(t));const{enableMovement:i,_mover:s,graphic:o,midpointGraphics:r,vertexGraphics:n,curveControlPointGraphics:a}=this,h=n.concat(r,a).toArray();i&&h.push(o),s?.set("graphics",h)},v),this.tooltip=vt(()=>({view:t,options:this.sketchOptions.tooltips})),this.tooltipInfos=Z(this.sketchOptions),this.addHandles([d(()=>t?.ready,()=>{const{layer:t,view:e}=this;N(e,t),this.addHandles(e.on("key-down",t=>this._keyDownHandler(t),pt.TOOL))},{once:!0,initial:!0}),m(()=>this.graphic,()=>this.refresh()),m(()=>this.layer,(t,e)=>{e&&(this._clearSelection(),this._resetGraphics(e)),this.refresh()}),m(()=>[this.highlightsEnabled,this.highlightName],()=>{this._highlightHelper?.removeAll(),this._setUpHighlights()}),m(()=>this.enableMidpoints,()=>this.refresh()),$(this.tooltip,()=>this._tooltipsContext),m(()=>this.sketchOptions.labels.enabled,t=>{this._segmentLabels?this._segmentLabels.visible=t:this._setUpGeometryHelper()}),m(()=>this.view.effectiveTheme.accentColor,()=>this._updateSymbolsForTheme(),u),this._updateHandlesOnExternalGeometryChange]),this._updateTooltip()}destroy(){this._reset(),this._mover=h(this._mover),this._connectedReshapeManager=h(this._connectedReshapeManager),this.tooltip=h(this.tooltip),this._segmentLabelsImportTask=p(this._segmentLabelsImportTask),this._segmentLabels=h(this._segmentLabels),this._updatingHandles=h(this._updatingHandles)}get _coordinateHelper(){return this._editGeometryOperations?.data.coordinateHelper??lt(!!this.graphic.geometry?.hasZ,!!this.graphic.geometry?.hasM,this.view.spatialReference)}get test(){return{segmentLabels:this._segmentLabels}}get _selectedManipulator(){return 1===this.selectedManipulators.length?this.selectedManipulators.at(0):void 0}get _tooltipsContext(){const{automaticAreaMeasurementUtils:t,automaticLengthMeasurementUtils:e,sketchOptions:i,activeTooltipInfo:s,graphic:o}=this;return{sketchOptions:i,activeTooltipInfo:s,graphic:o,selectedVertex:this._selectedManipulator,automaticAreaMeasurementUtils:t,automaticLengthMeasurementUtils:e,updateGeometry:(t,e,i,s,o)=>{this._setUpGeometryHelper();const r=t===this.graphic;r?this._emitMoveStartEvent(0,0):this._emitReshapeStartEvent(t);const n=!0;if(this._syncGeometryAfterVertexMove(t,e,s,o,n),r){const{view:t}=this,s=t.toScreen(i),o=t.toScreen(e),r=(o?.x??0)-(s?.x??0),n=(o?.y??0)-(s?.y??0);this._emitMoveEvent(r,n),this._emitMoveStopEvent(r,n)}else this._emitReshapeEvent(t),this._emitReshapeStopEvent(t)}}}get state(){const t=this.view.ready,e=!(!this.graphic||!this.layer);return t&&e?"active":t?"ready":"disabled"}get updating(){return this._updatingHandles.updating}isUIGraphic(t){return t===this.graphic||this._isMidpoint(t)||this._isCurveControlPoint(t)||this._isVertex(t)||this._isConstructionLine(t)}refresh(){this._reset(),this._setup()}reset(){this.graphic=null}clearSelection(){this._clearSelection()}removeSelectedVertices(){const{selectedManipulators:t}=this;t.length&&this._removeVertices(t)}_setup(){const{graphic:t,layer:e}=this;if(!e||null==t?.geometry)return;const i=t.geometry;"mesh"!==i.type&&"extent"!==i.type?("polygon"===i.type&&M(i),this._setUpHighlights(),this._setupGraphics(),this._setupMover(),this._setupConnectedReshapeManager(),this._setUpGeometryHelper()):this._logGeometryTypeError()}_setUpHighlights(){this.highlightsEnabled&&this.graphic&&this._highlightHelper?.add(this.graphic,this.highlightName)}_setUpGeometryHelper(){const t=this.graphic.geometry;if(null==t||"mesh"===t.type||"extent"===t.type)return this._segmentLabels=h(this._segmentLabels),void this._logGeometryTypeError();this._editGeometryOperations?this._syncEditGeometryOperations(t):this._editGeometryOperations=dt.fromGeometry(t,2,{allowCurves:!0}),this._updatingHandles.addPromise(this._setupSegmentLabels())}_saveSnappingContextForHandle(t,e){this._snappingGraphicsLayer=new A({listMode:"hide",internal:!0,title:"Reshape snapping layer"}),this.view.map.layers.add(this._snappingGraphicsLayer);const i=this._editGeometryOperations;l(i),this._snappingContext=new ut({editGeometryOperations:i,elevationInfo:gt,pointer:e.viewEvent?.pointerType||"mouse",excludeFeature:this.graphic,feature:this.graphic,visualizer:new U(this._snappingGraphicsLayer),vertexHandle:this._getVertexFromEditGeometry(t)})}_reset(){this._clearSelection(),this._highlightHelper?.removeAll(),this._updateTooltip(),this._resetGraphics(),this._resetSnappingStateVars(),this._segmentLabelsImportTask=p(this._segmentLabelsImportTask),this._segmentLabels=h(this._segmentLabels),this._activeOperationInfo=null,this._mover=h(this._mover),this.removeHandles(_t)}_resetSnappingStateVars(){null!=this.snappingManager&&this.snappingManager.doneSnapping(),null!=this._snappingGraphicsLayer&&(this.view?.map&&this.view.map.layers.remove(this._snappingGraphicsLayer),this._snappingGraphicsLayer.destroy()),this._snappingTask=p(this._snappingTask),this._snappingTask=null,this._snappingContext=null,this._stagedVertex=null}_resetGraphics(t){this._removeMidpointGraphics(t),this._removeVertexGraphics(t),this._removeCurveGraphics(t),this._updateTooltip()}_removeMidpointGraphics(t=this.layer){const{midpointGraphics:e}=this;t?.removeMany(e.items),e.drain(h)}_removeVertexGraphics(t=this.layer){const{vertexGraphics:e}=this;t?.removeMany(e.items),e.drain(h)}_removeCurveGraphics(t=this.layer){const{curveControlPointGraphics:e,constructionLineGraphics:i}=this;t?.removeMany(e.items),t?.removeMany(i.items),e.drain(h),i.drain(h)}_setupGraphics(){const t=this.graphic.geometry;if(null!=t&&("polyline"===t.type||"polygon"===t.type||"multipoint"===t.type)){const e=bt(t);this.enableMidpoints&&"multipoint"!==t.type&&this._setUpMidpointGraphics(e),this.enableVertices&&(this._setUpVertexGraphics(e),this._setupCurveGraphics(e))}}_setUpMidpointGraphics(t){this._removeMidpointGraphics();const e=W(t,this.symbols,this._coordinateHelper,"polygon"===this.graphic.geometry?.type);this.midpointGraphics.addMany(e),this.layer.addMany(e)}_setUpVertexGraphics(t){this._removeVertexGraphics();const e=X(t,this.symbols,this._coordinateHelper);this.vertexGraphics.addMany(e),this._storeRelatedVertexIndices(),this.layer.addMany(e)}_setupCurveGraphics(t){this._removeCurveGraphics();const e=Y(t,this.symbols,this._coordinateHelper),i=tt(t,this.symbols,this._coordinateHelper);this.curveControlPointGraphics.addMany(e),this.constructionLineGraphics.addMany(i),this.layer.addMany(i),this.layer.addMany(e)}async _setupSegmentLabels(){const t=this._editGeometryOperations,e=this.sketchOptions.labels.enabled;if(t&&this._segmentLabels?.context?.editGeometryOperations===t&&e||(this._segmentLabels=h(this._segmentLabels)),!this._segmentLabels&&t&&e){const e=this._segmentLabelsImportTask??=i(async t=>{const e=import("../../2d/interactive/SegmentLabels2D.js"),{SegmentLabels2D:i}=await this._updatingHandles.addPromise(e);return t.aborted?null:i}),s=await e.promise;if(!s)return;this._segmentLabels=h(this._segmentLabels),this._segmentLabels=new s({context:{view:this.view,editGeometryOperations:t,elevationInfo:gt,labelOptions:this.sketchOptions.labels,automaticLengthMeasurementUtils:this.automaticLengthMeasurementUtils},visible:!0})}}_updateSymbolsForTheme(){const t=this.view.effectiveTheme.accentColor;this.symbols={vertices:{...this.symbols.vertices,default:this.symbols.vertices.default.clone().set("color",t),hover:this.symbols.vertices.hover?.clone().set("color",t)},controlPoints:{...this.symbols.controlPoints,default:this.symbols.controlPoints.default.clone().set("color",t),hover:this.symbols.controlPoints.hover?.clone().set("color",t)},midpoints:{...this.symbols.midpoints},constructionLines:this.symbols.constructionLines.clone().set("color",t)};for(const e of this.vertexGraphics)this._isSelected(e)?e.symbol=this.symbols.vertices.selected:this._hoverGraphic===e?e.symbol=this.symbols.vertices.hover:e.symbol=this.symbols.vertices.default;for(const e of this.curveControlPointGraphics)this._isSelected(e)?e.symbol=this.symbols.controlPoints.selected:this._hoverGraphic===e?e.symbol=this.symbols.controlPoints.hover:e.symbol=this.symbols.controlPoints.default;for(const e of this.constructionLineGraphics)e.symbol=this.symbols.constructionLines}_storeRelatedVertexIndices(){const t=this.vertexGraphics.items;if(!t)return;const e=t.map(({geometry:t})=>({x:t.x,y:t.y}));for(let i=0;i<e.length;i++){const s=[];for(let t=0;t<e.length;t++){if(i===t)continue;const o=e[i],r=e[t];o.x===r.x&&o.y===r.y&&s.push(t)}t[i].attributes[et.relatedGraphicIndices]=s}}_setupMover(){const{enableMovement:t,graphic:e,midpointGraphics:i,vertexGraphics:s,view:o}=this,r=s.concat(i,this.curveControlPointGraphics).toArray();t&&"multipoint"!==e.geometry?.type&&r.push(e),this._mover=new z({enableMoveAllGraphics:!1,highlightsEnabled:!1,indicatorsEnabled:!1,graphics:r,view:o,callbacks:{onGraphicClick:t=>this._onGraphicClickCallback(t),onGraphicMoveStart:t=>this._onGraphicMoveStartCallback(t),onGraphicMove:t=>this._onGraphicMoveCallback(t),onGraphicMoveStop:t=>this._onGraphicMoveStopCallback(t),onGraphicPointerOver:t=>this._onGraphicPointerOverCallback(t),onGraphicPointerOut:t=>this._onGraphicPointerOutCallback(t)}})}_setupConnectedReshapeManager(){const{connectedReshapeProviders:t}=this;null!=t&&0!==t.length&&(this._connectedReshapeManager=new j({providerFactories:t,view:this.view}))}_onGraphicClickCallback(t){t.viewEvent.stopPropagation();const e=t.graphic,i=this._isCurveControlPoint(e);if(e===this.graphic)this.clearSelection(),this.emit("graphic-click",t),this.callbacks.onGraphicClick?.(t);else if(this._isMidpoint(e)){if(2===t.viewEvent.button)return;const i=this.graphic.clone(),s=this._handleMidpointClickOrStartMove(t);this.refresh(),s.length&&this._emitVertexAddEvent([e],i,s)}else if(this._isVertex(e)||i){if(t.viewEvent.stopPropagation(),2===t.viewEvent.button)return void(i||this._removeVertices(e));t.viewEvent.native.shiftKey||this._clearSelection(),this.selectedManipulators.includes(e)?this._removeFromSelection(e,!0):this._addToSelection(e)}}_setUpOperation(t){const{graphic:e,dx:i,dy:s}=t,o=e===this.graphic;this._resetSnappingStateVars(),this._setUpGeometryHelper(),this._saveSnappingContextForHandle(e,t),this._activeOperationInfo={target:this.graphic,mover:e,operationType:o?"move":"reshape",totalDx:i,totalDy:s}}_onGraphicMoveStartCallback(t){const{dx:e,dy:i,graphic:s}=t,o=this._connectedReshapeManager,r=o?Ht(this.graphic):null;if(s===this.graphic){const{geometry:n}=s;return this._setUpOperation(t),this._emitMoveStartEvent(e,i),r&&o?.startFeatureMove([r]),void(null!=n&&"point"===n.type&&this._onHandleMove(s,e,i,t,()=>{this._updateTooltip(this.graphic,t.viewEvent),this._emitMoveEvent(e,i)}))}const{selectedManipulators:n}=this;if(!n.includes(s)){if(this._clearSelection(),this._isMidpoint(s)){const e=this.graphic.clone(),i=this._handleMidpointClickOrStartMove(t);i.length&&(this._emitVertexAddEvent([s],e,i),this._refreshGraphicIndicesAttributes(i[0]))}this._addToSelection(s)}if(this._setUpOperation(t),r){const t=n.filter(t=>this._isVertex(t));o?.startVertexMove(r,kt(t))}this._emitReshapeStartEvent(s),this._onHandleMove(s,e,i,t,()=>{this._updateTooltip(s,t.viewEvent),this._emitReshapeEvent(s)})}_onGraphicMoveCallback(t){const e=this._activeOperationInfo;if(!e)return;const{dx:i,dy:s,graphic:o}=t;e.totalDx+=i,e.totalDy+=s;const{operationType:r}=e,{geometry:n}=o;if(null!=n)if("move"!==r)this._onHandleMove(o,i,s,t,()=>{this._updateTooltip(o,t.viewEvent),this._emitReshapeEvent(o)});else{if("point"===n.type)this._onHandleMove(o,i,s,t,()=>{this._updateTooltip(this.graphic,t.viewEvent),this._emitMoveEvent(i,s)});else if("polyline"===n.type||"polygon"===n.type){const e=bt(n);this._updateVertexGraphicLocations(e);const{dxMap:o,dyMap:r}=F(i,s,this.view);this._connectedReshapeManager?.translate(o,r,0),this._updateTooltip(this.graphic,t.viewEvent),this._emitMoveEvent(i,s)}this._syncEditGeometryOperations(n)}}_onGraphicMoveStopCallback(t){const e=this._activeOperationInfo;if(!e)return;const{dx:i,dy:s,graphic:o}=t,{operationType:r}=e;e.totalDx+=i,e.totalDy+=s,this._onHandleMove(o,i,s,t,()=>"move"===r?this._emitMoveStopEvent():this._emitReshapeStopEvent(o)),this._isMidpoint(o)||o.getAttribute(et.curveFromStraightEdgeFlag)?this.refresh():(this._updateTooltip(this._isVertex(o)?o:null),this._resetSnappingStateVars(),this._connectedReshapeManager?.finish(),this._activeOperationInfo=null)}_updateVertexGraphicLocations(t){const{_coordinateHelper:e}=this;for(const i of this.vertexGraphics){const{pathIndex:s,pointIndex:o}=i.attributes;i.geometry=e.arrayToPoint(I(t[s][o]))}this._updateMidpointGraphicLocations(t),this._updateCurveGraphicLocations(t)}_updateMidpointGraphicLocations(t){const{_coordinateHelper:e}=this;for(const i of this.midpointGraphics){const{pathIndex:s,pointIndexStart:o,pointIndexEnd:r}=i.attributes,n=t[s];i.geometry=it(n[o],n[r],e)}}_updateCurveGraphicLocations(t){const{spatialReference:e}=this._coordinateHelper,i=new Map;for(const s of this.selectedManipulators){const[t,e]=wt(s);null!=t&&null!=e&&s.getAttribute(et.controlPointKind)&&a(i,t,()=>new Set)?.add(e)}for(const s of this.curveControlPointGraphics){const[e,o]=wt(s);if(i.get(e)?.has(o))continue;const r=t[e][o];if(L(r)||H(r)){const i=I(t[e][o-1]),n=L(r)?O(i,r):R(i,r),[a,h]=E(n,.25);s.geometry=new f({x:a,y:h,spatialReference:this._coordinateHelper.spatialReference})}else if(k(r)){const t=s.getAttribute(et.controlPointKind),[e,i]=t===st.bezier.cp1?r.b[1]:r.b[2];s.geometry=new f({x:e,y:i,spatialReference:this._coordinateHelper.spatialReference})}}for(const s of this.constructionLineGraphics){const i=s.getAttribute(et.controlPointKind),[o,r]=wt(s),n=t[o],a=I(n[r-1]),h=I(n[r]),p=t[o][r];i===st.bezier.line1?s.geometry=new b({paths:[[[a[0],a[1]],[...p.b[1]]]],spatialReference:e}):s.geometry=new b({paths:[[[h[0],h[1]],[...p.b[2]]]],spatialReference:e})}}_refreshGraphicIndicesAttributes(t){const{componentIndex:e,vertexIndex:i}=t,s=t=>{const[s,o]=wt(t);s===e&&o>=i&&t.setAttribute(et.pointIndex,o+1)};this.vertexGraphics.forEach(s),this.curveControlPointGraphics.forEach(s),this.constructionLineGraphics.forEach(s);for(const o of this.midpointGraphics){if(o.getAttribute(et.pathIndex)!==e)continue;const t=o.getAttribute(et.pointIndexStart);t>=i&&(o.setAttribute(et.pointIndexStart,t+1),o.setAttribute(et.pointIndexEnd,o.getAttribute(et.pointIndexEnd)+1))}}_getVertexFromEditGeometry(t){const[e,i]=wt(t);return l(this._editGeometryOperations),this._editGeometryOperations.data.parts[e].vertices[i]}_onHandleMove(t,e,s,o,r){p(this._snappingTask);const n=this._snappingContext;if(!n)return;const a=t.geometry,h="graphic-move-stop"===o.type;if(a&&S(a))if(null!=this.snappingManager&&this.selectedManipulators.length<2&&!h){const o=this.snappingManager;this._stagedVertex=o.update({point:a,context:n}),this._syncGeometryAfterVertexMove(t,new f(this._stagedVertex),e,s,h),r(),this._snappingTask=i(async i=>{const p=await o.snap({point:a,context:n,signal:i});p.valid&&(this._stagedVertex=p.apply(),this._syncGeometryAfterVertexMove(t,new f(this._stagedVertex),e,s,h),r())})}else{const i=null!=this._stagedVertex?new f(this._stagedVertex):a;this._syncGeometryAfterVertexMove(t,i,e,s,h),r()}else r()}_syncGeometryAfterVertexMove(t,e,i,s,o=!1){const r=this._editGeometryOperations?.data.geometry.clone();if(!r)return;const{_coordinateHelper:n}=this,a=n.pointToVector(e),h=this._getVertexFromEditGeometry(t);if(h){const t=n.getZ(a),e=a[0]-h.pos[0],i=a[1]-h.pos[1],s=null!=t?t-h.pos[2]:0;"point"!==r.type&&"mesh"!==r.type||this._editGeometryOperations?.moveVertices([h],e,i,s),this._connectedReshapeManager?.translate(e,i,s)}if("point"===r.type)t.geometry=e;else if("mesh"===r.type)t.geometry=r.centerAt(e);else{if(t!==this.graphic){const o=n.spatialReference,[a,h]=wt(t);let p=Gt(r);const l=n.pointToArray(e);this._updateGeometryFromGraphic(t,p,a,h,l,o,"polygon"===r.type),this._isVertex(t)||this._isCurveControlPoint(t)?(p=this._moveRelatedCoordinates(p,t,l),p=this._moveSelectedHandleCoordinates(p,t,i,s,"polygon"===r.type),this._updateMidpointGraphicLocations(p),this._updateCurveGraphicLocations(p)):this._isMidpoint(t)&&this._updateCurveGraphicLocations(p),ot(r,p)}this._updateGraphicGeometry(r),this._syncEditGeometryOperations(r),o&&(this._mover?this._mover.updateGeometry(this._mover.graphics.indexOf(t),e):t.geometry=e)}}_syncEditGeometryOperations(t){const e=this._editGeometryOperations?.trySetGeometry(t);e||(this._editGeometryOperations=null,this._setUpGeometryHelper())}_moveRelatedCoordinates(t,e,i){const{relatedGraphicIndices:s}=e.attributes,o=this._coordinateHelper.spatialReference;if(!s?.length)return t;for(const r of s){const s=this.vertexGraphics.at(r),[n,a]=wt(s);Ot(t,n,a,i,o),s.geometry=e.geometry}return t}_moveSelectedHandleCoordinates(t,e,i,s,o){const r=this._coordinateHelper.spatialReference;for(const n of this.selectedManipulators)if(n!==e){const[e,a]=wt(n),h=n.getAttribute(et.relatedGraphicIndices),p=D(n.geometry,i,s,this.view),l=C(p);if(n.geometry=p,this._updateGeometryFromGraphic(n,t,e,a,l,r,o),h?.length)for(const i of h){const e=this.vertexGraphics.at(i),[s,o]=wt(e);Ot(t,s,o,l,r),e.geometry=p}}return t}_updateGeometryFromGraphic(t,e,i,s,o,r,n){const a=e[i].length-1;this._isCurveControlPoint(t)?Mt(e,i,s,[o[0],o[1]],t.getAttribute(et.controlPointKind)):(Ot(e,i,s,o,r),n&&(0===s?Ot(e,i,a,o,r):s===a&&(e[i][0]=o)))}_onGraphicPointerOverCallback(t){const e=t.graphic;this._hoverGraphic=e;const i=this._isVertex(e);i&&!this._isSelected(e)?e.symbol=this.symbols.vertices.hover:this._isCurveControlPoint(e)&&!this._isSelected(e)&&(e.symbol=this.symbols.controlPoints.hover),this._updateTooltip(i?e:null),this._updateHoverCursor(e)}_onGraphicPointerOutCallback(t){const e=t.graphic;this._hoverGraphic=null,this._isVertex(e)&&!this._isSelected(e)&&(e.symbol=this.symbols.vertices.default),this._isCurveControlPoint(e)&&!this._isSelected(e)&&(e.symbol=this.symbols.controlPoints.default),this.removeHandles(_t),this._updateTooltip()}_handleMidpointClickOrStartMove(t){const{graphic:e}=t,i=this.graphic.geometry;if(null==i||"polygon"!==i.type&&"polyline"!==i.type)return[];const s=i.clone(),o=[],{[et.pathIndex]:r,[et.pointIndexStart]:n,[et.pointIndexEnd]:a}=e.attributes,h=C(e.geometry),p=0===a?n+1:a;e.attributes={[et.tool]:rt,[et.pathIndex]:r,[et.pointIndex]:p,[et.relatedGraphicIndices]:[]};const l=Gt(s),c=l[r][a];if(V(c)){if(this.enableCurveOnMidpoint&&t.viewEvent.native.shiftKey){const t=I(l[r][p]);l[r].splice(p,1,{c:[t,[h[0],h[1]]]}),e.setAttribute(et.controlPointKind,st.circle.interior),e.setAttribute(et.curveFromStraightEdgeFlag,!0),this.midpointGraphics.remove(e),this.curveControlPointGraphics.push(e),ot(s,l)}else l[r].splice(p,0,h),o.push({coordinates:l[r][p],componentIndex:r,vertexIndex:p})}else{const t=I(l[r][n]),e=nt(t,c,.5,this._coordinateHelper);l[r].splice(a,1,...e),o.push({coordinates:I(l[r][p]),componentIndex:r,vertexIndex:p})}return this._updateGraphicGeometry(s),this._syncEditGeometryOperations(s),o}_addToSelection(t){const e=Lt(t);for(const i of e)this._isCurveControlPoint(i)?i.symbol=this.symbols.controlPoints.selected:i.symbol=this.symbols.vertices.selected,this.selectedManipulators.add(i),this._updateTooltip(i);this._emitSelectEvent(e)}_removeFromSelection(t,e){if(this._isVertex(t)){const{vertices:i}=this.symbols;t.symbol=e?i.hover:i.default}else if(this._isCurveControlPoint(t)){const{controlPoints:i}=this.symbols;t.symbol=e?i.hover:i.default}this.selectedManipulators.remove(t),this._emitDeselectEvent([t]),this._updateTooltip()}_clearSelection(){const t=this.selectedManipulators.toArray(),{controlPoints:e,vertices:i}=this.symbols;if(t.length>0){for(const s of t)this._isVertex(s)?s.symbol=i.default:this._isCurveControlPoint(s)&&(s.symbol=e.default);this.selectedManipulators.removeAll(),this._emitDeselectEvent(t),this._updateTooltip()}}_keyDownHandler(t){null==this._activeOperationInfo&&yt(t,this.tooltip)||ct.delete.includes(t.key)&&!t.repeat&&this.selectedManipulators.length&&(this._removeVertices(this.selectedManipulators),t.stopPropagation())}_removeVertices(t){const e=this.graphic.geometry,i=this.vertexGraphics.length;if(null==e||"polygon"!==e.type&&"polyline"!==e.type&&"multipoint"!==e.type)return;if("polygon"===e.type&&i<4||"multipoint"===e.type&&i<2||"polyline"===e.type&&i<3)return;const s=this.graphic.clone(),o=e.clone();let r=Gt(o);const n=[],a=Lt(t);for(const h of a){if(this._isCurveControlPoint(h))continue;const{x:t,y:e}=h.geometry;for(let i=0;i<r.length;i++){const s=r[i];for(let o=0;o<s.length;o++){const[a,h]=I(s[o]);if(t===a&&e===h){n.push({coordinates:I(r[i][o]),componentIndex:i,vertexIndex:o}),r[i].splice(Number(o),1);const t=r[i][o];t&&!V(t)&&(r[i][o]=I(t))}}}}if("polygon"===o.type)r=r.filter(t=>{if(t.length<2)return!1;const[e,i]=I(t[0]),[s,o]=I(t[t.length-1]);return(2!==t.length||e!==s||i!==o)&&(e===s&&i===o||t.push(t[0]),!0)});else if("polyline"===o.type)for(const h of r)1===h.length&&r.splice(r.indexOf(h),1);ot(o,r),this._updateGraphicGeometry(o),this.refresh(),this._emitVertexRemoveEvent(a,s,n)}_isVertex(t){return this.vertexGraphics.includes(t)}_isCurveControlPoint(t){return this.curveControlPointGraphics.includes(t)}_isConstructionLine(t){return this.constructionLineGraphics.includes(t)}_isSelected(t){return(this._isVertex(t)||this.curveControlPointGraphics.includes(t))&&this.selectedManipulators.includes(t)}_isMidpoint(t){return this.midpointGraphics.includes(t)}_updateHoverCursor(t){const e=this._isMidpoint(t)?"copy":"move";this.addHandles(this.view.acquireCursor(e,"high"),_t)}_updateTooltip(t,e){let i=null;const{graphic:s,view:o,tooltipInfos:r}=this,n=s?.geometry;"point"===n?.type?i=r.movePoint:this._selectedManipulator?i=r.selectedVertex:t===this.graphic?(i=r.translateGraphic,B(i,o,this._tooltipsContext,e)):t&&this.selectedManipulators.length>1&&(i=r.translateVertices,J(i,o,n,this._tooltipsContext,e)),this.activeTooltipInfo=i}_updateGraphicGeometry(t){this._updateHandlesOnExternalGeometryChange?.pause(),this.graphic.geometry=t,this._updateHandlesOnExternalGeometryChange?.resume()}_emitMoveStartEvent(t,e){const i={type:"move-start",mover:this.graphic,dx:t,dy:e};this.emit("move-start",i),this.callbacks.onMoveStart?.(i)}_emitMoveEvent(t,e){const i={type:"move",mover:this.graphic,dx:t,dy:e};this.emit("move",i),this.callbacks.onMove?.(i)}_emitMoveStopEvent(t,e){if(null==t||null==e){const i=this._activeOperationInfo;if(!i)return;t=i.totalDx,e=i.totalDy}const i={type:"move-stop",mover:this.graphic,dx:t,dy:e};this.emit("move-stop",i),this.callbacks.onMoveStop?.(i)}_emitReshapeStartEvent(t){const e={type:"reshape-start",graphic:this.graphic,mover:t,selected:this.selectedManipulators.toArray()};this.emit("reshape-start",e),this.callbacks.onReshapeStart?.(e)}_emitReshapeEvent(t){const e={type:"reshape",graphic:this.graphic,mover:t,selected:this.selectedManipulators.toArray()};this.emit("reshape",e),this.callbacks.onReshape?.(e)}_emitReshapeStopEvent(t){const e={type:"reshape-stop",graphic:this.graphic,mover:t,selected:this.selectedManipulators.toArray()};this.emit("reshape-stop",e),this.callbacks.onReshapeStop?.(e)}_emitSelectEvent(t){const e={type:"vertex-select",added:t};this.emit("select",e),this.callbacks.onVertexSelect?.(e)}_emitDeselectEvent(t){const e={type:"vertex-deselect",removed:t};this.emit("deselect",e),this.callbacks.onVertexDeselect?.(e)}_emitVertexAddEvent(t,e,i){const s={type:"vertex-add",added:t,graphic:this.graphic,oldGraphic:e,vertices:i};this.emit("vertex-add",s),this.callbacks.onVertexAdd?.(s)}_emitVertexRemoveEvent(t,e,i){const s={type:"vertex-remove",removed:t,graphic:this.graphic,oldGraphic:e,vertices:i};this.emit("vertex-remove",s),this.callbacks.onVertexRemove?.(s)}_logGeometryTypeError(){n.getLogger(this).error(new o("reshape:invalid-geometry","Reshape operation not supported for the provided graphic. The geometry type is not supported."))}};function bt(t){const e=Gt(t.clone());if("polygon"===t.type)for(const i of e){const t=i[i.length-1];if(!V(t))continue;const e=i[0];e[0]===t[0]&&e[1]===t[1]&&i.length>2&&i.pop()}return e}function Gt(t){return"polygon"===t.type?t.curveRings?.slice()??t.rings.slice():"polyline"===t.type?t.curvePaths?.slice()??t.paths.slice():t.points.map(t=>[t])}function xt(t,e,i,s){const o=t[e][i];if(L(o))o.c[1]=s;else if(H(o)){const o=I(t[e][i]);t[e][i]={c:[o,s]}}}function Mt(t,e,i,s,o){switch(o){case st.circle.interior:xt(t,e,i,s);break;case st.bezier.cp1:t[e][i].b[1]=s;break;case st.bezier.cp2:t[e][i].b[2]=s}}function Ct(t,e){return t<1e-8*e}function St(t,{cx:e,cy:i,isInvalid:s,thetaStart:o,thetaEnd:r},n,a){const[h,p]=t,[l,c]=n,d=l-h,m=c-p;e-=h,i-=p;const u=a?o>r:o<r,[v,y]=s?[e,i]:u?[-i,e]:[i,-e],[_,g]=[d,m],[f,b]=[v,y],G=_*b-g*f,x=(d**2+m**2)/2;if(Ct(Math.abs(G),x))return[(h+l)/2,(p+c)/2];const[M,C]=[b/G*x,-f/G*x],S=M**2+C**2,[E,O]=[d/2-M,m/2-C];if(Ct(E**2+O**2,S)){const[t,e]=u?[-C,M]:[C,-M];return[t+M+h,e+C+p]}const w=Math.sqrt((M**2+C**2)/(E**2+O**2))*Math.sign(d*v+m*y);return[E*w+M+h,O*w+C+p]}function Et(t,e,i){const s=G(new b({curvePaths:[[t,e]],spatialReference:i})),{curvePaths:o}=x(s,i),r=o[0][1];return P(r)?r:w(t,r)}function Ot(t,e,i,s,o){const r=t[e][i],n=t[e].at(i+1);if(at(t,e)){const i=t[e][1];return t[e][0]=[...s],void(t[e][1]={a:[[...s],[...i.a[1]],0,0]})}if(ht(t,e)){const i=t[e][1],[o,r]=i.a[1],[n,a]=s,h=Math.hypot(n-o,a-r),[p,l]=[n-o,a-r],c=T(l,p);return t[e][0]=[...s],void(t[e][1]={a:[[...s],[...i.a[1]],0,0,c,h,i.a[6]]})}const a=I(r);if(V(r))r.splice(0,r.length,...s);else if(k(r))r.b[0].splice(0,r.b[0].length,...s);else if(L(r)||H(r)){const o=I(t[e][i-1]),n=L(r)?O(o,r):R(o,r);t[e].splice(i,1,{c:[[...s],St(o,n,s,!0)]})}else if(P(r)){r.a[0].splice(0,r.a[0].length,...s);const n=I(t[e][i-1]);r.a=Et(n,r,o).a}if(n&&!V(n)&&!k(r))if(L(n)||H(n)){const o=I(n),r=L(n)?O(a,n):R(a,n);t[e].splice(i+1,1,{c:[o,St(o,r,s,!1)]})}else if(P(n)){const t=I(r);n.a=Et(t,n,o).a}}function wt({attributes:t}){return[t?.[et.pathIndex]||0,t?.[et.pointIndex]||0]}function It({attributes:t}){return`${t?.[et.pathIndex]}-${t?.[et.pointIndex]}`}function Lt(t){return t instanceof e?[t]:[...t]}function Ht(t){const e=t.sourceLayer??t.layer;return q(e)?{graphic:t,layer:e}:null}function kt(t){return t.toArray().map(({attributes:t})=>({pathIndex:t[et.pathIndex],vertexIndex:t[et.pointIndex]}))}t([y()],ft.prototype,"_activeOperationInfo",void 0),t([y()],ft.prototype,"_connectedReshapeManager",void 0),t([y()],ft.prototype,"_coordinateHelper",null),t([y()],ft.prototype,"_editGeometryOperations",void 0),t([y()],ft.prototype,"_segmentLabels",void 0),t([y()],ft.prototype,"test",null),t([y()],ft.prototype,"_segmentLabelsImportTask",void 0),t([y()],ft.prototype,"_updatingHandles",void 0),t([y()],ft.prototype,"_selectedManipulator",null),t([y()],ft.prototype,"_tooltipsContext",null),t([y()],ft.prototype,"callbacks",void 0),t([y()],ft.prototype,"connectedReshapeProviders",void 0),t([y()],ft.prototype,"enableMidpoints",void 0),t([y()],ft.prototype,"enableCurveOnMidpoint",void 0),t([y()],ft.prototype,"enableMovement",void 0),t([y()],ft.prototype,"enableVertices",void 0),t([y()],ft.prototype,"graphic",void 0),t([y()],ft.prototype,"highlightName",void 0),t([y()],ft.prototype,"highlightsEnabled",void 0),t([y()],ft.prototype,"layer",void 0),t([y()],ft.prototype,"snappingManager",void 0),t([y({readOnly:!0})],ft.prototype,"state",null),t([y()],ft.prototype,"symbols",void 0),t([y()],ft.prototype,"tooltip",void 0),t([y()],ft.prototype,"tooltipInfos",void 0),t([y()],ft.prototype,"activeTooltipInfo",void 0),t([y({constructOnly:!0})],ft.prototype,"automaticAreaMeasurementUtils",void 0),t([y({constructOnly:!0})],ft.prototype,"automaticLengthMeasurementUtils",void 0),t([y()],ft.prototype,"updating",null),t([y({type:mt})],ft.prototype,"sketchOptions",void 0),t([y({readOnly:!0})],ft.prototype,"type",void 0),t([y({readOnly:!0})],ft.prototype,"vertexGraphics",void 0),t([y({readOnly:!0})],ft.prototype,"curveControlPointGraphics",void 0),t([y({readOnly:!0})],ft.prototype,"constructionLineGraphics",void 0),t([y({readOnly:!0})],ft.prototype,"midpointGraphics",void 0),t([y({readOnly:!0})],ft.prototype,"selectedManipulators",void 0),t([y()],ft.prototype,"view",void 0),ft=t([_("esri.views.draw.support.Reshape")],ft);const Vt=ft;export{Vt 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/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as t}from"tslib";import e from"../../core/Accessor.js";import{EventEmitter as i}from"../../core/Evented.js";import{watch as o,sync as s}from"../../core/reactiveUtils.js";import{screenPointObjectToArray as l,pt2px as r,createScreenPointArray as n}from"../../core/screenUtils.js";import{property as a,subclass as c}from"../../core/accessorSupport/decorators.js";import{squaredDistance as h}from"../../core/libs/gl-matrix-2/math/vec2.js";import{C as p}from"../../chunks/vec32.js";import{create as m}from"../../core/libs/gl-matrix-2/factories/vec3f64.js";import{canProjectWithoutEngine as u,project as y}from"../../geometry/projectionUtils.js";import{projectPointToVector as g}from"../../geometry/projection/projectPointToVector.js";import{getGraphicEffectiveElevationMode as b}from"../../support/elevationInfoUtils.js";import{getDefaultSymbol2D as d}from"../../symbols/support/defaults.js";import f from"../../symbols/support/ElevationInfo.js";import{getSymbolInfo as _}from"./support/utils.js";import{intersectsDrapedGeometry as v}from"../support/drapedUtils.js";let S=class extends e{set graphic(t){this._circleCollisionCache=null,this._originalSymbol=t.symbol,this._set("graphic",t),this.attachSymbolChanged()}get elevationInfo(){const{layer:t}=this.graphic,e=t&&"elevationInfo"in t?t.elevationInfo:null,i=b(this.graphic),o=e?e.offset:0;return new f({mode:i,offset:o})}set focusedSymbol(t){t!==this._get("focusedSymbol")&&(this._set("focusedSymbol",t),this._updateGraphicSymbol(),this._circleCollisionCache=null)}grabbableForEvent(){return!0}set grabbing(t){t!==this._get("grabbing")&&(this._set("grabbing",t),this._updateGraphicSymbol())}set hovering(t){t!==this._get("hovering")&&(this._set("hovering",t),this._updateGraphicSymbol())}set selected(t){t!==this._get("selected")&&(this._set("selected",t),this._updateGraphicSymbol(),this.events.emit("select-changed",{action:t?"select":"deselect"}))}get _focused(){return this._get("hovering")||this._get("grabbing")}constructor(t){super(t),this.layer=null,this.interactive=!0,this.selectable=!1,this.grabbable=!0,this.dragging=!1,this.cursor=null,this.consumesClicks=!0,this.events=new i,this._circleCollisionCache=null,this._graphicSymbolChangedHandle=null,this._originalSymbol=null}destroy(){this.detachSymbolChanged(),this._resetGraphicSymbol(),this._set("view",null)}intersectionDistance(t){const e=this.graphic;if(!1===e.visible)return null;const i=e.geometry;if(null==i)return null;const o=this._get("focusedSymbol"),s=null!=o?o:e.symbol;return"2d"===this.view.type?this._intersectDistance2D(this.view,t,i,s):this._intersectDistance3D(this.view,t,e)}attach(){this.attachSymbolChanged(),null!=this.layer&&this.layer.add(this.graphic)}detach(){this.detachSymbolChanged(),this._resetGraphicSymbol(),null!=this.layer&&this.layer.remove(this.graphic)}attachSymbolChanged(){this.detachSymbolChanged(),this._graphicSymbolChangedHandle=o(()=>this.graphic?.symbol,t=>{null!=t&&t!==this.focusedSymbol&&t!==this._originalSymbol&&(this._originalSymbol=t,this._focused&&null!=this.focusedSymbol&&(this.graphic.symbol=this.focusedSymbol))},s)}detachSymbolChanged(){null!=this._graphicSymbolChangedHandle&&(this._graphicSymbolChangedHandle.remove(),this._graphicSymbolChangedHandle=null)}onElevationChange(){}onViewChange(){}_updateGraphicSymbol(){this.graphic.symbol=this._focused&&null!=this.focusedSymbol?this.focusedSymbol:this._originalSymbol}_resetGraphicSymbol(){this.graphic.symbol=this._originalSymbol}_intersectDistance2D(t,e,i,o){if(null==(o=o||d(i)))return null;const s=1;let n=this._circleCollisionCache;if("point"===i.type&&"cim"===o.type&&"CIMPointSymbol"===o.data.symbol?.type&&o.data.symbol.symbolLayers){const{offsetX:r,offsetY:n,size:a}=_(o),c=l(e,j),p=a/2,m=t.toScreen(i),u=m.x+r,y=m.y+n;return h(c,[u,y])<p*p?s:null}if("point"!==i.type||"simple-marker"!==o.type)return v(e,i,t)?s:null;if(null==n||!n.originalPoint.equals(i)){const e=i,s=t.spatialReference;if(u(e.spatialReference,s)){const t=y(e,s);n={originalPoint:e.clone(),mapPoint:t,radiusPx:r(o.size)},this._circleCollisionCache=n}}if(null!=n){const i=l(e,j),a=t.toScreen?.(n.mapPoint);if(!a)return null;const c=n.radiusPx,p=a.x+r(o.xoffset),m=a.y-r(o.yoffset);return h(i,[p,m])<c*c?s:null}return null}_intersectDistance3D(t,e,i){const o=t.toMap(e,{include:[i]});return o&&g(o,C,t.renderSpatialReference)?p(C,t.state.camera.eye):null}};t([a({constructOnly:!0,nonNullable:!0})],S.prototype,"graphic",null),t([a()],S.prototype,"elevationInfo",null),t([a({constructOnly:!0,nonNullable:!0})],S.prototype,"view",void 0),t([a({value:null})],S.prototype,"focusedSymbol",null),t([a({constructOnly:!0})],S.prototype,"layer",void 0),t([a()],S.prototype,"interactive",void 0),t([a()],S.prototype,"selectable",void 0),t([a()],S.prototype,"grabbable",void 0),t([a({value:!1})],S.prototype,"grabbing",null),t([a()],S.prototype,"dragging",void 0),t([a()],S.prototype,"hovering",null),t([a({value:!1})],S.prototype,"selected",null),t([a()],S.prototype,"cursor",void 0),S=t([c("esri.views.interactive.GraphicManipulator")],S);const C=m(),j=n();export{S as GraphicManipulator};
5
+ import{__decorate as t}from"tslib";import e from"../../core/Accessor.js";import{EventEmitter as i}from"../../core/Evented.js";import{watch as o,sync as s}from"../../core/reactiveUtils.js";import{screenPointObjectToArray as l,pt2px as r,createScreenPointArray as n}from"../../core/screenUtils.js";import{property as a,subclass as c}from"../../core/accessorSupport/decorators.js";import{squaredDistance as h}from"../../core/libs/gl-matrix-2/math/vec2.js";import{D as p}from"../../chunks/vec32.js";import{create as m}from"../../core/libs/gl-matrix-2/factories/vec3f64.js";import{canProjectWithoutEngine as u,project as y}from"../../geometry/projectionUtils.js";import{projectPointToVector as g}from"../../geometry/projection/projectPointToVector.js";import{getGraphicEffectiveElevationMode as b}from"../../support/elevationInfoUtils.js";import{getDefaultSymbol2D as d}from"../../symbols/support/defaults.js";import f from"../../symbols/support/ElevationInfo.js";import{getSymbolInfo as _}from"./support/utils.js";import{intersectsDrapedGeometry as v}from"../support/drapedUtils.js";let S=class extends e{set graphic(t){this._circleCollisionCache=null,this._originalSymbol=t.symbol,this._set("graphic",t),this.attachSymbolChanged()}get elevationInfo(){const{layer:t}=this.graphic,e=t&&"elevationInfo"in t?t.elevationInfo:null,i=b(this.graphic),o=e?e.offset:0;return new f({mode:i,offset:o})}set focusedSymbol(t){t!==this._get("focusedSymbol")&&(this._set("focusedSymbol",t),this._updateGraphicSymbol(),this._circleCollisionCache=null)}grabbableForEvent(){return!0}set grabbing(t){t!==this._get("grabbing")&&(this._set("grabbing",t),this._updateGraphicSymbol())}set hovering(t){t!==this._get("hovering")&&(this._set("hovering",t),this._updateGraphicSymbol())}set selected(t){t!==this._get("selected")&&(this._set("selected",t),this._updateGraphicSymbol(),this.events.emit("select-changed",{action:t?"select":"deselect"}))}get _focused(){return this._get("hovering")||this._get("grabbing")}constructor(t){super(t),this.layer=null,this.interactive=!0,this.selectable=!1,this.grabbable=!0,this.dragging=!1,this.cursor=null,this.consumesClicks=!0,this.events=new i,this._circleCollisionCache=null,this._graphicSymbolChangedHandle=null,this._originalSymbol=null}destroy(){this.detachSymbolChanged(),this._resetGraphicSymbol(),this._set("view",null)}intersectionDistance(t){const e=this.graphic;if(!1===e.visible)return null;const i=e.geometry;if(null==i)return null;const o=this._get("focusedSymbol"),s=null!=o?o:e.symbol;return"2d"===this.view.type?this._intersectDistance2D(this.view,t,i,s):this._intersectDistance3D(this.view,t,e)}attach(){this.attachSymbolChanged(),null!=this.layer&&this.layer.add(this.graphic)}detach(){this.detachSymbolChanged(),this._resetGraphicSymbol(),null!=this.layer&&this.layer.remove(this.graphic)}attachSymbolChanged(){this.detachSymbolChanged(),this._graphicSymbolChangedHandle=o(()=>this.graphic?.symbol,t=>{null!=t&&t!==this.focusedSymbol&&t!==this._originalSymbol&&(this._originalSymbol=t,this._focused&&null!=this.focusedSymbol&&(this.graphic.symbol=this.focusedSymbol))},s)}detachSymbolChanged(){null!=this._graphicSymbolChangedHandle&&(this._graphicSymbolChangedHandle.remove(),this._graphicSymbolChangedHandle=null)}onElevationChange(){}onViewChange(){}_updateGraphicSymbol(){this.graphic.symbol=this._focused&&null!=this.focusedSymbol?this.focusedSymbol:this._originalSymbol}_resetGraphicSymbol(){this.graphic.symbol=this._originalSymbol}_intersectDistance2D(t,e,i,o){if(null==(o=o||d(i)))return null;const s=1;let n=this._circleCollisionCache;if("point"===i.type&&"cim"===o.type&&"CIMPointSymbol"===o.data.symbol?.type&&o.data.symbol.symbolLayers){const{offsetX:r,offsetY:n,size:a}=_(o),c=l(e,j),p=a/2,m=t.toScreen(i),u=m.x+r,y=m.y+n;return h(c,[u,y])<p*p?s:null}if("point"!==i.type||"simple-marker"!==o.type)return v(e,i,t)?s:null;if(null==n||!n.originalPoint.equals(i)){const e=i,s=t.spatialReference;if(u(e.spatialReference,s)){const t=y(e,s);n={originalPoint:e.clone(),mapPoint:t,radiusPx:r(o.size)},this._circleCollisionCache=n}}if(null!=n){const i=l(e,j),a=t.toScreen?.(n.mapPoint);if(!a)return null;const c=n.radiusPx,p=a.x+r(o.xoffset),m=a.y-r(o.yoffset);return h(i,[p,m])<c*c?s:null}return null}_intersectDistance3D(t,e,i){const o=t.toMap(e,{include:[i]});return o&&g(o,C,t.renderSpatialReference)?p(C,t.state.camera.eye):null}};t([a({constructOnly:!0,nonNullable:!0})],S.prototype,"graphic",null),t([a()],S.prototype,"elevationInfo",null),t([a({constructOnly:!0,nonNullable:!0})],S.prototype,"view",void 0),t([a({value:null})],S.prototype,"focusedSymbol",null),t([a({constructOnly:!0})],S.prototype,"layer",void 0),t([a()],S.prototype,"interactive",void 0),t([a()],S.prototype,"selectable",void 0),t([a()],S.prototype,"grabbable",void 0),t([a({value:!1})],S.prototype,"grabbing",null),t([a()],S.prototype,"dragging",void 0),t([a()],S.prototype,"hovering",null),t([a({value:!1})],S.prototype,"selected",null),t([a()],S.prototype,"cursor",void 0),S=t([c("esri.views.interactive.GraphicManipulator")],S);const C=m(),j=n();export{S as GraphicManipulator};
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{distance as e,lerp as r,copy as t,equals as a}from"../../core/libs/gl-matrix-2/math/vec2.js";import{create as i,fromValues as o,fromArray as n}from"../../core/libs/gl-matrix-2/factories/vec2f64.js";import{C as s,h as u,l as c,d as l,F as h}from"../../chunks/vec32.js";import{create as p,fromValues as v,fromArray as y}from"../../core/libs/gl-matrix-2/factories/vec3f64.js";import{l as d,f,e as T}from"../../chunks/vec42.js";import{create as m,fromValues as _,fromArray as g}from"../../core/libs/gl-matrix-2/factories/vec4f64.js";import x from"../../geometry/Point.js";class R{constructor(e){this.spatialReference=e}createVector(){return this._tag(i())}pointToVector(e){return this._tag(o(e.x,e.y))}arrayToVector(e){return this._tag(o(e[0],e[1]))}vectorToArray(e){return[e[0],e[1]]}pointToArray(e){return[e.x,e.y]}vectorToPoint(e,r=new x){if(e)return r.x=e[0],r.y=e[1],r.z=void 0,r.m=void 0,r.spatialReference=this.spatialReference,r}arrayToPoint(e,r=new x){return r.x=e[0],r.y=e[1],r.z=void 0,r.m=void 0,r.spatialReference=this.spatialReference,r}vectorToDehydratedPoint(e,r){if(e)return r??={x:void 0,y:void 0,z:void 0,m:void 0,hasZ:void 0,hasM:void 0,spatialReference:void 0,type:"point"},r.x=e[0],r.y=e[1],r.z=void 0,r.m=void 0,r.hasZ=!1,r.hasM=!1,r.spatialReference=this.spatialReference,r}lerp(e,t,a,i){return r(i,e,t,a)}addDelta(e,r,t){e[0]+=r,e[1]+=t}distance(r,t){return e(r,t)}getZ(e,r=void 0){return r}hasZ(){return!1}getM(e,r=void 0){return r}hasM(){return!1}clone(e){return this._tag(n(e))}copy(e,r){return t(r,e)}fromXYZ(e){return this._tag(o(e[0],e[1]))}toXYZ(e,r=p()){return u(r,e[0],e[1],0)}arrayToXYZ(e,r=p()){return u(r,e[0],e[1],0)}pointToXYZ(e,r=p()){return u(r,e.x,e.y,0)}equals(e,r){return a(e,r)}_tag(e){return e}}class Z{constructor(e,r){this._valueType=e,this.spatialReference=r}createVector(){return this._tag(p())}pointToVector(e){return this._tag(v(e.x,e.y,0===this._valueType?e.z:e.m))}arrayToVector(e){return this._tag(v(e[0],e[1],e[2]||0))}vectorToArray(e){return[e[0],e[1],e[2]]}pointToArray(e){return 0===this._valueType?[e.x,e.y,e.z]:[e.x,e.y,e.m]}vectorToPoint(e,r=new x){if(e)return r.x=e[0],r.y=e[1],r.z=0===this._valueType?e[2]:void 0,r.m=1===this._valueType?e[2]:void 0,r.spatialReference=this.spatialReference,r}arrayToPoint(e,r=new x){return r.x=e[0],r.y=e[1],r.z=0===this._valueType?e[2]:void 0,r.m=1===this._valueType?e[2]:void 0,r.spatialReference=this.spatialReference,r}vectorToDehydratedPoint(e,r){if(!e)return;r??={x:void 0,y:void 0,z:void 0,m:void 0,hasZ:void 0,hasM:void 0,spatialReference:void 0,type:"point"};const t=0===this._valueType,a=1===this._valueType;return r.x=e[0],r.y=e[1],r.z=t?e[2]:void 0,r.m=a?e[2]:void 0,r.hasZ=t,r.hasM=a,r.spatialReference=this.spatialReference,r}lerp(e,r,t,a){return c(a,e,r,t)}addDelta(e,r,t,a){e[0]+=r,e[1]+=t,0===this._valueType&&(e[2]+=a)}distance(r,t){return 0===this._valueType?s(r,t):e(X(r),X(t))}getZ(e,r=void 0){return 0===this._valueType?e[2]:r}hasZ(){return 0===this._valueType}getM(e,r=void 0){return 1===this._valueType?e[2]:r}hasM(){return 1===this._valueType}clone(e){return this._tag(y(e))}copy(e,r){return l(r,e)}fromXYZ(e,r=0,t=0){return this._tag(v(e[0],e[1],0===this._valueType?e.length>2?e[2]:r:t))}toXYZ(e,r=p()){return u(r,e[0],e[1],0===this._valueType?e[2]:0)}arrayToXYZ(e,r=p()){return u(r,e[0],e[1],1===this._valueType||e.length<3?0:e[2])}pointToXYZ(e,r=p()){return u(r,e.x,e.y,0===this._valueType?e.z??0:0)}equals(e,r){return h(e,r)}_tag(e){return e}}class z{constructor(e){this.spatialReference=e}createVector(){return this._tag(m())}pointToVector(e){return this._tag(_(e.x,e.y,e.z,e.m))}arrayToVector(e){return this._tag(_(e[0],e[1],e[2]||0,e[3]||0))}vectorToArray(e){return[e[0],e[1],e[2],e[3]]}pointToArray(e){return[e.x,e.y,e.z,e.m]}vectorToPoint(e,r=new x){return r.x=e[0],r.y=e[1],r.z=e[2],r.m=e[3],r.spatialReference=this.spatialReference,r}arrayToPoint(e,r=new x){return r.x=e[0],r.y=e[1],r.z=e[2],r.m=e[3],r.spatialReference=this.spatialReference,r}vectorToDehydratedPoint(e,r){if(e)return r??={x:void 0,y:void 0,z:void 0,m:void 0,hasZ:void 0,hasM:void 0,spatialReference:void 0,type:"point"},r.x=e[0],r.y=e[1],r.z=e[2],r.m=e[3],r.hasZ=!0,r.hasM=!0,r.spatialReference=this.spatialReference,r}lerp(e,r,t,a){return d(a,e,r,t)}addDelta(e,r,t,a){e[0]+=r,e[1]+=t,e[2]+=a}distance(e,r){return s(M(e),M(r))}getZ(e){return e[2]}hasZ(){return!0}getM(e){return e[3]}hasM(){return!0}clone(e){return this._tag(g(e))}copy(e,r){return f(r,e)}fromXYZ(e,r=0,t=0){return this._tag(_(e[0],e[1],e.length>2?e[2]:r,t))}toXYZ(e,r=p()){return u(r,e[0],e[1],e[2])}arrayToXYZ(e,r=p()){return u(r,e[0],e[1],e.length<3?0:e[2])}pointToXYZ(e,r=p()){return u(r,e.x,e.y,e.z??0)}equals(e,r){return T(e,r)}_tag(e){return e}}function M(e){return e}function X(e){return e}function Y(e,r,t){return e&&r?new z(t):r?new Z(1,t):e?new Z(0,t):new R(t)}export{R as CoordinateHelper2D,Z as CoordinateHelper3D,z as CoordinateHelper4D,Y as createCoordinateHelper};
5
+ import{distance as e,lerp as r,copy as t,equals as a}from"../../core/libs/gl-matrix-2/math/vec2.js";import{create as i,fromValues as o,fromArray as n}from"../../core/libs/gl-matrix-2/factories/vec2f64.js";import{D as s,h as u,l as c,d as l,G as h}from"../../chunks/vec32.js";import{create as p,fromValues as v,fromArray as y}from"../../core/libs/gl-matrix-2/factories/vec3f64.js";import{l as d,f,e as T}from"../../chunks/vec42.js";import{create as m,fromValues as _,fromArray as g}from"../../core/libs/gl-matrix-2/factories/vec4f64.js";import x from"../../geometry/Point.js";class R{constructor(e){this.spatialReference=e}createVector(){return this._tag(i())}pointToVector(e){return this._tag(o(e.x,e.y))}arrayToVector(e){return this._tag(o(e[0],e[1]))}vectorToArray(e){return[e[0],e[1]]}pointToArray(e){return[e.x,e.y]}vectorToPoint(e,r=new x){if(e)return r.x=e[0],r.y=e[1],r.z=void 0,r.m=void 0,r.spatialReference=this.spatialReference,r}arrayToPoint(e,r=new x){return r.x=e[0],r.y=e[1],r.z=void 0,r.m=void 0,r.spatialReference=this.spatialReference,r}vectorToDehydratedPoint(e,r){if(e)return r??={x:void 0,y:void 0,z:void 0,m:void 0,hasZ:void 0,hasM:void 0,spatialReference:void 0,type:"point"},r.x=e[0],r.y=e[1],r.z=void 0,r.m=void 0,r.hasZ=!1,r.hasM=!1,r.spatialReference=this.spatialReference,r}lerp(e,t,a,i){return r(i,e,t,a)}addDelta(e,r,t){e[0]+=r,e[1]+=t}distance(r,t){return e(r,t)}getZ(e,r=void 0){return r}hasZ(){return!1}getM(e,r=void 0){return r}hasM(){return!1}clone(e){return this._tag(n(e))}copy(e,r){return t(r,e)}fromXYZ(e){return this._tag(o(e[0],e[1]))}toXYZ(e,r=p()){return u(r,e[0],e[1],0)}arrayToXYZ(e,r=p()){return u(r,e[0],e[1],0)}pointToXYZ(e,r=p()){return u(r,e.x,e.y,0)}equals(e,r){return a(e,r)}_tag(e){return e}}class Z{constructor(e,r){this._valueType=e,this.spatialReference=r}createVector(){return this._tag(p())}pointToVector(e){return this._tag(v(e.x,e.y,0===this._valueType?e.z:e.m))}arrayToVector(e){return this._tag(v(e[0],e[1],e[2]||0))}vectorToArray(e){return[e[0],e[1],e[2]]}pointToArray(e){return 0===this._valueType?[e.x,e.y,e.z]:[e.x,e.y,e.m]}vectorToPoint(e,r=new x){if(e)return r.x=e[0],r.y=e[1],r.z=0===this._valueType?e[2]:void 0,r.m=1===this._valueType?e[2]:void 0,r.spatialReference=this.spatialReference,r}arrayToPoint(e,r=new x){return r.x=e[0],r.y=e[1],r.z=0===this._valueType?e[2]:void 0,r.m=1===this._valueType?e[2]:void 0,r.spatialReference=this.spatialReference,r}vectorToDehydratedPoint(e,r){if(!e)return;r??={x:void 0,y:void 0,z:void 0,m:void 0,hasZ:void 0,hasM:void 0,spatialReference:void 0,type:"point"};const t=0===this._valueType,a=1===this._valueType;return r.x=e[0],r.y=e[1],r.z=t?e[2]:void 0,r.m=a?e[2]:void 0,r.hasZ=t,r.hasM=a,r.spatialReference=this.spatialReference,r}lerp(e,r,t,a){return c(a,e,r,t)}addDelta(e,r,t,a){e[0]+=r,e[1]+=t,0===this._valueType&&(e[2]+=a)}distance(r,t){return 0===this._valueType?s(r,t):e(X(r),X(t))}getZ(e,r=void 0){return 0===this._valueType?e[2]:r}hasZ(){return 0===this._valueType}getM(e,r=void 0){return 1===this._valueType?e[2]:r}hasM(){return 1===this._valueType}clone(e){return this._tag(y(e))}copy(e,r){return l(r,e)}fromXYZ(e,r=0,t=0){return this._tag(v(e[0],e[1],0===this._valueType?e.length>2?e[2]:r:t))}toXYZ(e,r=p()){return u(r,e[0],e[1],0===this._valueType?e[2]:0)}arrayToXYZ(e,r=p()){return u(r,e[0],e[1],1===this._valueType||e.length<3?0:e[2])}pointToXYZ(e,r=p()){return u(r,e.x,e.y,0===this._valueType?e.z??0:0)}equals(e,r){return h(e,r)}_tag(e){return e}}class z{constructor(e){this.spatialReference=e}createVector(){return this._tag(m())}pointToVector(e){return this._tag(_(e.x,e.y,e.z,e.m))}arrayToVector(e){return this._tag(_(e[0],e[1],e[2]||0,e[3]||0))}vectorToArray(e){return[e[0],e[1],e[2],e[3]]}pointToArray(e){return[e.x,e.y,e.z,e.m]}vectorToPoint(e,r=new x){return r.x=e[0],r.y=e[1],r.z=e[2],r.m=e[3],r.spatialReference=this.spatialReference,r}arrayToPoint(e,r=new x){return r.x=e[0],r.y=e[1],r.z=e[2],r.m=e[3],r.spatialReference=this.spatialReference,r}vectorToDehydratedPoint(e,r){if(e)return r??={x:void 0,y:void 0,z:void 0,m:void 0,hasZ:void 0,hasM:void 0,spatialReference:void 0,type:"point"},r.x=e[0],r.y=e[1],r.z=e[2],r.m=e[3],r.hasZ=!0,r.hasM=!0,r.spatialReference=this.spatialReference,r}lerp(e,r,t,a){return d(a,e,r,t)}addDelta(e,r,t,a){e[0]+=r,e[1]+=t,e[2]+=a}distance(e,r){return s(M(e),M(r))}getZ(e){return e[2]}hasZ(){return!0}getM(e){return e[3]}hasM(){return!0}clone(e){return this._tag(g(e))}copy(e,r){return f(r,e)}fromXYZ(e,r=0,t=0){return this._tag(_(e[0],e[1],e.length>2?e[2]:r,t))}toXYZ(e,r=p()){return u(r,e[0],e[1],e[2])}arrayToXYZ(e,r=p()){return u(r,e[0],e[1],e.length<3?0:e[2])}pointToXYZ(e,r=p()){return u(r,e.x,e.y,e.z??0)}equals(e,r){return T(e,r)}_tag(e){return e}}function M(e){return e}function X(e){return e}function Y(e,r,t){return e&&r?new z(t):r?new Z(1,t):e?new Z(0,t):new R(t)}export{R as CoordinateHelper2D,Z as CoordinateHelper3D,z as CoordinateHelper4D,Y as createCoordinateHelper};
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{clamp as t,deg2rad as i}from"../../../../core/mathUtils.js";import{subtract as e,normalize as s,dot as n}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{create as r}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{D as h,h as a,f as o,n as _,j as c,g as l,q as p,i as g,l as d,F as m,d as u}from"../../../../chunks/vec32.js";import{create as f}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{create as D,fromPositionAndNormal as x,signedDistance as b,getNormal as V,copy as N,intersectLine as P,isPointInside as y,projectPoint as Z}from"../../../../geometry/support/plane.js";import{angle as X,projectPointSignedLength as Y}from"../../../../geometry/support/vector.js";import{intersectLineAndRay as T}from"../../../support/geometry2dUtils.js";class M{get plane(){return this._plane}get requiresSplitEdgeLeft(){return!this._left.isOriginalDirection}get requiresSplitEdgeRight(){return!this._right.isOriginalDirection}get edgeDirection(){return this._edgeDirection}constructor(t,i,e,s=0,n=0){this._helper=t,this._planeType=i,this._edge=e,this.distance=s,this._plane=D(),this._offsetPlane=D(),this._minDistance=-1/0,this._maxDistance=1/0,this._selectedArrow=1,0===n&&this._initialize()}_initialize(){this._initializeNeighbors(),this._initializePlane(),this._initializeDistanceConstraints()}_initializeNeighbors(){const t=this._toXYZ(this._edge.leftVertex.pos),i=this._toXYZ(this._edge.leftVertex.leftSegment?.leftVertex?.pos),e=this._toXYZ(this._edge.rightVertex.pos),s=this._toXYZ(this._edge.rightVertex.rightSegment?.rightVertex?.pos);this._edgeDirection=h(f(),t,e),i?(this._left=this._computeNeighbor(t,i,this._edgeDirection),this._right=this._computeNeighbor(e,s,this._edgeDirection,this._left)):(this._right=this._computeNeighbor(e,s,this._edgeDirection),this._left=this._computeNeighbor(t,i,this._edgeDirection,this._right))}_toXYZ(t){return null!=t?this._helper.toXYZ(t):null}_pointToXYZ(t){return this._toXYZ(this._helper.pointToVector(t))}_computeNeighbor(t,i,e,s){const n=f();if(i){h(n,t,i);const s=!this._passesBisectingAngleThreshold(n,e);return{start:t,end:i,direction:s?this._bisectVectorsPerpendicular(e,n):n,isOriginalDirection:!s}}return this._helper.hasZ()?s&&(o(n,e,s.direction),o(n,n,e),_(n,n),Math.sign(n[1])!==Math.sign(e[0])&&c(n,n,-1)):a(n,-e[1],e[0],0),{start:t,end:i,direction:n,isOriginalDirection:!0}}_passesBisectingAngleThreshold(t,i){const e=Math.abs(X(i,t));return e>=j&&e<=Math.PI-j}_bisectVectorsPerpendicular(t,i){const e=l(t,i)<0?t:p(f(),t),s=Math.abs(l(e,i));if(!(s<z||s>1-z))return this._bisectDirection(e,i);const n=o(f(),e,[0,0,1]);return _(n,n)}_bisectDirection(t,i){const e=g(f(),t,i);return _(e,e)}_initializePlane(){const t=this._computeNormalDirection(this._left),i=this._computeNormalDirection(this._right);l(t,i)<0&&p(i,i),x(this._left.start,this._bisectDirection(t,i),this._plane)}_computeNormalDirection(t){const i=o(f(),t.direction,this._edgeDirection);_(i,i);const e=o(f(),this._edgeDirection,i);return 1===this._planeType&&(e[2]=0),_(e,e)}_initializeDistanceConstraints(){null==this._left.end||this.requiresSplitEdgeLeft||this._updateDistanceConstraint(b(this._plane,this._left.end)),null==this._right.end||this.requiresSplitEdgeRight||this._updateDistanceConstraint(b(this._plane,this._right.end)),this._updateIntersectDistanceConstraint(this._plane)}_updateDistanceConstraint(t){t<=0&&(this._minDistance=Math.max(this._minDistance,t)),t>=0&&(this._maxDistance=Math.min(this._maxDistance,t))}_updateIntersectDistanceConstraint(t){const i=V(t),h=this._edgeDirection,a=g(f(),this._left.start,this._left.direction),o=g(f(),this._right.start,this._right.direction),_=this._pointInBasis2D(r(),i,h,this._left.start),l=this._pointInBasis2D(r(),i,h,a),p=this._pointInBasis2D(r(),i,h,this._right.start),d=this._pointInBasis2D(r(),i,h,o),[m]=T({start:l,end:_,type:1},{start:d,end:p,type:1});if(!m)return;const u=e(r(),_,l);s(u,u);const D=e(r(),m,l),x=n(u,D),N=g(f(),a,c(f(),this._left.direction,-x)),P=b(t,N);this._updateDistanceConstraint(P)}_pointInBasis2D(t,i,e,s){return t[0]=Y(i,s),t[1]=Y(e,s),t}_offset(t,i){Number.isFinite(this._minDistance)&&(i=Math.max(this._minDistance,i)),Number.isFinite(this._maxDistance)&&(i=Math.min(this._maxDistance,i)),N(this._offsetPlane,this._plane),this._offsetPlane[3]-=i;const e=(t,i,e)=>null!=i&&P(this._offsetPlane,t,g(f(),t,i),e),s=f();(t===this._edge.leftVertex?e(this._left.start,this._left.direction,s):e(this._right.start,this._right.direction,s))&&this._helper.copy(this._helper.fromXYZ(s,void 0,this._helper.getM(t.pos)),t.pos)}selectArrowFromStartPoint(t){this._selectedArrow=y(this.plane,this._pointToXYZ(t))?1:-1}get selectedArrow(){return this._selectedArrow}signedDistanceToPoint(t){return b(this.plane,this._pointToXYZ(t))}clampedStartAndEnd(i){const e=this._helper.toXYZ(this._helper.pointToVector(i)),s=Z(this._plane,e,f()),n=b(this._plane,e),r=t(n,this._minDistance,this._maxDistance);return d(e,s,e,r/n),{start:s,end:e}}apply(t){this._offset(t,this.distance)}undo(t){this._offset(t,0)}canAccumulate(t){return t instanceof M&&this._edge.leftVertex.index===t._edge.leftVertex.index&&this._edge.rightVertex.index===t._edge.rightVertex.index&&this._edge.part===t._edge.part&&this._maybeEqualsVec3(this._left.direction,t._left.direction)&&this._maybeEqualsVec3(this._right.direction,t._right.direction)&&m(V(this._plane),V(t._plane))}accumulate(t,i){const e=this._plane[3]-i._plane[3]+i.distance;this._offset(t,e)}accumulateParams(t){const i=t.distance-t._plane[3];this.distance=i+this._plane[3]}clone(){const t=new M(this._helper,this._planeType,this._edge,this.distance,1);return N(t._plane,this._plane),N(t._offsetPlane,this._offsetPlane),t._maxDistance=this._maxDistance,t._minDistance=this._minDistance,t._left=this._cloneNeighbor(this._left),t._right=this._cloneNeighbor(this._right),t._edgeDirection=u(f(),this._edgeDirection),t}_maybeEqualsVec3(t,i){return null==t&&null==i||null!=t&&null!=i&&m(t,i)}_cloneNeighbor({start:t,end:i,direction:e,isOriginalDirection:s}){return{start:u(f(),t),end:null!=i?u(f(),i):null,direction:u(f(),e),isOriginalDirection:s}}}const j=i(15),z=.001;export{M as OffsetEdgeVertex};
5
+ import{clamp as t,deg2rad as i}from"../../../../core/mathUtils.js";import{subtract as e,normalize as s,dot as n}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{create as r}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{E as h,h as a,f as o,n as _,j as c,g as l,q as p,i as g,l as d,G as m,d as u}from"../../../../chunks/vec32.js";import{create as f}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{create as D,fromPositionAndNormal as x,signedDistance as b,getNormal as V,copy as N,intersectLine as P,isPointInside as y,projectPoint as Z}from"../../../../geometry/support/plane.js";import{angle as X,projectPointSignedLength as Y}from"../../../../geometry/support/vector.js";import{intersectLineAndRay as T}from"../../../support/geometry2dUtils.js";class M{get plane(){return this._plane}get requiresSplitEdgeLeft(){return!this._left.isOriginalDirection}get requiresSplitEdgeRight(){return!this._right.isOriginalDirection}get edgeDirection(){return this._edgeDirection}constructor(t,i,e,s=0,n=0){this._helper=t,this._planeType=i,this._edge=e,this.distance=s,this._plane=D(),this._offsetPlane=D(),this._minDistance=-1/0,this._maxDistance=1/0,this._selectedArrow=1,0===n&&this._initialize()}_initialize(){this._initializeNeighbors(),this._initializePlane(),this._initializeDistanceConstraints()}_initializeNeighbors(){const t=this._toXYZ(this._edge.leftVertex.pos),i=this._toXYZ(this._edge.leftVertex.leftSegment?.leftVertex?.pos),e=this._toXYZ(this._edge.rightVertex.pos),s=this._toXYZ(this._edge.rightVertex.rightSegment?.rightVertex?.pos);this._edgeDirection=h(f(),t,e),i?(this._left=this._computeNeighbor(t,i,this._edgeDirection),this._right=this._computeNeighbor(e,s,this._edgeDirection,this._left)):(this._right=this._computeNeighbor(e,s,this._edgeDirection),this._left=this._computeNeighbor(t,i,this._edgeDirection,this._right))}_toXYZ(t){return null!=t?this._helper.toXYZ(t):null}_pointToXYZ(t){return this._toXYZ(this._helper.pointToVector(t))}_computeNeighbor(t,i,e,s){const n=f();if(i){h(n,t,i);const s=!this._passesBisectingAngleThreshold(n,e);return{start:t,end:i,direction:s?this._bisectVectorsPerpendicular(e,n):n,isOriginalDirection:!s}}return this._helper.hasZ()?s&&(o(n,e,s.direction),o(n,n,e),_(n,n),Math.sign(n[1])!==Math.sign(e[0])&&c(n,n,-1)):a(n,-e[1],e[0],0),{start:t,end:i,direction:n,isOriginalDirection:!0}}_passesBisectingAngleThreshold(t,i){const e=Math.abs(X(i,t));return e>=j&&e<=Math.PI-j}_bisectVectorsPerpendicular(t,i){const e=l(t,i)<0?t:p(f(),t),s=Math.abs(l(e,i));if(!(s<z||s>1-z))return this._bisectDirection(e,i);const n=o(f(),e,[0,0,1]);return _(n,n)}_bisectDirection(t,i){const e=g(f(),t,i);return _(e,e)}_initializePlane(){const t=this._computeNormalDirection(this._left),i=this._computeNormalDirection(this._right);l(t,i)<0&&p(i,i),x(this._left.start,this._bisectDirection(t,i),this._plane)}_computeNormalDirection(t){const i=o(f(),t.direction,this._edgeDirection);_(i,i);const e=o(f(),this._edgeDirection,i);return 1===this._planeType&&(e[2]=0),_(e,e)}_initializeDistanceConstraints(){null==this._left.end||this.requiresSplitEdgeLeft||this._updateDistanceConstraint(b(this._plane,this._left.end)),null==this._right.end||this.requiresSplitEdgeRight||this._updateDistanceConstraint(b(this._plane,this._right.end)),this._updateIntersectDistanceConstraint(this._plane)}_updateDistanceConstraint(t){t<=0&&(this._minDistance=Math.max(this._minDistance,t)),t>=0&&(this._maxDistance=Math.min(this._maxDistance,t))}_updateIntersectDistanceConstraint(t){const i=V(t),h=this._edgeDirection,a=g(f(),this._left.start,this._left.direction),o=g(f(),this._right.start,this._right.direction),_=this._pointInBasis2D(r(),i,h,this._left.start),l=this._pointInBasis2D(r(),i,h,a),p=this._pointInBasis2D(r(),i,h,this._right.start),d=this._pointInBasis2D(r(),i,h,o),[m]=T({start:l,end:_,type:1},{start:d,end:p,type:1});if(!m)return;const u=e(r(),_,l);s(u,u);const D=e(r(),m,l),x=n(u,D),N=g(f(),a,c(f(),this._left.direction,-x)),P=b(t,N);this._updateDistanceConstraint(P)}_pointInBasis2D(t,i,e,s){return t[0]=Y(i,s),t[1]=Y(e,s),t}_offset(t,i){Number.isFinite(this._minDistance)&&(i=Math.max(this._minDistance,i)),Number.isFinite(this._maxDistance)&&(i=Math.min(this._maxDistance,i)),N(this._offsetPlane,this._plane),this._offsetPlane[3]-=i;const e=(t,i,e)=>null!=i&&P(this._offsetPlane,t,g(f(),t,i),e),s=f();(t===this._edge.leftVertex?e(this._left.start,this._left.direction,s):e(this._right.start,this._right.direction,s))&&this._helper.copy(this._helper.fromXYZ(s,void 0,this._helper.getM(t.pos)),t.pos)}selectArrowFromStartPoint(t){this._selectedArrow=y(this.plane,this._pointToXYZ(t))?1:-1}get selectedArrow(){return this._selectedArrow}signedDistanceToPoint(t){return b(this.plane,this._pointToXYZ(t))}clampedStartAndEnd(i){const e=this._helper.toXYZ(this._helper.pointToVector(i)),s=Z(this._plane,e,f()),n=b(this._plane,e),r=t(n,this._minDistance,this._maxDistance);return d(e,s,e,r/n),{start:s,end:e}}apply(t){this._offset(t,this.distance)}undo(t){this._offset(t,0)}canAccumulate(t){return t instanceof M&&this._edge.leftVertex.index===t._edge.leftVertex.index&&this._edge.rightVertex.index===t._edge.rightVertex.index&&this._edge.part===t._edge.part&&this._maybeEqualsVec3(this._left.direction,t._left.direction)&&this._maybeEqualsVec3(this._right.direction,t._right.direction)&&m(V(this._plane),V(t._plane))}accumulate(t,i){const e=this._plane[3]-i._plane[3]+i.distance;this._offset(t,e)}accumulateParams(t){const i=t.distance-t._plane[3];this.distance=i+this._plane[3]}clone(){const t=new M(this._helper,this._planeType,this._edge,this.distance,1);return N(t._plane,this._plane),N(t._offsetPlane,this._offsetPlane),t._maxDistance=this._maxDistance,t._minDistance=this._minDistance,t._left=this._cloneNeighbor(this._left),t._right=this._cloneNeighbor(this._right),t._edgeDirection=u(f(),this._edgeDirection),t}_maybeEqualsVec3(t,i){return null==t&&null==i||null!=t&&null!=i&&m(t,i)}_cloneNeighbor({start:t,end:i,direction:e,isOriginalDirection:s}){return{start:u(f(),t),end:null!=i?u(f(),i):null,direction:u(f(),e),isOriginalDirection:s}}}const j=i(15),z=.001;export{M as OffsetEdgeVertex};
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{isSome as t,equals as e}from"../../../core/arrayUtils.js";import{asinClamped as s}from"../../../core/mathUtils.js";import{dot as r,subtract as n,squaredDistance as i,exactEquals as o,set as c}from"../../../core/libs/gl-matrix-2/math/vec2.js";import{create as u}from"../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{m as a,d as h,h as f,e as l,F as d,c as p,s as m,a as g,E as _,g as k,f as L,n as x}from"../../../chunks/vec32.js";import{create as y,UNIT_Z as z,fromValues as M,clone as P}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{c as T,h as q}from"../../../chunks/vec42.js";import{create as w}from"../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{directGeodeticSolver as j,inverseGeodeticSolver as v,InverseGeodeticSolverResult as D}from"../../../geometry/geodesicUtils.js";import{toRadians as b}from"../../../geometry/support/geodesicConstants.js";import{create as R,fromPoints as A,fromPositionAndNormal as Z,intersectLine as U,signedDistance as E,projectPoint as I,getNormal as S,distance as C}from"../../../geometry/support/plane.js";import{Sphere as G}from"../../../geometry/support/sphere.js";import{tangentFrame as O}from"../../3d/support/mathUtils.js";import{clone as F,asVec2 as V,createWritable as B,create as H,fromValues as J,fromVec3 as K}from"./normalizedPoint.js";import{projectPointToVerticalPlane as N,isClose as Q,projectPointToVerticalCylinder as W,projectPointToLineLike as X,intersectLineLikes as Y,intersectVerticalPlaneAndLineLike as $,intersectLineLikeAndVerticalCylinder as tt,intersectLineLikeAndCircle as et,intersectVerticalPlanes as st,intersectVerticalPlaneAndVerticalCylinder as rt,intersectVerticalCylinders as nt,intersectVerticalPlaneAndPoint as it,vectorsHaveCloseZ as ot,isPointInsidePlane as ct,pointsInsidePlane as ut}from"../../support/geometry3dUtils.js";class at{intersect(t){return St(this,t)}closestPoints(t){return[this.closestTo(t)]}}class ht extends at{constructor(t){super(),this.point=t}equals(t){return this===t||le(t)&&a(this.point,t.point)}closestTo(){return F(this.point)}}class ft extends at{constructor(t,e,s){super(),this.start=t,this.end=e,this.lineLike={start:t,end:e,type:s}}equals(t){return this===t||de(t)&&this.lineLike.type===t.lineLike.type&&a(this.start,t.start)&&a(this.end,t.end)}closestTo(t){const e=B();return X(t,this.lineLike,e),e}}class lt extends ft{constructor(t,e){super(t,e,1)}}class dt extends ft{constructor(t,e){super(t,e,0)}}class pt extends at{constructor(t){super(),this.constraints=t}equals(t){return this===t||fe(t)&&e(this.constraints,t.constraints,(t,e)=>t.equals(e))}closestTo(t){let e,s=1/0;for(const r of this.constraints){const n=r.closestTo(t),i=m(t,n);i<s&&(s=i,e=n)}return F(e??t)}closestPoints(t){return this.constraints.flatMap(e=>e===this?[]:e.closestPoints(t))}}class mt extends at{constructor(t,e){super(),this.center=t,this.radius=e}equals(t){return this===t||ge(t)&&this.center[0]===t.center[0]&&this.center[1]===t.center[1]&&this.radius===t.radius}closestTo(t){const e=B();return W(t,this.center,this.radius,e),e}}class gt extends at{constructor(t,e){super(),this.center=t,this.radius=e}equals(t){return this===t||_e(t)&&a(this.center,t.center)&&this.radius===t.radius}closestTo(t){const e=B();return W(t,this.center,this.radius,e),e[2]=this.center[2],e}asCircle(){return new _t(F(this.center),this.radius,J(0,0,1))}}class _t extends at{constructor(t,e,s,r){super(),this.center=t,this.radius=e,this.normal=s,this.slicePlane=r}equals(t){return this===t||ke(t)&&a(this.center,t.center)&&a(this.normal,t.normal)&&this.radius===t.radius}closestTo(t){const{center:e,radius:s}=this;I(this.getPlane(Lt),t,kt);const r=g(kt,kt,e),n=_(r);if(Q(n,0))return F(t);const i=s/Math.sqrt(n),o=B();p(o,e,r,i);const{slicePlane:c}=this;if(c&&!ct(c,o)){const e=Ft(c,this);return e?.closestTo(t)??F(t)}return o}getPlane(t=R()){return Z(this.center,this.normal,t)}}const kt=y(),Lt=R();class xt extends at{constructor(t){super(),this.z=t}equals(t){return this===t||pe(t)&&this.z===t.z}closestTo(t){return J(t[0],t[1],this.z)}getPlane(t=R()){return f(yt,0,0,this.z),Z(yt,z,t)}}const yt=y();class zt extends at{constructor(t,e,s){super(),this.start=t,this.end=e,this.planeLike={start:V(t),end:V(e),type:s}}equals(t){return this===t||me(t)&&this.planeLike.type===t.planeLike.type&&a(this.start,t.start)&&a(this.end,t.end)}closestTo(t){const e=B();return N(t,this.planeLike,e),e}closestEndTo(t){const{start:e,end:s}=this.planeLike;return Math.sign(r(n(Mt,s,e),n(Pt,V(t),e)))>0?this.end:this.start}getPlane(t=R()){const e=h(Tt,this.end);return e[2]+=1,A(this.start,this.end,e,t)}getSlicePlane(t=R()){const{start:e,end:s,type:r}=this.planeLike;if(0===r)return;const n=f(Tt,e[0],e[1],0),i=f(qt,s[0],s[1],0),o=l(qt,i,n);return Z(n,o,t),t}}const Mt=u(),Pt=u(),Tt=y(),qt=y();class wt extends zt{constructor(t,e){super(t,e,1)}}class jt extends zt{constructor(t,e){super(t,e,0)}}class vt extends at{constructor(t,e){super(),this.sphere=new G(t,e),this._center=P(t)}equals(t){return this===t||Le(t)&&this.sphere.exactEquals(t.sphere)}closestTo(t){const e=B();return this.sphere.projectPoint(t,e),e}get center(){return this._center}get radius(){return this.sphere.radius}}class Dt extends at{constructor(t,e,s){super(),this.start=t,this.end=e,this.getZ=s,this.planeLike={start:V(t),end:V(e),type:0}}equals(t){return this===t||xe(t)&&a(this.start,t.start)&&a(this.end,t.end)&&this.getZ===t.getZ}closestTo(t){return It(this,t)}addIfOnTheGround(t,e){for(const s of e){const e=this.getZ(s[0],s[1])??0;Q(s[2],e)&&(s[2]=e,t.push(s))}}}class bt extends at{constructor(t,e,s){super(),this._x=t,this._y=e,this._z=s}equals(t){return this===t||ze(t)&&this._x===t._x&&this._y===t._y&&this._z===t._z}closestTo([t,e,s]){return H(this._x??t,this._y??e,this._z??s)}}class Rt extends at{constructor(t,e,s,r,n){super(),this._origin=t,this._spatialReference=e,this._distanceMeters=s,this._z=r,this._directionDegrees=n}equals(t){return this===t||ye(t)&&o(this._origin,t._origin)&&this._spatialReference===t._spatialReference&&this._distanceMeters===t._distanceMeters&&this._z===t._z&&this._directionDegrees===t._directionDegrees}closestTo([t,e,s]){return c(At,t,e),o(At,this._origin)||this._applyDirectionAndDistance(At),H(At[0],At[1],this._z??s)}_applyDirectionAndDistance(t){if(null!=this._directionDegrees&&null!=this._distanceMeters)j(t,this._origin,this._directionDegrees,this._distanceMeters,this._spatialReference);else if(null!=this._directionDegrees)Ut(t,this._origin,this._directionDegrees,t,this._spatialReference);else if(null!=this._distanceMeters){const{azimuth:e}=v(Zt,this._origin,t,this._spatialReference);j(t,this._origin,e??0,this._distanceMeters,this._spatialReference)}}}const At=[0,0],Zt=new D;function Ut(t,e,s,r,n){let{azimuth:i,distance:o}=v(Et,e,r,n);i??=0;let c=o*Math.cos((i-s)*b);c=Math.max(0,c),j(t,e,s,c,n)}const Et=new D;function It(t,e){const s=B();return N(e,t.planeLike,s),s[2]=t.getZ(s[0],s[1])??Me,s}function St(t,e){if(fe(t)){const s=[];for(const r of t.constraints){const t=r.intersect(e);t&&s.push(t)}return he(s)}if(fe(e))return St(e,t);if(xe(t))return oe(t,e);if(xe(e))return oe(e,t);if(le(t)){const{point:s}=t;if(le(e))return a(s,e.point)?t:void 0;const r=e.closestTo(s);return d(r,s)?t:void 0}if(de(t)){if(le(e))return St(e,t);if(de(e))return ue(Y(t.lineLike,e.lineLike));if(pe(e))return Ct(t,e);if(me(e))return ue($(e.planeLike,t.lineLike));if(ge(e))return ue(tt(t.lineLike,e.center,e.radius));if(ke(e))return ue(et(t.lineLike,e));if(_e(e))return Gt(t,e);if(Le(e))return Ot(t,e)}else if(pe(t)){if(le(e)||de(e))return St(e,t);if(pe(e))return Vt(t,e);if(me(e))return Bt(t,e);if(ge(e))return Ht(t,e);if(ke(e))return Kt(t,e);if(_e(e))return Jt(t,e);if(Le(e))return Nt(t,e)}else if(me(t)){if(le(e)||de(e)||pe(e))return St(e,t);if(me(e))return ce(st(t.planeLike,e.planeLike));if(ge(e))return ce(rt(t.planeLike,e.center,e.radius));if(ke(e))return Wt(t,e);if(_e(e))return Qt(t,e);if(Le(e))return Xt(t,e)}else if(ge(t)){if(le(e)||de(e)||pe(e)||me(e))return St(e,t);if(ge(e))return ce(nt(V(t.center),t.radius,V(e.center),e.radius));if(ke(e))return Yt();if(_e(e))return $t(t,e);if(Le(e))return te()}else if(ke(t)){if(le(e)||de(e)||pe(e)||me(e)||ge(e))return St(e,t);if(ke(e))return ee();if(_e(e))return ee(e.asCircle());if(Le(e))return se()}else if(_e(t)){if(le(e)||de(e)||pe(e)||me(e)||ge(e)||ke(e))return St(e,t);if(_e(e))return re(e,t);if(Le(e))return ne()}else if(Le(t)){if(le(e)||de(e)||pe(e)||me(e)||ge(e)||_e(e))return St(e,t);if(Le(e))return ie()}}const Ct=(()=>{const t=R();return(e,s)=>{const{start:r,end:n}=e;if(ot(r,n)&&Q(r[2],s.z))return e;const i=B();return U(s.getPlane(t),r,n,i)?new ht(i):void 0}})();function Gt({lineLike:t},{center:e,radius:s}){const r=e[2];return ue(tt(t,e,s).filter(t=>Q(t[2],r)))}function Ot({lineLike:t},{sphere:e}){return ue(e.intersectLine(t.start,t.end))}const Ft=(()=>{const t=w(),e=y(),r=y();return(n,i,o)=>{const{normal:c,center:u,radius:a}=i;O(c,e,r);const h=S(n),f=a*k(h,e),l=a*k(h,r);T(t,u[0],u[1],u[2],1);const d=q(n,t),m=Math.hypot(f,l),g=Q(m,0);if(Q(C(n,u),0)){if(g)return i;if(Q(a,0))return!o||ct(o,u)?new ht(F(u)):void 0;L(e,h,c),x(e,e);const t=new Array,s=P(u);p(s,s,e,a),o&&!ct(o,s)||t.push(s);const r=P(u);return p(r,r,e,-a),o&&!ct(o,r)||t.push(r),ue(t)}if(g)return;const _=-d/m;if(Math.abs(_)>1||Q(_,1))return;const z=Math.atan(f/l),M=s(_)-z,w=Math.PI-M,j=new Array,v=y();p(v,u,e,a*Math.cos(M)),p(v,v,r,a*Math.sin(M)),j.push(v);const D=y();return p(D,u,e,a*Math.cos(w)),p(D,D,r,a*Math.sin(w)),j.push(D),ue(o?ut(o,j):j)}})();function Vt(t,e){return Q(t.z,e.z)?t:void 0}function Bt({z:t},{planeLike:e}){const[s,r]=e.start,[n,i]=e.end,o=J(s,r,t),c=J(n,i,t);return 0===e.type?new lt(o,c):new dt(o,c)}function Ht(t,e){const[s,r]=e.center;return new gt(J(s,r,t.z),e.radius)}function Jt(t,e){return Q(e.center[2],t.z)?e:void 0}const Kt=(()=>{const t=R();return(e,s)=>Ft(e.getPlane(t),s,s.slicePlane)})();function Nt(t,{center:e,radius:s}){const r=Math.abs(e[2]-t.z);if(r>s&&!Q(r,s))return;const n=J(e[0],e[1],t.z),i=Math.sqrt(s**2-r**2);return Q(i,0)?void 0:new gt(n,i)}const Qt=(()=>{const t=R();return(e,{center:s,radius:r})=>{const n=rt(e.planeLike,s,r),i=s[2];e.getSlicePlane(t);const o=new Array;for(const[c,u]of n){const e=[c,u,i];ct(t,e)&&o.push(e)}return ue(o)}})(),Wt=(()=>{const t=R(),e=R();return(s,r)=>Ft(s.getPlane(t),r,s.getSlicePlane(e))})(),Xt=(()=>{const t=R();return(e,{center:s,radius:r})=>{const n=e.getPlane(t),i=E(n,s),o=Math.abs(i);if(o>r&&!Q(o,r))return;const c=Math.sqrt(r**2-i**2);if(Q(c,0)){const t=B();return I(n,s,t),new ht(t)}const u=B(),a=P(S(n));return p(u,s,a,i),new _t(u,c,a,e.getSlicePlane())}})();function Yt(t,e){}function $t(t,e){const s=i(V(t.center),V(e.center));if(Q(s,0)&&Q(t.radius,e.radius))return e;return ae(nt(V(t.center),t.radius,V(e.center),e.radius),e.center[2])}function te(t,e){}function ee(t,e){}function se(t,e){}function re(t,e){if(!ot(t.center,e.center))return;const s=i(V(t.center),V(e.center));if(Q(s,0)&&Q(t.radius,e.radius))return t;return ae(nt(V(t.center),t.radius,V(e.center),e.radius),t.center[2])}function ne(t,e){}function ie(t,e){}function oe(t,e){const{planeLike:s,getZ:r}=t,n=new Array;if(le(e))t.addIfOnTheGround(n,it(s,e.point));else if(de(e))t.addIfOnTheGround(n,$(s,e.lineLike));else if(ge(e))for(const[i,o]of rt(s,e.center,e.radius)){const t=r(i,o);null!=t&&n.push(M(i,o,t))}else if(me(e)||xe(e))for(const[i,o]of st(s,e.planeLike)){const t=r(i,o)??Me;n.push(M(i,o,t))}return ue(n)}function ce(t){return he(t.map(([t,e])=>{const s=J(t,e,0),r=J(t,e,1);return new lt(s,r)}))}function ue(t){return he(t.map(t=>t?new ht(K(t)):void 0))}function ae(t,e){return ue(t.map(([t,s])=>[t,s,e]))}function he(e){if(0!==e.length)return 1===e.length?e[0]??void 0:new pt(e.filter(t))}function fe(t){return t instanceof pt}function le(t){return t instanceof ht}function de(t){return t instanceof ft}function pe(t){return t instanceof xt}function me(t){return t instanceof zt}function ge(t){return t instanceof mt}function _e(t){return t instanceof gt}function ke(t){return t instanceof _t}function Le(t){return t instanceof vt}function xe(t){return t instanceof Dt}function ye(t){return t instanceof Rt}function ze(t){return t instanceof bt}const Me=0;export{_t as CircleConstraint,at as Constraint,bt as CoordinateConstraint,Dt as DrapedLineConstraint,Rt as GeodesicConstraint,gt as HorizontalCircleConstraint,xt as HorizontalPlaneConstraint,lt as LineConstraint,ft as LineLikeConstraint,ht as PointConstraint,dt as RayConstraint,pt as SetConstraint,vt as SphereConstraint,mt as VerticalCylinderConstraint,wt as VerticalHalfPlaneConstraint,jt as VerticalPlaneConstraint,zt as VerticalPlaneLikeConstraint,he as constraintOrSet,le as isPoint};
5
+ import{isSome as t,equals as e}from"../../../core/arrayUtils.js";import{asinClamped as s}from"../../../core/mathUtils.js";import{dot as r,subtract as n,squaredDistance as i,exactEquals as o,set as c}from"../../../core/libs/gl-matrix-2/math/vec2.js";import{create as u}from"../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{m as a,d as h,h as f,e as l,G as d,c as p,s as m,a as g,F as _,g as k,f as L,n as x}from"../../../chunks/vec32.js";import{create as y,UNIT_Z as z,fromValues as M,clone as P}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{c as T,h as q}from"../../../chunks/vec42.js";import{create as w}from"../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{directGeodeticSolver as j,inverseGeodeticSolver as v,InverseGeodeticSolverResult as D}from"../../../geometry/geodesicUtils.js";import{toRadians as b}from"../../../geometry/support/geodesicConstants.js";import{create as R,fromPoints as A,fromPositionAndNormal as Z,intersectLine as U,signedDistance as G,projectPoint as I,getNormal as S,distance as C}from"../../../geometry/support/plane.js";import{Sphere as E}from"../../../geometry/support/sphere.js";import{tangentFrame as O}from"../../3d/support/mathUtils.js";import{clone as F,asVec2 as V,createWritable as B,create as H,fromValues as J,fromVec3 as K}from"./normalizedPoint.js";import{projectPointToVerticalPlane as N,isClose as Q,projectPointToVerticalCylinder as W,projectPointToLineLike as X,intersectLineLikes as Y,intersectVerticalPlaneAndLineLike as $,intersectLineLikeAndVerticalCylinder as tt,intersectLineLikeAndCircle as et,intersectVerticalPlanes as st,intersectVerticalPlaneAndVerticalCylinder as rt,intersectVerticalCylinders as nt,intersectVerticalPlaneAndPoint as it,vectorsHaveCloseZ as ot,isPointInsidePlane as ct,pointsInsidePlane as ut}from"../../support/geometry3dUtils.js";class at{intersect(t){return St(this,t)}closestPoints(t){return[this.closestTo(t)]}}class ht extends at{constructor(t){super(),this.point=t}equals(t){return this===t||le(t)&&a(this.point,t.point)}closestTo(){return F(this.point)}}class ft extends at{constructor(t,e,s){super(),this.start=t,this.end=e,this.lineLike={start:t,end:e,type:s}}equals(t){return this===t||de(t)&&this.lineLike.type===t.lineLike.type&&a(this.start,t.start)&&a(this.end,t.end)}closestTo(t){const e=B();return X(t,this.lineLike,e),e}}class lt extends ft{constructor(t,e){super(t,e,1)}}class dt extends ft{constructor(t,e){super(t,e,0)}}class pt extends at{constructor(t){super(),this.constraints=t}equals(t){return this===t||fe(t)&&e(this.constraints,t.constraints,(t,e)=>t.equals(e))}closestTo(t){let e,s=1/0;for(const r of this.constraints){const n=r.closestTo(t),i=m(t,n);i<s&&(s=i,e=n)}return F(e??t)}closestPoints(t){return this.constraints.flatMap(e=>e===this?[]:e.closestPoints(t))}}class mt extends at{constructor(t,e){super(),this.center=t,this.radius=e}equals(t){return this===t||ge(t)&&this.center[0]===t.center[0]&&this.center[1]===t.center[1]&&this.radius===t.radius}closestTo(t){const e=B();return W(t,this.center,this.radius,e),e}}class gt extends at{constructor(t,e){super(),this.center=t,this.radius=e}equals(t){return this===t||_e(t)&&a(this.center,t.center)&&this.radius===t.radius}closestTo(t){const e=B();return W(t,this.center,this.radius,e),e[2]=this.center[2],e}asCircle(){return new _t(F(this.center),this.radius,J(0,0,1))}}class _t extends at{constructor(t,e,s,r){super(),this.center=t,this.radius=e,this.normal=s,this.slicePlane=r}equals(t){return this===t||ke(t)&&a(this.center,t.center)&&a(this.normal,t.normal)&&this.radius===t.radius}closestTo(t){const{center:e,radius:s}=this;I(this.getPlane(Lt),t,kt);const r=g(kt,kt,e),n=_(r);if(Q(n,0))return F(t);const i=s/Math.sqrt(n),o=B();p(o,e,r,i);const{slicePlane:c}=this;if(c&&!ct(c,o)){const e=Ft(c,this);return e?.closestTo(t)??F(t)}return o}getPlane(t=R()){return Z(this.center,this.normal,t)}}const kt=y(),Lt=R();class xt extends at{constructor(t){super(),this.z=t}equals(t){return this===t||pe(t)&&this.z===t.z}closestTo(t){return J(t[0],t[1],this.z)}getPlane(t=R()){return f(yt,0,0,this.z),Z(yt,z,t)}}const yt=y();class zt extends at{constructor(t,e,s){super(),this.start=t,this.end=e,this.planeLike={start:V(t),end:V(e),type:s}}equals(t){return this===t||me(t)&&this.planeLike.type===t.planeLike.type&&a(this.start,t.start)&&a(this.end,t.end)}closestTo(t){const e=B();return N(t,this.planeLike,e),e}closestEndTo(t){const{start:e,end:s}=this.planeLike;return Math.sign(r(n(Mt,s,e),n(Pt,V(t),e)))>0?this.end:this.start}getPlane(t=R()){const e=h(Tt,this.end);return e[2]+=1,A(this.start,this.end,e,t)}getSlicePlane(t=R()){const{start:e,end:s,type:r}=this.planeLike;if(0===r)return;const n=f(Tt,e[0],e[1],0),i=f(qt,s[0],s[1],0),o=l(qt,i,n);return Z(n,o,t),t}}const Mt=u(),Pt=u(),Tt=y(),qt=y();class wt extends zt{constructor(t,e){super(t,e,1)}}class jt extends zt{constructor(t,e){super(t,e,0)}}class vt extends at{constructor(t,e){super(),this.sphere=new E(t,e),this._center=P(t)}equals(t){return this===t||Le(t)&&this.sphere.exactEquals(t.sphere)}closestTo(t){const e=B();return this.sphere.projectPoint(t,e),e}get center(){return this._center}get radius(){return this.sphere.radius}}class Dt extends at{constructor(t,e,s){super(),this.start=t,this.end=e,this.getZ=s,this.planeLike={start:V(t),end:V(e),type:0}}equals(t){return this===t||xe(t)&&a(this.start,t.start)&&a(this.end,t.end)&&this.getZ===t.getZ}closestTo(t){return It(this,t)}addIfOnTheGround(t,e){for(const s of e){const e=this.getZ(s[0],s[1])??0;Q(s[2],e)&&(s[2]=e,t.push(s))}}}class bt extends at{constructor(t,e,s){super(),this._x=t,this._y=e,this._z=s}equals(t){return this===t||ze(t)&&this._x===t._x&&this._y===t._y&&this._z===t._z}closestTo([t,e,s]){return H(this._x??t,this._y??e,this._z??s)}}class Rt extends at{constructor(t,e,s,r,n){super(),this._origin=t,this._spatialReference=e,this._distanceMeters=s,this._z=r,this._directionDegrees=n}equals(t){return this===t||ye(t)&&o(this._origin,t._origin)&&this._spatialReference===t._spatialReference&&this._distanceMeters===t._distanceMeters&&this._z===t._z&&this._directionDegrees===t._directionDegrees}closestTo([t,e,s]){return c(At,t,e),o(At,this._origin)||this._applyDirectionAndDistance(At),H(At[0],At[1],this._z??s)}_applyDirectionAndDistance(t){if(null!=this._directionDegrees&&null!=this._distanceMeters)j(t,this._origin,this._directionDegrees,this._distanceMeters,this._spatialReference);else if(null!=this._directionDegrees)Ut(t,this._origin,this._directionDegrees,t,this._spatialReference);else if(null!=this._distanceMeters){const{azimuth:e}=v(Zt,this._origin,t,this._spatialReference);j(t,this._origin,e??0,this._distanceMeters,this._spatialReference)}}}const At=[0,0],Zt=new D;function Ut(t,e,s,r,n){let{azimuth:i,distance:o}=v(Gt,e,r,n);i??=0;let c=o*Math.cos((i-s)*b);c=Math.max(0,c),j(t,e,s,c,n)}const Gt=new D;function It(t,e){const s=B();return N(e,t.planeLike,s),s[2]=t.getZ(s[0],s[1])??Me,s}function St(t,e){if(fe(t)){const s=[];for(const r of t.constraints){const t=r.intersect(e);t&&s.push(t)}return he(s)}if(fe(e))return St(e,t);if(xe(t))return oe(t,e);if(xe(e))return oe(e,t);if(le(t)){const{point:s}=t;if(le(e))return a(s,e.point)?t:void 0;const r=e.closestTo(s);return d(r,s)?t:void 0}if(de(t)){if(le(e))return St(e,t);if(de(e))return ue(Y(t.lineLike,e.lineLike));if(pe(e))return Ct(t,e);if(me(e))return ue($(e.planeLike,t.lineLike));if(ge(e))return ue(tt(t.lineLike,e.center,e.radius));if(ke(e))return ue(et(t.lineLike,e));if(_e(e))return Et(t,e);if(Le(e))return Ot(t,e)}else if(pe(t)){if(le(e)||de(e))return St(e,t);if(pe(e))return Vt(t,e);if(me(e))return Bt(t,e);if(ge(e))return Ht(t,e);if(ke(e))return Kt(t,e);if(_e(e))return Jt(t,e);if(Le(e))return Nt(t,e)}else if(me(t)){if(le(e)||de(e)||pe(e))return St(e,t);if(me(e))return ce(st(t.planeLike,e.planeLike));if(ge(e))return ce(rt(t.planeLike,e.center,e.radius));if(ke(e))return Wt(t,e);if(_e(e))return Qt(t,e);if(Le(e))return Xt(t,e)}else if(ge(t)){if(le(e)||de(e)||pe(e)||me(e))return St(e,t);if(ge(e))return ce(nt(V(t.center),t.radius,V(e.center),e.radius));if(ke(e))return Yt();if(_e(e))return $t(t,e);if(Le(e))return te()}else if(ke(t)){if(le(e)||de(e)||pe(e)||me(e)||ge(e))return St(e,t);if(ke(e))return ee();if(_e(e))return ee(e.asCircle());if(Le(e))return se()}else if(_e(t)){if(le(e)||de(e)||pe(e)||me(e)||ge(e)||ke(e))return St(e,t);if(_e(e))return re(e,t);if(Le(e))return ne()}else if(Le(t)){if(le(e)||de(e)||pe(e)||me(e)||ge(e)||_e(e))return St(e,t);if(Le(e))return ie()}}const Ct=(()=>{const t=R();return(e,s)=>{const{start:r,end:n}=e;if(ot(r,n)&&Q(r[2],s.z))return e;const i=B();return U(s.getPlane(t),r,n,i)?new ht(i):void 0}})();function Et({lineLike:t},{center:e,radius:s}){const r=e[2];return ue(tt(t,e,s).filter(t=>Q(t[2],r)))}function Ot({lineLike:t},{sphere:e}){return ue(e.intersectLine(t.start,t.end))}const Ft=(()=>{const t=w(),e=y(),r=y();return(n,i,o)=>{const{normal:c,center:u,radius:a}=i;O(c,e,r);const h=S(n),f=a*k(h,e),l=a*k(h,r);T(t,u[0],u[1],u[2],1);const d=q(n,t),m=Math.hypot(f,l),g=Q(m,0);if(Q(C(n,u),0)){if(g)return i;if(Q(a,0))return!o||ct(o,u)?new ht(F(u)):void 0;L(e,h,c),x(e,e);const t=new Array,s=P(u);p(s,s,e,a),o&&!ct(o,s)||t.push(s);const r=P(u);return p(r,r,e,-a),o&&!ct(o,r)||t.push(r),ue(t)}if(g)return;const _=-d/m;if(Math.abs(_)>1||Q(_,1))return;const z=Math.atan(f/l),M=s(_)-z,w=Math.PI-M,j=new Array,v=y();p(v,u,e,a*Math.cos(M)),p(v,v,r,a*Math.sin(M)),j.push(v);const D=y();return p(D,u,e,a*Math.cos(w)),p(D,D,r,a*Math.sin(w)),j.push(D),ue(o?ut(o,j):j)}})();function Vt(t,e){return Q(t.z,e.z)?t:void 0}function Bt({z:t},{planeLike:e}){const[s,r]=e.start,[n,i]=e.end,o=J(s,r,t),c=J(n,i,t);return 0===e.type?new lt(o,c):new dt(o,c)}function Ht(t,e){const[s,r]=e.center;return new gt(J(s,r,t.z),e.radius)}function Jt(t,e){return Q(e.center[2],t.z)?e:void 0}const Kt=(()=>{const t=R();return(e,s)=>Ft(e.getPlane(t),s,s.slicePlane)})();function Nt(t,{center:e,radius:s}){const r=Math.abs(e[2]-t.z);if(r>s&&!Q(r,s))return;const n=J(e[0],e[1],t.z),i=Math.sqrt(s**2-r**2);return Q(i,0)?void 0:new gt(n,i)}const Qt=(()=>{const t=R();return(e,{center:s,radius:r})=>{const n=rt(e.planeLike,s,r),i=s[2];e.getSlicePlane(t);const o=new Array;for(const[c,u]of n){const e=[c,u,i];ct(t,e)&&o.push(e)}return ue(o)}})(),Wt=(()=>{const t=R(),e=R();return(s,r)=>Ft(s.getPlane(t),r,s.getSlicePlane(e))})(),Xt=(()=>{const t=R();return(e,{center:s,radius:r})=>{const n=e.getPlane(t),i=G(n,s),o=Math.abs(i);if(o>r&&!Q(o,r))return;const c=Math.sqrt(r**2-i**2);if(Q(c,0)){const t=B();return I(n,s,t),new ht(t)}const u=B(),a=P(S(n));return p(u,s,a,i),new _t(u,c,a,e.getSlicePlane())}})();function Yt(t,e){}function $t(t,e){const s=i(V(t.center),V(e.center));if(Q(s,0)&&Q(t.radius,e.radius))return e;return ae(nt(V(t.center),t.radius,V(e.center),e.radius),e.center[2])}function te(t,e){}function ee(t,e){}function se(t,e){}function re(t,e){if(!ot(t.center,e.center))return;const s=i(V(t.center),V(e.center));if(Q(s,0)&&Q(t.radius,e.radius))return t;return ae(nt(V(t.center),t.radius,V(e.center),e.radius),t.center[2])}function ne(t,e){}function ie(t,e){}function oe(t,e){const{planeLike:s,getZ:r}=t,n=new Array;if(le(e))t.addIfOnTheGround(n,it(s,e.point));else if(de(e))t.addIfOnTheGround(n,$(s,e.lineLike));else if(ge(e))for(const[i,o]of rt(s,e.center,e.radius)){const t=r(i,o);null!=t&&n.push(M(i,o,t))}else if(me(e)||xe(e))for(const[i,o]of st(s,e.planeLike)){const t=r(i,o)??Me;n.push(M(i,o,t))}return ue(n)}function ce(t){return he(t.map(([t,e])=>{const s=J(t,e,0),r=J(t,e,1);return new lt(s,r)}))}function ue(t){return he(t.map(t=>t?new ht(K(t)):void 0))}function ae(t,e){return ue(t.map(([t,s])=>[t,s,e]))}function he(e){if(0!==e.length)return 1===e.length?e[0]??void 0:new pt(e.filter(t))}function fe(t){return t instanceof pt}function le(t){return t instanceof ht}function de(t){return t instanceof ft}function pe(t){return t instanceof xt}function me(t){return t instanceof zt}function ge(t){return t instanceof mt}function _e(t){return t instanceof gt}function ke(t){return t instanceof _t}function Le(t){return t instanceof vt}function xe(t){return t instanceof Dt}function ye(t){return t instanceof Rt}function ze(t){return t instanceof bt}const Me=0;export{_t as CircleConstraint,at as Constraint,bt as CoordinateConstraint,Dt as DrapedLineConstraint,Rt as GeodesicConstraint,gt as HorizontalCircleConstraint,xt as HorizontalPlaneConstraint,lt as LineConstraint,ft as LineLikeConstraint,ht as PointConstraint,dt as RayConstraint,pt as SetConstraint,vt as SphereConstraint,mt as VerticalCylinderConstraint,wt as VerticalHalfPlaneConstraint,jt as VerticalPlaneConstraint,zt as VerticalPlaneLikeConstraint,he as constraintOrSet,le as isPoint};
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import{throwIfAborted as t}from"../../../../../core/promiseUtils.js";import{generateUID as o}from"../../../../../core/uid.js";import{subclass as s}from"../../../../../core/accessorSupport/decorators.js";import{i as n,C as i}from"../../../../../chunks/vec32.js";import{create as r,clone as c}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{create as d,fromPoints as a,projectPoint as m}from"../../../../../geometry/support/lineSegment.js";import{Sphere as p}from"../../../../../geometry/support/sphere.js";import{Octree as h}from"../../../../3d/webgl-engine/lib/Octree.js";import{extractComponentsEdgeLocationsLayout as u}from"../../../../3d/webgl-engine/lib/edgeRendering/edgeProcessing.js";import{maxCandidateCount as g,boundsFromEdge as l}from"./sceneLayerSnappingUtils.js";import{SnappingCandidateEdge as f,SnappingCandidateVertex as _}from"./SnappingCandidate.js";let b=class{constructor(){this._idToComponent=new Map,this._components=new h(e=>e.bounds),this._edges=new h(e=>e.bounds),this._tmpLineSegment=d(),this._tmpP1=r(),this._tmpP2=r(),this._tmpP3=r(),this.remoteClient=null}async fetchCandidates(e,o){await Promise.resolve(),t(o);const s=e;s.mbs=new p(e.mbsJSON),await this._ensureEdgeLocations(s,o);const n=[];return this._edges.forEachNeighbor(e=>(this._addCandidates(s,e,n),n.length<g),s.mbs),{result:{candidates:n}}}async _ensureEdgeLocations(e,t){const o=[];if(this._components.forEachNeighbor(e=>{if(null==e.info){const{id:t,uid:s}=e;o.push({id:t,uid:s})}return!0},e.mbs),!o.length)return;const s={components:o},n=await this.remoteClient.invoke("fetchAllEdgeLocations",s,t??{});for(const i of n.components)this._setFetchEdgeLocations(i)}async add(e){const t=new C(e.id,new p(e.bounds));return this._idToComponent.set(t.id,t),this._components.add([t]),{result:{}}}async remove(e){const t=this._idToComponent.get(e.id);if(t){const e=[];this._edges.forEachNeighbor(o=>(o.component===t&&e.push(o),!0),t.bounds),this._edges.remove(e),this._components.remove([t]),this._idToComponent.delete(t.id)}return{result:{}}}_setFetchEdgeLocations(e){const t=this._idToComponent.get(e.id);if(null==t||e.uid!==t.uid)return;const o=u.createView(e.locations),s=new Array(o.count),n=r(),i=r();for(let r=0;r<o.count;r++){o.position0.getVec(r,n),o.position1.getVec(r,i);const c=l(n,i,e.origin),d=new S(t,r,c);s[r]=d}this._edges.add(s);const{objectIds:c,origin:d}=e;t.info={locations:o,objectIds:c,origin:d}}_addCandidates(e,t,o){const{info:s}=t.component,{origin:i,objectIds:r}=s,c=s.locations,d=c.position0.getVec(t.index,this._tmpP1),a=c.position1.getVec(t.index,this._tmpP2);n(d,d,i),n(a,a,i);const m=r[c.componentIndex.get(t.index)];this._addEdgeCandidate(e,m,d,a,o),j(e,m,d,o),j(e,m,a,o)}_addEdgeCandidate(e,t,o,s,n){if(!e.returnEdge)return;const r=e.mbs.center,d=a(o,s,this._tmpLineSegment),p=m(d,r,this._tmpP3);e.mbs.contains(p)&&n.push(new f(t,c(p),i(r,p),c(o),c(s)))}};b=e([s("esri.views.interactive.snapping.featureSources.sceneLayerSource.SceneLayerSnappingSourceWorker")],b);const w=b;function j(e,t,o,s){e.returnVertex&&e.mbs.contains(o)&&s.push(new _(t,c(o),i(e.mbs.center,o)))}class C{constructor(e,t){this.id=e,this.bounds=t,this.info=null,this.uid=o()}}class S{constructor(e,t,o){this.component=e,this.index=t,this.bounds=o}}export{w as default};
5
+ import{__decorate as e}from"tslib";import{throwIfAborted as t}from"../../../../../core/promiseUtils.js";import{generateUID as o}from"../../../../../core/uid.js";import{subclass as s}from"../../../../../core/accessorSupport/decorators.js";import{i as n,D as i}from"../../../../../chunks/vec32.js";import{create as r,clone as c}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{create as d,fromPoints as a,projectPoint as m}from"../../../../../geometry/support/lineSegment.js";import{Sphere as p}from"../../../../../geometry/support/sphere.js";import{Octree as h}from"../../../../3d/webgl-engine/lib/Octree.js";import{extractComponentsEdgeLocationsLayout as u}from"../../../../3d/webgl-engine/lib/edgeRendering/edgeProcessing.js";import{maxCandidateCount as g,boundsFromEdge as l}from"./sceneLayerSnappingUtils.js";import{SnappingCandidateEdge as f,SnappingCandidateVertex as _}from"./SnappingCandidate.js";let b=class{constructor(){this._idToComponent=new Map,this._components=new h(e=>e.bounds),this._edges=new h(e=>e.bounds),this._tmpLineSegment=d(),this._tmpP1=r(),this._tmpP2=r(),this._tmpP3=r(),this.remoteClient=null}async fetchCandidates(e,o){await Promise.resolve(),t(o);const s=e;s.mbs=new p(e.mbsJSON),await this._ensureEdgeLocations(s,o);const n=[];return this._edges.forEachNeighbor(e=>(this._addCandidates(s,e,n),n.length<g),s.mbs),{result:{candidates:n}}}async _ensureEdgeLocations(e,t){const o=[];if(this._components.forEachNeighbor(e=>{if(null==e.info){const{id:t,uid:s}=e;o.push({id:t,uid:s})}return!0},e.mbs),!o.length)return;const s={components:o},n=await this.remoteClient.invoke("fetchAllEdgeLocations",s,t??{});for(const i of n.components)this._setFetchEdgeLocations(i)}async add(e){const t=new C(e.id,new p(e.bounds));return this._idToComponent.set(t.id,t),this._components.add([t]),{result:{}}}async remove(e){const t=this._idToComponent.get(e.id);if(t){const e=[];this._edges.forEachNeighbor(o=>(o.component===t&&e.push(o),!0),t.bounds),this._edges.remove(e),this._components.remove([t]),this._idToComponent.delete(t.id)}return{result:{}}}_setFetchEdgeLocations(e){const t=this._idToComponent.get(e.id);if(null==t||e.uid!==t.uid)return;const o=u.createView(e.locations),s=new Array(o.count),n=r(),i=r();for(let r=0;r<o.count;r++){o.position0.getVec(r,n),o.position1.getVec(r,i);const c=l(n,i,e.origin),d=new S(t,r,c);s[r]=d}this._edges.add(s);const{objectIds:c,origin:d}=e;t.info={locations:o,objectIds:c,origin:d}}_addCandidates(e,t,o){const{info:s}=t.component,{origin:i,objectIds:r}=s,c=s.locations,d=c.position0.getVec(t.index,this._tmpP1),a=c.position1.getVec(t.index,this._tmpP2);n(d,d,i),n(a,a,i);const m=r[c.componentIndex.get(t.index)];this._addEdgeCandidate(e,m,d,a,o),j(e,m,d,o),j(e,m,a,o)}_addEdgeCandidate(e,t,o,s,n){if(!e.returnEdge)return;const r=e.mbs.center,d=a(o,s,this._tmpLineSegment),p=m(d,r,this._tmpP3);e.mbs.contains(p)&&n.push(new f(t,c(p),i(r,p),c(o),c(s)))}};b=e([s("esri.views.interactive.snapping.featureSources.sceneLayerSource.SceneLayerSnappingSourceWorker")],b);const w=b;function j(e,t,o,s){e.returnVertex&&e.mbs.contains(o)&&s.push(new _(t,c(o),i(e.mbs.center,o)))}class C{constructor(e,t){this.id=e,this.bounds=t,this.info=null,this.uid=o()}}class S{constructor(e,t,o){this.component=e,this.index=t,this.bounds=o}}export{w 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/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{j as e,c as r,C as t,i as n}from"../../../../../chunks/vec32.js";import{Sphere as c}from"../../../../../geometry/support/sphere.js";const s=1e3;function o(s,o,p){const a=new c;return e(a.center,s,.5),r(a.center,a.center,o,.5),a.radius=t(a.center,s),n(a.center,a.center,p),a}export{o as boundsFromEdge,s as maxCandidateCount};
5
+ import{j as e,c as r,D as t,i as n}from"../../../../../chunks/vec32.js";import{Sphere as c}from"../../../../../geometry/support/sphere.js";const s=1e3;function o(s,o,p){const a=new c;return e(a.center,s,.5),r(a.center,a.center,o,.5),a.radius=t(a.center,s),n(a.center,a.center,p),a}export{o as boundsFromEdge,s as maxCandidateCount};
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{m as t,C as e}from"../../../../chunks/vec32.js";import{SnappingHint as i}from"./SnappingHint.js";class s extends i{constructor(t,e,i,s,n=3,h=!0,a=!0){super(s,n),this.type=t,this.lineStart=e,this.lineEnd=i,this.fadeLeft=h,this.fadeRight=a}equals(e){return e instanceof s&&(this.type===e.type&&t(this.lineStart,e.lineStart)&&t(this.lineEnd,e.lineEnd)&&this.fadeLeft===e.fadeLeft&&this.fadeRight===e.fadeRight)}get length(){return e(this.lineStart,this.lineEnd)}}export{s as LineSnappingHint};
5
+ import{m as t,D as e}from"../../../../chunks/vec32.js";import{SnappingHint as i}from"./SnappingHint.js";class s extends i{constructor(t,e,i,s,n=3,h=!0,a=!0){super(s,n),this.type=t,this.lineStart=e,this.lineEnd=i,this.fadeLeft=h,this.fadeRight=a}equals(e){return e instanceof s&&(this.type===e.type&&t(this.lineStart,e.lineStart)&&t(this.lineEnd,e.lineEnd)&&this.fadeLeft===e.fadeLeft&&this.fadeRight===e.fadeRight)}get length(){return e(this.lineStart,this.lineEnd)}}export{s as LineSnappingHint};
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{createTask as t}from"../../../core/asyncUtils.js";import{handlesGroup as o,makeHandle as e}from"../../../core/handleUtils.js";import{floatEqualUlp as n}from"../../../core/mathUtils.js";import{createAngle as r,createScalar as i,valueInUnit as a}from"../../../core/quantity.js";import{watch as l}from"../../../core/reactiveUtils.js";import{verticalLengthUnitFromSpatialReference as s}from"../../../core/units.js";import{q as u,j as c,F as p}from"../../../chunks/vec32.js";import{UNIT_Z as f,create as m,clone as d,ONES as g}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{isLoaded as y,load as v}from"../../../geometry/coordinateFormatter.js";import j from"../../../geometry/support/MeshTransform.js";import{isRelativeVertexSpace as x}from"../../../geometry/support/meshVertexSpaceUtils.js";import{isWebMercator as b}from"../../../geometry/support/spatialReferenceUtils.js";import{lngLatToXY as h}from"../../../geometry/support/webMercatorUtils.js";import{tooltipKeys as S}from"../keybindings.js";import U from"../Tooltip.js";import{parseLatitudeLongitude as w,parseXY as A}from"./fields/parsingAndFormattingUtils.js";import{getDegreesArithmetic as M,getDegreesGeographic as k}from"../../support/angularMeasurementUtils.js";function R(t){const o=new U(t());return o.addHandles(l(()=>t(),({view:t,options:e,info:n})=>{o.view=t,void 0!==e&&(o.options=e),void 0!==n&&(o.info=n)})),o}function V(t,o){const e=x(o.vertexSpace),{scale:n,orientation:a}=t,{transform:l}=o,s=I(l);e&&null!=s?(a.actual=r(s,"degrees","arithmetic"),a.visible=!0):(a.actual=null,a.visible=!1),e?(n.actual=i(H(l)),n.visible=!0):(n.actual=null,n.visible=!1)}function z(t,o,e){if(!o||!x(o.vertexSpace))return;const n=o.transform??=new j;D(t,n,e),F(t,n,e)}function D(t,o,e){const r=M(t.orientation.actual),i=T(o.rotationAxis);if(null==r||null==i)return;const a=r-90,l=o.rotationAngle,s=a*i,u=s-l;n(l,s)||(e?.onRotateStart(0),o.rotationAngle=s,e?.onRotate(u),e?.onRotateStop(u))}function F(t,o,e){const n=t.scale.actual?.value,r=H(o);if(null==n||n===r)return;const{scale:i}=o;let a;if(0===r)a=d(g);else{const t=n/r;a=c(m(),i,t)}e?.onScaleStart(i[0],i[1],i[2]),o.scale=a,e?.onScale(a[0],a[1],a[2]),e?.onScaleStop(a[0],a[1],a[2])}function P(t,o){const{x:e,y:r,z:i}=o,{x:a,y:l,z:s}=q(t,o.spatialReference);return{dx:null==a||n(a,e)?0:a-e,dy:null==l||n(l,r)?0:l-r,dz:null==s||null==i||n(s,i)?0:s-i}}function q(t,o){let e,n;t.geographic?(e=k(t.longitude.actual),n=k(t.latitude.actual),b(o)&&(null!=e&&null!=n?[e,n]=h(e,n,E):null!=e?e=h(e,0,E)[0]:null!=n&&(n=h(0,n,E)[1]))):(e=t.x.actual?.value,n=t.y.actual?.value);const r=t.elevation.actual,i=s(o);return{x:e,y:n,z:null!=i&&null!=r?a(r,i):void 0}}const E=[0,0];function I(t){const o=90;if(!t)return o;const e=T(t.rotationAxis)??1;return null!=e?o+e*t.rotationAngle:null}function T(t){return p(t,f)?1:p(t,B)?-1:null}const B=u(m(),f);function H(t){return t?Math.max(...t.scale):1}function O(t,o){return!("key-down"!==t.type||t.key!==S.enterInputMode||!o||!C(o.info))&&(o.enterInputMode(),t.preventDefault(),t.stopPropagation(),!0)}function C(t){const o=t?.sketchOptions;if(!o)return!1;const{inputEnabled:e,visibleElements:n}=o.tooltips;return e&&!0===t.editableFields.some(({name:t})=>"x"===t||"y"===t?n.coordinates:n[t])}function G(n,r){let i=null;return o([n.on("paste",o=>{i?.abort(),i=t(async()=>{y()||await v(),J(o,n.info,r)})}),t(()=>v()),e(()=>i?.abort())])}function J(t,o,e){if(!o||!("geographic"in o))return;const n=t.clipboardData?.getData("text");if(!n)return;const r=o=>{t.stopPropagation(),t.preventDefault(),e?.onBeforePaste(),o(),e?.onAfterPaste()};if(o.geographic){const t=w(n);t&&r(()=>{o.longitude.applyValue(t.longitude),o.latitude.applyValue(t.latitude)})}else{const t=A(n);t&&r(()=>{o.x.applyValue(t.x),o.y.applyValue(t.y)})}}export{G as connectPasteEvent,O as enterInputModeIfAvailable,P as getXYZDeltasFromTooltipInfo,R as makeTooltip,J as pasteLocation,z as updateMeshTransformFromTooltipInfo,V as updateTooltipInfoFromMeshTransform};
5
+ import{createTask as t}from"../../../core/asyncUtils.js";import{handlesGroup as o,makeHandle as e}from"../../../core/handleUtils.js";import{floatEqualUlp as n}from"../../../core/mathUtils.js";import{createAngle as r,createScalar as i,valueInUnit as a}from"../../../core/quantity.js";import{watch as l}from"../../../core/reactiveUtils.js";import{verticalLengthUnitFromSpatialReference as s}from"../../../core/units.js";import{q as u,j as c,G as p}from"../../../chunks/vec32.js";import{UNIT_Z as f,create as m,clone as d,ONES as g}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{isLoaded as y,load as v}from"../../../geometry/coordinateFormatter.js";import j from"../../../geometry/support/MeshTransform.js";import{isRelativeVertexSpace as x}from"../../../geometry/support/meshVertexSpaceUtils.js";import{isWebMercator as b}from"../../../geometry/support/spatialReferenceUtils.js";import{lngLatToXY as h}from"../../../geometry/support/webMercatorUtils.js";import{tooltipKeys as S}from"../keybindings.js";import U from"../Tooltip.js";import{parseLatitudeLongitude as w,parseXY as A}from"./fields/parsingAndFormattingUtils.js";import{getDegreesArithmetic as M,getDegreesGeographic as k}from"../../support/angularMeasurementUtils.js";function R(t){const o=new U(t());return o.addHandles(l(()=>t(),({view:t,options:e,info:n})=>{o.view=t,void 0!==e&&(o.options=e),void 0!==n&&(o.info=n)})),o}function V(t,o){const e=x(o.vertexSpace),{scale:n,orientation:a}=t,{transform:l}=o,s=I(l);e&&null!=s?(a.actual=r(s,"degrees","arithmetic"),a.visible=!0):(a.actual=null,a.visible=!1),e?(n.actual=i(G(l)),n.visible=!0):(n.actual=null,n.visible=!1)}function z(t,o,e){if(!o||!x(o.vertexSpace))return;const n=o.transform??=new j;D(t,n,e),P(t,n,e)}function D(t,o,e){const r=M(t.orientation.actual),i=T(o.rotationAxis);if(null==r||null==i)return;const a=r-90,l=o.rotationAngle,s=a*i,u=s-l;n(l,s)||(e?.onRotateStart(0),o.rotationAngle=s,e?.onRotate(u),e?.onRotateStop(u))}function P(t,o,e){const n=t.scale.actual?.value,r=G(o);if(null==n||n===r)return;const{scale:i}=o;let a;if(0===r)a=d(g);else{const t=n/r;a=c(m(),i,t)}e?.onScaleStart(i[0],i[1],i[2]),o.scale=a,e?.onScale(a[0],a[1],a[2]),e?.onScaleStop(a[0],a[1],a[2])}function F(t,o){const{x:e,y:r,z:i}=o,{x:a,y:l,z:s}=q(t,o.spatialReference);return{dx:null==a||n(a,e)?0:a-e,dy:null==l||n(l,r)?0:l-r,dz:null==s||null==i||n(s,i)?0:s-i}}function q(t,o){let e,n;t.geographic?(e=k(t.longitude.actual),n=k(t.latitude.actual),b(o)&&(null!=e&&null!=n?[e,n]=h(e,n,E):null!=e?e=h(e,0,E)[0]:null!=n&&(n=h(0,n,E)[1]))):(e=t.x.actual?.value,n=t.y.actual?.value);const r=t.elevation.actual,i=s(o);return{x:e,y:n,z:null!=i&&null!=r?a(r,i):void 0}}const E=[0,0];function I(t){const o=90;if(!t)return o;const e=T(t.rotationAxis)??1;return null!=e?o+e*t.rotationAngle:null}function T(t){return p(t,f)?1:p(t,B)?-1:null}const B=u(m(),f);function G(t){return t?Math.max(...t.scale):1}function H(t,o){return!("key-down"!==t.type||t.key!==S.enterInputMode||!o||!O(o.info))&&(o.enterInputMode(),t.preventDefault(),t.stopPropagation(),!0)}function O(t){const o=t?.sketchOptions;if(!o)return!1;const{inputEnabled:e,visibleElements:n}=o.tooltips;return e&&!0===t.editableFields.some(({name:t})=>"x"===t||"y"===t?n.coordinates:n[t])}function C(n,r){let i=null;return o([n.on("paste",o=>{i?.abort(),i=t(async()=>{y()||await v(),J(o,n.info,r)})}),t(()=>v()),e(()=>i?.abort())])}function J(t,o,e){if(!o||!("geographic"in o))return;const n=t.clipboardData?.getData("text");if(!n)return;const r=o=>{t.stopPropagation(),t.preventDefault(),e?.onBeforePaste(),o(),e?.onAfterPaste()};if(o.geographic){const t=w(n);t&&r(()=>{o.longitude.applyValue(t.longitude),o.latitude.applyValue(t.latitude)})}else{const t=A(n);t&&r(()=>{o.x.applyValue(t.x),o.y.applyValue(t.y)})}}export{C as connectPasteEvent,H as enterInputModeIfAvailable,F as getXYZDeltasFromTooltipInfo,R as makeTooltip,J as pasteLocation,z as updateMeshTransformFromTooltipInfo,V as updateTooltipInfoFromMeshTransform};
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{create as t}from"../../core/libs/gl-matrix-2/factories/vec2f64.js";import{E as e,n as i,d as s}from"../../chunks/vec32.js";import{create as a}from"../../core/libs/gl-matrix-2/factories/vec3f64.js";import{rotationAngleAndAxisDirectRotation as l,rotationAnglesAndAxesHeadingPreserving as n}from"../3d/state/utils/navigationUtils.js";import{FilteredFiniteDifference as r}from"./FilteredFiniteDifference.js";import{FilteredValue as h}from"./FilteredValue.js";import{Momentum as _}from"./Momentum.js";const m=1e-5;class u extends _{constructor(t,e,i,s,a,l=0,n){super(t,e,i),this._angularVelocity1=s,this.axis1=a,this.angularVelocity2=l,this.axis2=n}value1(t){return super.valueFromInitialVelocity(this._angularVelocity1,t)}value2(t){return super.valueFromInitialVelocity(this.angularVelocity2,t)}}class o{constructor(e=300,i=12,s=.84){this._minimumInitialVelocity=e,this._stopVelocity=i,this._friction=s,this.enabled=!0,this._tmpAxis1=a(),this._tmpAxis2=a(),this._tmpAngles=t(),this._time=new r(.3),this._screen=[new r(.4),new r(.4)],this._angle1=new h(.6),this._angle2=new h(.6),this._axis1=a(),this._axis2=a(),this._lastScene=a()}addMomentumDirectRotation(t,a,n,r,h,_){if(this.enabled){if(this._time.hasLastValue()){if(this._time.computeDelta(n)<.01)return;let t=l(this._lastScene,a,this._tmpAxis2,r,h,_);this._angle2.update(0),e(this._tmpAxis2)<m?t=0:i(this._axis1,this._tmpAxis2),this._angle1.update(t),s(this._lastScene,a)}this._screen[0].update(t[0]),this._screen[1].update(t[1]),this._time.update(n)}}addMomentumPreserveHeading(t,a,l,r,h,_,u){if(this.enabled){if(this._time.hasLastValue()){if(this._time.computeDelta(l)<.01)return;n(this._lastScene,a,this._tmpAxis2,this._tmpAxis1,this._tmpAngles,r,h,_,u,!1),e(this._tmpAxis2)<m?(this._angle1.update(0),this._angle2.update(0)):(this._angle1.update(this._tmpAngles[1]),this._angle2.update(this._tmpAngles[0]),i(this._axis1,this._tmpAxis1),i(this._axis2,this._tmpAxis2)),s(this._lastScene,a)}this._screen[0].update(t[0]),this._screen[1].update(t[1]),this._time.update(l)}}reset(){this._screen[0].reset(),this._screen[1].reset(),this._angle1.reset(),this._angle2.reset(),this._time.reset()}evaluateMomentum(){if(!this.enabled||!this._screen[0].hasFilteredDelta())return null;const t=this._screen[0].filteredDelta,e=this._screen[1].filteredDelta,i=null==t||null==e?null:Math.sqrt(t*t+e*e),s=this._time.filteredDelta,a=null==i||null==s?0:i/s;return Math.abs(a)<this._minimumInitialVelocity?null:this.createMomentum(a,this._stopVelocity,this._friction)}createMomentum(t,e,i){const s=this._time.filteredDelta,a=this._angle1.filteredValue,l=this._angle2.filteredValue,n=null==s||null==l?0:l/s;return new u(t,e,i,null==s||null==a?0:a/s,this._axis1,n,this._axis2)}}export{u as PanSphericalMomentum,o as PanSphericalMomentumEstimator};
5
+ import{create as t}from"../../core/libs/gl-matrix-2/factories/vec2f64.js";import{F as e,n as i,d as s}from"../../chunks/vec32.js";import{create as a}from"../../core/libs/gl-matrix-2/factories/vec3f64.js";import{rotationAngleAndAxisDirectRotation as l,rotationAnglesAndAxesHeadingPreserving as n}from"../3d/state/utils/navigationUtils.js";import{FilteredFiniteDifference as r}from"./FilteredFiniteDifference.js";import{FilteredValue as h}from"./FilteredValue.js";import{Momentum as _}from"./Momentum.js";const m=1e-5;class u extends _{constructor(t,e,i,s,a,l=0,n){super(t,e,i),this._angularVelocity1=s,this.axis1=a,this.angularVelocity2=l,this.axis2=n}value1(t){return super.valueFromInitialVelocity(this._angularVelocity1,t)}value2(t){return super.valueFromInitialVelocity(this.angularVelocity2,t)}}class o{constructor(e=300,i=12,s=.84){this._minimumInitialVelocity=e,this._stopVelocity=i,this._friction=s,this.enabled=!0,this._tmpAxis1=a(),this._tmpAxis2=a(),this._tmpAngles=t(),this._time=new r(.3),this._screen=[new r(.4),new r(.4)],this._angle1=new h(.6),this._angle2=new h(.6),this._axis1=a(),this._axis2=a(),this._lastScene=a()}addMomentumDirectRotation(t,a,n,r,h,_){if(this.enabled){if(this._time.hasLastValue()){if(this._time.computeDelta(n)<.01)return;let t=l(this._lastScene,a,this._tmpAxis2,r,h,_);this._angle2.update(0),e(this._tmpAxis2)<m?t=0:i(this._axis1,this._tmpAxis2),this._angle1.update(t),s(this._lastScene,a)}this._screen[0].update(t[0]),this._screen[1].update(t[1]),this._time.update(n)}}addMomentumPreserveHeading(t,a,l,r,h,_,u){if(this.enabled){if(this._time.hasLastValue()){if(this._time.computeDelta(l)<.01)return;n(this._lastScene,a,this._tmpAxis2,this._tmpAxis1,this._tmpAngles,r,h,_,u,!1),e(this._tmpAxis2)<m?(this._angle1.update(0),this._angle2.update(0)):(this._angle1.update(this._tmpAngles[1]),this._angle2.update(this._tmpAngles[0]),i(this._axis1,this._tmpAxis1),i(this._axis2,this._tmpAxis2)),s(this._lastScene,a)}this._screen[0].update(t[0]),this._screen[1].update(t[1]),this._time.update(l)}}reset(){this._screen[0].reset(),this._screen[1].reset(),this._angle1.reset(),this._angle2.reset(),this._time.reset()}evaluateMomentum(){if(!this.enabled||!this._screen[0].hasFilteredDelta())return null;const t=this._screen[0].filteredDelta,e=this._screen[1].filteredDelta,i=null==t||null==e?null:Math.sqrt(t*t+e*e),s=this._time.filteredDelta,a=null==i||null==s?0:i/s;return Math.abs(a)<this._minimumInitialVelocity?null:this.createMomentum(a,this._stopVelocity,this._friction)}createMomentum(t,e,i){const s=this._time.filteredDelta,a=this._angle1.filteredValue,l=this._angle2.filteredValue,n=null==s||null==l?0:l/s;return new u(t,e,i,null==s||null==a?0:a/s,this._axis1,n,this._axis2)}}export{u as PanSphericalMomentum,o as PanSphericalMomentumEstimator};
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{createArea as t}from"../../core/quantity.js";import{areaUnitFromSpatialReference as o}from"../../core/units.js";import{e as r}from"../../chunks/earcut.js";import{h as n,c as e,E as s}from"../../chunks/vec32.js";import{create as i}from"../../core/libs/gl-matrix-2/factories/vec3f64.js";import{projectVectorToVector as c}from"../../geometry/projection/projectVectorToVector.js";import{fromPoints as f,wrap as u,getNormal as l,projectPointLocal as m}from"../../geometry/support/plane.js";import{areaPoints2d as p}from"../../geometry/support/triangle.js";import{computeEuclideanMeasurementSR as a}from"./measurementUtils.js";function g(t,o=k()){return j(t,o)}function h(t,o=k()){return j(t,o,!1)}function j(r,g,h=r.hasZ){const j=a(r.spatialReference),k=o(j);if(null==k)return null;const x=(t,o)=>!(o.length<2)&&(n(t,o[0],o[1],h&&o[2]||0),!0);let C=0;for(const t of r.rings){const o=t.length;if(o<3)continue;const{positionsWorldCoords:a}=g;for(;a.length<o;)a.push(i());const h=y,k=n(d,0,0,0),R=1/o;for(let n=0;n<o;n++){if(!x(h,t[n]))return null;if(!c(h,r.spatialReference,a[n],j))return null;e(k,k,a[n],R)}const V=f(a[0],a[1],k,u());if(0===s(l(V)))continue;for(let t=0;t<o;t++)m(V,k,a[t],a[t]);const W=v(a);for(let t=0;t<W.length;t+=3)C+=p(a[W[t]],a[W[t+1]],a[W[t+2]])}return t(C,k)}const y=i(),d=i();function k(){return{positionsWorldCoords:[]}}function v(t){return r(x(t),[],2)}function x(t){const o=new Float64Array(2*t.length);for(let r=0;r<t.length;++r){const n=t[r],e=2*r;o[e]=n[0],o[e+1]=n[1]}return o}export{j as computeEuclideanPlanarArea,k as createEuclideanPlanarAreaCache,h as euclideanHorizontalPlanarArea,g as euclideanPlanarArea,v as triangulate};
5
+ import{createArea as t}from"../../core/quantity.js";import{areaUnitFromSpatialReference as o}from"../../core/units.js";import{e as r}from"../../chunks/earcut.js";import{h as n,c as e,F as s}from"../../chunks/vec32.js";import{create as i}from"../../core/libs/gl-matrix-2/factories/vec3f64.js";import{projectVectorToVector as c}from"../../geometry/projection/projectVectorToVector.js";import{fromPoints as f,wrap as u,getNormal as l,projectPointLocal as m}from"../../geometry/support/plane.js";import{areaPoints2d as p}from"../../geometry/support/triangle.js";import{computeEuclideanMeasurementSR as a}from"./measurementUtils.js";function g(t,o=k()){return j(t,o)}function h(t,o=k()){return j(t,o,!1)}function j(r,g,h=r.hasZ){const j=a(r.spatialReference),k=o(j);if(null==k)return null;const x=(t,o)=>!(o.length<2)&&(n(t,o[0],o[1],h&&o[2]||0),!0);let C=0;for(const t of r.rings){const o=t.length;if(o<3)continue;const{positionsWorldCoords:a}=g;for(;a.length<o;)a.push(i());const h=y,k=n(d,0,0,0),F=1/o;for(let n=0;n<o;n++){if(!x(h,t[n]))return null;if(!c(h,r.spatialReference,a[n],j))return null;e(k,k,a[n],F)}const R=f(a[0],a[1],k,u());if(0===s(l(R)))continue;for(let t=0;t<o;t++)m(R,k,a[t],a[t]);const V=v(a);for(let t=0;t<V.length;t+=3)C+=p(a[V[t]],a[V[t+1]],a[V[t+2]])}return t(C,k)}const y=i(),d=i();function k(){return{positionsWorldCoords:[]}}function v(t){return r(x(t),[],2)}function x(t){const o=new Float64Array(2*t.length);for(let r=0;r<t.length;++r){const n=t[r],e=2*r;o[e]=n[0],o[e+1]=n[1]}return o}export{j as computeEuclideanPlanarArea,k as createEuclideanPlanarAreaCache,h as euclideanHorizontalPlanarArea,g as euclideanPlanarArea,v as triangulate};