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

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 (998) hide show
  1. package/Basemap.js +1 -1
  2. package/Color.js +1 -1
  3. package/Ground.js +1 -1
  4. package/Map.js +1 -1
  5. package/PopupTemplate.js +1 -1
  6. package/WebMap.js +1 -1
  7. package/WebScene.js +1 -1
  8. package/analysis/LinearDimension.js +1 -1
  9. package/analysis/SliceAnalysis.js +1 -1
  10. package/applications/SceneViewer/sceneViewerUtils.js +1 -1
  11. package/arcade/Dictionary.js +1 -1
  12. package/arcade/Feature.js +1 -1
  13. package/arcade/featureset/sources/FeatureLayerDynamic.js +1 -1
  14. package/arcade/featureset/support/FeatureSet.js +1 -1
  15. package/assets/esri/core/workers/RemoteClient.js +1 -1
  16. package/assets/esri/core/workers/chunks/{e06461703e6f1acfcfdc.js → 076d1b1101b59af0d389.js} +1 -1
  17. package/assets/esri/core/workers/chunks/0b72d123386dc4ec7538.js +1 -0
  18. package/assets/esri/core/workers/chunks/0d53e575f11198867619.js +1 -0
  19. package/assets/esri/core/workers/chunks/0e6e3cf07c84d9f040c0.js +1 -0
  20. package/assets/esri/core/workers/chunks/105728404ddd9e73d5c9.js +1 -0
  21. package/assets/esri/core/workers/chunks/11106873b009b98e4286.js +1 -0
  22. package/assets/esri/core/workers/chunks/11a7b156591d1feca952.js +1 -0
  23. package/assets/esri/core/workers/chunks/{94325f920a125610e1f5.js → 12feeace7215248be23f.js} +1 -1
  24. package/assets/esri/core/workers/chunks/17be5bd0d1c233d73d7a.js +1 -0
  25. package/assets/esri/core/workers/chunks/1b53bd65407ba5c479d7.js +1 -0
  26. package/assets/esri/core/workers/chunks/1d91aa745b49b2ab36cf.js +1 -0
  27. package/assets/esri/core/workers/chunks/{fd35b69872ac9393924f.js → 1db8bfb1731be3ae320c.js} +1 -1
  28. package/assets/esri/core/workers/chunks/{3433361f09c84b31aec4.js → 2290bd6dc2e6bb136e14.js} +1 -1
  29. package/assets/esri/core/workers/chunks/24217129d492e170f0f0.js +1 -0
  30. package/assets/esri/core/workers/chunks/24e194107e0e5090125b.js +1 -0
  31. package/assets/esri/core/workers/chunks/2a1301a1d0cd4c0c17cf.js +1 -0
  32. package/assets/esri/core/workers/chunks/{178831b0d0bdabcc45e7.js → 2a676221ca1fc8e0cf34.js} +1 -1
  33. package/assets/esri/core/workers/chunks/2aede0d1dcac8592436b.js +1 -0
  34. package/assets/esri/core/workers/chunks/2b93ad626f5e75b97692.js +1 -0
  35. package/assets/esri/core/workers/chunks/2d03210fc6b5884c6bf9.js +1 -0
  36. package/assets/esri/core/workers/chunks/{b10c333abe4f4e52841c.js → 2dfd3def105005fc72c7.js} +1 -1
  37. package/assets/esri/core/workers/chunks/2f8ff35b8ab15c0e39c2.js +1 -0
  38. package/assets/esri/core/workers/chunks/36272141b3c33cb19026.js +1 -0
  39. package/assets/esri/core/workers/chunks/36c8e8de9c3f67d32572.js +1 -0
  40. package/assets/esri/core/workers/chunks/3ab8c6ae2f2713f637b0.js +1 -0
  41. package/assets/esri/core/workers/chunks/3c058381adcfdc407aa1.js +1 -0
  42. package/assets/esri/core/workers/chunks/3f39df1dfc0a685e5f9d.js +1 -0
  43. package/assets/esri/core/workers/chunks/3fd52a03b3126556aee6.js +1 -0
  44. package/assets/esri/core/workers/chunks/4082d8573f41f952c72e.js +1 -0
  45. package/assets/esri/core/workers/chunks/40b11eea270f6688ff9c.js +1 -0
  46. package/assets/esri/core/workers/chunks/4281b4b27f4767cdd3ae.js +1 -0
  47. package/assets/esri/core/workers/chunks/43fcaaeb6fd179e9199b.js +1 -0
  48. package/assets/esri/core/workers/chunks/4c65b27d80b23c0c3101.js +1 -0
  49. package/assets/esri/core/workers/chunks/{a6406a248b7b2ed65f35.js → 4ec7d59b0c814dbaa7a4.js} +1 -1
  50. package/assets/esri/core/workers/chunks/4f378ad6f4299183df85.js +1 -0
  51. package/assets/esri/core/workers/chunks/505b0aa5ee3e5a26c351.js +1 -0
  52. package/assets/esri/core/workers/chunks/509a9cdd0228a730bcea.js +1 -0
  53. package/assets/esri/core/workers/chunks/52255ad573cec0a34720.js +1 -0
  54. package/assets/esri/core/workers/chunks/52d4fdc451a58a858af1.js +1 -0
  55. package/assets/esri/core/workers/chunks/5405f478af3563580926.js +1 -0
  56. package/assets/esri/core/workers/chunks/54577c2522ca3ff08f7e.js +1 -0
  57. package/assets/esri/core/workers/chunks/54d67e450da6ce2641b4.js +1 -0
  58. package/assets/esri/core/workers/chunks/56d3cb0ae0069a8eadde.js +1 -0
  59. package/assets/esri/core/workers/chunks/5b4efe0014162f777534.js +1 -0
  60. package/assets/esri/core/workers/chunks/5baa162351551817838b.js +1 -0
  61. package/assets/esri/core/workers/chunks/5cf2064bfd9d0847d9ec.js +1 -0
  62. package/assets/esri/core/workers/chunks/620dc3c13c345d5aa9f6.js +1 -0
  63. package/assets/esri/core/workers/chunks/7c290763920f52a1f504.js +1 -0
  64. package/assets/esri/core/workers/chunks/7dc266be958e34e81007.js +972 -0
  65. package/assets/esri/core/workers/chunks/7dfd70f4fa1096e56641.js +1 -0
  66. package/assets/esri/core/workers/chunks/7f097de06972a68cd08a.js +1 -0
  67. package/assets/esri/core/workers/chunks/8033531b0cc706b40d86.js +1 -0
  68. package/assets/esri/core/workers/chunks/814234844a056d9f1ddc.js +1 -0
  69. package/assets/esri/core/workers/chunks/83700cdd60ceecc639cd.js +1 -0
  70. package/assets/esri/core/workers/chunks/857df84cea67079a91e5.js +1 -0
  71. package/assets/esri/core/workers/chunks/8793070d288878d6f49b.js +1 -0
  72. package/assets/esri/core/workers/chunks/8865c5cc28df60364e60.js +1 -0
  73. package/assets/esri/core/workers/chunks/{e9f786d4ba3143ed9644.js → 8cc85d1d46dda16ad041.js} +1 -1
  74. package/assets/esri/core/workers/chunks/958a7ef2cbf048819988.js +1 -0
  75. package/assets/esri/core/workers/chunks/967af0aa4dc4da032fdc.js +1 -0
  76. package/assets/esri/core/workers/chunks/9722880bd7f455b2bd07.js +1 -0
  77. package/assets/esri/core/workers/chunks/9d738aab0d907cd09a9d.js +1 -0
  78. package/assets/esri/core/workers/chunks/{86b31ae136f931d7884a.js → 9e6df034d7949880471f.js} +1 -1
  79. package/assets/esri/core/workers/chunks/a056a79f31cddb066f15.js +1 -0
  80. package/assets/esri/core/workers/chunks/a2c9fd78d42df7314a3e.js +1 -0
  81. package/assets/esri/core/workers/chunks/a4dcb50f6622cb1444c8.js +1 -0
  82. package/assets/esri/core/workers/chunks/a6bfbe449b8c2fa5334c.js +1 -0
  83. package/assets/esri/core/workers/chunks/a8ed1a938dc164b401d9.js +1 -0
  84. package/assets/esri/core/workers/chunks/a9a73bc4875a5aeaf1b9.js +1 -0
  85. package/assets/esri/core/workers/chunks/ac0df52b2f2a4874e4ea.js +1 -0
  86. package/assets/esri/core/workers/chunks/{431efa172901ab8e4d53.js → acfa8eb19225f7862b1d.js} +1 -1
  87. package/assets/esri/core/workers/chunks/adae54f116f311d72d97.js +1 -0
  88. package/assets/esri/core/workers/chunks/{718073d13d3de67b629b.js → aeeb364b7c1876f6e7db.js} +1 -1
  89. package/assets/esri/core/workers/chunks/afddfe620e6539991e6b.js +1 -0
  90. package/assets/esri/core/workers/chunks/b02a83845d3da4caee9d.js +1 -0
  91. package/assets/esri/core/workers/chunks/{0d21506b7d4f9afdbb09.js → b3847a6bbd45d813f03c.js} +1 -1
  92. package/assets/esri/core/workers/chunks/b4c23630d6c85f7b59c0.js +1 -0
  93. package/assets/esri/core/workers/chunks/{c318b229911b60fc3cbf.js → b50ae3dc7e43ff452568.js} +1 -1
  94. package/assets/esri/core/workers/chunks/b5ede4df4620097c6528.js +1 -0
  95. package/assets/esri/core/workers/chunks/b7d7ad127f8939cbdec2.js +1 -0
  96. package/assets/esri/core/workers/chunks/bf1d1c02d12b526b0750.js +1 -0
  97. package/assets/esri/core/workers/chunks/c0e6dbecdbd30066a82c.js +1 -0
  98. package/assets/esri/core/workers/chunks/c2a36243eb105d570bff.js +1 -0
  99. package/assets/esri/core/workers/chunks/c8a3a28809542396c6fd.js +1 -0
  100. package/assets/esri/core/workers/chunks/cf1047ad176a25dcd2d6.js +1 -0
  101. package/assets/esri/core/workers/chunks/d03de043d43691665a93.js +1 -0
  102. package/assets/esri/core/workers/chunks/d3fecbaca51ef8844026.js +1 -0
  103. package/assets/esri/core/workers/chunks/dafe120243db6648a4ab.js +1 -0
  104. package/assets/esri/core/workers/chunks/dccc33d87cb7d902f5c7.js +1 -0
  105. package/assets/esri/core/workers/chunks/dd43f5647900ee27af22.js +1 -0
  106. package/assets/esri/core/workers/chunks/{52489e2f7748dc610263.js → dfdd853dd6c023089963.js} +1 -1
  107. package/assets/esri/core/workers/chunks/e6f76f62cf58fb1e67c6.js +1 -0
  108. package/assets/esri/core/workers/chunks/ea73a1d9cad5e1a5d861.js +1 -0
  109. package/assets/esri/core/workers/chunks/{4130ea1f5a9f197168d7.js → ed4519ac9533a4d340f1.js} +1 -1
  110. package/assets/esri/core/workers/chunks/f0e462f5a16852f33225.js +1 -0
  111. package/assets/esri/core/workers/chunks/f13c29bcc71aed8f3a2e.js +1 -0
  112. package/assets/esri/core/workers/chunks/f356e505c36397fda3cf.js +1 -0
  113. package/assets/esri/core/workers/chunks/f55cbaf5a1d6ee6ac171.js +1 -0
  114. package/assets/esri/core/workers/chunks/f6e613ae6812a347a26c.js +1 -0
  115. package/assets/esri/core/workers/chunks/fb3279408bd5323ec612.js +1 -0
  116. package/assets/esri/core/workers/chunks/fdf80a371b7b2a45f1ff.js +1 -0
  117. package/assets/esri/libs/vxl/vxlLayer.wasm +0 -0
  118. package/chunks/ChapmanAtmosphere.glsl.js +15 -15
  119. package/chunks/CheckerBoard.glsl.js +3 -3
  120. package/chunks/Clouds.glsl.js +2 -3
  121. package/chunks/CloudsComposition.glsl.js +3 -3
  122. package/chunks/ColorMaterial.glsl.js +11 -11
  123. package/chunks/DefaultMaterial.glsl.js +26 -26
  124. package/chunks/EdgeShader.glsl.js +3 -3
  125. package/chunks/Fog.glsl.js +6 -6
  126. package/chunks/HUDMaterial.glsl.js +48 -48
  127. package/chunks/HeatmapDensity.glsl.js +7 -7
  128. package/chunks/HighlightApply.glsl.js +3 -3
  129. package/chunks/LineCallout.glsl.js +3 -3
  130. package/chunks/LineMarker.glsl.js +22 -22
  131. package/chunks/MeasurementArrow.glsl.js +4 -4
  132. package/chunks/NativeLine.glsl.js +11 -11
  133. package/chunks/Path.glsl.js +16 -16
  134. package/chunks/Pattern.glsl.js +30 -30
  135. package/chunks/RasterColorizer.glsl.js +4 -4
  136. package/chunks/RealisticTree.glsl.js +20 -20
  137. package/chunks/RibbonLine.glsl.js +39 -39
  138. package/chunks/ShadedColorMaterial.glsl.js +10 -10
  139. package/chunks/ShadowCastVisualize.glsl.js +5 -5
  140. package/chunks/ShadowHighlight.glsl.js +2 -2
  141. package/chunks/SlicePlaneMaterial.glsl.js +3 -3
  142. package/chunks/Stars.glsl.js +2 -2
  143. package/chunks/WaterSurface.glsl.js +20 -20
  144. package/chunks/languageUtils.js +1 -1
  145. package/chunks/persistableUrlUtils.js +1 -1
  146. package/chunks/vec22.js +1 -1
  147. package/chunks/vec2f64.js +1 -1
  148. package/chunks/vec3.js +1 -1
  149. package/chunks/vec33.js +1 -1
  150. package/chunks/vec43.js +1 -1
  151. package/colorUtils.js +1 -1
  152. package/config.js +1 -1
  153. package/core/Accessor.js +1 -1
  154. package/core/AsyncUpdate.js +1 -1
  155. package/core/Clonable.js +1 -1
  156. package/core/Collection.js +1 -1
  157. package/core/HandleOwner.js +1 -1
  158. package/core/Loadable.js +1 -1
  159. package/core/NestedMap.js +1 -1
  160. package/core/accessorSupport/DefaultsStore.js +1 -1
  161. package/core/accessorSupport/Properties.js +1 -1
  162. package/core/accessorSupport/decorators/enumeration.js +1 -1
  163. package/core/accessorSupport/extensions/serializableProperty/reader.js +1 -1
  164. package/core/accessorSupport/extensions/serializableProperty/writePolicyUtils.js +1 -1
  165. package/core/accessorSupport/extensions/serializableProperty/writer.js +1 -1
  166. package/core/accessorSupport/read.js +1 -1
  167. package/core/accessorSupport/tracking.js +1 -1
  168. package/core/accessorSupport/write.js +1 -1
  169. package/core/devEnvironmentUtils.js +1 -1
  170. package/core/has.js +1 -1
  171. package/core/libs/gl-matrix-2/factories/vec2f64.js +1 -1
  172. package/core/libs/gl-matrix-2/math/vec3.js +1 -1
  173. package/core/libs/rbush/PooledRBush.js +1 -1
  174. package/core/promiseUtils.js +1 -1
  175. package/core/reactiveUtils.js +1 -1
  176. package/core/scheduling.js +1 -1
  177. package/core/throttle.js +1 -1
  178. package/core/urlUtils.js +1 -1
  179. package/core/watchUtils.js +1 -1
  180. package/core/workers/RemoteClient.js +1 -1
  181. package/core/workers/WorkerOwner.js +1 -1
  182. package/core/workers/loaderConfig.js +1 -1
  183. package/core/workers/workerFactory.js +1 -1
  184. package/geometry/Mesh.js +1 -1
  185. package/geometry/geometryEngine.js +1 -1
  186. package/geometry/geometryEngineAsync.js +1 -1
  187. package/geometry/projection.js +1 -1
  188. package/geometry/support/axisAngleDegrees.js +1 -1
  189. package/geometry/support/meshUtils/centerAt.js +1 -1
  190. package/geometry/support/meshUtils/deduplicate.js +1 -1
  191. package/geometry/support/meshUtils/elevation.js +1 -1
  192. package/geometry/support/meshUtils/geographicUtils.js +1 -1
  193. package/geometry/support/meshUtils/georeference.js +1 -1
  194. package/geometry/support/meshUtils/loadExternal.js +1 -1
  195. package/geometry/support/meshUtils/loadGLTFMesh.js +1 -1
  196. package/geometry/support/meshUtils/offset.js +1 -1
  197. package/geometry/support/meshUtils/rotate.js +1 -1
  198. package/geometry/support/meshUtils/scale.js +1 -1
  199. package/geometry/support/normalizeUtils.js +1 -1
  200. package/geometry/support/normalizeUtilsCommon.js +1 -1
  201. package/geometry/support/offset.js +1 -1
  202. package/geometry/support/rotate.js +1 -1
  203. package/identity/IdentityManagerBase.js +1 -1
  204. package/identity/IdentityModal.js +1 -1
  205. package/interfaces.d.ts +109 -2
  206. package/intl/locale.js +1 -1
  207. package/intl/messages.js +1 -1
  208. package/kernel.js +1 -1
  209. package/layers/AnalysisLayer.js +1 -1
  210. package/layers/CSVLayer.js +1 -1
  211. package/layers/FeatureLayer.js +1 -1
  212. package/layers/GeoJSONLayer.js +1 -1
  213. package/layers/GeoRSSLayer.js +1 -1
  214. package/layers/ImageryLayer.js +1 -1
  215. package/layers/ImageryTileLayer.js +1 -1
  216. package/layers/Layer.js +1 -1
  217. package/layers/MapImageLayer.js +1 -1
  218. package/layers/MapNotesLayer.js +1 -1
  219. package/layers/OGCFeatureLayer.js +1 -1
  220. package/layers/RouteLayer.js +1 -1
  221. package/layers/SceneLayer.js +1 -1
  222. package/layers/StreamLayer.js +1 -1
  223. package/layers/SubtypeGroupLayer.js +1 -1
  224. package/layers/TileLayer.js +1 -1
  225. package/layers/VectorTileLayer.js +1 -1
  226. package/layers/VoxelLayer.js +1 -1
  227. package/layers/VoxelWasmPerScene.js +1 -1
  228. package/layers/WCSLayer.js +1 -1
  229. package/layers/WFSLayer.js +1 -1
  230. package/layers/WMSLayer.js +1 -1
  231. package/layers/WMTSLayer.js +1 -1
  232. package/layers/buildingSublayers/BuildingComponentSublayer.js +1 -1
  233. package/layers/effects/EffectView.js +1 -1
  234. package/layers/effects/FeatureEffectView.js +1 -1
  235. package/layers/effects/jsonUtils.js +1 -1
  236. package/layers/graphics/OptimizedGeometry.js +1 -1
  237. package/layers/graphics/centroid.js +1 -1
  238. package/layers/graphics/controllers/FeatureTileController3D.js +1 -1
  239. package/layers/graphics/controllers/I3SOnDemandController.js +1 -1
  240. package/layers/graphics/data/QueryEngineResult.js +1 -1
  241. package/layers/graphics/data/StreamFeatureManager.js +1 -1
  242. package/layers/graphics/editingSupport.js +1 -1
  243. package/layers/graphics/objectIdUtils.js +1 -1
  244. package/layers/graphics/sources/CSVSource.js +1 -1
  245. package/layers/graphics/sources/FeatureLayerSource.js +1 -1
  246. package/layers/graphics/sources/GeoJSONSource.js +1 -1
  247. package/layers/graphics/sources/MemorySource.js +1 -1
  248. package/layers/graphics/sources/OGCFeatureSource.js +1 -1
  249. package/layers/graphics/sources/WFSSource.js +1 -1
  250. package/layers/graphics/sources/WFSSourceWorker.js +1 -1
  251. package/layers/graphics/sources/connections/WebSocketConnection.js +1 -1
  252. package/layers/graphics/sources/geojson/GeoJSONSourceWorker.js +1 -1
  253. package/layers/graphics/sources/geojson/geojson.js +1 -1
  254. package/layers/graphics/sources/support/CSVSourceWorker.js +1 -1
  255. package/layers/graphics/sources/support/QueryTask.js +1 -1
  256. package/layers/mixins/APIKeyMixin.js +1 -1
  257. package/layers/mixins/ArcGISImageService.js +1 -1
  258. package/layers/mixins/ArcGISMapService.js +1 -1
  259. package/layers/mixins/ImageryTileMixin.js +1 -1
  260. package/layers/mixins/OperationalLayer.js +1 -1
  261. package/layers/mixins/PortalLayer.js +1 -1
  262. package/layers/mixins/SceneService.js +1 -1
  263. package/layers/mixins/refresh.js +1 -1
  264. package/layers/ogc/dateUtils.js +1 -1
  265. package/layers/ogc/ogcFeatureUtils.js +1 -1
  266. package/layers/ogc/wfsUtils.js +1 -1
  267. package/layers/save/featureLayerUtils.js +1 -1
  268. package/layers/support/ExportImageParameters.js +1 -1
  269. package/layers/support/ExportImageServiceParameters.js +1 -1
  270. package/layers/support/ExportWMSImageParameters.js +1 -1
  271. package/layers/support/FeatureEffect.js +1 -1
  272. package/layers/support/FeatureType.js +1 -1
  273. package/layers/support/FetchAssociatedFeatureLayer.js +1 -1
  274. package/layers/support/LabelClass.js +1 -1
  275. package/layers/support/LayerContingentValuesCache.js +1 -1
  276. package/layers/support/RasterFunction.js +1 -1
  277. package/layers/support/RasterInfo.js +1 -1
  278. package/layers/support/RasterJobHandler.js +1 -1
  279. package/layers/support/RasterWorker.js +1 -1
  280. package/layers/support/Sublayer.js +1 -1
  281. package/layers/support/SubtypeSublayer.js +1 -1
  282. package/layers/support/TilemapCache.js +1 -1
  283. package/layers/support/TimeReference.d.ts +4 -0
  284. package/layers/support/WMTSSublayer.js +1 -1
  285. package/layers/support/arcgisLayers.js +1 -1
  286. package/layers/support/commonProperties.js +1 -1
  287. package/layers/support/editableLayers.js +1 -1
  288. package/layers/support/fieldUtils.js +1 -1
  289. package/layers/support/floorFilterUtils.js +1 -1
  290. package/layers/support/imageryRendererUtils.js +1 -1
  291. package/layers/support/layerUtils.js +1 -1
  292. package/layers/support/layersCreator.js +1 -1
  293. package/layers/support/rasterDatasets/BaseRaster.js +1 -1
  294. package/layers/support/rasterDatasets/CloudRaster.js +1 -1
  295. package/layers/support/rasterDatasets/ImageAuxRaster.js +1 -1
  296. package/layers/support/rasterDatasets/ImageServerRaster.js +1 -1
  297. package/layers/support/rasterDatasets/InMemoryRaster.js +1 -1
  298. package/layers/support/rasterDatasets/MRFRaster.js +1 -1
  299. package/layers/support/rasterDatasets/TIFFRaster.js +1 -1
  300. package/layers/support/rasterDatasets/WCSRaster.js +1 -1
  301. package/layers/support/rasterDatasets/multipartParser.js +1 -1
  302. package/layers/support/rasterDatasets/pamParser.js +1 -1
  303. package/layers/support/rasterDatasets/wcsCapabilitiesParser.js +1 -1
  304. package/layers/support/rasterDatasets/wcsCoverageParser.js +1 -1
  305. package/layers/support/rasterDatasets/xmlUtilities.js +1 -1
  306. package/layers/support/rasterFormats/Lerc.js +1 -1
  307. package/layers/support/rasterFormats/RasterCodec.js +1 -1
  308. package/layers/support/rasterFormats/TiffDecoder.js +1 -1
  309. package/layers/support/rasterFunctions/pixelUtils.js +1 -1
  310. package/layers/support/rasterFunctions/rasterProjectionHelper.js +1 -1
  311. package/layers/support/rasterFunctions/stretchUtils.js +1 -1
  312. package/layers/support/rasterFunctions/vectorFieldUtils.js +1 -1
  313. package/layers/support/rasterTransforms/PolynomialTransform.js +1 -1
  314. package/layers/support/rasterTransforms/utils.js +1 -1
  315. package/layers/support/source/DataLayerSource.js +1 -1
  316. package/layers/support/source/QueryTableDataSource.js +1 -1
  317. package/layers/support/vectorTileLayerLoader.js +1 -1
  318. package/layers/support/wmsUtils.js +1 -1
  319. package/layers/support/wmtsUtils.js +1 -1
  320. package/libs/maquette-advanced-projector/projector.js +1 -1
  321. package/networks/Network.js +1 -1
  322. package/networks/UtilityNetwork.js +1 -1
  323. package/networks/support/utils.js +1 -1
  324. package/package.json +1 -1
  325. package/popup/content/ExpressionContent.js +1 -1
  326. package/portal/Portal.js +1 -1
  327. package/portal/PortalItem.js +1 -1
  328. package/portal/support/geometryServiceUtils.js +1 -1
  329. package/portal/support/layersLoader.js +1 -1
  330. package/portal/support/portalItemUtils.js +1 -1
  331. package/portal/support/portalLayers.js +1 -1
  332. package/renderers/DictionaryRenderer.js +1 -1
  333. package/renderers/FlowRenderer.js +1 -1
  334. package/renderers/RasterColormapRenderer.js +1 -1
  335. package/renderers/RasterStretchRenderer.js +1 -1
  336. package/renderers/VectorFieldRenderer.js +1 -1
  337. package/renderers/support/RasterSymbolizer.js +1 -1
  338. package/renderers/support/UniqueValueInfo.js +1 -1
  339. package/renderers/support/colorRampUtils.js +1 -1
  340. package/renderers/support/heatmapUtils.js +1 -1
  341. package/renderers/support/rasterRendererHelper.js +1 -1
  342. package/request.js +1 -1
  343. package/rest/identify.js +1 -1
  344. package/rest/imageService.js +1 -1
  345. package/rest/networkService.js +1 -1
  346. package/rest/networks/support/SynthesizeAssociationGeometriesParameters.js +1 -1
  347. package/rest/operations/identify.js +1 -1
  348. package/rest/print.js +1 -1
  349. package/rest/query/executeQuery.js +1 -1
  350. package/rest/query/operations/query.js +1 -1
  351. package/rest/query/operations/queryRelatedRecords.js +1 -1
  352. package/rest/query/operations/queryTopFeatures.js +1 -1
  353. package/rest/route.js +1 -1
  354. package/rest/support/DirectionLine.js +1 -1
  355. package/rest/support/DirectionPoint.js +1 -1
  356. package/rest/support/DirectionsFeatureSet.js +1 -1
  357. package/rest/support/FeatureSet.js +1 -1
  358. package/rest/support/ImageSampleParameters.js +1 -1
  359. package/rest/support/PointBarrier.js +1 -1
  360. package/rest/support/PolygonBarrier.js +1 -1
  361. package/rest/support/PolylineBarrier.js +1 -1
  362. package/rest/support/RouteInfo.js +1 -1
  363. package/rest/support/Stop.js +1 -1
  364. package/rest/support/meshFeatureSet.js +1 -1
  365. package/rest/support/printTaskUtils.js +1 -1
  366. package/smartMapping/labels/clusters.js +1 -1
  367. package/smartMapping/raster/renderers/rgb.js +1 -1
  368. package/smartMapping/raster/renderers/uniqueValue.js +1 -1
  369. package/smartMapping/raster/support/adapters/ImageryLayerAdapter.js +1 -1
  370. package/smartMapping/raster/support/adapters/RasterLayerAdapter.js +1 -1
  371. package/smartMapping/raster/support/utils.js +1 -1
  372. package/smartMapping/renderers/color.js +1 -1
  373. package/smartMapping/renderers/size.js +1 -1
  374. package/smartMapping/renderers/support/utils.js +1 -1
  375. package/smartMapping/renderers/univariateColorSize.js +1 -1
  376. package/smartMapping/statistics/support/WorkerClient.js +1 -1
  377. package/smartMapping/support/adapters/CSVLayerAdapter.js +1 -1
  378. package/smartMapping/support/adapters/FeatureLayerAdapter.js +1 -1
  379. package/smartMapping/support/adapters/OGCFeatureLayerAdapter.js +1 -1
  380. package/smartMapping/support/adapters/SceneLayerAdapter.js +1 -1
  381. package/smartMapping/support/adapters/support/utils.js +1 -1
  382. package/statistics/utils.js +1 -1
  383. package/support/LayersMixin.js +1 -1
  384. package/support/TablesMixin.js +1 -1
  385. package/support/arcadeUtils.js +1 -1
  386. package/support/basemapUtils.js +1 -1
  387. package/support/popupUtils.js +1 -1
  388. package/support/revision.js +1 -1
  389. package/support/timeUtils.js +1 -1
  390. package/symbols/FillSymbol3DLayer.js +1 -1
  391. package/symbols/LineSymbol3DLayer.js +1 -1
  392. package/symbols/LineSymbolMarker.js +1 -1
  393. package/symbols/PictureFillSymbol.js +1 -1
  394. package/symbols/PointSymbol3D.js +1 -1
  395. package/symbols/SimpleLineSymbol.js +1 -1
  396. package/symbols/SimpleMarkerSymbol.js +1 -1
  397. package/symbols/cim/CIMResourceManager.js +1 -1
  398. package/symbols/cim/CIMSymbolDrawHelper.js +1 -1
  399. package/symbols/cim/CIMSymbolHelper.js +1 -1
  400. package/symbols/cim/ExpandedCIM.js +1 -1
  401. package/symbols/cim/SDFHelper.js +1 -1
  402. package/symbols/cim/cimAnalyzer.js +1 -1
  403. package/symbols/cim/effects/EffectControlMeasureLine.js +1 -1
  404. package/symbols/cim/effects/EffectDashes.js +1 -1
  405. package/symbols/cim/effects/EffectOffset.js +1 -1
  406. package/symbols/cim/placements/PlacementAlongLineSameSize.js +1 -1
  407. package/symbols/cim/utils.js +1 -1
  408. package/symbols/support/cimSymbolUtils.js +1 -1
  409. package/symbols/support/jsonUtils.js +1 -1
  410. package/symbols/support/previewCIMSymbol.js +1 -1
  411. package/symbols/support/previewSymbol2D.js +1 -1
  412. package/symbols/support/previewSymbol3D.js +1 -1
  413. package/symbols/support/previewWebStyleSymbol.js +1 -1
  414. package/symbols/support/svgUtils.js +1 -1
  415. package/symbols/support/symbolConversion.js +1 -1
  416. package/symbols/support/symbolUtils.js +1 -1
  417. package/tasks/GenerateRendererTask.js +1 -1
  418. package/views/2d/MapViewConstraints.js +1 -1
  419. package/views/2d/constraints/GeometryConstraint.js +1 -1
  420. package/views/2d/engine/Bitmap.js +1 -1
  421. package/views/2d/engine/Container.js +1 -1
  422. package/views/2d/engine/DisplayObject.js +1 -1
  423. package/views/2d/engine/Stage.js +1 -1
  424. package/views/2d/engine/imagery/BrushRasterBitmap.js +1 -1
  425. package/views/2d/engine/imagery/RasterBitmap.js +1 -1
  426. package/views/2d/engine/imagery/RasterVFDisplayObject.js +1 -1
  427. package/views/2d/engine/vectorTiles/TilemapRequest.js +1 -1
  428. package/views/2d/engine/vectorTiles/WorkerTileHandler.js +1 -1
  429. package/views/2d/engine/vectorTiles/buckets/FillBucket.js +1 -1
  430. package/views/2d/engine/vectorTiles/buckets/LineBucket.js +1 -1
  431. package/views/2d/engine/vectorTiles/expression/expression.js +1 -1
  432. package/views/2d/engine/vectorTiles/shaders/VTLMaterial.js +1 -1
  433. package/views/2d/engine/vectorTiles/style/StyleLayer.js +1 -1
  434. package/views/2d/engine/vectorTiles/style/StyleRepository.js +1 -1
  435. package/views/2d/engine/vectorTiles/style/VectorTileSource.js +1 -1
  436. package/views/2d/engine/webgl/FeatureTile.js +1 -1
  437. package/views/2d/engine/webgl/GraphicTile.js +1 -1
  438. package/views/2d/engine/webgl/TextureManager.js +1 -1
  439. package/views/2d/engine/webgl/brushes/WGLBrushHeatmap.js +1 -1
  440. package/views/2d/engine/webgl/brushes/WGLBrushVTLCircle.js +1 -1
  441. package/views/2d/engine/webgl/brushes/WGLBrushVTLFill.js +1 -1
  442. package/views/2d/engine/webgl/brushes/WGLBrushVTLLine.js +1 -1
  443. package/views/2d/engine/webgl/collisions/CollisionEngine.js +1 -1
  444. package/views/2d/engine/webgl/collisions/MetricReader.js +1 -1
  445. package/views/2d/engine/webgl/cpuMapped/DisplayRecordReader.js +1 -1
  446. package/views/2d/engine/webgl/cpuMapped/FreeList.js +1 -1
  447. package/views/2d/engine/webgl/mesh/MeshData.js +1 -1
  448. package/views/2d/engine/webgl/mesh/templates/WGLBaseLineTemplate.js +1 -1
  449. package/views/2d/engine/webgl/mesh/templates/WGLBaseMarkerTemplate.js +1 -1
  450. package/views/2d/engine/webgl/mesh/templates/WGLBaseTextTemplate.js +1 -1
  451. package/views/2d/engine/webgl/mesh/templates/WGLDynamicFillTemplate.js +1 -1
  452. package/views/2d/engine/webgl/mesh/templates/WGLLabelTemplate.js +1 -1
  453. package/views/2d/engine/webgl/mesh/templates/WGLLineTemplate.js +1 -1
  454. package/views/2d/engine/webgl/mesh/templates/WGLMeshTemplate.js +1 -1
  455. package/views/2d/engine/webgl/painter/RenderPass.js +1 -1
  456. package/views/2d/engine/webgl/shaders/sources/shaderRepository.js +1 -1
  457. package/views/2d/engine/webgl/techniques/dotDensity/TechniqueDotDensity.js +1 -1
  458. package/views/2d/input/MapViewInputManager.js +1 -1
  459. package/views/2d/input/handlers/GamepadNavigation.js +1 -1
  460. package/views/2d/interactive/editingTools/draw/DrawGraphicTool2D.js +1 -1
  461. package/views/2d/interactive/snapping/featureSources/featureServiceSource/FeatureServiceTiles2D.js +1 -1
  462. package/views/2d/layers/BaseLayerView2D.js +1 -1
  463. package/views/2d/layers/BaseLayerViewGL2D.js +1 -1
  464. package/views/2d/layers/BitmapTileLayerView2D.js +1 -1
  465. package/views/2d/layers/FeatureLayerView2D.js +1 -1
  466. package/views/2d/layers/GeoRSSLayerView2D.js +1 -1
  467. package/views/2d/layers/GraphicsLayerView2D.js +1 -1
  468. package/views/2d/layers/ImageryLayerView2D.js +1 -1
  469. package/views/2d/layers/ImageryTileLayerView2D.js +1 -1
  470. package/views/2d/layers/KMLLayerView2D.js +1 -1
  471. package/views/2d/layers/LayerView2D.js +1 -1
  472. package/views/2d/layers/SubtypeGroupLayerView2D.js +1 -1
  473. package/views/2d/layers/TileLayerView2D.js +1 -1
  474. package/views/2d/layers/VectorTileLayerView2D.js +1 -1
  475. package/views/2d/layers/WMTSLayerView2D.js +1 -1
  476. package/views/2d/layers/features/FeatureStore2D.js +1 -1
  477. package/views/2d/layers/features/Pipeline.js +1 -1
  478. package/views/2d/layers/features/batchUtils.js +1 -1
  479. package/views/2d/layers/features/controllers/FeatureController2D.js +1 -1
  480. package/views/2d/layers/features/controllers/support/sourceAdapters.js +1 -1
  481. package/views/2d/layers/features/createSymbolSchema.js +1 -1
  482. package/views/2d/layers/features/processors/SymbolProcessor.js +1 -1
  483. package/views/2d/layers/features/schemaUtils.js +1 -1
  484. package/views/2d/layers/features/sources/BaseFeatureSource.js +1 -1
  485. package/views/2d/layers/features/sources/DataTileSource.js +1 -1
  486. package/views/2d/layers/features/sources/DataTileSubscription.js +1 -1
  487. package/views/2d/layers/features/sources/SnapshotFeatureSource.js +1 -1
  488. package/views/2d/layers/features/support/ClusterStore.js +1 -1
  489. package/views/2d/layers/features/support/FeatureSetReader.js +1 -1
  490. package/views/2d/layers/features/support/FeatureSetReaderJSON.js +1 -1
  491. package/views/2d/layers/features/support/FeatureSetReaderPBF.js +1 -1
  492. package/views/2d/layers/features/support/FeatureSetReaderPBFHeader.js +1 -1
  493. package/views/2d/layers/features/support/ResourceManagerProxy.js +1 -1
  494. package/views/2d/layers/features/tileRenderers/SymbolTileRenderer.js +1 -1
  495. package/views/2d/layers/features/tileRenderers/support/WGLFeatureView.js +1 -1
  496. package/views/2d/layers/graphics/graphicsUtils.js +1 -1
  497. package/views/2d/layers/imagery/BaseImageryTileSubView2D.js +1 -1
  498. package/views/2d/layers/imagery/ImageryTileView2D.js +1 -1
  499. package/views/2d/layers/imagery/VectorFieldTileView2D.js +1 -1
  500. package/views/2d/layers/support/ExportStrategy.js +1 -1
  501. package/views/2d/layers/support/FeatureCommandQueue.js +1 -1
  502. package/views/2d/magnifier/MagnifierView2D.js +1 -1
  503. package/views/2d/support/engineHelpers.js +1 -1
  504. package/views/2d/tiling/TileManager.js +1 -1
  505. package/views/3d/analysis/AreaMeasurement/support/AreaMeasurementVisualization.js +1 -1
  506. package/views/3d/analysis/AreaMeasurementAnalysisView3D.js +1 -1
  507. package/views/3d/analysis/Dimensioning/DimensioningVisualization.js +5 -0
  508. package/views/3d/analysis/Dimensioning/LinearDimensionVisualization.js +5 -0
  509. package/views/3d/analysis/DimensioningAnalysisView3D.js +1 -1
  510. package/views/3d/analysis/DirectLineMeasurement/DirectLineMeasurementController.js +1 -1
  511. package/views/3d/analysis/DirectLineMeasurement/DirectLineMeasurementVisualization.js +1 -1
  512. package/views/3d/analysis/DirectLineMeasurementAnalysisView3D.js +1 -1
  513. package/views/3d/analysis/LineOfSight/LineOfSightController.js +1 -1
  514. package/views/3d/analysis/LineOfSightAnalysisView3D.js +1 -1
  515. package/views/3d/analysis/Slice/SliceTool.js +1 -1
  516. package/views/3d/analysis/SliceAnalysisView3D.js +1 -1
  517. package/views/3d/environment/ChapmanAtmosphere.glsl.js +1 -1
  518. package/views/3d/environment/ChapmanAtmosphere.js +1 -1
  519. package/views/3d/environment/Clouds.glsl.js +1 -1
  520. package/views/3d/environment/CloudsComposition.glsl.js +1 -1
  521. package/views/3d/environment/CloudsComposition.js +1 -1
  522. package/views/3d/environment/CloudsCompositionParameters.js +5 -0
  523. package/views/3d/environment/EnvironmentRenderer.js +1 -1
  524. package/views/3d/environment/Fog.glsl.js +1 -1
  525. package/views/3d/environment/Fog.js +1 -1
  526. package/views/3d/environment/Precipitation.js +1 -1
  527. package/views/3d/environment/SceneViewEnvironment.js +1 -1
  528. package/views/3d/environment/SceneViewEnvironmentManager.js +1 -1
  529. package/views/3d/environment/SimpleAtmosphere.js +1 -1
  530. package/views/3d/environment/Stars.glsl.js +1 -1
  531. package/views/3d/environment/Stars.js +1 -1
  532. package/views/3d/externalRenderers/ExternalRendererStore.js +1 -1
  533. package/views/3d/glTF/internal/Resource.js +1 -1
  534. package/views/3d/glTF/loader.js +1 -1
  535. package/views/3d/input/SceneInputManager.js +1 -1
  536. package/views/3d/input/handlers/TwoFingerTilt.js +1 -1
  537. package/views/3d/interactive/Manipulator3D.js +1 -1
  538. package/views/3d/interactive/editingTools/draw/DrawGraphicTool3D.js +1 -1
  539. package/views/3d/interactive/editingTools/manipulations/MoveManipulation.js +1 -1
  540. package/views/3d/interactive/editingTools/moveGraphic/isSupportedGraphic.js +1 -1
  541. package/views/3d/interactive/editingTools/reshapeGraphic/GraphicReshapeTool.js +1 -1
  542. package/views/3d/interactive/editingTools/reshapeGraphic/ReshapeOperation.js +1 -1
  543. package/views/3d/interactive/editingTools/reshapeGraphic/isSupportedGraphic.js +1 -1
  544. package/views/3d/interactive/editingTools/transformGraphic/GraphicScaleRotateTransform.js +1 -1
  545. package/views/3d/interactive/editingTools/transformGraphic/isSupportedGraphic.js +1 -1
  546. package/views/3d/interactive/measurementTools/areaMeasurement3D/AreaMeasurement3DView.js +1 -1
  547. package/views/3d/interactive/measurementTools/directLineMeasurement3D/DirectLineMeasurement3DView.js +1 -1
  548. package/views/3d/interactive/snapping/featureSources/featureServiceSource/FeatureServiceTiles3D.js +1 -1
  549. package/views/3d/interactive/visualElements/DrapedVisualElementResources.js +1 -1
  550. package/views/3d/interactive/visualElements/LineVisualElement.js +1 -1
  551. package/views/3d/interactive/visualElements/OutlineVisualElement.js +1 -1
  552. package/views/3d/interactive/visualElements/VisualElementResources.js +1 -1
  553. package/views/3d/layers/BuildingComponentSublayerView3D.js +1 -1
  554. package/views/3d/layers/ElevationLayerView3D.js +1 -1
  555. package/views/3d/layers/FeatureLayerView3D.js +1 -1
  556. package/views/3d/layers/FeatureLayerViewBase3D.js +1 -1
  557. package/views/3d/layers/FeatureLikeLayerView3D.js +1 -1
  558. package/views/3d/layers/GraphicsLayerView3D.js +1 -1
  559. package/views/3d/layers/GraphicsView3D.js +1 -1
  560. package/views/3d/layers/I3SMeshView3D.js +1 -1
  561. package/views/3d/layers/ImageryLayerView3D.js +1 -1
  562. package/views/3d/layers/ImageryTileLayerView3D.js +1 -1
  563. package/views/3d/layers/LayerView3D.js +1 -1
  564. package/views/3d/layers/RouteLayerView3D.js +1 -1
  565. package/views/3d/layers/SceneLayerGraphicsView3D.js +1 -1
  566. package/views/3d/layers/SceneLayerView3D.js +1 -1
  567. package/views/3d/layers/SceneLayerWorker.js +1 -1
  568. package/views/3d/layers/StreamLayerView3D.js +1 -1
  569. package/views/3d/layers/TiledLayerView3D.js +1 -1
  570. package/views/3d/layers/VectorTileLayerView3D.js +1 -1
  571. package/views/3d/layers/VoxelLayerView3D.js +1 -1
  572. package/views/3d/layers/WMSLayerView3D.js +1 -1
  573. package/views/3d/layers/WMTSLayerView3D.js +1 -1
  574. package/views/3d/layers/graphics/Graphics3DCore.js +1 -1
  575. package/views/3d/layers/graphics/Graphics3DExtrudeSymbolLayer.js +1 -1
  576. package/views/3d/layers/graphics/Graphics3DFeatureProcessor.js +1 -1
  577. package/views/3d/layers/graphics/Graphics3DFilterVisibility.js +1 -1
  578. package/views/3d/layers/graphics/Graphics3DFrustumVisibility.js +1 -1
  579. package/views/3d/layers/graphics/Graphics3DLineSymbolLayer.js +1 -1
  580. package/views/3d/layers/graphics/Graphics3DMeshFillSymbolLayer.js +1 -1
  581. package/views/3d/layers/graphics/Graphics3DObject3DGraphicLayer.js +1 -1
  582. package/views/3d/layers/graphics/Graphics3DPathSymbolLayer.js +1 -1
  583. package/views/3d/layers/graphics/Graphics3DPointSymbol.js +1 -1
  584. package/views/3d/layers/graphics/Graphics3DSymbol.js +1 -1
  585. package/views/3d/layers/graphics/Graphics3DSymbolLayer.js +1 -1
  586. package/views/3d/layers/graphics/GraphicsDeconflictor.js +1 -1
  587. package/views/3d/layers/graphics/GraphicsProcessor.js +1 -1
  588. package/views/3d/layers/graphics/Labeler.js +1 -1
  589. package/views/3d/layers/i3s/I3SAttributeOverrides.js +1 -1
  590. package/views/3d/layers/i3s/I3SMeshViewFilter.js +1 -1
  591. package/views/3d/layers/i3s/I3SStreamDataController.js +1 -1
  592. package/views/3d/layers/i3s/I3SUtil.js +1 -1
  593. package/views/3d/layers/support/FeatureTileTree3D.js +1 -1
  594. package/views/3d/layers/support/FeatureTileTree3DDebugger.js +1 -1
  595. package/views/3d/layers/support/HeatmapFeatureProcessor.js +1 -1
  596. package/views/3d/layers/support/StageLayerElevationProvider.js +1 -1
  597. package/views/3d/layers/support/featureTileQuery3D.js +1 -1
  598. package/views/3d/state/ConstraintsManager.js +1 -1
  599. package/views/3d/state/helpers/SceneIntersectionHelper.js +1 -1
  600. package/views/3d/support/ResourceController.js +1 -1
  601. package/views/3d/support/SharedSymbolResources.js +1 -1
  602. package/views/3d/support/TextureCollection.js +1 -1
  603. package/views/3d/support/cameraUtils.js +1 -1
  604. package/views/3d/support/pointsOfInterest/CameraOnSurface.js +1 -1
  605. package/views/3d/support/pointsOfInterest/Focus.js +1 -1
  606. package/views/3d/support/pointsOfInterest/PointsOfInterest.js +1 -1
  607. package/views/3d/support/pointsOfInterest/StableSurfaceCenter.js +1 -1
  608. package/views/3d/terrain/OverlayFramebufferObject.js +1 -1
  609. package/views/3d/terrain/OverlayManager.js +1 -1
  610. package/views/3d/terrain/OverlayRenderer.js +1 -1
  611. package/views/3d/terrain/PatchGeometry.js +1 -1
  612. package/views/3d/terrain/PatchGeometryFactory.js +1 -1
  613. package/views/3d/terrain/PatchRenderData.js +1 -1
  614. package/views/3d/terrain/PlanarPatch.js +1 -1
  615. package/views/3d/terrain/RasterColorizerTechnique.js +1 -1
  616. package/views/3d/terrain/RasterTile.js +1 -1
  617. package/views/3d/terrain/SphericalPatch.js +1 -1
  618. package/views/3d/terrain/TerrainRenderer.js +1 -1
  619. package/views/3d/terrain/TerrainSurface.js +1 -1
  620. package/views/3d/terrain/Tile.js +1 -1
  621. package/views/3d/terrain/TileCompositor.js +1 -1
  622. package/views/3d/terrain/TileRenderer.js +1 -1
  623. package/views/3d/terrain/TilingSchemeLogic.js +1 -1
  624. package/views/3d/terrain/terrainUtils.js +1 -1
  625. package/views/3d/webgl-engine/collections/Component/ComponentIntersectionData.js +1 -1
  626. package/views/3d/webgl-engine/collections/Component/ComponentObjectCollection.js +1 -1
  627. package/views/3d/webgl-engine/collections/Component/Material/ComponentTechnique.js +1 -1
  628. package/views/3d/webgl-engine/collections/Component/Material/shader/ComponentData.glsl.js +2 -2
  629. package/views/3d/webgl-engine/core/material/MaterialBase.js +1 -1
  630. package/views/3d/webgl-engine/core/shaderLibrary/ScreenSizeScaling.glsl.js +1 -1
  631. package/views/3d/webgl-engine/core/shaderLibrary/Slice.glsl.js +5 -5
  632. package/views/3d/webgl-engine/core/shaderLibrary/attributes/PathVertexPosition.glsl.js +8 -8
  633. package/views/3d/webgl-engine/core/shaderLibrary/attributes/RibbonVertexPosition.glsl.js +6 -6
  634. package/views/3d/webgl-engine/core/shaderLibrary/attributes/VertexNormal.glsl.js +4 -4
  635. package/views/3d/webgl-engine/core/shaderLibrary/attributes/VertexPosition.glsl.js +2 -2
  636. package/views/3d/webgl-engine/core/shaderLibrary/attributes/VerticalOffset.glsl.js +5 -5
  637. package/views/3d/webgl-engine/core/shaderLibrary/hud/HUD.glsl.js +13 -13
  638. package/views/3d/webgl-engine/core/shaderLibrary/raster/BasicGrid.glsl.js +2 -2
  639. package/views/3d/webgl-engine/core/shaderLibrary/raster/Colormap.glsl.js +1 -1
  640. package/views/3d/webgl-engine/core/shaderLibrary/raster/Common.glsl.js +2 -2
  641. package/views/3d/webgl-engine/core/shaderLibrary/raster/Projection.glsl.js +1 -1
  642. package/views/3d/webgl-engine/core/shaderLibrary/raster/RasterColorizer.glsl.js +1 -1
  643. package/views/3d/webgl-engine/core/shaderLibrary/shading/ComputeMaterialColor.glsl.js +1 -1
  644. package/views/3d/webgl-engine/core/shaderLibrary/shading/EvaluateAmbientLighting.glsl.js +5 -5
  645. package/views/3d/webgl-engine/core/shaderLibrary/shading/EvaluateAmbientOcclusion.glsl.js +3 -3
  646. package/views/3d/webgl-engine/core/shaderLibrary/shading/EvaluateSceneLighting.glsl.js +13 -13
  647. package/views/3d/webgl-engine/core/shaderLibrary/shading/LineStipple.glsl.js +17 -17
  648. package/views/3d/webgl-engine/core/shaderLibrary/shading/ReadShadowMap.glsl.js +1 -1
  649. package/views/3d/webgl-engine/core/shaderLibrary/shading/VisualVariables.glsl.js +7 -7
  650. package/views/3d/webgl-engine/core/shaderLibrary/shading/WaterDistortion.glsl.js +2 -2
  651. package/views/3d/webgl-engine/core/shaderLibrary/terrain/Overlay.glsl.js +5 -5
  652. package/views/3d/webgl-engine/core/shaderLibrary/util/CameraSpace.glsl.js +2 -2
  653. package/views/3d/webgl-engine/core/shaderLibrary/util/CloudsParallaxShading.glsl.js +15 -15
  654. package/views/3d/webgl-engine/core/shaderLibrary/util/ScreenSizePerspective.glsl.js +2 -2
  655. package/views/3d/webgl-engine/core/shaderLibrary/util/View.glsl.js +1 -1
  656. package/views/3d/webgl-engine/core/shaderModules/BooleanPassUniform.js +5 -0
  657. package/views/3d/webgl-engine/core/shaderModules/Float4DrawUniform.js +5 -0
  658. package/views/3d/webgl-engine/core/shaderModules/{Matrix3Uniform.js → Float4PassUniform.js} +1 -1
  659. package/views/3d/webgl-engine/core/shaderModules/Float4Uniform.js +1 -1
  660. package/views/3d/webgl-engine/core/shaderModules/Matrix3DrawUniform.js +5 -0
  661. package/views/3d/webgl-engine/core/shaderModules/Matrix3PassUniform.js +5 -0
  662. package/views/3d/webgl-engine/core/shaderModules/{TextureCubeUniform.js → TextureCubePassUniform.js} +1 -1
  663. package/views/3d/webgl-engine/core/shaderTechnique/ShaderTechniqueConfiguration.js +1 -1
  664. package/views/3d/webgl-engine/lib/AutoDisposable.js +1 -1
  665. package/views/3d/webgl-engine/lib/BindParameters.js +1 -1
  666. package/views/3d/webgl-engine/lib/GLTextureMaterial.js +1 -1
  667. package/views/3d/webgl-engine/lib/RenderPluginManager.js +1 -1
  668. package/views/3d/webgl-engine/lib/Renderer.js +1 -1
  669. package/views/3d/webgl-engine/lib/ShadowAccumulator.js +1 -1
  670. package/views/3d/webgl-engine/lib/ShadowHighlight.js +1 -1
  671. package/views/3d/webgl-engine/lib/ShadowMap.js +1 -1
  672. package/views/3d/webgl-engine/lib/Texture.js +1 -1
  673. package/views/3d/webgl-engine/lib/WebGLLayer.js +1 -1
  674. package/views/3d/webgl-engine/lib/edgeRendering/EdgeView.js +1 -1
  675. package/views/3d/webgl-engine/lib/intersectorUtilsConversions.js +1 -1
  676. package/views/3d/webgl-engine/lib/pathGeometryUtils.js +1 -1
  677. package/views/3d/webgl-engine/materials/CheckerBoardMaterial.js +1 -1
  678. package/views/3d/webgl-engine/materials/ColorMaterial.js +1 -1
  679. package/views/3d/webgl-engine/materials/DefaultMaterial.js +1 -1
  680. package/views/3d/webgl-engine/materials/HUDMaterial.js +1 -1
  681. package/views/3d/webgl-engine/materials/HeatmapDensityMaterial.js +1 -1
  682. package/views/3d/webgl-engine/materials/ImageMaterial.js +1 -1
  683. package/views/3d/webgl-engine/materials/LineCalloutMaterial.js +1 -1
  684. package/views/3d/webgl-engine/materials/LineMarkerMaterial.js +1 -1
  685. package/views/3d/webgl-engine/materials/MeasurementArrowMaterial.js +1 -1
  686. package/views/3d/webgl-engine/materials/NativeLineMaterial.js +1 -1
  687. package/views/3d/webgl-engine/materials/PathMaterial.js +1 -1
  688. package/views/3d/webgl-engine/materials/PathTechnique.js +1 -1
  689. package/views/3d/webgl-engine/materials/RibbonLineMaterial.js +1 -1
  690. package/views/3d/webgl-engine/materials/ShadedColorMaterial.js +1 -1
  691. package/views/3d/webgl-engine/materials/{VisualVariableMaterialParameters.js → VisualVariablePassParameters.js} +1 -1
  692. package/views/3d/webgl-engine/materials/WaterGLMaterial.js +1 -1
  693. package/views/3d/webgl-engine/materials/WaterTechnique.js +1 -1
  694. package/views/3d/webgl-engine/parts/RenderView.js +1 -1
  695. package/views/3d/webgl-engine/parts/requireUtils.js +1 -1
  696. package/views/3d/webgl-engine/shaders/CheckerBoard.glsl.js +1 -1
  697. package/views/3d/webgl-engine/shaders/CheckerBoardTechnique.js +1 -1
  698. package/views/3d/webgl-engine/shaders/ColorMaterial.glsl.js +1 -1
  699. package/views/3d/webgl-engine/shaders/DefaultMaterial.glsl.js +1 -1
  700. package/views/3d/webgl-engine/shaders/DefaultMaterialTechnique.js +1 -1
  701. package/views/3d/webgl-engine/shaders/HUDMaterial.glsl.js +1 -1
  702. package/views/3d/webgl-engine/shaders/HUDMaterialTechnique.js +1 -1
  703. package/views/3d/webgl-engine/shaders/HeatmapDensity.glsl.js +1 -1
  704. package/views/3d/webgl-engine/shaders/HeatmapDensityTechnique.js +1 -1
  705. package/views/3d/webgl-engine/shaders/HeatmapTechnique.js +1 -1
  706. package/views/3d/webgl-engine/shaders/HighlightApply.glsl.js +1 -1
  707. package/views/3d/webgl-engine/shaders/LineCallout.glsl.js +1 -1
  708. package/views/3d/webgl-engine/shaders/LineMarker.glsl.js +1 -1
  709. package/views/3d/webgl-engine/shaders/Magnifier.glsl.js +3 -3
  710. package/views/3d/webgl-engine/shaders/MeasurementArrow.glsl.js +1 -1
  711. package/views/3d/webgl-engine/shaders/NativeLine.glsl.js +1 -1
  712. package/views/3d/webgl-engine/shaders/Path.glsl.js +1 -1
  713. package/views/3d/webgl-engine/shaders/Pattern.glsl.js +1 -1
  714. package/views/3d/webgl-engine/shaders/RealisticTree.glsl.js +1 -1
  715. package/views/3d/webgl-engine/shaders/RibbonLine.glsl.js +1 -1
  716. package/views/3d/webgl-engine/shaders/ShadedColorMaterial.glsl.js +1 -1
  717. package/views/3d/webgl-engine/shaders/ShadowCastVisualize.glsl.js +1 -1
  718. package/views/3d/webgl-engine/shaders/ShadowHighlight.glsl.js +1 -1
  719. package/views/3d/webgl-engine/shaders/SlicePlaneMaterial.glsl.js +1 -1
  720. package/views/3d/webgl-engine/shaders/WaterSurface.glsl.js +1 -1
  721. package/views/3d/webgl-engine/shaders/sources/edgeRenderer/AdjustProjectedPosition.glsl.js +3 -3
  722. package/views/3d/webgl-engine/shaders/sources/edgeRenderer/EdgeShader.glsl.js +1 -1
  723. package/views/3d/webgl-engine/shaders/sources/edgeRenderer/EdgeUtil.glsl.js +5 -5
  724. package/views/BasemapView.js +1 -1
  725. package/views/GroundView.js +1 -1
  726. package/views/LayerViewManager.js +1 -1
  727. package/views/MapView.js +1 -1
  728. package/views/SceneView.js +1 -1
  729. package/views/ToolViewManager.js +1 -1
  730. package/views/View.js +1 -1
  731. package/views/draw/DrawAction.js +1 -1
  732. package/views/draw/DrawGraphicTool.js +1 -1
  733. package/views/draw/DrawOperation.js +1 -1
  734. package/views/draw/DrawTool.js +1 -1
  735. package/views/draw/support/Box.js +1 -1
  736. package/views/draw/support/GraphicMover.js +1 -1
  737. package/views/draw/support/Reshape.js +1 -1
  738. package/views/interactive/coordinateHelper.js +1 -1
  739. package/views/interactive/editGeometry/operations/OffsetEdgeVertex.js +1 -1
  740. package/views/interactive/snapping/FeatureSnappingEngine.js +1 -1
  741. package/views/interactive/snapping/SnappingManager.js +1 -1
  742. package/views/interactive/snapping/featureSources/WorkerTileTreeDebugger.js +1 -1
  743. package/views/interactive/snapping/featureSources/featureServiceSource/FeatureServiceSnappingSourceWorkerHandle.js +1 -1
  744. package/views/interactive/snapping/featureSources/featureServiceSource/FeatureServiceTileStore.js +1 -1
  745. package/views/interactive/snapping/featureSources/featureServiceSource/FeatureServiceTiledFetcher.js +1 -1
  746. package/views/layers/FeatureLayerView.js +1 -1
  747. package/views/layers/GroupLayerView.js +1 -1
  748. package/views/layers/ImageryLayerView.js +1 -1
  749. package/views/layers/ImageryTileLayerView.js +1 -1
  750. package/views/layers/LayerView.js +1 -1
  751. package/views/layers/MapImageLayerView.js +1 -1
  752. package/views/layers/WMSLayerView.js +1 -1
  753. package/views/support/AllocationTracer.js +1 -1
  754. package/views/support/DefaultsFromMap.js +1 -1
  755. package/views/support/geometry2dUtils.js +1 -1
  756. package/views/support/layerViewUtils.js +1 -1
  757. package/views/support/waitForResources.js +1 -1
  758. package/views/ui/UI.js +1 -1
  759. package/views/webgl/BufferObject.js +1 -1
  760. package/views/webgl/FramebufferObject.js +1 -1
  761. package/views/webgl/RenderingContext.js +1 -1
  762. package/views/webgl/Texture.js +1 -1
  763. package/views/webgl/UniformBufferLayout.js +1 -1
  764. package/views/webgl/VertexArrayObject.js +1 -1
  765. package/views/webgl/capabilities.js +1 -1
  766. package/views/webgl/rasterUtils.js +1 -1
  767. package/views/webgl/testFloatBufferBlend.js +1 -1
  768. package/webdoc/widgets/TimeSlider.js +1 -1
  769. package/webmap/Bookmark.js +1 -1
  770. package/webscene/Slide.js +1 -1
  771. package/widgets/AreaMeasurement2D/AreaMeasurement2DTool.js +1 -1
  772. package/widgets/AreaMeasurement2D/AreaMeasurement2DViewModel.js +1 -1
  773. package/widgets/AreaMeasurement2D.js +1 -1
  774. package/widgets/AreaMeasurement3D.js +1 -1
  775. package/widgets/Attribution.js +1 -1
  776. package/widgets/BasemapGallery/BasemapGalleryViewModel.js +1 -1
  777. package/widgets/BasemapGallery/support/BasemapGalleryItem.js +1 -1
  778. package/widgets/BasemapGallery/support/basemapCompatibilityUtils.js +1 -1
  779. package/widgets/BasemapLayerList.js +1 -1
  780. package/widgets/BasemapToggle/BasemapToggleViewModel.js +1 -1
  781. package/widgets/Bookmarks/BookmarksViewModel.js +1 -1
  782. package/widgets/Bookmarks.js +1 -1
  783. package/widgets/BuildingExplorer/BuildingDisciplinesTree/BuildingDisciplinesNode.js +1 -1
  784. package/widgets/BuildingExplorer/BuildingExplorerViewModel.js +1 -1
  785. package/widgets/BuildingExplorer/BuildingLevel.js +1 -1
  786. package/widgets/BuildingExplorer/BuildingLevelPicker/BuildingLevelPicker.js +1 -1
  787. package/widgets/BuildingExplorer/BuildingNumericFilterViewModel.js +1 -1
  788. package/widgets/BuildingExplorer/BuildingPhase.js +1 -1
  789. package/widgets/BuildingExplorer/support/buildingLayerUtils.js +1 -1
  790. package/widgets/BuildingExplorer.js +1 -1
  791. package/widgets/CoordinateConversion/CoordinateConversionViewModel.js +1 -1
  792. package/widgets/CoordinateConversion/support/Format.js +1 -1
  793. package/widgets/Daylight/DaylightViewModel.js +1 -1
  794. package/widgets/Daylight/support/SliderWithDropdown.js +1 -1
  795. package/widgets/Daylight.js +1 -1
  796. package/widgets/DirectLineMeasurement3D.js +1 -1
  797. package/widgets/Directions/DirectionsViewModel.js +1 -1
  798. package/widgets/Directions.js +1 -1
  799. package/widgets/DistanceMeasurement2D/DistanceMeasurement2DViewModel.js +1 -1
  800. package/widgets/DistanceMeasurement2D.js +1 -1
  801. package/widgets/Editor/CreateFeaturesWorkflow.js +1 -1
  802. package/widgets/Editor/CreateWorkflow.js +1 -1
  803. package/widgets/Editor/EditorViewModel.js +1 -1
  804. package/widgets/Editor/UpdateWorkflow.js +1 -1
  805. package/widgets/Editor/workflowUtils.js +1 -1
  806. package/widgets/Editor.js +1 -1
  807. package/widgets/ElevationProfile/ElevationProfileLineGround.js +1 -1
  808. package/widgets/ElevationProfile/ElevationProfileLineInput.js +1 -1
  809. package/widgets/ElevationProfile/ElevationProfileLineView.js +1 -1
  810. package/widgets/ElevationProfile/ElevationProfileTool.js +1 -1
  811. package/widgets/ElevationProfile/ElevationProfileViewModel.js +1 -1
  812. package/widgets/ElevationProfile/components/Statistics.js +1 -1
  813. package/widgets/ElevationProfile/support/elevationQuerySourceUtils.js +1 -1
  814. package/widgets/ElevationProfile/support/profileUtils.js +1 -1
  815. package/widgets/ElevationProfile.js +1 -1
  816. package/widgets/Expand.js +1 -1
  817. package/widgets/Feature/FeatureAttachments.js +1 -1
  818. package/widgets/Feature/FeatureContent.js +1 -1
  819. package/widgets/Feature/FeatureExpression/FeatureExpressionViewModel.js +1 -1
  820. package/widgets/Feature/FeatureExpression.js +1 -1
  821. package/widgets/Feature/FeatureFields/FeatureFieldsViewModel.js +1 -1
  822. package/widgets/Feature/FeatureFields.js +1 -1
  823. package/widgets/Feature/FeatureMedia/FeatureMediaViewModel.js +1 -1
  824. package/widgets/Feature/FeatureMedia.js +1 -1
  825. package/widgets/Feature/FeatureViewModel.js +1 -1
  826. package/widgets/Feature/support/arcadeFeatureUtils.js +1 -1
  827. package/widgets/Feature/support/featureUtils.js +1 -1
  828. package/widgets/Feature/support/relatedFeatureUtils.js +1 -1
  829. package/widgets/FeatureForm/FeatureFormViewModel.js +1 -1
  830. package/widgets/FeatureForm/InputField.js +1 -1
  831. package/widgets/FeatureForm/support/formTemplateUtils.js +1 -1
  832. package/widgets/FeatureForm.js +1 -1
  833. package/widgets/FeatureTable/FeatureTableViewModel.js +1 -1
  834. package/widgets/FeatureTable/FieldColumn.js +1 -1
  835. package/widgets/FeatureTable/Grid/Column.js +1 -1
  836. package/widgets/FeatureTable/Grid/EditorColumn.js +1 -1
  837. package/widgets/FeatureTable/Grid/Grid.js +1 -1
  838. package/widgets/FeatureTable/Grid/GridViewModel.js +1 -1
  839. package/widgets/FeatureTable/Grid/support/ButtonMenu.js +1 -1
  840. package/widgets/FeatureTable/Grid/support/LocalStore.js +1 -1
  841. package/widgets/FeatureTable/support/FeatureStore.js +1 -1
  842. package/widgets/FeatureTable.js +1 -1
  843. package/widgets/FeatureTemplates/FeatureTemplatesViewModel.js +1 -1
  844. package/widgets/FeatureTemplates/ItemList.js +1 -1
  845. package/widgets/FeatureTemplates/TemplateItem.js +1 -1
  846. package/widgets/FeatureTemplates.js +1 -1
  847. package/widgets/FloorFilter/FloorFilterViewModel.js +1 -1
  848. package/widgets/FloorFilter.js +1 -1
  849. package/widgets/Fullscreen.js +1 -1
  850. package/widgets/Home.js +1 -1
  851. package/widgets/LayerList/LayerListViewModel.js +1 -1
  852. package/widgets/LayerList/support/layerListUtils.js +1 -1
  853. package/widgets/LayerList.js +1 -1
  854. package/widgets/Legend/LegendViewModel.js +1 -1
  855. package/widgets/Legend/styles/Card.js +1 -1
  856. package/widgets/Legend/styles/support/univariateUtils.js +1 -1
  857. package/widgets/Legend/support/ActiveLayerInfo.js +1 -1
  858. package/widgets/Legend/support/clusterUtils.js +1 -1
  859. package/widgets/Legend/support/sizeRampUtils.js +1 -1
  860. package/widgets/Locate/LocateViewModel.js +1 -1
  861. package/widgets/Popup/PopupViewModel.js +1 -1
  862. package/widgets/Popup/actionUtils.js +1 -1
  863. package/widgets/Popup.js +1 -1
  864. package/widgets/Print/PrintViewModel.js +1 -1
  865. package/widgets/Print.js +1 -1
  866. package/widgets/ScaleRangeSlider/ScaleRangeSliderViewModel.js +1 -1
  867. package/widgets/Search/LayerSearchSource.js +1 -1
  868. package/widgets/Search/SearchResultRenderer.js +1 -1
  869. package/widgets/Search/SearchViewModel.js +1 -1
  870. package/widgets/Search/support/geometryUtils.js +1 -1
  871. package/widgets/Search/support/layerSearchUtils.js +1 -1
  872. package/widgets/Search/support/locatorUtils.js +1 -1
  873. package/widgets/Search.js +1 -1
  874. package/widgets/ShadowCast/components/DiscreteConfigurator.js +1 -1
  875. package/widgets/ShadowCast/components/Label.js +1 -1
  876. package/widgets/ShadowCast/components/TimezonePicker.js +1 -1
  877. package/widgets/ShadowCast.js +1 -1
  878. package/widgets/Sketch/SketchViewModel.js +1 -1
  879. package/widgets/Sketch.js +1 -1
  880. package/widgets/Slider.js +1 -1
  881. package/widgets/Swipe/SwipeViewModel.js +1 -1
  882. package/widgets/TableList/TableListViewModel.js +1 -1
  883. package/widgets/TableList/support/tableListUtils.js +1 -1
  884. package/widgets/TableList.js +1 -1
  885. package/widgets/TimeSlider/TimeSliderViewModel.js +1 -1
  886. package/widgets/TimeSlider/utils.js +1 -1
  887. package/widgets/TimeSlider.js +1 -1
  888. package/widgets/UtilityNetworkTrace/UtilityNetworkTraceViewModel.js +1 -1
  889. package/widgets/Weather.js +1 -1
  890. package/widgets/Widget.js +1 -1
  891. package/widgets/smartMapping/BinaryColorSizeSlider/BinaryColorSizeSliderViewModel.js +1 -1
  892. package/widgets/smartMapping/BinaryColorSizeSlider.js +1 -1
  893. package/widgets/smartMapping/ClassedColorSlider.js +1 -1
  894. package/widgets/smartMapping/ClassedSizeSlider.js +1 -1
  895. package/widgets/smartMapping/ColorSizeSlider.js +1 -1
  896. package/widgets/smartMapping/SizeSlider/SizeSliderViewModel.js +1 -1
  897. package/widgets/smartMapping/SmartMappingSliderBase.js +1 -1
  898. package/widgets/smartMapping/SmartMappingSliderViewModel.js +1 -1
  899. package/widgets/support/AnalysisViewModel.js +1 -1
  900. package/widgets/support/ColorPicker.js +1 -1
  901. package/widgets/support/DatePicker.js +1 -1
  902. package/widgets/support/InteractiveAnalysisViewModel.js +1 -1
  903. package/widgets/support/Popover.js +1 -1
  904. package/widgets/support/SelectionToolbar/SelectionToolbarViewModel.js +1 -1
  905. package/widgets/support/SelectionToolbar.js +1 -1
  906. package/widgets/support/Selector2D/SelectionOperation2D.js +1 -1
  907. package/widgets/support/Selector2D.js +1 -1
  908. package/widgets/support/SnappingControls/SnappingControlsViewModel.js +1 -1
  909. package/widgets/support/SnappingControls.js +1 -1
  910. package/widgets/support/jsxWidgetSupport.js +1 -1
  911. package/widgets/support/widgetUtils.js +1 -1
  912. package/assets/esri/core/workers/chunks/049c5c30bd37693dddb7.js +0 -1
  913. package/assets/esri/core/workers/chunks/055a0ebf22a82f859474.js +0 -1
  914. package/assets/esri/core/workers/chunks/0b12ff7b2ed2838afbb8.js +0 -1
  915. package/assets/esri/core/workers/chunks/0e25548573baf855e394.js +0 -1
  916. package/assets/esri/core/workers/chunks/0edd4c3ca6e7d749d0e5.js +0 -1
  917. package/assets/esri/core/workers/chunks/0fcbf7e2db58e38ee6d1.js +0 -1
  918. package/assets/esri/core/workers/chunks/133f971e72a1a6277ac4.js +0 -1
  919. package/assets/esri/core/workers/chunks/135a90ae61f3b3cae91b.js +0 -1
  920. package/assets/esri/core/workers/chunks/13fde7fd56c39fa3f2d5.js +0 -1
  921. package/assets/esri/core/workers/chunks/1c90855c3b0e5dcff908.js +0 -1
  922. package/assets/esri/core/workers/chunks/1dbef1919c7ac10a6bcc.js +0 -1
  923. package/assets/esri/core/workers/chunks/1facbda248863cf72cbd.js +0 -1
  924. package/assets/esri/core/workers/chunks/1fb2d7abe6c8efa84695.js +0 -1
  925. package/assets/esri/core/workers/chunks/2068377c2a796d5f2245.js +0 -1
  926. package/assets/esri/core/workers/chunks/28a5878cbe5880476855.js +0 -1
  927. package/assets/esri/core/workers/chunks/2cf3934b3ecabdf207c8.js +0 -1
  928. package/assets/esri/core/workers/chunks/2d42711a629384144625.js +0 -1
  929. package/assets/esri/core/workers/chunks/3021fda52083fc67d18c.js +0 -1
  930. package/assets/esri/core/workers/chunks/30333a95dc0a44e23fb5.js +0 -1
  931. package/assets/esri/core/workers/chunks/30837d93116f0337972f.js +0 -1
  932. package/assets/esri/core/workers/chunks/320543485c8e22485075.js +0 -1
  933. package/assets/esri/core/workers/chunks/3f0f7da92a6e4493686e.js +0 -1
  934. package/assets/esri/core/workers/chunks/42057f252ba4e82a8b45.js +0 -1
  935. package/assets/esri/core/workers/chunks/45a3f6033cdf4bc74a4c.js +0 -1
  936. package/assets/esri/core/workers/chunks/492b65fe99641f5740f0.js +0 -1
  937. package/assets/esri/core/workers/chunks/4d1cd7df617273c489f4.js +0 -1
  938. package/assets/esri/core/workers/chunks/4df9dfa80dbbae9b743d.js +0 -1
  939. package/assets/esri/core/workers/chunks/515c1c055666ff4740f3.js +0 -1
  940. package/assets/esri/core/workers/chunks/541e644fc77dbe527124.js +0 -1
  941. package/assets/esri/core/workers/chunks/59e341b2db44351bf557.js +0 -1
  942. package/assets/esri/core/workers/chunks/5a10b58533b4116115ac.js +0 -1
  943. package/assets/esri/core/workers/chunks/5f940853341d7e2bc852.js +0 -1
  944. package/assets/esri/core/workers/chunks/5ff2cdecf95e0136dd52.js +0 -1
  945. package/assets/esri/core/workers/chunks/6147bfbe2bd7292d6ad0.js +0 -1
  946. package/assets/esri/core/workers/chunks/6467f996fe9f136c370b.js +0 -1
  947. package/assets/esri/core/workers/chunks/682a8f15f352de76df69.js +0 -1
  948. package/assets/esri/core/workers/chunks/6a06635089761ee3e6d4.js +0 -972
  949. package/assets/esri/core/workers/chunks/725828a41917d3d56f2d.js +0 -1
  950. package/assets/esri/core/workers/chunks/794b47764ebb0257ed41.js +0 -1
  951. package/assets/esri/core/workers/chunks/7fd03a75eb07a09cda35.js +0 -1
  952. package/assets/esri/core/workers/chunks/86ad6b020c01850d9095.js +0 -1
  953. package/assets/esri/core/workers/chunks/86f9d1ce36661781d962.js +0 -1
  954. package/assets/esri/core/workers/chunks/8dcf6c836b53b40dfbf1.js +0 -1
  955. package/assets/esri/core/workers/chunks/8e98ff9404a802352037.js +0 -1
  956. package/assets/esri/core/workers/chunks/94e51fe1c539df6257c2.js +0 -1
  957. package/assets/esri/core/workers/chunks/9519a02b9b8db88a3150.js +0 -1
  958. package/assets/esri/core/workers/chunks/9a8b50ed75219b4a42e1.js +0 -1
  959. package/assets/esri/core/workers/chunks/9f3a094aa4b47e4eb046.js +0 -1
  960. package/assets/esri/core/workers/chunks/a0ebf25c9c9a7f839b93.js +0 -1
  961. package/assets/esri/core/workers/chunks/a25f0a195f9217665530.js +0 -1
  962. package/assets/esri/core/workers/chunks/a2be1e0b632cef87f6a4.js +0 -1
  963. package/assets/esri/core/workers/chunks/a4d8cf9829da9cfc5f36.js +0 -1
  964. package/assets/esri/core/workers/chunks/a562059dbdd1bf1fab66.js +0 -1
  965. package/assets/esri/core/workers/chunks/a59ee7d2b98c85f27dd2.js +0 -1
  966. package/assets/esri/core/workers/chunks/a5dbab94697757c87c49.js +0 -1
  967. package/assets/esri/core/workers/chunks/a5e65d5a7a536759d1cc.js +0 -1
  968. package/assets/esri/core/workers/chunks/a8ac0b6a3eba35e3a5b6.js +0 -1
  969. package/assets/esri/core/workers/chunks/acbd0f4d72d1f5d8e4e8.js +0 -1
  970. package/assets/esri/core/workers/chunks/acc97a210f36bff2d1b0.js +0 -1
  971. package/assets/esri/core/workers/chunks/ad68fe924456d6d7d4f0.js +0 -1
  972. package/assets/esri/core/workers/chunks/b06c949fc7d08e376a5f.js +0 -1
  973. package/assets/esri/core/workers/chunks/b26bd8fde2fc65bb67fb.js +0 -1
  974. package/assets/esri/core/workers/chunks/b4405e9fe6c0cf7250d3.js +0 -1
  975. package/assets/esri/core/workers/chunks/bc08fe3b03767bd694c5.js +0 -1
  976. package/assets/esri/core/workers/chunks/c11501e96ffd81bf39a0.js +0 -1
  977. package/assets/esri/core/workers/chunks/c44116378cc1bc627044.js +0 -1
  978. package/assets/esri/core/workers/chunks/c9b09099488d0e719dfb.js +0 -1
  979. package/assets/esri/core/workers/chunks/cbea4f1eb814115748db.js +0 -1
  980. package/assets/esri/core/workers/chunks/ce262a2accd982988ef1.js +0 -1
  981. package/assets/esri/core/workers/chunks/d15e6662d90718411d62.js +0 -1
  982. package/assets/esri/core/workers/chunks/d16aac3461af9cee0c29.js +0 -1
  983. package/assets/esri/core/workers/chunks/d60dd3e1028f714f2258.js +0 -1
  984. package/assets/esri/core/workers/chunks/d6c150c243ca1f6108f9.js +0 -1
  985. package/assets/esri/core/workers/chunks/d85748b57a71999caf3a.js +0 -1
  986. package/assets/esri/core/workers/chunks/d8c59b1d73650c060dfb.js +0 -1
  987. package/assets/esri/core/workers/chunks/dcb6e1b33402d7fa455b.js +0 -1
  988. package/assets/esri/core/workers/chunks/df653bca2b14dffc82d1.js +0 -1
  989. package/assets/esri/core/workers/chunks/e2a12142439d3037a3a7.js +0 -1
  990. package/assets/esri/core/workers/chunks/e3e1d87b8532bf84a18d.js +0 -1
  991. package/assets/esri/core/workers/chunks/e7744b7e0c16bba93151.js +0 -1
  992. package/assets/esri/core/workers/chunks/ea50effc5c39870dc871.js +0 -1
  993. package/assets/esri/core/workers/chunks/f1665a64564593f2a438.js +0 -1
  994. package/assets/esri/core/workers/chunks/f4c12f3a5e7f89106ae0.js +0 -1
  995. package/assets/esri/core/workers/chunks/fbefdc74b3aab716187f.js +0 -1
  996. package/assets/esri/core/workers/chunks/fc4fd9db056579e09bfe.js +0 -1
  997. package/assets/esri/core/workers/chunks/fd4907fa96f55128764d.js +0 -1
  998. package/views/3d/webgl-engine/core/shaderModules/BooleanUniform.js +0 -5
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.24/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../chunks/tslib.es6.js";import t from"../../core/Evented.js";import{HandleOwner as i}from"../../core/HandleOwner.js";import{clone as r}from"../../core/lang.js";import{isNone as n,destroyMaybe as s,removeMaybe as o,isSome as a,abortMaybe as p}from"../../core/maybe.js";import{debounce as h,ignoreAbortErrors as c}from"../../core/promiseUtils.js";import{createScreenPoint as d}from"../../core/screenUtils.js";import{property as l}from"../../core/accessorSupport/decorators/property.js";import"../../core/accessorSupport/ensureType.js";import{subclass as g}from"../../core/accessorSupport/decorators/subclass.js";import{pointEquals as m}from"../../layers/graphics/dehydratedFeatureComparison.js";import{ViewingMode as u}from"../ViewingMode.js";import{defaultDrawingMode as y}from"./DrawingMode.js";import{DrawManipulator as _}from"./DrawManipulator.js";import{createCoordinateHelper as v}from"../interactive/coordinateHelper.js";import{createManipulatorDragEventPipeline as x}from"../interactive/dragEventPipeline.js";import{EditGeometry as f,Component as V}from"../interactive/editGeometry/EditGeometry.js";import{EditGeometryOperations as S}from"../interactive/editGeometry/EditGeometryOperations.js";import{SnappingContext as T}from"../interactive/snapping/SnappingContext.js";import{SnappingPipeline as b}from"../interactive/snapping/SnappingDragPipelineStep.js";import{TaskPriority as w,ImmediateTask as M}from"../support/Scheduler.js";let C=class extends(t.EventedMixin(i)){constructor(e){super(e),this._createOperationCompleted=!1,this._pointerDownStates=new Set,this._snappingPipeline=new b,this._snappingAbortController=null,this._stagedVertex=null,this.snapToSceneEnabled=null,this._snap=h((async({snappingManager:e,mapPoint:t,context:i},r)=>{const n=await this._frameTask.schedule((()=>e.snap(t,i,r)),r);n.valid&&await this._frameTask.schedule((()=>{this.stagedVertex=n.apply(),t!==this._snapMapPoint&&(this.stagedVertex=e.update(this._snapMapPoint,i))}),r)})),n(e.elevationInfo)&&(this.elevationInfo={mode:e.hasZ?"absolute-height":"on-the-ground",offset:0})}initialize(){var e,t;this.coordinateHelper=v(this.hasZ,this.hasM,this.view.spatialReference);const i="3d"===this.view.type?null==(e=this.view)||null==(t=e.resourceController)?void 0:t.scheduler:null;this._frameTask=i?i.registerTask(w.SNAPPING):M;const r="viewingMode"in this.view.state?this.view.state.viewingMode:u.Local,n="segment"===this.geometryType||"multipoint"===this.geometryType?"polyline":this.geometryType;this._editGeometryOperations=new S(new f(n,this.coordinateHelper,r)),this._activeComponent=new V(this.spatialReference,r),this._editGeometryOperations.data.components.push(this._activeComponent),this.handles.add(this._editGeometryOperations.on(["vertex-add","vertex-update","vertex-remove"],(e=>{const t=e.vertices.map((e=>({componentIndex:0,vertexIndex:e.index,coordinates:this.coordinateHelper.vectorToArray(e.pos)}))),i=t.map((e=>e.coordinates));switch(e.type){case"vertex-add":this.emit(e.type,{...e,added:i,vertices:t});break;case"vertex-update":this.emit(e.type,{...e,updated:i,vertices:t});break;case"vertex-remove":this.emit(e.type,{...e,removed:i,vertices:t})}}))),this._manipulator=new _({grabbableForEvent:e=>"click"!==this.drawingMode||"touch"===e.pointerType&&this._snappingEnabled&&1===this._pointerDownStates.size}),this.manipulators.add(this._manipulator),this._manipulator.grabbable="point"!==this.geometryType,this.handles.add([this._createManipulatorDragPipeline(this._manipulator),this._manipulator.events.on("immediate-click",(e=>this._onImmediateClick(e))),this._manipulator.events.on("immediate-double-click",(e=>this._onImmediateDoubleClick(e)))])}destroy(){this._editGeometryOperations=s(this._editGeometryOperations),this._frameTask=o(this._frameTask)}get _snappingEnabled(){return a(this.snappingManager)&&this.snappingManager.options.effectiveEnabled}get canRedo(){return this._editGeometryOperations.canRedo}get canUndo(){return this._editGeometryOperations.canUndo}get committedVertices(){return this._activeComponent.vertices.map((e=>this.coordinateHelper.vectorToArray(e.pos)))}set drawingMode(e){this._set("drawingMode",null!=e?e:y)}get hasStagedVertex(){return a(this._stagedVertex)}get interactive(){return this._manipulator.interactive}set interactive(e){this._manipulator.interactive=e}get isCompleted(){return this._createOperationCompleted}get numCommittedVertices(){return this._activeComponent.vertices.length}get numVertices(){return a(this._stagedVertex)?this._activeComponent.vertices.length+1:this._activeComponent.vertices.length}get spatialReference(){return this.view.spatialReference}get stagedVertex(){return this._stagedVertex}set stagedVertex(e){if(n(e))this.discardStagedVertex();else{if(n(this._stagedVertex))this._stagedVertex=r(e);else{if(m(this._stagedVertex,e))return;this._stagedVertex.x=e.x,this._stagedVertex.y=e.y,this._stagedVertex.z=e.z,this._stagedVertex.m=e.m,this._stagedVertex.hasZ=e.hasZ,this._stagedVertex.hasM=e.hasM,this._stagedVertex.spatialReference=e.spatialReference}this.emit("cursor-update",{updated:null,vertices:[{componentIndex:0,vertexIndex:this._activeComponent.vertices.length,coordinates:this.coordinateHelper.pointToArray(e)}],operation:"apply",type:"vertex-update"})}}get updating(){return this.updatingHandles.updating}get vertices(){const e=this.committedVertices;return a(this._stagedVertex)&&e.push(this.coordinateHelper.pointToArray(this._stagedVertex)),e}cancel(){this.complete({aborted:!0})}commitStagedVertex(){if(this._snappingAbortController=p(this._snappingAbortController),a(this._stagedVertex)){const e=this._stagedVertex;this._stagedVertex=null,this._editGeometryOperations.appendVertex(this.coordinateHelper.pointToVector(e))}}complete(e){const t=e&&e.aborted||!1;this._snappingAbortController=p(this._snappingAbortController),a(this.snappingManager)&&this.snappingManager.doneSnapping(),"segment"===this.geometryType||"point"===this.geometryType?this.commitStagedVertex():this.discardStagedVertex();const i="multipoint"===this.geometryType&&0===this.numVertices||"polyline"===this.geometryType&&this.numVertices<2||"polygon"===this.geometryType&&this.numVertices<3;this._createOperationCompleted=!i,(this.isCompleted||t)&&this.emit("complete",{vertices:this.vertices.map(((e,t)=>({componentIndex:0,vertexIndex:t,coordinates:e}))),aborted:t,type:"complete"})}discardStagedVertex(){this._stagedVertex=null}onInputEvent(e){switch(e.type){case"pointer-down":this._pointerDownStates.add(e.pointerId);break;case"pointer-up":this._pointerDownStates.delete(e.pointerId)}switch(e.type){case"pointer-move":return this._onPointerMove(e);case"hold":return this._onHold(e)}}redo(){this._editGeometryOperations.redo()}undo(){a(this.snappingManager)&&this.snappingManager.doneSnapping(),this._editGeometryOperations.undo()}_closeOnClickVertexIndex(e){const t=this._activeComponent;if("polygon"===this.geometryType&&t.vertices.length>2){if(this._vertexWithinPointerDistance(t.vertices[0].pos,e))return 0;if(this._vertexWithinPointerDistance(t.vertices[t.vertices.length-1].pos,e))return t.vertices.length-1}return null}_createManipulatorDragPipeline(e){switch(this.drawingMode){case"click":return this._createManipulatorDragPipelineClick(e);case"freehand":return this._createManipulatorDragPipelineFreehand(e);case"hybrid":return this._createManipulatorDragPipelineHybrid(e)}}_createManipulatorDragPipelineClick(e){return x(e,((e,t,i,r)=>{const n="touch"===r&&this._snappingEnabled;!this.isCompleted&&n&&(t.next(this._screenToMapDragEventStep()).next((e=>("start"===e.action&&(this.stagedVertex=e.mapStart,("segment"===this.geometryType||n&&0===this.numVertices)&&this.commitStagedVertex()),e))).next(this._snappingPipeline.createSnapDragEventPipelineStep({predicate:()=>n,cancel:i,snappingManager:this.snappingManager,snappingContext:new T({editGeometryOperations:this._editGeometryOperations,elevationInfo:this.elevationInfo,pointer:r,visualizer:this.snappingVisualizer}),updatingHandles:this.updatingHandles}),this._snappingPipeline.next).next((e=>(n&&(this.stagedVertex=e.mapEnd,"end"===e.action&&this.commitStagedVertex()),e))).next((e=>("end"===e.action&&("segment"!==this.geometryType&&"point"!==this.geometryType||this.complete()),e))),i.next((()=>{n&&a(this.snappingManager)&&this.snappingManager.doneSnapping()})))}))}_createManipulatorDragPipelineFreehand(e){return x(e,((e,t)=>{this.isCompleted||t.next(this._screenToMapDragEventStep()).next((e=>("start"===e.action&&(n(this.stagedVertex)&&(this.stagedVertex=e.mapStart),"segment"===this.geometryType&&this.commitStagedVertex()),e))).next((e=>{switch(e.action){case"start":case"update":this.stagedVertex=e.mapEnd,"polygon"!==this.geometryType&&"polyline"!==this.geometryType||this.commitStagedVertex();break;case"end":this.complete()}return e}))}))}_createManipulatorDragPipelineHybrid(e){return x(e,((e,t)=>{this.isCompleted||t.next(this._screenToMapDragEventStep()).next((e=>("start"===e.action&&(n(this.stagedVertex)&&(this.stagedVertex=e.mapStart),this.commitStagedVertex()),e))).next((e=>{switch(e.action){case"start":case"update":this.stagedVertex=e.mapEnd,"polygon"!==this.geometryType&&"polyline"!==this.geometryType||this.commitStagedVertex();break;case"end":"segment"!==this.geometryType&&"point"!==this.geometryType||this.complete()}return e}))}))}_getDrawSurface(){if(n(this.elevationDrawSurface))return this.drawSurface;if(!this.coordinateHelper.hasZ)return this.elevationDrawSurface.defaultZ=null,this.elevationDrawSurface;let e=this.defaultZ,t=!1;a(this.elevationInfo)&&"absolute-height"===this.elevationInfo.mode&&(t=!0),a(this.snapToSceneEnabled)&&(t=this.snapToSceneEnabled),a(this.elevationInfo)&&"on-the-ground"===this.elevationInfo.mode&&(t=!1);const i=this._activeComponent.vertices.length;return("segment"===this.geometryType||"polygon"===this.geometryType)&&i>0&&(e=this.coordinateHelper.getZ(this._activeComponent.vertices[0].pos),t=!1),t?this.drawSurface:(this.elevationDrawSurface.defaultZ=e,this.elevationDrawSurface)}_mapToScreen(e){return this._getDrawSurface().mapToScreen(e)}_onHold(e){this._snappingAbortController=p(this._snappingAbortController),"click"===this.drawingMode&&"touch"===e.pointerType&&this._snappingEnabled&&(this.stagedVertex=e.mapPoint),e.stopPropagation()}_onImmediateClick(e){if("mouse"===e.pointerType&&2===e.button||this._manipulator.dragging)return;const t=this._activeComponent,i=this._closeOnClickVertexIndex(e.screenPoint);if(a(i))return e.stopPropagation(),this.discardStagedVertex(),void this.complete();const r=this._screenToMap(e.screenPoint);if(a(r))switch(this.drawingMode){case"freehand":"point"===this.geometryType&&(this.hasStagedVertex?this.commitStagedVertex():this._editGeometryOperations.appendVertex(this.coordinateHelper.pointToVector(r)),this.complete());break;case"click":case"hybrid":this._snappingAbortController=p(this._snappingAbortController),this.hasStagedVertex?this.commitStagedVertex():this._editGeometryOperations.appendVertex(this.coordinateHelper.pointToVector(r)),("point"===this.geometryType||"segment"===this.geometryType&&2===t.vertices.length||"segment"===this.geometryType&&"hybrid"===this.drawingMode&&1===t.vertices.length)&&this.complete()}e.stopPropagation()}_onImmediateDoubleClick(e){this._manipulator.dragging||"point"===this.geometryType||(this.complete(),e.stopPropagation())}_onPointerMove(e){if(this._manipulator.dragging||this._pointerDownStates.has(e.pointerId)||this._manipulator.grabbing||!this._manipulator.interactive)return void(this._snappingAbortController=p(this._snappingAbortController));e.stopPropagation();const t=d(e.x,e.y),i=this._closeOnClickVertexIndex(t);if(a(i))return this._closeOnVertex(i),void(this._snappingAbortController=p(this._snappingAbortController));const r=this._screenToMap(t);if(this._manipulator.cursor=a(r)?"crosshair":null,n(r))return void(this._snappingAbortController=p(this._snappingAbortController));if(n(this.snappingManager))return this.stagedVertex=r,void(this._snappingAbortController=p(this._snappingAbortController));const s=this.snappingManager,o=new T({editGeometryOperations:this._editGeometryOperations,elevationInfo:this.elevationInfo,pointer:e.pointerType,visualizer:this.snappingVisualizer});this.stagedVertex=s.update(r,o),this._snapMapPoint=r,n(this._snappingAbortController)&&(this._snappingAbortController=new AbortController),this.updatingHandles.addPromise(c(this._snap({snappingManager:s,mapPoint:r,context:o},this._snappingAbortController.signal)))}_closeOnVertex(e){this.discardStagedVertex();const t={componentIndex:0,vertexIndex:e,coordinates:this.coordinateHelper.vectorToArray(this._activeComponent.vertices[e].pos)};this.emit("cursor-update",{updated:null,vertices:[t],operation:"apply",type:"vertex-update"})}_screenToMap(e){return this._getDrawSurface().screenToMap(e)}_screenToMapDragEventStep(){let e=null;return t=>{if("start"===t.action&&(e=this._screenToMap(t.screenStart)),n(e))return null;const i=this._screenToMap(t.screenEnd);return a(i)?{...t,mapStart:e,mapEnd:i}:null}}_vertexWithinPointerDistance(e,t){const i=25,r=this._mapToScreen(this.coordinateHelper.vectorToDehydratedPoint(e));return!!a(r)&&O(r,t,i)}};function O(e,t,i){const r=e.x-t.x,n=e.y-t.y;return r*r+n*n<=i}e([l()],C.prototype,"defaultZ",void 0),e([l({value:y})],C.prototype,"drawingMode",null),e([l({constructOnly:!0})],C.prototype,"elevationDrawSurface",void 0),e([l({constructOnly:!0})],C.prototype,"elevationInfo",void 0),e([l({constructOnly:!0})],C.prototype,"geometryType",void 0),e([l({constructOnly:!0})],C.prototype,"hasM",void 0),e([l({constructOnly:!0})],C.prototype,"hasZ",void 0),e([l({constructOnly:!0})],C.prototype,"manipulators",void 0),e([l({constructOnly:!0})],C.prototype,"drawSurface",void 0),e([l({constructOnly:!0})],C.prototype,"snappingManager",void 0),e([l({constructOnly:!0})],C.prototype,"snappingVisualizer",void 0),e([l()],C.prototype,"snapToSceneEnabled",void 0),e([l({readOnly:!0})],C.prototype,"updating",null),e([l({constructOnly:!0})],C.prototype,"view",void 0),C=e([g("esri.views.draw.DrawOperation")],C);export{C as DrawOperation};
5
+ import{_ as e}from"../../chunks/tslib.es6.js";import t from"../../core/Evented.js";import{HandleOwner as i}from"../../core/HandleOwner.js";import{clone as r}from"../../core/lang.js";import{isNone as n,destroyMaybe as s,removeMaybe as o,isSome as a,abortMaybe as p}from"../../core/maybe.js";import{debounce as h,ignoreAbortErrors as c}from"../../core/promiseUtils.js";import{createScreenPoint as d}from"../../core/screenUtils.js";import{property as l}from"../../core/accessorSupport/decorators/property.js";import"../../core/accessorSupport/ensureType.js";import{subclass as g}from"../../core/accessorSupport/decorators/subclass.js";import{pointEquals as m}from"../../layers/graphics/dehydratedFeatureComparison.js";import{ViewingMode as u}from"../ViewingMode.js";import{defaultDrawingMode as y}from"./DrawingMode.js";import{DrawManipulator as _}from"./DrawManipulator.js";import{createCoordinateHelper as v}from"../interactive/coordinateHelper.js";import{createManipulatorDragEventPipeline as x}from"../interactive/dragEventPipeline.js";import{EditGeometry as f,Component as V}from"../interactive/editGeometry/EditGeometry.js";import{EditGeometryOperations as S}from"../interactive/editGeometry/EditGeometryOperations.js";import{SnappingContext as T}from"../interactive/snapping/SnappingContext.js";import{SnappingPipeline as b}from"../interactive/snapping/SnappingDragPipelineStep.js";import{TaskPriority as w,ImmediateTask as M}from"../support/Scheduler.js";let C=class extends(t.EventedMixin(i)){constructor(e){super(e),this._createOperationCompleted=!1,this._pointerDownStates=new Set,this._snappingPipeline=new b,this._snappingAbortController=null,this._stagedVertex=null,this.snapToSceneEnabled=null,this._snap=h((async({snappingManager:e,mapPoint:t,context:i},r)=>{const n=await this._frameTask.schedule((()=>e.snap(t,i,r)),r);n.valid&&await this._frameTask.schedule((()=>{this.stagedVertex=n.apply(),t!==this._snapMapPoint&&(this.stagedVertex=e.update(this._snapMapPoint,i))}),r)})),n(e.elevationInfo)&&(this.elevationInfo={mode:e.hasZ?"absolute-height":"on-the-ground",offset:0})}initialize(){this.coordinateHelper=v(this.hasZ,this.hasM,this.view.spatialReference);const e="3d"===this.view.type?this.view?.resourceController?.scheduler:null;this._frameTask=e?e.registerTask(w.SNAPPING):M;const t="viewingMode"in this.view.state?this.view.state.viewingMode:u.Local,i="segment"===this.geometryType||"multipoint"===this.geometryType?"polyline":this.geometryType;this._editGeometryOperations=new S(new f(i,this.coordinateHelper,t)),this._activeComponent=new V(this.spatialReference,t),this._editGeometryOperations.data.components.push(this._activeComponent),this.handles.add(this._editGeometryOperations.on(["vertex-add","vertex-update","vertex-remove"],(e=>{const t=e.vertices.map((e=>({componentIndex:0,vertexIndex:e.index,coordinates:this.coordinateHelper.vectorToArray(e.pos)}))),i=t.map((e=>e.coordinates));switch(e.type){case"vertex-add":this.emit(e.type,{...e,added:i,vertices:t});break;case"vertex-update":this.emit(e.type,{...e,updated:i,vertices:t});break;case"vertex-remove":this.emit(e.type,{...e,removed:i,vertices:t})}}))),this._manipulator=new _({grabbableForEvent:e=>"click"!==this.drawingMode||"touch"===e.pointerType&&this._snappingEnabled&&1===this._pointerDownStates.size}),this.manipulators.add(this._manipulator),this._manipulator.grabbable="point"!==this.geometryType,this.handles.add([this._createManipulatorDragPipeline(this._manipulator),this._manipulator.events.on("immediate-click",(e=>this._onImmediateClick(e))),this._manipulator.events.on("immediate-double-click",(e=>this._onImmediateDoubleClick(e)))])}destroy(){this._editGeometryOperations=s(this._editGeometryOperations),this._frameTask=o(this._frameTask)}get _snappingEnabled(){return a(this.snappingManager)&&this.snappingManager.options.effectiveEnabled}get canRedo(){return this._editGeometryOperations.canRedo}get canUndo(){return this._editGeometryOperations.canUndo}get committedVertices(){return this._activeComponent.vertices.map((e=>this.coordinateHelper.vectorToArray(e.pos)))}set drawingMode(e){this._set("drawingMode",e??y)}get hasStagedVertex(){return a(this._stagedVertex)}get interactive(){return this._manipulator.interactive}set interactive(e){this._manipulator.interactive=e}get isCompleted(){return this._createOperationCompleted}get numCommittedVertices(){return this._activeComponent.vertices.length}get numVertices(){return a(this._stagedVertex)?this._activeComponent.vertices.length+1:this._activeComponent.vertices.length}get spatialReference(){return this.view.spatialReference}get stagedVertex(){return this._stagedVertex}set stagedVertex(e){if(n(e))this.discardStagedVertex();else{if(n(this._stagedVertex))this._stagedVertex=r(e);else{if(m(this._stagedVertex,e))return;this._stagedVertex.x=e.x,this._stagedVertex.y=e.y,this._stagedVertex.z=e.z,this._stagedVertex.m=e.m,this._stagedVertex.hasZ=e.hasZ,this._stagedVertex.hasM=e.hasM,this._stagedVertex.spatialReference=e.spatialReference}this.emit("cursor-update",{updated:null,vertices:[{componentIndex:0,vertexIndex:this._activeComponent.vertices.length,coordinates:this.coordinateHelper.pointToArray(e)}],operation:"apply",type:"vertex-update"})}}get updating(){return this.updatingHandles.updating}get vertices(){const e=this.committedVertices;return a(this._stagedVertex)&&e.push(this.coordinateHelper.pointToArray(this._stagedVertex)),e}cancel(){this.complete({aborted:!0})}commitStagedVertex(){if(this._snappingAbortController=p(this._snappingAbortController),a(this._stagedVertex)){const e=this._stagedVertex;this._stagedVertex=null,this._editGeometryOperations.appendVertex(this.coordinateHelper.pointToVector(e))}}complete(e){const t=e&&e.aborted||!1;this._snappingAbortController=p(this._snappingAbortController),a(this.snappingManager)&&this.snappingManager.doneSnapping(),"segment"===this.geometryType||"point"===this.geometryType?this.commitStagedVertex():this.discardStagedVertex();const i="multipoint"===this.geometryType&&0===this.numVertices||"polyline"===this.geometryType&&this.numVertices<2||"polygon"===this.geometryType&&this.numVertices<3;this._createOperationCompleted=!i,(this.isCompleted||t)&&this.emit("complete",{vertices:this.vertices.map(((e,t)=>({componentIndex:0,vertexIndex:t,coordinates:e}))),aborted:t,type:"complete"})}discardStagedVertex(){this._stagedVertex=null}onInputEvent(e){switch(e.type){case"pointer-down":this._pointerDownStates.add(e.pointerId);break;case"pointer-up":this._pointerDownStates.delete(e.pointerId)}switch(e.type){case"pointer-move":return this._onPointerMove(e);case"hold":return this._onHold(e)}}redo(){this._editGeometryOperations.redo()}undo(){a(this.snappingManager)&&this.snappingManager.doneSnapping(),this._editGeometryOperations.undo()}_closeOnClickVertexIndex(e){const t=this._activeComponent;if("polygon"===this.geometryType&&t.vertices.length>2){if(this._vertexWithinPointerDistance(t.vertices[0].pos,e))return 0;if(this._vertexWithinPointerDistance(t.vertices[t.vertices.length-1].pos,e))return t.vertices.length-1}return null}_createManipulatorDragPipeline(e){switch(this.drawingMode){case"click":return this._createManipulatorDragPipelineClick(e);case"freehand":return this._createManipulatorDragPipelineFreehand(e);case"hybrid":return this._createManipulatorDragPipelineHybrid(e)}}_createManipulatorDragPipelineClick(e){return x(e,((e,t,i,r)=>{const n="touch"===r&&this._snappingEnabled;!this.isCompleted&&n&&(t.next(this._screenToMapDragEventStep()).next((e=>("start"===e.action&&(this.stagedVertex=e.mapStart,("segment"===this.geometryType||n&&0===this.numVertices)&&this.commitStagedVertex()),e))).next(this._snappingPipeline.createSnapDragEventPipelineStep({predicate:()=>n,cancel:i,snappingManager:this.snappingManager,snappingContext:new T({editGeometryOperations:this._editGeometryOperations,elevationInfo:this.elevationInfo,pointer:r,visualizer:this.snappingVisualizer}),updatingHandles:this.updatingHandles}),this._snappingPipeline.next).next((e=>(n&&(this.stagedVertex=e.mapEnd,"end"===e.action&&this.commitStagedVertex()),e))).next((e=>("end"===e.action&&("segment"!==this.geometryType&&"point"!==this.geometryType||this.complete()),e))),i.next((()=>{n&&a(this.snappingManager)&&this.snappingManager.doneSnapping()})))}))}_createManipulatorDragPipelineFreehand(e){return x(e,((e,t)=>{this.isCompleted||t.next(this._screenToMapDragEventStep()).next((e=>("start"===e.action&&(n(this.stagedVertex)&&(this.stagedVertex=e.mapStart),"segment"===this.geometryType&&this.commitStagedVertex()),e))).next((e=>{switch(e.action){case"start":case"update":this.stagedVertex=e.mapEnd,"polygon"!==this.geometryType&&"polyline"!==this.geometryType||this.commitStagedVertex();break;case"end":this.complete()}return e}))}))}_createManipulatorDragPipelineHybrid(e){return x(e,((e,t)=>{this.isCompleted||t.next(this._screenToMapDragEventStep()).next((e=>("start"===e.action&&(n(this.stagedVertex)&&(this.stagedVertex=e.mapStart),this.commitStagedVertex()),e))).next((e=>{switch(e.action){case"start":case"update":this.stagedVertex=e.mapEnd,"polygon"!==this.geometryType&&"polyline"!==this.geometryType||this.commitStagedVertex();break;case"end":"segment"!==this.geometryType&&"point"!==this.geometryType||this.complete()}return e}))}))}_getDrawSurface(){if(n(this.elevationDrawSurface))return this.drawSurface;if(!this.coordinateHelper.hasZ)return this.elevationDrawSurface.defaultZ=null,this.elevationDrawSurface;let e=this.defaultZ,t=!1;a(this.elevationInfo)&&"absolute-height"===this.elevationInfo.mode&&(t=!0),a(this.snapToSceneEnabled)&&(t=this.snapToSceneEnabled),a(this.elevationInfo)&&"on-the-ground"===this.elevationInfo.mode&&(t=!1);const i=this._activeComponent.vertices.length;return("segment"===this.geometryType||"polygon"===this.geometryType)&&i>0&&(e=this.coordinateHelper.getZ(this._activeComponent.vertices[0].pos),t=!1),t?this.drawSurface:(this.elevationDrawSurface.defaultZ=e,this.elevationDrawSurface)}_mapToScreen(e){return this._getDrawSurface().mapToScreen(e)}_onHold(e){this._snappingAbortController=p(this._snappingAbortController),"click"===this.drawingMode&&"touch"===e.pointerType&&this._snappingEnabled&&(this.stagedVertex=e.mapPoint),e.stopPropagation()}_onImmediateClick(e){if("mouse"===e.pointerType&&2===e.button||this._manipulator.dragging)return;const t=this._activeComponent,i=this._closeOnClickVertexIndex(e.screenPoint);if(a(i))return e.stopPropagation(),this.discardStagedVertex(),void this.complete();const r=this._screenToMap(e.screenPoint);if(a(r))switch(this.drawingMode){case"freehand":"point"===this.geometryType&&(this.hasStagedVertex?this.commitStagedVertex():this._editGeometryOperations.appendVertex(this.coordinateHelper.pointToVector(r)),this.complete());break;case"click":case"hybrid":this._snappingAbortController=p(this._snappingAbortController),this.hasStagedVertex?this.commitStagedVertex():this._editGeometryOperations.appendVertex(this.coordinateHelper.pointToVector(r)),("point"===this.geometryType||"segment"===this.geometryType&&2===t.vertices.length||"segment"===this.geometryType&&"hybrid"===this.drawingMode&&1===t.vertices.length)&&this.complete()}e.stopPropagation()}_onImmediateDoubleClick(e){this._manipulator.dragging||"point"===this.geometryType||(this.complete(),e.stopPropagation())}_onPointerMove(e){if(this._manipulator.dragging||this._pointerDownStates.has(e.pointerId)||this._manipulator.grabbing||!this._manipulator.interactive)return void(this._snappingAbortController=p(this._snappingAbortController));e.stopPropagation();const t=d(e.x,e.y),i=this._closeOnClickVertexIndex(t);if(a(i))return this._closeOnVertex(i),void(this._snappingAbortController=p(this._snappingAbortController));const r=this._screenToMap(t);if(this._manipulator.cursor=a(r)?"crosshair":null,n(r))return void(this._snappingAbortController=p(this._snappingAbortController));if(n(this.snappingManager))return this.stagedVertex=r,void(this._snappingAbortController=p(this._snappingAbortController));const s=this.snappingManager,o=new T({editGeometryOperations:this._editGeometryOperations,elevationInfo:this.elevationInfo,pointer:e.pointerType,visualizer:this.snappingVisualizer});this.stagedVertex=s.update(r,o),this._snapMapPoint=r,n(this._snappingAbortController)&&(this._snappingAbortController=new AbortController),this.updatingHandles.addPromise(c(this._snap({snappingManager:s,mapPoint:r,context:o},this._snappingAbortController.signal)))}_closeOnVertex(e){this.discardStagedVertex();const t={componentIndex:0,vertexIndex:e,coordinates:this.coordinateHelper.vectorToArray(this._activeComponent.vertices[e].pos)};this.emit("cursor-update",{updated:null,vertices:[t],operation:"apply",type:"vertex-update"})}_screenToMap(e){return this._getDrawSurface().screenToMap(e)}_screenToMapDragEventStep(){let e=null;return t=>{if("start"===t.action&&(e=this._screenToMap(t.screenStart)),n(e))return null;const i=this._screenToMap(t.screenEnd);return a(i)?{...t,mapStart:e,mapEnd:i}:null}}_vertexWithinPointerDistance(e,t){const i=25,r=this._mapToScreen(this.coordinateHelper.vectorToDehydratedPoint(e));return!!a(r)&&O(r,t,i)}};function O(e,t,i){const r=e.x-t.x,n=e.y-t.y;return r*r+n*n<=i}e([l()],C.prototype,"defaultZ",void 0),e([l({value:y})],C.prototype,"drawingMode",null),e([l({constructOnly:!0})],C.prototype,"elevationDrawSurface",void 0),e([l({constructOnly:!0})],C.prototype,"elevationInfo",void 0),e([l({constructOnly:!0})],C.prototype,"geometryType",void 0),e([l({constructOnly:!0})],C.prototype,"hasM",void 0),e([l({constructOnly:!0})],C.prototype,"hasZ",void 0),e([l({constructOnly:!0})],C.prototype,"manipulators",void 0),e([l({constructOnly:!0})],C.prototype,"drawSurface",void 0),e([l({constructOnly:!0})],C.prototype,"snappingManager",void 0),e([l({constructOnly:!0})],C.prototype,"snappingVisualizer",void 0),e([l()],C.prototype,"snapToSceneEnabled",void 0),e([l({readOnly:!0})],C.prototype,"updating",null),e([l({constructOnly:!0})],C.prototype,"view",void 0),C=e([g("esri.views.draw.DrawOperation")],C);export{C as DrawOperation};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.24/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../chunks/tslib.es6.js";import t from"../../core/Evented.js";import{HandleOwnerMixin as o}from"../../core/HandleOwner.js";import{unwrapOr as r,destroyMaybe as i}from"../../core/maybe.js";import{property as n}from"../../core/accessorSupport/decorators/property.js";import"../../core/arrayUtils.js";import"../../core/has.js";import"../../core/accessorSupport/ensureType.js";import{subclass as a}from"../../core/accessorSupport/decorators/subclass.js";import{DrawOperation as s}from"./DrawOperation.js";import{SceneDrawSurface as p,ElevationDrawSurface as d}from"./drawSurfaces.js";import{InteractiveToolBase as l}from"../interactive/InteractiveToolBase.js";let h=class extends(o(t.EventedMixin(l))){constructor(e){super(e),this.defaultZ=0,this.elevationInfo=null,this.hasZ=!0,this.mode=null,this.snapToScene=null,this.type="draw-3d"}initialize(){const e=r(this.elevationInfo,{mode:this.hasZ?"absolute-height":"on-the-ground",offset:0}),t=this.view;this.drawOperation=new s({view:t,manipulators:this.manipulators,geometryType:this.geometryType,drawingMode:this.mode,hasZ:this.hasZ,defaultZ:this.defaultZ,snapToSceneEnabled:this.snapToScene,drawSurface:"3d"===t.type?new p(t,e):null,elevationDrawSurface:"3d"===t.type?new d(e,this.defaultZ,t):null,hasM:!1,elevationInfo:e}),this.handles.add([this.drawOperation.on("vertex-add",(e=>this.onVertexAdd(e))),this.drawOperation.on("vertex-remove",(e=>this.onVertexRemove(e))),this.drawOperation.on("vertex-update",(e=>this.onVertexUpdate(e))),this.drawOperation.on("cursor-update",(e=>this.onCursorUpdate(e))),this.drawOperation.on("complete",(e=>this.onComplete(e)))]),this.finishToolCreation()}destroy(){this.drawOperation=i(this.drawOperation),this._set("view",null)}get canRedo(){return this.drawOperation.canRedo}get canUndo(){return this.drawOperation.canUndo}set enabled(e){this.drawOperation.interactive=e,this._set("enabled",e)}get updating(){var e,t;return null!=(e=null==(t=this.drawOperation)?void 0:t.updating)&&e}completeCreateOperation(){this.drawOperation.complete()}onDeactivate(){this.drawOperation.isCompleted||this.drawOperation.cancel()}getVertexCoords(){return this.drawOperation.vertices}onInputEvent(e){this.drawOperation.onInputEvent(e)}redo(){this.drawOperation.redo()}reset(){}undo(){this.drawOperation.undo()}onComplete(e){this.emit("complete",e)}onCursorUpdate(e){this.emit("cursor-update",e)}onVertexAdd(e){this.emit("vertex-add",e)}onVertexRemove(e){this.emit("vertex-remove",e)}onVertexUpdate(e){this.emit("vertex-update",e)}};e([n({constructOnly:!0,nonNullable:!0})],h.prototype,"defaultZ",void 0),e([n()],h.prototype,"drawOperation",void 0),e([n({constructOnly:!0})],h.prototype,"elevationInfo",void 0),e([n({value:!0})],h.prototype,"enabled",null),e([n({constructOnly:!0})],h.prototype,"geometryType",void 0),e([n({constructOnly:!0})],h.prototype,"hasZ",void 0),e([n({constructOnly:!0})],h.prototype,"mode",void 0),e([n()],h.prototype,"snapToScene",void 0),e([n({readOnly:!0})],h.prototype,"type",void 0),e([n({readOnly:!0})],h.prototype,"updating",null),e([n({constructOnly:!0,nonNullable:!0})],h.prototype,"view",void 0),h=e([a("esri.views.draw.DrawTool")],h);export{h as DrawTool};
5
+ import{_ as e}from"../../chunks/tslib.es6.js";import t from"../../core/Evented.js";import{HandleOwnerMixin as o}from"../../core/HandleOwner.js";import{unwrapOr as r,destroyMaybe as i}from"../../core/maybe.js";import{property as n}from"../../core/accessorSupport/decorators/property.js";import"../../core/arrayUtils.js";import"../../core/has.js";import"../../core/accessorSupport/ensureType.js";import{subclass as a}from"../../core/accessorSupport/decorators/subclass.js";import{DrawOperation as s}from"./DrawOperation.js";import{SceneDrawSurface as p,ElevationDrawSurface as d}from"./drawSurfaces.js";import{InteractiveToolBase as l}from"../interactive/InteractiveToolBase.js";let h=class extends(o(t.EventedMixin(l))){constructor(e){super(e),this.defaultZ=0,this.elevationInfo=null,this.hasZ=!0,this.mode=null,this.snapToScene=null,this.type="draw-3d"}initialize(){const e=r(this.elevationInfo,{mode:this.hasZ?"absolute-height":"on-the-ground",offset:0}),t=this.view;this.drawOperation=new s({view:t,manipulators:this.manipulators,geometryType:this.geometryType,drawingMode:this.mode,hasZ:this.hasZ,defaultZ:this.defaultZ,snapToSceneEnabled:this.snapToScene,drawSurface:"3d"===t.type?new p(t,e):null,elevationDrawSurface:"3d"===t.type?new d(e,this.defaultZ,t):null,hasM:!1,elevationInfo:e}),this.handles.add([this.drawOperation.on("vertex-add",(e=>this.onVertexAdd(e))),this.drawOperation.on("vertex-remove",(e=>this.onVertexRemove(e))),this.drawOperation.on("vertex-update",(e=>this.onVertexUpdate(e))),this.drawOperation.on("cursor-update",(e=>this.onCursorUpdate(e))),this.drawOperation.on("complete",(e=>this.onComplete(e)))]),this.finishToolCreation()}destroy(){this.drawOperation=i(this.drawOperation),this._set("view",null)}get canRedo(){return this.drawOperation.canRedo}get canUndo(){return this.drawOperation.canUndo}set enabled(e){this.drawOperation.interactive=e,this._set("enabled",e)}get updating(){return this.drawOperation?.updating??!1}completeCreateOperation(){this.drawOperation.complete()}onDeactivate(){this.drawOperation.isCompleted||this.drawOperation.cancel()}getVertexCoords(){return this.drawOperation.vertices}onInputEvent(e){this.drawOperation.onInputEvent(e)}redo(){this.drawOperation.redo()}reset(){}undo(){this.drawOperation.undo()}onComplete(e){this.emit("complete",e)}onCursorUpdate(e){this.emit("cursor-update",e)}onVertexAdd(e){this.emit("vertex-add",e)}onVertexRemove(e){this.emit("vertex-remove",e)}onVertexUpdate(e){this.emit("vertex-update",e)}};e([n({constructOnly:!0,nonNullable:!0})],h.prototype,"defaultZ",void 0),e([n()],h.prototype,"drawOperation",void 0),e([n({constructOnly:!0})],h.prototype,"elevationInfo",void 0),e([n({value:!0})],h.prototype,"enabled",null),e([n({constructOnly:!0})],h.prototype,"geometryType",void 0),e([n({constructOnly:!0})],h.prototype,"hasZ",void 0),e([n({constructOnly:!0})],h.prototype,"mode",void 0),e([n()],h.prototype,"snapToScene",void 0),e([n({readOnly:!0})],h.prototype,"type",void 0),e([n({readOnly:!0})],h.prototype,"updating",null),e([n({constructOnly:!0,nonNullable:!0})],h.prototype,"view",void 0),h=e([a("esri.views.draw.DrawTool")],h);export{h as DrawTool};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.24/esri/copyright.txt for details.
4
4
  */
5
- import{_ as t}from"../../../chunks/tslib.es6.js";import"../../../geometry.js";import e from"../../../Graphic.js";import i from"../../../core/Evented.js";import{isSome as r}from"../../../core/maybe.js";import{when as s,watch as o}from"../../../core/reactiveUtils.js";import{property as a}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/arrayUtils.js";import"../../../core/has.js";import"../../../core/accessorSupport/ensureType.js";import{subclass as h}from"../../../core/accessorSupport/decorators/subclass.js";import{create as c}from"../../../geometry/support/aaBoundingRect.js";import{getRingsOrPathsBounds as n}from"../../../geometry/support/boundsUtils.js";import{geometryToCoordinates as l}from"../../../geometry/support/coordsUtils.js";import p from"../../../geometry/support/rotate.js";import _ from"../../../symbols/SimpleFillSymbol.js";import u from"../../../symbols/SimpleLineSymbol.js";import g from"../../../symbols/SimpleMarkerSymbol.js";import{cloneMove as d,scale as v,getScaleRatio as m,getRotationAngle as y}from"./drawUtils.js";import G from"./GraphicMover.js";import f from"./HighlightHelper.js";import{addUniqueLayer as b}from"./layerUtils.js";import{settings as w}from"./settings.js";import x from"../../../geometry/Point.js";import S from"../../../geometry/Polygon.js";import k from"../../../geometry/Polyline.js";class R{constructor(t,e,i,r){this.graphics=t,this.mover=e,this.dx=i,this.dy=r,this.type="move-start"}}class I{constructor(t,e,i,r){this.graphics=t,this.mover=e,this.dx=i,this.dy=r,this.type="move"}}class M{constructor(t,e,i,r){this.graphics=t,this.mover=e,this.dx=i,this.dy=r,this.type="move-stop"}}class C{constructor(t,e,i){this.graphics=t,this.mover=e,this.angle=i,this.type="rotate-start"}}class H{constructor(t,e,i){this.graphics=t,this.mover=e,this.angle=i,this.type="rotate"}}class j{constructor(t,e,i){this.graphics=t,this.mover=e,this.angle=i,this.type="rotate-stop"}}class O{constructor(t,e,i,r){this.graphics=t,this.mover=e,this.xScale=i,this.yScale=r,this.type="scale-start"}}class E{constructor(t,e,i,r){this.graphics=t,this.mover=e,this.xScale=i,this.yScale=r,this.type="scale"}}class B{constructor(t,e,i,r){this.graphics=t,this.mover=e,this.xScale=i,this.yScale=r,this.type="scale-stop"}}const L=w.transformGraphics,Y={centerIndicator:new g({style:"cross",size:L.center.size,color:L.center.color}),fill:{default:new _({color:L.fill.color,outline:{color:L.fill.outlineColor,join:"round",width:1}}),active:new _({color:L.fill.stagedColor,outline:{color:L.fill.outlineColor,join:"round",style:"dash",width:1}})},handles:{default:new g({style:"square",size:L.vertex.size,color:L.vertex.color,outline:{color:L.vertex.outlineColor,width:1}}),hover:new g({style:"square",size:L.vertex.hoverSize,color:L.vertex.hoverColor,outline:{color:L.vertex.hoverOutlineColor,width:1}})},rotator:{default:new g({style:"circle",size:L.vertex.size,color:L.vertex.color,outline:{color:L.vertex.outlineColor,width:1}}),hover:new g({style:"circle",size:L.vertex.hoverSize,color:L.vertex.hoverColor,outline:{color:L.vertex.hoverOutlineColor,width:1}})},rotatorLine:new u({color:L.line.color,width:1})};let z=class extends i.EventedAccessor{constructor(t){super(t),this._activeHandleGraphic=null,this._graphicAttributes={esriSketchTool:"box"},this._mover=null,this._centerGraphic=null,this._backgroundGraphic=null,this._vertexGraphics=[],this._rotateHandleGraphic=null,this._rotateGraphicOffset=20,this._angleOfRotation=0,this._rotateLineGraphic=null,this._startInfo=null,this._totalDx=0,this._totalDy=0,this._xScale=1,this._yScale=1,this.type="box",this.callbacks={onMoveStart(){},onMove(){},onMoveStop(){},onScaleStart(){},onScale(){},onScaleStop(){},onRotateStart(){},onRotate(){},onRotateStop(){},onGraphicClick(){}},this.enableMovement=!0,this.enableRotation=!0,this.enableScaling=!0,this.graphics=[],this.highlightsEnabled=!0,this.layer=null,this.preserveAspectRatio=!1,this.showCenterGraphic=!0,this.symbols=Y,this.view=null,this._getBounds=(()=>{const t=c();return(e,i)=>{e[0]=Number.POSITIVE_INFINITY,e[1]=Number.POSITIVE_INFINITY,e[2]=Number.NEGATIVE_INFINITY,e[3]=Number.NEGATIVE_INFINITY;for(const r of i){if(!r)continue;let i,s,o,a;if("point"===r.type)i=o=r.x,s=a=r.y;else if("multipoint"===r.type){const e=l(r);[i,s,o,a]=n(t,[e])}else if("extent"===r.type)[i,s,o,a]=[r.xmin,r.ymin,r.xmax,r.ymax];else{const e=l(r);[i,s,o,a]=n(t,e)}e[0]=Math.min(i,e[0]),e[1]=Math.min(s,e[1]),e[2]=Math.max(o,e[2]),e[3]=Math.max(a,e[3])}return e}})()}initialize(){this._highlightHelper=new f({view:this.view}),this._setup(),this.own([s((()=>{var t;return null==(t=this.view)?void 0:t.ready}),(()=>{const{layer:t,view:e}=this;b(e,t)}),{once:!0,initial:!0}),o((()=>this.preserveAspectRatio),(()=>{this._activeHandleGraphic&&(this._scaleGraphic(this._activeHandleGraphic),this._updateGraphics())})),o((()=>{var t;return null==(t=this.view)?void 0:t.scale}),(()=>{this._updateRotateGraphic(),this._updateRotateLineGraphic()})),o((()=>this.graphics),(()=>this.refresh())),o((()=>this.layer),((t,e)=>{e&&this._resetGraphics(e),this.refresh()})),o((()=>this.highlightsEnabled),(()=>{var t;null==(t=this._highlightHelper)||t.removeAll(),this._setUpHighlights()})),this.on("move-start",(t=>{var e;return null==(e=this.callbacks)||null==e.onMoveStart?void 0:e.onMoveStart(t)})),this.on("move",(t=>{var e;return null==(e=this.callbacks)||null==e.onMove?void 0:e.onMove(t)})),this.on("move-stop",(t=>{var e;return null==(e=this.callbacks)||null==e.onMoveStop?void 0:e.onMoveStop(t)})),this.on("rotate-start",(t=>{var e;return null==(e=this.callbacks)||null==e.onRotateStart?void 0:e.onRotateStart(t)})),this.on("rotate",(t=>{var e;return null==(e=this.callbacks)||null==e.onRotate?void 0:e.onRotate(t)})),this.on("rotate-stop",(t=>{var e;return null==(e=this.callbacks)||null==e.onRotateStop?void 0:e.onRotateStop(t)})),this.on("scale-start",(t=>{var e;return null==(e=this.callbacks)||null==e.onScaleStart?void 0:e.onScaleStart(t)})),this.on("scale",(t=>{var e;return null==(e=this.callbacks)||null==e.onScale?void 0:e.onScale(t)})),this.on("scale-stop",(t=>{var e;return null==(e=this.callbacks)||null==e.onScaleStop?void 0:e.onScaleStop(t)}))])}destroy(){this._reset()}get state(){var t,e;const i=null!=(t=null==(e=this.view)?void 0:e.ready)&&t,r=this.graphics.length&&this.layer;return i&&r?"active":i?"ready":"disabled"}isUIGraphic(t){return this._vertexGraphics.includes(t)||t===this._backgroundGraphic||t===this._centerGraphic||t===this._rotateHandleGraphic||t===this._rotateLineGraphic}move(t,e){if(this._mover&&this.graphics.length){for(const i of this.graphics){const r=i.geometry,s=d(r,t,e,this.view);i.geometry=s}this.refresh(),this.emit("move-stop",new M(this.graphics,null,t,e))}}scale(t,e){if(this._mover&&this.graphics.length){for(const i of this.graphics){const r=i.geometry,s=v(r,t,e);i.geometry=s}this.refresh(),this.emit("scale-stop",new B(this.graphics,null,t,e))}}rotate(t,e){if(this._mover&&this.graphics.length){if(!e){const t=this._vertexGraphics[1].geometry.x,i=this._vertexGraphics[3].geometry.y;e=new x(t,i,this.view.spatialReference)}for(const i of this.graphics){const r=i.geometry,s=p(r,t,e);i.geometry=s}this.refresh(),this.emit("rotate-stop",new j(this.graphics,null,t))}}refresh(){this._reset(),this._setup()}reset(){this.graphics=[]}_setup(){"active"===this.state&&(this._setUpHighlights(),this._setupGraphics(),this._setupMover(),this._updateGraphics())}_reset(){this._highlightHelper.removeAll(),this._resetGraphicStateVars(),this._resetGraphics(),this._mover&&this._mover.destroy(),this._mover=null,this.view.cursor="default"}_resetGraphicStateVars(){this._startInfo=null,this._activeHandleGraphic=null,this._totalDx=0,this._totalDy=0,this._xScale=1,this._yScale=1,this._angleOfRotation=0}_resetGraphics(t){(t=t||this.layer)&&(t.removeMany(this._vertexGraphics),t.remove(this._backgroundGraphic),t.remove(this._centerGraphic),t.remove(this._rotateHandleGraphic),t.remove(this._rotateLineGraphic)),this._vertexGraphics=[],this._backgroundGraphic=null,this._centerGraphic=null,this._rotateHandleGraphic=null,this._rotateLineGraphic=null}_setupMover(){let t=[];this.enableScaling&&(t=t.concat(this._vertexGraphics)),this.enableMovement&&(t=t.concat(this.graphics,this._backgroundGraphic)),this.enableRotation&&t.push(this._rotateHandleGraphic),this.showCenterGraphic&&t.push(this._centerGraphic),this._mover=new G({enableMoveAllGraphics:!1,highlightsEnabled:!1,indicatorsEnabled:!1,view:this.view,graphics:t,callbacks:{onGraphicClick:t=>this._onGraphicClickCallback(t),onGraphicMoveStart:t=>this._onGraphicMoveStartCallback(t),onGraphicMove:t=>this._onGraphicMoveCallback(t),onGraphicMoveStop:t=>this._onGraphicMoveStopCallback(t),onGraphicPointerOver:t=>this._onGraphicPointerOverCallback(t),onGraphicPointerOut:t=>this._onGraphicPointerOutCallback(t)}})}_getStartInfo(t){const[e,i,r,s]=this._getBoxBounds(c()),o=Math.abs(r-e),a=Math.abs(s-i),h=(r+e)/2,n=(s+i)/2,{x:l,y:p}=t.geometry;return{width:o,height:a,centerX:h,centerY:n,startX:l,startY:p,graphicInfos:this._getGraphicInfos(),box:this._backgroundGraphic.geometry,rotate:this._rotateHandleGraphic.geometry}}_getGraphicInfos(){return this.graphics.map((t=>this._getGraphicInfo(t)))}_getGraphicInfo(t){const e=t.geometry,[i,r,s,o]=this._getBounds(c(),[e]);return{width:Math.abs(s-i),height:Math.abs(o-r),centerX:(s+i)/2,centerY:(o+r)/2,geometry:e}}_onGraphicClickCallback(t){t.viewEvent.stopPropagation(),this.emit("graphic-click",t),this.callbacks.onGraphicClick&&this.callbacks.onGraphicClick(t)}_onGraphicMoveStartCallback(t){const{_angleOfRotation:e,_xScale:i,_yScale:r,_backgroundGraphic:s,_vertexGraphics:o,_rotateHandleGraphic:a,symbols:h}=this,c=t.graphic;this._resetGraphicStateVars(),this._hideGraphicsBeforeUpdate(),s.symbol=h.fill.active,this._startInfo=this._getStartInfo(c),c===a?(this.view.cursor="grabbing",this.emit("rotate-start",new C(this.graphics,c,e))):o.includes(c)?(this._activeHandleGraphic=c,this.emit("scale-start",new O(this.graphics,c,i,r))):this.emit("move-start",new R(this.graphics,c,t.dx,t.dy))}_onGraphicMoveCallback(t){const e=t.graphic;if(this._startInfo)if(this._vertexGraphics.includes(e))this._scaleGraphic(e),this.emit("scale",new E(this.graphics,e,this._xScale,this._yScale));else if(e===this._rotateHandleGraphic)this._rotateGraphic(e),this.emit("rotate",new H(this.graphics,e,this._angleOfRotation));else{const{dx:i,dy:r}=t;this._totalDx+=i,this._totalDy+=r,this._moveGraphic(e,i,r),this.emit("move",new I(this.graphics,e,i,r))}}_onGraphicMoveStopCallback(t){const e=t.graphic;if(!this._startInfo)return void this.refresh();const{_angleOfRotation:i,_totalDx:r,_totalDy:s,_xScale:o,_yScale:a,_vertexGraphics:h,_rotateHandleGraphic:c}=this;this.refresh(),e===c?(this.view.cursor="pointer",this.emit("rotate-stop",new j(this.graphics,e,i))):h.includes(e)?this.emit("scale-stop",new B(this.graphics,e,o,a)):this.emit("move-stop",new M(this.graphics,e,r,s))}_onGraphicPointerOverCallback(t){const{_backgroundGraphic:e,_vertexGraphics:i,graphics:r,_rotateHandleGraphic:s,symbols:o,view:a}=this,h=t.graphic;if(h===s)return s.symbol=o.rotator.hover,void(a.cursor="pointer");if(r.includes(h)||h===e)return void(a.cursor="move");if(!i.includes(h))return void(a.cursor="pointer");t.graphic.symbol=o.handles.hover;const c=a.rotation;let n,l=t.index;switch(l<8&&(c>=0&&c<45?l%=8:l=c>=45&&c<90?(l+1)%8:c>=90&&c<135?(l+2)%8:c>=135&&c<180?(l+3)%8:c>=180&&c<225?(l+4)%8:c>=225&&c<270?(l+5)%8:c>=270&&c<315?(l+6)%8:(l+7)%8),l){case 0:case 4:n="nwse-resize";break;case 1:case 5:n="ns-resize";break;case 2:case 6:n="nesw-resize";break;case 3:case 7:n="ew-resize";break;default:n="pointer"}a.cursor=n}_onGraphicPointerOutCallback(t){const{_vertexGraphics:e,_rotateHandleGraphic:i,symbols:r,view:s}=this;t.graphic===i?i.symbol=r.rotator.default:e.includes(t.graphic)&&(t.graphic.symbol=r.handles.default),s.cursor="default"}_scaleGraphic(t){const{_startInfo:e,_vertexGraphics:i,preserveAspectRatio:r,view:s}=this,{centerX:o,centerY:a,startX:h,startY:c}=e,{resolution:n,transform:l}=s.state,p=i.indexOf(t);1!==p&&5!==p||this._updateX(t,o),3!==p&&7!==p||this._updateY(t,a);const{x:_,y:u}=t.geometry,g=l[0]*_+l[2]*u+l[4],y=l[1]*_+l[3]*u+l[5],G=e.graphicInfos.map((t=>t.geometry));if(r){const t=l[0]*o+l[2]*a+l[4],e=l[1]*o+l[3]*a+l[5],i=l[0]*h+l[2]*c+l[4],r=l[1]*h+l[3]*c+l[5];this._xScale=this._yScale=m(t,e,i,r,g,y);for(const s of G){const t=G.indexOf(s);this.graphics[t].geometry=v(s,this._xScale,this._yScale,[o,a])}this._updateBackgroundGraphic()}else{const{width:t,height:i}=e;let r=_-h,l=c-u;if(1===p||5===p?r=0:3!==p&&7!==p||(l=0),0===r&&0===l)return;const g=t+(h>o?r:-1*r),m=i+(c<a?l:-1*l),y=o+r/2,f=a+l/2;this._xScale=g/t||1,this._yScale=m/i||1,1===p||5===p?this._xScale=1:3!==p&&7!==p||(this._yScale=1);const b=(y-o)/n,w=(f-a)/n,S=v(e.box,this._xScale,this._yScale);this._backgroundGraphic.geometry=d(S,b,w,s,!0);const{centerX:k,centerY:R}=this._getGraphicInfo(this._backgroundGraphic),I=(k-o)/n,M=-1*(R-a)/n;for(const e of G){const t=G.indexOf(e),i=v(e,this._xScale,this._yScale,[o,a]);this.graphics[t].geometry=d(i,I,M,s,!0)}this._centerGraphic.geometry=new x(k,R,s.spatialReference)}}_rotateGraphic(t){const{centerX:e,centerY:i,startX:r,startY:s,box:o,rotate:a}=this._startInfo,h=new x(r,s,this.view.spatialReference),c=new x(e,i,this.view.spatialReference),n=t.geometry;this._angleOfRotation=y(h,n,c);const l=this._startInfo.graphicInfos.map((t=>t.geometry));for(const _ of l){const t=l.indexOf(_),e=p(_,this._angleOfRotation,c);this.graphics[t].geometry=e}this._backgroundGraphic.geometry=p(o,this._angleOfRotation,c),this._rotateHandleGraphic.geometry=p(a,this._angleOfRotation,c)}_moveGraphic(t,e,i){if(this.graphics.includes(t)){const r=this._backgroundGraphic.geometry;this._backgroundGraphic.geometry=d(r,e,i,this.view);for(const s of this.graphics)s!==t&&(s.geometry=d(s.geometry,e,i,this.view))}else if(t===this._centerGraphic){const t=this._backgroundGraphic.geometry;this._backgroundGraphic.geometry=d(t,e,i,this.view)}if(t===this._backgroundGraphic||t===this._centerGraphic)for(const r of this.graphics)r.geometry=d(r.geometry,e,i,this.view)}_setUpHighlights(){var t;this.highlightsEnabled&&this.graphics.length&&(null==(t=this._highlightHelper)||t.add(this.graphics))}_setupGraphics(){const{_graphicAttributes:t,symbols:i}=this;this._centerGraphic=new e(null,i.centerIndicator,t),this.showCenterGraphic&&this.layer.add(this._centerGraphic),this._backgroundGraphic=new e(null,i.fill.default,t),this.layer.add(this._backgroundGraphic),this._rotateLineGraphic=new e(null,i.rotatorLine,t),this._rotateHandleGraphic=new e(null,i.rotator.default,t),this.enableRotation&&!this._hasExtentGraphic()&&this.layer.addMany([this._rotateLineGraphic,this._rotateHandleGraphic]);for(let r=0;r<8;r++)this._vertexGraphics.push(new e(null,i.handles.default,t));this.enableScaling&&this.layer.addMany(this._vertexGraphics)}_updateGraphics(){this._updateBackgroundGraphic(),this._updateHandleGraphics(),this._updateCenterGraphic(),this._updateRotateGraphic(),this._updateRotateLineGraphic()}_hideGraphicsBeforeUpdate(){this._centerGraphic.visible=!1,this._rotateHandleGraphic.visible=!1,this._rotateLineGraphic.visible=!1,this._vertexGraphics.forEach((t=>t.visible=!1))}_updateHandleGraphics(){const t=this._getCoordinates(!0);this._vertexGraphics.forEach(((e,i)=>{const[r,s]=t[i];this._updateXY(e,r,s)}))}_updateBackgroundGraphic(){const t=this._getCoordinates();this._backgroundGraphic.geometry=new S({rings:t,spatialReference:this.view.spatialReference})}_updateCenterGraphic(){const[t,e,i,r]=this._getBoxBounds(c()),s=(i+t)/2,o=(r+e)/2;this._centerGraphic.geometry=new x(s,o,this.view.spatialReference)}_updateRotateGraphic(){if(!this._vertexGraphics.length)return;const{x:t,y:e}=this._vertexGraphics[1].geometry,i=e+this.view.state.resolution*this._rotateGraphicOffset;this._rotateHandleGraphic.geometry=new x(t,i,this.view.spatialReference)}_updateRotateLineGraphic(){if(!this._vertexGraphics.length||!this._rotateHandleGraphic||!this._rotateHandleGraphic.geometry)return;const t=this._vertexGraphics[1].geometry,e=this._rotateHandleGraphic.geometry;this._rotateLineGraphic.geometry=new k({paths:[[t.x,t.y],[e.x,e.y]],spatialReference:this.view.spatialReference})}_updateXY(t,e,i){t.geometry=new x(e,i,this.view.spatialReference)}_updateX(t,e){const i=t.geometry.y;t.geometry=new x(e,i,this.view.spatialReference)}_updateY(t,e){const i=t.geometry.x;t.geometry=new x(i,e,this.view.spatialReference)}_hasExtentGraphic(){return this.graphics.some((t=>t&&r(t.geometry)&&"extent"===t.geometry.type))}_getBoxBounds(t){const e=this.graphics.map((t=>t.geometry));return this._getBounds(t,e)}_getCoordinates(t){const[e,i,r,s]=this._getBoxBounds(c());if(t){const t=(e+r)/2,o=(s+i)/2;return[[e,s],[t,s],[r,s],[r,o],[r,i],[t,i],[e,i],[e,o]]}return[[e,s],[r,s],[r,i],[e,i]]}};t([a({readOnly:!0})],z.prototype,"type",void 0),t([a()],z.prototype,"callbacks",void 0),t([a()],z.prototype,"enableMovement",void 0),t([a()],z.prototype,"enableRotation",void 0),t([a()],z.prototype,"enableScaling",void 0),t([a()],z.prototype,"graphics",void 0),t([a()],z.prototype,"highlightsEnabled",void 0),t([a()],z.prototype,"layer",void 0),t([a()],z.prototype,"preserveAspectRatio",void 0),t([a()],z.prototype,"showCenterGraphic",void 0),t([a({readOnly:!0})],z.prototype,"state",null),t([a({value:Y,cast(t){const{centerIndicator:e=Y.centerIndicator,fill:i=Y.fill,handles:r=Y.handles,rotator:s=Y.rotator,rotatorLine:o=Y.rotatorLine}=t||{};return{centerIndicator:e,fill:i,handles:r,rotator:s,rotatorLine:o}}})],z.prototype,"symbols",void 0),t([a({constructOnly:!0})],z.prototype,"view",void 0),z=t([h("esri.views.draw.support.Box")],z);const N=z;export{N as default};
5
+ import{_ as t}from"../../../chunks/tslib.es6.js";import"../../../geometry.js";import e from"../../../Graphic.js";import i from"../../../core/Evented.js";import{isSome as s}from"../../../core/maybe.js";import{when as r,watch as o}from"../../../core/reactiveUtils.js";import{property as a}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/arrayUtils.js";import"../../../core/has.js";import"../../../core/accessorSupport/ensureType.js";import{subclass as h}from"../../../core/accessorSupport/decorators/subclass.js";import{create as c}from"../../../geometry/support/aaBoundingRect.js";import{getRingsOrPathsBounds as n}from"../../../geometry/support/boundsUtils.js";import{geometryToCoordinates as l}from"../../../geometry/support/coordsUtils.js";import p from"../../../geometry/support/rotate.js";import _ from"../../../symbols/SimpleFillSymbol.js";import g from"../../../symbols/SimpleLineSymbol.js";import m from"../../../symbols/SimpleMarkerSymbol.js";import{cloneMove as d,scale as u,getScaleRatio as v,getRotationAngle as y}from"./drawUtils.js";import G from"./GraphicMover.js";import f from"./HighlightHelper.js";import{addUniqueLayer as b}from"./layerUtils.js";import{settings as w}from"./settings.js";import x from"../../../geometry/Point.js";import S from"../../../geometry/Polygon.js";import k from"../../../geometry/Polyline.js";class R{constructor(t,e,i,s){this.graphics=t,this.mover=e,this.dx=i,this.dy=s,this.type="move-start"}}class I{constructor(t,e,i,s){this.graphics=t,this.mover=e,this.dx=i,this.dy=s,this.type="move"}}class C{constructor(t,e,i,s){this.graphics=t,this.mover=e,this.dx=i,this.dy=s,this.type="move-stop"}}class H{constructor(t,e,i){this.graphics=t,this.mover=e,this.angle=i,this.type="rotate-start"}}class M{constructor(t,e,i){this.graphics=t,this.mover=e,this.angle=i,this.type="rotate"}}class j{constructor(t,e,i){this.graphics=t,this.mover=e,this.angle=i,this.type="rotate-stop"}}class O{constructor(t,e,i,s){this.graphics=t,this.mover=e,this.xScale=i,this.yScale=s,this.type="scale-start"}}class E{constructor(t,e,i,s){this.graphics=t,this.mover=e,this.xScale=i,this.yScale=s,this.type="scale"}}class B{constructor(t,e,i,s){this.graphics=t,this.mover=e,this.xScale=i,this.yScale=s,this.type="scale-stop"}}const L=w.transformGraphics,Y={centerIndicator:new m({style:"cross",size:L.center.size,color:L.center.color}),fill:{default:new _({color:L.fill.color,outline:{color:L.fill.outlineColor,join:"round",width:1}}),active:new _({color:L.fill.stagedColor,outline:{color:L.fill.outlineColor,join:"round",style:"dash",width:1}})},handles:{default:new m({style:"square",size:L.vertex.size,color:L.vertex.color,outline:{color:L.vertex.outlineColor,width:1}}),hover:new m({style:"square",size:L.vertex.hoverSize,color:L.vertex.hoverColor,outline:{color:L.vertex.hoverOutlineColor,width:1}})},rotator:{default:new m({style:"circle",size:L.vertex.size,color:L.vertex.color,outline:{color:L.vertex.outlineColor,width:1}}),hover:new m({style:"circle",size:L.vertex.hoverSize,color:L.vertex.hoverColor,outline:{color:L.vertex.hoverOutlineColor,width:1}})},rotatorLine:new g({color:L.line.color,width:1})};let z=class extends i.EventedAccessor{constructor(t){super(t),this._activeHandleGraphic=null,this._graphicAttributes={esriSketchTool:"box"},this._mover=null,this._centerGraphic=null,this._backgroundGraphic=null,this._vertexGraphics=[],this._rotateHandleGraphic=null,this._rotateGraphicOffset=20,this._angleOfRotation=0,this._rotateLineGraphic=null,this._startInfo=null,this._totalDx=0,this._totalDy=0,this._xScale=1,this._yScale=1,this.type="box",this.callbacks={onMoveStart(){},onMove(){},onMoveStop(){},onScaleStart(){},onScale(){},onScaleStop(){},onRotateStart(){},onRotate(){},onRotateStop(){},onGraphicClick(){}},this.enableMovement=!0,this.enableRotation=!0,this.enableScaling=!0,this.graphics=[],this.highlightsEnabled=!0,this.layer=null,this.preserveAspectRatio=!1,this.showCenterGraphic=!0,this.symbols=Y,this.view=null,this._getBounds=(()=>{const t=c();return(e,i)=>{e[0]=Number.POSITIVE_INFINITY,e[1]=Number.POSITIVE_INFINITY,e[2]=Number.NEGATIVE_INFINITY,e[3]=Number.NEGATIVE_INFINITY;for(const s of i){if(!s)continue;let i,r,o,a;if("point"===s.type)i=o=s.x,r=a=s.y;else if("multipoint"===s.type){const e=l(s);[i,r,o,a]=n(t,[e])}else if("extent"===s.type)[i,r,o,a]=[s.xmin,s.ymin,s.xmax,s.ymax];else{const e=l(s);[i,r,o,a]=n(t,e)}e[0]=Math.min(i,e[0]),e[1]=Math.min(r,e[1]),e[2]=Math.max(o,e[2]),e[3]=Math.max(a,e[3])}return e}})()}initialize(){this._highlightHelper=new f({view:this.view}),this._setup(),this.own([r((()=>this.view?.ready),(()=>{const{layer:t,view:e}=this;b(e,t)}),{once:!0,initial:!0}),o((()=>this.preserveAspectRatio),(()=>{this._activeHandleGraphic&&(this._scaleGraphic(this._activeHandleGraphic),this._updateGraphics())})),o((()=>this.view?.scale),(()=>{this._updateRotateGraphic(),this._updateRotateLineGraphic()})),o((()=>this.graphics),(()=>this.refresh())),o((()=>this.layer),((t,e)=>{e&&this._resetGraphics(e),this.refresh()})),o((()=>this.highlightsEnabled),(()=>{this._highlightHelper?.removeAll(),this._setUpHighlights()})),this.on("move-start",(t=>this.callbacks?.onMoveStart?.(t))),this.on("move",(t=>this.callbacks?.onMove?.(t))),this.on("move-stop",(t=>this.callbacks?.onMoveStop?.(t))),this.on("rotate-start",(t=>this.callbacks?.onRotateStart?.(t))),this.on("rotate",(t=>this.callbacks?.onRotate?.(t))),this.on("rotate-stop",(t=>this.callbacks?.onRotateStop?.(t))),this.on("scale-start",(t=>this.callbacks?.onScaleStart?.(t))),this.on("scale",(t=>this.callbacks?.onScale?.(t))),this.on("scale-stop",(t=>this.callbacks?.onScaleStop?.(t)))])}destroy(){this._reset()}get state(){const t=this.view?.ready??!1,e=this.graphics.length&&this.layer;return t&&e?"active":t?"ready":"disabled"}isUIGraphic(t){return this._vertexGraphics.includes(t)||t===this._backgroundGraphic||t===this._centerGraphic||t===this._rotateHandleGraphic||t===this._rotateLineGraphic}move(t,e){if(this._mover&&this.graphics.length){for(const i of this.graphics){const s=i.geometry,r=d(s,t,e,this.view);i.geometry=r}this.refresh(),this.emit("move-stop",new C(this.graphics,null,t,e))}}scale(t,e){if(this._mover&&this.graphics.length){for(const i of this.graphics){const s=i.geometry,r=u(s,t,e);i.geometry=r}this.refresh(),this.emit("scale-stop",new B(this.graphics,null,t,e))}}rotate(t,e){if(this._mover&&this.graphics.length){if(!e){const t=this._vertexGraphics[1].geometry.x,i=this._vertexGraphics[3].geometry.y;e=new x(t,i,this.view.spatialReference)}for(const i of this.graphics){const s=i.geometry,r=p(s,t,e);i.geometry=r}this.refresh(),this.emit("rotate-stop",new j(this.graphics,null,t))}}refresh(){this._reset(),this._setup()}reset(){this.graphics=[]}_setup(){"active"===this.state&&(this._setUpHighlights(),this._setupGraphics(),this._setupMover(),this._updateGraphics())}_reset(){this._highlightHelper.removeAll(),this._resetGraphicStateVars(),this._resetGraphics(),this._mover&&this._mover.destroy(),this._mover=null,this.view.cursor="default"}_resetGraphicStateVars(){this._startInfo=null,this._activeHandleGraphic=null,this._totalDx=0,this._totalDy=0,this._xScale=1,this._yScale=1,this._angleOfRotation=0}_resetGraphics(t){(t=t||this.layer)&&(t.removeMany(this._vertexGraphics),t.remove(this._backgroundGraphic),t.remove(this._centerGraphic),t.remove(this._rotateHandleGraphic),t.remove(this._rotateLineGraphic)),this._vertexGraphics=[],this._backgroundGraphic=null,this._centerGraphic=null,this._rotateHandleGraphic=null,this._rotateLineGraphic=null}_setupMover(){let t=[];this.enableScaling&&(t=t.concat(this._vertexGraphics)),this.enableMovement&&(t=t.concat(this.graphics,this._backgroundGraphic)),this.enableRotation&&t.push(this._rotateHandleGraphic),this.showCenterGraphic&&t.push(this._centerGraphic),this._mover=new G({enableMoveAllGraphics:!1,highlightsEnabled:!1,indicatorsEnabled:!1,view:this.view,graphics:t,callbacks:{onGraphicClick:t=>this._onGraphicClickCallback(t),onGraphicMoveStart:t=>this._onGraphicMoveStartCallback(t),onGraphicMove:t=>this._onGraphicMoveCallback(t),onGraphicMoveStop:t=>this._onGraphicMoveStopCallback(t),onGraphicPointerOver:t=>this._onGraphicPointerOverCallback(t),onGraphicPointerOut:t=>this._onGraphicPointerOutCallback(t)}})}_getStartInfo(t){const[e,i,s,r]=this._getBoxBounds(c()),o=Math.abs(s-e),a=Math.abs(r-i),h=(s+e)/2,n=(r+i)/2,{x:l,y:p}=t.geometry;return{width:o,height:a,centerX:h,centerY:n,startX:l,startY:p,graphicInfos:this._getGraphicInfos(),box:this._backgroundGraphic.geometry,rotate:this._rotateHandleGraphic.geometry}}_getGraphicInfos(){return this.graphics.map((t=>this._getGraphicInfo(t)))}_getGraphicInfo(t){const e=t.geometry,[i,s,r,o]=this._getBounds(c(),[e]);return{width:Math.abs(r-i),height:Math.abs(o-s),centerX:(r+i)/2,centerY:(o+s)/2,geometry:e}}_onGraphicClickCallback(t){t.viewEvent.stopPropagation(),this.emit("graphic-click",t),this.callbacks.onGraphicClick&&this.callbacks.onGraphicClick(t)}_onGraphicMoveStartCallback(t){const{_angleOfRotation:e,_xScale:i,_yScale:s,_backgroundGraphic:r,_vertexGraphics:o,_rotateHandleGraphic:a,symbols:h}=this,c=t.graphic;this._resetGraphicStateVars(),this._hideGraphicsBeforeUpdate(),r.symbol=h.fill.active,this._startInfo=this._getStartInfo(c),c===a?(this.view.cursor="grabbing",this.emit("rotate-start",new H(this.graphics,c,e))):o.includes(c)?(this._activeHandleGraphic=c,this.emit("scale-start",new O(this.graphics,c,i,s))):this.emit("move-start",new R(this.graphics,c,t.dx,t.dy))}_onGraphicMoveCallback(t){const e=t.graphic;if(this._startInfo)if(this._vertexGraphics.includes(e))this._scaleGraphic(e),this.emit("scale",new E(this.graphics,e,this._xScale,this._yScale));else if(e===this._rotateHandleGraphic)this._rotateGraphic(e),this.emit("rotate",new M(this.graphics,e,this._angleOfRotation));else{const{dx:i,dy:s}=t;this._totalDx+=i,this._totalDy+=s,this._moveGraphic(e,i,s),this.emit("move",new I(this.graphics,e,i,s))}}_onGraphicMoveStopCallback(t){const e=t.graphic;if(!this._startInfo)return void this.refresh();const{_angleOfRotation:i,_totalDx:s,_totalDy:r,_xScale:o,_yScale:a,_vertexGraphics:h,_rotateHandleGraphic:c}=this;this.refresh(),e===c?(this.view.cursor="pointer",this.emit("rotate-stop",new j(this.graphics,e,i))):h.includes(e)?this.emit("scale-stop",new B(this.graphics,e,o,a)):this.emit("move-stop",new C(this.graphics,e,s,r))}_onGraphicPointerOverCallback(t){const{_backgroundGraphic:e,_vertexGraphics:i,graphics:s,_rotateHandleGraphic:r,symbols:o,view:a}=this,h=t.graphic;if(h===r)return r.symbol=o.rotator.hover,void(a.cursor="pointer");if(s.includes(h)||h===e)return void(a.cursor="move");if(!i.includes(h))return void(a.cursor="pointer");t.graphic.symbol=o.handles.hover;const c=a.rotation;let n,l=t.index;switch(l<8&&(c>=0&&c<45?l%=8:l=c>=45&&c<90?(l+1)%8:c>=90&&c<135?(l+2)%8:c>=135&&c<180?(l+3)%8:c>=180&&c<225?(l+4)%8:c>=225&&c<270?(l+5)%8:c>=270&&c<315?(l+6)%8:(l+7)%8),l){case 0:case 4:n="nwse-resize";break;case 1:case 5:n="ns-resize";break;case 2:case 6:n="nesw-resize";break;case 3:case 7:n="ew-resize";break;default:n="pointer"}a.cursor=n}_onGraphicPointerOutCallback(t){const{_vertexGraphics:e,_rotateHandleGraphic:i,symbols:s,view:r}=this;t.graphic===i?i.symbol=s.rotator.default:e.includes(t.graphic)&&(t.graphic.symbol=s.handles.default),r.cursor="default"}_scaleGraphic(t){const{_startInfo:e,_vertexGraphics:i,preserveAspectRatio:s,view:r}=this,{centerX:o,centerY:a,startX:h,startY:c}=e,{resolution:n,transform:l}=r.state,p=i.indexOf(t);1!==p&&5!==p||this._updateX(t,o),3!==p&&7!==p||this._updateY(t,a);const{x:_,y:g}=t.geometry,m=l[0]*_+l[2]*g+l[4],y=l[1]*_+l[3]*g+l[5],G=e.graphicInfos.map((t=>t.geometry));if(s){const t=l[0]*o+l[2]*a+l[4],e=l[1]*o+l[3]*a+l[5],i=l[0]*h+l[2]*c+l[4],s=l[1]*h+l[3]*c+l[5];this._xScale=this._yScale=v(t,e,i,s,m,y);for(const r of G){const t=G.indexOf(r);this.graphics[t].geometry=u(r,this._xScale,this._yScale,[o,a])}this._updateBackgroundGraphic()}else{const{width:t,height:i}=e;let s=_-h,l=c-g;if(1===p||5===p?s=0:3!==p&&7!==p||(l=0),0===s&&0===l)return;const m=t+(h>o?s:-1*s),v=i+(c<a?l:-1*l),y=o+s/2,f=a+l/2;this._xScale=m/t||1,this._yScale=v/i||1,1===p||5===p?this._xScale=1:3!==p&&7!==p||(this._yScale=1);const b=(y-o)/n,w=(f-a)/n,S=u(e.box,this._xScale,this._yScale);this._backgroundGraphic.geometry=d(S,b,w,r,!0);const{centerX:k,centerY:R}=this._getGraphicInfo(this._backgroundGraphic),I=(k-o)/n,C=-1*(R-a)/n;for(const e of G){const t=G.indexOf(e),i=u(e,this._xScale,this._yScale,[o,a]);this.graphics[t].geometry=d(i,I,C,r,!0)}this._centerGraphic.geometry=new x(k,R,r.spatialReference)}}_rotateGraphic(t){const{centerX:e,centerY:i,startX:s,startY:r,box:o,rotate:a}=this._startInfo,h=new x(s,r,this.view.spatialReference),c=new x(e,i,this.view.spatialReference),n=t.geometry;this._angleOfRotation=y(h,n,c);const l=this._startInfo.graphicInfos.map((t=>t.geometry));for(const _ of l){const t=l.indexOf(_),e=p(_,this._angleOfRotation,c);this.graphics[t].geometry=e}this._backgroundGraphic.geometry=p(o,this._angleOfRotation,c),this._rotateHandleGraphic.geometry=p(a,this._angleOfRotation,c)}_moveGraphic(t,e,i){if(this.graphics.includes(t)){const s=this._backgroundGraphic.geometry;this._backgroundGraphic.geometry=d(s,e,i,this.view);for(const r of this.graphics)r!==t&&(r.geometry=d(r.geometry,e,i,this.view))}else if(t===this._centerGraphic){const t=this._backgroundGraphic.geometry;this._backgroundGraphic.geometry=d(t,e,i,this.view)}if(t===this._backgroundGraphic||t===this._centerGraphic)for(const s of this.graphics)s.geometry=d(s.geometry,e,i,this.view)}_setUpHighlights(){this.highlightsEnabled&&this.graphics.length&&this._highlightHelper?.add(this.graphics)}_setupGraphics(){const{_graphicAttributes:t,symbols:i}=this;this._centerGraphic=new e(null,i.centerIndicator,t),this.showCenterGraphic&&this.layer.add(this._centerGraphic),this._backgroundGraphic=new e(null,i.fill.default,t),this.layer.add(this._backgroundGraphic),this._rotateLineGraphic=new e(null,i.rotatorLine,t),this._rotateHandleGraphic=new e(null,i.rotator.default,t),this.enableRotation&&!this._hasExtentGraphic()&&this.layer.addMany([this._rotateLineGraphic,this._rotateHandleGraphic]);for(let s=0;s<8;s++)this._vertexGraphics.push(new e(null,i.handles.default,t));this.enableScaling&&this.layer.addMany(this._vertexGraphics)}_updateGraphics(){this._updateBackgroundGraphic(),this._updateHandleGraphics(),this._updateCenterGraphic(),this._updateRotateGraphic(),this._updateRotateLineGraphic()}_hideGraphicsBeforeUpdate(){this._centerGraphic.visible=!1,this._rotateHandleGraphic.visible=!1,this._rotateLineGraphic.visible=!1,this._vertexGraphics.forEach((t=>t.visible=!1))}_updateHandleGraphics(){const t=this._getCoordinates(!0);this._vertexGraphics.forEach(((e,i)=>{const[s,r]=t[i];this._updateXY(e,s,r)}))}_updateBackgroundGraphic(){const t=this._getCoordinates();this._backgroundGraphic.geometry=new S({rings:t,spatialReference:this.view.spatialReference})}_updateCenterGraphic(){const[t,e,i,s]=this._getBoxBounds(c()),r=(i+t)/2,o=(s+e)/2;this._centerGraphic.geometry=new x(r,o,this.view.spatialReference)}_updateRotateGraphic(){if(!this._vertexGraphics.length)return;const{x:t,y:e}=this._vertexGraphics[1].geometry,i=e+this.view.state.resolution*this._rotateGraphicOffset;this._rotateHandleGraphic.geometry=new x(t,i,this.view.spatialReference)}_updateRotateLineGraphic(){if(!this._vertexGraphics.length||!this._rotateHandleGraphic||!this._rotateHandleGraphic.geometry)return;const t=this._vertexGraphics[1].geometry,e=this._rotateHandleGraphic.geometry;this._rotateLineGraphic.geometry=new k({paths:[[t.x,t.y],[e.x,e.y]],spatialReference:this.view.spatialReference})}_updateXY(t,e,i){t.geometry=new x(e,i,this.view.spatialReference)}_updateX(t,e){const i=t.geometry.y;t.geometry=new x(e,i,this.view.spatialReference)}_updateY(t,e){const i=t.geometry.x;t.geometry=new x(i,e,this.view.spatialReference)}_hasExtentGraphic(){return this.graphics.some((t=>t&&s(t.geometry)&&"extent"===t.geometry.type))}_getBoxBounds(t){const e=this.graphics.map((t=>t.geometry));return this._getBounds(t,e)}_getCoordinates(t){const[e,i,s,r]=this._getBoxBounds(c());if(t){const t=(e+s)/2,o=(r+i)/2;return[[e,r],[t,r],[s,r],[s,o],[s,i],[t,i],[e,i],[e,o]]}return[[e,r],[s,r],[s,i],[e,i]]}};t([a({readOnly:!0})],z.prototype,"type",void 0),t([a()],z.prototype,"callbacks",void 0),t([a()],z.prototype,"enableMovement",void 0),t([a()],z.prototype,"enableRotation",void 0),t([a()],z.prototype,"enableScaling",void 0),t([a()],z.prototype,"graphics",void 0),t([a()],z.prototype,"highlightsEnabled",void 0),t([a()],z.prototype,"layer",void 0),t([a()],z.prototype,"preserveAspectRatio",void 0),t([a()],z.prototype,"showCenterGraphic",void 0),t([a({readOnly:!0})],z.prototype,"state",null),t([a({value:Y,cast(t){const{centerIndicator:e=Y.centerIndicator,fill:i=Y.fill,handles:s=Y.handles,rotator:r=Y.rotator,rotatorLine:o=Y.rotatorLine}=t||{};return{centerIndicator:e,fill:i,handles:s,rotator:r,rotatorLine:o}}})],z.prototype,"symbols",void 0),t([a({constructOnly:!0})],z.prototype,"view",void 0),z=t([h("esri.views.draw.support.Box")],z);const N=z;export{N as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.24/esri/copyright.txt for details.
4
4
  */
5
- import{_ as i}from"../../../chunks/tslib.es6.js";import"../../../symbols.js";import t from"../../../core/Evented.js";import e from"../../../core/Handles.js";import{clone as s}from"../../../core/lang.js";import{destroyMaybe as r,isNone as h,isSome as a}from"../../../core/maybe.js";import{watch as o,when as c}from"../../../core/reactiveUtils.js";import{property as n}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/accessorSupport/ensureType.js";import{subclass as l}from"../../../core/accessorSupport/decorators/subclass.js";import p from"../../../layers/GraphicsLayer.js";import{cloneMove as d}from"./drawUtils.js";import v from"./HighlightHelper.js";import{addUniqueLayer as g,findLayerView as _}from"./layerUtils.js";import{GraphicClickEvent as m,GraphicDoubleClickEvent as y,GraphicPointerDownEvent as u,GraphicPointerUpEvent as f,GraphicPointerOutEvent as w,GraphicMoveStartEvent as G,GraphicMoveEvent as b,GraphicMoveStopEvent as k,GraphicPointerOverEvent as O}from"./input/GraphicMoverEvents.js";import{ViewEventPriorities as H}from"../../input/InputManager.js";import{GraphicManipulator as M}from"../../interactive/GraphicManipulator.js";import{createScreenPointFromEvent as x}from"../../support/screenUtils.js";import E from"../../../symbols/SimpleMarkerSymbol.js";import j from"../../../symbols/SimpleLineSymbol.js";import U from"../../../symbols/SimpleFillSymbol.js";const P="indicator-symbols";let S=class extends t.EventedAccessor{constructor(i){super(i),this._activeGraphic=null,this._dragEvent=null,this._handles=new e,this._hoverGraphic=null,this._indicators=[],this._initialDragGeometry=null,this._viewHandles=new e,this._manipulators=[],this._layerViews=null,this.type="graphic-mover",this.callbacks={onGraphicClick(){},onGraphicDoubleClick(){},onGraphicMoveStart(){},onGraphicMove(){},onGraphicMoveStop(){},onGraphicPointerOver(){},onGraphicPointerOut(){},onGraphicPointerDown(){},onGraphicPointerUp(){}},this.enableMoveAllGraphics=!1,this.graphics=[],this.indicatorsEnabled=!1,this.layer=new p({listMode:"hide",internal:!0,title:"GraphicMover highlight layer"}),this.view=null}initialize(){g(this.view,this.layer),this._highlightHelper=new v({view:this.view}),this.refresh(),this._handles.add([o((()=>{var i;return[this.graphics,null==(i=this.graphics)?void 0:i.length]}),(()=>this.refresh())),c((()=>{var i;return null==(i=this.view)?void 0:i.ready}),(()=>{this._viewHandles.add([this.view.on("immediate-click",(i=>this._clickHandler(i)),H.TOOL),this.view.on("double-click",(i=>this._doubleClickHandler(i)),H.TOOL),this.view.on("pointer-down",(i=>this._pointerDownHandler(i)),H.TOOL),this.view.on("pointer-move",(i=>this._pointerMoveHandler(i)),H.TOOL),this.view.on("pointer-up",(i=>this._pointerUpHandler(i)),H.TOOL),this.view.on("drag",(i=>this._dragHandler(i)),H.TOOL),this.view.on("key-down",(i=>this._keyDownHandler(i)),H.TOOL)])}),{once:!0,initial:!0}),o((()=>this.view),(i=>{this._highlightHelper.removeAll(),this._highlightHelper.view=i}))])}destroy(){var i;this._removeIndicators(),null==(i=this.view.map)||i.remove(this.layer),this.layer.destroy(),this.reset(),this._manipulators.forEach((i=>i.destroy())),this._manipulators=null,this._handles=r(this._handles),this._viewHandles=r(this._viewHandles)}set highlightsEnabled(i){var t,e;(null==(t=this._highlightHelper)||t.removeAll(),this._set("highlightsEnabled",i),i)&&(null==(e=this._highlightHelper)||e.add(this.graphics))}get state(){const i=!!this.get("view.ready"),t=!!this.get("graphics.length"),e=this._activeGraphic;return i&&t?e?"moving":"active":i?"ready":"disabled"}refresh(){this.reset(),this._setup()}reset(){this._activeGraphic=null,this._hoverGraphic=null,this._dragEvent=null,this._highlightHelper.removeAll()}updateGeometry(i,t){const e=this.graphics[i];e&&(e.set("geometry",t),this._setUpIndicators())}_setup(){this._setUpHighlights(),this._setUpIndicators(),this._setUpManipulators(),this._syncLayerViews()}_clickHandler(i){const t=this._findTargetGraphic(x(i));if(t){const e=new m(t,this.graphics.indexOf(t),i.x,i.y,i);this.emit("graphic-click",e),this.callbacks.onGraphicClick&&this.callbacks.onGraphicClick(e)}}_doubleClickHandler(i){const t=this._findTargetGraphic(x(i));if(t){const e=new y(t,this.graphics.indexOf(t),i.x,i.y,i);this.emit("graphic-double-click",e),this.callbacks.onGraphicDoubleClick&&this.callbacks.onGraphicDoubleClick(e)}}_pointerDownHandler(i){const t=this._findTargetGraphic(x(i));if(t){this._activeGraphic=t;const{x:e,y:s}=i,r=new u(t,this.graphics.indexOf(t),e,s,i);this.emit("graphic-pointer-down",r),this.callbacks.onGraphicPointerDown&&this.callbacks.onGraphicPointerDown(r)}else this._activeGraphic=null}_pointerUpHandler(i){if(this._activeGraphic){const{x:t,y:e}=i,s=this.graphics.indexOf(this._activeGraphic),r=new f(this._activeGraphic,s,t,e,i);this.emit("graphic-pointer-up",r),this.callbacks.onGraphicPointerUp&&this.callbacks.onGraphicPointerUp(r)}}_pointerMoveHandler(i){if(this._dragEvent)return;const t=this._findTargetGraphic(x(i));if(t){const{x:e,y:s}=i;if(this._hoverGraphic){if(this._hoverGraphic===t)return;const r=this.graphics.indexOf(this._hoverGraphic),h=new w(this.graphics[r],r,e,s,i);this._hoverGraphic=null,this.emit("graphic-pointer-out",h),this.callbacks.onGraphicPointerOut&&this.callbacks.onGraphicPointerOut(h)}const r=this.graphics.indexOf(t),h=new O(t,r,e,s,i);return this._hoverGraphic=t,this.emit("graphic-pointer-over",h),void(this.callbacks.onGraphicPointerOver&&this.callbacks.onGraphicPointerOver(h))}if(this._hoverGraphic){const{x:t,y:e}=i,s=this.graphics.indexOf(this._hoverGraphic),r=new w(this.graphics[s],s,t,e,i);this._hoverGraphic=null,this.emit("graphic-pointer-out",r),this.callbacks.onGraphicPointerOut&&this.callbacks.onGraphicPointerOut(r)}}_dragHandler(i){if("start"!==i.action&&!this._dragEvent||!this._activeGraphic||!this._activeGraphic.geometry)return;"start"===i.action&&this._removeIndicators(),i.stopPropagation();const{action:t,x:e,y:r}=i,h=this.graphics.indexOf(this._activeGraphic),a=this._dragEvent?e-this._dragEvent.x:0,o=this._dragEvent?r-this._dragEvent.y:0,c=e-i.origin.x,n=r-i.origin.y,l="start"===t?this._activeGraphic.geometry:this._initialDragGeometry,p=d(l,c,n,this.view);if(this._activeGraphic.geometry=p,this.enableMoveAllGraphics&&this.graphics.forEach((i=>{i!==this._activeGraphic&&(i.geometry=d(i.geometry,a,o,this.view))})),this._dragEvent=i,"start"===t){this._initialDragGeometry=s(l);const t=new G(this._activeGraphic,this.graphics,h,e,r,a,o,c,n,i);this.emit("graphic-move-start",t),this.callbacks.onGraphicMoveStart&&this.callbacks.onGraphicMoveStart(t),t.defaultPrevented&&this._activeGraphic.set("geometry",l)}else if("update"===t){const t=new b(this._activeGraphic,this.graphics,h,e,r,a,o,c,n,i);this.emit("graphic-move",t),this.callbacks.onGraphicMove&&this.callbacks.onGraphicMove(t),t.defaultPrevented&&(this._activeGraphic.geometry=l)}else{const t=new k(this._activeGraphic,this.graphics,h,e,r,a,o,c,n,i);this._dragEvent=null,this._activeGraphic=null,this._setUpIndicators(),this.emit("graphic-move-stop",t),this.callbacks.onGraphicMoveStop&&this.callbacks.onGraphicMoveStop(t),t.defaultPrevented&&(this.graphics[h].set("geometry",this._initialDragGeometry),this._setUpIndicators()),this._initialDragGeometry=null}}_keyDownHandler(i){"a"!==i.key&&"d"!==i.key&&"n"!==i.key||"moving"!==this.state||i.stopPropagation()}_findTargetGraphic(i){const t=this.view.toMap(i);let e=null,s=Number.MAX_VALUE;this._syncLayerViews();const r=this._layerViews.flatMap((i=>"graphicsViews"in i?Array.from(i.graphicsViews(),(i=>i.hitTest(t))).flat():i.graphicsView.hitTest(t))).filter((i=>this.graphics.includes(i)));return r.length?r[0]:(this._manipulators.forEach((t=>{const r=t.intersectionDistance(i);a(r)&&r<s&&(s=r,e=t.graphic)})),e)}_syncLayerViews(){this._layerViews=[];const i=new Set;for(const t of this.graphics){const e=_(this.view,t.layer);e&&i.add(e)}this._layerViews=[...i]}_setUpManipulators(){const{graphics:i,view:t}=this;this._manipulators.forEach((i=>i.destroy())),this._manipulators=null!=i&&i.length?i.map((i=>new M({graphic:i,view:t}))):[]}_setUpHighlights(){this.highlightsEnabled&&this._highlightHelper.add(this.graphics)}_setUpIndicators(){if(this._removeIndicators(),this.indicatorsEnabled){for(const i of this.graphics){const t=i.clone();t.symbol=this._getSymbolForIndicator(i),this._indicators.push(t),this._handles.add(o((()=>i.symbol),(()=>this._setUpIndicators())),P)}this.layer.addMany(this._indicators)}}_removeIndicators(){this._handles.remove(P),this._indicators.length&&(this.layer.removeMany(this._indicators),this._indicators.forEach((i=>i.destroy())),this._indicators=[])}_getSymbolForIndicator(i){const t=12;if(h(i.symbol))return null;switch(i.symbol.type){case"cim":return new E({style:"circle",size:t,color:[0,0,0,0],outline:{color:[255,127,0,1],width:1}});case"picture-marker":{const{xoffset:t,yoffset:e,height:s,width:r}=i.symbol,h=s===r?r:Math.max(s,r);return new E({xoffset:t,yoffset:e,size:h,style:"square",color:[0,0,0,0],outline:{color:[255,127,0,1],width:1}})}case"simple-marker":{const{xoffset:t,yoffset:e,size:s,style:r}=i.symbol;return new E({xoffset:t,yoffset:e,style:"circle"===r?"circle":"square",size:s+2,color:[0,0,0,0],outline:{color:[255,127,0,1],width:1}})}case"simple-fill":return new U({color:[0,0,0,0],outline:{style:"dash",color:[255,127,0,1],width:1}});case"simple-line":return new j({color:[255,127,0,1],style:"dash",width:1});case"text":{const{xoffset:e,yoffset:s}=i.symbol;return new E({xoffset:e,yoffset:s,size:t,color:[0,0,0,0],outline:{color:[255,127,0,1],width:1}})}default:return null}}};i([n()],S.prototype,"_activeGraphic",void 0),i([n({readOnly:!0})],S.prototype,"type",void 0),i([n()],S.prototype,"callbacks",void 0),i([n()],S.prototype,"enableMoveAllGraphics",void 0),i([n()],S.prototype,"graphics",void 0),i([n({value:!1})],S.prototype,"highlightsEnabled",null),i([n()],S.prototype,"indicatorsEnabled",void 0),i([n()],S.prototype,"layer",void 0),i([n({readOnly:!0})],S.prototype,"state",null),i([n()],S.prototype,"view",void 0),S=i([l("esri.views.draw.support.GraphicMover")],S);const D=S;export{D as default};
5
+ import{_ as i}from"../../../chunks/tslib.es6.js";import"../../../symbols.js";import t from"../../../core/Evented.js";import e from"../../../core/Handles.js";import{clone as s}from"../../../core/lang.js";import{destroyMaybe as r,isNone as h,isSome as a}from"../../../core/maybe.js";import{watch as o,when as c}from"../../../core/reactiveUtils.js";import{property as n}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/accessorSupport/ensureType.js";import{subclass as l}from"../../../core/accessorSupport/decorators/subclass.js";import p from"../../../layers/GraphicsLayer.js";import{cloneMove as d}from"./drawUtils.js";import v from"./HighlightHelper.js";import{addUniqueLayer as g,findLayerView as _}from"./layerUtils.js";import{GraphicClickEvent as m,GraphicDoubleClickEvent as y,GraphicPointerDownEvent as u,GraphicPointerUpEvent as f,GraphicPointerOutEvent as w,GraphicMoveStartEvent as G,GraphicMoveEvent as b,GraphicMoveStopEvent as k,GraphicPointerOverEvent as O}from"./input/GraphicMoverEvents.js";import{ViewEventPriorities as H}from"../../input/InputManager.js";import{GraphicManipulator as M}from"../../interactive/GraphicManipulator.js";import{createScreenPointFromEvent as x}from"../../support/screenUtils.js";import E from"../../../symbols/SimpleMarkerSymbol.js";import j from"../../../symbols/SimpleLineSymbol.js";import U from"../../../symbols/SimpleFillSymbol.js";const P="indicator-symbols";let S=class extends t.EventedAccessor{constructor(i){super(i),this._activeGraphic=null,this._dragEvent=null,this._handles=new e,this._hoverGraphic=null,this._indicators=[],this._initialDragGeometry=null,this._viewHandles=new e,this._manipulators=[],this._layerViews=null,this.type="graphic-mover",this.callbacks={onGraphicClick(){},onGraphicDoubleClick(){},onGraphicMoveStart(){},onGraphicMove(){},onGraphicMoveStop(){},onGraphicPointerOver(){},onGraphicPointerOut(){},onGraphicPointerDown(){},onGraphicPointerUp(){}},this.enableMoveAllGraphics=!1,this.graphics=[],this.indicatorsEnabled=!1,this.layer=new p({listMode:"hide",internal:!0,title:"GraphicMover highlight layer"}),this.view=null}initialize(){g(this.view,this.layer),this._highlightHelper=new v({view:this.view}),this.refresh(),this._handles.add([o((()=>[this.graphics,this.graphics?.length]),(()=>this.refresh())),c((()=>this.view?.ready),(()=>{this._viewHandles.add([this.view.on("immediate-click",(i=>this._clickHandler(i)),H.TOOL),this.view.on("double-click",(i=>this._doubleClickHandler(i)),H.TOOL),this.view.on("pointer-down",(i=>this._pointerDownHandler(i)),H.TOOL),this.view.on("pointer-move",(i=>this._pointerMoveHandler(i)),H.TOOL),this.view.on("pointer-up",(i=>this._pointerUpHandler(i)),H.TOOL),this.view.on("drag",(i=>this._dragHandler(i)),H.TOOL),this.view.on("key-down",(i=>this._keyDownHandler(i)),H.TOOL)])}),{once:!0,initial:!0}),o((()=>this.view),(i=>{this._highlightHelper.removeAll(),this._highlightHelper.view=i}))])}destroy(){this._removeIndicators(),this.view.map?.remove(this.layer),this.layer.destroy(),this.reset(),this._manipulators.forEach((i=>i.destroy())),this._manipulators=null,this._handles=r(this._handles),this._viewHandles=r(this._viewHandles)}set highlightsEnabled(i){this._highlightHelper?.removeAll(),this._set("highlightsEnabled",i),i&&this._highlightHelper?.add(this.graphics)}get state(){const i=!!this.get("view.ready"),t=!!this.get("graphics.length"),e=this._activeGraphic;return i&&t?e?"moving":"active":i?"ready":"disabled"}refresh(){this.reset(),this._setup()}reset(){this._activeGraphic=null,this._hoverGraphic=null,this._dragEvent=null,this._highlightHelper.removeAll()}updateGeometry(i,t){const e=this.graphics[i];e&&(e.set("geometry",t),this._setUpIndicators())}_setup(){this._setUpHighlights(),this._setUpIndicators(),this._setUpManipulators(),this._syncLayerViews()}_clickHandler(i){const t=this._findTargetGraphic(x(i));if(t){const e=new m(t,this.graphics.indexOf(t),i.x,i.y,i);this.emit("graphic-click",e),this.callbacks.onGraphicClick&&this.callbacks.onGraphicClick(e)}}_doubleClickHandler(i){const t=this._findTargetGraphic(x(i));if(t){const e=new y(t,this.graphics.indexOf(t),i.x,i.y,i);this.emit("graphic-double-click",e),this.callbacks.onGraphicDoubleClick&&this.callbacks.onGraphicDoubleClick(e)}}_pointerDownHandler(i){const t=this._findTargetGraphic(x(i));if(t){this._activeGraphic=t;const{x:e,y:s}=i,r=new u(t,this.graphics.indexOf(t),e,s,i);this.emit("graphic-pointer-down",r),this.callbacks.onGraphicPointerDown&&this.callbacks.onGraphicPointerDown(r)}else this._activeGraphic=null}_pointerUpHandler(i){if(this._activeGraphic){const{x:t,y:e}=i,s=this.graphics.indexOf(this._activeGraphic),r=new f(this._activeGraphic,s,t,e,i);this.emit("graphic-pointer-up",r),this.callbacks.onGraphicPointerUp&&this.callbacks.onGraphicPointerUp(r)}}_pointerMoveHandler(i){if(this._dragEvent)return;const t=this._findTargetGraphic(x(i));if(t){const{x:e,y:s}=i;if(this._hoverGraphic){if(this._hoverGraphic===t)return;const r=this.graphics.indexOf(this._hoverGraphic),h=new w(this.graphics[r],r,e,s,i);this._hoverGraphic=null,this.emit("graphic-pointer-out",h),this.callbacks.onGraphicPointerOut&&this.callbacks.onGraphicPointerOut(h)}const r=this.graphics.indexOf(t),h=new O(t,r,e,s,i);return this._hoverGraphic=t,this.emit("graphic-pointer-over",h),void(this.callbacks.onGraphicPointerOver&&this.callbacks.onGraphicPointerOver(h))}if(this._hoverGraphic){const{x:t,y:e}=i,s=this.graphics.indexOf(this._hoverGraphic),r=new w(this.graphics[s],s,t,e,i);this._hoverGraphic=null,this.emit("graphic-pointer-out",r),this.callbacks.onGraphicPointerOut&&this.callbacks.onGraphicPointerOut(r)}}_dragHandler(i){if("start"!==i.action&&!this._dragEvent||!this._activeGraphic||!this._activeGraphic.geometry)return;"start"===i.action&&this._removeIndicators(),i.stopPropagation();const{action:t,x:e,y:r}=i,h=this.graphics.indexOf(this._activeGraphic),a=this._dragEvent?e-this._dragEvent.x:0,o=this._dragEvent?r-this._dragEvent.y:0,c=e-i.origin.x,n=r-i.origin.y,l="start"===t?this._activeGraphic.geometry:this._initialDragGeometry,p=d(l,c,n,this.view);if(this._activeGraphic.geometry=p,this.enableMoveAllGraphics&&this.graphics.forEach((i=>{i!==this._activeGraphic&&(i.geometry=d(i.geometry,a,o,this.view))})),this._dragEvent=i,"start"===t){this._initialDragGeometry=s(l);const t=new G(this._activeGraphic,this.graphics,h,e,r,a,o,c,n,i);this.emit("graphic-move-start",t),this.callbacks.onGraphicMoveStart&&this.callbacks.onGraphicMoveStart(t),t.defaultPrevented&&this._activeGraphic.set("geometry",l)}else if("update"===t){const t=new b(this._activeGraphic,this.graphics,h,e,r,a,o,c,n,i);this.emit("graphic-move",t),this.callbacks.onGraphicMove&&this.callbacks.onGraphicMove(t),t.defaultPrevented&&(this._activeGraphic.geometry=l)}else{const t=new k(this._activeGraphic,this.graphics,h,e,r,a,o,c,n,i);this._dragEvent=null,this._activeGraphic=null,this._setUpIndicators(),this.emit("graphic-move-stop",t),this.callbacks.onGraphicMoveStop&&this.callbacks.onGraphicMoveStop(t),t.defaultPrevented&&(this.graphics[h].set("geometry",this._initialDragGeometry),this._setUpIndicators()),this._initialDragGeometry=null}}_keyDownHandler(i){"a"!==i.key&&"d"!==i.key&&"n"!==i.key||"moving"!==this.state||i.stopPropagation()}_findTargetGraphic(i){const t=this.view.toMap(i);let e=null,s=Number.MAX_VALUE;this._syncLayerViews();const r=this._layerViews.flatMap((i=>"graphicsViews"in i?Array.from(i.graphicsViews(),(i=>i.hitTest(t))).flat():i.graphicsView.hitTest(t))).filter((i=>this.graphics.includes(i)));return r.length?r[0]:(this._manipulators.forEach((t=>{const r=t.intersectionDistance(i);a(r)&&r<s&&(s=r,e=t.graphic)})),e)}_syncLayerViews(){this._layerViews=[];const i=new Set;for(const t of this.graphics){const e=_(this.view,t.layer);e&&i.add(e)}this._layerViews=[...i]}_setUpManipulators(){const{graphics:i,view:t}=this;this._manipulators.forEach((i=>i.destroy())),this._manipulators=i?.length?i.map((i=>new M({graphic:i,view:t}))):[]}_setUpHighlights(){this.highlightsEnabled&&this._highlightHelper.add(this.graphics)}_setUpIndicators(){if(this._removeIndicators(),this.indicatorsEnabled){for(const i of this.graphics){const t=i.clone();t.symbol=this._getSymbolForIndicator(i),this._indicators.push(t),this._handles.add(o((()=>i.symbol),(()=>this._setUpIndicators())),P)}this.layer.addMany(this._indicators)}}_removeIndicators(){this._handles.remove(P),this._indicators.length&&(this.layer.removeMany(this._indicators),this._indicators.forEach((i=>i.destroy())),this._indicators=[])}_getSymbolForIndicator(i){const t=12;if(h(i.symbol))return null;switch(i.symbol.type){case"cim":return new E({style:"circle",size:t,color:[0,0,0,0],outline:{color:[255,127,0,1],width:1}});case"picture-marker":{const{xoffset:t,yoffset:e,height:s,width:r}=i.symbol,h=s===r?r:Math.max(s,r);return new E({xoffset:t,yoffset:e,size:h,style:"square",color:[0,0,0,0],outline:{color:[255,127,0,1],width:1}})}case"simple-marker":{const{xoffset:t,yoffset:e,size:s,style:r}=i.symbol;return new E({xoffset:t,yoffset:e,style:"circle"===r?"circle":"square",size:s+2,color:[0,0,0,0],outline:{color:[255,127,0,1],width:1}})}case"simple-fill":return new U({color:[0,0,0,0],outline:{style:"dash",color:[255,127,0,1],width:1}});case"simple-line":return new j({color:[255,127,0,1],style:"dash",width:1});case"text":{const{xoffset:e,yoffset:s}=i.symbol;return new E({xoffset:e,yoffset:s,size:t,color:[0,0,0,0],outline:{color:[255,127,0,1],width:1}})}default:return null}}};i([n()],S.prototype,"_activeGraphic",void 0),i([n({readOnly:!0})],S.prototype,"type",void 0),i([n()],S.prototype,"callbacks",void 0),i([n()],S.prototype,"enableMoveAllGraphics",void 0),i([n()],S.prototype,"graphics",void 0),i([n({value:!1})],S.prototype,"highlightsEnabled",null),i([n()],S.prototype,"indicatorsEnabled",void 0),i([n()],S.prototype,"layer",void 0),i([n({readOnly:!0})],S.prototype,"state",null),i([n()],S.prototype,"view",void 0),S=i([l("esri.views.draw.support.GraphicMover")],S);const D=S;export{D as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.24/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../chunks/tslib.es6.js";import"../../../geometry.js";import t from"../../../Graphic.js";import i from"../../../core/Collection.js";import s from"../../../core/Error.js";import r from"../../../core/Evented.js";import o from"../../../core/Handles.js";import n from"../../../core/Logger.js";import{destroyMaybe as a,isNone as h,isSome as c,abortMaybe as p,get as l}from"../../../core/maybe.js";import{createTask as d}from"../../../core/promiseUtils.js";import{whenOnce as m,pausable as v}from"../../../core/watchUtils.js";import{property as y}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/arrayUtils.js";import"../../../core/has.js";import"../../../core/accessorSupport/ensureType.js";import{subclass as _}from"../../../core/accessorSupport/decorators/subclass.js";import{geometryToCoordinates as g,getMidpoint as u}from"../../../geometry/support/coordsUtils.js";import x from"../../../layers/GraphicsLayer.js";import f from"../../../symbols/SimpleMarkerSymbol.js";import{ViewingMode as G}from"../../ViewingMode.js";import{SnappingVisualizer2D as b}from"../../2d/interactive/SnappingVisualizer2D.js";import{cloneMove as V}from"./drawUtils.js";import M from"./GraphicMover.js";import w from"./HighlightHelper.js";import{addUniqueLayer as S}from"./layerUtils.js";import{settings as k}from"./settings.js";import{ViewEventPriorities as E}from"../../input/InputManager.js";import{SKETCH_KEYS as I}from"../../interactive/keybindings.js";import{EditGeometryOperations as O}from"../../interactive/editGeometry/EditGeometryOperations.js";import{SnappingContext as C}from"../../interactive/snapping/SnappingContext.js";import R from"../../../geometry/Polyline.js";import j from"../../../geometry/Point.js";class H{constructor(e,t,i){this.graphic=e,this.mover=t,this.selected=i,this.type="reshape-start"}}class A{constructor(e,t,i){this.graphic=e,this.mover=t,this.selected=i,this.type="reshape"}}class U{constructor(e,t,i){this.graphic=e,this.mover=t,this.selected=i,this.type="reshape-stop"}}class T{constructor(e,t,i){this.mover=e,this.dx=t,this.dy=i,this.type="move-start"}}class D{constructor(e,t,i){this.mover=e,this.dx=t,this.dy=i,this.type="move"}}class F{constructor(e,t,i){this.mover=e,this.dx=t,this.dy=i,this.type="move-stop"}}class z{constructor(e){this.added=e,this.type="vertex-select"}}class L{constructor(e){this.removed=e,this.type="vertex-deselect"}}class P{constructor(e,t,i,s){this.added=e,this.graphic=t,this.oldGraphic=i,this.vertices=s,this.type="vertex-add"}}class K{constructor(e,t,i,s){this.removed=e,this.graphic=t,this.oldGraphic=i,this.vertices=s,this.type="vertex-remove"}}const N=k.reshapeGraphics,q={vertices:{default:new f({style:"circle",size:N.vertex.size,color:N.vertex.color,outline:{color:N.vertex.outlineColor,width:1}}),hover:new f({style:"circle",size:N.vertex.hoverSize,color:N.vertex.hoverColor,outline:{color:N.vertex.hoverOutlineColor,width:1}}),selected:new f({style:"circle",size:N.selected.size,color:N.selected.color,outline:{color:N.selected.outlineColor,width:1}})},midpoints:{default:new f({style:"circle",size:N.midpoint.size,color:N.midpoint.color,outline:{color:N.midpoint.outlineColor,width:1}}),hover:new f({style:"circle",size:N.midpoint.size,color:N.midpoint.color,outline:{color:N.midpoint.outlineColor,width:1}})}},B="esri.views.draw.support.Reshape",J=n.getLogger(B);let Q=class extends r.EventedAccessor{constructor(e){super(e),this._activeOperationInfo=null,this._editGeometryOperations=null,this._handles=new o,this._graphicAttributes={esriSketchTool:"box"},this._mover=null,this._snappingTask=null,this._stagedVertex=null,this._viewHandles=new o,this.callbacks={onReshapeStart(){},onReshape(){},onReshapeStop(){},onMoveStart(){},onMove(){},onMoveStop(){},onGraphicClick(){}},this.enableMidpoints=!0,this.enableMovement=!0,this.enableVertices=!0,this.graphic=null,this.layer=null,this.midpointGraphics=new i,this.midpointSymbol=new f({style:"circle",size:6,color:[200,200,200],outline:{color:[100,100,100],width:1}}),this.selectedVertices=[],this.snappingManager=null,this.type="reshape",this.vertexGraphics=new i,this.view=null}initialize(){this._highlightHelper=new w({view:this.view}),this._setup(),this._handles.add([m(this,"view.ready",(()=>{const{layer:e,view:t}=this;S(t,e),this._viewHandles.add([t.on("key-down",(e=>this._keyDownHandler(e)),E.TOOL)])})),v(this,"graphic",(()=>this.refresh())),v(this,"layer",((e,t)=>{t&&(this._clearSelection(),this._resetGraphics(t)),this.refresh()})),v(this,"enableMidpoints",(()=>{this.refresh()}))])}destroy(){var e;this._reset(),null==(e=this._mover)||e.destroy(),this._mover=null,this._handles=a(this._handles),this._viewHandles=a(this._viewHandles)}set highlightsEnabled(e){var t;null==(t=this._highlightHelper)||t.removeAll(),this._set("highlightsEnabled",e),this._setUpHighlights()}get state(){const e=!!this.get("view.ready"),t=!(!this.get("graphic")||!this.get("layer"));return e&&t?"active":e?"ready":"disabled"}set symbols(e){const{midpoints:t=q.midpoints,vertices:i=q.vertices}=e||{};this._set("symbols",{midpoints:t,vertices:i})}isUIGraphic(e){const t=[];return this.graphic&&t.push(this.graphic),t.concat(this.vertexGraphics.items,this.midpointGraphics.items),t.length&&t.includes(e)}refresh(){this._reset(),this._setup()}reset(){this.graphic=null}clearSelection(){this._clearSelection()}removeSelectedVertices(){this.selectedVertices.length&&this._removeVertices(this.selectedVertices)}_setup(){const{graphic:e,layer:t}=this;if(!t||!e||h(e.geometry))return;const i=e.geometry;"mesh"!==i.type&&"extent"!==i.type?(this._setUpHighlights(),this._setupGraphics(),this._setupMover()):this._logGeometryTypeError()}_setUpHighlights(){this.highlightsEnabled&&this.graphic&&this._highlightHelper.add(this.graphic)}_setUpGeometryHelper(){const e=this.graphic.geometry;if(h(e)||"mesh"===e.type||"extent"===e.type)return void this._logGeometryTypeError();const t="multipoint"===e.type?new R({paths:e.points,spatialReference:e.spatialReference}):e;this._editGeometryOperations=O.fromGeometry(t,G.Local)}_saveSnappingContextForHandle(e,t){var i;this._snappingGraphicsLayer=new x({listMode:"hide",internal:!0,title:"Reshape snapping layer"}),this.view.map.layers.add(this._snappingGraphicsLayer),this._snappingContext=new C({editGeometryOperations:this._editGeometryOperations,elevationInfo:{mode:"on-the-ground",offset:0},pointer:(null==(i=t.viewEvent)?void 0:i.pointerType)||"mouse",excludeFeature:this.graphic,visualizer:new b(this._snappingGraphicsLayer),vertexHandle:this._getVertexFromEditGeometry(e)})}_reset(){this._clearSelection(),this._highlightHelper.removeAll(),this._resetGraphics(),this._resetSnappingStateVars(),this._activeOperationInfo=null,this._mover&&this._mover.destroy(),this._mover=null,this.view.cursor="default"}_resetSnappingStateVars(){c(this.snappingManager)&&this.snappingManager.doneSnapping(),c(this._snappingGraphicsLayer)&&(this.view.map.layers.remove(this._snappingGraphicsLayer),this._snappingGraphicsLayer.destroy()),this._editGeometryOperations=a(this._editGeometryOperations),this._snappingTask=p(this._snappingTask),this._snappingTask=null,this._snappingContext=null,this._stagedVertex=null}_resetGraphics(e){this._removeMidpointGraphics(e),this._removeVertexGraphics(e),this._set("selectedVertices",[])}_removeMidpointGraphics(e){const t=e||this.layer;t&&t.removeMany(this.midpointGraphics.items),this.midpointGraphics.items.forEach((e=>e.destroy())),this.midpointGraphics.removeAll()}_removeVertexGraphics(e){const t=e||this.layer;t&&t.removeMany(this.vertexGraphics.items),this.vertexGraphics.items.forEach((e=>e.destroy())),this.vertexGraphics.removeAll()}_getCoordinatesForUI(e){const t=g(e.clone());if("polygon"===e.type)for(const i of t){const e=i[i.length-1];i[0][0]===e[0]&&i[0][1]===e[1]&&i.length>2&&i.pop()}return t}_setupGraphics(){const e=this.graphic.geometry;if(c(e)&&("polyline"===e.type||"polygon"===e.type)){const t=this._getCoordinatesForUI(e);this.enableMidpoints&&this._setUpMidpointGraphics(t),this.enableVertices&&this._setUpVertexGraphics(t)}}_setUpMidpointGraphics(e){this._removeMidpointGraphics();const t=this._createMidpointGraphics(e);this.midpointGraphics.addMany(t),this.layer.addMany(t)}_setUpVertexGraphics(e){this._removeVertexGraphics();const t=this._createVertexGraphics(e);this.vertexGraphics.addMany(t),this._storeRelatedVertexIndices(),this.layer.addMany(t)}_createVertexGraphics(e){const{_graphicAttributes:i,symbols:s,view:{spatialReference:r}}=this,o=[];return null==e||e.forEach(((e,n)=>{e.forEach(((e,a)=>{var h;const[c,p]=e;o.push(new t({geometry:new j({x:c,y:p,spatialReference:r}),symbol:null==s||null==(h=s.vertices)?void 0:h.default,attributes:{...i,pathIndex:n,pointIndex:a}}))}))})),o}_createMidpointGraphics(e){const{_graphicAttributes:i,symbols:s,view:{spatialReference:r}}=this,o=[];return null==e||e.forEach(((e,n)=>{e.forEach(((a,h)=>{const[c,p]=a,d=e[h+1]?h+1:0;if("polygon"===l(this.graphic.geometry,"type")||0!==d){const[a,l]=e[d],[m,v]=u([c,p],[a,l]);o.push(new t({geometry:new j({x:m,y:v,spatialReference:r}),symbol:s.midpoints.default,attributes:{...i,pathIndex:n,pointIndexStart:h,pointIndexEnd:d}}))}}))})),o}_storeRelatedVertexIndices(){const e=this.vertexGraphics.items;if(!e)return;const t=e.map((({geometry:e})=>({x:e.x,y:e.y})));for(let i=0;i<t.length;i++){const s=[];for(let e=0;e<t.length;e++){if(i===e)continue;const r=t[i],o=t[e];r.x===o.x&&r.y===o.y&&s.push(e)}e[i].attributes.relatedGraphicIndices=s}}_setupMover(){const{enableMovement:e,graphic:t,midpointGraphics:i,vertexGraphics:s,view:r}=this,o=s.concat(i).items;e&&o.push(t),this._mover=new M({enableMoveAllGraphics:!1,highlightsEnabled:!1,indicatorsEnabled:!1,graphics:o,view:r,callbacks:{onGraphicClick:e=>this._onGraphicClickCallback(e),onGraphicMoveStart:e=>this._onGraphicMoveStartCallback(e),onGraphicMove:e=>this._onGraphicMoveCallback(e),onGraphicMoveStop:e=>this._onGraphicMoveStopCallback(e),onGraphicPointerOver:e=>this._onGraphicPointerOverCallback(e),onGraphicPointerOut:e=>this._onGraphicPointerOutCallback(e)}})}_onGraphicClickCallback(e){e.viewEvent.stopPropagation();const t=e.graphic;if(t===this.graphic)this.clearSelection(),this.emit("graphic-click",e),this.callbacks.onGraphicClick&&this.callbacks.onGraphicClick(e);else if(this._isMidpoint(t)){if(2===e.viewEvent.button)return;const i=this.graphic.clone(),s=this._createVertexFromMidpoint(t);this.refresh(),this._emitVertexAddEvent([t],i,s)}else if(this._isVertex(t))if(e.viewEvent.stopPropagation(),2===e.viewEvent.button)this._removeVertices(t);else{e.viewEvent.native.shiftKey||this._clearSelection(),this.selectedVertices.includes(t)?this._removeFromSelection(t,!0):this._addToSelection(t)}}_setUpOperation(e){const{graphic:t,dx:i,dy:s}=e,r=t===this.graphic;this._resetSnappingStateVars(),this._setUpGeometryHelper(),this._saveSnappingContextForHandle(t,e),this._activeOperationInfo={target:this.graphic,mover:t,operationType:r?"move":"reshape",totalDx:i,totalDy:s}}_onGraphicMoveStartCallback(e){const t=e.graphic,{dx:i,dy:s}=e;if(t===this.graphic)return this._clearSelection(),this._resetGraphics(),this._setUpOperation(e),this._emitMoveStartEvent(i,s),void("point"===this._editGeometryOperations.data.type&&this._onHandleMove(t,i,s,e,(()=>this._emitMoveEvent(i,s))));if(!this.selectedVertices.includes(t)){if(this._clearSelection(),this._isMidpoint(t)){const e=this.graphic.clone(),i=this._createVertexFromMidpoint(t);this._emitVertexAddEvent([t],e,i)}this._addToSelection(t)}this._setUpOperation(e),this._emitReshapeStartEvent(t),this._onHandleMove(t,i,s,e,(()=>this._emitReshapeEvent(t)))}_onGraphicMoveCallback(e){const{graphic:t,dx:i,dy:s}=e;this._activeOperationInfo.totalDx+=i,this._activeOperationInfo.totalDy+=s;const{operationType:r}=this._activeOperationInfo;"move"===r?"point"===this._editGeometryOperations.data.type?this._onHandleMove(t,i,s,e,(()=>this._emitMoveEvent(i,s))):this._emitMoveEvent(i,s):this._onHandleMove(t,i,s,e,(()=>this._emitReshapeEvent(t)))}_onGraphicMoveStopCallback(e){const{graphic:t,dx:i,dy:s}=e;this._activeOperationInfo.totalDx+=i,this._activeOperationInfo.totalDy+=s,t===this.graphic?(this._emitMoveStopEvent(),this.refresh()):(this._onHandleMove(t,i,s,e,(()=>this._emitReshapeStopEvent(t))),this._resetSnappingStateVars(),this._activeOperationInfo=null,this._isMidpoint(t)&&this.refresh())}_updateMidpointGraphicLocations(e){for(const t of this.midpointGraphics){const{pathIndex:i,pointIndexStart:s,pointIndexEnd:r}=t.attributes,[o,n]=e[i][s],[a,h]=e[i][r],[c,p]=u([o,n],[a,h]);t.geometry=new j({x:c,y:p,spatialReference:this.view.spatialReference})}}_getIndicesForVertexGraphic({attributes:e}){return[(null==e?void 0:e.pathIndex)||0,(null==e?void 0:e.pointIndex)||0]}_getVertexFromEditGeometry(e){const[t,i]=this._getIndicesForVertexGraphic(e);return this._editGeometryOperations.data.components[t].vertices[i]}_onHandleMove(e,t,i,s,r){if(p(this._snappingTask),!this._snappingContext)return;const o=e.geometry,n="graphic-move-stop"===s.type;if(c(this.snappingManager)&&this.selectedVertices.length<2&&!n){const s=this.snappingManager;this._stagedVertex=s.update(o,this._snappingContext),this._syncGeometryAfterVertexMove(e,new j(this._stagedVertex),t,i,n),r(),this._snappingTask=d((async a=>{const h=await s.snap(o,this._snappingContext,a);h.valid&&(this._stagedVertex=h.apply(),this._syncGeometryAfterVertexMove(e,new j(this._stagedVertex),t,i,n),r())}))}else{const s=c(this._stagedVertex)?new j(this._stagedVertex):o;this._syncGeometryAfterVertexMove(e,s,t,i,n),r()}}async _syncGeometryAfterVertexMove(e,t,i,s,r=!1){const o=this._editGeometryOperations.data.geometry;if("point"===o.type)e.geometry=t;else{const{x:n,y:a}=t,[h,c]=this._getIndicesForVertexGraphic(e);let p=g(o);const l=p[h].length-1;p[h][c]=[n,a],"polygon"===o.type&&(0===c?p[h][l]=[n,a]:c===l&&(p[h][0]=[n,a])),this._isVertex(e)&&(p=this._moveRelatedCoordinates(p,e,n,a),p=this._moveSelectedHandleCoordinates(p,e,i,s,"polygon"===o.type),this._updateMidpointGraphicLocations(p)),this.graphic.geometry=o.clone();const d=this._getVertexFromEditGeometry(e),m=n-d.pos[0],v=a-d.pos[1];this._editGeometryOperations.moveVertices([d],m,v,0),r&&(this._mover?this._mover.updateGeometry(this._mover.graphics.indexOf(e),t):e.geometry=t)}}_moveRelatedCoordinates(e,t,i,s){const{relatedGraphicIndices:r}=t.attributes;for(const o of r){const r=this.vertexGraphics.getItemAt(o),{pathIndex:n,pointIndex:a}=r.attributes;e[n][a]=[i,s],r.geometry=t.geometry}return e}_moveSelectedHandleCoordinates(e,t,i,s,r){for(const o of this.selectedVertices)if(o!==t){const{pathIndex:t,pointIndex:n,relatedGraphicIndices:a}=o.attributes,h=V(o.geometry,i,s,this.view),c=e[t].length-1;e[t][n]=[h.x,h.y],o.geometry=h,r&&(0===n?e[t][c]=[h.x,h.y]:n===c&&(e[t][0]=[h.x,h.y]));for(const i of a){const t=this.vertexGraphics.getItemAt(i),{pathIndex:s,pointIndex:r}=t.attributes;e[s][r]=[h.x,h.y],t.geometry=h}}return e}_onGraphicPointerOverCallback(e){const t=e.graphic;this._isVertex(t)&&!this._isSelected(t)&&(t.symbol=this.symbols.vertices.hover),this._updateHoverCursor(t)}_onGraphicPointerOutCallback(e){const t=e.graphic;this._isVertex(t)&&!this._isSelected(t)&&(t.symbol=this.symbols.vertices.default),this.view.cursor="default"}_createVertexFromMidpoint(e){const{_graphicAttributes:t,graphic:i}=this,s=i.geometry;if(h(s)||"polygon"!==s.type&&"polyline"!==s.type)return[];const r=s.clone(),o=[],{pathIndex:n,pointIndexStart:a,pointIndexEnd:c}=e.attributes,{x:p,y:l}=e.geometry,d=0===c?a+1:c,m=g(r);return m[n].splice(d,0,[p,l]),e.attributes={...t,pathIndex:n,pointIndex:d,relatedGraphicIndices:[]},o.push({coordinates:m[n][d],componentIndex:n,vertexIndex:d}),this.graphic.geometry=r,o}_addToSelection(e){e instanceof t&&(e=[e]);for(const t of e)t.symbol=this.symbols.vertices.selected;this._set("selectedVertices",this.selectedVertices.concat(e)),this._emitSelectEvent(e)}_removeFromSelection(e,i){const{vertices:s}=this.symbols,r=i?s.hover:s.default;e instanceof t&&(e=[e]);for(const t of e)this.selectedVertices.splice(this.selectedVertices.indexOf(t),1),this._set("selectedVertices",this.selectedVertices),t.set("symbol",r);this._emitDeselectEvent(e)}_clearSelection(){if(this.selectedVertices.length){const e=this.selectedVertices;for(const t of this.selectedVertices)t.set("symbol",this.symbols.vertices.default);this._set("selectedVertices",[]),this._emitDeselectEvent(e)}}_keyDownHandler(e){I.delete.includes(e.key)&&!e.repeat&&this.selectedVertices.length&&this._removeVertices(this.selectedVertices)}_removeVertices(e){const i=this.graphic.geometry;if(h(i)||"polygon"!==i.type&&"polyline"!==i.type)return;if("polygon"===i.type&&this.vertexGraphics.length<4||this.vertexGraphics.length<3)return;e instanceof t&&(e=[e]);const s=this.graphic.clone(),r=i.clone();let o=g(r);const n=[];e instanceof t&&(e=[e]);for(const t of e){const{x:e,y:i}=t.geometry;for(let t=0;t<o.length;t++){const s=o[t];for(let r=0;r<s.length;r++){const[a,h]=s[r];e===a&&i===h&&(n.push({coordinates:o[t][r],componentIndex:t,vertexIndex:r}),o[t].splice(Number(r),1))}}}if("polygon"===r.type)o=o.filter((e=>{if(e.length<2)return!1;const[t,i]=e[0],[s,r]=e[e.length-1];return(2!==e.length||t!==s||i!==r)&&(t===s&&i===r||e.push(e[0]),!0)})),r.rings=o;else{for(const e of o)1===e.length&&o.splice(o.indexOf(e),1);r.paths=o}this.graphic.geometry=r,this.refresh(),this._emitVertexRemoveEvent(e,s,n)}_isVertex(e){return this.vertexGraphics.includes(e)}_isSelected(e){return this._isVertex(e)&&this.selectedVertices.includes(e)}_isMidpoint(e){return this.midpointGraphics.includes(e)}_updateHoverCursor(e){this.view.cursor=this._isMidpoint(e)?"copy":"move"}_emitMoveStartEvent(e,t){const i=new T(this.graphic,e,t);this.emit("move-start",i),this.callbacks.onMoveStart&&this.callbacks.onMoveStart(i)}_emitMoveEvent(e,t){const i=new D(this.graphic,e,t);this.emit("move",i),this.callbacks.onMove&&this.callbacks.onMove(i)}_emitMoveStopEvent(){const{totalDx:e,totalDy:t}=this._activeOperationInfo,i=new F(this.graphic,e,t);this.emit("move-stop",i),this.callbacks.onMoveStop&&this.callbacks.onMoveStop(i)}_emitReshapeStartEvent(e){const t=new H(this.graphic,e,this.selectedVertices);this.emit("reshape-start",t),this.callbacks.onReshapeStart&&this.callbacks.onReshapeStart(t)}_emitReshapeEvent(e){const t=new A(this.graphic,e,this.selectedVertices);this.emit("reshape",t),this.callbacks.onReshape&&this.callbacks.onReshape(t)}_emitReshapeStopEvent(e){const t=new U(this.graphic,e,this.selectedVertices);this.emit("reshape-stop",t),this.callbacks.onReshapeStop&&this.callbacks.onReshapeStop(t)}_emitSelectEvent(e){const t=new z(e);this.emit("select",t),this.callbacks.onVertexSelect&&this.callbacks.onVertexSelect(t)}_emitDeselectEvent(e){const t=new L(e);this.emit("deselect",t),this.callbacks.onVertexDeselect&&this.callbacks.onVertexDeselect(t)}_emitVertexAddEvent(e,t,i){const s=new P(e,this.graphic,t,i);this.emit("vertex-add",s),this.callbacks.onVertexAdd&&this.callbacks.onVertexAdd(s)}_emitVertexRemoveEvent(e,t,i){const s=new K(e,this.graphic,t,i);this.emit("vertex-remove",s),this.callbacks.onVertexRemove&&this.callbacks.onVertexRemove(s)}_logGeometryTypeError(){J.error(new s("reshape:invalid-geometry","Reshape operation not supported for the provided graphic. The geometry type is not supported."))}};e([y()],Q.prototype,"callbacks",void 0),e([y()],Q.prototype,"enableMidpoints",void 0),e([y()],Q.prototype,"enableMovement",void 0),e([y()],Q.prototype,"enableVertices",void 0),e([y()],Q.prototype,"graphic",void 0),e([y({value:!0})],Q.prototype,"highlightsEnabled",null),e([y()],Q.prototype,"layer",void 0),e([y({readOnly:!0})],Q.prototype,"midpointGraphics",void 0),e([y()],Q.prototype,"midpointSymbol",void 0),e([y({readOnly:!0})],Q.prototype,"selectedVertices",void 0),e([y()],Q.prototype,"snappingManager",void 0),e([y({readOnly:!0})],Q.prototype,"state",null),e([y({value:q})],Q.prototype,"symbols",null),e([y({readOnly:!0})],Q.prototype,"type",void 0),e([y({readOnly:!0})],Q.prototype,"vertexGraphics",void 0),e([y()],Q.prototype,"view",void 0),Q=e([_(B)],Q);const W=Q;export{W as default};
5
+ import{_ as e}from"../../../chunks/tslib.es6.js";import"../../../geometry.js";import t from"../../../Graphic.js";import i from"../../../core/Collection.js";import s from"../../../core/Error.js";import r from"../../../core/Evented.js";import o from"../../../core/Handles.js";import n from"../../../core/Logger.js";import{destroyMaybe as h,isNone as a,isSome as c,abortMaybe as p,get as l}from"../../../core/maybe.js";import{createTask as d}from"../../../core/promiseUtils.js";import{whenOnce as m,pausable as v}from"../../../core/watchUtils.js";import{property as y}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/arrayUtils.js";import"../../../core/has.js";import"../../../core/accessorSupport/ensureType.js";import{subclass as _}from"../../../core/accessorSupport/decorators/subclass.js";import{geometryToCoordinates as g,getMidpoint as u}from"../../../geometry/support/coordsUtils.js";import x from"../../../layers/GraphicsLayer.js";import f from"../../../symbols/SimpleMarkerSymbol.js";import{ViewingMode as G}from"../../ViewingMode.js";import{SnappingVisualizer2D as b}from"../../2d/interactive/SnappingVisualizer2D.js";import{cloneMove as V}from"./drawUtils.js";import M from"./GraphicMover.js";import w from"./HighlightHelper.js";import{addUniqueLayer as S}from"./layerUtils.js";import{settings as k}from"./settings.js";import{ViewEventPriorities as E}from"../../input/InputManager.js";import{SKETCH_KEYS as I}from"../../interactive/keybindings.js";import{EditGeometryOperations as O}from"../../interactive/editGeometry/EditGeometryOperations.js";import{SnappingContext as C}from"../../interactive/snapping/SnappingContext.js";import R from"../../../geometry/Polyline.js";import j from"../../../geometry/Point.js";class H{constructor(e,t,i){this.graphic=e,this.mover=t,this.selected=i,this.type="reshape-start"}}class A{constructor(e,t,i){this.graphic=e,this.mover=t,this.selected=i,this.type="reshape"}}class U{constructor(e,t,i){this.graphic=e,this.mover=t,this.selected=i,this.type="reshape-stop"}}class T{constructor(e,t,i){this.mover=e,this.dx=t,this.dy=i,this.type="move-start"}}class D{constructor(e,t,i){this.mover=e,this.dx=t,this.dy=i,this.type="move"}}class F{constructor(e,t,i){this.mover=e,this.dx=t,this.dy=i,this.type="move-stop"}}class z{constructor(e){this.added=e,this.type="vertex-select"}}class L{constructor(e){this.removed=e,this.type="vertex-deselect"}}class P{constructor(e,t,i,s){this.added=e,this.graphic=t,this.oldGraphic=i,this.vertices=s,this.type="vertex-add"}}class K{constructor(e,t,i,s){this.removed=e,this.graphic=t,this.oldGraphic=i,this.vertices=s,this.type="vertex-remove"}}const N=k.reshapeGraphics,q={vertices:{default:new f({style:"circle",size:N.vertex.size,color:N.vertex.color,outline:{color:N.vertex.outlineColor,width:1}}),hover:new f({style:"circle",size:N.vertex.hoverSize,color:N.vertex.hoverColor,outline:{color:N.vertex.hoverOutlineColor,width:1}}),selected:new f({style:"circle",size:N.selected.size,color:N.selected.color,outline:{color:N.selected.outlineColor,width:1}})},midpoints:{default:new f({style:"circle",size:N.midpoint.size,color:N.midpoint.color,outline:{color:N.midpoint.outlineColor,width:1}}),hover:new f({style:"circle",size:N.midpoint.size,color:N.midpoint.color,outline:{color:N.midpoint.outlineColor,width:1}})}},B="esri.views.draw.support.Reshape",J=n.getLogger(B);let Q=class extends r.EventedAccessor{constructor(e){super(e),this._activeOperationInfo=null,this._editGeometryOperations=null,this._handles=new o,this._graphicAttributes={esriSketchTool:"box"},this._mover=null,this._snappingTask=null,this._stagedVertex=null,this._viewHandles=new o,this.callbacks={onReshapeStart(){},onReshape(){},onReshapeStop(){},onMoveStart(){},onMove(){},onMoveStop(){},onGraphicClick(){}},this.enableMidpoints=!0,this.enableMovement=!0,this.enableVertices=!0,this.graphic=null,this.layer=null,this.midpointGraphics=new i,this.midpointSymbol=new f({style:"circle",size:6,color:[200,200,200],outline:{color:[100,100,100],width:1}}),this.selectedVertices=[],this.snappingManager=null,this.type="reshape",this.vertexGraphics=new i,this.view=null}initialize(){this._highlightHelper=new w({view:this.view}),this._setup(),this._handles.add([m(this,"view.ready",(()=>{const{layer:e,view:t}=this;S(t,e),this._viewHandles.add([t.on("key-down",(e=>this._keyDownHandler(e)),E.TOOL)])})),v(this,"graphic",(()=>this.refresh())),v(this,"layer",((e,t)=>{t&&(this._clearSelection(),this._resetGraphics(t)),this.refresh()})),v(this,"enableMidpoints",(()=>{this.refresh()}))])}destroy(){this._reset(),this._mover?.destroy(),this._mover=null,this._handles=h(this._handles),this._viewHandles=h(this._viewHandles)}set highlightsEnabled(e){this._highlightHelper?.removeAll(),this._set("highlightsEnabled",e),this._setUpHighlights()}get state(){const e=!!this.get("view.ready"),t=!(!this.get("graphic")||!this.get("layer"));return e&&t?"active":e?"ready":"disabled"}set symbols(e){const{midpoints:t=q.midpoints,vertices:i=q.vertices}=e||{};this._set("symbols",{midpoints:t,vertices:i})}isUIGraphic(e){const t=[];return this.graphic&&t.push(this.graphic),t.concat(this.vertexGraphics.items,this.midpointGraphics.items),t.length&&t.includes(e)}refresh(){this._reset(),this._setup()}reset(){this.graphic=null}clearSelection(){this._clearSelection()}removeSelectedVertices(){this.selectedVertices.length&&this._removeVertices(this.selectedVertices)}_setup(){const{graphic:e,layer:t}=this;if(!t||!e||a(e.geometry))return;const i=e.geometry;"mesh"!==i.type&&"extent"!==i.type?(this._setUpHighlights(),this._setupGraphics(),this._setupMover()):this._logGeometryTypeError()}_setUpHighlights(){this.highlightsEnabled&&this.graphic&&this._highlightHelper.add(this.graphic)}_setUpGeometryHelper(){const e=this.graphic.geometry;if(a(e)||"mesh"===e.type||"extent"===e.type)return void this._logGeometryTypeError();const t="multipoint"===e.type?new R({paths:e.points,spatialReference:e.spatialReference}):e;this._editGeometryOperations=O.fromGeometry(t,G.Local)}_saveSnappingContextForHandle(e,t){this._snappingGraphicsLayer=new x({listMode:"hide",internal:!0,title:"Reshape snapping layer"}),this.view.map.layers.add(this._snappingGraphicsLayer),this._snappingContext=new C({editGeometryOperations:this._editGeometryOperations,elevationInfo:{mode:"on-the-ground",offset:0},pointer:t.viewEvent?.pointerType||"mouse",excludeFeature:this.graphic,visualizer:new b(this._snappingGraphicsLayer),vertexHandle:this._getVertexFromEditGeometry(e)})}_reset(){this._clearSelection(),this._highlightHelper.removeAll(),this._resetGraphics(),this._resetSnappingStateVars(),this._activeOperationInfo=null,this._mover&&this._mover.destroy(),this._mover=null,this.view.cursor="default"}_resetSnappingStateVars(){c(this.snappingManager)&&this.snappingManager.doneSnapping(),c(this._snappingGraphicsLayer)&&(this.view.map.layers.remove(this._snappingGraphicsLayer),this._snappingGraphicsLayer.destroy()),this._editGeometryOperations=h(this._editGeometryOperations),this._snappingTask=p(this._snappingTask),this._snappingTask=null,this._snappingContext=null,this._stagedVertex=null}_resetGraphics(e){this._removeMidpointGraphics(e),this._removeVertexGraphics(e),this._set("selectedVertices",[])}_removeMidpointGraphics(e){const t=e||this.layer;t&&t.removeMany(this.midpointGraphics.items),this.midpointGraphics.items.forEach((e=>e.destroy())),this.midpointGraphics.removeAll()}_removeVertexGraphics(e){const t=e||this.layer;t&&t.removeMany(this.vertexGraphics.items),this.vertexGraphics.items.forEach((e=>e.destroy())),this.vertexGraphics.removeAll()}_getCoordinatesForUI(e){const t=g(e.clone());if("polygon"===e.type)for(const i of t){const e=i[i.length-1];i[0][0]===e[0]&&i[0][1]===e[1]&&i.length>2&&i.pop()}return t}_setupGraphics(){const e=this.graphic.geometry;if(c(e)&&("polyline"===e.type||"polygon"===e.type)){const t=this._getCoordinatesForUI(e);this.enableMidpoints&&this._setUpMidpointGraphics(t),this.enableVertices&&this._setUpVertexGraphics(t)}}_setUpMidpointGraphics(e){this._removeMidpointGraphics();const t=this._createMidpointGraphics(e);this.midpointGraphics.addMany(t),this.layer.addMany(t)}_setUpVertexGraphics(e){this._removeVertexGraphics();const t=this._createVertexGraphics(e);this.vertexGraphics.addMany(t),this._storeRelatedVertexIndices(),this.layer.addMany(t)}_createVertexGraphics(e){const{_graphicAttributes:i,symbols:s,view:{spatialReference:r}}=this,o=[];return e?.forEach(((e,n)=>{e.forEach(((e,h)=>{const[a,c]=e;o.push(new t({geometry:new j({x:a,y:c,spatialReference:r}),symbol:s?.vertices?.default,attributes:{...i,pathIndex:n,pointIndex:h}}))}))})),o}_createMidpointGraphics(e){const{_graphicAttributes:i,symbols:s,view:{spatialReference:r}}=this,o=[];return e?.forEach(((e,n)=>{e.forEach(((h,a)=>{const[c,p]=h,d=e[a+1]?a+1:0;if("polygon"===l(this.graphic.geometry,"type")||0!==d){const[h,l]=e[d],[m,v]=u([c,p],[h,l]);o.push(new t({geometry:new j({x:m,y:v,spatialReference:r}),symbol:s.midpoints.default,attributes:{...i,pathIndex:n,pointIndexStart:a,pointIndexEnd:d}}))}}))})),o}_storeRelatedVertexIndices(){const e=this.vertexGraphics.items;if(!e)return;const t=e.map((({geometry:e})=>({x:e.x,y:e.y})));for(let i=0;i<t.length;i++){const s=[];for(let e=0;e<t.length;e++){if(i===e)continue;const r=t[i],o=t[e];r.x===o.x&&r.y===o.y&&s.push(e)}e[i].attributes.relatedGraphicIndices=s}}_setupMover(){const{enableMovement:e,graphic:t,midpointGraphics:i,vertexGraphics:s,view:r}=this,o=s.concat(i).items;e&&o.push(t),this._mover=new M({enableMoveAllGraphics:!1,highlightsEnabled:!1,indicatorsEnabled:!1,graphics:o,view:r,callbacks:{onGraphicClick:e=>this._onGraphicClickCallback(e),onGraphicMoveStart:e=>this._onGraphicMoveStartCallback(e),onGraphicMove:e=>this._onGraphicMoveCallback(e),onGraphicMoveStop:e=>this._onGraphicMoveStopCallback(e),onGraphicPointerOver:e=>this._onGraphicPointerOverCallback(e),onGraphicPointerOut:e=>this._onGraphicPointerOutCallback(e)}})}_onGraphicClickCallback(e){e.viewEvent.stopPropagation();const t=e.graphic;if(t===this.graphic)this.clearSelection(),this.emit("graphic-click",e),this.callbacks.onGraphicClick&&this.callbacks.onGraphicClick(e);else if(this._isMidpoint(t)){if(2===e.viewEvent.button)return;const i=this.graphic.clone(),s=this._createVertexFromMidpoint(t);this.refresh(),this._emitVertexAddEvent([t],i,s)}else if(this._isVertex(t))if(e.viewEvent.stopPropagation(),2===e.viewEvent.button)this._removeVertices(t);else{e.viewEvent.native.shiftKey||this._clearSelection(),this.selectedVertices.includes(t)?this._removeFromSelection(t,!0):this._addToSelection(t)}}_setUpOperation(e){const{graphic:t,dx:i,dy:s}=e,r=t===this.graphic;this._resetSnappingStateVars(),this._setUpGeometryHelper(),this._saveSnappingContextForHandle(t,e),this._activeOperationInfo={target:this.graphic,mover:t,operationType:r?"move":"reshape",totalDx:i,totalDy:s}}_onGraphicMoveStartCallback(e){const t=e.graphic,{dx:i,dy:s}=e;if(t===this.graphic)return this._clearSelection(),this._resetGraphics(),this._setUpOperation(e),this._emitMoveStartEvent(i,s),void("point"===this._editGeometryOperations.data.type&&this._onHandleMove(t,i,s,e,(()=>this._emitMoveEvent(i,s))));if(!this.selectedVertices.includes(t)){if(this._clearSelection(),this._isMidpoint(t)){const e=this.graphic.clone(),i=this._createVertexFromMidpoint(t);this._emitVertexAddEvent([t],e,i)}this._addToSelection(t)}this._setUpOperation(e),this._emitReshapeStartEvent(t),this._onHandleMove(t,i,s,e,(()=>this._emitReshapeEvent(t)))}_onGraphicMoveCallback(e){const{graphic:t,dx:i,dy:s}=e;this._activeOperationInfo.totalDx+=i,this._activeOperationInfo.totalDy+=s;const{operationType:r}=this._activeOperationInfo;"move"===r?"point"===this._editGeometryOperations.data.type?this._onHandleMove(t,i,s,e,(()=>this._emitMoveEvent(i,s))):this._emitMoveEvent(i,s):this._onHandleMove(t,i,s,e,(()=>this._emitReshapeEvent(t)))}_onGraphicMoveStopCallback(e){const{graphic:t,dx:i,dy:s}=e;this._activeOperationInfo.totalDx+=i,this._activeOperationInfo.totalDy+=s,t===this.graphic?(this._emitMoveStopEvent(),this.refresh()):(this._onHandleMove(t,i,s,e,(()=>this._emitReshapeStopEvent(t))),this._resetSnappingStateVars(),this._activeOperationInfo=null,this._isMidpoint(t)&&this.refresh())}_updateMidpointGraphicLocations(e){for(const t of this.midpointGraphics){const{pathIndex:i,pointIndexStart:s,pointIndexEnd:r}=t.attributes,[o,n]=e[i][s],[h,a]=e[i][r],[c,p]=u([o,n],[h,a]);t.geometry=new j({x:c,y:p,spatialReference:this.view.spatialReference})}}_getIndicesForVertexGraphic({attributes:e}){return[e?.pathIndex||0,e?.pointIndex||0]}_getVertexFromEditGeometry(e){const[t,i]=this._getIndicesForVertexGraphic(e);return this._editGeometryOperations.data.components[t].vertices[i]}_onHandleMove(e,t,i,s,r){if(p(this._snappingTask),!this._snappingContext)return;const o=e.geometry,n="graphic-move-stop"===s.type;if(c(this.snappingManager)&&this.selectedVertices.length<2&&!n){const s=this.snappingManager;this._stagedVertex=s.update(o,this._snappingContext),this._syncGeometryAfterVertexMove(e,new j(this._stagedVertex),t,i,n),r(),this._snappingTask=d((async h=>{const a=await s.snap(o,this._snappingContext,h);a.valid&&(this._stagedVertex=a.apply(),this._syncGeometryAfterVertexMove(e,new j(this._stagedVertex),t,i,n),r())}))}else{const s=c(this._stagedVertex)?new j(this._stagedVertex):o;this._syncGeometryAfterVertexMove(e,s,t,i,n),r()}}async _syncGeometryAfterVertexMove(e,t,i,s,r=!1){const o=this._editGeometryOperations.data.geometry;if("point"===o.type)e.geometry=t;else{const{x:n,y:h}=t,[a,c]=this._getIndicesForVertexGraphic(e);let p=g(o);const l=p[a].length-1;p[a][c]=[n,h],"polygon"===o.type&&(0===c?p[a][l]=[n,h]:c===l&&(p[a][0]=[n,h])),this._isVertex(e)&&(p=this._moveRelatedCoordinates(p,e,n,h),p=this._moveSelectedHandleCoordinates(p,e,i,s,"polygon"===o.type),this._updateMidpointGraphicLocations(p)),this.graphic.geometry=o.clone();const d=this._getVertexFromEditGeometry(e),m=n-d.pos[0],v=h-d.pos[1];this._editGeometryOperations.moveVertices([d],m,v,0),r&&(this._mover?this._mover.updateGeometry(this._mover.graphics.indexOf(e),t):e.geometry=t)}}_moveRelatedCoordinates(e,t,i,s){const{relatedGraphicIndices:r}=t.attributes;for(const o of r){const r=this.vertexGraphics.getItemAt(o),{pathIndex:n,pointIndex:h}=r.attributes;e[n][h]=[i,s],r.geometry=t.geometry}return e}_moveSelectedHandleCoordinates(e,t,i,s,r){for(const o of this.selectedVertices)if(o!==t){const{pathIndex:t,pointIndex:n,relatedGraphicIndices:h}=o.attributes,a=V(o.geometry,i,s,this.view),c=e[t].length-1;e[t][n]=[a.x,a.y],o.geometry=a,r&&(0===n?e[t][c]=[a.x,a.y]:n===c&&(e[t][0]=[a.x,a.y]));for(const i of h){const t=this.vertexGraphics.getItemAt(i),{pathIndex:s,pointIndex:r}=t.attributes;e[s][r]=[a.x,a.y],t.geometry=a}}return e}_onGraphicPointerOverCallback(e){const t=e.graphic;this._isVertex(t)&&!this._isSelected(t)&&(t.symbol=this.symbols.vertices.hover),this._updateHoverCursor(t)}_onGraphicPointerOutCallback(e){const t=e.graphic;this._isVertex(t)&&!this._isSelected(t)&&(t.symbol=this.symbols.vertices.default),this.view.cursor="default"}_createVertexFromMidpoint(e){const{_graphicAttributes:t,graphic:i}=this,s=i.geometry;if(a(s)||"polygon"!==s.type&&"polyline"!==s.type)return[];const r=s.clone(),o=[],{pathIndex:n,pointIndexStart:h,pointIndexEnd:c}=e.attributes,{x:p,y:l}=e.geometry,d=0===c?h+1:c,m=g(r);return m[n].splice(d,0,[p,l]),e.attributes={...t,pathIndex:n,pointIndex:d,relatedGraphicIndices:[]},o.push({coordinates:m[n][d],componentIndex:n,vertexIndex:d}),this.graphic.geometry=r,o}_addToSelection(e){e instanceof t&&(e=[e]);for(const t of e)t.symbol=this.symbols.vertices.selected;this._set("selectedVertices",this.selectedVertices.concat(e)),this._emitSelectEvent(e)}_removeFromSelection(e,i){const{vertices:s}=this.symbols,r=i?s.hover:s.default;e instanceof t&&(e=[e]);for(const t of e)this.selectedVertices.splice(this.selectedVertices.indexOf(t),1),this._set("selectedVertices",this.selectedVertices),t.set("symbol",r);this._emitDeselectEvent(e)}_clearSelection(){if(this.selectedVertices.length){const e=this.selectedVertices;for(const t of this.selectedVertices)t.set("symbol",this.symbols.vertices.default);this._set("selectedVertices",[]),this._emitDeselectEvent(e)}}_keyDownHandler(e){I.delete.includes(e.key)&&!e.repeat&&this.selectedVertices.length&&this._removeVertices(this.selectedVertices)}_removeVertices(e){const i=this.graphic.geometry;if(a(i)||"polygon"!==i.type&&"polyline"!==i.type)return;if("polygon"===i.type&&this.vertexGraphics.length<4||this.vertexGraphics.length<3)return;e instanceof t&&(e=[e]);const s=this.graphic.clone(),r=i.clone();let o=g(r);const n=[];e instanceof t&&(e=[e]);for(const t of e){const{x:e,y:i}=t.geometry;for(let t=0;t<o.length;t++){const s=o[t];for(let r=0;r<s.length;r++){const[h,a]=s[r];e===h&&i===a&&(n.push({coordinates:o[t][r],componentIndex:t,vertexIndex:r}),o[t].splice(Number(r),1))}}}if("polygon"===r.type)o=o.filter((e=>{if(e.length<2)return!1;const[t,i]=e[0],[s,r]=e[e.length-1];return(2!==e.length||t!==s||i!==r)&&(t===s&&i===r||e.push(e[0]),!0)})),r.rings=o;else{for(const e of o)1===e.length&&o.splice(o.indexOf(e),1);r.paths=o}this.graphic.geometry=r,this.refresh(),this._emitVertexRemoveEvent(e,s,n)}_isVertex(e){return this.vertexGraphics.includes(e)}_isSelected(e){return this._isVertex(e)&&this.selectedVertices.includes(e)}_isMidpoint(e){return this.midpointGraphics.includes(e)}_updateHoverCursor(e){this.view.cursor=this._isMidpoint(e)?"copy":"move"}_emitMoveStartEvent(e,t){const i=new T(this.graphic,e,t);this.emit("move-start",i),this.callbacks.onMoveStart&&this.callbacks.onMoveStart(i)}_emitMoveEvent(e,t){const i=new D(this.graphic,e,t);this.emit("move",i),this.callbacks.onMove&&this.callbacks.onMove(i)}_emitMoveStopEvent(){const{totalDx:e,totalDy:t}=this._activeOperationInfo,i=new F(this.graphic,e,t);this.emit("move-stop",i),this.callbacks.onMoveStop&&this.callbacks.onMoveStop(i)}_emitReshapeStartEvent(e){const t=new H(this.graphic,e,this.selectedVertices);this.emit("reshape-start",t),this.callbacks.onReshapeStart&&this.callbacks.onReshapeStart(t)}_emitReshapeEvent(e){const t=new A(this.graphic,e,this.selectedVertices);this.emit("reshape",t),this.callbacks.onReshape&&this.callbacks.onReshape(t)}_emitReshapeStopEvent(e){const t=new U(this.graphic,e,this.selectedVertices);this.emit("reshape-stop",t),this.callbacks.onReshapeStop&&this.callbacks.onReshapeStop(t)}_emitSelectEvent(e){const t=new z(e);this.emit("select",t),this.callbacks.onVertexSelect&&this.callbacks.onVertexSelect(t)}_emitDeselectEvent(e){const t=new L(e);this.emit("deselect",t),this.callbacks.onVertexDeselect&&this.callbacks.onVertexDeselect(t)}_emitVertexAddEvent(e,t,i){const s=new P(e,this.graphic,t,i);this.emit("vertex-add",s),this.callbacks.onVertexAdd&&this.callbacks.onVertexAdd(s)}_emitVertexRemoveEvent(e,t,i){const s=new K(e,this.graphic,t,i);this.emit("vertex-remove",s),this.callbacks.onVertexRemove&&this.callbacks.onVertexRemove(s)}_logGeometryTypeError(){J.error(new s("reshape:invalid-geometry","Reshape operation not supported for the provided graphic. The geometry type is not supported."))}};e([y()],Q.prototype,"callbacks",void 0),e([y()],Q.prototype,"enableMidpoints",void 0),e([y()],Q.prototype,"enableMovement",void 0),e([y()],Q.prototype,"enableVertices",void 0),e([y()],Q.prototype,"graphic",void 0),e([y({value:!0})],Q.prototype,"highlightsEnabled",null),e([y()],Q.prototype,"layer",void 0),e([y({readOnly:!0})],Q.prototype,"midpointGraphics",void 0),e([y()],Q.prototype,"midpointSymbol",void 0),e([y({readOnly:!0})],Q.prototype,"selectedVertices",void 0),e([y()],Q.prototype,"snappingManager",void 0),e([y({readOnly:!0})],Q.prototype,"state",null),e([y({value:q})],Q.prototype,"symbols",null),e([y({readOnly:!0})],Q.prototype,"type",void 0),e([y({readOnly:!0})],Q.prototype,"vertexGraphics",void 0),e([y()],Q.prototype,"view",void 0),Q=e([_(B)],Q);const W=Q;export{W as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.24/esri/copyright.txt for details.
4
4
  */
5
- import{l as e,a as t,c as r}from"../../chunks/vec2.js";import{a,f as i,d as n}from"../../chunks/vec2f64.js";import{h as s,i as o,c as u}from"../../chunks/vec3.js";import{f as c,c as h,d as p}from"../../chunks/vec3f64.js";import{l as v,c as y}from"../../chunks/vec4.js";import{c as l,f as d,b as f}from"../../chunks/vec4f64.js";import T from"../../geometry/Point.js";var m;!function(e){e[e.Z=0]="Z",e[e.M=1]="M"}(m||(m={}));class Z{constructor(e){this.spatialReference=e}createVector(){return this._tag(a())}pointToVector(e){return this._tag(i(e.x,e.y))}arrayToVector(e){return this._tag(i(e[0],e[1]))}vectorToArray(e){return[e[0],e[1]]}pointToArray(e){return[e.x,e.y]}vectorToPoint(e,t=new T){return t.x=e[0],t.y=e[1],t.z=void 0,t.m=void 0,t.spatialReference=this.spatialReference,t}arrayToPoint(e,t=new T){return t.x=e[0],t.y=e[1],t.z=void 0,t.m=void 0,t.spatialReference=this.spatialReference,t}vectorToDehydratedPoint(e,t={x:void 0,y:void 0,z:void 0,m:void 0,hasZ:void 0,hasM:void 0,spatialReference:void 0,type:"point"}){return t.x=e[0],t.y=e[1],t.z=void 0,t.m=void 0,t.hasZ=!1,t.hasM=!1,t.spatialReference=this.spatialReference,t}lerp(t,r,a,i){return e(i,t,r,a)}addDelta(e,t,r){e[0]+=t,e[1]+=r}distance(e,r){return t(e,r)}getZ(e,t){return t}hasZ(){return!1}getM(e,t){return t}hasM(){return!1}clone(e){return this._tag(n(e))}copy(e,t){return r(t,e)}fromXYZ(e){return this._tag(i(e[0],e[1]))}toXYZ(e,t=0){return c(e[0],e[1],t)}_tag(e){return e}}class g{constructor(e,t){this.valueType=e,this.spatialReference=t}createVector(){return this._tag(h())}pointToVector(e){return this._tag(c(e.x,e.y,this.valueType===m.Z?e.z:e.m))}arrayToVector(e){return this._tag(c(e[0],e[1],e[2]||0))}vectorToArray(e){return[e[0],e[1],e[2]]}pointToArray(e){return this.valueType===m.Z?[e.x,e.y,e.z]:[e.x,e.y,e.m]}vectorToPoint(e,t=new T){return t.x=e[0],t.y=e[1],t.z=this.valueType===m.Z?e[2]:void 0,t.m=this.valueType===m.M?e[2]:void 0,t.spatialReference=this.spatialReference,t}arrayToPoint(e,t=new T){return t.x=e[0],t.y=e[1],t.z=this.valueType===m.Z?e[2]:void 0,t.m=this.valueType===m.M?e[2]:void 0,t.spatialReference=this.spatialReference,t}vectorToDehydratedPoint(e,t={x:void 0,y:void 0,z:void 0,m:void 0,hasZ:void 0,hasM:void 0,spatialReference:void 0,type:"point"}){const r=this.valueType===m.Z,a=this.valueType===m.M;return t.x=e[0],t.y=e[1],t.z=r?e[2]:void 0,t.m=a?e[2]:void 0,t.hasZ=r,t.hasM=a,t.spatialReference=this.spatialReference,t}lerp(e,t,r,a){return s(a,e,t,r)}addDelta(e,t,r,a){e[0]+=t,e[1]+=r,this.valueType===m.Z&&(e[2]+=a)}distance(e,r){return this.valueType===m.Z?o(e,r):t(e,r)}getZ(e,t){return this.valueType===m.Z?e[2]:t}hasZ(){return this.valueType===m.Z}getM(e,t){return this.valueType===m.M?e[2]:t}hasM(){return this.valueType===m.M}clone(e){return this._tag(p(e))}copy(e,t){return u(t,e)}fromXYZ(e,t=0,r=0){return this._tag(c(e[0],e[1],this.valueType===m.Z?e.length>2?e[2]:t:r))}toXYZ(e,t=0){return this._tag(c(e[0],e[1],this.valueType===m.Z?e[2]:t))}_tag(e){return e}}class R{constructor(e){this.spatialReference=e}createVector(){return this._tag(l())}pointToVector(e){return this._tag(d(e.x,e.y,e.z,e.m))}arrayToVector(e){return this._tag(d(e[0],e[1],e[2]||0,e[3]||0))}vectorToArray(e){return[e[0],e[1],e[2],e[3]]}pointToArray(e){return[e.x,e.y,e.z,e.m]}vectorToPoint(e,t=new T){return t.x=e[0],t.y=e[1],t.z=e[2],t.m=e[3],t.spatialReference=this.spatialReference,t}arrayToPoint(e,t=new T){return t.x=e[0],t.y=e[1],t.z=e[2],t.m=e[3],t.spatialReference=this.spatialReference,t}vectorToDehydratedPoint(e,t={x:void 0,y:void 0,z:void 0,m:void 0,hasZ:void 0,hasM:void 0,spatialReference:void 0,type:"point"}){return t.x=e[0],t.y=e[1],t.z=e[2],t.m=e[3],t.hasZ=!0,t.hasM=!0,t.spatialReference=this.spatialReference,t}lerp(e,t,r,a){return v(a,e,t,r)}addDelta(e,t,r,a){e[0]+=t,e[1]+=r,e[2]+=a}distance(e,t){return o(e,t)}getZ(e){return e[2]}hasZ(){return!0}getM(e){return e[3]}hasM(){return!0}clone(e){return this._tag(f(e))}copy(e,t){return y(t,e)}fromXYZ(e,t=0,r=0){return this._tag(d(e[0],e[1],e.length>2?e[2]:t,r))}toXYZ(e){return c(e[0],e[1],e[2])}_tag(e){return e}}function x(e,t,r){return e&&t?new R(r):t?new g(m.M,r):e?new g(m.Z,r):new Z(r)}export{Z as CoordinateHelper2D,g as CoordinateHelper3D,R as CoordinateHelper4D,x as createCoordinateHelper};
5
+ import{l as e,a as t,c as r}from"../../chunks/vec2.js";import{a,f as i,b as n}from"../../chunks/vec2f64.js";import{h as s,i as o,c as u}from"../../chunks/vec3.js";import{f as c,c as h,d as p}from"../../chunks/vec3f64.js";import{l as v,c as y}from"../../chunks/vec4.js";import{c as l,f as d,b as f}from"../../chunks/vec4f64.js";import T from"../../geometry/Point.js";var m;!function(e){e[e.Z=0]="Z",e[e.M=1]="M"}(m||(m={}));class Z{constructor(e){this.spatialReference=e}createVector(){return this._tag(a())}pointToVector(e){return this._tag(i(e.x,e.y))}arrayToVector(e){return this._tag(i(e[0],e[1]))}vectorToArray(e){return[e[0],e[1]]}pointToArray(e){return[e.x,e.y]}vectorToPoint(e,t=new T){return t.x=e[0],t.y=e[1],t.z=void 0,t.m=void 0,t.spatialReference=this.spatialReference,t}arrayToPoint(e,t=new T){return t.x=e[0],t.y=e[1],t.z=void 0,t.m=void 0,t.spatialReference=this.spatialReference,t}vectorToDehydratedPoint(e,t={x:void 0,y:void 0,z:void 0,m:void 0,hasZ:void 0,hasM:void 0,spatialReference:void 0,type:"point"}){return t.x=e[0],t.y=e[1],t.z=void 0,t.m=void 0,t.hasZ=!1,t.hasM=!1,t.spatialReference=this.spatialReference,t}lerp(t,r,a,i){return e(i,t,r,a)}addDelta(e,t,r){e[0]+=t,e[1]+=r}distance(e,r){return t(e,r)}getZ(e,t){return t}hasZ(){return!1}getM(e,t){return t}hasM(){return!1}clone(e){return this._tag(n(e))}copy(e,t){return r(t,e)}fromXYZ(e){return this._tag(i(e[0],e[1]))}toXYZ(e,t=0){return c(e[0],e[1],t)}_tag(e){return e}}class g{constructor(e,t){this.valueType=e,this.spatialReference=t}createVector(){return this._tag(h())}pointToVector(e){return this._tag(c(e.x,e.y,this.valueType===m.Z?e.z:e.m))}arrayToVector(e){return this._tag(c(e[0],e[1],e[2]||0))}vectorToArray(e){return[e[0],e[1],e[2]]}pointToArray(e){return this.valueType===m.Z?[e.x,e.y,e.z]:[e.x,e.y,e.m]}vectorToPoint(e,t=new T){return t.x=e[0],t.y=e[1],t.z=this.valueType===m.Z?e[2]:void 0,t.m=this.valueType===m.M?e[2]:void 0,t.spatialReference=this.spatialReference,t}arrayToPoint(e,t=new T){return t.x=e[0],t.y=e[1],t.z=this.valueType===m.Z?e[2]:void 0,t.m=this.valueType===m.M?e[2]:void 0,t.spatialReference=this.spatialReference,t}vectorToDehydratedPoint(e,t={x:void 0,y:void 0,z:void 0,m:void 0,hasZ:void 0,hasM:void 0,spatialReference:void 0,type:"point"}){const r=this.valueType===m.Z,a=this.valueType===m.M;return t.x=e[0],t.y=e[1],t.z=r?e[2]:void 0,t.m=a?e[2]:void 0,t.hasZ=r,t.hasM=a,t.spatialReference=this.spatialReference,t}lerp(e,t,r,a){return s(a,e,t,r)}addDelta(e,t,r,a){e[0]+=t,e[1]+=r,this.valueType===m.Z&&(e[2]+=a)}distance(e,r){return this.valueType===m.Z?o(e,r):t(e,r)}getZ(e,t){return this.valueType===m.Z?e[2]:t}hasZ(){return this.valueType===m.Z}getM(e,t){return this.valueType===m.M?e[2]:t}hasM(){return this.valueType===m.M}clone(e){return this._tag(p(e))}copy(e,t){return u(t,e)}fromXYZ(e,t=0,r=0){return this._tag(c(e[0],e[1],this.valueType===m.Z?e.length>2?e[2]:t:r))}toXYZ(e,t=0){return this._tag(c(e[0],e[1],this.valueType===m.Z?e[2]:t))}_tag(e){return e}}class R{constructor(e){this.spatialReference=e}createVector(){return this._tag(l())}pointToVector(e){return this._tag(d(e.x,e.y,e.z,e.m))}arrayToVector(e){return this._tag(d(e[0],e[1],e[2]||0,e[3]||0))}vectorToArray(e){return[e[0],e[1],e[2],e[3]]}pointToArray(e){return[e.x,e.y,e.z,e.m]}vectorToPoint(e,t=new T){return t.x=e[0],t.y=e[1],t.z=e[2],t.m=e[3],t.spatialReference=this.spatialReference,t}arrayToPoint(e,t=new T){return t.x=e[0],t.y=e[1],t.z=e[2],t.m=e[3],t.spatialReference=this.spatialReference,t}vectorToDehydratedPoint(e,t={x:void 0,y:void 0,z:void 0,m:void 0,hasZ:void 0,hasM:void 0,spatialReference:void 0,type:"point"}){return t.x=e[0],t.y=e[1],t.z=e[2],t.m=e[3],t.hasZ=!0,t.hasM=!0,t.spatialReference=this.spatialReference,t}lerp(e,t,r,a){return v(a,e,t,r)}addDelta(e,t,r,a){e[0]+=t,e[1]+=r,e[2]+=a}distance(e,t){return o(e,t)}getZ(e){return e[2]}hasZ(){return!0}getM(e){return e[3]}hasM(){return!0}clone(e){return this._tag(f(e))}copy(e,t){return y(t,e)}fromXYZ(e,t=0,r=0){return this._tag(d(e[0],e[1],e.length>2?e[2]:t,r))}toXYZ(e){return c(e[0],e[1],e[2])}_tag(e){return e}}function x(e,t,r){return e&&t?new R(r):t?new g(m.M,r):e?new g(m.Z,r):new Z(r)}export{Z as CoordinateHelper2D,g as CoordinateHelper3D,R as CoordinateHelper4D,x as createCoordinateHelper};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.24/esri/copyright.txt for details.
4
4
  */
5
- import{deg2rad as t}from"../../../../core/mathUtils.js";import{isSome as i,isNone as e}from"../../../../core/maybe.js";import{h as s,j as n,i as r}from"../../../../chunks/vec2.js";import{a as h}from"../../../../chunks/vec2f64.js";import{r as a,e as o,o as c,f as _,n as l,a as p,g as d,y as g,c as f}from"../../../../chunks/vec3.js";import{c as u,f as m}from"../../../../chunks/vec3f64.js";import{create as D,fromPositionAndNormal as E,signedDistance as x,copy as b,intersectLine as I,normal as V}from"../../../../geometry/support/plane.js";import{angle as M,projectPointSignedLength as y}from"../../../../geometry/support/vector.js";import{intersectLineAndRay as N,LineType as P}from"../../../support/geometry2dUtils.js";class X{constructor(t,i,e,s=0,n=j.IMMEDIATE){this.helper=t,this.planeType=i,this.edge=e,this.distance=s,this._plane=D(),this._offsetPlane=D(),this._minDistance=-1/0,this._maxDistance=1/0,n===j.IMMEDIATE&&this._initialize()}get plane(){return this._plane}get requiresSplitEdgeLeft(){return!this._left.isOriginalDirection}get requiresSplitEdgeRight(){return!this._right.isOriginalDirection}get edgeDirection(){return this._edgeDirection}_initialize(){this._initializeNeighbors(),this._initializePlane(),this._initializeDistanceConstraints()}_initializeNeighbors(){var t,i,e,s;const n=this._toXYZ(this.edge.leftVertex.pos),r=this._toXYZ(null==(t=this.edge.leftVertex.leftEdge)||null==(i=t.leftVertex)?void 0:i.pos),h=this._toXYZ(this.edge.rightVertex.pos),o=this._toXYZ(null==(e=this.edge.rightVertex.rightEdge)||null==(s=e.rightVertex)?void 0:s.pos);this._edgeDirection=a(u(),n,h),this._left=this._computeNeighbor(n,r,this._edgeDirection),this._right=this._computeNeighbor(h,o,this._edgeDirection)}_toXYZ(t){return i(t)?this.helper.toXYZ(t):null}_computeNeighbor(t,i,s){if(e(i))return{start:t,end:i,direction:m(-s[1],s[0],0),isOriginalDirection:!0};const n=a(u(),t,i),r=!this._passesBisectingAngleThreshold(n,s);return{start:t,end:i,direction:r?this._bisectVectorsPerpendicular(s,n):n,isOriginalDirection:!r}}_passesBisectingAngleThreshold(t,i){const e=Math.abs(M(i,t));return e>=Y&&e<=Math.PI-Y}_bisectVectorsPerpendicular(t,i){const e=o(t,i)<0?t:c(u(),t),s=Math.abs(o(e,i));if(!(s<.001||s>.999))return this._bisectDirection(e,i);const n=_(u(),e,[0,0,1]);return l(n,n)}_bisectDirection(t,i){const e=p(u(),t,i);return l(e,e)}_initializePlane(){const t=this._computeNormalDirection(this._left),i=this._computeNormalDirection(this._right);o(t,i)<0&&c(i,i),E(this._left.start,this._bisectDirection(t,i),this._plane)}_computeNormalDirection(t){const i=_(u(),t.direction,this._edgeDirection);l(i,i);const e=_(u(),this._edgeDirection,i);return this.planeType===T.XY&&(e[2]=0),l(e,e)}_initializeDistanceConstraints(){i(this._left.end)&&!this.requiresSplitEdgeLeft&&this._updateDistanceConstraint(x(this._plane,this._left.end)),i(this._right.end)&&!this.requiresSplitEdgeRight&&this._updateDistanceConstraint(x(this._plane,this._right.end)),this._updateIntersectDistanceConstraint(this._plane)}_updateDistanceConstraint(t){t<=0&&(this._minDistance=Math.max(this._minDistance,t)),t>=0&&(this._maxDistance=Math.min(this._maxDistance,t))}_updateIntersectDistanceConstraint(t){const i=V(t),e=this._edgeDirection,a=p(u(),this._left.start,this._left.direction),o=p(u(),this._right.start,this._right.direction),c=this._pointInBasis2D(h(),i,e,this._left.start),_=this._pointInBasis2D(h(),i,e,a),l=this._pointInBasis2D(h(),i,e,this._right.start),g=this._pointInBasis2D(h(),i,e,o),[f]=N({start:_,end:c,type:P.LINE},{start:g,end:l,type:P.LINE});if(!f)return;const m=s(h(),c,_);n(m,m);const D=s(h(),f,_),E=r(m,D),b=p(u(),a,d(u(),this._left.direction,-E)),I=x(t,b);this._updateDistanceConstraint(I)}_pointInBasis2D(t,i,e,s){return t[0]=y(i,s),t[1]=y(e,s),t}_offset(t,e){Number.isFinite(this._minDistance)&&(e=Math.max(this._minDistance,e)),Number.isFinite(this._maxDistance)&&(e=Math.min(this._maxDistance,e)),b(this._offsetPlane,this._plane),this._offsetPlane[3]-=e;const s=(t,e,s)=>i(e)&&I(this._offsetPlane,t,p(u(),t,e),s),n=u();(t===this.edge.leftVertex?s(this._left.start,this._left.direction,n):s(this._right.start,this._right.direction,n))&&this.helper.copy(this.helper.fromXYZ(n,void 0,this.helper.getM(t.pos)),t.pos)}signedDistanceToPoint(t){return x(this.plane,this.helper.toXYZ(this.helper.pointToVector(t)))}apply(t){this._offset(t,this.distance)}undo(t){this._offset(t,0)}canAccumulate(t){return t instanceof X&&this.edge.leftVertex.index===t.edge.leftVertex.index&&this.edge.rightVertex.index===t.edge.rightVertex.index&&this.edge.component===t.edge.component&&this._maybeEqualsVec3(this._left.direction,t._left.direction)&&this._maybeEqualsVec3(this._right.direction,t._right.direction)&&g(V(this._plane),V(t._plane))}accumulate(t,i){const e=this._plane[3]-i._plane[3]+i.distance;this._offset(t,e)}accumulateParams(t){const i=t.distance-t._plane[3];this.distance=i+this._plane[3]}clone(){const t=new X(this.helper,this.planeType,this.edge,this.distance,j.DEFERRED);return b(t._plane,this._plane),b(t._offsetPlane,this._offsetPlane),t._maxDistance=this._maxDistance,t._minDistance=this._minDistance,t._left=this._cloneNeighbor(this._left),t._right=this._cloneNeighbor(this._right),t._edgeDirection=f(u(),this._edgeDirection),t}_maybeEqualsVec3(t,s){return e(t)&&e(s)||i(t)&&i(s)&&g(t,s)}_cloneNeighbor({start:t,end:e,direction:s,isOriginalDirection:n}){return{start:f(u(),t),end:i(e)?f(u(),e):null,direction:f(u(),s),isOriginalDirection:n}}}const Y=t(15);var T,j;!function(t){t[t.XYZ=0]="XYZ",t[t.XY=1]="XY"}(T||(T={})),function(t){t[t.IMMEDIATE=0]="IMMEDIATE",t[t.DEFERRED=1]="DEFERRED"}(j||(j={}));export{X as OffsetEdgeVertex,T as PlaneType};
5
+ import{deg2rad as t}from"../../../../core/mathUtils.js";import{isSome as i,isNone as e}from"../../../../core/maybe.js";import{h as s,j as n,i as r}from"../../../../chunks/vec2.js";import{a as h}from"../../../../chunks/vec2f64.js";import{r as a,e as o,o as c,f as _,n as l,a as p,g,z as d,c as f}from"../../../../chunks/vec3.js";import{c as m,f as u}from"../../../../chunks/vec3f64.js";import{create as D,fromPositionAndNormal as E,signedDistance as x,copy as b,intersectLine as I,normal as V}from"../../../../geometry/support/plane.js";import{angle as M,projectPointSignedLength as N}from"../../../../geometry/support/vector.js";import{intersectLineAndRay as y,LineType as P}from"../../../support/geometry2dUtils.js";class X{constructor(t,i,e,s=0,n=j.IMMEDIATE){this.helper=t,this.planeType=i,this.edge=e,this.distance=s,this._plane=D(),this._offsetPlane=D(),this._minDistance=-1/0,this._maxDistance=1/0,n===j.IMMEDIATE&&this._initialize()}get plane(){return this._plane}get requiresSplitEdgeLeft(){return!this._left.isOriginalDirection}get requiresSplitEdgeRight(){return!this._right.isOriginalDirection}get edgeDirection(){return this._edgeDirection}_initialize(){this._initializeNeighbors(),this._initializePlane(),this._initializeDistanceConstraints()}_initializeNeighbors(){const t=this._toXYZ(this.edge.leftVertex.pos),i=this._toXYZ(this.edge.leftVertex.leftEdge?.leftVertex?.pos),e=this._toXYZ(this.edge.rightVertex.pos),s=this._toXYZ(this.edge.rightVertex.rightEdge?.rightVertex?.pos);this._edgeDirection=a(m(),t,e),this._left=this._computeNeighbor(t,i,this._edgeDirection),this._right=this._computeNeighbor(e,s,this._edgeDirection)}_toXYZ(t){return i(t)?this.helper.toXYZ(t):null}_computeNeighbor(t,i,s){if(e(i))return{start:t,end:i,direction:u(-s[1],s[0],0),isOriginalDirection:!0};const n=a(m(),t,i),r=!this._passesBisectingAngleThreshold(n,s);return{start:t,end:i,direction:r?this._bisectVectorsPerpendicular(s,n):n,isOriginalDirection:!r}}_passesBisectingAngleThreshold(t,i){const e=Math.abs(M(i,t));return e>=Y&&e<=Math.PI-Y}_bisectVectorsPerpendicular(t,i){const e=o(t,i)<0?t:c(m(),t),s=Math.abs(o(e,i));if(!(s<.001||s>.999))return this._bisectDirection(e,i);const n=_(m(),e,[0,0,1]);return l(n,n)}_bisectDirection(t,i){const e=p(m(),t,i);return l(e,e)}_initializePlane(){const t=this._computeNormalDirection(this._left),i=this._computeNormalDirection(this._right);o(t,i)<0&&c(i,i),E(this._left.start,this._bisectDirection(t,i),this._plane)}_computeNormalDirection(t){const i=_(m(),t.direction,this._edgeDirection);l(i,i);const e=_(m(),this._edgeDirection,i);return this.planeType===T.XY&&(e[2]=0),l(e,e)}_initializeDistanceConstraints(){i(this._left.end)&&!this.requiresSplitEdgeLeft&&this._updateDistanceConstraint(x(this._plane,this._left.end)),i(this._right.end)&&!this.requiresSplitEdgeRight&&this._updateDistanceConstraint(x(this._plane,this._right.end)),this._updateIntersectDistanceConstraint(this._plane)}_updateDistanceConstraint(t){t<=0&&(this._minDistance=Math.max(this._minDistance,t)),t>=0&&(this._maxDistance=Math.min(this._maxDistance,t))}_updateIntersectDistanceConstraint(t){const i=V(t),e=this._edgeDirection,a=p(m(),this._left.start,this._left.direction),o=p(m(),this._right.start,this._right.direction),c=this._pointInBasis2D(h(),i,e,this._left.start),_=this._pointInBasis2D(h(),i,e,a),l=this._pointInBasis2D(h(),i,e,this._right.start),d=this._pointInBasis2D(h(),i,e,o),[f]=y({start:_,end:c,type:P.LINE},{start:d,end:l,type:P.LINE});if(!f)return;const u=s(h(),c,_);n(u,u);const D=s(h(),f,_),E=r(u,D),b=p(m(),a,g(m(),this._left.direction,-E)),I=x(t,b);this._updateDistanceConstraint(I)}_pointInBasis2D(t,i,e,s){return t[0]=N(i,s),t[1]=N(e,s),t}_offset(t,e){Number.isFinite(this._minDistance)&&(e=Math.max(this._minDistance,e)),Number.isFinite(this._maxDistance)&&(e=Math.min(this._maxDistance,e)),b(this._offsetPlane,this._plane),this._offsetPlane[3]-=e;const s=(t,e,s)=>i(e)&&I(this._offsetPlane,t,p(m(),t,e),s),n=m();(t===this.edge.leftVertex?s(this._left.start,this._left.direction,n):s(this._right.start,this._right.direction,n))&&this.helper.copy(this.helper.fromXYZ(n,void 0,this.helper.getM(t.pos)),t.pos)}signedDistanceToPoint(t){return x(this.plane,this.helper.toXYZ(this.helper.pointToVector(t)))}apply(t){this._offset(t,this.distance)}undo(t){this._offset(t,0)}canAccumulate(t){return t instanceof X&&this.edge.leftVertex.index===t.edge.leftVertex.index&&this.edge.rightVertex.index===t.edge.rightVertex.index&&this.edge.component===t.edge.component&&this._maybeEqualsVec3(this._left.direction,t._left.direction)&&this._maybeEqualsVec3(this._right.direction,t._right.direction)&&d(V(this._plane),V(t._plane))}accumulate(t,i){const e=this._plane[3]-i._plane[3]+i.distance;this._offset(t,e)}accumulateParams(t){const i=t.distance-t._plane[3];this.distance=i+this._plane[3]}clone(){const t=new X(this.helper,this.planeType,this.edge,this.distance,j.DEFERRED);return b(t._plane,this._plane),b(t._offsetPlane,this._offsetPlane),t._maxDistance=this._maxDistance,t._minDistance=this._minDistance,t._left=this._cloneNeighbor(this._left),t._right=this._cloneNeighbor(this._right),t._edgeDirection=f(m(),this._edgeDirection),t}_maybeEqualsVec3(t,s){return e(t)&&e(s)||i(t)&&i(s)&&d(t,s)}_cloneNeighbor({start:t,end:e,direction:s,isOriginalDirection:n}){return{start:f(m(),t),end:i(e)?f(m(),e):null,direction:f(m(),s),isOriginalDirection:n}}}const Y=t(15);var T,j;!function(t){t[t.XYZ=0]="XYZ",t[t.XY=1]="XY"}(T||(T={})),function(t){t[t.IMMEDIATE=0]="IMMEDIATE",t[t.DEFERRED=1]="DEFERRED"}(j||(j={}));export{X as OffsetEdgeVertex,T as PlaneType};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.24/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../chunks/tslib.es6.js";import{HandleOwner as t}from"../../../core/HandleOwner.js";import r from"../../../core/Handles.js";import{someMap as i}from"../../../core/MapUtils.js";import{isSome as n,unwrap as o,isNone as a}from"../../../core/maybe.js";import{eachAlwaysValues as s,throwIfAborted as c}from"../../../core/promiseUtils.js";import{sync as u,watch as l,syncAndInitial as d}from"../../../core/reactiveUtils.js";import{property as p}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/arrayUtils.js";import"../../../core/has.js";import"../../../core/accessorSupport/ensureType.js";import{subclass as h}from"../../../core/accessorSupport/decorators/subclass.js";import{c as g}from"../../../chunks/vec3f64.js";import{SnappingTypes as f}from"../../../layers/graphics/data/QueryEngineResult.js";import{RayConstraint as y}from"./SnappingConstraint.js";import{sortCandidatesInPlace as S,anyMapPointToRender as m,anyMapPointToScreenPoint as v}from"./snappingUtils.js";import{EdgeSnappingCandidate as w}from"./candidates/EdgeSnappingCandidate.js";import{FeatureSnappingCandidate as _}from"./candidates/FeatureSnappingCandidate.js";import{RightAngleSnappingCandidate as j,OtherVertexType as x}from"./candidates/RightAngleSnappingCandidate.js";let C=class extends t{constructor(e){super(e),this.sourceModules={featureService:{module:null,loader:null},featureCollection:{module:null,loader:null},graphics:{module:null,loader:null}}}get updating(){return i(this.snappingSources,(({snappingSource:e})=>e.updating))||this.updatingHandles.updating}get snappingSources(){var e;const t=this._get("snappingSources")||new Map,r=new Map;if(null!=(e=this.options)&&e.featureSources)for(const i of this.options.featureSources.items){const e=i.layer.uid,o=t.get(e);if(o){t.delete(e),r.set(e,o);continue}if(!i.layer.loaded){this.updatingHandles.addPromise(i.layer.load());continue}const a=this._createSourceInfo(i);n(a)&&r.set(e,a)}for(const[,i]of t)i.destroy();return r}initialize(){this.updatingHandles.add((()=>this.snappingSources),(()=>this.notifyChange("updating")),u),n(this.view)&&this.handles.add([this.view.on("layerview-create",(e=>this._updateLayerView(e.layer,e.layerView))),this.view.on("layerview-destroy",(e=>this._updateLayerView(e.layer,null)))])}_updateLayerView(e,t){for(const[,r]of this.snappingSources)r.snappingSource.layerSource.layer===e&&(r.layerView=t)}destroy(){this._set("options",null);for(const[,e]of this.snappingSources)e.destroy()}async fetchCandidates(e,t,r){if(!this.options.effectiveFeatureEnabled)return[];const i=[],o=this._computeScreeenSizeDistanceParameters(e,t),a={distance:o,point:e,coordinateHelper:t.coordinateHelper,types:this.types,filter:null};for(const[,{snappingSource:s,layerView:c}]of this.snappingSources)!s.layerSource.enabled||n(c)&&c.suspended||i.push(s.fetchCandidates(a,r).then((e=>e.filter((e=>!this._candidateIsExcluded(s,e,t.excludeFeature))))));const u=(await s(i)).flat();return this._addRightAngleCandidates(u,e,o,t),c(r),S(e,u),u}_addRightAngleCandidates(e,t,r,i){var a,s,c,u,l,d,p,h;const g=n(i.vertexHandle)?null==(a=i.vertexHandle.rightEdge)||null==(s=a.rightVertex)?void 0:s.pos:n(i.editGeometryOperations)&&"polygon"===i.editGeometryOperations.data.type?null==(c=o(null==(u=i.editGeometryOperations.data.components[0])?void 0:u.getFirstVertex()))?void 0:c.pos:null,f=n(i.vertexHandle)?null==(l=i.vertexHandle.leftEdge)||null==(d=l.leftVertex)?void 0:d.pos:n(i.editGeometryOperations)?null==(p=o(null==(h=i.editGeometryOperations.data.components[0])?void 0:h.getLastVertex()))?void 0:p.pos:null,y=e.length;for(let n=0;n<y;n++)this._addRightAngleCandidate(e[n],f,t,r,i,e),this._addRightAngleCandidate(e[n],g,t,r,i,e)}_addRightAngleCandidate(e,t,r,i,n,o){if(a(t)||!(e instanceof w))return;const s=e.constraint.closestTo(t),c=(s[0]-r[0])/i.x,u=(s[1]-r[1])/i.y;if(c*c+u*u<=1){const r=n.coordinateHelper;o.push(new j({coordinateHelper:r,targetPoint:s,otherVertex:t,otherVertexType:x.NEXT,previousVertex:e.constraint.start,constraint:new y(r,t,s),objectId:e.objectId,elevationInfo:e.elevationInfo}))}}_computeScreeenSizeDistanceParameters(e,t){const r=this.options.distance*("touch"===t.pointer?this.options.touchSensitivityMultiplier:1);if(a(this.view))return{x:r,y:r,pixelSize:r};if("2d"===this.view.type){const e=r*this.view.resolution;return{x:e,y:e,pixelSize:e}}return this._computeScreeenSizeDistanceParameters3D(e,r,this.view,t)}_computeScreeenSizeDistanceParameters3D(e,t,r,i){const{coordinateHelper:n,elevationInfo:o}=i,a=r.state.camera.computeScreenPixelSizeAt(m(e,n,o,r,M)),s=a*r.renderCoordsHelper.unitInMeters/r.mapCoordsHelper.unitInMeters,c=t*s;return{x:c/this._computeScreenMagnitudeOfMapOffset(e,s,0,r,i),y:c/this._computeScreenMagnitudeOfMapOffset(e,0,s,r,i),pixelSize:a}}_computeScreenMagnitudeOfMapOffset(e,t,r,i,{coordinateHelper:n,elevationInfo:o}){const a=n.clone(e);a[0]+=t,a[1]+=r;const s=v(e,n,o,i),c=v(a,n,o,i),u=c.x-s.x,l=c.y-s.y;return Math.sqrt(u*u+l*l)}get types(){return f.EDGE|f.VERTEX}_candidateIsExcluded(e,t,r){if(a(r))return!1;const i=this._getCandidateObjectId(t);if(a(i))return!1;const n=e.layerSource.layer;return"graphics"===n.type?r.uid===i:r.sourceLayer===n&&(!(!r.attributes||!("objectIdField"in n))&&r.attributes[n.objectIdField]===i)}_getCandidateObjectId(e){return e instanceof _?e.objectId:null}_createSourceInfo(e){const t=this._createFeatureSnappingSourceType(e);if(a(t))return null;if("loading"in t)return this.updatingHandles.addPromise(t.loading.then((()=>{this.destroyed||this.notifyChange("snappingSources")}))),null;const r=n(this.view)?this.view.allLayerViews.find((t=>t.layer===e.layer)):null;return new H(t.source,r)}_createFeatureSnappingSourceType(e){switch(e.layer.type){case"feature":case"geojson":case"csv":case"subtype-group":case"wfs":return this._createFeatureSnappingSourceFeatureLayer(e);case"graphics":return this._createFeatureSnappingSourceGraphicsLayer(e)}return null}_createFeatureSnappingSourceFeatureLayer(e){switch(e.layer.source.type){case"feature-layer":{const t=this._getSourceModule("featureService");return n(t.module)?{source:new t.module.FeatureServiceSnappingSource({spatialReference:this.spatialReference,view:this.view,layerSource:e})}:{loading:t.loader}}case"memory":case"csv":case"geojson":case"wfs":{if("mesh"===e.layer.geometryType)return null;const t=this._getSourceModule("featureCollection");return n(t.module)?{source:new t.module.FeatureCollectionSnappingSource({layerSource:e})}:{loading:t.loader}}}return null}_createFeatureSnappingSourceGraphicsLayer(e){const t=this._getSourceModule("graphics");return n(t.module)?{source:new t.module.GraphicsSnappingSource({spatialReference:this.spatialReference,view:this.view,layerSource:e})}:{loading:t.loader}}_getSourceModule(e){const t=this.sourceModules[e];if(a(t.loader)){const r=this._loadSourceModule(e).then((e=>{t.module=e}));return t.loader=r,{module:t.module,loader:r}}return{module:t.module,loader:t.loader}}_loadSourceModule(e){switch(e){case"featureService":return this.updatingHandles.addPromise(import("./featureSources/FeatureServiceSnappingSource.js"));case"featureCollection":return this.updatingHandles.addPromise(import("./featureSources/FeatureCollectionSnappingSource.js"));case"graphics":return this.updatingHandles.addPromise(import("./featureSources/GraphicsSnappingSource.js"))}return null}};e([p({constructOnly:!0})],C.prototype,"spatialReference",void 0),e([p({constructOnly:!0})],C.prototype,"view",void 0),e([p()],C.prototype,"options",void 0),e([p({readOnly:!0})],C.prototype,"updating",null),e([p({readOnly:!0})],C.prototype,"snappingSources",null),C=e([h("esri.views.interactive.snapping.FeatureSnappingEngine")],C);class H{constructor(e,t){this.snappingSource=e,this.layerView=t,this.handles=new r;const i=this.snappingSource.layerSource.layer;if("refresh"in i){const t=i;this.handles.add(t.on("refresh",(()=>e.refresh())))}this.handles.add([l((()=>e.updating),(t=>e.layerSource.updating=t),d),l((()=>e.availability),(t=>e.layerSource.availability=t),d)])}destroy(){this.snappingSource.destroy(),this.handles.destroy()}}const M=g();export{C as FeatureSnappingEngine};
5
+ import{_ as e}from"../../../chunks/tslib.es6.js";import{HandleOwner as t}from"../../../core/HandleOwner.js";import r from"../../../core/Handles.js";import{someMap as i}from"../../../core/MapUtils.js";import{isSome as o,unwrap as n,isNone as a}from"../../../core/maybe.js";import{eachAlwaysValues as s,throwIfAborted as c}from"../../../core/promiseUtils.js";import{sync as u,watch as l,syncAndInitial as p}from"../../../core/reactiveUtils.js";import{property as d}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/arrayUtils.js";import"../../../core/has.js";import"../../../core/accessorSupport/ensureType.js";import{subclass as h}from"../../../core/accessorSupport/decorators/subclass.js";import{c as g}from"../../../chunks/vec3f64.js";import{SnappingTypes as f}from"../../../layers/graphics/data/QueryEngineResult.js";import{RayConstraint as y}from"./SnappingConstraint.js";import{sortCandidatesInPlace as S,anyMapPointToRender as m,anyMapPointToScreenPoint as v}from"./snappingUtils.js";import{EdgeSnappingCandidate as w}from"./candidates/EdgeSnappingCandidate.js";import{FeatureSnappingCandidate as _}from"./candidates/FeatureSnappingCandidate.js";import{RightAngleSnappingCandidate as j,OtherVertexType as x}from"./candidates/RightAngleSnappingCandidate.js";let C=class extends t{constructor(e){super(e),this.sourceModules={featureService:{module:null,loader:null},featureCollection:{module:null,loader:null},graphics:{module:null,loader:null}}}get updating(){return i(this.snappingSources,(({snappingSource:e})=>e.updating))||this.updatingHandles.updating}get snappingSources(){const e=this._get("snappingSources")||new Map,t=new Map;if(this.options?.featureSources)for(const r of this.options.featureSources.items){const i=r.layer.uid,n=e.get(i);if(n){e.delete(i),t.set(i,n);continue}if(!r.layer.loaded){this.updatingHandles.addPromise(r.layer.load());continue}const a=this._createSourceInfo(r);o(a)&&t.set(i,a)}for(const[,r]of e)r.destroy();return t}initialize(){this.updatingHandles.add((()=>this.snappingSources),(()=>this.notifyChange("updating")),u),o(this.view)&&this.handles.add([this.view.on("layerview-create",(e=>this._updateLayerView(e.layer,e.layerView))),this.view.on("layerview-destroy",(e=>this._updateLayerView(e.layer,null)))])}_updateLayerView(e,t){for(const[,r]of this.snappingSources)r.snappingSource.layerSource.layer===e&&(r.layerView=t)}destroy(){this._set("options",null);for(const[,e]of this.snappingSources)e.destroy()}async fetchCandidates(e,t,r){if(!this.options.effectiveFeatureEnabled)return[];const i=[],n=this._computeScreeenSizeDistanceParameters(e,t),a={distance:n,point:e,coordinateHelper:t.coordinateHelper,types:this.types,filter:null};for(const[,{snappingSource:s,layerView:c}]of this.snappingSources)!s.layerSource.enabled||o(c)&&c.suspended||i.push(s.fetchCandidates(a,r).then((e=>e.filter((e=>!this._candidateIsExcluded(s,e,t.excludeFeature))))));const u=(await s(i)).flat();return this._addRightAngleCandidates(u,e,n,t),c(r),S(e,u),u}_addRightAngleCandidates(e,t,r,i){const a=o(i.vertexHandle)?i.vertexHandle.rightEdge?.rightVertex?.pos:o(i.editGeometryOperations)&&"polygon"===i.editGeometryOperations.data.type?n(i.editGeometryOperations.data.components[0]?.getFirstVertex())?.pos:null,s=o(i.vertexHandle)?i.vertexHandle.leftEdge?.leftVertex?.pos:o(i.editGeometryOperations)?n(i.editGeometryOperations.data.components[0]?.getLastVertex())?.pos:null,c=e.length;for(let o=0;o<c;o++)this._addRightAngleCandidate(e[o],s,t,r,i,e),this._addRightAngleCandidate(e[o],a,t,r,i,e)}_addRightAngleCandidate(e,t,r,i,o,n){if(a(t)||!(e instanceof w))return;const s=e.constraint.closestTo(t),c=(s[0]-r[0])/i.x,u=(s[1]-r[1])/i.y;if(c*c+u*u<=1){const r=o.coordinateHelper;n.push(new j({coordinateHelper:r,targetPoint:s,otherVertex:t,otherVertexType:x.NEXT,previousVertex:e.constraint.start,constraint:new y(r,t,s),objectId:e.objectId,elevationInfo:e.elevationInfo}))}}_computeScreeenSizeDistanceParameters(e,t){const r=this.options.distance*("touch"===t.pointer?this.options.touchSensitivityMultiplier:1);if(a(this.view))return{x:r,y:r,pixelSize:r};if("2d"===this.view.type){const e=r*this.view.resolution;return{x:e,y:e,pixelSize:e}}return this._computeScreeenSizeDistanceParameters3D(e,r,this.view,t)}_computeScreeenSizeDistanceParameters3D(e,t,r,i){const{coordinateHelper:o,elevationInfo:n}=i,a=r.state.camera.computeScreenPixelSizeAt(m(e,o,n,r,M)),s=a*r.renderCoordsHelper.unitInMeters/r.mapCoordsHelper.unitInMeters,c=t*s;return{x:c/this._computeScreenMagnitudeOfMapOffset(e,s,0,r,i),y:c/this._computeScreenMagnitudeOfMapOffset(e,0,s,r,i),pixelSize:a}}_computeScreenMagnitudeOfMapOffset(e,t,r,i,{coordinateHelper:o,elevationInfo:n}){const a=o.clone(e);a[0]+=t,a[1]+=r;const s=v(e,o,n,i),c=v(a,o,n,i),u=c.x-s.x,l=c.y-s.y;return Math.sqrt(u*u+l*l)}get types(){return f.EDGE|f.VERTEX}_candidateIsExcluded(e,t,r){if(a(r))return!1;const i=this._getCandidateObjectId(t);if(a(i))return!1;const o=e.layerSource.layer;return"graphics"===o.type?r.uid===i:r.sourceLayer===o&&(!(!r.attributes||!("objectIdField"in o))&&r.attributes[o.objectIdField]===i)}_getCandidateObjectId(e){return e instanceof _?e.objectId:null}_createSourceInfo(e){const t=this._createFeatureSnappingSourceType(e);if(a(t))return null;if("loading"in t)return this.updatingHandles.addPromise(t.loading.then((()=>{this.destroyed||this.notifyChange("snappingSources")}))),null;const r=o(this.view)?this.view.allLayerViews.find((t=>t.layer===e.layer)):null;return new H(t.source,r)}_createFeatureSnappingSourceType(e){switch(e.layer.type){case"feature":case"geojson":case"csv":case"subtype-group":case"wfs":return this._createFeatureSnappingSourceFeatureLayer(e);case"graphics":return this._createFeatureSnappingSourceGraphicsLayer(e)}return null}_createFeatureSnappingSourceFeatureLayer(e){switch(e.layer.source.type){case"feature-layer":{const t=this._getSourceModule("featureService");return o(t.module)?{source:new t.module.FeatureServiceSnappingSource({spatialReference:this.spatialReference,view:this.view,layerSource:e})}:{loading:t.loader}}case"memory":case"csv":case"geojson":case"wfs":{if("mesh"===e.layer.geometryType)return null;const t=this._getSourceModule("featureCollection");return o(t.module)?{source:new t.module.FeatureCollectionSnappingSource({layerSource:e})}:{loading:t.loader}}}return null}_createFeatureSnappingSourceGraphicsLayer(e){const t=this._getSourceModule("graphics");return o(t.module)?{source:new t.module.GraphicsSnappingSource({spatialReference:this.spatialReference,view:this.view,layerSource:e})}:{loading:t.loader}}_getSourceModule(e){const t=this.sourceModules[e];if(a(t.loader)){const r=this._loadSourceModule(e).then((e=>{t.module=e}));return t.loader=r,{module:t.module,loader:r}}return{module:t.module,loader:t.loader}}_loadSourceModule(e){switch(e){case"featureService":return this.updatingHandles.addPromise(import("./featureSources/FeatureServiceSnappingSource.js"));case"featureCollection":return this.updatingHandles.addPromise(import("./featureSources/FeatureCollectionSnappingSource.js"));case"graphics":return this.updatingHandles.addPromise(import("./featureSources/GraphicsSnappingSource.js"))}return null}};e([d({constructOnly:!0})],C.prototype,"spatialReference",void 0),e([d({constructOnly:!0})],C.prototype,"view",void 0),e([d()],C.prototype,"options",void 0),e([d({readOnly:!0})],C.prototype,"updating",null),e([d({readOnly:!0})],C.prototype,"snappingSources",null),C=e([h("esri.views.interactive.snapping.FeatureSnappingEngine")],C);class H{constructor(e,t){this.snappingSource=e,this.layerView=t,this.handles=new r;const i=this.snappingSource.layerSource.layer;if("refresh"in i){const t=i;this.handles.add(t.on("refresh",(()=>e.refresh())))}this.handles.add([l((()=>e.updating),(t=>e.layerSource.updating=t),p),l((()=>e.availability),(t=>e.layerSource.availability=t),p)])}destroy(){this.snappingSource.destroy(),this.handles.destroy()}}const M=g();export{C as FeatureSnappingEngine};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.24/esri/copyright.txt for details.
4
4
  */
5
- import{_ as t}from"../../../chunks/tslib.es6.js";import e from"../../../core/Evented.js";import{HandleOwner as i}from"../../../core/HandleOwner.js";import{isSome as n}from"../../../core/maybe.js";import{isAborted as s}from"../../../core/promiseUtils.js";import{watch as o,sync as r,syncAndInitial as a}from"../../../core/reactiveUtils.js";import{property as d}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/arrayUtils.js";import"../../../core/has.js";import"../../../core/accessorSupport/ensureType.js";import{subclass as c}from"../../../core/accessorSupport/decorators/subclass.js";import{s as h}from"../../../chunks/vec2.js";import p from"../../../geometry/SpatialReference.js";import{FeatureSnappingEngine as l}from"./FeatureSnappingEngine.js";import{SelfSnappingEngine as u}from"./SelfSnappingEngine.js";import f from"./SnappingOptions.js";import{squareDistance as v,anyMapPointToScreenPoint as m,sortCandidatesInPlace as g}from"./snappingUtils.js";import{IntersectionSnappingCandidate as _}from"./candidates/IntersectionSnappingCandidate.js";let y=class extends(e.EventedMixin(i)){constructor(t){super(t),this.options=new f,this.engines=[],this._currentMainCandidate=null,this._currentOtherActiveCandidates=[]}initialize(){this.handles.add([o((()=>{const{effectiveFeatureEnabled:t,effectiveSelfEnabled:e,touchSensitivityMultiplier:i,distance:n}=this.options;return{effectiveFeatureEnabled:t,effectiveSelfEnabled:e,touchSensitivityMultiplier:i,distance:n}}),(()=>{this.doneSnapping(),this.emit("changed")}),r),o((()=>this.options),(t=>{for(const e of this.engines)e.options=t}),r),o((()=>({ready:this.view.ready,spatialReference:this.view.spatialReference})),(({ready:t,spatialReference:e})=>this._onViewChange(t,e)),a)])}destroy(){this._destroyEngines()}get updating(){return this.engines.some((t=>t.updating))}_onViewChange(t,e){this._destroyEngines(),t&&(this.engines=[new u({view:this.view,options:this.options}),new l({view:this.view,spatialReference:null!=e?e:p.WGS84,options:this.options})])}_destroyEngines(){for(const t of this.engines)t.destroy();this.engines.length=0}get squaredMouseProximityTreshold(){return this.options.distance*this.options.distance}get squaredTouchProximityThreshold(){const{distance:t,touchSensitivityMultiplier:e}=this.options,i=t*e;return i*i}async snap(t,e,i){const o=e.coordinateHelper.pointToVector(t),r=await this._fetchCandidates(o,e,i);return{get valid(){return!s(i)},apply:()=>{const{snappedPoint:t,hints:i}=this._processCandidates(o,r,e);return this._removeVisualization(),n(e.visualizer)&&this.handles.add(e.visualizer.draw(i,{coordinateHelper:e.coordinateHelper,elevationInfo:e.elevationInfo,view:this.view}),C),t}}}update(t,e){this._removeVisualization();let i=t;const s=[];if(n(this._currentMainCandidate)){const n=e.coordinateHelper,o=n.pointToVector(t),r=this._currentMainCandidate.constraint.closestTo(o);if(v(m(o,n,e.elevationInfo,this.view),m(r,n,e.elevationInfo,this.view))<this._squaredPointProximityThreshold(e.pointer)){i=n.vectorToDehydratedPoint(r),this._currentMainCandidate.targetPoint=r,s.push(...this._currentMainCandidate.hints);for(const t of this._currentOtherActiveCandidates)t.targetPoint=r,s.push(...t.hints)}else this._currentMainCandidate=null,this._currentOtherActiveCandidates=[]}return n(e.visualizer)&&this.handles.add(e.visualizer.draw(s,{coordinateHelper:e.coordinateHelper,elevationInfo:e.elevationInfo,view:this.view}),C),i}doneSnapping(){this._removeVisualization(),this._currentMainCandidate=null,this._currentOtherActiveCandidates=[]}_removeVisualization(){this.handles.remove(C)}async _fetchCandidates(t,e,i){return(await Promise.all(this.engines.map((n=>n.fetchCandidates(t,e,i))))).flat()}_processCandidates(t,e,i){if(e.length<1)return this.doneSnapping(),{snappedPoint:i.coordinateHelper.vectorToDehydratedPoint(t),hints:[]};g(t,e);const s=this._currentMainCandidate;if(n(s)){const n=this._findOldConstraintInNewCandidates(s,e);if(n>=0){if(!(e[n]instanceof _))return this._intersectWithOtherCandidates(n,e,t,i);if(h(t,s.targetPoint)<this._squaredPointProximityThreshold(i.pointer))return this._updateSnappingCandidate(s,e,i)}}return this._intersectWithOtherCandidates(0,e,t,i)}_findOldConstraintInNewCandidates(t,e){return t instanceof _?this._findOldCandidateIndex(e,t.first)>=0&&this._findOldCandidateIndex(e,t.second)>=0?0:-1:this._findOldCandidateIndex(e,t)}_intersectWithOtherCandidates(t,e,i,n){const s=e[t],o=[],r=n.coordinateHelper;for(let a=0;a<e.length;++a){if(a===t)continue;const d=e[a];for(const t of s.constraint.intersect(d.constraint)){const e=r.fromXYZ(t.intersection,s.targetPoint[2]);o.push([new _(r,e,s,d,d.elevationInfo),v(m(i,n.coordinateHelper,n.elevationInfo,this.view),m(e,n.coordinateHelper,n.elevationInfo,this.view))])}}return o.length>0&&(o.sort(((t,e)=>t[1]-e[1])),o[0][1]<this._squaredPointProximityThreshold(n.pointer))?this._updateSnappingCandidate(o[0][0],e,n):this._updateSnappingCandidate(s,e,n)}_updateSnappingCandidate(t,e,i){this.doneSnapping(),this._currentMainCandidate=t;const n=this._currentMainCandidate.targetPoint,s=[];s.push(...t.hints);for(const o of e){if(t instanceof _){if(o.constraint.objectEqual(t.first.constraint)||o.constraint.objectEqual(t.second.constraint))continue}else if(o.constraint.objectEqual(t.constraint))continue;o.constraint.check(n)&&(o.targetPoint=n,this._currentOtherActiveCandidates.push(o),s.push(...o.hints))}return{snappedPoint:i.coordinateHelper.vectorToDehydratedPoint(n),hints:s}}_squaredPointProximityThreshold(t){return"touch"===t?this.squaredTouchProximityThreshold:this.squaredMouseProximityTreshold}_findOldCandidateIndex(t,e){let i=-1;for(let n=0;n<t.length;++n)if(e.constraint.objectEqual(t[n].constraint)){i=n;break}return i}get test(){return{visualizationsActive:this.handles.has(C),engines:this.engines}}};t([d({constructOnly:!0})],y.prototype,"view",void 0),t([d()],y.prototype,"options",void 0),t([d({readOnly:!0})],y.prototype,"updating",null),t([d()],y.prototype,"engines",void 0),t([d()],y.prototype,"squaredMouseProximityTreshold",null),t([d()],y.prototype,"squaredTouchProximityThreshold",null),y=t([c("esri.views.interactive.snapping.SnappingManager")],y);const C="visualization-handle";export{y as SnappingManager};
5
+ import{_ as t}from"../../../chunks/tslib.es6.js";import e from"../../../core/Evented.js";import{HandleOwner as i}from"../../../core/HandleOwner.js";import{isSome as n}from"../../../core/maybe.js";import{isAborted as s}from"../../../core/promiseUtils.js";import{watch as o,sync as r,syncAndInitial as a}from"../../../core/reactiveUtils.js";import{property as d}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/arrayUtils.js";import"../../../core/has.js";import"../../../core/accessorSupport/ensureType.js";import{subclass as c}from"../../../core/accessorSupport/decorators/subclass.js";import{s as h}from"../../../chunks/vec2.js";import p from"../../../geometry/SpatialReference.js";import{FeatureSnappingEngine as l}from"./FeatureSnappingEngine.js";import{SelfSnappingEngine as u}from"./SelfSnappingEngine.js";import f from"./SnappingOptions.js";import{squareDistance as v,anyMapPointToScreenPoint as m,sortCandidatesInPlace as g}from"./snappingUtils.js";import{IntersectionSnappingCandidate as _}from"./candidates/IntersectionSnappingCandidate.js";let y=class extends(e.EventedMixin(i)){constructor(t){super(t),this.options=new f,this.engines=[],this._currentMainCandidate=null,this._currentOtherActiveCandidates=[]}initialize(){this.handles.add([o((()=>{const{effectiveFeatureEnabled:t,effectiveSelfEnabled:e,touchSensitivityMultiplier:i,distance:n}=this.options;return{effectiveFeatureEnabled:t,effectiveSelfEnabled:e,touchSensitivityMultiplier:i,distance:n}}),(()=>{this.doneSnapping(),this.emit("changed")}),r),o((()=>this.options),(t=>{for(const e of this.engines)e.options=t}),r),o((()=>({ready:this.view.ready,spatialReference:this.view.spatialReference})),(({ready:t,spatialReference:e})=>this._onViewChange(t,e)),a)])}destroy(){this._destroyEngines()}get updating(){return this.engines.some((t=>t.updating))}_onViewChange(t,e){this._destroyEngines(),t&&(this.engines=[new u({view:this.view,options:this.options}),new l({view:this.view,spatialReference:e??p.WGS84,options:this.options})])}_destroyEngines(){for(const t of this.engines)t.destroy();this.engines.length=0}get squaredMouseProximityTreshold(){return this.options.distance*this.options.distance}get squaredTouchProximityThreshold(){const{distance:t,touchSensitivityMultiplier:e}=this.options,i=t*e;return i*i}async snap(t,e,i){const o=e.coordinateHelper.pointToVector(t),r=await this._fetchCandidates(o,e,i);return{get valid(){return!s(i)},apply:()=>{const{snappedPoint:t,hints:i}=this._processCandidates(o,r,e);return this._removeVisualization(),n(e.visualizer)&&this.handles.add(e.visualizer.draw(i,{coordinateHelper:e.coordinateHelper,elevationInfo:e.elevationInfo,view:this.view}),C),t}}}update(t,e){this._removeVisualization();let i=t;const s=[];if(n(this._currentMainCandidate)){const n=e.coordinateHelper,o=n.pointToVector(t),r=this._currentMainCandidate.constraint.closestTo(o);if(v(m(o,n,e.elevationInfo,this.view),m(r,n,e.elevationInfo,this.view))<this._squaredPointProximityThreshold(e.pointer)){i=n.vectorToDehydratedPoint(r),this._currentMainCandidate.targetPoint=r,s.push(...this._currentMainCandidate.hints);for(const t of this._currentOtherActiveCandidates)t.targetPoint=r,s.push(...t.hints)}else this._currentMainCandidate=null,this._currentOtherActiveCandidates=[]}return n(e.visualizer)&&this.handles.add(e.visualizer.draw(s,{coordinateHelper:e.coordinateHelper,elevationInfo:e.elevationInfo,view:this.view}),C),i}doneSnapping(){this._removeVisualization(),this._currentMainCandidate=null,this._currentOtherActiveCandidates=[]}_removeVisualization(){this.handles.remove(C)}async _fetchCandidates(t,e,i){return(await Promise.all(this.engines.map((n=>n.fetchCandidates(t,e,i))))).flat()}_processCandidates(t,e,i){if(e.length<1)return this.doneSnapping(),{snappedPoint:i.coordinateHelper.vectorToDehydratedPoint(t),hints:[]};g(t,e);const s=this._currentMainCandidate;if(n(s)){const n=this._findOldConstraintInNewCandidates(s,e);if(n>=0){if(!(e[n]instanceof _))return this._intersectWithOtherCandidates(n,e,t,i);if(h(t,s.targetPoint)<this._squaredPointProximityThreshold(i.pointer))return this._updateSnappingCandidate(s,e,i)}}return this._intersectWithOtherCandidates(0,e,t,i)}_findOldConstraintInNewCandidates(t,e){return t instanceof _?this._findOldCandidateIndex(e,t.first)>=0&&this._findOldCandidateIndex(e,t.second)>=0?0:-1:this._findOldCandidateIndex(e,t)}_intersectWithOtherCandidates(t,e,i,n){const s=e[t],o=[],r=n.coordinateHelper;for(let a=0;a<e.length;++a){if(a===t)continue;const d=e[a];for(const t of s.constraint.intersect(d.constraint)){const e=r.fromXYZ(t.intersection,s.targetPoint[2]);o.push([new _(r,e,s,d,d.elevationInfo),v(m(i,n.coordinateHelper,n.elevationInfo,this.view),m(e,n.coordinateHelper,n.elevationInfo,this.view))])}}return o.length>0&&(o.sort(((t,e)=>t[1]-e[1])),o[0][1]<this._squaredPointProximityThreshold(n.pointer))?this._updateSnappingCandidate(o[0][0],e,n):this._updateSnappingCandidate(s,e,n)}_updateSnappingCandidate(t,e,i){this.doneSnapping(),this._currentMainCandidate=t;const n=this._currentMainCandidate.targetPoint,s=[];s.push(...t.hints);for(const o of e){if(t instanceof _){if(o.constraint.objectEqual(t.first.constraint)||o.constraint.objectEqual(t.second.constraint))continue}else if(o.constraint.objectEqual(t.constraint))continue;o.constraint.check(n)&&(o.targetPoint=n,this._currentOtherActiveCandidates.push(o),s.push(...o.hints))}return{snappedPoint:i.coordinateHelper.vectorToDehydratedPoint(n),hints:s}}_squaredPointProximityThreshold(t){return"touch"===t?this.squaredTouchProximityThreshold:this.squaredMouseProximityTreshold}_findOldCandidateIndex(t,e){let i=-1;for(let n=0;n<t.length;++n)if(e.constraint.objectEqual(t[n].constraint)){i=n;break}return i}get test(){return{visualizationsActive:this.handles.has(C),engines:this.engines}}};t([d({constructOnly:!0})],y.prototype,"view",void 0),t([d()],y.prototype,"options",void 0),t([d({readOnly:!0})],y.prototype,"updating",null),t([d()],y.prototype,"engines",void 0),t([d()],y.prototype,"squaredMouseProximityTreshold",null),t([d()],y.prototype,"squaredTouchProximityThreshold",null),y=t([c("esri.views.interactive.snapping.SnappingManager")],y);const C="visualization-handle";export{y as SnappingManager};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.24/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../../chunks/tslib.es6.js";import t from"../../../../core/Handles.js";import{makeHandle as r}from"../../../../core/handleUtils.js";import{property as o}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/arrayUtils.js";import"../../../../core/has.js";import"../../../../core/accessorSupport/ensureType.js";import{subclass as s}from"../../../../core/accessorSupport/decorators/subclass.js";import a from"../../../../geometry/Polygon.js";import{toExtent as i}from"../../../../geometry/support/aaBoundingRect.js";import{TileTreeDebugger as n}from"../../../support/TileTreeDebugger.js";let d=class extends n{constructor(e){super(e),this.handles=new t}initialize(){const e=setInterval((()=>this._fetchDebugInfo()),2e3);this.handles.add(r((()=>clearInterval(e))))}destroy(){this.handles.destroy()}getTiles(){if(!this.debugInfo)return[];const e=new Map,t=new Map;this.debugInfo.storedTiles.forEach((t=>{e.set(t.data.id,t.featureCount)})),this.debugInfo.pendingTiles.forEach((r=>{e.set(r.data.id,r.featureCount),t.set(r.data.id,r.state)}));const r=r=>{var o;const s=t.get(r),a=null!=(o=e.get(r))?o:"?";return s?`${s}:${a}\n${r}`:`store:${a}\n${r}`},o=new Map;return this.debugInfo.storedTiles.forEach((e=>{o.set(e.data.id,e.data)})),this.debugInfo.pendingTiles.forEach((e=>{o.set(e.data.id,e.data)})),Array.from(o.values()).map((e=>({lij:[e.level,e.row,e.col],geometry:a.fromExtent(i(e.extent,this.view.spatialReference)),label:r(e.id)})))}_fetchDebugInfo(){this.handle.getDebugInfo(null).then((e=>{this.debugInfo=e,this.update()}))}};e([o({constructOnly:!0})],d.prototype,"handle",void 0),d=e([s("esri.views.interactive.snapping.featureSources.WorkerTileTreeDebugger")],d);export{d as WorkerTileTreeDebugger};
5
+ import{_ as e}from"../../../../chunks/tslib.es6.js";import t from"../../../../core/Handles.js";import{makeHandle as r}from"../../../../core/handleUtils.js";import{property as o}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/arrayUtils.js";import"../../../../core/has.js";import"../../../../core/accessorSupport/ensureType.js";import{subclass as s}from"../../../../core/accessorSupport/decorators/subclass.js";import a from"../../../../geometry/Polygon.js";import{toExtent as i}from"../../../../geometry/support/aaBoundingRect.js";import{TileTreeDebugger as n}from"../../../support/TileTreeDebugger.js";let d=class extends n{constructor(e){super(e),this.handles=new t}initialize(){const e=setInterval((()=>this._fetchDebugInfo()),2e3);this.handles.add(r((()=>clearInterval(e))))}destroy(){this.handles.destroy()}getTiles(){if(!this.debugInfo)return[];const e=new Map,t=new Map;this.debugInfo.storedTiles.forEach((t=>{e.set(t.data.id,t.featureCount)})),this.debugInfo.pendingTiles.forEach((r=>{e.set(r.data.id,r.featureCount),t.set(r.data.id,r.state)}));const r=r=>{const o=t.get(r),s=e.get(r)??"?";return o?`${o}:${s}\n${r}`:`store:${s}\n${r}`},o=new Map;return this.debugInfo.storedTiles.forEach((e=>{o.set(e.data.id,e.data)})),this.debugInfo.pendingTiles.forEach((e=>{o.set(e.data.id,e.data)})),Array.from(o.values()).map((e=>({lij:[e.level,e.row,e.col],geometry:a.fromExtent(i(e.extent,this.view.spatialReference)),label:r(e.id)})))}_fetchDebugInfo(){this.handle.getDebugInfo(null).then((e=>{this.debugInfo=e,this.update()}))}};e([o({constructOnly:!0})],d.prototype,"handle",void 0),d=e([s("esri.views.interactive.snapping.featureSources.WorkerTileTreeDebugger")],d);export{d as WorkerTileTreeDebugger};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.24/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../../../chunks/tslib.es6.js";import{HandleOwner as t}from"../../../../../core/HandleOwner.js";import{isNone as i,isSome as o}from"../../../../../core/maybe.js";import{whenOrAbort as r}from"../../../../../core/promiseUtils.js";import{property as a}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/arrayUtils.js";import"../../../../../core/has.js";import"../../../../../core/accessorSupport/ensureType.js";import{subclass as n}from"../../../../../core/accessorSupport/decorators/subclass.js";import{WorkerHandle as s}from"../../../../../core/workers/WorkerHandle.js";import{featureGeometryTypeKebabDictionary as d}from"../../../../../geometry/support/typeUtils.js";let l=class extends t{constructor(e){super(e),this.availability=0,this.workerHandleUpdating=!0,this.editId=0}get updating(){return this.updatingHandles.updating||this.workerHandleUpdating}destroy(){this.workerHandle.destroy()}initialize(){this.workerHandle=new p(this.schedule),this.handles.add([this.workerHandle.on("notify-updating",(({updating:e})=>this.workerHandleUpdating=e)),this.workerHandle.on("notify-availability",(({availability:e})=>this._set("availability",e)))])}async setup(e,t){const o=this._serviceInfoFromLayer(e.layer);if(i(o))return;const r={configuration:this._convertConfiguration(e.configuration),serviceInfo:o,spatialReference:e.spatialReference.toJSON()};await this.updatingHandles.addPromise(this.workerHandle.invokeMethod("setup",r,t)),this.updatingHandles.addPromise(this.workerHandle.invokeMethod("whenNotUpdating",{},t))}async configure(e,t){const i=this._convertConfiguration(e);await this.updatingHandles.addPromise(this.workerHandle.invokeMethod("configure",i,t)),this.updatingHandles.addPromise(this.workerHandle.invokeMethod("whenNotUpdating",{},t))}async refresh(e){await this.updatingHandles.addPromise(this.workerHandle.invokeMethod("refresh",{},e)),this.updatingHandles.addPromise(this.workerHandle.invokeMethod("whenNotUpdating",{},e))}async fetchCandidates(e,t){const i={distance:e.distance,point:e.coordinateHelper.vectorToPoint(e.point).toJSON(),types:e.types,filter:o(e.filter)?e.filter.createQuery().toJSON():null};return this.workerHandle.invoke(i,t)}async updateTiles(e,t){const i={tiles:e.tiles,tileInfo:o(e.tileInfo)?e.tileInfo.toJSON():null,tileSize:e.tileSize};await this.updatingHandles.addPromise(this.workerHandle.invokeMethod("updateTiles",i,t)),this.updatingHandles.addPromise(this.workerHandle.invokeMethod("whenNotUpdating",{},t))}async applyEdits(e,t){var i,o,a,n,s,d;const l=this.editId++,p={id:l};await this.updatingHandles.addPromise(this.workerHandle.invokeMethod("beginApplyEdits",p,t)),this.updatingHandles.addPromise(this.workerHandle.invokeMethod("whenNotUpdating",{},t));const u=await this.updatingHandles.addPromise(r(e.result,t)),c={id:l,edits:{addedFeatures:null!=(i=null==(o=u.addedFeatures)?void 0:o.map((({objectId:e})=>e)))?i:[],deletedFeatures:null!=(a=null==(n=u.deletedFeatures)?void 0:n.map((({objectId:e,globalId:t})=>({objectId:e,globalId:t}))))?a:[],updatedFeatures:null!=(s=null==(d=u.updatedFeatures)?void 0:d.map((({objectId:e})=>e)))?s:[]}};await this.updatingHandles.addPromise(this.workerHandle.invokeMethod("endApplyEdits",c,t)),this.updatingHandles.addPromise(this.workerHandle.invokeMethod("whenNotUpdating",{},t))}getDebugInfo(e){return this.workerHandle.invokeMethod("getDebugInfo",{},e)}_convertConfiguration(e){return{filter:o(e.filter)?e.filter.toJSON():null,customParameters:e.customParameters}}_serviceInfoFromLayer(e){var t;return"multipatch"===e.geometryType||"mesh"===e.geometryType?null:{url:e.parsedUrl.path,fields:e.fields.map((e=>e.toJSON())),geometryType:d.toJSON(e.geometryType),capabilities:e.capabilities,objectIdField:e.objectIdField,globalIdField:e.globalIdField,spatialReference:e.spatialReference.toJSON(),timeInfo:null==(t=e.timeInfo)?void 0:t.toJSON()}}};e([a({constructOnly:!0})],l.prototype,"schedule",void 0),e([a({readOnly:!0})],l.prototype,"updating",null),e([a({readOnly:!0})],l.prototype,"availability",void 0),e([a()],l.prototype,"workerHandleUpdating",void 0),l=e([n("esri.views.interactive.snapping.featureSources.featureServiceSource.FeatureServiceSnappingSourceWorkerHandle")],l);class p extends s{constructor(e){super("FeatureServiceSnappingSourceWorker","fetchCandidates",{},e,{strategy:"dedicated"})}}export{l as FeatureServiceSnappingSourceWorkerHandle};
5
+ import{_ as e}from"../../../../../chunks/tslib.es6.js";import{HandleOwner as t}from"../../../../../core/HandleOwner.js";import{isNone as i,isSome as r}from"../../../../../core/maybe.js";import{whenOrAbort as o}from"../../../../../core/promiseUtils.js";import{property as a}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/arrayUtils.js";import"../../../../../core/has.js";import"../../../../../core/accessorSupport/ensureType.js";import{subclass as s}from"../../../../../core/accessorSupport/decorators/subclass.js";import{WorkerHandle as d}from"../../../../../core/workers/WorkerHandle.js";import{featureGeometryTypeKebabDictionary as n}from"../../../../../geometry/support/typeUtils.js";let l=class extends t{constructor(e){super(e),this.availability=0,this.workerHandleUpdating=!0,this.editId=0}get updating(){return this.updatingHandles.updating||this.workerHandleUpdating}destroy(){this.workerHandle.destroy()}initialize(){this.workerHandle=new p(this.schedule),this.handles.add([this.workerHandle.on("notify-updating",(({updating:e})=>this.workerHandleUpdating=e)),this.workerHandle.on("notify-availability",(({availability:e})=>this._set("availability",e)))])}async setup(e,t){const r=this._serviceInfoFromLayer(e.layer);if(i(r))return;const o={configuration:this._convertConfiguration(e.configuration),serviceInfo:r,spatialReference:e.spatialReference.toJSON()};await this.updatingHandles.addPromise(this.workerHandle.invokeMethod("setup",o,t)),this.updatingHandles.addPromise(this.workerHandle.invokeMethod("whenNotUpdating",{},t))}async configure(e,t){const i=this._convertConfiguration(e);await this.updatingHandles.addPromise(this.workerHandle.invokeMethod("configure",i,t)),this.updatingHandles.addPromise(this.workerHandle.invokeMethod("whenNotUpdating",{},t))}async refresh(e){await this.updatingHandles.addPromise(this.workerHandle.invokeMethod("refresh",{},e)),this.updatingHandles.addPromise(this.workerHandle.invokeMethod("whenNotUpdating",{},e))}async fetchCandidates(e,t){const i={distance:e.distance,point:e.coordinateHelper.vectorToPoint(e.point).toJSON(),types:e.types,filter:r(e.filter)?e.filter.createQuery().toJSON():null};return this.workerHandle.invoke(i,t)}async updateTiles(e,t){const i={tiles:e.tiles,tileInfo:r(e.tileInfo)?e.tileInfo.toJSON():null,tileSize:e.tileSize};await this.updatingHandles.addPromise(this.workerHandle.invokeMethod("updateTiles",i,t)),this.updatingHandles.addPromise(this.workerHandle.invokeMethod("whenNotUpdating",{},t))}async applyEdits(e,t){const i=this.editId++,r={id:i};await this.updatingHandles.addPromise(this.workerHandle.invokeMethod("beginApplyEdits",r,t)),this.updatingHandles.addPromise(this.workerHandle.invokeMethod("whenNotUpdating",{},t));const a=await this.updatingHandles.addPromise(o(e.result,t)),s={id:i,edits:{addedFeatures:a.addedFeatures?.map((({objectId:e})=>e))??[],deletedFeatures:a.deletedFeatures?.map((({objectId:e,globalId:t})=>({objectId:e,globalId:t})))??[],updatedFeatures:a.updatedFeatures?.map((({objectId:e})=>e))??[]}};await this.updatingHandles.addPromise(this.workerHandle.invokeMethod("endApplyEdits",s,t)),this.updatingHandles.addPromise(this.workerHandle.invokeMethod("whenNotUpdating",{},t))}getDebugInfo(e){return this.workerHandle.invokeMethod("getDebugInfo",{},e)}_convertConfiguration(e){return{filter:r(e.filter)?e.filter.toJSON():null,customParameters:e.customParameters}}_serviceInfoFromLayer(e){return"multipatch"===e.geometryType||"mesh"===e.geometryType?null:{url:e.parsedUrl.path,fields:e.fields.map((e=>e.toJSON())),geometryType:n.toJSON(e.geometryType),capabilities:e.capabilities,objectIdField:e.objectIdField,globalIdField:e.globalIdField,spatialReference:e.spatialReference.toJSON(),timeInfo:e.timeInfo?.toJSON()}}};e([a({constructOnly:!0})],l.prototype,"schedule",void 0),e([a({readOnly:!0})],l.prototype,"updating",null),e([a({readOnly:!0})],l.prototype,"availability",void 0),e([a()],l.prototype,"workerHandleUpdating",void 0),l=e([s("esri.views.interactive.snapping.featureSources.featureServiceSource.FeatureServiceSnappingSourceWorkerHandle")],l);class p extends d{constructor(e){super("FeatureServiceSnappingSourceWorker","fetchCandidates",{},e,{strategy:"dedicated"})}}export{l as FeatureServiceSnappingSourceWorkerHandle};