@arcgis/core 4.31.0-next.20240821 → 4.31.0-next.20240823

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 (376) hide show
  1. package/assets/esri/core/workers/RemoteClient.js +1 -1
  2. package/assets/esri/core/workers/chunks/{24e38b7d1e9984a1472e.js → 033032715c3b04e0fc7d.js} +1 -1
  3. package/assets/esri/core/workers/chunks/{cfc93bbd35cc4bfde7c0.js → 045336db17aae6eef68f.js} +1 -1
  4. package/assets/esri/core/workers/chunks/04de7b2937d5ca7c23e2.js +1 -0
  5. package/assets/esri/core/workers/chunks/12a4b3706162872c2b41.js +769 -0
  6. package/assets/esri/core/workers/chunks/142b1336533fa2ac470b.js +47 -0
  7. package/assets/esri/core/workers/chunks/185e596f86767c22f951.js +1 -0
  8. package/assets/esri/core/workers/chunks/{cd8d595d577b74817623.js → 1a4b3820136fb615b730.js} +1 -1
  9. package/assets/esri/core/workers/chunks/29b157b41dfa16da886b.js +1 -0
  10. package/assets/esri/core/workers/chunks/300b57846114fedd12be.js +1 -0
  11. package/assets/esri/core/workers/chunks/{3f75b7ed24b440b4508a.js → 3d5f37c2f355260e6dc6.js} +1 -1
  12. package/assets/esri/core/workers/chunks/{a9eba26d62b62592cee1.js → 42861d54a336146753d8.js} +1 -1
  13. package/assets/esri/core/workers/chunks/4c8deac4bf72a5e2597a.js +1 -0
  14. package/assets/esri/core/workers/chunks/52107d450c55450f5c04.js +274 -0
  15. package/assets/esri/core/workers/chunks/6d54222301b6d819c904.js +1 -0
  16. package/assets/esri/core/workers/chunks/{eb0f180ed20af220a82e.js → 6ddece9cd94b60efe3d7.js} +1 -1
  17. package/assets/esri/core/workers/chunks/{566844774388a031fd74.js → 7125cff7fd288ff7bd5f.js} +1 -1
  18. package/assets/esri/core/workers/chunks/74de734a20b4cd2d7efb.js +1 -0
  19. package/assets/esri/core/workers/chunks/7712a23dc68220edaa64.js +1 -0
  20. package/assets/esri/core/workers/chunks/{ea561b2460e634a643fc.js → 7f35380809e7de99c302.js} +1 -1
  21. package/assets/esri/core/workers/chunks/7f3d49b667e9b46449e7.js +1 -0
  22. package/assets/esri/core/workers/chunks/8a2faf12938e811a9fc9.js +1 -0
  23. package/assets/esri/core/workers/chunks/{796c64b9caa1303e26ed.js → 8af503fa88c1668872eb.js} +1 -1
  24. package/assets/esri/core/workers/chunks/{e2a6f77c05d0818e3f74.js → 8e42ce8305cefba5debc.js} +1 -1
  25. package/assets/esri/core/workers/chunks/93169e55e472fec4bc50.js +1 -0
  26. package/assets/esri/core/workers/chunks/985c1f42aab564008c0d.js +1 -0
  27. package/assets/esri/core/workers/chunks/9a32d9d720cb81abfba2.js +1 -0
  28. package/assets/esri/core/workers/chunks/b171d57b4d0142f687d0.js +1 -0
  29. package/assets/esri/core/workers/chunks/d5e376893cd47605a438.js +1 -0
  30. package/assets/esri/core/workers/chunks/df9daac7ea581e9e5ca4.js +1 -0
  31. package/assets/esri/core/workers/chunks/f11ae249cc8e995bbccc.js +1 -0
  32. package/assets/esri/core/workers/chunks/{65d8011cf756b066cade.js → f218316de8b4635653b2.js} +1 -1
  33. package/assets/esri/libs/linkchartlayout/lclayout.wasm +0 -0
  34. package/assets/esri/libs/vxl/vxlLayer.wasm +0 -0
  35. package/assets/esri/themes/base/_core.scss +2 -0
  36. package/assets/esri/themes/base/widgets/_Grid.scss +0 -8
  37. package/assets/esri/themes/base/widgets/_GridControls.scss +86 -0
  38. package/assets/esri/themes/base/widgets/_Print.scss +13 -15
  39. package/assets/esri/themes/dark/main.css +1 -1
  40. package/assets/esri/themes/light/main.css +1 -1
  41. package/assets/esri/themes/light/view.css +1 -1
  42. package/assets/esri/widgets/Print/t9n/Print.json +1 -1
  43. package/assets/esri/widgets/Print/t9n/Print_ar.json +1 -1
  44. package/assets/esri/widgets/Print/t9n/Print_bg.json +1 -1
  45. package/assets/esri/widgets/Print/t9n/Print_bs.json +1 -1
  46. package/assets/esri/widgets/Print/t9n/Print_ca.json +1 -1
  47. package/assets/esri/widgets/Print/t9n/Print_cs.json +1 -1
  48. package/assets/esri/widgets/Print/t9n/Print_da.json +1 -1
  49. package/assets/esri/widgets/Print/t9n/Print_de.json +1 -1
  50. package/assets/esri/widgets/Print/t9n/Print_el.json +1 -1
  51. package/assets/esri/widgets/Print/t9n/Print_en.json +1 -1
  52. package/assets/esri/widgets/Print/t9n/Print_es.json +1 -1
  53. package/assets/esri/widgets/Print/t9n/Print_et.json +1 -1
  54. package/assets/esri/widgets/Print/t9n/Print_fi.json +1 -1
  55. package/assets/esri/widgets/Print/t9n/Print_fr.json +1 -1
  56. package/assets/esri/widgets/Print/t9n/Print_he.json +1 -1
  57. package/assets/esri/widgets/Print/t9n/Print_hr.json +1 -1
  58. package/assets/esri/widgets/Print/t9n/Print_hu.json +1 -1
  59. package/assets/esri/widgets/Print/t9n/Print_id.json +1 -1
  60. package/assets/esri/widgets/Print/t9n/Print_it.json +1 -1
  61. package/assets/esri/widgets/Print/t9n/Print_ja.json +1 -1
  62. package/assets/esri/widgets/Print/t9n/Print_ko.json +1 -1
  63. package/assets/esri/widgets/Print/t9n/Print_lt.json +1 -1
  64. package/assets/esri/widgets/Print/t9n/Print_lv.json +1 -1
  65. package/assets/esri/widgets/Print/t9n/Print_nb.json +1 -1
  66. package/assets/esri/widgets/Print/t9n/Print_nl.json +1 -1
  67. package/assets/esri/widgets/Print/t9n/Print_pl.json +1 -1
  68. package/assets/esri/widgets/Print/t9n/Print_pt-BR.json +1 -1
  69. package/assets/esri/widgets/Print/t9n/Print_pt-PT.json +1 -1
  70. package/assets/esri/widgets/Print/t9n/Print_ro.json +1 -1
  71. package/assets/esri/widgets/Print/t9n/Print_ru.json +1 -1
  72. package/assets/esri/widgets/Print/t9n/Print_sk.json +1 -1
  73. package/assets/esri/widgets/Print/t9n/Print_sl.json +1 -1
  74. package/assets/esri/widgets/Print/t9n/Print_sr.json +1 -1
  75. package/assets/esri/widgets/Print/t9n/Print_sv.json +1 -1
  76. package/assets/esri/widgets/Print/t9n/Print_th.json +1 -1
  77. package/assets/esri/widgets/Print/t9n/Print_tr.json +1 -1
  78. package/assets/esri/widgets/Print/t9n/Print_uk.json +1 -1
  79. package/assets/esri/widgets/Print/t9n/Print_vi.json +1 -1
  80. package/assets/esri/widgets/Print/t9n/Print_zh-CN.json +1 -1
  81. package/assets/esri/widgets/Print/t9n/Print_zh-HK.json +1 -1
  82. package/assets/esri/widgets/Print/t9n/Print_zh-TW.json +1 -1
  83. package/assets/esri/widgets/support/GridControls/t9n/GridControls.json +1 -0
  84. package/assets/esri/widgets/support/GridControls/t9n/GridControls_en.json +1 -0
  85. package/chunks/CloudsComposition.glsl.js +3 -3
  86. package/chunks/ComponentShader.glsl.js +53 -61
  87. package/chunks/DefaultMaterial.glsl.js +1 -1
  88. package/chunks/FocusAreaColor.glsl.js +12 -0
  89. package/chunks/FocusAreaMask.glsl.js +5 -0
  90. package/chunks/Laserlines.glsl.js +1 -1
  91. package/chunks/Path.glsl.js +22 -17
  92. package/chunks/PointRenderer.glsl.js +3 -3
  93. package/chunks/Precipitation.glsl.js +1 -1
  94. package/chunks/Terrain.glsl.js +1 -1
  95. package/chunks/WaterSurface.glsl.js +18 -18
  96. package/chunks/boundedPlane.js +1 -1
  97. package/chunks/cameraUtilsPlanar.js +1 -1
  98. package/chunks/cameraUtilsSpherical.js +1 -1
  99. package/chunks/sphere.js +1 -1
  100. package/chunks/terrainUtilsPlanar.js +1 -1
  101. package/chunks/vec32.js +1 -1
  102. package/chunks/vxlLayer.js +1 -1
  103. package/core/libs/gl-matrix-2/math/quat.js +1 -1
  104. package/core/libs/gl-matrix-2/math/vec3.js +1 -1
  105. package/core/mathUtils.js +1 -1
  106. package/core/perspectiveUtils.js +1 -1
  107. package/exports/csv.js +1 -1
  108. package/geometry/operators/support/converterAPI.js +1 -1
  109. package/geometry/projection/localLinearScaleFactors.js +1 -1
  110. package/geometry/support/buffer/internals/Vec3.js +1 -1
  111. package/geometry/support/clipRay.js +1 -1
  112. package/geometry/support/coordinateSystem.js +1 -1
  113. package/geometry/support/frustum.js +1 -1
  114. package/geometry/support/heightModelInfoUtils.js +1 -1
  115. package/geometry/support/lineSegment.js +1 -1
  116. package/geometry/support/meshUtils/exporters/gltf/geometry.js +1 -1
  117. package/geometry/support/meshUtils/rotate.js +1 -1
  118. package/geometry/support/meshUtils/scale.js +1 -1
  119. package/geometry/support/plane.js +1 -1
  120. package/geometry/support/polygonUtils.js +1 -1
  121. package/geometry/support/ray.js +1 -1
  122. package/geometry/support/sphere.js +1 -1
  123. package/geometry/support/sphereUtils.js +5 -0
  124. package/geometry/support/triangle.js +1 -1
  125. package/geometry/support/vector.js +1 -1
  126. package/interfaces.d.ts +68 -9
  127. package/layers/FocusAreaLayer.js +5 -0
  128. package/layers/VoxelLayer.js +1 -1
  129. package/layers/VoxelWasmPerSceneView.js +1 -1
  130. package/layers/mixins/operationalLayerModuleMap.js +1 -1
  131. package/layers/orientedImagery/transformations/imageToGroundUtils.js +1 -1
  132. package/layers/video/VideoCameraSensorModel.js +1 -1
  133. package/package.json +1 -1
  134. package/support/revision.js +1 -1
  135. package/symbols/cim/CIMSymbolDrawHelper.js +1 -1
  136. package/symbols/support/Symbol3DFillMaterial.js +1 -1
  137. package/symbols/support/Symbol3DMaterial.js +1 -1
  138. package/views/2d/engine/webgl/AFeatureTile.js +1 -1
  139. package/views/2d/engine/webgl/WorldExtentClipRenderer.js +1 -1
  140. package/views/2d/grid/GridView2D.js +1 -1
  141. package/views/2d/grid/constants.js +5 -0
  142. package/views/2d/interactive/editingTools/TransformTool.js +1 -1
  143. package/views/2d/interactive/editingTools/manipulations/ScaleManipulation.js +1 -1
  144. package/views/2d/layerViewModuleImportUtils.js +1 -1
  145. package/views/2d/support/highlightGroupUtils.js +1 -1
  146. package/views/3d/analysis/AreaMeasurement/support/MeasurementData.js +1 -1
  147. package/views/3d/analysis/Dimension/lengthDimensionConstraintUtils.js +1 -1
  148. package/views/3d/analysis/Dimension/lengthDimensionManipulatorUtils.js +1 -1
  149. package/views/3d/analysis/Dimension/lengthDimensionUtils.js +1 -1
  150. package/views/3d/analysis/LineOfSight/LineOfSightRayIntersector.js +1 -1
  151. package/views/3d/analysis/Slice/ShiftManipulator.js +1 -1
  152. package/views/3d/analysis/Slice/SliceTool.js +1 -1
  153. package/views/3d/analysis/Slice/SliceVisualization.js +1 -1
  154. package/views/3d/analysis/Slice/sliceToolUtils.js +1 -1
  155. package/views/3d/analysis/Viewshed/FieldOfViewManipulation.js +1 -1
  156. package/views/3d/analysis/Viewshed/ScaleOrientManipulation.js +1 -1
  157. package/views/3d/analysis/Viewshed/ViewshedSubTool.js +1 -1
  158. package/views/3d/analysis/Viewshed/ViewshedTool.js +1 -1
  159. package/views/3d/analysis/Viewshed/ViewshedVisualization.js +1 -1
  160. package/views/3d/analysis/Viewshed/viewshedToolUtils.js +1 -1
  161. package/views/3d/analysis/support/measurementUtils.js +1 -1
  162. package/views/3d/animation/pointToPoint/Animation.js +1 -1
  163. package/views/3d/animation/pointToPoint/Camera.js +1 -1
  164. package/views/3d/camera/constraintUtils/common.js +1 -1
  165. package/views/3d/camera/constraintUtils/surfaceCollision.js +1 -1
  166. package/views/3d/camera/constraintUtils/tilt.js +1 -1
  167. package/views/3d/camera/intersectionUtils.js +1 -1
  168. package/views/3d/environment/ChapmanAtmosphere.js +1 -1
  169. package/views/3d/environment/CloudsComposition.glsl.js +1 -1
  170. package/views/3d/environment/CloudsParameters.js +1 -1
  171. package/views/3d/environment/EnvironmentRenderer.js +1 -1
  172. package/views/3d/environment/Fog.js +1 -1
  173. package/views/3d/environment/MarsAtmosphere.js +1 -1
  174. package/views/3d/interactive/Manipulator3D.js +1 -1
  175. package/views/3d/interactive/editingTools/dragEventPipeline3D.js +1 -1
  176. package/views/3d/interactive/editingTools/draw/DrawGraphicTool3D.js +1 -1
  177. package/views/3d/interactive/editingTools/lineObjectVisualElementUtils.js +1 -1
  178. package/views/3d/interactive/editingTools/manipulations/MoveXYAxisManipulation.js +1 -1
  179. package/views/3d/interactive/editingTools/manipulations/MoveXYDiscManipulation.js +1 -1
  180. package/views/3d/interactive/editingTools/manipulations/MoveZManipulation.js +1 -1
  181. package/views/3d/interactive/editingTools/originGeometryVisualElementUtils.js +1 -1
  182. package/views/3d/interactive/editingTools/reshape/ReshapeOperation.js +1 -1
  183. package/views/3d/interactive/editingTools/transform/ScaleRotateTransform.js +1 -1
  184. package/views/3d/interactive/editingTools/transform/extentTransform/ExtentScale.js +1 -1
  185. package/views/3d/interactive/editingTools/transform/extentTransform/extentUtils.js +1 -1
  186. package/views/3d/interactive/visualElements/LineVisualElement.js +1 -1
  187. package/views/3d/interactive/visualElements/OutlineVisualElement.js +1 -1
  188. package/views/3d/interactive/visualElements/PointVisualElement.js +1 -1
  189. package/views/3d/interactive/visualElements/VerticesVisualElement.js +1 -1
  190. package/views/3d/layerViewModuleImportUtils.js +1 -1
  191. package/views/3d/layers/FocusAreaLayerView3D.js +5 -0
  192. package/views/3d/layers/I3SMeshView3D.js +1 -1
  193. package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
  194. package/views/3d/layers/IntegratedMeshLayerView3D.js +1 -1
  195. package/views/3d/layers/PointCloudLayerView3D.js +1 -1
  196. package/views/3d/layers/SceneLayerGraphicsView3D.js +1 -1
  197. package/views/3d/layers/VoxelGraphic.js +5 -0
  198. package/views/3d/layers/VoxelLayerView3D.js +1 -1
  199. package/views/3d/layers/graphics/Deconflictor.js +1 -1
  200. package/views/3d/layers/graphics/ElevationAligners.js +1 -1
  201. package/views/3d/layers/graphics/Graphics3DCore.js +1 -1
  202. package/views/3d/layers/graphics/Graphics3DDrapedGraphicLayer.js +1 -1
  203. package/views/3d/layers/graphics/Graphics3DExtrudeSymbolLayer.js +1 -1
  204. package/views/3d/layers/graphics/Graphics3DLodInstanceGraphicLayer.js +1 -1
  205. package/views/3d/layers/graphics/Graphics3DMeshFillSymbolLayer.js +1 -1
  206. package/views/3d/layers/graphics/Graphics3DObjectSymbolLayer.js +1 -1
  207. package/views/3d/layers/graphics/Graphics3DPathSymbolLayer.js +1 -1
  208. package/views/3d/layers/graphics/elevationAlignmentUtils.js +1 -1
  209. package/views/3d/layers/graphics/labelPlacement.js +1 -1
  210. package/views/3d/layers/graphics/objectResourceUtils.js +1 -1
  211. package/views/3d/layers/i3s/I3SMeshViewFilter.js +1 -1
  212. package/views/3d/layers/i3s/I3SUtil.js +1 -1
  213. package/views/3d/layers/i3s/I3SViewportQueries.js +1 -1
  214. package/views/3d/layers/i3s/LayerElevationProvider.js +1 -1
  215. package/views/3d/layers/i3s/LoDUtil.js +1 -1
  216. package/views/3d/layers/i3s/PointRenderer.js +1 -1
  217. package/views/3d/layers/support/FastSymbolUpdates.js +1 -1
  218. package/views/3d/layers/support/FeatureTileMeasurements3D.js +1 -1
  219. package/views/3d/layers/support/FeatureTileVisibility3D.js +1 -1
  220. package/views/3d/layers/support/uvUtils.js +1 -1
  221. package/views/3d/state/NearFarHeuristic.js +1 -1
  222. package/views/3d/state/ViewStateManager.js +1 -1
  223. package/views/3d/state/controllers/GamepadKeyboardController.js +1 -1
  224. package/views/3d/state/controllers/PinchAndPanControllerGlobal.js +1 -1
  225. package/views/3d/state/controllers/PinchAndPanControllerLocal.js +1 -1
  226. package/views/3d/state/controllers/RotateController.js +1 -1
  227. package/views/3d/state/controllers/ZoomControllerGlobal.js +1 -1
  228. package/views/3d/state/controllers/ZoomControllerLocal.js +1 -1
  229. package/views/3d/state/controllers/ZoomStepControllerGlobal.js +1 -1
  230. package/views/3d/state/controllers/ZoomStepControllerLocal.js +1 -1
  231. package/views/3d/state/helpers/SceneIntersectionHelper.js +1 -1
  232. package/views/3d/state/utils/navigationUtils.js +1 -1
  233. package/views/3d/state/utils/viewUtils.js +1 -1
  234. package/views/3d/support/FrustumExtentIntersection.js +1 -1
  235. package/views/3d/support/cameraUtilsInternal.js +1 -1
  236. package/views/3d/support/geometryUtils/ray.js +1 -1
  237. package/views/3d/support/intersectionUtils.js +1 -1
  238. package/views/3d/support/mathUtils.js +1 -1
  239. package/views/3d/support/orientedBoundingBox.js +1 -1
  240. package/views/3d/support/pointsOfInterest/Focus.js +1 -1
  241. package/views/3d/support/sunUtils.js +1 -1
  242. package/views/3d/support/viewpointUtils.js +1 -1
  243. package/views/3d/terrain/OverlayRenderer.js +1 -1
  244. package/views/3d/terrain/PatchRenderData.js +1 -1
  245. package/views/3d/terrain/SphericalPatch.js +1 -1
  246. package/views/3d/terrain/TerrainRenderer.js +1 -1
  247. package/views/3d/terrain/TerrainSurface.js +1 -1
  248. package/views/3d/terrain/Tile.js +1 -1
  249. package/views/3d/terrain/isTerrainSurfaceLayer.js +1 -1
  250. package/views/3d/webgl/RenderCamera.js +1 -1
  251. package/views/3d/webgl-engine/collections/Component/ComponentObjectCollection.js +1 -1
  252. package/views/3d/webgl-engine/collections/Component/DepthRange.js +1 -1
  253. package/views/3d/webgl-engine/collections/Component/Material/ComponentMaterial.js +1 -1
  254. package/views/3d/webgl-engine/collections/Component/Material/ComponentTechnique.js +1 -1
  255. package/views/3d/webgl-engine/collections/Component/Material/ComponentTechniqueConfiguration.js +1 -1
  256. package/views/3d/webgl-engine/collections/Component/Material/shader/ComponentShader.glsl.js +1 -1
  257. package/views/3d/webgl-engine/core/renderPasses/RenderPassManager.js +1 -1
  258. package/views/3d/webgl-engine/core/shaderLibrary/ShaderOutput.js +1 -1
  259. package/views/3d/webgl-engine/core/shaderLibrary/Slice.glsl.js +1 -1
  260. package/views/3d/webgl-engine/core/shaderLibrary/attributes/InstancedDoublePrecision.glsl.js +1 -1
  261. package/views/3d/webgl-engine/core/shaderLibrary/attributes/NormalAttribute.glsl.js +1 -1
  262. package/views/3d/webgl-engine/core/shaderLibrary/attributes/VertexNormal.glsl.js +2 -6
  263. package/views/3d/webgl-engine/core/shaderLibrary/output/Emissions.glsl.js +2 -2
  264. package/views/3d/webgl-engine/core/shaderLibrary/shading/ComputeFragmentNormals.glsl.js +13 -0
  265. package/views/3d/webgl-engine/core/shaderLibrary/shading/EvaluateAmbientLighting.glsl.js +1 -1
  266. package/views/3d/webgl-engine/core/shaderLibrary/shading/EvaluateSceneLighting.glsl.js +11 -13
  267. package/views/3d/webgl-engine/core/shaderLibrary/shading/MainLighting.glsl.js +4 -4
  268. package/views/3d/webgl-engine/core/shaderLibrary/shading/PhysicallyBasedRendering.glsl.js +1 -4
  269. package/views/3d/webgl-engine/core/shaderLibrary/shading/ReadBaseColorTexture.glsl.js +3 -3
  270. package/views/3d/webgl-engine/core/shaderLibrary/shading/ReadShadowMap.glsl.js +1 -1
  271. package/views/3d/webgl-engine/core/shaderLibrary/shading/Water.glsl.js +2 -2
  272. package/views/3d/webgl-engine/core/shaderLibrary/util/ScreenSizePerspective.glsl.js +1 -1
  273. package/views/3d/webgl-engine/core/shaderLibrary/util/View.glsl.js +1 -1
  274. package/views/3d/webgl-engine/effects/focusArea/FocusAreaColorRenderNodeTechnique.js +5 -0
  275. package/views/3d/webgl-engine/effects/focusArea/FocusAreaMaskRenderNodeTechnique.js +5 -0
  276. package/views/3d/webgl-engine/effects/focusArea/FocusAreaParameters.js +5 -0
  277. package/views/3d/webgl-engine/effects/focusArea/FocusAreaRenderNode.js +5 -0
  278. package/views/3d/webgl-engine/effects/highlight/ShadowHighlight.js +1 -1
  279. package/views/3d/webgl-engine/effects/laserlines/LaserlinePathData.js +1 -1
  280. package/views/3d/webgl-engine/lib/BoundingInfo.js +1 -1
  281. package/views/3d/webgl-engine/lib/GeometryUtil.js +1 -1
  282. package/views/3d/webgl-engine/lib/Intersector.js +1 -1
  283. package/views/3d/webgl-engine/lib/Object3D.js +1 -1
  284. package/views/3d/webgl-engine/lib/Octree.js +1 -1
  285. package/views/3d/webgl-engine/lib/OrderIndependentTransparency.js +1 -1
  286. package/views/3d/webgl-engine/lib/Path.js +1 -1
  287. package/views/3d/webgl-engine/lib/PathGeometryData.js +1 -1
  288. package/views/3d/webgl-engine/lib/PathVertex.js +1 -1
  289. package/views/3d/webgl-engine/lib/RayIntersections.js +1 -1
  290. package/views/3d/webgl-engine/lib/Renderer.js +1 -1
  291. package/views/3d/webgl-engine/lib/ShadowMap.js +1 -1
  292. package/views/3d/webgl-engine/lib/edgeRendering/EdgeRenderer.js +1 -1
  293. package/views/3d/webgl-engine/lib/edgeRendering/EdgeView.js +1 -1
  294. package/views/3d/webgl-engine/lib/edgeRendering/edgePreprocessing.js +1 -1
  295. package/views/3d/webgl-engine/lib/geometryDataUtils.js +1 -1
  296. package/views/3d/webgl-engine/lib/lodRendering/InstanceData.js +1 -1
  297. package/views/3d/webgl-engine/lib/lodRendering/LodRenderer.js +1 -1
  298. package/views/3d/webgl-engine/lib/pathGeometryUtils.js +1 -1
  299. package/views/3d/webgl-engine/lib/triangleIntersectionUtils.js +1 -1
  300. package/views/3d/webgl-engine/lib/verticalOffsetUtils.js +1 -1
  301. package/views/3d/webgl-engine/lighting/SphericalHarmonics.js +1 -1
  302. package/views/3d/webgl-engine/materials/DefaultMaterial.js +1 -1
  303. package/views/3d/webgl-engine/materials/HUDMaterial.js +1 -1
  304. package/views/3d/webgl-engine/materials/LineMarkerMaterial.js +1 -1
  305. package/views/3d/webgl-engine/materials/MeasurementArrowMaterial.js +1 -1
  306. package/views/3d/webgl-engine/materials/NativeLineMaterial.js +1 -1
  307. package/views/3d/webgl-engine/materials/PathMaterial.js +1 -1
  308. package/views/3d/webgl-engine/materials/PathTechnique.js +1 -1
  309. package/views/3d/webgl-engine/materials/RibbonLineMaterial.js +1 -1
  310. package/views/3d/webgl-engine/materials/ShadedColorMaterial.js +1 -1
  311. package/views/3d/webgl-engine/shaders/DefaultMaterialTechnique.js +1 -1
  312. package/views/3d/webgl-engine/shaders/FocusAreaColor.glsl.js +5 -0
  313. package/views/3d/webgl-engine/shaders/FocusAreaMask.glsl.js +5 -0
  314. package/views/3d/webgl-engine/shaders/OutputColorHighlightOID.glsl.js +8 -8
  315. package/views/3d/webgl-engine/shaders/Path.glsl.js +1 -1
  316. package/views/draw/support/helpMessageUtils3d.js +1 -1
  317. package/views/draw/support/surfaceCoordinateSystems.js +1 -1
  318. package/views/input/gamepad/GamepadSource.js +1 -1
  319. package/views/interactive/coordinateHelper.js +1 -1
  320. package/views/interactive/editGeometry/operations/OffsetEdgeVertex.js +1 -1
  321. package/views/interactive/sketch/constraints.js +1 -1
  322. package/views/interactive/snapping/FeatureSnappingEngine.js +1 -1
  323. package/views/interactive/snapping/GridSnappingEngine.js +5 -0
  324. package/views/interactive/snapping/RightAngleSnapper.js +1 -1
  325. package/views/interactive/snapping/SnappingOptions.js +1 -1
  326. package/views/interactive/snapping/featureSources/featureServiceSource/tileUtils.js +1 -1
  327. package/views/interactive/snapping/snappingUtils.js +1 -1
  328. package/views/navigation/PanPlanarMomentumEstimator.js +1 -1
  329. package/views/support/angularMeasurementUtils.js +1 -1
  330. package/views/support/euclideanAreaMeasurementUtils.js +1 -1
  331. package/views/support/euclideanLengthMeasurementUtils.js +1 -1
  332. package/views/support/geometry3dUtils.js +1 -1
  333. package/webscene/Slide.js +1 -1
  334. package/widgets/CoordinateConversion/support/formatUtils.js +1 -1
  335. package/widgets/ElevationProfile/ElevationProfileLineView.js +1 -1
  336. package/widgets/Feature/FeatureMedia.js +1 -1
  337. package/widgets/FeatureTable/FeatureTableViewModel.js +1 -1
  338. package/widgets/FeatureTable/Grid/Column.js +1 -1
  339. package/widgets/FeatureTable.js +1 -1
  340. package/widgets/GridControls/GridControlsViewModel.d.ts +4 -0
  341. package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
  342. package/widgets/PanoramicViewer/PanoramicViewerViewModel.js +1 -1
  343. package/widgets/Print/CustomTemplate.js +1 -1
  344. package/widgets/Print/PrintViewModel.js +1 -1
  345. package/widgets/Print/TemplateOptions.js +1 -1
  346. package/widgets/Print/utils.js +5 -0
  347. package/widgets/Print.js +1 -1
  348. package/widgets/ShadowCast/ShadowCastViewModel.js +1 -1
  349. package/widgets/support/GridControls/GridControlsViewModel.d.ts +4 -0
  350. package/widgets/support/GridControls/GridControlsViewModel.js +5 -0
  351. package/widgets/support/GridControls/VisibleElements.js +5 -0
  352. package/widgets/support/GridControls/gridUtils.js +5 -0
  353. package/widgets/support/GridControls.d.ts +4 -0
  354. package/widgets/support/GridControls.js +5 -0
  355. package/widgets/support/exportUtils.js +1 -1
  356. package/assets/esri/core/workers/chunks/14dc47896456e3c66b24.js +0 -1
  357. package/assets/esri/core/workers/chunks/2e88af8ab1e2713e7655.js +0 -1
  358. package/assets/esri/core/workers/chunks/3b204e75b613bcfbc8b9.js +0 -1
  359. package/assets/esri/core/workers/chunks/3e57f493d5a9d7aa7a48.js +0 -1
  360. package/assets/esri/core/workers/chunks/4e5ae81c612543130d9a.js +0 -1
  361. package/assets/esri/core/workers/chunks/4e746f8fca1d932dd684.js +0 -1
  362. package/assets/esri/core/workers/chunks/544eec13338b2d71680f.js +0 -1
  363. package/assets/esri/core/workers/chunks/5e7e12863cbed07451d0.js +0 -1
  364. package/assets/esri/core/workers/chunks/6c129767cda74aa672e0.js +0 -1
  365. package/assets/esri/core/workers/chunks/6f7c2d02fbd29870f6ee.js +0 -1
  366. package/assets/esri/core/workers/chunks/7802e70422f4151b95bc.js +0 -1
  367. package/assets/esri/core/workers/chunks/920557db2bd107a3c579.js +0 -1
  368. package/assets/esri/core/workers/chunks/9443b9ec03f25c723c2c.js +0 -47
  369. package/assets/esri/core/workers/chunks/991295637f51e8207efe.js +0 -1
  370. package/assets/esri/core/workers/chunks/ace8b6351ed35b03499b.js +0 -1
  371. package/assets/esri/core/workers/chunks/b1e4896acfae0bf9a9a8.js +0 -1
  372. package/assets/esri/core/workers/chunks/ca12b1c470e67ca7b30e.js +0 -1
  373. package/assets/esri/core/workers/chunks/cd9f48dcee2a1fc261ed.js +0 -774
  374. package/assets/esri/core/workers/chunks/d3626c01d2569d84e01e.js +0 -1
  375. package/assets/esri/core/workers/chunks/e5474bcde5b8fa037b56.js +0 -278
  376. package/views/3d/webgl-engine/core/shaderLibrary/shading/ComputeShadingNormal.glsl.js +0 -31
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.31/esri/copyright.txt for details.
4
4
  */
5
- const a={ArcGISAnnotationLayer:()=>Promise.resolve(null),ArcGISDimensionLayer:async()=>(await import("../DimensionLayer.js")).default,ArcGISFeatureLayer:async()=>(await import("../FeatureLayer.js")).default,ArcGISImageServiceLayer:async()=>(await import("../ImageryLayer.js")).default,ArcGISImageServiceVectorLayer:()=>Promise.resolve(null),ArcGISMapServiceLayer:async()=>(await import("../MapImageLayer.js")).default,ArcGISSceneServiceLayer:async()=>(await import("../SceneLayer.js")).default,ArcGISStreamLayer:async()=>(await import("../StreamLayer.js")).default,ArcGISTiledElevationServiceLayer:async()=>(await import("../ElevationLayer.js")).default,ArcGISTiledImageServiceLayer:async()=>(await import("../ImageryTileLayer.js")).default,ArcGISTiledMapServiceLayer:async()=>(await import("../TileLayer.js")).default,BingMapsAerial:async()=>(await import("../BingMapsLayer.js")).default,BingMapsRoad:async()=>(await import("../BingMapsLayer.js")).default,BingMapsHybrid:async()=>(await import("../BingMapsLayer.js")).default,BuildingSceneLayer:async()=>(await import("../BuildingSceneLayer.js")).default,CatalogLayer:async()=>(await import("../CatalogLayer.js")).default,CSV:async()=>(await import("../CSVLayer.js")).default,GeoRSS:async()=>(await import("../GeoRSSLayer.js")).default,GeoJSON:async()=>(await import("../GeoJSONLayer.js")).default,GroupLayer:async()=>(await import("../GroupLayer.js")).default,IntegratedMeshLayer:async()=>(await import("../IntegratedMeshLayer.js")).default,KML:async()=>(await import("../KMLLayer.js")).default,KnowledgeGraphLayer:async()=>(await import("../KnowledgeGraphLayer.js")).default,MediaLayer:async()=>(await import("../MediaLayer.js")).default,LineOfSightLayer:async()=>(await import("../LineOfSightLayer.js")).default,OGCFeatureLayer:async()=>(await import("../OGCFeatureLayer.js")).default,OpenStreetMap:async()=>(await import("../OpenStreetMapLayer.js")).default,OrientedImageryLayer:async()=>(await import("../OrientedImageryLayer.js")).default,PointCloudLayer:async()=>(await import("../PointCloudLayer.js")).default,VectorTileLayer:async()=>(await import("../VectorTileLayer.js")).default,ViewshedLayer:async()=>(await import("../ViewshedLayer.js")).default,Voxel:async()=>(await import("../VoxelLayer.js")).default,WebTiledLayer:async()=>(await import("../WebTileLayer.js")).default,WFS:async()=>(await import("../WFSLayer.js")).default,SubtypeGroupLayer:async()=>(await import("../SubtypeGroupLayer.js")).default,WMS:async()=>(await import("../WMSLayer.js")).default,RasterDataLayer:()=>Promise.resolve(null),RasterDataElevationLayer:()=>Promise.resolve(null),IntegratedMesh3DTilesLayer:async()=>(await import("../IntegratedMesh3DTilesLayer.js")).default};export{a as typeModuleMap};
5
+ const a={ArcGISAnnotationLayer:()=>Promise.resolve(null),ArcGISDimensionLayer:async()=>(await import("../DimensionLayer.js")).default,ArcGISFeatureLayer:async()=>(await import("../FeatureLayer.js")).default,ArcGISImageServiceLayer:async()=>(await import("../ImageryLayer.js")).default,ArcGISImageServiceVectorLayer:()=>Promise.resolve(null),ArcGISMapServiceLayer:async()=>(await import("../MapImageLayer.js")).default,ArcGISSceneServiceLayer:async()=>(await import("../SceneLayer.js")).default,ArcGISStreamLayer:async()=>(await import("../StreamLayer.js")).default,ArcGISTiledElevationServiceLayer:async()=>(await import("../ElevationLayer.js")).default,ArcGISTiledImageServiceLayer:async()=>(await import("../ImageryTileLayer.js")).default,ArcGISTiledMapServiceLayer:async()=>(await import("../TileLayer.js")).default,BingMapsAerial:async()=>(await import("../BingMapsLayer.js")).default,BingMapsRoad:async()=>(await import("../BingMapsLayer.js")).default,BingMapsHybrid:async()=>(await import("../BingMapsLayer.js")).default,BuildingSceneLayer:async()=>(await import("../BuildingSceneLayer.js")).default,CatalogLayer:async()=>(await import("../CatalogLayer.js")).default,CSV:async()=>(await import("../CSVLayer.js")).default,FocusAreaLayer:async()=>(await import("../FocusAreaLayer.js")).default,GeoRSS:async()=>(await import("../GeoRSSLayer.js")).default,GeoJSON:async()=>(await import("../GeoJSONLayer.js")).default,GroupLayer:async()=>(await import("../GroupLayer.js")).default,IntegratedMeshLayer:async()=>(await import("../IntegratedMeshLayer.js")).default,KML:async()=>(await import("../KMLLayer.js")).default,KnowledgeGraphLayer:async()=>(await import("../KnowledgeGraphLayer.js")).default,MediaLayer:async()=>(await import("../MediaLayer.js")).default,LineOfSightLayer:async()=>(await import("../LineOfSightLayer.js")).default,OGCFeatureLayer:async()=>(await import("../OGCFeatureLayer.js")).default,OpenStreetMap:async()=>(await import("../OpenStreetMapLayer.js")).default,OrientedImageryLayer:async()=>(await import("../OrientedImageryLayer.js")).default,PointCloudLayer:async()=>(await import("../PointCloudLayer.js")).default,VectorTileLayer:async()=>(await import("../VectorTileLayer.js")).default,ViewshedLayer:async()=>(await import("../ViewshedLayer.js")).default,Voxel:async()=>(await import("../VoxelLayer.js")).default,WebTiledLayer:async()=>(await import("../WebTileLayer.js")).default,WFS:async()=>(await import("../WFSLayer.js")).default,SubtypeGroupLayer:async()=>(await import("../SubtypeGroupLayer.js")).default,WMS:async()=>(await import("../WMSLayer.js")).default,RasterDataLayer:()=>Promise.resolve(null),RasterDataElevationLayer:()=>Promise.resolve(null),IntegratedMesh3DTilesLayer:async()=>(await import("../IntegratedMesh3DTilesLayer.js")).default};export{a as typeModuleMap};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.31/esri/copyright.txt for details.
4
4
  */
5
- import"../../../geometry.js";import"../../../core/has.js";import"../../../core/Logger.js";import{deg2rad as e}from"../../../core/mathUtils.js";import{zeros as t,create as r}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{m as a,z as n,g as i}from"../../../chunks/vec32.js";import o from"../../../geometry/Point.js";import{projectWithZConversion as s,initializeProjection as c,project as f}from"../../../geometry/projection.js";import{fromPoints as p,fromValues as m}from"../../../geometry/support/ray.js";import{l,i as y}from"../../../chunks/sphere.js";import{geographicToWebMercator as u,webMercatorToGeographic as g}from"../../../geometry/support/webMercatorUtils.js";import{createCoveragePolygon as w,limitZToGround as x}from"../core/coverageUtils.js";import z from"../core/ExposurePoint.js";import{transformPoints as h,updateElevation as d}from"./groundToImageUtils.js";import{getWebMercatorScalingFactor as R,convertPixelToHeadingPitch as j,convertHeadingPitchToSphereVertex as b,scaleAndAddWithFactor as P,hasCameraOrientationLTP as v,computeHFOVAndVFOV as M,ltpToGeographic as O,projectiveTransform2 as S,scaleWithFactor as F,calculateRotationMatrix as L,transformMat3 as H,projectiveTransform as V,getPlaneLineIntersectionPoint as A}from"./utils.js";import{defaultImageSphereCenter as T}from"../../../widgets/PanoramicViewer/constants.js";import{isNumber as U}from"../../../widgets/support/dataUtils.js";import C from"../../../geometry/Polygon.js";import D from"../../../geometry/SpatialReference.js";function E(e,t){if(!e)return Promise.resolve([]);const r=t.feature;let a=r.attributes;return a instanceof z||(a=z.fromJSON(r),a&&(r.attributes=a)),G(e,t)}function G(e,t){const{attributes:r}=t.feature;if(r.isSpherical||360===r.horizontalFieldOfView){const{location:a,cameraOrientation:n,farDistance:i,cameraHeading:o,cameraHeight:s}=r;return W(e,a,i,[t.imageProperties.width,t.imageProperties.height],o,s,n)}return q(e,t)}async function W(e,t,a,n,i,s,c){let f=new o(t);f.spatialReference.isGeographic&&f.spatialReference.isWGS84&&4!==c?.type&&(f=u(f));const g=R(f),w=new Array,[x,z,h]=f.toArray(),d=l([x,z,h??0],a*g),v=T.toArray();for(const l of e){let e,t;if(U(l.heading)&&U(l.pitch))e=l.heading,t=l.pitch;else{const r=j({x:l.x,y:l.y},n[0],n[1]);e=r.heading,t=r.pitch}e=(e+i)%360;const a=p([v[0],v[1],v[2]],b(e,t)),c=m([x,z,h??0],a.direction),u=r();y(d,c,u);const R=(f.z??0)-s;if(u[2]<R){const e=Math.abs((f.z-R)/-a.direction[2])*g;P([f.x,f.y,f.z],a.direction,e,g,u)}else u[2]=R;w.push(new o(u,f.spatialReference))}return w}async function q(e,t){const{feature:r,footprintExtent:a,options:n}=t,{attributes:{cameraHeight:i,cameraOrientation:c,cameraPitch:f,cameraRoll:p,elevationSource:m,horizontalFieldOfView:l,location:y,verticalFieldOfView:x},elevationSample:z}=r,d=v(c),{vfov:j}=M(l,x,p??0);let b=new o(y),P=!1;d&&(b=new o(O(b,[c.latitude,c.longitude,c.ellipsoidRadius,c.squaredEccentricity]))),b.spatialReference.isWGS84&&(P=!0,b=u(b));const F=R(b),L=I(t,b,F),H=d?L.map((e=>g(new o(e)))):L,V=await h(H,t,!0).then((e=>e.map((e=>({x:e.x,y:e.y,z:1}))))),A=new Array;for(const u of e){const e={...u,z:1},c={...S(e,V,H),spatialReference:b.spatialReference},[p]=await h([d?g(new o(c)):new o(c)],t,!0);await B(e,p,V,H,b,c,d,t);const l=r.attributes.clone();l.geometry=b.clone();const{polygon:y}=w(l),x=y.rings[0].map((e=>new o(e,y.spatialReference))),R=await s(m||z?await J({cameraLocation:b,groundFootPrint:x,projectedPoint:c,webMercatorScalingFactor:F,vfov:j,shouldConvertToLatLong:P,isCameraOrientationLTP:d,imgPoint:e},t):new o(k(c,b,F,b.z-i,f,j,P)),a.spatialReference,n);A.push(R)}return A}async function J(e,t){const{cameraLocation:r,groundFootPrint:a,projectedPoint:n,webMercatorScalingFactor:i,vfov:s,shouldConvertToLatLong:f,isCameraOrientationLTP:p,imgPoint:m}=e,{cameraHeight:l,cameraPitch:y}=t.feature.attributes;await c(r.spatialReference,t.footprintExtent.spatialReference,null,t.options);let u=await Z(a,t),w=0,x=(r.z??0)-l,z=0;for(;z<10;){const e=K(u,r,n);if(!e||!N([r.x,r.y,r.z],[e.x,e.y,e.z],[n.x,n.y,n.z]))return new o(k(n,r,i,x,y,s,f));const a=new o({x:e.x,y:e.y,z:e.z,spatialReference:r.spatialReference}),c=await h([p?g(a):a],t);if(w=Math.abs(m.x-c[0].x)+Math.abs(m.y-c[0].y),x=e.z,w<=1)return new o(k(n,r,i,x,y,s,f));z+=1;const{extent:l}=u,R=(l?.width??0)/10,j=(l?.height??0)/10;if(R<1||j<1)return new o(k(n,r,i,x,y,s,f));const{x:b,y:P}=e,v=await d(Q(R,j).map((([e,t])=>new o({x:b+e,y:P+t,spatialReference:r.spatialReference}))),t,!1);v.push(v[0]),u=new C({rings:[v.map((e=>e.toArray()))],spatialReference:r.spatialReference})}return new o(k(n,r,i,x,y,s,f))}const N=(e,r,i)=>a(n(t(),r,e),n(t(),i,e))>0;function k(e,r,a,i,s,c,f){const p=Math.sqrt((e.z-r.z)**2+(Math.sqrt((e.x-r.x)**2+(e.y-r.y)**2)/a)**2)*a,m=F(n(t(),[e.x,e.y,e.z],[r.x,r.y,r.z]),1/p,1/a);if(e.z<i||s+c/2<90){const t=Math.abs((r.z-i)/-m[2])*a,n=P([r.x,r.y,r.z],m,t,a);e.x=n[0],e.y=n[1],e.z=n[2]}else e.z=i;return f?g(new o(e)).toJSON():e}function I(r,a,s){const{feature:c}=r,{attributes:f}=c,p=2*Math.tan(e(f.verticalFieldOfView)/2)*f.farDistance*s,m=2*Math.tan(e(f.horizontalFieldOfView)/2)*f.farDistance*s,l=L("HPR",[f.cameraHeading,f.cameraPitch,f.cameraRoll??0]),y=H([0,0,-1],l),u=P([a.x,a.y,a.z],y,f.farDistance*s,s),g=H([0,1,0],l),w=H([1,0,0],l),x=F(g,p/2,s),z=F(w,m/2,s),h=n(t(),x,z),d=i(t(),x,z);return[i(t(),u,h),i(t(),u,d),n(t(),u,h),n(t(),u,d)].map((e=>{const[t,r,n]=e;return new o({x:t,y:r,z:n,spatialReference:a.spatialReference})}))}async function Z(e,t){const r=e[0].spatialReference.isWGS84?D.WebMercator:e[0].spatialReference,{cameraHeight:a,location:n,elevation:i}=t.feature.attributes,s="number"==typeof n.z&&"number"==typeof i?n.z-i:a,c=x(e.map((({x:e,y:t,z:r})=>[e,t,r])),s,n,R(n)),p=(await d(c.map((e=>new o(e,n.spatialReference))),t,!1)).map((e=>f(e,r)));return new C({hasZ:!0,rings:[p.map((({x:e,y:t,z:r})=>[e,t,r??0]))],spatialReference:r})}async function B(e,t,r,a,n,i,s,c){let f=0;const p=8;for(let m=0;m<=p;m+=1){if(f=Math.abs(e.x-t.x)+Math.abs(e.y-t.y),f<=1)return;const[p,m,l,y]=Q(f,f).map((([t,i])=>({...V({x:e.x+t,y:e.y+i,z:1},r[0],r[1],r[2],r[3],{x:a[0].x,y:a[0].y,z:a[0].z},{x:a[1].x,y:a[1].y,z:a[1].z},{x:a[2].x,y:a[2].y,z:a[2].z},{x:a[3].x,y:a[3].y,z:a[3].z}),spatialReference:n.spatialReference}))),[u,w,x,z]=await h(s?[g(new o(p)),g(new o(m)),g(new o(l)),g(new o(y))]:[new o(p),new o(m),new o(l),new o(y)],c,!0).then((e=>e.map((e=>({...e,z:0}))))),{x:d,y:R,z:j}=V(e,u,w,x,z,p,m,l,y);i.x=d,i.y=R,i.z=j,[t]=await h([s?g(new o(i)):new o(i)],c,!0)}}function K(e,t,r){const a={x:e.rings[0][0][0],y:e.rings[0][0][1],z:e.rings[0][0][2]},n={x:e.rings[0][1][0],y:e.rings[0][1][1],z:e.rings[0][1][2]},i={x:e.rings[0][1][0],y:e.rings[0][1][1],z:e.rings[0][1][2]},o={x:e.rings[0][2][0],y:e.rings[0][2][1],z:e.rings[0][2][2]},s=(o.z-i.z)*(n.y-a.y)-(o.y-i.y)*(n.z-a.z),c=-((o.z-i.z)*(n.x-a.x)-(n.z-a.z)*(o.x-i.x)),f=(o.y-i.y)*(n.x-a.x)-(n.y-a.y)*(o.x-i.x),p=-(s*a.x+c*a.y+f*a.z);return A(t.toJSON(),r,s,c,f,p)}const Q=(e,t)=>[[-e,-t],[e,-t],[e,t],[-e,t]];export{E as transformPoints};
5
+ import"../../../geometry.js";import"../../../core/has.js";import"../../../core/Logger.js";import{deg2rad as e}from"../../../core/mathUtils.js";import{zeros as t,create as r}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{l as a,z as n,g as i}from"../../../chunks/vec32.js";import o from"../../../geometry/Point.js";import{projectWithZConversion as s,initializeProjection as c,project as f}from"../../../geometry/projection.js";import{fromPoints as p,fromValues as m}from"../../../geometry/support/ray.js";import{l,i as y}from"../../../chunks/sphere.js";import{geographicToWebMercator as u,webMercatorToGeographic as x}from"../../../geometry/support/webMercatorUtils.js";import{createCoveragePolygon as g,limitZToGround as w}from"../core/coverageUtils.js";import z from"../core/ExposurePoint.js";import{transformPoints as h,updateElevation as d}from"./groundToImageUtils.js";import{getWebMercatorScalingFactor as R,convertPixelToHeadingPitch as j,convertHeadingPitchToSphereVertex as b,scaleAndAddWithFactor as P,hasCameraOrientationLTP as v,computeHFOVAndVFOV as M,ltpToGeographic as O,projectiveTransform2 as S,scaleWithFactor as F,calculateRotationMatrix as L,transformMat3 as H,projectiveTransform as V,getPlaneLineIntersectionPoint as A}from"./utils.js";import{defaultImageSphereCenter as T}from"../../../widgets/PanoramicViewer/constants.js";import{isNumber as U}from"../../../widgets/support/dataUtils.js";import C from"../../../geometry/Polygon.js";import D from"../../../geometry/SpatialReference.js";function E(e,t){if(!e)return Promise.resolve([]);const r=t.feature;let a=r.attributes;return a instanceof z||(a=z.fromJSON(r),a&&(r.attributes=a)),G(e,t)}function G(e,t){const{attributes:r}=t.feature;if(r.isSpherical||360===r.horizontalFieldOfView){const{location:a,cameraOrientation:n,farDistance:i,cameraHeading:o,cameraHeight:s}=r;return W(e,a,i,[t.imageProperties.width,t.imageProperties.height],o,s,n)}return q(e,t)}async function W(e,t,a,n,i,s,c){let f=new o(t);f.spatialReference.isGeographic&&f.spatialReference.isWGS84&&4!==c?.type&&(f=u(f));const x=R(f),g=new Array,[w,z,h]=f.toArray(),d=l([w,z,h??0],a*x),v=T.toArray();for(const l of e){let e,t;if(U(l.heading)&&U(l.pitch))e=l.heading,t=l.pitch;else{const r=j({x:l.x,y:l.y},n[0],n[1]);e=r.heading,t=r.pitch}e=(e+i)%360;const a=p([v[0],v[1],v[2]],b(e,t)),c=m([w,z,h??0],a.direction),u=r();y(d,c,u);const R=(f.z??0)-s;if(u[2]<R){const e=Math.abs((f.z-R)/-a.direction[2])*x;P([f.x,f.y,f.z],a.direction,e,x,u)}else u[2]=R;g.push(new o(u,f.spatialReference))}return g}async function q(e,t){const{feature:r,footprintExtent:a,options:n}=t,{attributes:{cameraHeight:i,cameraOrientation:c,cameraPitch:f,cameraRoll:p,elevationSource:m,horizontalFieldOfView:l,location:y,verticalFieldOfView:w},elevationSample:z}=r,d=v(c),{vfov:j}=M(l,w,p??0);let b=new o(y),P=!1;d&&(b=new o(O(b,[c.latitude,c.longitude,c.ellipsoidRadius,c.squaredEccentricity]))),b.spatialReference.isWGS84&&(P=!0,b=u(b));const F=R(b),L=I(t,b,F),H=d?L.map((e=>x(new o(e)))):L,V=await h(H,t,!0).then((e=>e.map((e=>({x:e.x,y:e.y,z:1}))))),A=new Array;for(const u of e){const e={...X(u),z:1},c={...S(e,V,H),spatialReference:b.spatialReference},[p]=await h([d?x(new o(c)):new o(c)],t,!0);await B(e,p,V,H,b,c,d,t);const l=r.attributes.clone();l.geometry=b.clone();const{polygon:y}=g(l),w=y.rings[0].map((e=>new o(e,y.spatialReference))),R=await s(m||z?await J({cameraLocation:b,groundFootPrint:w,projectedPoint:c,webMercatorScalingFactor:F,vfov:j,shouldConvertToLatLong:P,isCameraOrientationLTP:d,imgPoint:e},t):new o(k(c,b,F,b.z-i,f,j,P)),a.spatialReference,n);A.push(R)}return A}async function J(e,t){const{cameraLocation:r,groundFootPrint:a,projectedPoint:n,webMercatorScalingFactor:i,vfov:s,shouldConvertToLatLong:f,isCameraOrientationLTP:p,imgPoint:m}=e,{cameraHeight:l,cameraPitch:y}=t.feature.attributes;await c(r.spatialReference,t.footprintExtent.spatialReference,null,t.options);let u=await Z(a,t),g=0,w=(r.z??0)-l,z=0;for(;z<10;){const e=K(u,r,n);if(!e||!N([r.x,r.y,r.z],[e.x,e.y,e.z],[n.x,n.y,n.z]))return new o(k(n,r,i,w,y,s,f));const a=new o({x:e.x,y:e.y,z:e.z,spatialReference:r.spatialReference}),c=await h([p?x(a):a],t);if(g=Math.abs(m.x-c[0].x)+Math.abs(m.y-c[0].y),w=e.z,g<=1)return new o(k(n,r,i,w,y,s,f));z+=1;const{extent:l}=u,R=(l?.width??0)/10,j=(l?.height??0)/10;if(R<1||j<1)return new o(k(n,r,i,w,y,s,f));const{x:b,y:P}=e,v=await d(Q(R,j).map((([e,t])=>new o({x:b+e,y:P+t,spatialReference:r.spatialReference}))),t,!1);v.push(v[0]),u=new C({rings:[v.map((e=>e.toArray()))],spatialReference:r.spatialReference})}return new o(k(n,r,i,w,y,s,f))}const N=(e,r,i)=>a(n(t(),r,e),n(t(),i,e))>0;function k(e,r,a,i,s,c,f){const p=Math.sqrt((e.z-r.z)**2+(Math.sqrt((e.x-r.x)**2+(e.y-r.y)**2)/a)**2)*a,m=F(n(t(),[e.x,e.y,e.z],[r.x,r.y,r.z]),1/p,1/a);if(e.z<i||s+c/2<90){const t=Math.abs((r.z-i)/-m[2])*a,n=P([r.x,r.y,r.z],m,t,a);e.x=n[0],e.y=n[1],e.z=n[2]}else e.z=i;return f?x(new o(e)).toJSON():e}function I(r,a,s){const{feature:c}=r,{attributes:f}=c,p=2*Math.tan(e(f.verticalFieldOfView)/2)*f.farDistance*s,m=2*Math.tan(e(f.horizontalFieldOfView)/2)*f.farDistance*s,l=L("HPR",[f.cameraHeading,f.cameraPitch,f.cameraRoll??0]),y=H([0,0,-1],l),u=P([a.x,a.y,a.z],y,f.farDistance*s,s),x=H([0,1,0],l),g=H([1,0,0],l),w=F(x,p/2,s),z=F(g,m/2,s),h=n(t(),w,z),d=i(t(),w,z);return[i(t(),u,h),i(t(),u,d),n(t(),u,h),n(t(),u,d)].map((e=>{const[t,r,n]=e;return new o({x:t,y:r,z:n,spatialReference:a.spatialReference})}))}async function Z(e,t){const r=e[0].spatialReference.isWGS84?D.WebMercator:e[0].spatialReference,{cameraHeight:a,location:n,elevation:i}=t.feature.attributes,s="number"==typeof n.z&&"number"==typeof i?n.z-i:a,c=w(e.map((({x:e,y:t,z:r})=>[e,t,r])),s,n,R(n)),p=(await d(c.map((e=>new o(e,n.spatialReference))),t,!1)).map((e=>f(e,r)));return new C({hasZ:!0,rings:[p.map((({x:e,y:t,z:r})=>[e,t,r??0]))],spatialReference:r})}async function B(e,t,r,a,n,i,s,c){let f=0;const p=8;for(let m=0;m<=p;m+=1){if(f=Math.abs(e.x-t.x)+Math.abs(e.y-t.y),f<=1)return;const[p,m,l,y]=Q(f,f).map((([t,i])=>({...V({x:e.x+t,y:e.y+i,z:1},r[0],r[1],r[2],r[3],{x:a[0].x,y:a[0].y,z:a[0].z},{x:a[1].x,y:a[1].y,z:a[1].z},{x:a[2].x,y:a[2].y,z:a[2].z},{x:a[3].x,y:a[3].y,z:a[3].z}),spatialReference:n.spatialReference}))),[u,g,w,z]=await h(s?[x(new o(p)),x(new o(m)),x(new o(l)),x(new o(y))]:[new o(p),new o(m),new o(l),new o(y)],c,!0).then((e=>e.map((e=>({...X(e),z:0}))))),{x:d,y:R,z:j}=V(e,u,g,w,z,p,m,l,y);i.x=d,i.y=R,i.z=j,[t]=await h([s?x(new o(i)):new o(i)],c,!0)}}function K(e,t,r){const a={x:e.rings[0][0][0],y:e.rings[0][0][1],z:e.rings[0][0][2]},n={x:e.rings[0][1][0],y:e.rings[0][1][1],z:e.rings[0][1][2]},i={x:e.rings[0][1][0],y:e.rings[0][1][1],z:e.rings[0][1][2]},o={x:e.rings[0][2][0],y:e.rings[0][2][1],z:e.rings[0][2][2]},s=(o.z-i.z)*(n.y-a.y)-(o.y-i.y)*(n.z-a.z),c=-((o.z-i.z)*(n.x-a.x)-(n.z-a.z)*(o.x-i.x)),f=(o.y-i.y)*(n.x-a.x)-(n.y-a.y)*(o.x-i.x),p=-(s*a.x+c*a.y+f*a.z);return A(t.toJSON(),r,s,c,f,p)}const Q=(e,t)=>[[-e,-t],[e,-t],[e,t],[-e,t]],X=({x:e,y:t})=>({x:e,y:t});export{E as transformPoints};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.31/esri/copyright.txt for details.
4
4
  */
5
- import{_ as t}from"../../chunks/tslib.es6.js";import e from"../../core/Accessor.js";import{property as o}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{subclass as s}from"../../core/accessorSupport/decorators/subclass.js";import{fromValues as i,create as a}from"../../core/libs/gl-matrix-2/factories/mat3f64.js";import{fromValues as r,create as l}from"../../core/libs/gl-matrix-2/factories/vec3f64.js";import{multiply as n,transpose as h}from"../../core/libs/gl-matrix-2/math/mat3.js";import{m,r as g,f as u,t as c}from"../../chunks/vec32.js";import p from"../../geometry/Point.js";import d from"../../geometry/SpatialReference.js";import{WGS84ECEFSpatialReference as f}from"../../geometry/spatialReferenceEllipsoidUtils.js";import{projectBuffer as v}from"../../geometry/projection/projectBuffer.js";import{earth as _}from"../../geometry/support/Ellipsoid.js";import{videoMetadataEntryId as A}from"./videoUtils.js";const M=Math.PI/180;let V=class extends e{constructor(t){super(),this.averageElevation=0,this.imageHeight=0,this.imageWidth=0,this.metadataSupportsTransforms=!1,this.platformHeadingAngle=0,this.platformPitchAngle=0,this.platformRollAngle=0,this.sensorHeadingAngle=0,this.sensorAltitude=0,this.sensorHorizontalFieldOfView=0,this.sensorLatitude=0,this.sensorLongitude=0,this.sensorPitchAngle=0,this.sensorRollAngle=0,this.sensorVerticalFieldOfView=0,this.vttMetadata=new Map,this._createMat3FromValues=t=>{const e=t[0],o=t[1],s=t[2];return i(e[0],o[0],s[0],e[1],o[1],s[1],e[2],o[2],s[2])},this._multiplyMat3=(t,e)=>{const o=a();return n(o,t,e),o},this._transposeMat3=t=>{const e=a();return h(e,t),e},this._calculateCameraFovForward=()=>this._createMat3FromValues([[0,0,1],[Math.tan(.5*this.sensorHorizontalFieldOfView*M),0,0],[0,Math.tan(.5*this.sensorVerticalFieldOfView*M),0]]),this._calculateCameraFovReverse=()=>this._createMat3FromValues([[0,1/Math.tan(.5*this.sensorHorizontalFieldOfView*M),0],[0,0,1/Math.tan(.5*this.sensorVerticalFieldOfView*M)],[1,0,0]]),this._calculateCameraLook=()=>this._getRotationMatrixZYX(this.sensorHeadingAngle*M,this.sensorPitchAngle*M,this.sensorRollAngle*M),this._calculateImageDimensionsForward=()=>this._createMat3FromValues([[2/this.imageWidth,0,-1],[0,-2/this.imageHeight,-1],[0,0,1]]),this._calculateImageDimensionsReverse=()=>this._createMat3FromValues([[this.imageWidth/2,0,this.imageWidth/2],[0,-this.imageHeight/2,-this.imageHeight/2],[0,0,1]]),this._calculatePlatformPositionMatrix=()=>{const t=Math.sin(this.sensorLatitude*M),e=Math.cos(this.sensorLatitude*M),o=Math.sin(this.sensorLongitude*M),s=Math.cos(this.sensorLongitude*M);return this._createMat3FromValues([[-t*s,-o,-e*s],[-t*o,s,-e*o],[e,0,-t]])},this._calculatePlatformOrientation=()=>this._getRotationMatrixZYX(this.platformHeadingAngle*M,this.platformPitchAngle*M,this.platformRollAngle*M),this._extractValues=t=>{this.imageWidth=t.get(A.EsriVideoWidth)?.value,this.imageHeight=t.get(A.EsriVideoHeight)?.value;const e=t.get(A.SensorEllipsoidHeight)?.value;this.sensorAltitude=e??t.get(A.SensorTrueAltitude)?.value,this.sensorLatitude=t.get(A.SensorLatitude)?.value,this.sensorLongitude=t.get(A.SensorLongitude)?.value,this.sensorHeadingAngle=t.get(A.SensorAzimuthAngle)?.value,this.sensorPitchAngle=t.get(A.SensorElevationAngle)?.value,this.sensorRollAngle=t.get(A.SensorRollAngle)?.value,this.sensorHorizontalFieldOfView=t.get(A.SensorHorizontalFOV)?.value,this.sensorVerticalFieldOfView=t.get(A.SensorVerticalFOV)?.value,this.platformHeadingAngle=t.get(A.PlatformHeadingAngle)?.value,this.platformPitchAngle=t.get(A.PlatformPitchAngle)?.value,this.platformRollAngle=t.get(A.PlatformRollAngle)?.value,this.averageElevation=t.get(A.FrameCenterElevation)?.value||0},this._getRotationMatrixZYX=(t,e,o)=>{const s=Math.cos(t),i=Math.sin(t),a=Math.cos(e),r=Math.sin(e),l=Math.cos(o),n=Math.sin(o);return this._createMat3FromValues([[s*a,s*r*n-l*i,i*n+s*l*r],[a*i,s*l+i*r*n,l*i*r-s*n],[-r,a*n,a*l]])},this._initCameraSensor=()=>{const t=this._calculateCameraFovForward(),e=this._calculateCameraFovReverse(),o=this._calculateCameraLook(),s=this._calculateImageDimensionsForward(),i=this._calculateImageDimensionsReverse(),a=this._calculatePlatformPositionMatrix(),r=this._calculatePlatformOrientation(),l=this._multiplyMat3(this._multiplyMat3(a,r),o);this._imageToEarthTransform=this._multiplyMat3(this._multiplyMat3(l,t),s);const n=this._multiplyMat3(i,e);this._earthToImageTransform=this._multiplyMat3(n,this._transposeMat3(l)),this._platformPositionEcef=this._projectPointToECEF(this.sensorLongitude,this.sensorLatitude,this.sensorAltitude||this.averageElevation)},this._metadataSupportsTransforms=t=>{if(!t?.size)return!1;const e=t.get(A.EsriVideoWidth)?.value??0,o=t.get(A.EsriVideoHeight)?.value??0;if(e<=0||o<=0)return!1;const s=t.get(A.SensorEllipsoidHeight)?.value,i=t.get(A.SensorTrueAltitude)?.value,a=t.get(A.SensorLatitude)?.value,r=t.get(A.SensorLongitude)?.value;if(null==s&&null==i||null==a||null==r)return!1;const l=t.get(A.PlatformHeadingAngle)?.value,n=t.get(A.PlatformPitchAngle)?.value,h=t.get(A.PlatformRollAngle)?.value;if(null==l||null==n||null==h)return!1;const m=t.get(A.SensorHorizontalFOV)?.value,g=t.get(A.SensorVerticalFOV)?.value;if(null==m||null==g)return!1;const u=t.get(A.SensorAzimuthAngle)?.value,c=t.get(A.SensorElevationAngle)?.value,p=t.get(A.SensorRollAngle)?.value;return null!=u&&null!=c&&null!=p},this._projectPointToECEF=(t,e,o)=>{const s=[];return v([t,e,o],d.WGS84,0,s,f,0,1),new p({x:s[0],y:s[1],z:s[2],spatialReference:f})},this._projectImageVectorToEllipsoid=(t,e)=>{const o=_.semiMajorAxis+e,s=_.semiMinorAxis+e,i=s/o,a=o/s,{x:n,y:h,z:u}=this._platformPositionEcef,c=u??this.averageElevation,p=r(n,h,a*c),d=m(t,t),f=m(t,p),v=m(p,p)-o*o,A=(-f-Math.sqrt(f*f-d*v))/d;if(A<0)return[NaN,NaN,NaN];const M=l();return g(M,p,t,A),M[2]=M[2]*i,M};const e=t?.videoMetadata;this._set("metadataSupportsTransforms",this._metadataSupportsTransforms(e)),this.metadataSupportsTransforms&&(this._extractValues(e),this._initCameraSensor())}transformGeoToImage(t,e,o){const s=this._platformPositionEcef;if(!s)return[0,0];const{x:i,y:a,z:n}=s,h=r(i,a,n),m=this._projectPointToECEF(t,e,o||this.averageElevation),g=l(),p=r(m.x,m.y,m.z);u(g,p,h),c(g,g,this._earthToImageTransform);const d=g[0],f=g[1],v=g[2];let _=r(NaN,NaN,NaN);return isNaN(v)||(_=r(d/v,f/v,v/v)),[_[0],_[1]]}transformImageToGeo(t,e){const o=r(t,e,1),s=l();c(s,o,this._imageToEarthTransform);const i=this._projectImageVectorToEllipsoid(s,this.averageElevation);let a;if(!isNaN(i[0])){const t=[];v([i[0],i[1],i[2]],f,0,t,d.WGS84,0,1),a=new p({x:t[0],y:t[1],z:t[2],spatialReference:d.WGS84})}return a}};t([o()],V.prototype,"averageElevation",void 0),t([o()],V.prototype,"imageHeight",void 0),t([o()],V.prototype,"imageWidth",void 0),t([o({readOnly:!0})],V.prototype,"metadataSupportsTransforms",void 0),t([o()],V.prototype,"platformHeadingAngle",void 0),t([o()],V.prototype,"platformPitchAngle",void 0),t([o()],V.prototype,"platformRollAngle",void 0),t([o()],V.prototype,"sensorHeadingAngle",void 0),t([o()],V.prototype,"sensorAltitude",void 0),t([o()],V.prototype,"sensorHorizontalFieldOfView",void 0),t([o()],V.prototype,"sensorLatitude",void 0),t([o()],V.prototype,"sensorLongitude",void 0),t([o()],V.prototype,"sensorPitchAngle",void 0),t([o()],V.prototype,"sensorRollAngle",void 0),t([o()],V.prototype,"sensorVerticalFieldOfView",void 0),t([o()],V.prototype,"vttMetadata",void 0),V=t([s("esri.layers.video.VideoCameraSensorModel")],V);const y=V;export{y as default};
5
+ import{_ as t}from"../../chunks/tslib.es6.js";import e from"../../core/Accessor.js";import{property as o}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{subclass as s}from"../../core/accessorSupport/decorators/subclass.js";import{fromValues as i,create as a}from"../../core/libs/gl-matrix-2/factories/mat3f64.js";import{fromValues as r,create as l}from"../../core/libs/gl-matrix-2/factories/vec3f64.js";import{multiply as n,transpose as h}from"../../core/libs/gl-matrix-2/math/mat3.js";import{l as m,r as g,f as u,t as c}from"../../chunks/vec32.js";import p from"../../geometry/Point.js";import d from"../../geometry/SpatialReference.js";import{WGS84ECEFSpatialReference as f}from"../../geometry/spatialReferenceEllipsoidUtils.js";import{projectBuffer as v}from"../../geometry/projection/projectBuffer.js";import{earth as _}from"../../geometry/support/Ellipsoid.js";import{videoMetadataEntryId as A}from"./videoUtils.js";const M=Math.PI/180;let V=class extends e{constructor(t){super(),this.averageElevation=0,this.imageHeight=0,this.imageWidth=0,this.metadataSupportsTransforms=!1,this.platformHeadingAngle=0,this.platformPitchAngle=0,this.platformRollAngle=0,this.sensorHeadingAngle=0,this.sensorAltitude=0,this.sensorHorizontalFieldOfView=0,this.sensorLatitude=0,this.sensorLongitude=0,this.sensorPitchAngle=0,this.sensorRollAngle=0,this.sensorVerticalFieldOfView=0,this.vttMetadata=new Map,this._createMat3FromValues=t=>{const e=t[0],o=t[1],s=t[2];return i(e[0],o[0],s[0],e[1],o[1],s[1],e[2],o[2],s[2])},this._multiplyMat3=(t,e)=>{const o=a();return n(o,t,e),o},this._transposeMat3=t=>{const e=a();return h(e,t),e},this._calculateCameraFovForward=()=>this._createMat3FromValues([[0,0,1],[Math.tan(.5*this.sensorHorizontalFieldOfView*M),0,0],[0,Math.tan(.5*this.sensorVerticalFieldOfView*M),0]]),this._calculateCameraFovReverse=()=>this._createMat3FromValues([[0,1/Math.tan(.5*this.sensorHorizontalFieldOfView*M),0],[0,0,1/Math.tan(.5*this.sensorVerticalFieldOfView*M)],[1,0,0]]),this._calculateCameraLook=()=>this._getRotationMatrixZYX(this.sensorHeadingAngle*M,this.sensorPitchAngle*M,this.sensorRollAngle*M),this._calculateImageDimensionsForward=()=>this._createMat3FromValues([[2/this.imageWidth,0,-1],[0,-2/this.imageHeight,-1],[0,0,1]]),this._calculateImageDimensionsReverse=()=>this._createMat3FromValues([[this.imageWidth/2,0,this.imageWidth/2],[0,-this.imageHeight/2,-this.imageHeight/2],[0,0,1]]),this._calculatePlatformPositionMatrix=()=>{const t=Math.sin(this.sensorLatitude*M),e=Math.cos(this.sensorLatitude*M),o=Math.sin(this.sensorLongitude*M),s=Math.cos(this.sensorLongitude*M);return this._createMat3FromValues([[-t*s,-o,-e*s],[-t*o,s,-e*o],[e,0,-t]])},this._calculatePlatformOrientation=()=>this._getRotationMatrixZYX(this.platformHeadingAngle*M,this.platformPitchAngle*M,this.platformRollAngle*M),this._extractValues=t=>{this.imageWidth=t.get(A.EsriVideoWidth)?.value,this.imageHeight=t.get(A.EsriVideoHeight)?.value;const e=t.get(A.SensorEllipsoidHeight)?.value;this.sensorAltitude=e??t.get(A.SensorTrueAltitude)?.value,this.sensorLatitude=t.get(A.SensorLatitude)?.value,this.sensorLongitude=t.get(A.SensorLongitude)?.value,this.sensorHeadingAngle=t.get(A.SensorAzimuthAngle)?.value,this.sensorPitchAngle=t.get(A.SensorElevationAngle)?.value,this.sensorRollAngle=t.get(A.SensorRollAngle)?.value,this.sensorHorizontalFieldOfView=t.get(A.SensorHorizontalFOV)?.value,this.sensorVerticalFieldOfView=t.get(A.SensorVerticalFOV)?.value,this.platformHeadingAngle=t.get(A.PlatformHeadingAngle)?.value,this.platformPitchAngle=t.get(A.PlatformPitchAngle)?.value,this.platformRollAngle=t.get(A.PlatformRollAngle)?.value,this.averageElevation=t.get(A.FrameCenterElevation)?.value||0},this._getRotationMatrixZYX=(t,e,o)=>{const s=Math.cos(t),i=Math.sin(t),a=Math.cos(e),r=Math.sin(e),l=Math.cos(o),n=Math.sin(o);return this._createMat3FromValues([[s*a,s*r*n-l*i,i*n+s*l*r],[a*i,s*l+i*r*n,l*i*r-s*n],[-r,a*n,a*l]])},this._initCameraSensor=()=>{const t=this._calculateCameraFovForward(),e=this._calculateCameraFovReverse(),o=this._calculateCameraLook(),s=this._calculateImageDimensionsForward(),i=this._calculateImageDimensionsReverse(),a=this._calculatePlatformPositionMatrix(),r=this._calculatePlatformOrientation(),l=this._multiplyMat3(this._multiplyMat3(a,r),o);this._imageToEarthTransform=this._multiplyMat3(this._multiplyMat3(l,t),s);const n=this._multiplyMat3(i,e);this._earthToImageTransform=this._multiplyMat3(n,this._transposeMat3(l)),this._platformPositionEcef=this._projectPointToECEF(this.sensorLongitude,this.sensorLatitude,this.sensorAltitude||this.averageElevation)},this._metadataSupportsTransforms=t=>{if(!t?.size)return!1;const e=t.get(A.EsriVideoWidth)?.value??0,o=t.get(A.EsriVideoHeight)?.value??0;if(e<=0||o<=0)return!1;const s=t.get(A.SensorEllipsoidHeight)?.value,i=t.get(A.SensorTrueAltitude)?.value,a=t.get(A.SensorLatitude)?.value,r=t.get(A.SensorLongitude)?.value;if(null==s&&null==i||null==a||null==r)return!1;const l=t.get(A.PlatformHeadingAngle)?.value,n=t.get(A.PlatformPitchAngle)?.value,h=t.get(A.PlatformRollAngle)?.value;if(null==l||null==n||null==h)return!1;const m=t.get(A.SensorHorizontalFOV)?.value,g=t.get(A.SensorVerticalFOV)?.value;if(null==m||null==g)return!1;const u=t.get(A.SensorAzimuthAngle)?.value,c=t.get(A.SensorElevationAngle)?.value,p=t.get(A.SensorRollAngle)?.value;return null!=u&&null!=c&&null!=p},this._projectPointToECEF=(t,e,o)=>{const s=[];return v([t,e,o],d.WGS84,0,s,f,0,1),new p({x:s[0],y:s[1],z:s[2],spatialReference:f})},this._projectImageVectorToEllipsoid=(t,e)=>{const o=_.semiMajorAxis+e,s=_.semiMinorAxis+e,i=s/o,a=o/s,{x:n,y:h,z:u}=this._platformPositionEcef,c=u??this.averageElevation,p=r(n,h,a*c),d=m(t,t),f=m(t,p),v=m(p,p)-o*o,A=(-f-Math.sqrt(f*f-d*v))/d;if(A<0)return[NaN,NaN,NaN];const M=l();return g(M,p,t,A),M[2]=M[2]*i,M};const e=t?.videoMetadata;this._set("metadataSupportsTransforms",this._metadataSupportsTransforms(e)),this.metadataSupportsTransforms&&(this._extractValues(e),this._initCameraSensor())}transformGeoToImage(t,e,o){const s=this._platformPositionEcef;if(!s)return[0,0];const{x:i,y:a,z:n}=s,h=r(i,a,n),m=this._projectPointToECEF(t,e,o||this.averageElevation),g=l(),p=r(m.x,m.y,m.z);u(g,p,h),c(g,g,this._earthToImageTransform);const d=g[0],f=g[1],v=g[2];let _=r(NaN,NaN,NaN);return isNaN(v)||(_=r(d/v,f/v,v/v)),[_[0],_[1]]}transformImageToGeo(t,e){const o=r(t,e,1),s=l();c(s,o,this._imageToEarthTransform);const i=this._projectImageVectorToEllipsoid(s,this.averageElevation);let a;if(!isNaN(i[0])){const t=[];v([i[0],i[1],i[2]],f,0,t,d.WGS84,0,1),a=new p({x:t[0],y:t[1],z:t[2],spatialReference:d.WGS84})}return a}};t([o()],V.prototype,"averageElevation",void 0),t([o()],V.prototype,"imageHeight",void 0),t([o()],V.prototype,"imageWidth",void 0),t([o({readOnly:!0})],V.prototype,"metadataSupportsTransforms",void 0),t([o()],V.prototype,"platformHeadingAngle",void 0),t([o()],V.prototype,"platformPitchAngle",void 0),t([o()],V.prototype,"platformRollAngle",void 0),t([o()],V.prototype,"sensorHeadingAngle",void 0),t([o()],V.prototype,"sensorAltitude",void 0),t([o()],V.prototype,"sensorHorizontalFieldOfView",void 0),t([o()],V.prototype,"sensorLatitude",void 0),t([o()],V.prototype,"sensorLongitude",void 0),t([o()],V.prototype,"sensorPitchAngle",void 0),t([o()],V.prototype,"sensorRollAngle",void 0),t([o()],V.prototype,"sensorVerticalFieldOfView",void 0),t([o()],V.prototype,"vttMetadata",void 0),V=t([s("esri.layers.video.VideoCameraSensorModel")],V);const y=V;export{y as default};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arcgis/core",
3
- "version": "4.31.0-next.20240821",
3
+ "version": "4.31.0-next.20240823",
4
4
  "homepage": "https://js.arcgis.com",
5
5
  "description": "ArcGIS Maps SDK for JavaScript: A complete 2D and 3D mapping and data visualization API",
6
6
  "keywords": [
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.31/esri/copyright.txt for details.
4
4
  */
5
- const e="20240821",c="1741bf32a83cc6d4fb5ec05ef01ff9551de65cee";export{e as buildDate,c as commitHash};
5
+ const e="20240823",b="d6b6a5579b96b4e3d37be2523fe6528af5e476ce";export{e as buildDate,b as commitHash};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.31/esri/copyright.txt for details.
4
4
  */
5
- import{defaultFontFamily as t}from"../../core/fontUtils.js";import has from"../../core/has.js";import{clone as e}from"../../core/lang.js";import r from"../../core/Logger.js";import i from"../../core/ObjectPool.js";import{px2pt as s,pt2px as o}from"../../core/screenUtils.js";import{GeometryCursor as n}from"../../geometry/GeometryCursor.js";import{fromValues as a,create as l}from"../../geometry/support/aaBoundingRect.js";import{getBoundsXY as h}from"../../geometry/support/boundsUtils.js";import{polygonCentroid as c}from"../../geometry/support/centroid.js";import{isPoint as m,isPolygon as f,isPolyline as u,isExtent as d,isMultipoint as p}from"../../geometry/support/jsonUtils.js";import{SimpleEffectCursor as _}from"./CIMEffects.js";import g from"./CIMImageColorSubstitutionHelper.js";import{getEffectOperator as y,getPlacementOperator as P}from"./CIMOperators.js";import{Placement as w}from"./CIMPlacements.js";import{defaultCIMValues as x}from"./defaultCIMValues.js";import{LineCapStyle as S,LineJoinStyle as M}from"./enums.js";import{getFirstFrame as b}from"./imageUtils.js";import k from"./Rect.js";import C from"./TextRasterizer.js";import{getNumericValue as I,isCIMFill as T,getSize as R,isSVGImage as v,fromCIMFontDecoration as z,fromCIMFontStyle as F,fromCIMHorizontalAlignment as L,fromCIMVerticalAlignment as A,getFillColor as U,getStrokeWidth as j,getStrokeColor as H,getFontStyle as G,getFontWeight as D}from"./utils.js";import{glyphSize as B,magicLabelLineHeight as X,hittestToleranceSmallSymbol as E,hittestSmallSymbolThreshold as N}from"../../views/2d/engine/webgl/definitions.js";import{shapeGlyphs as J}from"../../views/2d/engine/webgl/mesh/templates/shapingUtils.js";import{roundPtToWholePixel as O,getLineWidth as V}from"../../views/2d/layers/graphics/graphicsUtils.js";const q=Math.PI/180,Y=.5,W=()=>r.getLogger("esri.symbols.cim.CIMSymbolDrawHelper");class K{constructor(t){this._t=t}static createIdentity(){return new K([1,0,0,0,1,0])}clone(){const t=this._t;return new K(t.slice())}transform(t){const e=this._t;return[e[0]*t[0]+e[1]*t[1]+e[2],e[3]*t[0]+e[4]*t[1]+e[5]]}static createScale(t,e){return new K([t,0,0,0,e,0])}scale(t,e){const r=this._t;return r[0]*=t,r[1]*=t,r[2]*=t,r[3]*=e,r[4]*=e,r[5]*=e,this}scaleRatio(){return Math.sqrt(this._t[0]*this._t[0]+this._t[1]*this._t[1])}static createTranslate(t,e){return new K([0,0,t,0,0,e])}translate(t,e){const r=this._t;return r[2]+=t,r[5]+=e,this}static createRotate(t){const e=Math.cos(t),r=Math.sin(t);return new K([e,-r,0,r,e,0])}rotate(t){return K.multiply(this,K.createRotate(t),this)}angle(){const t=this._t[0],e=this._t[3],r=Math.sqrt(t*t+e*e);return[t/r,e/r]}static multiply(t,e,r){const i=t._t,s=e._t,o=i[0]*s[0]+i[3]*s[1],n=i[1]*s[0]+i[4]*s[1],a=i[2]*s[0]+i[5]*s[1]+s[2],l=i[0]*s[3]+i[3]*s[4],h=i[1]*s[3]+i[4]*s[4],c=i[2]*s[3]+i[5]*s[4]+s[5],m=r._t;return m[0]=o,m[1]=n,m[2]=a,m[3]=l,m[4]=h,m[5]=c,r}invert(){const t=this._t;let e=t[0]*t[4]-t[1]*t[3];if(0===e)return new K([0,0,0,0,0,0]);e=1/e;const r=(t[1]*t[5]-t[2]*t[4])*e,i=(t[2]*t[3]-t[0]*t[5])*e,s=t[4]*e,o=-t[1]*e,n=-t[3]*e,a=t[0]*e;return new K([s,o,r,n,a,i])}}class Q{constructor(t,e){this._resourceManager=t,this._transfos=[],this._sizeTransfos=[],this._geomUnitsPerPoint=1,this._placementPool=new i(w,void 0,void 0,100),this._earlyReturn=!1,this._mapRotation=0,this._transfos.push(e||K.createIdentity()),this._sizeTransfos.push(e?e.scaleRatio():1)}setTransform(t,e){this._transfos=[t||K.createIdentity()],this._sizeTransfos=[e||(t?t.scaleRatio():1)]}setGeomUnitsPerPoint(t){this._geomUnitsPerPoint=t}transformPt(t){return this._transfos[this._transfos.length-1].transform(t)}transformSize(t){return t*this._sizeTransfos[this._sizeTransfos.length-1]}reverseTransformPt(t){return this._transfos[this._transfos.length-1].invert().transform(t)}reverseTransformSize(t){return t/this._sizeTransfos[this._sizeTransfos.length-1]}reverseTransformScalar(t){return t/this._transfos[this._transfos.length-1].scaleRatio()}getTransformAngle(){return this._transfos[this._transfos.length-1].angle()}geomUnitsPerPoint(){return this.isEmbedded()?1:this._geomUnitsPerPoint}prevGeomUnitsPerPoint(){return this._transfos.length>2?1:this._geomUnitsPerPoint}isEmbedded(){return this._transfos.length>1}back(){return this._transfos[this._transfos.length-1]}push(t,e){const r=e?t.scaleRatio():1;K.multiply(t,this.back(),t),this._transfos.push(t),this._sizeTransfos.push(this._sizeTransfos[this._sizeTransfos.length-1]*r)}pop(){this._transfos.splice(-1,1),this._sizeTransfos.splice(-1,1)}drawSymbol(t,e,r){if(t)switch(t.type){case"CIMPointSymbol":case"CIMLineSymbol":case"CIMPolygonSymbol":this.drawMultiLayerSymbol(t,e);break;case"CIMTextSymbol":this.drawTextSymbol(t,e,r)}}drawMultiLayerSymbol(t,e){if(!t||!e)return;const r=t.symbolLayers;if(!r)return;const i=t.effects;if(i&&i.length>0){const t=this.executeEffects(i,e);if(t){let e=t.next();for(;e;)this.drawSymbolLayers(r,e.asJSON()),e=t.next()}}else this.drawSymbolLayers(r,e)}executeEffects(t,e){const r=this._resourceManager.geometryEngine;let i=new _(n.fromJSONCIM(e));for(const s of t){const t=y(s);t&&(i=t.execute(i,s,this.geomUnitsPerPoint(),null,r))}return i}drawSymbolLayers(t,e){let r=t.length;for(;r--;){const i=t[r];if(!i||!1===i.enable)continue;const s=i.effects;if(s&&s.length>0){const t=this.executeEffects(s,e);if(t){let e=null;for(;(e=t.next())&&(this.drawSymbolLayer(i,e.asJSON()),!this._earlyReturn););}}else this.drawSymbolLayer(i,e);if(this._earlyReturn)return}}drawSymbolLayer(t,e){switch(t.type){case"CIMSolidFill":this.drawSolidFill(e,t.color);break;case"CIMHatchFill":this.drawHatchFill(e,t);break;case"CIMPictureFill":this.drawPictureFill(e,t);break;case"CIMGradientFill":this.drawGradientFill(e,t);break;case"CIMSolidStroke":this.drawSolidStroke(e,t.color,t.width,t.capStyle,t.joinStyle,t.miterLimit);break;case"CIMPictureStroke":this.drawPictureStroke(e,t);break;case"CIMGradientStroke":this.drawGradientStroke(e,t);break;case"CIMCharacterMarker":case"CIMPictureMarker":case"CIMVectorMarker":this.drawMarkerLayer(t,e)}}drawHatchFill(t,e){const r=et(e,t,this.geomUnitsPerPoint());r&&(this.pushClipPath(t),this.drawMultiLayerSymbol(e.lineSymbol,r),this.popClipPath())}drawPictureFill(t,e){}drawGradientFill(t,e){}drawPictureStroke(t,e){}drawGradientStroke(t,e){}drawMarkerLayer(t,e){const r=t.markerPlacement;if(r){const i=P(r);if(i){const s="CIMMarkerPlacementInsidePolygon"===r.type||"CIMMarkerPlacementPolygonCenter"===r.type&&r.clipAtBoundary;s&&this.pushClipPath(e);const o=i.execute(n.fromJSONCIM(e),r,this.geomUnitsPerPoint(),null,this._resourceManager.geometryEngine);if(o){let e=null;for(;(e=o.next())&&(this.drawMarker(t,e),!this._earlyReturn););}s&&this.popClipPath()}}else{const r=this._placementPool.acquire();if(m(e))r.tx=e.x,r.ty=e.y,this.drawMarker(t,r);else if(f(e)){const i=c(e);i&&([r.tx,r.ty]=i,this.drawMarker(t,r))}else for(const i of e.points)if(r.tx=i[0],r.ty=i[1],this.drawMarker(t,r),this._earlyReturn)break;this._placementPool.release(r)}}drawMarker(t,e){switch(t.type){case"CIMCharacterMarker":case"CIMPictureMarker":this.drawPictureMarker(t,e);break;case"CIMVectorMarker":this.drawVectorMarker(t,e)}}drawPictureMarker(t,e){if(!t)return;const r=this._resourceManager.getResource(t.url),i=I(t.size,x.CIMPictureMarker.size);if(null==r||i<=0)return;const s=r.width,o=r.height;if(!s||!o)return;const n=s/o,a=I(t.scaleX,1),l=K.createIdentity(),h=t.anchorPoint;if(h){let e=h.x,r=h.y;"Absolute"!==t.anchorPointUnits&&(e*=i*n*a,r*=i),l.translate(-e,-r)}let c=I(t.rotation);t.rotateClockwise&&(c=-c),this._mapRotation&&(c+=this._mapRotation),c&&l.rotate(c*q);let m=I(t.offsetX),f=I(t.offsetY);if(m||f){if(this._mapRotation){const t=q*this._mapRotation,e=Math.cos(t),r=Math.sin(t),i=m*r+f*e;m=m*e-f*r,f=i}l.translate(m,f)}const u=this.geomUnitsPerPoint();1!==u&&l.scale(u,u);const d=e.getAngle();d&&l.rotate(d),l.translate(e.tx,e.ty),this.push(l,!1),this.drawImage(t,i),this.pop()}drawVectorMarker(t,e){if(!t)return;const r=t.markerGraphics;if(!r)return;const i=I(t.size,x.CIMVectorMarker.size),s=t.frame,o=s?s.ymax-s.ymin:0,n=i&&o?i/o:1,a=K.createIdentity();s&&a.translate(.5*-(s.xmax+s.xmin),.5*-(s.ymax+s.ymin));const l=t.anchorPoint;if(l){let e=l.x,r=l.y;"Absolute"!==t.anchorPointUnits?s&&(e*=s.xmax-s.xmin,r*=s.ymax-s.ymin):(e/=n,r/=n),a.translate(-e,-r)}1!==n&&a.scale(n,n);let h=I(t.rotation);t.rotateClockwise&&(h=-h),this._mapRotation&&(h+=this._mapRotation),h&&a.rotate(h*q);let c=I(t.offsetX),m=I(t.offsetY);if(c||m){if(this._mapRotation){const t=q*this._mapRotation,e=Math.cos(t),r=Math.sin(t),i=c*r+m*e;c=c*e-m*r,m=i}a.translate(c,m)}const f=this.geomUnitsPerPoint();1!==f&&a.scale(f,f);const u=e.getAngle();u&&a.rotate(u),a.translate(e.tx,e.ty),this.push(a,t.scaleSymbolsProportionally);for(const d of r){d?.symbol&&d.geometry||W().error("Invalid marker graphic",d);let t=d.textString;if("number"==typeof t&&(t=t.toString()),this.drawSymbol(d.symbol,d.geometry,t),this._earlyReturn)break}this.pop()}drawTextSymbol(t,e,r){if(!t)return;if(!m(e))return;if(I(t.height,x.CIMTextSymbol.height)<=0)return;const i=K.createIdentity();let s=I(t.angle);s=-s,s&&i.rotate(s*q);const o=I(t.offsetX),n=I(t.offsetY);(o||n)&&i.translate(o,n);const a=this.geomUnitsPerPoint();1!==a&&i.scale(a,a),i.translate(e.x,e.y),this.push(i,!1),this.drawText(t,r),this.pop()}}class Z extends Q{constructor(t,e){super(t,e),this.reset()}reset(){this._xmin=this._ymin=1/0,this._xmax=this._ymax=-1/0,this._clipCount=0}envelope(){return new k(this._xmin,this._ymin,this._xmax-this._xmin,this._ymax-this._ymin)}bounds(){return a(this._xmin,this._ymin,this._xmax,this._ymax)}drawSolidFill(t){if(t&&!(this._clipCount>0))if(f(t))this._processPath(t.rings,0);else if(u(t))this._processPath(t.paths,0);else if(d(t)){const e=ot(t);e&&this._processPath(e.rings,0)}else console.error("drawSolidFill Unexpected geometry type!")}drawSolidStroke(t,e,r){if(!t||this._clipCount>0||null==r||r<=0)return;const i=Math.max(.5*this.transformSize(I(r,x.CIMSolidStroke.width)),.5*Y);if(f(t))this._processPath(t.rings,i);else if(u(t))this._processPath(t.paths,i);else if(d(t)){const e=ot(t);e&&this._processPath(e.rings,i)}else console.error("drawSolidStroke unexpected geometry type!")}drawMarkerLayer(t,e){f(e)&&t.markerPlacement&&("CIMMarkerPlacementInsidePolygon"===t.markerPlacement.type||"CIMMarkerPlacementPolygonCenter"===t.markerPlacement.type&&t.markerPlacement.clipAtBoundary)?this._processPath(e.rings,0):super.drawMarkerLayer(t,e)}drawHatchFill(t,e){this.drawSolidFill(t)}drawPictureFill(t,e){this.drawSolidFill(t)}drawGradientFill(t,e){this.drawSolidFill(t)}drawPictureStroke(t,e){this.drawSolidStroke(t,null,e.width)}drawGradientStroke(t,e){this.drawSolidStroke(t,null,e.width)}pushClipPath(t){this.drawSolidFill(t),this._clipCount++}popClipPath(){this._clipCount--}drawImage(t,e){const{url:r}=t,i=I(t.scaleX,1);let s=i*e,o=e;const n=this._resourceManager.getResource(r);if(null!=n){const t=n.height/n.width;s=i*(e?t>1?e:e/t:n.width),o=e?t>1?e*t:e:n.height}this._merge(this.transformPt([-s/2,-o/2]),0),this._merge(this.transformPt([-s/2,o/2]),0),this._merge(this.transformPt([s/2,-o/2]),0),this._merge(this.transformPt([s/2,o/2]),0)}drawText(t,e){if(!e||0===e.length)return;this._textRasterizer||(this._textRasterizer=new C);const r=at(t);let[i,o]=this._textRasterizer.computeTextSize(e,r);i=s(i),o=s(o);let n=0;switch(t.horizontalAlignment){case"Left":n=i/2;break;case"Right":n=-i/2}let a=0;switch(t.verticalAlignment){case"Bottom":a=o/2;break;case"Top":a=-o/2;break;case"Baseline":a=o/6}this._merge(this.transformPt([-i/2+n,-o/2+a]),0),this._merge(this.transformPt([-i/2+n,o/2+a]),0),this._merge(this.transformPt([i/2+n,-o/2+a]),0),this._merge(this.transformPt([i/2+n,o/2+a]),0)}_processPath(t,e){if(t)for(const r of t){const t=r?r.length:0;if(t>1){this._merge(this.transformPt(r[0]),e);for(let i=1;i<t;i++)this._merge(this.transformPt(r[i]),e)}}}_merge(t,e){t[0]-e<this._xmin&&(this._xmin=t[0]-e),t[0]+e>this._xmax&&(this._xmax=t[0]+e),t[1]-e<this._ymin&&(this._ymin=t[1]-e),t[1]+e>this._ymax&&(this._ymax=t[1]+e)}}class $ extends Q{constructor(){super(...arguments),this._searchPoint=[0,0],this._searchDistPoint=0,this._textInfo=null}hitTest(t,e,r,i,n,a){const l=a*o(1);this.setTransform(),this.setGeomUnitsPerPoint(l),this._searchPoint=[(t[0]+t[2])/2,(t[1]+t[3])/2],this._searchDistPoint=(t[2]-t[0])/2/l,this._textInfo=i;const h=e&&("CIMPointSymbol"===e.type&&"Map"!==e.angleAlignment||"CIMTextSymbol"===e.type);if(this._mapRotation=h?n:0,!has("esri-mobile")){const t=s(E*window.devicePixelRatio),r=s(N);!(("CIMLineSymbol"===e?.type||"CIMPolygonSymbol"===e?.type)&&e.symbolLayers?.some(T))&&"CIMMeshSymbol"!==e?.type&&(R(e)??0)<r&&(this._searchDistPoint=t)}return this._earlyReturn=!1,this.drawSymbol(e,r),this._earlyReturn}drawSolidFill(t,e){this._hitTestFill(t)}drawHatchFill(t,e){this._hitTestFill(t)}drawPictureFill(t,e){this._hitTestFill(t)}drawGradientFill(t,e){this._hitTestFill(t)}drawSolidStroke(t,e,r,i,s,o){this._hitTestStroke(t,r)}drawPictureStroke(t,e){this._hitTestStroke(t,e.width)}drawGradientStroke(t,e){this._hitTestStroke(t,e.width)}drawMarkerLayer(t,e){t.markerPlacement&&("CIMMarkerPlacementInsidePolygon"===t.markerPlacement.type||"CIMMarkerPlacementPolygonCenter"===t.markerPlacement.type&&t.markerPlacement.clipAtBoundary)?this._hitTestFill(e):super.drawMarkerLayer(t,e)}pushClipPath(t){}popClipPath(){}drawImage(t,e){const{url:r}=t,i=I(t.scaleX,1),s=this._resourceManager.getResource(r);if(null==s||0===s.height||0===e)return;const o=e*this.geomUnitsPerPoint(),n=o*i*(s.width/s.height),a=this.reverseTransformPt(this._searchPoint),l=this._searchDistPoint;Math.abs(a[0])<n/2+l&&Math.abs(a[1])<o/2+l&&(this._earlyReturn=!0)}drawText(t,e){const r=this._textInfo;if(!r)return;const i=r.get(t);if(!i)return;if(!i.glyphMosaicItems.glyphs.length)return;const s=O(I(t.height,x.CIMTextSymbol.height)),{lineGapType:o,lineGap:n}=t,a=o?nt(o,I(n),s):0,l="CIMBackgroundCallout"===t.callout?.type,h=J(i.glyphMosaicItems,{scale:s/B,angle:0,xOffset:0,yOffset:0,horizontalAlignment:t.horizontalAlignment,verticalAlignment:t.verticalAlignment,maxLineWidth:V(t.lineWidth),lineHeight:X*Math.max(.25,Math.min(a||1,4)),decoration:t.font.decoration||"none",useCIMAngleBehavior:!0,hasBackground:l}),c=this.reverseTransformPt(this._searchPoint),m=c[0],f=c[1];for(const u of h.glyphs)if(m>u.xTopLeft&&m<u.xBottomRight&&f>-u.yBottomRight&&f<-u.yTopLeft){this._earlyReturn=!0;break}}_hitTestFill(t){let e=null;if(d(t)){const r=t;e=[[[r.xmin,r.ymin],[r.xmin,r.ymax],[r.xmax,r.ymax],[r.xmax,r.ymin],[r.xmin,r.ymin]]]}else if(f(t))e=t.rings;else{if(!u(t))return;e=t.paths}const r=this.reverseTransformPt(this._searchPoint);if(rt(r,e)&&(this._earlyReturn=!0),!this._earlyReturn){it(r,e,this.reverseTransformScalar(this._searchDistPoint)*this.prevGeomUnitsPerPoint())&&(this._earlyReturn=!0)}}_hitTestStroke(t,e){let r=null;if(d(t)){const e=t;r=[[[e.xmin,e.ymin],[e.xmin,e.ymax],[e.xmax,e.ymax],[e.xmax,e.ymin],[e.xmin,e.ymin]]]}else if(f(t))r=t.rings;else{if(!u(t))return;r=t.paths}it(this.reverseTransformPt(this._searchPoint),r,I(e,x.CIMSolidStroke.width)*this.geomUnitsPerPoint()/2+this.reverseTransformScalar(this._searchDistPoint)*this.prevGeomUnitsPerPoint())&&(this._earlyReturn=!0)}}class tt extends Q{constructor(t,e,r,i){super(e,r),this._applyAdditionalRenderProps=i,this._colorSubstitutionHelper=new g,this._ctx=t}drawSolidFill(t,e){if(!t)return;if(f(t))this._buildPath(t.rings,!0);else if(u(t))this._buildPath(t.paths,!0);else if(d(t))this._buildPath(ot(t).rings,!0);else{if(!p(t))return;console.log("CanvasDrawHelper.drawSolidFill - No implementation!")}const r=this._ctx;r.fillStyle="string"==typeof e?e:"rgba("+Math.round(e[0])+","+Math.round(e[1])+","+Math.round(e[2])+","+(e[3]??255)/255+")",r.fill("evenodd")}drawSolidStroke(t,e,r,i,s,o){if(!t||!e||0===r)return;if(f(t))this._buildPath(t.rings,!0);else if(u(t))this._buildPath(t.paths,!1);else{if(!d(t))return void console.log("CanvasDrawHelper.drawSolidStroke isn't implemented!");this._buildPath(ot(t).rings,!0)}const n=this._ctx;n.strokeStyle="string"==typeof e?e:"rgba("+Math.round(e[0])+","+Math.round(e[1])+","+Math.round(e[2])+","+(e[3]??255)/255+")",n.lineWidth=Math.max(this.transformSize(r),Y),this._setCapStyle(i),this._setJoinStyle(s),n.miterLimit=o,n.stroke()}pushClipPath(t){if(this._ctx.save(),f(t))this._buildPath(t.rings,!0);else if(u(t))this._buildPath(t.paths,!0);else{if(!d(t))return;this._buildPath(ot(t).rings,!0)}this._ctx.clip("evenodd")}popClipPath(){this._ctx.restore()}drawImage(t,e){const{colorSubstitutions:r,url:i,tintColor:s}=t,o=I(t.scaleX,1),n=this._resourceManager.getResource(i);if(null==n)return;let a=e*(n.width/n.height),l=e;e||(a=n.width,l=n.height);const h=v(i)||"src"in n&&v(n.src);let c="getFrame"in n?b(n):n;r&&(c=this._colorSubstitutionHelper.applyColorSubstitution(c,r)),this._applyAdditionalRenderProps&&!h&&s&&(c=this._colorSubstitutionHelper.tintImageData(c,s));const m=this.transformPt([0,0]),[f,u]=this.getTransformAngle(),d=this.transformSize(1),p=this._ctx;p.save(),p.setTransform({m11:o*d*f,m12:o*d*u,m21:-d*u,m22:d*f,m41:m[0],m42:m[1]}),p.drawImage(c,-a/2,-l/2,a,l),p.restore()}drawText(t,e){if(!e||0===e.length)return;this._textRasterizer||(this._textRasterizer=new C);const r=at(t);r.size*=this.transformSize(s(1));const i=this._textRasterizer.rasterizeText(e,r);if(!i)return;const{size:o,anchorX:n,anchorY:a,canvas:l}=i,h=o[0]*(n+.5),c=o[1]*(a-.5),m=this._ctx,f=this.transformPt([0,0]),[u,d]=this.getTransformAngle(),p=1;m.save(),m.setTransform({m11:p*u,m12:p*d,m21:-p*d,m22:p*u,m41:f[0]-p*h,m42:f[1]+p*c}),m.drawImage(l,0,0),m.restore()}drawPictureFill(t,e){if(!t)return;let{colorSubstitutions:r,height:i,offsetX:s,offsetY:o,rotation:n,scaleX:a,tintColor:l,url:h}=e;const c=this._resourceManager.getResource(h);if(null==c)return;if(f(t))this._buildPath(t.rings,!0);else if(u(t))this._buildPath(t.paths,!0);else if(d(t))this._buildPath(ot(t).rings,!0);else{if(!p(t))return;console.log("CanvasDrawHelper.drawPictureFill - No implementation!")}const m=this._ctx,_=v(h)||"src"in c&&v(c.src);let g,y="getFrame"in c?b(c):c;if(r&&(y=this._colorSubstitutionHelper.applyColorSubstitution(y,r)),this._applyAdditionalRenderProps){_||l&&(y=this._colorSubstitutionHelper.tintImageData(y,l)),g=m.createPattern(y,"repeat");const t=this.transformSize(1);n||(n=0),s?s*=t:s=0,o?o*=t:o=0,i&&(i*=t);const e=i?i/c.height:1,r=a&&i?a*i/c.width:1;if(0!==n||1!==e||1!==r||0!==s||0!==o){const t=new DOMMatrix;t.rotateSelf(0,0,-n).translateSelf(s,o).scaleSelf(r,e,1),g.setTransform(t)}}else g=m.createPattern(y,"repeat");m.save(),m.fillStyle=g,m.fill("evenodd"),m.restore()}drawPictureStroke(t,r){if(!t)return;let{colorSubstitutions:i,capStyle:s,joinStyle:n,miterLimit:a,tintColor:l,url:h,width:c}=r;const m=this._resourceManager.getResource(h);if(null==m)return;let _;if(f(t))_=t.rings;else if(u(t))_=t.paths;else{if(!d(t))return p(t)?void console.log("CanvasDrawHelper.drawPictureStroke - No implementation!"):void 0;_=ot(t).rings}c||(c=m.width);const g=v(h)||"src"in m&&v(m.src);let y="getFrame"in m?b(m):m;i&&(y=this._colorSubstitutionHelper.applyColorSubstitution(y,i)),this._applyAdditionalRenderProps&&(g||l&&(y=this._colorSubstitutionHelper.tintImageData(y,l)));const P=Math.max(this.transformSize(o(c)),.5),w=P/y.width,x=this._ctx,S=x.createPattern(y,"repeat-y");let M,k;x.save(),this._setCapStyle(s),this._setJoinStyle(n),void 0!==a&&(x.miterLimit=a),x.lineWidth=P;for(let o of _)if(o=e(o),ht(o),o&&!(o.length<=1)){M=this.transformPt(o[0]);for(let t=1;t<o.length;t++){k=this.transformPt(o[t]);const e=st(M,k),r=new DOMMatrix;r.translateSelf(0,M[1]-P/2).scaleSelf(w,w,1).rotateSelf(0,0,90-e),S.setTransform(r),x.strokeStyle=S,x.beginPath(),x.moveTo(M[0],M[1]),x.lineTo(k[0],k[1]),x.stroke(),M=k}}x.restore()}_buildPath(t,e){const r=this._ctx;if(r.beginPath(),t)for(const i of t){const t=i?i.length:0;if(t>1){let s=this.transformPt(i[0]);r.moveTo(s[0],s[1]);for(let e=1;e<t;e++)s=this.transformPt(i[e]),r.lineTo(s[0],s[1]);e&&r.closePath()}}}_setCapStyle(t){switch(t){case S.Butt:this._ctx.lineCap="butt";break;case S.Round:this._ctx.lineCap="round";break;case S.Square:this._ctx.lineCap="square"}}_setJoinStyle(t){switch(t){case M.Bevel:this._ctx.lineJoin="bevel";break;case M.Round:this._ctx.lineJoin="round";break;case M.Miter:this._ctx.lineJoin="miter"}}}function et(t,e,r){let i=I(t.separation,x.CIMHatchFill.separation)*r,s=I(t.rotation);if(0===i)return null;i<0&&(i=-i);let o=0;const n=.5*i;for(;o>n;)o-=i;for(;o<-n;)o+=i;const a=l();h(a,e),a[0]-=n,a[1]-=n,a[2]+=n,a[3]+=n;const c=[[a[0],a[1]],[a[0],a[3]],[a[2],a[3]],[a[2],a[1]]];for(;s>180;)s-=180;for(;s<0;)s+=180;const m=Math.cos(s*q),f=Math.sin(s*q),u=-i*f,d=i*m;let p,_,g,y;o=I(t.offsetX)*r*f-I(t.offsetY)*r*m,p=g=Number.MAX_VALUE,_=y=-Number.MAX_VALUE;for(const l of c){const t=l[0],e=l[1],r=m*t+f*e,i=-f*t+m*e;p=Math.min(p,r),g=Math.min(g,i),_=Math.max(_,r),y=Math.max(y,i)}g=Math.floor(g/i)*i;let P=m*p-f*g-u*o/i,w=f*p+m*g-d*o/i,S=m*_-f*g-u*o/i,M=f*_+m*g-d*o/i;const b=1+Math.round((y-g)/i),k=[];for(let l=0;l<b;l++)P+=u,w+=d,S+=u,M+=d,k.push([[P,w],[S,M]]);return{paths:k}}function rt(t,e){let r=0;for(const i of e){const e=i.length;for(let s=1;s<e;s++){const e=i[s-1],o=i[s];if(e[1]>t[1]==o[1]>t[1])continue;(o[0]-e[0])*(t[1]-e[1])-(o[1]-e[1])*(t[0]-e[0])>0?r++:r--}}return 0!==r}function it(t,e,r){for(const i of e){const e=i.length;for(let s=1;s<e;s++){const e=i[s-1],o=i[s];let n=(o[0]-e[0])*(o[0]-e[0])+(o[1]-e[1])*(o[1]-e[1]);if(0===n)continue;n=Math.sqrt(n);const a=((o[0]-e[0])*(t[1]-e[1])-(o[1]-e[1])*(t[0]-e[0]))/n;if(Math.abs(a)<r){const i=((o[0]-e[0])*(t[0]-e[0])+(o[1]-e[1])*(t[1]-e[1]))/n;if(i>-r&&i<n+r)return!0}}}return!1}function st(t,e){const r=e[0]-t[0],i=e[1]-t[1];return 180/Math.PI*Math.atan2(i,r)}const ot=t=>t?{spatialReference:t.spatialReference,rings:[[[t.xmin,t.ymin],[t.xmin,t.ymax],[t.xmax,t.ymax],[t.xmax,t.ymin],[t.xmin,t.ymin]]]}:null,nt=(t,e,r)=>{switch(t){case"ExtraLeading":return 1+e/r;case"Multiple":return e;case"Exact":return e/r}};function at(e,r=1){const i=z(e),s=F(e.fontStyleName),o=e.fontFamilyName??t,{weight:n,style:a}=s,l=r*(e.height||5),h=L(e.horizontalAlignment),c=A(e.verticalAlignment),m=U(e),f=U(e.haloSymbol),u=null!=f?r*(e.haloSize??0):0,d="CIMBackgroundCallout"===e.callout?.type?e.callout.backgroundSymbol:null,p=U(d),_=j(d),g=H(d);return{color:m,size:l,horizontalAlignment:h,verticalAlignment:c,font:{family:o,style:G(a),weight:D(n),decoration:i},halo:{size:u||0,color:f,style:a},backgroundColor:p,borderLine:null!=_&&null!=g?{size:_,color:g}:null,pixelRatio:1,premultiplyColors:!0}}const lt=1e-4;function ht(t){let e,r,i,s,o,n=t[0],a=1;for(;a<t.length;)e=t[a][0]-n[0],r=t[a][1]-n[1],s=0!==e?r/e:Math.PI/2,void 0!==i&&s-i<=lt?(t.splice(a-1,1),n=o):(o=n,n=t[a],a++),i=s}export{Q as CIMSymbolDrawHelper,tt as CanvasDrawHelper,Z as EnvDrawHelper,$ as HittestDrawHelper,K as Transformation,q as cDegToRad,nt as lineGapType2LineHeight};
5
+ import{defaultFontFamily as t}from"../../core/fontUtils.js";import has from"../../core/has.js";import{clone as e}from"../../core/lang.js";import r from"../../core/Logger.js";import s from"../../core/ObjectPool.js";import{px2pt as i,pt2px as o}from"../../core/screenUtils.js";import{GeometryCursor as n}from"../../geometry/GeometryCursor.js";import{fromValues as a,create as l}from"../../geometry/support/aaBoundingRect.js";import{getBoundsXY as h}from"../../geometry/support/boundsUtils.js";import{polygonCentroid as c}from"../../geometry/support/centroid.js";import{isPoint as m,isPolygon as f,isPolyline as u,isExtent as p,isMultipoint as d}from"../../geometry/support/jsonUtils.js";import{SimpleEffectCursor as _}from"./CIMEffects.js";import g from"./CIMImageColorSubstitutionHelper.js";import{getEffectOperator as y,getPlacementOperator as P}from"./CIMOperators.js";import{Placement as x}from"./CIMPlacements.js";import{defaultCIMValues as w}from"./defaultCIMValues.js";import{LineCapStyle as M,LineJoinStyle as S}from"./enums.js";import{getFirstFrame as b}from"./imageUtils.js";import k from"./Rect.js";import C from"./TextRasterizer.js";import{getNumericValue as I,isCIMFill as T,getSize as R,isSVGImage as v,fromCIMFontDecoration as z,fromCIMFontStyle as F,fromCIMHorizontalAlignment as L,fromCIMVerticalAlignment as A,getFillColor as U,getStrokeWidth as j,getStrokeColor as G,getFontStyle as H,getFontWeight as D}from"./utils.js";import{glyphSize as E,magicLabelLineHeight as B,hittestToleranceSmallSymbol as X,hittestSmallSymbolThreshold as N}from"../../views/2d/engine/webgl/definitions.js";import{shapeGlyphs as J}from"../../views/2d/engine/webgl/mesh/templates/shapingUtils.js";import{roundPtToWholePixel as O,getLineWidth as V}from"../../views/2d/layers/graphics/graphicsUtils.js";const q=Math.PI/180,Y=.5,W=()=>r.getLogger("esri.symbols.cim.CIMSymbolDrawHelper");class K{constructor(t){this._t=t}static createIdentity(){return new K([1,0,0,0,1,0])}clone(){const t=this._t;return new K(t.slice())}transform(t){const e=this._t;return[e[0]*t[0]+e[1]*t[1]+e[2],e[3]*t[0]+e[4]*t[1]+e[5]]}static createScale(t,e){return new K([t,0,0,0,e,0])}scale(t,e){const r=this._t;return r[0]*=t,r[1]*=t,r[2]*=t,r[3]*=e,r[4]*=e,r[5]*=e,this}scaleRatio(){return Math.sqrt(this._t[0]*this._t[0]+this._t[1]*this._t[1])}static createTranslate(t,e){return new K([0,0,t,0,0,e])}translate(t,e){const r=this._t;return r[2]+=t,r[5]+=e,this}static createRotate(t){const e=Math.cos(t),r=Math.sin(t);return new K([e,-r,0,r,e,0])}rotate(t){return K.multiply(this,K.createRotate(t),this)}angle(){const t=this._t[0],e=this._t[3],r=Math.sqrt(t*t+e*e);return[t/r,e/r]}static multiply(t,e,r){const s=t._t,i=e._t,o=s[0]*i[0]+s[3]*i[1],n=s[1]*i[0]+s[4]*i[1],a=s[2]*i[0]+s[5]*i[1]+i[2],l=s[0]*i[3]+s[3]*i[4],h=s[1]*i[3]+s[4]*i[4],c=s[2]*i[3]+s[5]*i[4]+i[5],m=r._t;return m[0]=o,m[1]=n,m[2]=a,m[3]=l,m[4]=h,m[5]=c,r}invert(){const t=this._t;let e=t[0]*t[4]-t[1]*t[3];if(0===e)return new K([0,0,0,0,0,0]);e=1/e;const r=(t[1]*t[5]-t[2]*t[4])*e,s=(t[2]*t[3]-t[0]*t[5])*e,i=t[4]*e,o=-t[1]*e,n=-t[3]*e,a=t[0]*e;return new K([i,o,r,n,a,s])}}class Q{constructor(t,e){this._resourceManager=t,this._transfos=[],this._sizeTransfos=[],this._geomUnitsPerPoint=1,this._placementPool=new s(x,void 0,void 0,100),this._earlyReturn=!1,this._mapRotation=0,this._transfos.push(e||K.createIdentity()),this._sizeTransfos.push(e?e.scaleRatio():1)}setTransform(t,e){this._transfos=[t||K.createIdentity()],this._sizeTransfos=[e||(t?t.scaleRatio():1)]}setGeomUnitsPerPoint(t){this._geomUnitsPerPoint=t}transformPt(t){return this._transfos[this._transfos.length-1].transform(t)}transformSize(t){return t*this._sizeTransfos[this._sizeTransfos.length-1]}reverseTransformPt(t){return this._transfos[this._transfos.length-1].invert().transform(t)}reverseTransformSize(t){return t/this._sizeTransfos[this._sizeTransfos.length-1]}reverseTransformScalar(t){return t/this._transfos[this._transfos.length-1].scaleRatio()}getTransformAngle(){return this._transfos[this._transfos.length-1].angle()}geomUnitsPerPoint(){return this.isEmbedded()?1:this._geomUnitsPerPoint}prevGeomUnitsPerPoint(){return this._transfos.length>2?1:this._geomUnitsPerPoint}isEmbedded(){return this._transfos.length>1}back(){return this._transfos[this._transfos.length-1]}push(t,e){const r=e?t.scaleRatio():1;K.multiply(t,this.back(),t),this._transfos.push(t),this._sizeTransfos.push(this._sizeTransfos[this._sizeTransfos.length-1]*r)}pop(){this._transfos.splice(-1,1),this._sizeTransfos.splice(-1,1)}drawSymbol(t,e,r){if(t)switch(t.type){case"CIMPointSymbol":case"CIMLineSymbol":case"CIMPolygonSymbol":this.drawMultiLayerSymbol(t,e);break;case"CIMTextSymbol":this.drawTextSymbol(t,e,r)}}drawMultiLayerSymbol(t,e){if(!t||!e)return;const r=t.symbolLayers;if(!r)return;const s=t.effects;if(s&&s.length>0){const t=this.executeEffects(s,e);if(t){let e=t.next();for(;e;)this.drawSymbolLayers(r,e.asJSON()),e=t.next()}}else this.drawSymbolLayers(r,e)}executeEffects(t,e){const r=this._resourceManager.geometryEngine;let s=new _(n.fromJSONCIM(e));for(const i of t){const t=y(i);t&&(s=t.execute(s,i,this.geomUnitsPerPoint(),null,r))}return s}drawSymbolLayers(t,e){let r=t.length;for(;r--;){const s=t[r];if(!s||!1===s.enable)continue;const i=s.effects;if(i&&i.length>0){const t=this.executeEffects(i,e);if(t){let e=null;for(;(e=t.next())&&(this.drawSymbolLayer(s,e.asJSON()),!this._earlyReturn););}}else this.drawSymbolLayer(s,e);if(this._earlyReturn)return}}drawSymbolLayer(t,e){switch(t.type){case"CIMSolidFill":this.drawSolidFill(e,t.color);break;case"CIMHatchFill":this.drawHatchFill(e,t);break;case"CIMPictureFill":this.drawPictureFill(e,t);break;case"CIMGradientFill":this.drawGradientFill(e,t);break;case"CIMSolidStroke":this.drawSolidStroke(e,t.color,t.width,t.capStyle,t.joinStyle,t.miterLimit);break;case"CIMPictureStroke":this.drawPictureStroke(e,t);break;case"CIMGradientStroke":this.drawGradientStroke(e,t);break;case"CIMCharacterMarker":case"CIMPictureMarker":case"CIMVectorMarker":this.drawMarkerLayer(t,e)}}drawHatchFill(t,e){const r=et(e,t,this.geomUnitsPerPoint());r&&(this.pushClipPath(t),this.drawMultiLayerSymbol(e.lineSymbol,r),this.popClipPath())}drawPictureFill(t,e){}drawGradientFill(t,e){}drawPictureStroke(t,e){}drawGradientStroke(t,e){}drawMarkerLayer(t,e){const r=t.markerPlacement;if(r){const s=P(r);if(s){const i="CIMMarkerPlacementInsidePolygon"===r.type||"CIMMarkerPlacementPolygonCenter"===r.type&&r.clipAtBoundary;i&&this.pushClipPath(e);const o=s.execute(n.fromJSONCIM(e),r,this.geomUnitsPerPoint(),null,this._resourceManager.geometryEngine);if(o){let e=null;for(;(e=o.next())&&(this.drawMarker(t,e),!this._earlyReturn););}i&&this.popClipPath()}}else{const r=this._placementPool.acquire();if(m(e))r.tx=e.x,r.ty=e.y,this.drawMarker(t,r);else if(f(e)){const s=c(e);s&&([r.tx,r.ty]=s,this.drawMarker(t,r))}else for(const s of e.points)if(r.tx=s[0],r.ty=s[1],this.drawMarker(t,r),this._earlyReturn)break;this._placementPool.release(r)}}drawMarker(t,e){switch(t.type){case"CIMCharacterMarker":case"CIMPictureMarker":this.drawPictureMarker(t,e);break;case"CIMVectorMarker":this.drawVectorMarker(t,e)}}drawPictureMarker(t,e){if(!t)return;const r=this._resourceManager.getResource(t.url),s=I(t.size,w.CIMPictureMarker.size);if(null==r||s<=0)return;const i=r.width,o=r.height;if(!i||!o)return;const n=i/o,a=I(t.scaleX,1),l=K.createIdentity(),h=t.anchorPoint;if(h){let e=h.x,r=h.y;"Absolute"!==t.anchorPointUnits&&(e*=s*n*a,r*=s),l.translate(-e,-r)}let c=I(t.rotation);t.rotateClockwise&&(c=-c),this._mapRotation&&(c+=this._mapRotation),c&&l.rotate(c*q);let m=I(t.offsetX),f=I(t.offsetY);if(m||f){if(this._mapRotation){const t=q*this._mapRotation,e=Math.cos(t),r=Math.sin(t),s=m*r+f*e;m=m*e-f*r,f=s}l.translate(m,f)}const u=this.geomUnitsPerPoint();1!==u&&l.scale(u,u);const p=e.getAngle();p&&l.rotate(p),l.translate(e.tx,e.ty),this.push(l,!1),this.drawImage(t,s),this.pop()}drawVectorMarker(t,e){if(!t)return;const r=t.markerGraphics;if(!r)return;const s=I(t.size,w.CIMVectorMarker.size),i=t.frame,o=i?i.ymax-i.ymin:0,n=s&&o?s/o:1,a=K.createIdentity();i&&a.translate(.5*-(i.xmax+i.xmin),.5*-(i.ymax+i.ymin));const l=t.anchorPoint;if(l){let e=l.x,r=l.y;"Absolute"!==t.anchorPointUnits?i&&(e*=i.xmax-i.xmin,r*=i.ymax-i.ymin):(e/=n,r/=n),a.translate(-e,-r)}1!==n&&a.scale(n,n);let h=I(t.rotation);t.rotateClockwise&&(h=-h),this._mapRotation&&(h+=this._mapRotation),h&&a.rotate(h*q);let c=I(t.offsetX),m=I(t.offsetY);if(c||m){if(this._mapRotation){const t=q*this._mapRotation,e=Math.cos(t),r=Math.sin(t),s=c*r+m*e;c=c*e-m*r,m=s}a.translate(c,m)}const f=this.geomUnitsPerPoint();1!==f&&a.scale(f,f);const u=e.getAngle();u&&a.rotate(u),a.translate(e.tx,e.ty),this.push(a,t.scaleSymbolsProportionally);for(const p of r){p?.symbol&&p.geometry||W().error("Invalid marker graphic",p);let t=p.textString;if("number"==typeof t&&(t=t.toString()),this.drawSymbol(p.symbol,p.geometry,t),this._earlyReturn)break}this.pop()}drawTextSymbol(t,e,r){if(!t)return;if(!m(e))return;if(I(t.height,w.CIMTextSymbol.height)<=0)return;const s=K.createIdentity();let i=I(t.angle);i=-i,i&&s.rotate(i*q);const o=I(t.offsetX),n=I(t.offsetY);(o||n)&&s.translate(o,n);const a=this.geomUnitsPerPoint();1!==a&&s.scale(a,a),s.translate(e.x,e.y),this.push(s,!1),this.drawText(t,r),this.pop()}}class Z extends Q{constructor(t,e){super(t,e),this.reset()}reset(){this._xmin=this._ymin=1/0,this._xmax=this._ymax=-1/0,this._clipCount=0}envelope(){return new k(this._xmin,this._ymin,this._xmax-this._xmin,this._ymax-this._ymin)}bounds(){return a(this._xmin,this._ymin,this._xmax,this._ymax)}drawSolidFill(t){if(t&&!(this._clipCount>0))if(f(t))this._processPath(t.rings,0);else if(u(t))this._processPath(t.paths,0);else if(p(t)){const e=ot(t);e&&this._processPath(e.rings,0)}else console.error("drawSolidFill Unexpected geometry type!")}drawSolidStroke(t,e,r){if(!t||this._clipCount>0||null==r||r<=0)return;const s=Math.max(.5*this.transformSize(I(r,w.CIMSolidStroke.width)),.5*Y);if(f(t))this._processPath(t.rings,s);else if(u(t))this._processPath(t.paths,s);else if(p(t)){const e=ot(t);e&&this._processPath(e.rings,s)}else console.error("drawSolidStroke unexpected geometry type!")}drawMarkerLayer(t,e){f(e)&&t.markerPlacement&&("CIMMarkerPlacementInsidePolygon"===t.markerPlacement.type||"CIMMarkerPlacementPolygonCenter"===t.markerPlacement.type&&t.markerPlacement.clipAtBoundary)?this._processPath(e.rings,0):super.drawMarkerLayer(t,e)}drawHatchFill(t,e){this.drawSolidFill(t)}drawPictureFill(t,e){this.drawSolidFill(t)}drawGradientFill(t,e){this.drawSolidFill(t)}drawPictureStroke(t,e){this.drawSolidStroke(t,null,e.width)}drawGradientStroke(t,e){this.drawSolidStroke(t,null,e.width)}pushClipPath(t){this.drawSolidFill(t),this._clipCount++}popClipPath(){this._clipCount--}drawImage(t,e){const{url:r}=t,s=I(t.scaleX,1);let i=s*e,o=e;const n=this._resourceManager.getResource(r);if(null!=n){const t=n.height/n.width;i=s*(e?t>1?e:e/t:n.width),o=e?t>1?e*t:e:n.height}this._merge(this.transformPt([-i/2,-o/2]),0),this._merge(this.transformPt([-i/2,o/2]),0),this._merge(this.transformPt([i/2,-o/2]),0),this._merge(this.transformPt([i/2,o/2]),0)}drawText(t,e){if(!e||0===e.length)return;this._textRasterizer||(this._textRasterizer=new C);const r=at(t);let[s,o]=this._textRasterizer.computeTextSize(e,r);s=i(s),o=i(o);let n=0;switch(t.horizontalAlignment){case"Left":n=s/2;break;case"Right":n=-s/2}let a=0;switch(t.verticalAlignment){case"Bottom":a=o/2;break;case"Top":a=-o/2;break;case"Baseline":a=o/6}this._merge(this.transformPt([-s/2+n,-o/2+a]),0),this._merge(this.transformPt([-s/2+n,o/2+a]),0),this._merge(this.transformPt([s/2+n,-o/2+a]),0),this._merge(this.transformPt([s/2+n,o/2+a]),0)}_processPath(t,e){if(t)for(const r of t){const t=r?r.length:0;if(t>1){this._merge(this.transformPt(r[0]),e);for(let s=1;s<t;s++)this._merge(this.transformPt(r[s]),e)}}}_merge(t,e){t[0]-e<this._xmin&&(this._xmin=t[0]-e),t[0]+e>this._xmax&&(this._xmax=t[0]+e),t[1]-e<this._ymin&&(this._ymin=t[1]-e),t[1]+e>this._ymax&&(this._ymax=t[1]+e)}}class $ extends Q{constructor(){super(...arguments),this._searchPoint=[0,0],this._searchDistPoint=0,this._textInfo=null}hitTest(t,e,r,s,n,a){const l=a*o(1);this.setTransform(),this.setGeomUnitsPerPoint(l),this._searchPoint=[(t[0]+t[2])/2,(t[1]+t[3])/2],this._searchDistPoint=(t[2]-t[0])/2/l,this._textInfo=s;const h=e&&("CIMPointSymbol"===e.type&&"Map"!==e.angleAlignment||"CIMTextSymbol"===e.type);if(this._mapRotation=h?n:0,!has("esri-mobile")){const t=i(X*window.devicePixelRatio),r=i(N);!(("CIMLineSymbol"===e?.type||"CIMPolygonSymbol"===e?.type)&&e.symbolLayers?.some(T))&&"CIMMeshSymbol"!==e?.type&&(R(e)??0)<r&&(this._searchDistPoint=t)}return this._earlyReturn=!1,this.drawSymbol(e,r),this._earlyReturn}executeEffects(t,e){return"CIMGeometricEffectDashes"===t.at(-1)?.type&&(t=t.slice(0,-1)),super.executeEffects(t,e)}drawSolidFill(t,e){this._hitTestFill(t)}drawHatchFill(t,e){this._hitTestFill(t)}drawPictureFill(t,e){this._hitTestFill(t)}drawGradientFill(t,e){this._hitTestFill(t)}drawSolidStroke(t,e,r,s,i,o){this._hitTestStroke(t,r)}drawPictureStroke(t,e){this._hitTestStroke(t,e.width)}drawGradientStroke(t,e){this._hitTestStroke(t,e.width)}drawMarkerLayer(t,e){t.markerPlacement&&("CIMMarkerPlacementInsidePolygon"===t.markerPlacement.type||"CIMMarkerPlacementPolygonCenter"===t.markerPlacement.type&&t.markerPlacement.clipAtBoundary)?this._hitTestFill(e):super.drawMarkerLayer(t,e)}pushClipPath(t){}popClipPath(){}drawImage(t,e){const{url:r}=t,s=I(t.scaleX,1),i=this._resourceManager.getResource(r);if(null==i||0===i.height||0===e)return;const o=e*this.geomUnitsPerPoint(),n=o*s*(i.width/i.height),a=this.reverseTransformPt(this._searchPoint),l=this._searchDistPoint;Math.abs(a[0])<n/2+l&&Math.abs(a[1])<o/2+l&&(this._earlyReturn=!0)}drawText(t,e){const r=this._textInfo;if(!r)return;const s=r.get(t);if(!s)return;if(!s.glyphMosaicItems.glyphs.length)return;const i=O(I(t.height,w.CIMTextSymbol.height)),{lineGapType:o,lineGap:n}=t,a=o?nt(o,I(n),i):0,l="CIMBackgroundCallout"===t.callout?.type,h=J(s.glyphMosaicItems,{scale:i/E,angle:0,xOffset:0,yOffset:0,horizontalAlignment:t.horizontalAlignment,verticalAlignment:t.verticalAlignment,maxLineWidth:V(t.lineWidth),lineHeight:B*Math.max(.25,Math.min(a||1,4)),decoration:t.font.decoration||"none",useCIMAngleBehavior:!0,hasBackground:l}),c=this.reverseTransformPt(this._searchPoint),m=c[0],f=c[1];for(const u of h.glyphs)if(m>u.xTopLeft&&m<u.xBottomRight&&f>-u.yBottomRight&&f<-u.yTopLeft){this._earlyReturn=!0;break}}_hitTestFill(t){let e=null;if(p(t)){const r=t;e=[[[r.xmin,r.ymin],[r.xmin,r.ymax],[r.xmax,r.ymax],[r.xmax,r.ymin],[r.xmin,r.ymin]]]}else if(f(t))e=t.rings;else{if(!u(t))return;e=t.paths}const r=this.reverseTransformPt(this._searchPoint);if(rt(r,e)&&(this._earlyReturn=!0),!this._earlyReturn){st(r,e,this.reverseTransformScalar(this._searchDistPoint)*this.prevGeomUnitsPerPoint())&&(this._earlyReturn=!0)}}_hitTestStroke(t,e){let r=null;if(p(t)){const e=t;r=[[[e.xmin,e.ymin],[e.xmin,e.ymax],[e.xmax,e.ymax],[e.xmax,e.ymin],[e.xmin,e.ymin]]]}else if(f(t))r=t.rings;else{if(!u(t))return;r=t.paths}st(this.reverseTransformPt(this._searchPoint),r,I(e,w.CIMSolidStroke.width)*this.geomUnitsPerPoint()/2+this.reverseTransformScalar(this._searchDistPoint)*this.prevGeomUnitsPerPoint())&&(this._earlyReturn=!0)}}class tt extends Q{constructor(t,e,r,s){super(e,r),this._applyAdditionalRenderProps=s,this._colorSubstitutionHelper=new g,this._ctx=t}drawSolidFill(t,e){if(!t)return;if(f(t))this._buildPath(t.rings,!0);else if(u(t))this._buildPath(t.paths,!0);else if(p(t))this._buildPath(ot(t).rings,!0);else{if(!d(t))return;console.log("CanvasDrawHelper.drawSolidFill - No implementation!")}const r=this._ctx;r.fillStyle="string"==typeof e?e:"rgba("+Math.round(e[0])+","+Math.round(e[1])+","+Math.round(e[2])+","+(e[3]??255)/255+")",r.fill("evenodd")}drawSolidStroke(t,e,r,s,i,o){if(!t||!e||0===r)return;if(f(t))this._buildPath(t.rings,!0);else if(u(t))this._buildPath(t.paths,!1);else{if(!p(t))return void console.log("CanvasDrawHelper.drawSolidStroke isn't implemented!");this._buildPath(ot(t).rings,!0)}const n=this._ctx;n.strokeStyle="string"==typeof e?e:"rgba("+Math.round(e[0])+","+Math.round(e[1])+","+Math.round(e[2])+","+(e[3]??255)/255+")",n.lineWidth=Math.max(this.transformSize(r),Y),this._setCapStyle(s),this._setJoinStyle(i),n.miterLimit=o,n.stroke()}pushClipPath(t){if(this._ctx.save(),f(t))this._buildPath(t.rings,!0);else if(u(t))this._buildPath(t.paths,!0);else{if(!p(t))return;this._buildPath(ot(t).rings,!0)}this._ctx.clip("evenodd")}popClipPath(){this._ctx.restore()}drawImage(t,e){const{colorSubstitutions:r,url:s,tintColor:i}=t,o=I(t.scaleX,1),n=this._resourceManager.getResource(s);if(null==n)return;let a=e*(n.width/n.height),l=e;e||(a=n.width,l=n.height);const h=v(s)||"src"in n&&v(n.src);let c="getFrame"in n?b(n):n;r&&(c=this._colorSubstitutionHelper.applyColorSubstitution(c,r)),this._applyAdditionalRenderProps&&!h&&i&&(c=this._colorSubstitutionHelper.tintImageData(c,i));const m=this.transformPt([0,0]),[f,u]=this.getTransformAngle(),p=this.transformSize(1),d=this._ctx;d.save(),d.setTransform({m11:o*p*f,m12:o*p*u,m21:-p*u,m22:p*f,m41:m[0],m42:m[1]}),d.drawImage(c,-a/2,-l/2,a,l),d.restore()}drawText(t,e){if(!e||0===e.length)return;this._textRasterizer||(this._textRasterizer=new C);const r=at(t);r.size*=this.transformSize(i(1));const s=this._textRasterizer.rasterizeText(e,r);if(!s)return;const{size:o,anchorX:n,anchorY:a,canvas:l}=s,h=o[0]*(n+.5),c=o[1]*(a-.5),m=this._ctx,f=this.transformPt([0,0]),[u,p]=this.getTransformAngle(),d=1;m.save(),m.setTransform({m11:d*u,m12:d*p,m21:-d*p,m22:d*u,m41:f[0]-d*h,m42:f[1]+d*c}),m.drawImage(l,0,0),m.restore()}drawPictureFill(t,e){if(!t)return;let{colorSubstitutions:r,height:s,offsetX:i,offsetY:o,rotation:n,scaleX:a,tintColor:l,url:h}=e;const c=this._resourceManager.getResource(h);if(null==c)return;if(f(t))this._buildPath(t.rings,!0);else if(u(t))this._buildPath(t.paths,!0);else if(p(t))this._buildPath(ot(t).rings,!0);else{if(!d(t))return;console.log("CanvasDrawHelper.drawPictureFill - No implementation!")}const m=this._ctx,_=v(h)||"src"in c&&v(c.src);let g,y="getFrame"in c?b(c):c;if(r&&(y=this._colorSubstitutionHelper.applyColorSubstitution(y,r)),this._applyAdditionalRenderProps){_||l&&(y=this._colorSubstitutionHelper.tintImageData(y,l)),g=m.createPattern(y,"repeat");const t=this.transformSize(1);n||(n=0),i?i*=t:i=0,o?o*=t:o=0,s&&(s*=t);const e=s?s/c.height:1,r=a&&s?a*s/c.width:1;if(0!==n||1!==e||1!==r||0!==i||0!==o){const t=new DOMMatrix;t.rotateSelf(0,0,-n).translateSelf(i,o).scaleSelf(r,e,1),g.setTransform(t)}}else g=m.createPattern(y,"repeat");m.save(),m.fillStyle=g,m.fill("evenodd"),m.restore()}drawPictureStroke(t,r){if(!t)return;let{colorSubstitutions:s,capStyle:i,joinStyle:n,miterLimit:a,tintColor:l,url:h,width:c}=r;const m=this._resourceManager.getResource(h);if(null==m)return;let _;if(f(t))_=t.rings;else if(u(t))_=t.paths;else{if(!p(t))return d(t)?void console.log("CanvasDrawHelper.drawPictureStroke - No implementation!"):void 0;_=ot(t).rings}c||(c=m.width);const g=v(h)||"src"in m&&v(m.src);let y="getFrame"in m?b(m):m;s&&(y=this._colorSubstitutionHelper.applyColorSubstitution(y,s)),this._applyAdditionalRenderProps&&(g||l&&(y=this._colorSubstitutionHelper.tintImageData(y,l)));const P=Math.max(this.transformSize(o(c)),.5),x=P/y.width,w=this._ctx,M=w.createPattern(y,"repeat-y");let S,k;w.save(),this._setCapStyle(i),this._setJoinStyle(n),void 0!==a&&(w.miterLimit=a),w.lineWidth=P;for(let o of _)if(o=e(o),ht(o),o&&!(o.length<=1)){S=this.transformPt(o[0]);for(let t=1;t<o.length;t++){k=this.transformPt(o[t]);const e=it(S,k),r=new DOMMatrix;r.translateSelf(0,S[1]-P/2).scaleSelf(x,x,1).rotateSelf(0,0,90-e),M.setTransform(r),w.strokeStyle=M,w.beginPath(),w.moveTo(S[0],S[1]),w.lineTo(k[0],k[1]),w.stroke(),S=k}}w.restore()}_buildPath(t,e){const r=this._ctx;if(r.beginPath(),t)for(const s of t){const t=s?s.length:0;if(t>1){let i=this.transformPt(s[0]);r.moveTo(i[0],i[1]);for(let e=1;e<t;e++)i=this.transformPt(s[e]),r.lineTo(i[0],i[1]);e&&r.closePath()}}}_setCapStyle(t){switch(t){case M.Butt:this._ctx.lineCap="butt";break;case M.Round:this._ctx.lineCap="round";break;case M.Square:this._ctx.lineCap="square"}}_setJoinStyle(t){switch(t){case S.Bevel:this._ctx.lineJoin="bevel";break;case S.Round:this._ctx.lineJoin="round";break;case S.Miter:this._ctx.lineJoin="miter"}}}function et(t,e,r){let s=I(t.separation,w.CIMHatchFill.separation)*r,i=I(t.rotation);if(0===s)return null;s<0&&(s=-s);let o=0;const n=.5*s;for(;o>n;)o-=s;for(;o<-n;)o+=s;const a=l();h(a,e),a[0]-=n,a[1]-=n,a[2]+=n,a[3]+=n;const c=[[a[0],a[1]],[a[0],a[3]],[a[2],a[3]],[a[2],a[1]]];for(;i>180;)i-=180;for(;i<0;)i+=180;const m=Math.cos(i*q),f=Math.sin(i*q),u=-s*f,p=s*m;let d,_,g,y;o=I(t.offsetX)*r*f-I(t.offsetY)*r*m,d=g=Number.MAX_VALUE,_=y=-Number.MAX_VALUE;for(const l of c){const t=l[0],e=l[1],r=m*t+f*e,s=-f*t+m*e;d=Math.min(d,r),g=Math.min(g,s),_=Math.max(_,r),y=Math.max(y,s)}g=Math.floor(g/s)*s;let P=m*d-f*g-u*o/s,x=f*d+m*g-p*o/s,M=m*_-f*g-u*o/s,S=f*_+m*g-p*o/s;const b=1+Math.round((y-g)/s),k=[];for(let l=0;l<b;l++)P+=u,x+=p,M+=u,S+=p,k.push([[P,x],[M,S]]);return{paths:k}}function rt(t,e){let r=0;for(const s of e){const e=s.length;for(let i=1;i<e;i++){const e=s[i-1],o=s[i];if(e[1]>t[1]==o[1]>t[1])continue;(o[0]-e[0])*(t[1]-e[1])-(o[1]-e[1])*(t[0]-e[0])>0?r++:r--}}return 0!==r}function st(t,e,r){for(const s of e){const e=s.length;for(let i=1;i<e;i++){const e=s[i-1],o=s[i];let n=(o[0]-e[0])*(o[0]-e[0])+(o[1]-e[1])*(o[1]-e[1]);if(0===n)continue;n=Math.sqrt(n);const a=((o[0]-e[0])*(t[1]-e[1])-(o[1]-e[1])*(t[0]-e[0]))/n;if(Math.abs(a)<r){const s=((o[0]-e[0])*(t[0]-e[0])+(o[1]-e[1])*(t[1]-e[1]))/n;if(s>-r&&s<n+r)return!0}}}return!1}function it(t,e){const r=e[0]-t[0],s=e[1]-t[1];return 180/Math.PI*Math.atan2(s,r)}const ot=t=>t?{spatialReference:t.spatialReference,rings:[[[t.xmin,t.ymin],[t.xmin,t.ymax],[t.xmax,t.ymax],[t.xmax,t.ymin],[t.xmin,t.ymin]]]}:null,nt=(t,e,r)=>{switch(t){case"ExtraLeading":return 1+e/r;case"Multiple":return e;case"Exact":return e/r}};function at(e,r=1){const s=z(e),i=F(e.fontStyleName),o=e.fontFamilyName??t,{weight:n,style:a}=i,l=r*(e.height||5),h=L(e.horizontalAlignment),c=A(e.verticalAlignment),m=U(e),f=U(e.haloSymbol),u=null!=f?r*(e.haloSize??0):0,p="CIMBackgroundCallout"===e.callout?.type?e.callout.backgroundSymbol:null,d=U(p),_=j(p),g=G(p);return{color:m,size:l,horizontalAlignment:h,verticalAlignment:c,font:{family:o,style:H(a),weight:D(n),decoration:s},halo:{size:u||0,color:f,style:a},backgroundColor:d,borderLine:null!=_&&null!=g?{size:_,color:g}:null,pixelRatio:1,premultiplyColors:!0}}const lt=1e-4;function ht(t){let e,r,s,i,o,n=t[0],a=1;for(;a<t.length;)e=t[a][0]-n[0],r=t[a][1]-n[1],i=0!==e?r/e:Math.PI/2,void 0!==s&&i-s<=lt?(t.splice(a-1,1),n=o):(o=n,n=t[a],a++),s=i}export{Q as CIMSymbolDrawHelper,tt as CanvasDrawHelper,Z as EnvDrawHelper,$ as HittestDrawHelper,K as Transformation,q as cDegToRad,nt as lineGapType2LineHeight};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.31/esri/copyright.txt for details.
4
4
  */
5
- import{_ as o}from"../../chunks/tslib.es6.js";import"../../core/Logger.js";import"../../core/has.js";import"../../core/RandomLCG.js";import"../../core/Error.js";import{enumeration as r}from"../../core/accessorSupport/decorators/enumeration.js";import{subclass as s}from"../../core/accessorSupport/decorators/subclass.js";import{Symbol3DMaterial as t}from"./Symbol3DMaterial.js";var e;let l=e=class extends t{constructor(o){super(o),this.colorMixMode=null}clone(){const o={color:null!=this.color?this.color.clone():null,colorMixMode:this.colorMixMode};return new e(o)}};o([r({multiply:"multiply",replace:"replace",tint:"tint"})],l.prototype,"colorMixMode",void 0),l=e=o([s("esri.symbols.support.Symbol3DFillMaterial")],l);export{l as Symbol3DFillMaterial};
5
+ import{_ as o}from"../../chunks/tslib.es6.js";import"../../core/Logger.js";import"../../core/has.js";import"../../core/RandomLCG.js";import"../../core/Error.js";import{enumeration as r}from"../../core/accessorSupport/decorators/enumeration.js";import{subclass as s}from"../../core/accessorSupport/decorators/subclass.js";import{clone as e}from"../../core/libs/gl-matrix-2/factories/vec3f64.js";import{Symbol3DMaterial as t}from"./Symbol3DMaterial.js";var i;let c=i=class extends t{constructor(o){super(o),this.colorMixMode=null}clone(){const o={color:this.color?.clone()??null,emissiveFactor:this.emissiveFactor?e(this.emissiveFactor):null,colorMixMode:this.colorMixMode};return new i(o)}};o([r({multiply:"multiply",replace:"replace",tint:"tint"})],c.prototype,"colorMixMode",void 0),c=i=o([s("esri.symbols.support.Symbol3DFillMaterial")],c);export{c as Symbol3DFillMaterial};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.31/esri/copyright.txt for details.
4
4
  */
5
- import{_ as o}from"../../chunks/tslib.es6.js";import{JSONSupport as r}from"../../core/JSONSupport.js";import{property as s}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{subclass as t}from"../../core/accessorSupport/decorators/subclass.js";import{colorAndTransparencyProperty as e}from"./materialUtils.js";var c;let l=c=class extends r{constructor(o){super(o),this.color=null}clone(){const o={color:null!=this.color?this.color.clone():null};return new c(o)}};o([s(e)],l.prototype,"color",void 0),l=c=o([t("esri.symbols.support.Symbol3DMaterial")],l);export{l as Symbol3DMaterial};
5
+ import{_ as o}from"../../chunks/tslib.es6.js";import{JSONSupport as r}from"../../core/JSONSupport.js";import{property as s}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{subclass as t}from"../../core/accessorSupport/decorators/subclass.js";import{clone as e}from"../../core/libs/gl-matrix-2/factories/vec3f64.js";import{colorAndTransparencyProperty as i}from"./materialUtils.js";var c;let m=c=class extends r{constructor(o){super(o),this.color=null,this.emissiveFactor=null}clone(){const o={color:this.color?.clone()??null,emissiveFactor:this.emissiveFactor?e(this.emissiveFactor):null};return new c(o)}};o([s(i)],m.prototype,"color",void 0),o([s({type:[Number],json:{write:!1}})],m.prototype,"emissiveFactor",void 0),m=c=o([t("esri.symbols.support.Symbol3DMaterial")],m);export{m as Symbol3DMaterial};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.31/esri/copyright.txt for details.
4
4
  */
5
- import{set as t,multiply as s}from"../../../../core/libs/gl-matrix-2/math/mat2d.js";import{create as r}from"../../../../core/libs/gl-matrix-2/factories/mat2df32.js";import{set as i,multiply as e,invert as o}from"../../../../core/libs/gl-matrix-2/math/mat3.js";import{create as a}from"../../../../core/libs/gl-matrix-2/factories/mat3f32.js";import{s as m,t as n}from"../../../../chunks/vec32.js";import{create as l}from"../../../../core/libs/gl-matrix-2/factories/vec3f32.js";import{tileSize as c}from"./definitions.js";import{TiledDisplayObject as h}from"./TiledDisplayObject.js";const f=a(),p=l();class d extends h{constructor(t,s,r,i){super(t,s,r,i,c,c)}destroy(){super.destroy()}setTransform(o){const a=this.resolution/o.resolution,m=this.transforms.tileMat3,[n,l]=o.toScreenNoRotation([0,0],[this.x,this.y]),c=this.width/this.rangeX*a,h=this.height/this.rangeY*a;i(m,c,0,0,0,h,0,n,l,1),e(this.transforms.displayViewScreenMat3,o.displayViewMat3,m);const f=t(r(),c,0,0,h,n,l);s(this.transforms.labelMat2d,o.viewMat2d,f)}_createTransforms(){return{labelMat2d:r(),tileMat3:a(),displayViewScreenMat3:a()}}containsScreenPoint(t,s,r){const i=e(f,t.viewMat3,this.transforms.tileMat3),a=o(f,i);if(null==a)return!0;m(p,...s,1);const l=n(p,p,a),c=r*(this.resolution/t.resolution);return l[0]>=-c&&l[0]<this.width+c&&l[1]>=-c&&l[1]<this.height+c}}export{d as AFeatureTile};
5
+ import{set as t,multiply as s}from"../../../../core/libs/gl-matrix-2/math/mat2d.js";import{create as r}from"../../../../core/libs/gl-matrix-2/factories/mat2df32.js";import{set as i,multiply as e,invert as o}from"../../../../core/libs/gl-matrix-2/math/mat3.js";import{create as a}from"../../../../core/libs/gl-matrix-2/factories/mat3f32.js";import{a as m,t as n}from"../../../../chunks/vec32.js";import{create as l}from"../../../../core/libs/gl-matrix-2/factories/vec3f32.js";import{tileSize as c}from"./definitions.js";import{TiledDisplayObject as h}from"./TiledDisplayObject.js";const f=a(),p=l();class d extends h{constructor(t,s,r,i){super(t,s,r,i,c,c)}destroy(){super.destroy()}setTransform(o){const a=this.resolution/o.resolution,m=this.transforms.tileMat3,[n,l]=o.toScreenNoRotation([0,0],[this.x,this.y]),c=this.width/this.rangeX*a,h=this.height/this.rangeY*a;i(m,c,0,0,0,h,0,n,l,1),e(this.transforms.displayViewScreenMat3,o.displayViewMat3,m);const f=t(r(),c,0,0,h,n,l);s(this.transforms.labelMat2d,o.viewMat2d,f)}_createTransforms(){return{labelMat2d:r(),tileMat3:a(),displayViewScreenMat3:a()}}containsScreenPoint(t,s,r){const i=e(f,t.viewMat3,this.transforms.tileMat3),a=o(f,i);if(null==a)return!0;m(p,...s,1);const l=n(p,p,a),c=r*(this.resolution/t.resolution);return l[0]>=-c&&l[0]<this.width+c&&l[1]>=-c&&l[1]<this.height+c}}export{d as AFeatureTile};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.31/esri/copyright.txt for details.
4
4
  */
5
- import{disposeMaybe as t}from"../../../../core/maybe.js";import{toRadian as i}from"../../../../core/libs/gl-matrix-2/math/common.js";import{fromTranslation as e,scale as r,rotate as s,translate as o}from"../../../../core/libs/gl-matrix-2/math/mat3.js";import{create as a}from"../../../../core/libs/gl-matrix-2/factories/mat3f32.js";import{fromValues as n}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{s as l}from"../../../../chunks/vec32.js";import{create as m}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import c from"./VertexStream.js";import{stencil as h}from"./shaders/StencilPrograms.js";import{CompareFunction as _,StencilOperation as d}from"../../../webgl/enums.js";import{createProgram as p}from"../../../webgl/ProgramTemplate.js";const f=n(-.5,-.5);class u{constructor(){this._centerNdc=m(),this._pxToNdc=m(),this._worldDimensionsPx=m(),this._mat3=a(),this._initialized=!1}dispose(){this._program=t(this._program),this._quad=t(this._quad)}render(t,i,e){const{context:r}=t,s=this._updateGeometry(t,e);if(null!=i){const{r:t,g:e,b:s,a:o}=i;r.setClearColor(o*t/255,o*e/255,o*s/255,o)}else r.setClearColor(0,0,0,0);if(r.setStencilFunction(_.ALWAYS,0,255),r.setStencilWriteMask(255),!s)return r.setClearStencil(1),void r.clear(r.gl.STENCIL_BUFFER_BIT|r.gl.COLOR_BUFFER_BIT);r.setClearStencil(0),r.clear(r.gl.STENCIL_BUFFER_BIT|r.gl.COLOR_BUFFER_BIT),this._initialized||this._initialize(r),r.setDepthWriteEnabled(!1),r.setDepthTestEnabled(!1),r.setColorMask(!1,!1,!1,!1),r.setBlendingEnabled(!1),r.setStencilOp(d.KEEP,d.KEEP,d.REPLACE),r.setStencilFunction(_.ALWAYS,1,255),r.setStencilTestEnabled(!0),r.useProgram(this._program),this._program.setUniformMatrix3fv("u_worldExtent",this._mat3),this._quad.draw(),this._quad.unbind()}_initialize(t){if(this._initialized)return;const i=p(t,h);i&&(this._program=i,this._quad=new c(t,[0,0,1,0,0,1,1,1]),this._initialized=!0)}_updateGeometry(t,a){const{state:n,pixelRatio:m}=t,{size:c,rotation:h}=n,_=Math.round(c[0]*m),d=Math.round(c[1]*m);if(!n.spatialReference.isWrappable)return!1;const p=i(h),u=Math.abs(Math.cos(p)),g=Math.abs(Math.sin(p)),b=Math.round(_*u+d*g),x=Math.round(m*n.worldScreenWidth);if(b<=x)return!1;const E=_*g+d*u,S=(a.left-a.right)*m/_,C=(a.bottom-a.top)*m/d;l(this._worldDimensionsPx,x,E,1),l(this._pxToNdc,2/_,-2/d,1),l(this._centerNdc,S,C,1);const T=this._mat3;return e(T,this._centerNdc),r(T,T,this._pxToNdc),0!==h&&s(T,T,p),r(T,T,this._worldDimensionsPx),o(T,T,f),!0}}export{u as WorldExtentRenderer};
5
+ import{disposeMaybe as t}from"../../../../core/maybe.js";import{toRadian as i}from"../../../../core/libs/gl-matrix-2/math/common.js";import{fromTranslation as e,scale as r,rotate as s,translate as o}from"../../../../core/libs/gl-matrix-2/math/mat3.js";import{create as a}from"../../../../core/libs/gl-matrix-2/factories/mat3f32.js";import{fromValues as n}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{a as l}from"../../../../chunks/vec32.js";import{create as m}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import c from"./VertexStream.js";import{stencil as h}from"./shaders/StencilPrograms.js";import{CompareFunction as _,StencilOperation as d}from"../../../webgl/enums.js";import{createProgram as p}from"../../../webgl/ProgramTemplate.js";const f=n(-.5,-.5);class u{constructor(){this._centerNdc=m(),this._pxToNdc=m(),this._worldDimensionsPx=m(),this._mat3=a(),this._initialized=!1}dispose(){this._program=t(this._program),this._quad=t(this._quad)}render(t,i,e){const{context:r}=t,s=this._updateGeometry(t,e);if(null!=i){const{r:t,g:e,b:s,a:o}=i;r.setClearColor(o*t/255,o*e/255,o*s/255,o)}else r.setClearColor(0,0,0,0);if(r.setStencilFunction(_.ALWAYS,0,255),r.setStencilWriteMask(255),!s)return r.setClearStencil(1),void r.clear(r.gl.STENCIL_BUFFER_BIT|r.gl.COLOR_BUFFER_BIT);r.setClearStencil(0),r.clear(r.gl.STENCIL_BUFFER_BIT|r.gl.COLOR_BUFFER_BIT),this._initialized||this._initialize(r),r.setDepthWriteEnabled(!1),r.setDepthTestEnabled(!1),r.setColorMask(!1,!1,!1,!1),r.setBlendingEnabled(!1),r.setStencilOp(d.KEEP,d.KEEP,d.REPLACE),r.setStencilFunction(_.ALWAYS,1,255),r.setStencilTestEnabled(!0),r.useProgram(this._program),this._program.setUniformMatrix3fv("u_worldExtent",this._mat3),this._quad.draw(),this._quad.unbind()}_initialize(t){if(this._initialized)return;const i=p(t,h);i&&(this._program=i,this._quad=new c(t,[0,0,1,0,0,1,1,1]),this._initialized=!0)}_updateGeometry(t,a){const{state:n,pixelRatio:m}=t,{size:c,rotation:h}=n,_=Math.round(c[0]*m),d=Math.round(c[1]*m);if(!n.spatialReference.isWrappable)return!1;const p=i(h),u=Math.abs(Math.cos(p)),g=Math.abs(Math.sin(p)),b=Math.round(_*u+d*g),x=Math.round(m*n.worldScreenWidth);if(b<=x)return!1;const E=_*g+d*u,S=(a.left-a.right)*m/_,C=(a.bottom-a.top)*m/d;l(this._worldDimensionsPx,x,E,1),l(this._pxToNdc,2/_,-2/d,1),l(this._centerNdc,S,C,1);const T=this._mat3;return e(T,this._centerNdc),r(T,T,this._pxToNdc),0!==h&&s(T,T,p),r(T,T,this._worldDimensionsPx),o(T,T,f),!0}}export{u as WorldExtentRenderer};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.31/esri/copyright.txt for details.
4
4
  */
5
- import e from"../../../core/Handles.js";import{deg2rad as r}from"../../../core/mathUtils.js";import{destroyMaybe as t}from"../../../core/maybe.js";import{watch as i,initial as s}from"../../../core/reactiveUtils.js";import{convertUnit as o,getMetersPerUnitForSR as n}from"../../../core/unitUtils.js";import{fromRotation as a,translate as l,rotate as c,scaleByVec2 as m}from"../../../core/libs/gl-matrix-2/math/mat3.js";import{create as h}from"../../../core/libs/gl-matrix-2/factories/mat3f32.js";import{set as d,sub as p,scale as f,rotate as u}from"../../../core/libs/gl-matrix-2/math/vec2.js";import{ZEROS as j}from"../../../core/libs/gl-matrix-2/factories/vec2f32.js";import{create as g}from"../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{project as _}from"../../../geometry/projection.js";import{getResolutionInMetersForScale as C}from"../../../geometry/support/scaleUtils.js";import{equals as v}from"../../../geometry/support/spatialReferenceUtils.js";import{DisplayObject as y}from"../engine/DisplayObject.js";import{WGLDrawPhase as M}from"../engine/webgl/enums.js";import{GridTechnique as b}from"../engine/webgl/shaderGraph/techniques/grid/GridTechnique.js";const x=g();function L(e,r){return Math.log(e)/Math.log(r)}class w extends y{constructor(){super(),this._handles=new e,this._desiredPixelsPerCell=50,this._projectedCenter=null,this._technique=new b,this._grid=null,this.visible=!0}destroy(){this._handles=t(this._handles),this._technique.shutdown()}get grid(){return this._grid}set grid(e){this._grid=e,this._handles.removeAll(),this._handles.add([i((()=>e?.center),(()=>{this._projectedCenter=null}),s),i((()=>[e?.center,e?.dynamicScaling,e?.majorLineColor,e?.majorLineInterval,e?.minorLineColor,e?.rotateWithMap,e?.rotation,e?.spacing,e?.units]),(()=>this.requestRender()),s)])}_createTransforms(){return{displayViewScreenMat3:h()}}doRender(e){if(e.drawPhase!==M.MAP||null==this.grid||!this.visible)return;const{spacing:r,units:t,majorLineInterval:i,dynamicScaling:s,majorLineColor:n,minorLineColor:a}=this.grid,{scale:l}=e.state,c=o(r,t,"meters"),m=C(l),h=c/m,d=1===i?10:i,p=c*d**(s?Math.round(L(this._desiredPixelsPerCell/h,d)):0);this._updateTransform(e,m,p),this._technique.render(e,{transform:{dvs:this.transforms.displayViewScreenMat3},config:{pxPerCell:p/m,minorLineColor:q(a),majorLineColor:q(n),majorLineInterval:i,halfWidth:.25,aaWidth:.5}})}_updateTransform(e,t,i){const{grid:s}=this,{center:o,rotation:h,size:g,spatialReference:C}=e.state;if(null==s)return;if(this._projectedCenter&&v(this._projectedCenter.spatialReference,C)||(v(s.center.spatialReference,C)?this._projectedCenter=s.center:this._projectedCenter=_(s.center,C)),!this._projectedCenter)return;const y=t*(g[0]/2),M=t*(g[1]/2),b=n(C)/i,L=this._projectedCenter,w=r(s.rotation),q=r(h),R=this.transforms.displayViewScreenMat3;a(R,-w);const I=d(x,L.x,L.y),S=p(x,o,I);f(S,S,b),s.rotateWithMap||u(S,S,j,-q),u(S,S,j,-w),f(S,S,1/s.majorLineInterval),P(S,S),f(S,S,s.majorLineInterval),u(S,S,j,w),l(R,R,S),s.rotateWithMap&&c(R,R,q);const U=d(x,y/i,M/i);m(R,R,U)}}function P(e,r){return e[0]=r[0]-Math.trunc(r[0]),e[1]=r[1]-Math.trunc(r[1]),e}function q(e){const[r,t,i,s]=e.toArray().map((e=>e/255));return[r*s,t*s,i*s,s]}export{w as default};
5
+ import e from"../../../core/Handles.js";import{deg2rad as t}from"../../../core/mathUtils.js";import{destroyMaybe as r}from"../../../core/maybe.js";import{watch as i,initial as o}from"../../../core/reactiveUtils.js";import{convertUnit as s,getMetersPerUnitForSR as n}from"../../../core/unitUtils.js";import{fromRotation as a,translate as c,rotate as m,scaleByVec2 as l}from"../../../core/libs/gl-matrix-2/math/mat3.js";import{create as h}from"../../../core/libs/gl-matrix-2/factories/mat3f32.js";import{set as p,sub as d,scale as f,rotate as u}from"../../../core/libs/gl-matrix-2/math/vec2.js";import{ZEROS as j}from"../../../core/libs/gl-matrix-2/factories/vec2f32.js";import{create as g}from"../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{project as _}from"../../../geometry/projection.js";import{getResolutionInMetersForScale as C}from"../../../geometry/support/scaleUtils.js";import{equals as v}from"../../../geometry/support/spatialReferenceUtils.js";import{DisplayObject as y}from"../engine/DisplayObject.js";import{WGLDrawPhase as M}from"../engine/webgl/enums.js";import{GridTechnique as b}from"../engine/webgl/shaderGraph/techniques/grid/GridTechnique.js";import{pixelsPerCell as L}from"./constants.js";const w=g();function x(e,t){return Math.log(e)/Math.log(t)}class q extends y{constructor(){super(),this._handles=new e,this._projectedCenter=null,this._technique=new b,this._grid=null,this.visible=!0}destroy(){this._handles=r(this._handles),this._technique.shutdown()}get grid(){return this._grid}set grid(e){this._grid=e,this._handles.removeAll(),this._handles.add([i((()=>e?.center),(()=>{this._projectedCenter=null}),o),i((()=>[e?.center,e?.dynamicScaling,e?.majorLineColor,e?.majorLineInterval,e?.minorLineColor,e?.rotateWithMap,e?.rotation,e?.spacing,e?.units]),(()=>this.requestRender()),o)])}_createTransforms(){return{displayViewScreenMat3:h()}}doRender(e){if(e.drawPhase!==M.MAP||null==this.grid||!this.visible)return;const{spacing:t,units:r,majorLineInterval:i,dynamicScaling:o,majorLineColor:n,minorLineColor:a}=this.grid,{scale:c}=e.state,m=s(t,r,"meters"),l=C(c),h=m/l,p=1===i?10:i,d=m*p**(o?Math.round(x(L/h,p)):0);this._updateTransform(e,l,d),this._technique.render(e,{transform:{dvs:this.transforms.displayViewScreenMat3},config:{pxPerCell:d/l,minorLineColor:I(a),majorLineColor:I(n),majorLineInterval:i,halfWidth:.25,aaWidth:.5}})}_updateTransform(e,r,i){const{grid:o}=this,{center:s,rotation:h,size:g,spatialReference:C}=e.state;if(null==o)return;if(this._projectedCenter&&v(this._projectedCenter.spatialReference,C)||(v(o.center.spatialReference,C)?this._projectedCenter=o.center:this._projectedCenter=_(o.center,C)),!this._projectedCenter)return;const y=r*(g[0]/2),M=r*(g[1]/2),b=n(C)/i,L=this._projectedCenter,x=t(o.rotation),q=t(h),I=this.transforms.displayViewScreenMat3;a(I,-x);const S=p(w,L.x,L.y),U=d(w,s,S);f(U,U,b),o.rotateWithMap||u(U,U,j,-q),u(U,U,j,-x),f(U,U,1/o.majorLineInterval),R(U,U),f(U,U,o.majorLineInterval),u(U,U,j,x),c(I,I,U),o.rotateWithMap&&m(I,I,q);const W=p(w,y/i,M/i);l(I,I,W)}}function R(e,t){return e[0]=t[0]-Math.trunc(t[0]),e[1]=t[1]-Math.trunc(t[1]),e}function I(e){const[t,r,i,o]=e.toArray().map((e=>e/255));return[t*o,r*o,i*o,o]}export{q as default};
@@ -0,0 +1,5 @@
1
+ /*
2
+ All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
+ See https://js.arcgis.com/4.31/esri/copyright.txt for details.
4
+ */
5
+ const o=50;export{o as pixelsPerCell};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.31/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../../chunks/tslib.es6.js";import"../../../../geometry.js";import t from"../../../../Graphic.js";import"../../../../symbols.js";import{getContrast as i}from"../../../../core/colorUtils.js";import{destroyMaybe as s}from"../../../../core/maybe.js";import{watch as o}from"../../../../core/reactiveUtils.js";import{getMetersPerUnitForSR as r}from"../../../../core/unitUtils.js";import{property as a}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as n}from"../../../../core/accessorSupport/decorators/subclass.js";import{subtract as c,normalize as h}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{create as l,UNIT_X as p}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{j as m,l as d,n as _,g,o as u,f as y}from"../../../../chunks/vec32.js";import{create as f}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{project as v,initializeProjection as G}from"../../../../geometry/projection.js";import{a as w,c as R}from"../../../../chunks/boundedPlane.js";import{equals as b}from"../../../../geometry/support/spatialReferenceUtils.js";import j from"../../../../layers/GraphicsLayer.js";import{ViewingMode as C}from"../../../ViewingMode.js";import{DragManipulation as k}from"./manipulations/DragManipulation.js";import{RotateManipulation as A}from"./manipulations/RotateManipulation.js";import{ScaleManipulation as S}from"./manipulations/ScaleManipulation.js";import{PreserveAspectRatio as P,SnapRotation as T}from"./manipulations/utils.js";import{primaryKey as M}from"../../../input/keys.js";import{InteractiveToolBase as x}from"../../../interactive/InteractiveToolBase.js";import{mediaKeys as D,KeyBindings as O}from"../../../interactive/keybindings.js";import{EditGeometry as U}from"../../../interactive/editGeometry/EditGeometry.js";import{EditGeometryOperations as L}from"../../../interactive/editGeometry/EditGeometryOperations.js";import{AccumulationBehavior as E}from"../../../interactive/editGeometry/interfaces.js";import{AccumulationType as B}from"../../../interactive/editGeometry/operations/UpdateVertices.js";import{calculateOrientedBounds as H}from"../../../interactive/editGeometry/support/editPlaneUtils.js";import{findFirstGraphicHit as I}from"../../../support/hitTestSelectUtils.js";import{createScreenPointFromEvent as V}from"../../../support/screenUtils.js";import z from"../../../../geometry/Polygon.js";import N from"../../../../geometry/Point.js";import W from"../../../../symbols/SimpleFillSymbol.js";import q from"../../../../symbols/SimpleMarkerSymbol.js";const F={up:"ArrowUp",down:"ArrowDown",left:"ArrowLeft",right:"ArrowRight",plus:"+",minus:"-",toggleOpacity:"t",shift:"Shift",primaryKey:M},K=80,J=10,Q=30,X=[[1,1],[1,-1],[-1,-1],[-1,1],[1,0],[0,-1],[-1,0],[0,1]],Y=1,Z=10;let $=class extends x{constructor(e){super(e),this._initialControlPoints=null,this._initialGeometry=null,this._graphic=null,this._planeCache=w(),this._displayPlaneCache=w(),this._mainAxisCache=l(),this._rotationHandleCache=f(),this._cornerA=f(),this._cornerB=f(),this._cornerC=f(),this._cornerD=f(),this._avgAB=f(),this._avgBC=f(),this._avgCD=f(),this._avgDA=f(),this._preserveAspectRatio=new P,this._snapRotation=new T,this._graphicsLayer=new j({internal:!0,listMode:"hide",visible:!1}),this._sharedUndoStack=[],this._sharedRedoStack=[],this._isOpacityToggled=!1,this._factor=Y,this.preserveAspectRatio=null,this.snapRotation=null}initialize(){this._initialize()}destroy(){const{map:e}=this.view;this._dragManipulation.destroy(),this._rotateManipulation.destroy(),this._scaleManipulations.forEach((e=>e.destroy())),this._editGeometryOperations.destroy(),e.removeMany([this._graphicsLayer]),this._graphicsLayer.removeAll(),this._graphicsLayer=s(this._graphicsLayer),this._initialControlPoints=null,this._initialGeometry=null,this._graphic=null,this._preserveAspectRatio=null,this._snapRotation=null,this._planeCache=null,this._displayPlaneCache=null,this._rotationHandleCache=null,this._mainAxisCache=null,this._cornerA=null,this._cornerB=null,this._cornerC=null,this._cornerD=null,this._avgAB=null,this._avgBC=null,this._avgCD=null,this._avgDA=null,this._sharedUndoStack=null,this._sharedRedoStack=null}get _plane(){const e=this._graphic.geometry;if(null==e)return null;const t=this._editGeometryOperations.data,i=t.components[0].edges[0],s=c(this._mainAxisCache,i.leftVertex.pos,i.rightVertex.pos);h(s,s);let o=K*this.view.resolution;const a=this.view.spatialReference;return b(a,e.spatialReference)&&(o*=r(a)/r(e.spatialReference)),H(s,t,o,this._planeCache)}get _displayPlane(){const e=this._plane;if(!e)return null;const t=this._displayPlaneCache;R(e,t);const i=J*this.view.resolution;return m(t.basis1,t.basis1,1+i/d(t.basis1)),m(t.basis2,t.basis2,1+i/d(t.basis2)),t}get _backgroundGraphicGeometry(){const e=this._displayPlane;if(!e)return null;const t=this.view.spatialReference;return this._updateDisplayPlaneConrers(e),new z({spatialReference:t,rings:[[this._cornerA,this._cornerB,this._cornerC,this._cornerD,this._cornerA]]})}get _rotateGraphicGeometry(){const e=this._plane;if(!e)return null;const t=this._rotationHandleCache;return _(t,e.basis1),m(t,t,Q*this.view.resolution),g(t,t,e.origin),g(t,t,e.basis1),new N({x:t[0],y:t[1],spatialReference:this.view.spatialReference})}get _scaleGraphicGeometries(){const e=this._displayPlane;if(!e)return[];const t=this.view.spatialReference;this._updateDisplayPlaneConrers(e);const{_cornerA:i,_cornerB:s,_cornerC:o,_cornerD:r}=this,a=u(this._avgAB,i,s,.5),n=u(this._avgBC,s,o,.5),c=u(this._avgCD,o,r,.5),h=u(this._avgDA,r,i,.5);return[new N({x:i[0],y:i[1],spatialReference:t}),new N({x:s[0],y:s[1],spatialReference:t}),new N({x:o[0],y:o[1],spatialReference:t}),new N({x:r[0],y:r[1],spatialReference:t}),new N({x:a[0],y:a[1],spatialReference:t}),new N({x:n[0],y:n[1],spatialReference:t}),new N({x:c[0],y:c[1],spatialReference:t}),new N({x:h[0],y:h[1],spatialReference:t})]}onActivate(){this.visible=!0}onDeactivate(){this.visible=!1}onShow(){this._graphicsLayer.visible=!0}onHide(){this._graphicsLayer.visible=!1}canUndo(){return this._editGeometryOperations.canUndo}canRedo(){return this._editGeometryOperations.canRedo}undo(){this._editGeometryOperations.undo(),this.updateGraphics()}redo(){this._editGeometryOperations.redo(),this.updateGraphics()}refresh(){const{view:e,target:t}=this,i="georeference"in t?t.georeference.coords:t.geometry,s=this._editGeometryOperations,o=s.data.components[0].vertices,r=U.fromGeometry(v(i,e.spatialReference),C.Local).components[0].vertices;o.forEach(((e,t)=>{s.setVertexPosition(e,r[t].pos)})),this.updateGraphics()}reset(){const{target:e}=this;if("georeference"in e){const t=e.georeference;"control-points"===t.type&&(t.controlPoints=this._initialControlPoints)}else e.geometry=this._initialGeometry;this.refresh(),this._sharedUndoStack.length=0,this._sharedRedoStack.length=0}updateGraphics(){const e=this._editGeometryOperations.data.geometry;if("georeference"in this.target){this.target.georeference.coords=e}this._graphic.geometry=e,this._backgroundGraphic.geometry=this._backgroundGraphicGeometry,this._rotateGraphic.geometry=this._rotateGraphicGeometry,this._scaleGraphicGeometries.forEach(((e,t)=>{this._scaleGraphics[t].geometry=e}))}setSharedUndoStack(e){this._sharedUndoStack=e}setSharedRedoStack(e){this._sharedRedoStack=e}async _initialize(){const{view:e,target:s}=this;if("georeference"in s){const e=s.georeference;this._graphic=new t({geometry:e.coords}),this._initialControlPoints="control-points"===e.type?e.controlPoints:null}else this._graphic=s,this._initialGeometry=s.geometry;e.map.addMany([this._graphicsLayer]),e.focus(),this.visible=!1,this.finishToolCreation(),await this._loadProjectionEngine(),this._editGeometryOperations=L.fromGeometry(v(this._graphic.geometry,e.spatialReference),C.Local),this._backgroundGraphic=new t({symbol:new W({color:"transparent",outline:{type:"simple-line",color:e.effectiveTheme.accentColor,width:2}}),geometry:this._backgroundGraphicGeometry}),this._rotateGraphic=new t({symbol:new q({color:i(e.effectiveTheme.accentColor),outline:{type:"simple-line",color:e.effectiveTheme.accentColor,width:1}}),geometry:this._rotateGraphicGeometry}),this._scaleGraphics=this._scaleGraphicGeometries.map((s=>new t({symbol:new q({size:6,style:"square",color:i(e.effectiveTheme.accentColor),outline:{type:"simple-line",color:e.effectiveTheme.accentColor,width:1}}),geometry:s}))),this._graphicsLayer.graphics.addMany([this._backgroundGraphic,this._rotateGraphic,...this._scaleGraphics]),this._dragManipulation=new k({tool:this,view:e,graphic:this._graphic}),this._rotateManipulation=new A({tool:this,view:e,graphic:this._rotateGraphic,snapRotation:this._snapRotation}),this._scaleManipulations=this._scaleGraphics.map(((t,i)=>new S({tool:this,view:e,graphic:t,direction:X[i],preserveAspectRatio:this._preserveAspectRatio}))),this.addHandles([this._dragManipulation.createDragPipeline(this._getInfo.bind(this),this._updateGraphics.bind(this)),this._rotateManipulation.createDragPipeline(this._getInfo.bind(this),this._updateGraphics.bind(this)),...this._scaleManipulations.map((e=>e.createDragPipeline(this._getInfo.bind(this),this._updateGraphics.bind(this)))),o((()=>this.view.scale),(()=>this.active?this.updateGraphics():null)),e.on("click",(async t=>{if(null!=e.activeTool&&e.activeTool!==this)return;const i=V(t),o=[];e.map.allLayers.forEach((e=>{"vector-tile"!==e.type&&"imagery"!==e.type||o.push(e)}));const r=await this.view.hitTest(i,{exclude:o}),a=r.results;if(0===a.length)e.activeTool=null;else{const t=I(r.results),i="georeference"in s,o=a.map((e=>"media"===e.type?e.element:null)).filter(Boolean),n=new Set([...this._graphicsLayer.graphics,i?null:s].filter(Boolean));i&&o.includes(s)||null!=t&&n.has(t.graphic)?null==e.activeTool&&(e.activeTool=this):e.activeTool=null}}))]);const r=e=>{this.addHandles(e.events.on("grab-changed",(e=>{"georeference"in s&&("start"===e.action?s.opacity*=.5:"end"===e.action&&(s.opacity*=2))})))};this._dragManipulation.forEachManipulator(r),this._rotateManipulation.forEachManipulator(r),this._scaleManipulations.forEach((e=>e.forEachManipulator(r)));const a=new O;a.addToggle(D.preserveAspectRatio,(()=>{null==this.preserveAspectRatio&&(this._preserveAspectRatio.enabled=!this._preserveAspectRatio.enabled)})),a.addToggle(D.rotateIncrements,(()=>{null==this.snapRotation&&(this._snapRotation.enabled=!this._snapRotation.enabled)})),a.add(D.toggleOpacity,(()=>{"georeference"in s&&(s.opacity*=this._isOpacityToggled?2:.5,this._isOpacityToggled=!this._isOpacityToggled)})),a.addToggle(D.factorModifier,(e=>this._factor="key-down"===e.type?Z:Y)),a.add(D.scaleUp,(()=>this._scale(this._factor))),a.add(D.scaleDown,(()=>this._scale(-this._factor))),a.add(D.moveUp,(()=>this._move(0,this._factor))),a.add(D.moveDown,(()=>this._move(0,-this._factor))),a.add(D.moveLeft,(()=>this._move(-this._factor,0))),a.add(D.moveRight,(()=>this._move(this._factor,0))),this.addHandles([e.on("key-down",(t=>{e.activeTool===this&&a.dispatch(e.inputManager,t)})),e.on("key-up",(t=>{e.activeTool===this&&a.dispatch(e.inputManager,t)}))])}async _loadProjectionEngine(){const e=this._graphic.geometry;return G(e.spatialReference,this.view.spatialReference)}_updateDisplayPlaneConrers(e){const{basis1:t,basis2:i,origin:s}=e,o=this._cornerA;g(o,s,t),g(o,o,i);const r=this._cornerB;g(r,s,t),y(r,r,i);const a=this._cornerC;y(a,s,t),y(a,a,i);const n=this._cornerD;y(n,s,t),g(n,n,i)}_getInfo(){return{editGeometryOperations:this._editGeometryOperations,plane:this._plane,displayPlane:this._displayPlane}}_updateGraphics(e,t){"start"===e.action&&(this._sharedUndoStack.push({tool:this,operation:t}),this._sharedRedoStack.length=0),this.updateGraphics()}_scale(e){const t=this._editGeometryOperations,i=t.data.geometry.extent?.width,s=(i+e*this.view.resolution)/i,o=t.scale(this._plane.origin,p,s,s,E.NEW_STEP,B.REPLACE);this._sharedUndoStack.push({tool:this,operation:o}),this._sharedRedoStack.length=0,this.updateGraphics()}_move(e,t){const i=this._editGeometryOperations.move(e*this.view.resolution,t*this.view.resolution,0,E.NEW_STEP);this._sharedUndoStack.push({tool:this,operation:i}),this._sharedRedoStack.length=0,this.updateGraphics()}};e([a()],$.prototype,"_plane",null),e([a()],$.prototype,"_backgroundGraphicGeometry",null),e([a()],$.prototype,"_rotateGraphicGeometry",null),e([a()],$.prototype,"_scaleGraphicGeometries",null),e([a()],$.prototype,"preserveAspectRatio",void 0),e([a()],$.prototype,"snapRotation",void 0),e([a({constructOnly:!0,nonNullable:!0})],$.prototype,"target",void 0),e([a({constructOnly:!0})],$.prototype,"view",void 0),$=e([n("esri.views.2d.interactive.editingTools.TransformTool")],$);export{$ as TransformTool,F as keys};
5
+ import{_ as e}from"../../../../chunks/tslib.es6.js";import"../../../../geometry.js";import t from"../../../../Graphic.js";import"../../../../symbols.js";import{getContrast as i}from"../../../../core/colorUtils.js";import{destroyMaybe as s}from"../../../../core/maybe.js";import{watch as o}from"../../../../core/reactiveUtils.js";import{getMetersPerUnitForSR as r}from"../../../../core/unitUtils.js";import{property as a}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as n}from"../../../../core/accessorSupport/decorators/subclass.js";import{subtract as c,normalize as h}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{create as l,UNIT_X as p}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{j as m,m as d,n as _,g,o as u,f as y}from"../../../../chunks/vec32.js";import{create as f}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{project as v,initializeProjection as G}from"../../../../geometry/projection.js";import{a as w,c as R}from"../../../../chunks/boundedPlane.js";import{equals as b}from"../../../../geometry/support/spatialReferenceUtils.js";import j from"../../../../layers/GraphicsLayer.js";import{ViewingMode as C}from"../../../ViewingMode.js";import{DragManipulation as k}from"./manipulations/DragManipulation.js";import{RotateManipulation as A}from"./manipulations/RotateManipulation.js";import{ScaleManipulation as S}from"./manipulations/ScaleManipulation.js";import{PreserveAspectRatio as P,SnapRotation as T}from"./manipulations/utils.js";import{primaryKey as M}from"../../../input/keys.js";import{InteractiveToolBase as x}from"../../../interactive/InteractiveToolBase.js";import{mediaKeys as D,KeyBindings as O}from"../../../interactive/keybindings.js";import{EditGeometry as U}from"../../../interactive/editGeometry/EditGeometry.js";import{EditGeometryOperations as L}from"../../../interactive/editGeometry/EditGeometryOperations.js";import{AccumulationBehavior as E}from"../../../interactive/editGeometry/interfaces.js";import{AccumulationType as B}from"../../../interactive/editGeometry/operations/UpdateVertices.js";import{calculateOrientedBounds as H}from"../../../interactive/editGeometry/support/editPlaneUtils.js";import{findFirstGraphicHit as I}from"../../../support/hitTestSelectUtils.js";import{createScreenPointFromEvent as V}from"../../../support/screenUtils.js";import z from"../../../../geometry/Polygon.js";import N from"../../../../geometry/Point.js";import W from"../../../../symbols/SimpleFillSymbol.js";import q from"../../../../symbols/SimpleMarkerSymbol.js";const F={up:"ArrowUp",down:"ArrowDown",left:"ArrowLeft",right:"ArrowRight",plus:"+",minus:"-",toggleOpacity:"t",shift:"Shift",primaryKey:M},K=80,J=10,Q=30,X=[[1,1],[1,-1],[-1,-1],[-1,1],[1,0],[0,-1],[-1,0],[0,1]],Y=1,Z=10;let $=class extends x{constructor(e){super(e),this._initialControlPoints=null,this._initialGeometry=null,this._graphic=null,this._planeCache=w(),this._displayPlaneCache=w(),this._mainAxisCache=l(),this._rotationHandleCache=f(),this._cornerA=f(),this._cornerB=f(),this._cornerC=f(),this._cornerD=f(),this._avgAB=f(),this._avgBC=f(),this._avgCD=f(),this._avgDA=f(),this._preserveAspectRatio=new P,this._snapRotation=new T,this._graphicsLayer=new j({internal:!0,listMode:"hide",visible:!1}),this._sharedUndoStack=[],this._sharedRedoStack=[],this._isOpacityToggled=!1,this._factor=Y,this.preserveAspectRatio=null,this.snapRotation=null}initialize(){this._initialize()}destroy(){const{map:e}=this.view;this._dragManipulation.destroy(),this._rotateManipulation.destroy(),this._scaleManipulations.forEach((e=>e.destroy())),this._editGeometryOperations.destroy(),e.removeMany([this._graphicsLayer]),this._graphicsLayer.removeAll(),this._graphicsLayer=s(this._graphicsLayer),this._initialControlPoints=null,this._initialGeometry=null,this._graphic=null,this._preserveAspectRatio=null,this._snapRotation=null,this._planeCache=null,this._displayPlaneCache=null,this._rotationHandleCache=null,this._mainAxisCache=null,this._cornerA=null,this._cornerB=null,this._cornerC=null,this._cornerD=null,this._avgAB=null,this._avgBC=null,this._avgCD=null,this._avgDA=null,this._sharedUndoStack=null,this._sharedRedoStack=null}get _plane(){const e=this._graphic.geometry;if(null==e)return null;const t=this._editGeometryOperations.data,i=t.components[0].edges[0],s=c(this._mainAxisCache,i.leftVertex.pos,i.rightVertex.pos);h(s,s);let o=K*this.view.resolution;const a=this.view.spatialReference;return b(a,e.spatialReference)&&(o*=r(a)/r(e.spatialReference)),H(s,t,o,this._planeCache)}get _displayPlane(){const e=this._plane;if(!e)return null;const t=this._displayPlaneCache;R(e,t);const i=J*this.view.resolution;return m(t.basis1,t.basis1,1+i/d(t.basis1)),m(t.basis2,t.basis2,1+i/d(t.basis2)),t}get _backgroundGraphicGeometry(){const e=this._displayPlane;if(!e)return null;const t=this.view.spatialReference;return this._updateDisplayPlaneConrers(e),new z({spatialReference:t,rings:[[this._cornerA,this._cornerB,this._cornerC,this._cornerD,this._cornerA]]})}get _rotateGraphicGeometry(){const e=this._plane;if(!e)return null;const t=this._rotationHandleCache;return _(t,e.basis1),m(t,t,Q*this.view.resolution),g(t,t,e.origin),g(t,t,e.basis1),new N({x:t[0],y:t[1],spatialReference:this.view.spatialReference})}get _scaleGraphicGeometries(){const e=this._displayPlane;if(!e)return[];const t=this.view.spatialReference;this._updateDisplayPlaneConrers(e);const{_cornerA:i,_cornerB:s,_cornerC:o,_cornerD:r}=this,a=u(this._avgAB,i,s,.5),n=u(this._avgBC,s,o,.5),c=u(this._avgCD,o,r,.5),h=u(this._avgDA,r,i,.5);return[new N({x:i[0],y:i[1],spatialReference:t}),new N({x:s[0],y:s[1],spatialReference:t}),new N({x:o[0],y:o[1],spatialReference:t}),new N({x:r[0],y:r[1],spatialReference:t}),new N({x:a[0],y:a[1],spatialReference:t}),new N({x:n[0],y:n[1],spatialReference:t}),new N({x:c[0],y:c[1],spatialReference:t}),new N({x:h[0],y:h[1],spatialReference:t})]}onActivate(){this.visible=!0}onDeactivate(){this.visible=!1}onShow(){this._graphicsLayer.visible=!0}onHide(){this._graphicsLayer.visible=!1}canUndo(){return this._editGeometryOperations.canUndo}canRedo(){return this._editGeometryOperations.canRedo}undo(){this._editGeometryOperations.undo(),this.updateGraphics()}redo(){this._editGeometryOperations.redo(),this.updateGraphics()}refresh(){const{view:e,target:t}=this,i="georeference"in t?t.georeference.coords:t.geometry,s=this._editGeometryOperations,o=s.data.components[0].vertices,r=U.fromGeometry(v(i,e.spatialReference),C.Local).components[0].vertices;o.forEach(((e,t)=>{s.setVertexPosition(e,r[t].pos)})),this.updateGraphics()}reset(){const{target:e}=this;if("georeference"in e){const t=e.georeference;"control-points"===t.type&&(t.controlPoints=this._initialControlPoints)}else e.geometry=this._initialGeometry;this.refresh(),this._sharedUndoStack.length=0,this._sharedRedoStack.length=0}updateGraphics(){const e=this._editGeometryOperations.data.geometry;if("georeference"in this.target){this.target.georeference.coords=e}this._graphic.geometry=e,this._backgroundGraphic.geometry=this._backgroundGraphicGeometry,this._rotateGraphic.geometry=this._rotateGraphicGeometry,this._scaleGraphicGeometries.forEach(((e,t)=>{this._scaleGraphics[t].geometry=e}))}setSharedUndoStack(e){this._sharedUndoStack=e}setSharedRedoStack(e){this._sharedRedoStack=e}async _initialize(){const{view:e,target:s}=this;if("georeference"in s){const e=s.georeference;this._graphic=new t({geometry:e.coords}),this._initialControlPoints="control-points"===e.type?e.controlPoints:null}else this._graphic=s,this._initialGeometry=s.geometry;e.map.addMany([this._graphicsLayer]),e.focus(),this.visible=!1,this.finishToolCreation(),await this._loadProjectionEngine(),this._editGeometryOperations=L.fromGeometry(v(this._graphic.geometry,e.spatialReference),C.Local),this._backgroundGraphic=new t({symbol:new W({color:"transparent",outline:{type:"simple-line",color:e.effectiveTheme.accentColor,width:2}}),geometry:this._backgroundGraphicGeometry}),this._rotateGraphic=new t({symbol:new q({color:i(e.effectiveTheme.accentColor),outline:{type:"simple-line",color:e.effectiveTheme.accentColor,width:1}}),geometry:this._rotateGraphicGeometry}),this._scaleGraphics=this._scaleGraphicGeometries.map((s=>new t({symbol:new q({size:6,style:"square",color:i(e.effectiveTheme.accentColor),outline:{type:"simple-line",color:e.effectiveTheme.accentColor,width:1}}),geometry:s}))),this._graphicsLayer.graphics.addMany([this._backgroundGraphic,this._rotateGraphic,...this._scaleGraphics]),this._dragManipulation=new k({tool:this,view:e,graphic:this._graphic}),this._rotateManipulation=new A({tool:this,view:e,graphic:this._rotateGraphic,snapRotation:this._snapRotation}),this._scaleManipulations=this._scaleGraphics.map(((t,i)=>new S({tool:this,view:e,graphic:t,direction:X[i],preserveAspectRatio:this._preserveAspectRatio}))),this.addHandles([this._dragManipulation.createDragPipeline(this._getInfo.bind(this),this._updateGraphics.bind(this)),this._rotateManipulation.createDragPipeline(this._getInfo.bind(this),this._updateGraphics.bind(this)),...this._scaleManipulations.map((e=>e.createDragPipeline(this._getInfo.bind(this),this._updateGraphics.bind(this)))),o((()=>this.view.scale),(()=>this.active?this.updateGraphics():null)),e.on("click",(async t=>{if(null!=e.activeTool&&e.activeTool!==this)return;const i=V(t),o=[];e.map.allLayers.forEach((e=>{"vector-tile"!==e.type&&"imagery"!==e.type||o.push(e)}));const r=await this.view.hitTest(i,{exclude:o}),a=r.results;if(0===a.length)e.activeTool=null;else{const t=I(r.results),i="georeference"in s,o=a.map((e=>"media"===e.type?e.element:null)).filter(Boolean),n=new Set([...this._graphicsLayer.graphics,i?null:s].filter(Boolean));i&&o.includes(s)||null!=t&&n.has(t.graphic)?null==e.activeTool&&(e.activeTool=this):e.activeTool=null}}))]);const r=e=>{this.addHandles(e.events.on("grab-changed",(e=>{"georeference"in s&&("start"===e.action?s.opacity*=.5:"end"===e.action&&(s.opacity*=2))})))};this._dragManipulation.forEachManipulator(r),this._rotateManipulation.forEachManipulator(r),this._scaleManipulations.forEach((e=>e.forEachManipulator(r)));const a=new O;a.addToggle(D.preserveAspectRatio,(()=>{null==this.preserveAspectRatio&&(this._preserveAspectRatio.enabled=!this._preserveAspectRatio.enabled)})),a.addToggle(D.rotateIncrements,(()=>{null==this.snapRotation&&(this._snapRotation.enabled=!this._snapRotation.enabled)})),a.add(D.toggleOpacity,(()=>{"georeference"in s&&(s.opacity*=this._isOpacityToggled?2:.5,this._isOpacityToggled=!this._isOpacityToggled)})),a.addToggle(D.factorModifier,(e=>this._factor="key-down"===e.type?Z:Y)),a.add(D.scaleUp,(()=>this._scale(this._factor))),a.add(D.scaleDown,(()=>this._scale(-this._factor))),a.add(D.moveUp,(()=>this._move(0,this._factor))),a.add(D.moveDown,(()=>this._move(0,-this._factor))),a.add(D.moveLeft,(()=>this._move(-this._factor,0))),a.add(D.moveRight,(()=>this._move(this._factor,0))),this.addHandles([e.on("key-down",(t=>{e.activeTool===this&&a.dispatch(e.inputManager,t)})),e.on("key-up",(t=>{e.activeTool===this&&a.dispatch(e.inputManager,t)}))])}async _loadProjectionEngine(){const e=this._graphic.geometry;return G(e.spatialReference,this.view.spatialReference)}_updateDisplayPlaneConrers(e){const{basis1:t,basis2:i,origin:s}=e,o=this._cornerA;g(o,s,t),g(o,o,i);const r=this._cornerB;g(r,s,t),y(r,r,i);const a=this._cornerC;y(a,s,t),y(a,a,i);const n=this._cornerD;y(n,s,t),g(n,n,i)}_getInfo(){return{editGeometryOperations:this._editGeometryOperations,plane:this._plane,displayPlane:this._displayPlane}}_updateGraphics(e,t){"start"===e.action&&(this._sharedUndoStack.push({tool:this,operation:t}),this._sharedRedoStack.length=0),this.updateGraphics()}_scale(e){const t=this._editGeometryOperations,i=t.data.geometry.extent?.width,s=(i+e*this.view.resolution)/i,o=t.scale(this._plane.origin,p,s,s,E.NEW_STEP,B.REPLACE);this._sharedUndoStack.push({tool:this,operation:o}),this._sharedRedoStack.length=0,this.updateGraphics()}_move(e,t){const i=this._editGeometryOperations.move(e*this.view.resolution,t*this.view.resolution,0,E.NEW_STEP);this._sharedUndoStack.push({tool:this,operation:i}),this._sharedRedoStack.length=0,this.updateGraphics()}};e([a()],$.prototype,"_plane",null),e([a()],$.prototype,"_backgroundGraphicGeometry",null),e([a()],$.prototype,"_rotateGraphicGeometry",null),e([a()],$.prototype,"_scaleGraphicGeometries",null),e([a()],$.prototype,"preserveAspectRatio",void 0),e([a()],$.prototype,"snapRotation",void 0),e([a({constructOnly:!0,nonNullable:!0})],$.prototype,"target",void 0),e([a({constructOnly:!0})],$.prototype,"view",void 0),$=e([n("esri.views.2d.interactive.editingTools.TransformTool")],$);export{$ as TransformTool,F as keys};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.31/esri/copyright.txt for details.
4
4
  */
5
- import t from"../../../../../core/Handles.js";import{set as i,normalize as e}from"../../../../../core/libs/gl-matrix-2/math/vec2.js";import{create as r}from"../../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{l as a,c as s,r as n,f as o,m as l}from"../../../../../chunks/vec32.js";import{create as c}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{a as h,c as p}from"../../../../../chunks/boundedPlane.js";import{getInfo as u}from"../../../../../geometry/support/spatialReferenceUtils.js";import{Manipulation as _,ManipulatorType as m}from"./Manipulation.js";import{onGrabChangedHandle as d}from"./utils.js";import{createManipulatorDragEventPipeline as f,screenToMap as v}from"../../../../interactive/dragEventPipeline.js";import{GraphicManipulator as g}from"../../../../interactive/GraphicManipulator.js";import{AccumulationBehavior as b}from"../../../../interactive/editGeometry/interfaces.js";import{AccumulationType as x}from"../../../../interactive/editGeometry/operations/UpdateVertices.js";import{apply as C}from"../../../../interactive/editGeometry/support/editPlaneUtils.js";const E=10,S=1e-6,y=.3;function j(t){const i=a(t.basis1),e=a(t.basis2);return y*Math.min(i,e)}class w extends _{constructor(i){super(),this._handles=new t,this._planeStart=h(),this._displayPlaneStart=h(),this._originCache=c(),this._axisCache=r(),this._renderStartCache=c(),this._renderEndCache=c(),this._resizeOriginCache=c(),this._view=i.view,this._tool=i.tool,this._graphic=i.graphic,this._direction=i.direction,this._preserveAspectRatio=i.preserveAspectRatio,this._manipulator=this._createManipulator(),this._handles.add([this._manipulator.events.on("grab-changed",(t=>d(t,this._manipulator)))]),this.forEachManipulator((t=>this._tool.manipulators.add(t)))}destroy(){this._handles.destroy(),this.forEachManipulator((t=>{this._tool.manipulators.remove(t),t.destroy()})),this._tool=null,this._view=null,this._graphic=null,this._manipulator=null,this._direction=null,this._handles=null,this._planeStart=null,this._displayPlaneStart=null,this._originCache=null,this._axisCache=null,this._renderStartCache=null,this._renderEndCache=null,this._resizeOriginCache=null,this._preserveAspectRatio=null}forEachManipulator(t){t(this._manipulator,m.SCALE)}createDragPipeline(t,r){let c=null,h=null,_=null,m=0,d=null,g=null;const y=this._planeStart,w=this._displayPlaneStart,P=this._direction;return f(this._manipulator,((f,M)=>{M.next((i=>{if("start"===i.action){f.cursor="grabbing";const i=t();c=i.plane,h=i.displayPlane,_=i.editGeometryOperations,m=E*this._view.resolution,p(c,y),p(h,w);const e=u(_.data.spatialReference);d=e?e.valid[1]-e.valid[0]-3*E*this._view.resolution:null}return i})).next(v(this._view)).next((t=>{const i=s(this._renderStartCache,[t.mapStart.x,t.mapStart.y,0]),e=s(this._renderEndCache,[t.mapEnd.x,t.mapEnd.y,0]),r=s(this._resizeOriginCache,w.origin);n(r,r,w.basis1,-P[0]),n(r,r,w.basis2,-P[1]),o(e,e,r),o(i,i,r);const c=0!==P[0]&&0!==P[1],p=j(w),u=j(h)/p,_=(t,r)=>{if(0===t)return 1;let s=a(r),n=.5*t*l(r,e)/s;const o=n<0?-1:1;if(c){n+=(s-.5*t*l(r,i)/s)*o*u}const h=s<1.5*m?1:S;return s=Math.max(s-m,S),o>0&&(n-=E*this._view.resolution),o*Math.max(o*(n/s),h)},d=_(P[0],w.basis1),f=_(P[1],w.basis2);return{...t,direction:P,factor1:d,factor2:f}})).next(this._preserveAspectRatio.createDragEventPipelineStep(),this._preserveAspectRatio.next).next((t=>{const a=s(this._originCache,y.origin);n(a,a,y.basis1,-P[0]),n(a,a,y.basis2,-P[1]);const o=i(this._axisCache,y.basis1[0],y.basis1[1]);e(o,o);const l=_.data.allVertices,h="start"===t.action?b.NEW_STEP:b.ACCUMULATE_STEPS,u=_.scaleVertices(l,a,o,t.factor1,t.factor2,h,x.REPLACE);return d&&d<_.data.geometry.extent.width&&g?_.updateVertices(l,g):(p(y,c),C(u,c),g=u.operation,r(t,u)),t})).next((t=>("end"===t.action&&(f.cursor="grab"),t)))}))}_createManipulator(){return new g({view:this._view,graphic:this._graphic,selectable:!0,cursor:"grab"})}}export{w as ScaleManipulation,j as calculateDiagonalResizeHandleScale};
5
+ import t from"../../../../../core/Handles.js";import{set as i,normalize as e}from"../../../../../core/libs/gl-matrix-2/math/vec2.js";import{create as r}from"../../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{m as a,c as s,r as n,f as o,l}from"../../../../../chunks/vec32.js";import{create as c}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{a as h,c as p}from"../../../../../chunks/boundedPlane.js";import{getInfo as u}from"../../../../../geometry/support/spatialReferenceUtils.js";import{Manipulation as _,ManipulatorType as m}from"./Manipulation.js";import{onGrabChangedHandle as d}from"./utils.js";import{createManipulatorDragEventPipeline as f,screenToMap as v}from"../../../../interactive/dragEventPipeline.js";import{GraphicManipulator as g}from"../../../../interactive/GraphicManipulator.js";import{AccumulationBehavior as b}from"../../../../interactive/editGeometry/interfaces.js";import{AccumulationType as x}from"../../../../interactive/editGeometry/operations/UpdateVertices.js";import{apply as C}from"../../../../interactive/editGeometry/support/editPlaneUtils.js";const E=10,S=1e-6,y=.3;function j(t){const i=a(t.basis1),e=a(t.basis2);return y*Math.min(i,e)}class w extends _{constructor(i){super(),this._handles=new t,this._planeStart=h(),this._displayPlaneStart=h(),this._originCache=c(),this._axisCache=r(),this._renderStartCache=c(),this._renderEndCache=c(),this._resizeOriginCache=c(),this._view=i.view,this._tool=i.tool,this._graphic=i.graphic,this._direction=i.direction,this._preserveAspectRatio=i.preserveAspectRatio,this._manipulator=this._createManipulator(),this._handles.add([this._manipulator.events.on("grab-changed",(t=>d(t,this._manipulator)))]),this.forEachManipulator((t=>this._tool.manipulators.add(t)))}destroy(){this._handles.destroy(),this.forEachManipulator((t=>{this._tool.manipulators.remove(t),t.destroy()})),this._tool=null,this._view=null,this._graphic=null,this._manipulator=null,this._direction=null,this._handles=null,this._planeStart=null,this._displayPlaneStart=null,this._originCache=null,this._axisCache=null,this._renderStartCache=null,this._renderEndCache=null,this._resizeOriginCache=null,this._preserveAspectRatio=null}forEachManipulator(t){t(this._manipulator,m.SCALE)}createDragPipeline(t,r){let c=null,h=null,_=null,m=0,d=null,g=null;const y=this._planeStart,w=this._displayPlaneStart,P=this._direction;return f(this._manipulator,((f,M)=>{M.next((i=>{if("start"===i.action){f.cursor="grabbing";const i=t();c=i.plane,h=i.displayPlane,_=i.editGeometryOperations,m=E*this._view.resolution,p(c,y),p(h,w);const e=u(_.data.spatialReference);d=e?e.valid[1]-e.valid[0]-3*E*this._view.resolution:null}return i})).next(v(this._view)).next((t=>{const i=s(this._renderStartCache,[t.mapStart.x,t.mapStart.y,0]),e=s(this._renderEndCache,[t.mapEnd.x,t.mapEnd.y,0]),r=s(this._resizeOriginCache,w.origin);n(r,r,w.basis1,-P[0]),n(r,r,w.basis2,-P[1]),o(e,e,r),o(i,i,r);const c=0!==P[0]&&0!==P[1],p=j(w),u=j(h)/p,_=(t,r)=>{if(0===t)return 1;let s=a(r),n=.5*t*l(r,e)/s;const o=n<0?-1:1;if(c){n+=(s-.5*t*l(r,i)/s)*o*u}const h=s<1.5*m?1:S;return s=Math.max(s-m,S),o>0&&(n-=E*this._view.resolution),o*Math.max(o*(n/s),h)},d=_(P[0],w.basis1),f=_(P[1],w.basis2);return{...t,direction:P,factor1:d,factor2:f}})).next(this._preserveAspectRatio.createDragEventPipelineStep(),this._preserveAspectRatio.next).next((t=>{const a=s(this._originCache,y.origin);n(a,a,y.basis1,-P[0]),n(a,a,y.basis2,-P[1]);const o=i(this._axisCache,y.basis1[0],y.basis1[1]);e(o,o);const l=_.data.allVertices,h="start"===t.action?b.NEW_STEP:b.ACCUMULATE_STEPS,u=_.scaleVertices(l,a,o,t.factor1,t.factor2,h,x.REPLACE);return d&&d<_.data.geometry.extent.width&&g?_.updateVertices(l,g):(p(y,c),C(u,c),g=u.operation,r(t,u)),t})).next((t=>("end"===t.action&&(f.cursor="grab"),t)))}))}_createManipulator(){return new g({view:this._view,graphic:this._graphic,selectable:!0,cursor:"grab"})}}export{w as ScaleManipulation,j as calculateDiagonalResizeHandleScale};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.31/esri/copyright.txt for details.
4
4
  */
5
- import e from"../../core/Error.js";function r(){return Promise.all([import("./webglDeps.js"),import("./mapViewDeps.js")])}const a=()=>r().then((()=>import("./layers/TileLayerView2D.js"))),t=()=>r().then((()=>import("./layers/FeatureLayerView2D.js"))),i={"base-dynamic":()=>r().then((()=>import("./layers/BaseDynamicLayerView2D.js"))),"base-tile":a,"bing-maps":a,catalog:()=>r().then((()=>import("./layers/CatalogLayerView2D.js"))),"catalog-dynamic-group":()=>r().then((()=>import("./layers/CatalogDynamicGroupLayerView2D.js"))),"catalog-footprint":()=>r().then((()=>import("./layers/CatalogFootprintLayerView2D.js"))),csv:t,"geo-rss":()=>r().then((()=>import("./layers/GeoRSSLayerView2D.js"))),feature:t,geojson:t,graphics:()=>r().then((()=>import("./layers/GraphicsLayerView2D.js"))),group:()=>r().then((()=>import("./layers/GroupLayerView2D.js"))),imagery:()=>r().then((()=>import("./layers/ImageryLayerView2D.js"))),"imagery-tile":()=>r().then((()=>import("./layers/ImageryTileLayerView2D.js"))),kml:()=>r().then((()=>import("./layers/KMLLayerView2D.js"))),"knowledge-graph":()=>r().then((()=>import("./layers/KnowledgeGraphLayerView2D.js"))),"link-chart":()=>r().then((()=>import("./layers/KnowledgeGraphLayerView2D.js"))),"knowledge-graph-sublayer":t,"map-image":()=>r().then((()=>import("./layers/MapImageLayerView2D.js"))),"map-notes":()=>r().then((()=>import("./layers/MapNotesLayerView2D.js"))),media:()=>r().then((()=>import("./layers/MediaLayerView2D.js"))),"ogc-feature":()=>r().then((()=>import("./layers/OGCFeatureLayerView2D.js"))),"open-street-map":a,"oriented-imagery":t,route:()=>r().then((()=>import("./layers/RouteLayerView2D.js"))),stream:()=>r().then((()=>import("./layers/StreamLayerView2D.js"))),"subtype-group":()=>r().then((()=>import("./layers/SubtypeGroupLayerView2D.js"))),tile:a,"vector-tile":()=>r().then((()=>import("./layers/VectorTileLayerView2D.js"))),video:()=>r().then((()=>import("./layers/VideoLayerView2D.js"))),wcs:()=>r().then((()=>import("./layers/ImageryTileLayerView2D.js"))),"web-tile":a,wfs:t,wms:()=>r().then((()=>import("./layers/WMSLayerView2D.js"))),wmts:()=>r().then((()=>import("./layers/WMTSLayerView2D.js"))),"line-of-sight":null,"base-elevation":null,"building-scene":null,dimension:null,elevation:null,"integrated-mesh":null,"integrated-mesh-3dtiles":null,"point-cloud":null,viewshed:null,voxel:null,scene:null,unknown:null,unsupported:null};function s(r){const a=r.declaredClass?r.declaredClass.slice(r.declaredClass.lastIndexOf(".")+1):"Unknown",t=a.replaceAll(/([a-z])([A-Z])/g,"$1-$2").toLowerCase();return new e(`${t}:view-not-supported`,`${a} is not supported in 2D`)}const l={hasLayerViewModule:e=>null!=i[e.type],importLayerView:e=>{const r=i[e.type];if(null==r)throw s(e);return r(e)}};export{l as layerView2DImporter};
5
+ import e from"../../core/Error.js";function r(){return Promise.all([import("./webglDeps.js"),import("./mapViewDeps.js")])}const a=()=>r().then((()=>import("./layers/TileLayerView2D.js"))),t=()=>r().then((()=>import("./layers/FeatureLayerView2D.js"))),i={"base-dynamic":()=>r().then((()=>import("./layers/BaseDynamicLayerView2D.js"))),"base-tile":a,"bing-maps":a,catalog:()=>r().then((()=>import("./layers/CatalogLayerView2D.js"))),"catalog-dynamic-group":()=>r().then((()=>import("./layers/CatalogDynamicGroupLayerView2D.js"))),"catalog-footprint":()=>r().then((()=>import("./layers/CatalogFootprintLayerView2D.js"))),csv:t,"geo-rss":()=>r().then((()=>import("./layers/GeoRSSLayerView2D.js"))),feature:t,geojson:t,graphics:()=>r().then((()=>import("./layers/GraphicsLayerView2D.js"))),group:()=>r().then((()=>import("./layers/GroupLayerView2D.js"))),imagery:()=>r().then((()=>import("./layers/ImageryLayerView2D.js"))),"imagery-tile":()=>r().then((()=>import("./layers/ImageryTileLayerView2D.js"))),kml:()=>r().then((()=>import("./layers/KMLLayerView2D.js"))),"knowledge-graph":()=>r().then((()=>import("./layers/KnowledgeGraphLayerView2D.js"))),"link-chart":()=>r().then((()=>import("./layers/KnowledgeGraphLayerView2D.js"))),"knowledge-graph-sublayer":t,"map-image":()=>r().then((()=>import("./layers/MapImageLayerView2D.js"))),"map-notes":()=>r().then((()=>import("./layers/MapNotesLayerView2D.js"))),media:()=>r().then((()=>import("./layers/MediaLayerView2D.js"))),"ogc-feature":()=>r().then((()=>import("./layers/OGCFeatureLayerView2D.js"))),"open-street-map":a,"oriented-imagery":t,route:()=>r().then((()=>import("./layers/RouteLayerView2D.js"))),stream:()=>r().then((()=>import("./layers/StreamLayerView2D.js"))),"subtype-group":()=>r().then((()=>import("./layers/SubtypeGroupLayerView2D.js"))),tile:a,"vector-tile":()=>r().then((()=>import("./layers/VectorTileLayerView2D.js"))),video:()=>r().then((()=>import("./layers/VideoLayerView2D.js"))),wcs:()=>r().then((()=>import("./layers/ImageryTileLayerView2D.js"))),"web-tile":a,wfs:t,wms:()=>r().then((()=>import("./layers/WMSLayerView2D.js"))),wmts:()=>r().then((()=>import("./layers/WMTSLayerView2D.js"))),"line-of-sight":null,"base-elevation":null,"building-scene":null,dimension:null,elevation:null,focusArea:null,"integrated-mesh":null,"integrated-mesh-3dtiles":null,"point-cloud":null,viewshed:null,voxel:null,scene:null,unknown:null,unsupported:null};function s(r){const a=r.declaredClass?r.declaredClass.slice(r.declaredClass.lastIndexOf(".")+1):"Unknown",t=a.replaceAll(/([a-z])([A-Z])/g,"$1-$2").toLowerCase();return new e(`${t}:view-not-supported`,`${a} is not supported in 2D`)}const l={hasLayerViewModule:e=>null!=i[e.type],importLayerView:e=>{const r=i[e.type];if(null==r)throw s(e);return r(e)}};export{l as layerView2DImporter};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.31/esri/copyright.txt for details.
4
4
  */
5
- import i from"../../../core/Collection.js";import{HighlightGroup as t}from"./HighlightGroup.js";import o from"./HighlightOptions.js";const n=i.ofType(t);function e(){return new n([{name:"default",options:new o},{name:"popup",options:new o({color:"teal"})},{name:"temporary",options:new o({color:"yellow"})}])}function h(i){i.highlights||(i.highlights=new n([{name:"default",options:new o}]));const t=i.highlights.findIndex((i=>"default"===i.name));return i.highlights.items[t].options}function s(i,t){if(!i.highlights){if(!t)return;i.highlights=new n([{name:"default",options:new o}])}const e=i.highlights.findIndex((i=>"default"===i.name));t?i.highlights.items[e].options=t:i.highlights.removeAt(e)}export{e as createInitialHighlightGroups,h as getDefaultHighlightOptions,s as setDefaultHighlightOptions};
5
+ import i from"../../../core/Collection.js";import{HighlightGroup as t}from"./HighlightGroup.js";import n from"./HighlightOptions.js";const o=i.ofType(t);function e(){return new o([{name:"default",options:new n},{name:"popup",options:new n({color:"teal"})},{name:"temporary",options:new n({color:"yellow"})}])}function h(i){if(!i.highlights)return null;const t=i.highlights.findIndex((i=>"default"===i.name));return-1===t?null:i.highlights.items[t].options}function l(i,t){if(!i.highlights){if(!t)return;i.highlights=new o([{name:"default",options:new n}])}const e=i.highlights.findIndex((i=>"default"===i.name));t?i.highlights.items[e].options=t:i.highlights.removeAt(e)}export{e as createInitialHighlightGroups,h as getDefaultHighlightOptions,l as setDefaultHighlightOptions};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.31/esri/copyright.txt for details.
4
4
  */
5
- import{deg2rad as e}from"../../../../../core/mathUtils.js";import{createLength as t,toUnit as s,createArea as i}from"../../../../../core/quantityUtils.js";import{lengthUnitFromSpatialReference as o,areaUnitFromSpatialReference as n}from"../../../../../core/unitUtils.js";import{set as r,distance as h}from"../../../../../core/libs/gl-matrix-2/math/vec2.js";import{create as a}from"../../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{p as l,c as d,b as g,k as c,f as p,m,j as u,g as _,n as f}from"../../../../../chunks/vec32.js";import{create as S}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{create as L}from"../../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{getReferenceEllipsoid as C}from"../../../../../geometry/ellipsoidUtils.js";import{canProjectWithoutEngine as M}from"../../../../../geometry/projection.js";import{getSphericalPCPF as j}from"../../../../../geometry/spatialReferenceEllipsoidUtils.js";import{projectDirection as P}from"../../../../../geometry/projection/projectDirection.js";import{projectPointToVector as R}from"../../../../../geometry/projection/projectPointToVector.js";import{projectVectorToVector as U}from"../../../../../geometry/projection/projectVectorToVector.js";import{Axis as A}from"../../../../../geometry/support/Axis.js";import{compactIndices as v}from"../../../../../geometry/support/Indices.js";import{segmentIntersects as V}from"../../../../../geometry/support/intersectsBase.js";import{c as I}from"../../../../../chunks/sphere.js";import{areaPoints2d as w}from"../../../../../geometry/support/triangle.js";import{MeasurementMode as W}from"../../interfaces.js";import{bestFitPlane as F,fitHemisphere as y,triangleAreaGeodesic as G,planePointDistance as x,boundingSphere as T}from"../../support/measurementUtils.js";import{getElevationAtPoint as z}from"../../../support/ElevationProvider.js";import{midpoint3d as b,makeOrthonormal as q,tangentFrame as E}from"../../../support/mathUtils.js";import{triangulate as k}from"../../../../support/euclideanAreaMeasurementUtils.js";import{euclideanDistanceBetweenPoints as B}from"../../../../support/euclideanLengthMeasurementUtils.js";import{geodesicDistance as D,geodesicDistanceBetweenPoints as H}from"../../../../support/geodesicLengthMeasurementUtils.js";import{supportsGeodesicMeasurement as X}from"../../../../support/geodesicMeasurementUtils.js";import{computeEuclideanMeasurementSR as Z}from"../../../../support/measurementUtils.js";class J{get numVertices(){return this._length}get hasStagedVertex(){return this._hasCursorPoint}constructor(e){this.validMeasurement=!1,this.positionsWorld=[],this.positionsRender=[],this.positionsFittedWorld=[],this.positionsFittedRender=[],this.positionsGeodesic=[],this.positionsSpherical=[],this.positionsStereographic=[],this.pathSegmentLengths=[],this.geodesicPathSegmentLengths=[],this.perimeterSegmentLengths=[],this.intersectingSegments=new Set,this.geodesicIntersectingSegments=new Set,this.triangleIndices=null,this.geodesicTriangleIndices=null,this.areaCentroidWorldCoords=S(),this.areaCentroidRenderCoords=S(),this.geodesicAreaCentroidRenderCoords=S(),this.fittingMode=null,this.area=null,this.geodesicArea=null,this.pathLength=null,this.geodesicPathLength=null,this.perimeterLength=null,this._length=0,this._centroidRenderCoords=S(),this._planeWorldCoords=L(),this._worldUp=S(),this._worldTangent=S(),this._frame=[S(),S(),S()],this._pathVersion=-1,this._hasCursorPoint=!1,this._mode=null,this._tempU=S(),this._tempV=S(),this._tempVec3=S(),this._tempSphere=I(),this._sceneView=e;const t=Z(e.spatialReference);this._measurementSR=t,this._lengthMeasurementUnit=o(t)??"meters",this._areaMeasurementUnit=n(t)??"square-meters"}update(e,t,s,i,o,n){const r=null!=t,h=this._pathVersion===e.version,a=this._hasCursorPoint===r,l=this._mode===o;return!(h&&!n&&a&&l&&e.isValidPolygon)&&(this._pathVersion=e.version,this._hasCursorPoint=r,this._updateCursorSegmentLength(e,t),this._update(e,t,s,i,o),!0)}_update(e,s,i,o,n){const r=this._sceneView.renderSpatialReference,h=this._measurementSR,a=i.spatialReference;let l=e.numVertices;const d=!(null==s||s.equals(e.lastPoint)||l>2&&s.equals(e.firstPoint));d&&(l+=1);const g=!e.polygonIsClosed&&l>2,c=e.polygonIsClosed||g;this._resize(l);const p=j(a),m=null!=a&&X(a)?a:null,u=null!=m&&M(a,p),{positionsGeodesic:_,positionsWorld:S,positionsRender:L,positionsSpherical:C}=this,P=(e,t)=>{K(i.elevationProvider,e),R(e,S[t],h),R(e,L[t],r),u&&(R(e,_[t],m),R(e,C[t],p),f(C[t],C[t]))};e.forEachVertexPosition(((e,t)=>P(e,t))),d&&P(s,l-1);const U=this._updatePathLengths(c);if(this.pathLength=this._length>1?t(U,this._lengthMeasurementUnit):null,u){const e=this._updateGeodesicPathLengths(c,m);this.geodesicPathLength=null!=e&&this._length>1?e:null}else this.geodesicPathLength=null;if(this._updateMode(n),!c)return this.area=null,this.geodesicArea=null,this.perimeterLength=null,this.triangleIndices=null,this.geodesicTriangleIndices=null,this.intersectingSegments.clear(),this.geodesicIntersectingSegments.clear(),void(this.validMeasurement=!1);this._updateAreaAndPerimeterLength(i,r,h,o),u&&this._updateGeodesicArea(i,m),this.validMeasurement=!0}getData(){return{validMeasurement:this.validMeasurement,numVertices:this.numVertices,hasStagedVertex:this.hasStagedVertex,positionsRender:this.positionsRender,positionsFittedWorld:this.positionsFittedWorld,positionsFittedRender:this.positionsFittedRender,intersectingSegments:this.intersectingSegments,geodesicIntersectingSegments:this.geodesicIntersectingSegments,triangleIndices:this.triangleIndices,geodesicTriangleIndices:this.geodesicTriangleIndices,areaCentroidRenderCoords:this.areaCentroidRenderCoords,geodesicAreaCentroidRenderCoords:this.geodesicAreaCentroidRenderCoords,area:this.area,geodesicArea:this.geodesicArea,pathLength:this.pathLength,geodesicPathLength:this.geodesicPathLength,perimeterLength:this.perimeterLength,actualMeasurementMode:this.actualMeasurementMode}}_resize(e){for(e<this._length&&(this.positionsWorld.length=e,this.positionsRender.length=e,this.positionsFittedWorld.length=e,this.positionsFittedRender.length=e,this.positionsGeodesic.length=e,this.positionsSpherical.length=e,this.positionsStereographic.length=e,this.pathSegmentLengths.length=e,this.geodesicPathSegmentLengths.length=e,this.perimeterSegmentLengths.length=e,this._length=e);this._length<e;)this.positionsWorld.push(S()),this.positionsRender.push(S()),this.positionsFittedWorld.push(a()),this.positionsFittedRender.push(S()),this.positionsGeodesic.push(S()),this.positionsSpherical.push(S()),this.positionsStereographic.push(a()),this.pathSegmentLengths.push(0),this.geodesicPathSegmentLengths.push(0),this.perimeterSegmentLengths.push(0),++this._length}_updatePathLengths(e){const t=this.positionsWorld,s=this.pathSegmentLengths;let i=0;const o=this._length;for(let n=0;n<o;++n){const r=s[n]=l(t[n],t[(n+1)%o]);(n<o-1||e)&&(i+=r)}return i}_updateGeodesicPathLengths(e,i){const o=this.positionsGeodesic,n=this.geodesicPathSegmentLengths;let r=0;const h=this._length;for(let t=0;t<h;++t){const a=D(o[t],o[(t+1)%h],i);if(null==a)return null;const l=s(a,"meters").value,d=n[t]=l;(t<h-1||e)&&(r+=d)}return t(r,"meters")}_updateAreaAndPerimeterLength(e,t,s,i){const o=e.renderCoordsHelper,n=this.positionsWorld,h=this.positionsRender,a=this.positionsFittedWorld,l=this.positionsFittedRender,f=this._planeWorldCoords,S=this._centroidRenderCoords;b(h,S),o.worldUpAtPosition(S,this._worldUp),o.worldBasisAtPosition(S,A.X,this._worldTangent),P(S,this._worldUp,t,this._worldUp,s),P(S,this._worldTangent,t,this._worldTangent,s),n.length>2&&F(n,f),this.fittingMode=this._selectFittingMode(f,n,this._worldUp,i);let L=0;if("horizontal"===this.fittingMode){let e=-1/0;h.forEach(((t,s)=>{const i=o.getAltitude(h[s]);i>e&&(e=i,L=s)}))}const C=n[L];let M=f,j=this._worldTangent;"horizontal"===this.fittingMode?M=this._worldUp:"vertical"===this.fittingMode&&(M=this._tempVec3,j=this._worldUp,q(f,this._worldUp,M)),d(this._frame[2],M),q(j,M,this._frame[0]),g(this._frame[1],this._frame[0],this._frame[2]),c(this._frame[1],this._frame[1]);const R=this._tempVec3,v=this._tempU,V=this._tempV;for(let d=0;d<this._length;++d){const e=a[d],i=l[d];p(R,n[d],C),r(e,m(this._frame[0],R),m(this._frame[1],R)),u(v,this._frame[0],e[0]),u(V,this._frame[1],e[1]),_(R,v,V),_(R,R,C),U(R,s,i,t)}this.perimeterLength=this._length>0?this._updatePerimeterLengths():null,b(l,this.areaCentroidRenderCoords),U(this.areaCentroidRenderCoords,t,this.areaCentroidWorldCoords,s),this._updateIntersectingSegments(),this.area=0===this.intersectingSegments.size?this._computeArea():null}_updateGeodesicArea(e,t){const{renderCoordsHelper:s,spatialReference:i}=e,{positionsSpherical:o,positionsStereographic:n}=this,h=this._tempVec3,a=y(o,h);if(!a)return void(this.geodesicArea=null);const l=this._tempU,d=this._tempV;E(h,l,d);for(let g=0;g<this._length;++g){const e=m(o[g],l),t=m(o[g],d),s=m(o[g],h);r(n[g],e/s,t/s)}u(h,h,C(i).radius),s.toRenderCoords(h,j(i),this.geodesicAreaCentroidRenderCoords),this._updateGeodesicIntersectingSegments(),this.geodesicArea=a&&0===this.geodesicIntersectingSegments.size?this._computeGeodesicArea(t):null}_updatePerimeterLengths(){const e=this.positionsFittedWorld,s=this.perimeterSegmentLengths;let i=0;for(let t=0;t<this._length;++t){i+=s[t]=h(e[t],e[(t+1)%this._length])}return t(i,this._lengthMeasurementUnit)}_updateIntersectingSegments(){const e=this.positionsFittedWorld,t=this.intersectingSegments;t.clear();for(let s=0;s<this._length;++s)for(let i=s+2;i<this._length;++i){if((i+1)%this._length===s)continue;const o=e[s],n=e[(s+1)%this._length],r=e[i],h=e[(i+1)%this._length];V(o,n,r,h)&&(t.add(s),t.add(i))}}_computeArea(){const e=this.positionsFittedWorld,t=this.triangleIndices=v(k(e));let s=0;for(let i=0;i<t.length;i+=3)s+=w(e[t[i]],e[t[i+1]],e[t[i+2]]);return i(s,this._areaMeasurementUnit)}_updateGeodesicIntersectingSegments(){const e=this.positionsStereographic,t=this.geodesicIntersectingSegments;t.clear();for(let s=0;s<this._length;++s)for(let i=s+2;i<this._length;++i){if((i+1)%this._length===s)continue;const o=e[s],n=e[(s+1)%this._length],r=e[i],h=e[(i+1)%this._length];V(o,n,r,h)&&(t.add(s),t.add(i))}}_computeGeodesicArea(e){const t=this.positionsGeodesic,o=this.positionsStereographic,n=this.geodesicTriangleIndices=v(k(o));let r=0;for(let i=0;i<n.length;i+=3){const o=G(t[n[i]],t[n[i+1]],t[n[i+2]],e);if(null==o)return null;r+=s(o,"square-meters").value}return i(r,"square-meters")}_selectFittingMode(t,s,i,o){const n=s.map((e=>Math.abs(x(t,e)))).reduce(((e,t)=>Math.max(e,t)),0);T(s,this._tempSphere);const r=n/(2*this._tempSphere[3]),h=r<o.maxRelativeErrorCoplanar,a=r<o.maxRelativeErrorAlmostCoplanar;let l="horizontal";if(h)l="oblique";else if(a){l=Math.abs(m(i,t))>Math.cos(e(o.verticalAngleThreshold))?"horizontal":"vertical"}return l}_updateCursorSegmentLength(e,t){const s=e.lastPoint;e.isValidPolygon||null==s||null==t?(this.geodesicStagedSegmentLength=null,this.stagedSegmentLength=null):(this.geodesicStagedSegmentLength=H(s,t),this.stagedSegmentLength=B(s,t)?.direct)}_updateMode(e){if(e===W.Auto){this.actualMeasurementMode="euclidean";let e=0;null!=this.geodesicPathLength&&(e+=this.geodesicPathLength.value),e>N&&(this.actualMeasurementMode="geodesic")}else this.actualMeasurementMode=e===W.Euclidean?"euclidean":"geodesic";null==this.geodesicPathLength&&(this.actualMeasurementMode="euclidean"),this._mode=e}}function K(e,t){t.hasZ||(t.z=z(e,t,"ground")??0)}const N=1e5;export{J as MeasurementDataManager};
5
+ import{deg2rad as e}from"../../../../../core/mathUtils.js";import{createLength as t,toUnit as s,createArea as i}from"../../../../../core/quantityUtils.js";import{lengthUnitFromSpatialReference as o,areaUnitFromSpatialReference as n}from"../../../../../core/unitUtils.js";import{set as r,distance as h}from"../../../../../core/libs/gl-matrix-2/math/vec2.js";import{create as a}from"../../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{p as l,c as d,b as g,k as c,f as p,l as m,j as u,g as _,n as f}from"../../../../../chunks/vec32.js";import{create as S}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{create as L}from"../../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{getReferenceEllipsoid as C}from"../../../../../geometry/ellipsoidUtils.js";import{canProjectWithoutEngine as M}from"../../../../../geometry/projection.js";import{getSphericalPCPF as j}from"../../../../../geometry/spatialReferenceEllipsoidUtils.js";import{projectDirection as P}from"../../../../../geometry/projection/projectDirection.js";import{projectPointToVector as R}from"../../../../../geometry/projection/projectPointToVector.js";import{projectVectorToVector as U}from"../../../../../geometry/projection/projectVectorToVector.js";import{Axis as A}from"../../../../../geometry/support/Axis.js";import{compactIndices as v}from"../../../../../geometry/support/Indices.js";import{segmentIntersects as V}from"../../../../../geometry/support/intersectsBase.js";import{c as I}from"../../../../../chunks/sphere.js";import{areaPoints2d as w}from"../../../../../geometry/support/triangle.js";import{MeasurementMode as W}from"../../interfaces.js";import{bestFitPlane as F,fitHemisphere as y,triangleAreaGeodesic as G,planePointDistance as x,boundingSphere as T}from"../../support/measurementUtils.js";import{getElevationAtPoint as z}from"../../../support/ElevationProvider.js";import{midpoint3d as b,makeOrthonormal as q,tangentFrame as E}from"../../../support/mathUtils.js";import{triangulate as k}from"../../../../support/euclideanAreaMeasurementUtils.js";import{euclideanDistanceBetweenPoints as B}from"../../../../support/euclideanLengthMeasurementUtils.js";import{geodesicDistance as D,geodesicDistanceBetweenPoints as H}from"../../../../support/geodesicLengthMeasurementUtils.js";import{supportsGeodesicMeasurement as X}from"../../../../support/geodesicMeasurementUtils.js";import{computeEuclideanMeasurementSR as Z}from"../../../../support/measurementUtils.js";class J{get numVertices(){return this._length}get hasStagedVertex(){return this._hasCursorPoint}constructor(e){this.validMeasurement=!1,this.positionsWorld=[],this.positionsRender=[],this.positionsFittedWorld=[],this.positionsFittedRender=[],this.positionsGeodesic=[],this.positionsSpherical=[],this.positionsStereographic=[],this.pathSegmentLengths=[],this.geodesicPathSegmentLengths=[],this.perimeterSegmentLengths=[],this.intersectingSegments=new Set,this.geodesicIntersectingSegments=new Set,this.triangleIndices=null,this.geodesicTriangleIndices=null,this.areaCentroidWorldCoords=S(),this.areaCentroidRenderCoords=S(),this.geodesicAreaCentroidRenderCoords=S(),this.fittingMode=null,this.area=null,this.geodesicArea=null,this.pathLength=null,this.geodesicPathLength=null,this.perimeterLength=null,this._length=0,this._centroidRenderCoords=S(),this._planeWorldCoords=L(),this._worldUp=S(),this._worldTangent=S(),this._frame=[S(),S(),S()],this._pathVersion=-1,this._hasCursorPoint=!1,this._mode=null,this._tempU=S(),this._tempV=S(),this._tempVec3=S(),this._tempSphere=I(),this._sceneView=e;const t=Z(e.spatialReference);this._measurementSR=t,this._lengthMeasurementUnit=o(t)??"meters",this._areaMeasurementUnit=n(t)??"square-meters"}update(e,t,s,i,o,n){const r=null!=t,h=this._pathVersion===e.version,a=this._hasCursorPoint===r,l=this._mode===o;return!(h&&!n&&a&&l&&e.isValidPolygon)&&(this._pathVersion=e.version,this._hasCursorPoint=r,this._updateCursorSegmentLength(e,t),this._update(e,t,s,i,o),!0)}_update(e,s,i,o,n){const r=this._sceneView.renderSpatialReference,h=this._measurementSR,a=i.spatialReference;let l=e.numVertices;const d=!(null==s||s.equals(e.lastPoint)||l>2&&s.equals(e.firstPoint));d&&(l+=1);const g=!e.polygonIsClosed&&l>2,c=e.polygonIsClosed||g;this._resize(l);const p=j(a),m=null!=a&&X(a)?a:null,u=null!=m&&M(a,p),{positionsGeodesic:_,positionsWorld:S,positionsRender:L,positionsSpherical:C}=this,P=(e,t)=>{K(i.elevationProvider,e),R(e,S[t],h),R(e,L[t],r),u&&(R(e,_[t],m),R(e,C[t],p),f(C[t],C[t]))};e.forEachVertexPosition(((e,t)=>P(e,t))),d&&P(s,l-1);const U=this._updatePathLengths(c);if(this.pathLength=this._length>1?t(U,this._lengthMeasurementUnit):null,u){const e=this._updateGeodesicPathLengths(c,m);this.geodesicPathLength=null!=e&&this._length>1?e:null}else this.geodesicPathLength=null;if(this._updateMode(n),!c)return this.area=null,this.geodesicArea=null,this.perimeterLength=null,this.triangleIndices=null,this.geodesicTriangleIndices=null,this.intersectingSegments.clear(),this.geodesicIntersectingSegments.clear(),void(this.validMeasurement=!1);this._updateAreaAndPerimeterLength(i,r,h,o),u&&this._updateGeodesicArea(i,m),this.validMeasurement=!0}getData(){return{validMeasurement:this.validMeasurement,numVertices:this.numVertices,hasStagedVertex:this.hasStagedVertex,positionsRender:this.positionsRender,positionsFittedWorld:this.positionsFittedWorld,positionsFittedRender:this.positionsFittedRender,intersectingSegments:this.intersectingSegments,geodesicIntersectingSegments:this.geodesicIntersectingSegments,triangleIndices:this.triangleIndices,geodesicTriangleIndices:this.geodesicTriangleIndices,areaCentroidRenderCoords:this.areaCentroidRenderCoords,geodesicAreaCentroidRenderCoords:this.geodesicAreaCentroidRenderCoords,area:this.area,geodesicArea:this.geodesicArea,pathLength:this.pathLength,geodesicPathLength:this.geodesicPathLength,perimeterLength:this.perimeterLength,actualMeasurementMode:this.actualMeasurementMode}}_resize(e){for(e<this._length&&(this.positionsWorld.length=e,this.positionsRender.length=e,this.positionsFittedWorld.length=e,this.positionsFittedRender.length=e,this.positionsGeodesic.length=e,this.positionsSpherical.length=e,this.positionsStereographic.length=e,this.pathSegmentLengths.length=e,this.geodesicPathSegmentLengths.length=e,this.perimeterSegmentLengths.length=e,this._length=e);this._length<e;)this.positionsWorld.push(S()),this.positionsRender.push(S()),this.positionsFittedWorld.push(a()),this.positionsFittedRender.push(S()),this.positionsGeodesic.push(S()),this.positionsSpherical.push(S()),this.positionsStereographic.push(a()),this.pathSegmentLengths.push(0),this.geodesicPathSegmentLengths.push(0),this.perimeterSegmentLengths.push(0),++this._length}_updatePathLengths(e){const t=this.positionsWorld,s=this.pathSegmentLengths;let i=0;const o=this._length;for(let n=0;n<o;++n){const r=s[n]=l(t[n],t[(n+1)%o]);(n<o-1||e)&&(i+=r)}return i}_updateGeodesicPathLengths(e,i){const o=this.positionsGeodesic,n=this.geodesicPathSegmentLengths;let r=0;const h=this._length;for(let t=0;t<h;++t){const a=D(o[t],o[(t+1)%h],i);if(null==a)return null;const l=s(a,"meters").value,d=n[t]=l;(t<h-1||e)&&(r+=d)}return t(r,"meters")}_updateAreaAndPerimeterLength(e,t,s,i){const o=e.renderCoordsHelper,n=this.positionsWorld,h=this.positionsRender,a=this.positionsFittedWorld,l=this.positionsFittedRender,f=this._planeWorldCoords,S=this._centroidRenderCoords;b(h,S),o.worldUpAtPosition(S,this._worldUp),o.worldBasisAtPosition(S,A.X,this._worldTangent),P(S,this._worldUp,t,this._worldUp,s),P(S,this._worldTangent,t,this._worldTangent,s),n.length>2&&F(n,f),this.fittingMode=this._selectFittingMode(f,n,this._worldUp,i);let L=0;if("horizontal"===this.fittingMode){let e=-1/0;h.forEach(((t,s)=>{const i=o.getAltitude(h[s]);i>e&&(e=i,L=s)}))}const C=n[L];let M=f,j=this._worldTangent;"horizontal"===this.fittingMode?M=this._worldUp:"vertical"===this.fittingMode&&(M=this._tempVec3,j=this._worldUp,q(f,this._worldUp,M)),d(this._frame[2],M),q(j,M,this._frame[0]),g(this._frame[1],this._frame[0],this._frame[2]),c(this._frame[1],this._frame[1]);const R=this._tempVec3,v=this._tempU,V=this._tempV;for(let d=0;d<this._length;++d){const e=a[d],i=l[d];p(R,n[d],C),r(e,m(this._frame[0],R),m(this._frame[1],R)),u(v,this._frame[0],e[0]),u(V,this._frame[1],e[1]),_(R,v,V),_(R,R,C),U(R,s,i,t)}this.perimeterLength=this._length>0?this._updatePerimeterLengths():null,b(l,this.areaCentroidRenderCoords),U(this.areaCentroidRenderCoords,t,this.areaCentroidWorldCoords,s),this._updateIntersectingSegments(),this.area=0===this.intersectingSegments.size?this._computeArea():null}_updateGeodesicArea(e,t){const{renderCoordsHelper:s,spatialReference:i}=e,{positionsSpherical:o,positionsStereographic:n}=this,h=this._tempVec3,a=y(o,h);if(!a)return void(this.geodesicArea=null);const l=this._tempU,d=this._tempV;E(h,l,d);for(let g=0;g<this._length;++g){const e=m(o[g],l),t=m(o[g],d),s=m(o[g],h);r(n[g],e/s,t/s)}u(h,h,C(i).radius),s.toRenderCoords(h,j(i),this.geodesicAreaCentroidRenderCoords),this._updateGeodesicIntersectingSegments(),this.geodesicArea=a&&0===this.geodesicIntersectingSegments.size?this._computeGeodesicArea(t):null}_updatePerimeterLengths(){const e=this.positionsFittedWorld,s=this.perimeterSegmentLengths;let i=0;for(let t=0;t<this._length;++t){i+=s[t]=h(e[t],e[(t+1)%this._length])}return t(i,this._lengthMeasurementUnit)}_updateIntersectingSegments(){const e=this.positionsFittedWorld,t=this.intersectingSegments;t.clear();for(let s=0;s<this._length;++s)for(let i=s+2;i<this._length;++i){if((i+1)%this._length===s)continue;const o=e[s],n=e[(s+1)%this._length],r=e[i],h=e[(i+1)%this._length];V(o,n,r,h)&&(t.add(s),t.add(i))}}_computeArea(){const e=this.positionsFittedWorld,t=this.triangleIndices=v(k(e));let s=0;for(let i=0;i<t.length;i+=3)s+=w(e[t[i]],e[t[i+1]],e[t[i+2]]);return i(s,this._areaMeasurementUnit)}_updateGeodesicIntersectingSegments(){const e=this.positionsStereographic,t=this.geodesicIntersectingSegments;t.clear();for(let s=0;s<this._length;++s)for(let i=s+2;i<this._length;++i){if((i+1)%this._length===s)continue;const o=e[s],n=e[(s+1)%this._length],r=e[i],h=e[(i+1)%this._length];V(o,n,r,h)&&(t.add(s),t.add(i))}}_computeGeodesicArea(e){const t=this.positionsGeodesic,o=this.positionsStereographic,n=this.geodesicTriangleIndices=v(k(o));let r=0;for(let i=0;i<n.length;i+=3){const o=G(t[n[i]],t[n[i+1]],t[n[i+2]],e);if(null==o)return null;r+=s(o,"square-meters").value}return i(r,"square-meters")}_selectFittingMode(t,s,i,o){const n=s.map((e=>Math.abs(x(t,e)))).reduce(((e,t)=>Math.max(e,t)),0);T(s,this._tempSphere);const r=n/(2*this._tempSphere[3]),h=r<o.maxRelativeErrorCoplanar,a=r<o.maxRelativeErrorAlmostCoplanar;let l="horizontal";if(h)l="oblique";else if(a){l=Math.abs(m(i,t))>Math.cos(e(o.verticalAngleThreshold))?"horizontal":"vertical"}return l}_updateCursorSegmentLength(e,t){const s=e.lastPoint;e.isValidPolygon||null==s||null==t?(this.geodesicStagedSegmentLength=null,this.stagedSegmentLength=null):(this.geodesicStagedSegmentLength=H(s,t),this.stagedSegmentLength=B(s,t)?.direct)}_updateMode(e){if(e===W.Auto){this.actualMeasurementMode="euclidean";let e=0;null!=this.geodesicPathLength&&(e+=this.geodesicPathLength.value),e>N&&(this.actualMeasurementMode="geodesic")}else this.actualMeasurementMode=e===W.Euclidean?"euclidean":"geodesic";null==this.geodesicPathLength&&(this.actualMeasurementMode="euclidean"),this._mode=e}}function K(e,t){t.hasZ||(t.z=z(e,t,"ground")??0)}const N=1e5;export{J as MeasurementDataManager};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.31/esri/copyright.txt for details.
4
4
  */
5
- import"../../../../geometry.js";import{LengthDimensionMeasureType as e}from"../../../../analysis/dimensionUtils.js";import"../../../../core/has.js";import{e as t,j as n,m as i,f as o,q as r}from"../../../../chunks/vec32.js";import{sv3d as a}from"../../../../geometry/support/vectorStacks.js";import{automaticHeadingFromCamera as s}from"./lengthDimensionManipulatorUtils.js";import{isGeodesicDimension as l,directUp as c,directStartToEnd as d}from"./lengthDimensionUtils.js";import{constraintThresholdPx as m}from"./settings.js";import u from"../../../../geometry/Point.js";var P;function p(e,t){return{enabled:t.effectiveFeatureEnabled,elevationAlignedStartPoint:e.elevationAlignedStartPoint,elevationAlignedEndPoint:e.elevationAlignedEndPoint,geometry:e.geometry}}function f(e,s){if(l(e))return P.Direct;if(!e.enabled)return null;const{geometry:u}=e;if(null==u||t(u.directSegment.startRenderSpace,u.directSegment.endRenderSpace))return null;const{camera:p}=s.state,f=c(a.get(),u,s.renderCoordsHelper),g=d(a.get(),u),S=n(a.get(),f,i(g,f)),v=o(a.get(),g,S),y=r(v),A=r(S),{startRenderSpace:R,endRenderSpace:j}=u.directSegment,z=Math.max(p.computeScreenPixelSizeAt(R)*m,p.computeScreenPixelSizeAt(j)*m)**2;return y<z?P.Vertical:A<z?P.Horizontal:null}function g(e,t,{constraint:n,view:i}){const{unconstrainedGeometry:o}=e;if(null==o)return;const{renderCoordsHelper:r,spatialReference:a}=i,{startRenderSpace:s,endRenderSpace:l}=o.directSegment,c=r.fromRenderCoords(s,new u({spatialReference:a})),d=r.fromRenderCoords(l,new u({spatialReference:a}));let m;m="start"===t?{startPoint:c}:{endPoint:d},S(e,m,{constraint:n,elevationAlignedStartPoint:e.elevationAlignedStartPoint,elevationAlignedEndPoint:e.elevationAlignedEndPoint,unconstrainedGeometry:o,view:i})}function S(t,n,i){const{constraint:o,elevationAlignedStartPoint:r,elevationAlignedEndPoint:a,unconstrainedGeometry:l,view:c}=i,{dimension:d,previousConstraint:m,preConstraintProperties:u}=t;if(null==r||null==a)return;const p=()=>{"startPoint"in n?d.startPoint=n.startPoint:"endPoint"in n&&(d.endPoint=n.endPoint)};if(null==o)p(),null!=m&&null!=u&&(d.measureType=u.measureType,d.orientation=u.orientation);else switch(d.measureType=e.Direct,o){case P.Horizontal:if(o!==m&&(d.orientation=0),"startPoint"in n){const e=n.startPoint;null!=e&&(e.z=a.z),d.startPoint=e}else if("endPoint"in n){const e=n.endPoint;null!=e&&(e.z=r.z),d.endPoint=e}break;case P.Vertical:if(o!==m&&(d.orientation=s(l,c)),"startPoint"in n){const e=n.startPoint;null!=e&&(e.x=a.x,e.y=a.y),d.startPoint=e}else if("endPoint"in n){const e=n.endPoint;null!=e&&(e.x=r.x,e.y=r.y),d.endPoint=e}break;case P.Direct:o!==m&&null!=u&&(d.orientation=u.orientation),p()}t.previousConstraint=o,t.unconstrainedGeometry=l}!function(e){e[e.Horizontal=0]="Horizontal",e[e.Vertical=1]="Vertical",e[e.Direct=2]="Direct"}(P||(P={}));export{P as LengthDimensionConstraint,S as applyConstraint,f as computeConstraint,p as constraintDependencies,g as reapplyConstraint};
5
+ import"../../../../geometry.js";import{LengthDimensionMeasureType as e}from"../../../../analysis/dimensionUtils.js";import"../../../../core/has.js";import{e as t,j as n,l as i,f as o,q as r}from"../../../../chunks/vec32.js";import{sv3d as a}from"../../../../geometry/support/vectorStacks.js";import{automaticHeadingFromCamera as s}from"./lengthDimensionManipulatorUtils.js";import{isGeodesicDimension as l,directUp as c,directStartToEnd as d}from"./lengthDimensionUtils.js";import{constraintThresholdPx as m}from"./settings.js";import u from"../../../../geometry/Point.js";var P;function p(e,t){return{enabled:t.effectiveFeatureEnabled,elevationAlignedStartPoint:e.elevationAlignedStartPoint,elevationAlignedEndPoint:e.elevationAlignedEndPoint,geometry:e.geometry}}function f(e,s){if(l(e))return P.Direct;if(!e.enabled)return null;const{geometry:u}=e;if(null==u||t(u.directSegment.startRenderSpace,u.directSegment.endRenderSpace))return null;const{camera:p}=s.state,f=c(a.get(),u,s.renderCoordsHelper),g=d(a.get(),u),S=n(a.get(),f,i(g,f)),v=o(a.get(),g,S),y=r(v),A=r(S),{startRenderSpace:R,endRenderSpace:j}=u.directSegment,z=Math.max(p.computeScreenPixelSizeAt(R)*m,p.computeScreenPixelSizeAt(j)*m)**2;return y<z?P.Vertical:A<z?P.Horizontal:null}function g(e,t,{constraint:n,view:i}){const{unconstrainedGeometry:o}=e;if(null==o)return;const{renderCoordsHelper:r,spatialReference:a}=i,{startRenderSpace:s,endRenderSpace:l}=o.directSegment,c=r.fromRenderCoords(s,new u({spatialReference:a})),d=r.fromRenderCoords(l,new u({spatialReference:a}));let m;m="start"===t?{startPoint:c}:{endPoint:d},S(e,m,{constraint:n,elevationAlignedStartPoint:e.elevationAlignedStartPoint,elevationAlignedEndPoint:e.elevationAlignedEndPoint,unconstrainedGeometry:o,view:i})}function S(t,n,i){const{constraint:o,elevationAlignedStartPoint:r,elevationAlignedEndPoint:a,unconstrainedGeometry:l,view:c}=i,{dimension:d,previousConstraint:m,preConstraintProperties:u}=t;if(null==r||null==a)return;const p=()=>{"startPoint"in n?d.startPoint=n.startPoint:"endPoint"in n&&(d.endPoint=n.endPoint)};if(null==o)p(),null!=m&&null!=u&&(d.measureType=u.measureType,d.orientation=u.orientation);else switch(d.measureType=e.Direct,o){case P.Horizontal:if(o!==m&&(d.orientation=0),"startPoint"in n){const e=n.startPoint;null!=e&&(e.z=a.z),d.startPoint=e}else if("endPoint"in n){const e=n.endPoint;null!=e&&(e.z=r.z),d.endPoint=e}break;case P.Vertical:if(o!==m&&(d.orientation=s(l,c)),"startPoint"in n){const e=n.startPoint;null!=e&&(e.x=a.x,e.y=a.y),d.startPoint=e}else if("endPoint"in n){const e=n.endPoint;null!=e&&(e.x=r.x,e.y=r.y),d.endPoint=e}break;case P.Direct:o!==m&&null!=u&&(d.orientation=u.orientation),p()}t.previousConstraint=o,t.unconstrainedGeometry=l}!function(e){e[e.Horizontal=0]="Horizontal",e[e.Vertical=1]="Vertical",e[e.Direct=2]="Direct"}(P||(P={}));export{P as LengthDimensionConstraint,S as applyConstraint,f as computeConstraint,p as constraintDependencies,g as reapplyConstraint};