@arcgis/core 6.0.0-next.54 → 6.0.0-next.55

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (300) hide show
  1. package/WebScene.js +2 -2
  2. package/applications/Components/OrientedImageryViewer/shared/constants.js +1 -1
  3. package/applications/SceneViewer/sceneViewerUtils.js +1 -1
  4. package/arcade/arcadeAsyncRuntime.js +1 -1
  5. package/arcade/arcadeCompiler.js +1 -1
  6. package/arcade/arcadeRuntime.js +1 -1
  7. package/arcade/featureset/support/sqlUtils.js +1 -1
  8. package/arcade/validation/arcadeValidator.js +1 -1
  9. package/assets/esri/core/workers/RemoteClient.js +1 -1
  10. package/assets/esri/core/workers/chunks/0329fa3aa3403f1c243b.js +1 -0
  11. package/assets/esri/core/workers/chunks/{6602310c3fcd91fb6a2f.js → 07c8ac092e4b9e8d5b3c.js} +1 -1
  12. package/assets/esri/core/workers/chunks/0a97b1974367382cfdf5.js +1 -0
  13. package/assets/esri/core/workers/chunks/{db0a7671ab5cbe8afd72.js → 123661019bb69c53f2d3.js} +1 -1
  14. package/assets/esri/core/workers/chunks/{d14732a57c8e63948c60.js → 14259910f44c08fd5bbd.js} +1 -1
  15. package/assets/esri/core/workers/chunks/{1b41ba050cde068d2860.js → 193a73a2c7f4f8482c21.js} +1 -1
  16. package/assets/esri/core/workers/chunks/20acb6f3ed5140b6c6c6.js +1 -0
  17. package/assets/esri/core/workers/chunks/{e507dfc4788295d9c244.js → 249a687ce1b6d0815242.js} +1 -1
  18. package/assets/esri/core/workers/chunks/{afb4dfb89fbc8a342cc5.js → 3354f1fa90f8ce4c8fde.js} +1 -1
  19. package/assets/esri/core/workers/chunks/{9b458b0d1627f22fdd93.js → 3b11e4d2e69b7aea1d65.js} +1 -1
  20. package/assets/esri/core/workers/chunks/41694ee8990e799da225.js +1 -0
  21. package/assets/esri/core/workers/chunks/{e592f2483db71230e8e5.js → 4401b3f8ebb658abe789.js} +1 -1
  22. package/assets/esri/core/workers/chunks/{12add2003631fa314f25.js → 5060be52a380fc4920f8.js} +1 -1
  23. package/assets/esri/core/workers/chunks/{2aa6be0b047a1b25a520.js → 53bbb9aa6e4e4a0a8121.js} +1 -1
  24. package/assets/esri/core/workers/chunks/{4707aedcc1b3bdf5e987.js → 5c34d49a6c9cc34b7626.js} +1 -1
  25. package/assets/esri/core/workers/chunks/69a09c6acb5ae03c67f6.js +1 -0
  26. package/assets/esri/core/workers/chunks/7b156905d168bf973518.js +1 -0
  27. package/assets/esri/core/workers/chunks/{e83806797979138fd22a.js → 844c593754b2692257f4.js} +1 -1
  28. package/assets/esri/core/workers/chunks/{2d3e977f3b75474d7ebc.js → 846248697c398468d8e6.js} +1 -1
  29. package/assets/esri/core/workers/chunks/{f7e33d37dd11fb08f3f8.js → 97107e64407fa6825620.js} +1 -1
  30. package/assets/esri/core/workers/chunks/{032733b863426c5bde00.js → 9e508f930086d2ef5f22.js} +3 -3
  31. package/assets/esri/core/workers/chunks/{5118c7269b706089c88e.js → a05a2c2aaf0c288f9681.js} +1 -1
  32. package/assets/esri/core/workers/chunks/{817bf487df056da1e6ec.js → a116dd204921e7464944.js} +1 -1
  33. package/assets/esri/core/workers/chunks/{944f17e9c9f681b971fb.js → a12e2a345005189c64be.js} +1 -1
  34. package/assets/esri/core/workers/chunks/{15b3386ad92a0b4149b8.js → a24dc5350af001db417a.js} +1 -1
  35. package/assets/esri/core/workers/chunks/{10967a36c77c5188690d.js → a66d6298236d59a615db.js} +1 -1
  36. package/assets/esri/core/workers/chunks/{255f5b45c4d32f97f86c.js → ac0861014b3d2f1a1de2.js} +1 -1
  37. package/assets/esri/core/workers/chunks/ace210d313ce53f3ae10.js +1 -0
  38. package/assets/esri/core/workers/chunks/ae48ee283cfa5b3c14b0.js +1 -0
  39. package/assets/esri/core/workers/chunks/bbd8fcb0bbba7bde3d9b.js +1 -0
  40. package/assets/esri/core/workers/chunks/{ac8d38016e4bee37a77c.js → be0b8bb4f09aae6ff5de.js} +1 -1
  41. package/assets/esri/core/workers/chunks/d0659f1b0495734be4b3.js +1 -0
  42. package/assets/esri/core/workers/chunks/{b9a2b05ede02c305e865.js → d8ffb1502def5c85740b.js} +1 -1
  43. package/assets/esri/core/workers/chunks/{7dfe1e78d2e66de6be22.js → d9ef244019954d5a8a27.js} +1 -1
  44. package/assets/esri/core/workers/chunks/{95403bb27a4ea0a4b7b1.js → ddbfa664e69612295785.js} +1 -1
  45. package/assets/esri/core/workers/chunks/{c6d82397044e403a1f61.js → e61082f56c08abe54b3a.js} +1 -1
  46. package/assets/esri/core/workers/chunks/{55d28d3f5b8ced061e39.js → eaf73ce60f39a48ddd2a.js} +1 -1
  47. package/assets/esri/core/workers/chunks/ed2f2a5da830d058e339.js +1 -0
  48. package/assets/esri/core/workers/chunks/{944cb751c85d3a127f49.js → f52d081bbde5c95265cf.js} +1 -1
  49. package/assets/esri/core/workers/chunks/{1de9be7b65109c207bd5.js → fbd5f3b81cd9f061824d.js} +1 -1
  50. package/assets/esri/layers/raster/formats/blosc-wasm.wasm +0 -0
  51. package/assets/esri/libs/librust-parquet/pkg/parquet_bg.wasm +0 -0
  52. package/basemapGallery/support/basemapCompatibilityUtils.js +1 -1
  53. package/chunks/CypherParser.js +1 -1
  54. package/chunks/GeodeticDistanceCalculator-zRp89-dW.js +1 -1
  55. package/chunks/MultiPathImpl.js +1 -1
  56. package/chunks/OperatorGeodesicBuffer.js +1 -1
  57. package/chunks/UnitFactory.js +1 -1
  58. package/chunks/blosc-wasm.js +2 -0
  59. package/chunks/cameraUtilsSpherical.js +1 -1
  60. package/chunks/parquet.js +1 -1
  61. package/chunks/text.js +1 -1
  62. package/config.js +1 -1
  63. package/core/sql/SqlInterval.js +1 -1
  64. package/core/urlUtils.js +1 -1
  65. package/geometry/geometryEngine.js +1 -1
  66. package/geometry/operators/gx/operatorOffset.js +1 -1
  67. package/geometry/support/Ellipsoid.js +1 -1
  68. package/geometry/support/curves/ellipticArc7Utils.js +1 -1
  69. package/geometry/support/geodesicConstants.js +1 -1
  70. package/geometry/support/meshUtils/primitives.js +1 -1
  71. package/kernel.js +1 -1
  72. package/layers/Lyr3DWasmPerSceneView.js +1 -1
  73. package/layers/VoxelWasmPerSceneView.js +1 -1
  74. package/layers/effects/parser.js +1 -1
  75. package/layers/geospatialPDF/GeospatialPDFLayerWorker.js +1 -1
  76. package/layers/graphics/controllers/I3SOnDemandController.js +1 -1
  77. package/layers/graphics/data/QueryEngineResult.js +1 -1
  78. package/layers/graphics/sources/support/ParquetSourceWorker.js +1 -1
  79. package/layers/parquet.js +1 -1
  80. package/layers/raster/datasets/ZarrRaster.js +1 -1
  81. package/layers/raster/datasets/wcsCoverageParser.js +1 -1
  82. package/layers/raster/formats/RasterCodec.js +1 -1
  83. package/layers/raster/formats/blosc.js +2 -0
  84. package/layers/support/BuildingFilter.js +1 -1
  85. package/layers/support/IntegratedMeshSemantics.js +1 -1
  86. package/layers/support/fieldUtils.d.ts +23 -87
  87. package/layers/support/fieldUtils.js +1 -1
  88. package/layers/support/layersMapping.js +1 -1
  89. package/layers/video/VideoController.js +1 -1
  90. package/legend/ActiveLayerInfo.js +1 -1
  91. package/libs/ajv/ajv.bundle-wrapper.js +1 -1
  92. package/package.json +4 -4
  93. package/renderers/types.d.ts +1 -1
  94. package/rest/knowledgeGraphService.js +1 -1
  95. package/rest/query/operations/pbfFeatureServiceParser.js +1 -1
  96. package/smartMapping/statistics/support/attributeDensity.js +1 -1
  97. package/smartMapping/support/adapters/support/utils.js +1 -1
  98. package/support/tests/serviceMockDependencies.js +1 -1
  99. package/symbols/cim/CIMEffects.js +1 -1
  100. package/symbols/cim/CIMSymbolDrawHelper.js +1 -1
  101. package/symbols/cim/effects/EffectControlMeasureLine.js +1 -1
  102. package/symbols/cim/placements/PlacementInsidePolygon.js +1 -1
  103. package/symbols/cim/rasterizingUtils.js +1 -1
  104. package/views/2d/PaddedViewState.js +1 -1
  105. package/views/2d/engine/vectorTiles/buckets/FillBucket.js +1 -1
  106. package/views/2d/engine/vectorTiles/constants.js +1 -1
  107. package/views/2d/engine/vectorTiles/style/geoJSONVectorTileUtils.js +1 -1
  108. package/views/2d/engine/webgl/effects/HighlightEffect.js +1 -1
  109. package/views/2d/engine/webgl/mesh/templates/segmentUtils.js +1 -1
  110. package/views/2d/engine/webgl/mesh/templates/shapingUtils.js +1 -1
  111. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/constants.js +1 -1
  112. package/views/2d/engine/webgl/shaderGraph/techniques/text/TextShader.js +1 -1
  113. package/views/2d/interactive/editingTools/ControlPointsTransformTool.js +1 -1
  114. package/views/2d/interactive/editingTools/TransformTool.js +1 -1
  115. package/views/2d/layers/FeatureLikeLayerView2D.js +1 -1
  116. package/views/2d/layers/ParquetLayerView2D.js +1 -1
  117. package/views/2d/layers/features/Processor.js +1 -1
  118. package/views/2d/layers/features/aggregation/GridSpatialIndex.js +1 -1
  119. package/views/2d/layers/features/support/AttributeStore.js +1 -1
  120. package/views/2d/layers/features/support/FeatureSetReaderPBF.js +1 -1
  121. package/views/2d/layers/graphics/GraphicsView2D.js +1 -1
  122. package/views/3d/analysis/AreaMeasurement/support/AreaMeasurementPathHelper.js +1 -1
  123. package/views/3d/analysis/Dimension/DimensionTool.js +1 -1
  124. package/views/3d/analysis/Dimension/LengthDimensionSubTool.js +1 -1
  125. package/views/3d/analysis/ElevationProfile/ElevationProfileLineSceneComputation.js +1 -1
  126. package/views/3d/analysis/LineOfSight/LineOfSightController.js +1 -1
  127. package/views/3d/analysis/LineOfSight/LineOfSightItemManipulatedObject3D.js +1 -1
  128. package/views/3d/analysis/LineOfSight/LineOfSightRayIntersector.js +1 -1
  129. package/views/3d/analysis/ShadowCastAnalysisView3D.js +1 -1
  130. package/views/3d/analysis/Slice/SliceTool.js +1 -1
  131. package/views/3d/analysis/Viewshed/ViewshedObserverManipulatedObject3D.js +1 -1
  132. package/views/3d/analysis/Viewshed/ViewshedSnappingController.js +1 -1
  133. package/views/3d/analysis/Viewshed/ViewshedTool.js +1 -1
  134. package/views/3d/analysis/ViewshedAnalysisView3D.js +1 -1
  135. package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementCutFillComputation.js +1 -1
  136. package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementVisualization.js +1 -1
  137. package/views/3d/animation/pointToPoint/Camera.js +1 -1
  138. package/views/3d/camera/constraintUtils.js +1 -1
  139. package/views/3d/camera/intersectionUtils.js +1 -1
  140. package/views/3d/environment/EnvironmentView.js +1 -1
  141. package/views/3d/focusAreaUtils.js +1 -1
  142. package/views/3d/interactive/editingTools/ManipulatedObject3DGraphic.js +1 -1
  143. package/views/3d/interactive/editingTools/dragEventPipeline3D.js +1 -1
  144. package/views/3d/interactive/editingTools/manipulations/config.js +1 -1
  145. package/views/3d/interactive/editingTools/media/MediaElementControllerControlPoints.js +1 -1
  146. package/views/3d/interactive/editingTools/media/MediaElementControllerShape.js +1 -1
  147. package/views/3d/interactive/editingTools/move/MoveTool3D.js +1 -1
  148. package/views/3d/interactive/editingTools/transform/ScaleRotateMeshAdapter.js +1 -1
  149. package/views/3d/interactive/editingTools/transform/TransformTool3D.js +1 -1
  150. package/views/3d/interactive/measurementTools/areaMeasurement3D/AreaMeasurement3DTool.js +1 -1
  151. package/views/3d/interactive/measurementTools/areaMeasurement3D/AreaMeasurement3DView.js +1 -1
  152. package/views/3d/interactive/measurementTools/directLineMeasurement3D/DirectLineMeasurement3DTool.js +1 -1
  153. package/views/3d/layers/I3SMeshView3D.js +1 -1
  154. package/views/3d/layers/SceneLayerGraphicsView3D.js +1 -1
  155. package/views/3d/layers/TiledLayerView3D.js +1 -1
  156. package/views/3d/layers/graphics/Graphics3DExtrudeSymbolLayer.js +1 -1
  157. package/views/3d/layers/graphics/Graphics3DIconSymbolLayer.js +1 -1
  158. package/views/3d/layers/graphics/Graphics3DLineSymbolLayer.js +1 -1
  159. package/views/3d/layers/graphics/Graphics3DMeshFillSymbolLayer.js +1 -1
  160. package/views/3d/layers/graphics/Graphics3DObjectSymbolLayer.js +1 -1
  161. package/views/3d/layers/graphics/Graphics3DPathSymbolLayer.js +1 -1
  162. package/views/3d/layers/graphics/Graphics3DPolygonFillSymbolLayer.js +1 -1
  163. package/views/3d/layers/graphics/Graphics3DSymbolFactory.js +1 -1
  164. package/views/3d/layers/graphics/LabelInfo.js +1 -1
  165. package/views/3d/layers/i3s/I3SClientNodeLoader.js +1 -1
  166. package/views/3d/layers/i3s/I3SIndex.js +1 -1
  167. package/views/3d/layers/i3s/I3SIntersectionHandler.js +1 -1
  168. package/views/3d/layers/i3s/I3SMeshViewFilter.js +1 -1
  169. package/views/3d/layers/i3s/I3SNode.js +1 -1
  170. package/views/3d/layers/i3s/I3SOverrides.js +1 -1
  171. package/views/3d/layers/i3s/I3SViewportQueries.js +1 -1
  172. package/views/3d/layers/i3s/LayerElevationProvider.js +1 -1
  173. package/views/3d/layers/support/FeatureTileFetcher3D.js +1 -1
  174. package/views/3d/layers/support/FeatureTileFetcher3DContext.js +1 -1
  175. package/views/3d/layers/support/FeatureTileMeasurements3D.js +1 -1
  176. package/views/3d/layers/support/FeatureTileVisibility3D.js +1 -1
  177. package/views/3d/layers/support/StageLayerElevationProvider.js +1 -1
  178. package/views/3d/layers/support/Tiles3DLayerViewRegistration.js +1 -1
  179. package/views/3d/layers/support/selectTiles3DSpatialReference.js +1 -1
  180. package/views/3d/layers/support/uvUtils.js +1 -1
  181. package/views/3d/state/Constraints.js +1 -1
  182. package/views/3d/state/ConstraintsManager.js +1 -1
  183. package/views/3d/state/NearFarHeuristic.js +1 -1
  184. package/views/3d/state/ViewState.js +1 -1
  185. package/views/3d/state/ViewStateManager.js +1 -1
  186. package/views/3d/state/controllers/PinchAndPanControllerGlobal.js +1 -1
  187. package/views/3d/state/controllers/PinchAndPanControllerLocal.js +1 -1
  188. package/views/3d/state/controllers/PointToPointAnimationController.js +1 -1
  189. package/views/3d/state/controllers/ZoomStepControllerGlobal.js +1 -1
  190. package/views/3d/state/controllers/ZoomStepControllerLocal.js +1 -1
  191. package/views/3d/state/helpers/SceneIntersectionHelper.js +1 -1
  192. package/views/3d/state/utils/OffsetCorrectionController.js +1 -1
  193. package/views/3d/state/utils/groundNavigationUtils.js +1 -1
  194. package/views/3d/state/utils/navigationUtils.js +1 -1
  195. package/views/3d/support/FrustumExtentIntersection.js +1 -1
  196. package/views/3d/support/RenderCoordsHelper.js +1 -1
  197. package/views/3d/support/SweptSphereVolume.js +1 -1
  198. package/views/3d/support/cameraUtils.js +1 -1
  199. package/views/3d/support/elevationUpdateExtentUtils.js +1 -1
  200. package/views/3d/support/engineContent/line.js +1 -1
  201. package/views/3d/support/engineContent/marker.js +1 -1
  202. package/views/3d/support/hitTest.js +1 -1
  203. package/views/3d/support/orientedBoundingBox.js +1 -1
  204. package/views/3d/support/pointsOfInterest/CameraOnSurface.js +1 -1
  205. package/views/3d/support/pointsOfInterest/PointsOfInterest.js +1 -1
  206. package/views/3d/support/pointsOfInterest/SurfaceGeometryUpdates.js +1 -1
  207. package/views/3d/support/sunUtils.js +1 -1
  208. package/views/3d/terrain/ExtentHelper.js +1 -1
  209. package/views/3d/terrain/OverlayManager.js +1 -1
  210. package/views/3d/terrain/OverlayRenderer.js +1 -1
  211. package/views/3d/terrain/PatchGeometryFactory.js +1 -1
  212. package/views/3d/terrain/TerrainRenderer.js +1 -1
  213. package/views/3d/terrain/TerrainSurface.js +1 -1
  214. package/views/3d/terrain/Tile.js +1 -1
  215. package/views/3d/terrain/TilingSchemeLogic.js +1 -1
  216. package/views/3d/terrain/terrainUtils.js +1 -1
  217. package/views/3d/webgl/RenderCamera.js +1 -1
  218. package/views/3d/webgl-engine/Stage.js +1 -1
  219. package/views/3d/webgl-engine/collections/Component/ComponentObject.js +1 -1
  220. package/views/3d/webgl-engine/collections/Component/ComponentObjectCollection.js +1 -1
  221. package/views/3d/webgl-engine/collections/Component/ComponentObjectElevationAgnosticBVH.js +1 -1
  222. package/views/3d/webgl-engine/collections/Component/ComponentObjectElevationAgnosticComponentGeometryBVH.js +1 -1
  223. package/views/3d/webgl-engine/collections/Component/ElevationAgnosticBVH.js +1 -1
  224. package/views/3d/webgl-engine/collections/Component/IntersectionGeometry.js +1 -1
  225. package/views/3d/webgl-engine/collections/Component/Material/ComponentMaterial.js +1 -1
  226. package/views/3d/webgl-engine/collections/Component/Material/ComponentMaterialRepository.js +1 -1
  227. package/views/3d/webgl-engine/collections/Component/Material/ComponentTechniqueConfiguration.js +1 -1
  228. package/views/3d/webgl-engine/core/shaderLibrary/terrain/Overlay.glsl.js +1 -1
  229. package/views/3d/webgl-engine/effects/atmosphere/MarsAtmosphere.js +1 -1
  230. package/views/3d/webgl-engine/effects/debug/RenderNodeVisualizerNode.js +1 -1
  231. package/views/3d/webgl-engine/effects/highlight/ShadowHighlight.js +1 -1
  232. package/views/3d/webgl-engine/effects/laserlines/LaserlinePathData.js +1 -1
  233. package/views/3d/webgl-engine/effects/shadowAccumulation/ShadowAccumulator.js +1 -1
  234. package/views/3d/webgl-engine/lib/Intersector.js +1 -1
  235. package/views/3d/webgl-engine/lib/Renderer.js +1 -1
  236. package/views/3d/webgl-engine/lib/ShadowMap.js +1 -1
  237. package/views/3d/webgl-engine/lib/TextRenderParameters.js +1 -1
  238. package/views/3d/webgl-engine/lib/TextRenderer.js +1 -1
  239. package/views/3d/webgl-engine/lib/TriangleIntersectionData.js +1 -1
  240. package/views/3d/webgl-engine/lib/edgeRendering/EdgeView.js +1 -1
  241. package/views/3d/webgl-engine/lib/edgeRendering/strokes.js +1 -1
  242. package/views/3d/webgl-engine/lib/verticalOffsetUtils.js +1 -1
  243. package/views/3d/webgl-engine/materials/DefaultMaterial.js +1 -1
  244. package/views/3d/webgl-engine/materials/PolygonOffset.js +1 -1
  245. package/views/3d/webgl-engine/materials/RibbonLineMaterial.js +1 -1
  246. package/views/3d/webgl-engine/parts/RenderView.js +1 -1
  247. package/views/MapView.d.ts +1 -0
  248. package/views/SceneView.js +1 -1
  249. package/views/View2D.js +1 -1
  250. package/views/ViewingMode.js +1 -1
  251. package/views/analysis/ElevationProfile/elevationProfileChartBoundsUtils.js +1 -1
  252. package/views/analysis/ElevationProfile/elevationProfileGeometryUtils.js +1 -1
  253. package/views/draw/DrawAction.js +1 -1
  254. package/views/draw/DrawOperation.js +1 -1
  255. package/views/draw/DrawTool.js +1 -1
  256. package/views/draw/SegmentDrawAction.js +1 -1
  257. package/views/draw/support/Reshape.js +1 -1
  258. package/views/draw/support/helpMessageUtils.js +1 -1
  259. package/views/draw/support/managers/EditSessionManager.js +1 -1
  260. package/views/interactive/dragEventPipeline.js +1 -1
  261. package/views/interactive/editGeometry/EditGeometry.js +1 -1
  262. package/views/interactive/editGeometry/EditGeometryOperations.js +1 -1
  263. package/views/interactive/editGeometry/operations/AddOrUpdatePart.js +1 -1
  264. package/views/layers/support/editableLayerViews.js +1 -1
  265. package/views/overlay/TextOverlayItem.js +1 -1
  266. package/views/support/DefaultsFromMap.js +1 -1
  267. package/views/support/Scheduler.js +1 -1
  268. package/views/support/spatialReferenceSupport.js +1 -1
  269. package/views/webgl/ShaderTranspiler.js +2 -2
  270. package/widgets/AreaMeasurement2D/AreaMeasurement2DTool.js +1 -1
  271. package/widgets/BasemapGallery/support/basemapCompatibilityUtils.js +1 -1
  272. package/widgets/BatchAttributeForm.js +1 -1
  273. package/widgets/DistanceMeasurement2D/DistanceMeasurement2DTool.js +1 -1
  274. package/widgets/Editor/workflowUtils.js +1 -1
  275. package/widgets/ElevationProfile/ElevationProfileLineView.js +1 -1
  276. package/widgets/ElevationProfile/support/chartUtils.js +1 -1
  277. package/widgets/ElevationProfile/support/geometryUtils.js +1 -1
  278. package/widgets/FeatureForm.js +1 -1
  279. package/widgets/Legend/styles/card/ColorRamp.js +1 -1
  280. package/widgets/Legend/support/ActiveLayerInfo.js +1 -1
  281. package/widgets/Measurement.js +1 -1
  282. package/widgets/OrientedImageryViewer/components/ImageLocationWidget.js +1 -1
  283. package/widgets/OrientedImageryViewer/components/ImageMeasurementWidget.js +1 -1
  284. package/widgets/Search/support/layerSearchUtils.js +1 -1
  285. package/widgets/ShadowCast/ShadowCastViewModel.js +1 -1
  286. package/widgets/UtilityNetworkAssociations/UtilityNetworkAssociationsViewModel.js +1 -1
  287. package/widgets/UtilityNetworkAssociations.js +1 -1
  288. package/widgets/Weather/WeatherViewModel.js +1 -1
  289. package/widgets/Weather/css.js +1 -1
  290. package/widgets/Weather.js +1 -1
  291. package/assets/esri/core/workers/chunks/021bd07b9a3e70598840.js +0 -1
  292. package/assets/esri/core/workers/chunks/170e68624b71ac96de4a.js +0 -1
  293. package/assets/esri/core/workers/chunks/8a820e303941b351de81.js +0 -1
  294. package/assets/esri/core/workers/chunks/90d567e920b6982b402d.js +0 -1
  295. package/assets/esri/core/workers/chunks/97cdcedfe853280f6258.js +0 -1
  296. package/assets/esri/core/workers/chunks/9ebc6026934400fc1e1f.js +0 -1
  297. package/assets/esri/core/workers/chunks/b4a325dcf50e276751d7.js +0 -1
  298. package/assets/esri/core/workers/chunks/be5857b0d1b00faf430b.js +0 -1
  299. package/assets/esri/core/workers/chunks/cd9100a7c8309dfa7569.js +0 -1
  300. package/assets/esri/core/workers/chunks/e58f51618251f74aaafd.js +0 -1
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{Evented as e}from"../../../core/Evented.js";import{makeHandle as t}from"../../../core/handleUtils.js";import{clone as n}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{isMeshEditGeometry as r,Part as i,EditGeometry as a,haveCompatibleTopologies as o}from"./EditGeometry.js";import{AppendVertex as s}from"./operations/AppendVertex.js";import{UpdateVertices as c}from"./operations/UpdateVertices.js";import{RemoveVertices as l}from"./operations/RemoveVertices.js";import{SplitSegment as u}from"./operations/SplitSegment.js";import{SetVertexPosition as d}from"./operations/SetVertexPosition.js";import{ClosePart as f}from"./operations/ClosePart.js";import{AddOrUpdatePart as p}from"./operations/AddOrUpdatePart.js";import{MoveMesh as m}from"./operations/MoveMesh.js";import{MoveVertex as h}from"./operations/MoveVertex.js";import{OffsetEdgeVertex as g}from"./operations/OffsetEdgeVertex.js";import{RotateVertex as _}from"./operations/RotateVertex.js";import{ScaleVertex as v}from"./operations/ScaleVertex.js";import{SetAllVertexPositions as y}from"./operations/SetAllVertexPositions.js";import{UndoGroup as b}from"./operations/UndoGroup.js";class x extends e{constructor(e,t,n=!1){super(),this.data=e,this.viewingMode=t,this.allowCurves=n,this._undoStack=[],this._redoStack=[],this.disableDefaultRedoBehavior=!1,this._listener=this.data.on(`change`,e=>{e.addedVertices&&this.emit(`vertex-add`,{type:`vertex-add`,vertices:e.addedVertices,operation:e.operation}),e.removedVertices&&this.emit(`vertex-remove`,{type:`vertex-remove`,vertices:e.removedVertices,operation:e.operation}),e.updatedVertices&&this.emit(`vertex-update`,{type:`vertex-update`,vertices:e.updatedVertices,operation:e.operation})})}destroy(){super.destroy(),this._listener.remove()}splitSegment(e,t){return this._apply(new u(this.data,e,t))}updateVertices(e,t,n=1){return this._apply(new c(this.data,e,t),n)}move(e,t,n,i=1){return r(this.data)?this._apply(new m(this.data,e,t,n),i):this.moveVertices(this.data.allVerticesUnordered,e,t,n,i)}moveVertices(e,t,n,i,a=1){return r(this.data)?this._apply(new m(this.data,t,n,i),a):this.updateVertices(e,new h(this.data.coordinateHelper,t,n,i),a)}scale(e,t,n,r,i=1,a=0){return this.scaleVertices(this.data.allVerticesUnordered,e,t,n,r,i,a)}scaleVertices(e,t,n,r,i,a=1,o=0){return this.updateVertices(e,new v(t,n,r,i,o),a)}rotate(e,t,n=1,r=0){return this.rotateVertices(this.data.allVerticesUnordered,e,t,n,r)}rotateVertices(e,t,n,r=1,i=0){return this.updateVertices(e,new _(t,n,i),r)}removeVertices(e){return this._apply(new l(this.data,e,this._minNumVerticesPerType))}appendVertex(e,t,n){return t??=new i(this.data.spatialReference,this.viewingMode,n),this._apply(new s(this.data,t,e))}appendVertexToFirstPart(e){let t=this.data.parts.at(0);return t?this._apply(new s(this.data,t,e)):null}addOrUpdatePart(e,t){return this._apply(new p(this.data,e,t,this.viewingMode))}setVertexPosition(e,t){return this._apply(new d(this.data,e,t))}offsetEdge(e,t,n,r=1){return this.updateVertices([t.leftVertex,t.rightVertex],new g(this.data.coordinateHelper,e,t,n),r)}trySetGeometry(e,t=1){let{data:n}=this,{coordinateHelper:i}=n;if(n.type!==e.type||!n.spatialReference.equals(e.spatialReference)||i.hasZ()!==e.hasZ||i.hasM()!==e.hasM||r(n))return;let s=a.fromGeometry(e,this.viewingMode,{allowCurves:this.allowCurves});if(o(n,s))return this.overwriteGeometryDataInPlace(s,t)}overwriteGeometryDataInPlace(e,t=1){return this._apply(new y(this.data,e),t)}createResetState(){if(r(this.data))return this._createResetStateMesh();let e=this.data.geometry.clone();return t(()=>this.trySetGeometry(e))}closePart(e){return this.data.parts.includes(e)?this._apply(new f(this.data,e)):null}canRemoveVertex(e){return e.vertices.length>this._minNumVerticesPerType}createUndoGroup(){let e=new b;return this._apply(e),t(()=>e.close())}groupOperations(e){let t=[],{_undoStack:n}=this;for(;n.length>0;){let r=n.at(-1);if(!r||!e(r))break;n.pop(),t.push(r)}if(t.length>0){let e=new b(t.reverse());return this.recordUndo(e,!0),{group:e,operations:t}}return null}recordUndo(e,t){let n=this.canUndo;this._undoStack.push(e),t&&this.resetRedoStack(),this.emit(`can-redo-change`,{type:`can-redo-change`,canRedo:this.canRedo}),n!==this.canUndo&&this.emit(`can-undo-change`,{type:`can-undo-change`,canUndo:this.canUndo})}recordRedo(e){if(this.disableDefaultRedoBehavior)return;let t=this.canRedo;this._redoStack.push(e),t||this.emit(`can-redo-change`,{type:`can-redo-change`,canRedo:!0})}undo(){if(this._undoStack.length>0){let e=this.canUndo,t=this._undoStack.pop();return t.undo(),this.recordRedo(t),e!==this.canUndo&&this.emit(`can-undo-change`,{type:`can-undo-change`,canUndo:this.canUndo}),t}return null}redo(){if(this._redoStack.length>0){let e=this._redoStack.pop();return e.apply(),this.recordUndo(e,!1),e}return null}resetRedoStack(){this.disableDefaultRedoBehavior||(this._redoStack=[],this.emit(`redo-reset`,{type:`redo-reset`}))}undoHas(e){return this._undoStack.includes(e)}get canUndo(){return this._undoStack.length>0}get canRedo(){return this._redoStack.length>0}get lastOperation(){return this._undoStack.length>0?this._undoStack[this._undoStack.length-1]:null}get nextOperation(){return this._redoStack.length>0?this._redoStack[this._redoStack.length-1]:null}get test(){return{undoLength:this._undoStack.length,redoLength:this._redoStack.length}}get _minNumVerticesPerType(){switch(this.data.type){case`point`:return 1;case`polyline`:return 2;case`polygon`:return 3;default:return 0}}_apply(e,t=1){return t!==0&&this.lastOperation?.accumulate(e)||(e.apply(),this.recordUndo(e,!0)),e}_createResetStateMesh(){if(!r(this.data))return t();let e=this.data.geometry,{vertexSpace:i}=e;if(i.origin){let r=n(i.origin);return t(()=>{e.vertexSpace.origin=r})}let a=e.vertexAttributes.clonePositional();return t(()=>{e.vertexAttributes=a,e.vertexAttributesChanged()})}static fromGeometry(e,t,n){return new x(a.fromGeometry(e,t,n),t,n?.allowCurves)}}export{x as EditGeometryOperations};
2
+ import{Evented as e}from"../../../core/Evented.js";import{makeHandle as t}from"../../../core/handleUtils.js";import{clone as n}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{isMeshEditGeometry as r,Part as i,EditGeometry as a,haveCompatibleTopologies as o}from"./EditGeometry.js";import{AppendVertex as s}from"./operations/AppendVertex.js";import{UpdateVertices as c}from"./operations/UpdateVertices.js";import{RemoveVertices as l}from"./operations/RemoveVertices.js";import{SplitSegment as u}from"./operations/SplitSegment.js";import{SetVertexPosition as d}from"./operations/SetVertexPosition.js";import{ClosePart as f}from"./operations/ClosePart.js";import{AddOrUpdatePart as p}from"./operations/AddOrUpdatePart.js";import{MoveMesh as m}from"./operations/MoveMesh.js";import{MoveVertex as h}from"./operations/MoveVertex.js";import{OffsetEdgeVertex as g}from"./operations/OffsetEdgeVertex.js";import{RotateVertex as _}from"./operations/RotateVertex.js";import{ScaleVertex as v}from"./operations/ScaleVertex.js";import{SetAllVertexPositions as y}from"./operations/SetAllVertexPositions.js";import{UndoGroup as b}from"./operations/UndoGroup.js";class x extends e{constructor(e,t,n=!1){super(),this.data=e,this.isGlobal=t,this.allowCurves=n,this._undoStack=[],this._redoStack=[],this.disableDefaultRedoBehavior=!1,this._listener=this.data.on(`change`,e=>{e.addedVertices&&this.emit(`vertex-add`,{type:`vertex-add`,vertices:e.addedVertices,operation:e.operation}),e.removedVertices&&this.emit(`vertex-remove`,{type:`vertex-remove`,vertices:e.removedVertices,operation:e.operation}),e.updatedVertices&&this.emit(`vertex-update`,{type:`vertex-update`,vertices:e.updatedVertices,operation:e.operation})})}destroy(){super.destroy(),this._listener.remove()}splitSegment(e,t){return this._apply(new u(this.data,e,t))}updateVertices(e,t,n=1){return this._apply(new c(this.data,e,t),n)}move(e,t,n,i=1){return r(this.data)?this._apply(new m(this.data,e,t,n),i):this.moveVertices(this.data.allVerticesUnordered,e,t,n,i)}moveVertices(e,t,n,i,a=1){return r(this.data)?this._apply(new m(this.data,t,n,i),a):this.updateVertices(e,new h(this.data.coordinateHelper,t,n,i),a)}scale(e,t,n,r,i=1,a=0){return this.scaleVertices(this.data.allVerticesUnordered,e,t,n,r,i,a)}scaleVertices(e,t,n,r,i,a=1,o=0){return this.updateVertices(e,new v(t,n,r,i,o),a)}rotate(e,t,n=1,r=0){return this.rotateVertices(this.data.allVerticesUnordered,e,t,n,r)}rotateVertices(e,t,n,r=1,i=0){return this.updateVertices(e,new _(t,n,i),r)}removeVertices(e){return this._apply(new l(this.data,e,this._minNumVerticesPerType))}appendVertex(e,t,n){return t??=new i(this.data.spatialReference,this.isGlobal,n),this._apply(new s(this.data,t,e))}appendVertexToFirstPart(e){let t=this.data.parts.at(0);return t?this._apply(new s(this.data,t,e)):null}addOrUpdatePart(e,t){return this._apply(new p(this.data,e,t,this.isGlobal))}setVertexPosition(e,t){return this._apply(new d(this.data,e,t))}offsetEdge(e,t,n,r=1){return this.updateVertices([t.leftVertex,t.rightVertex],new g(this.data.coordinateHelper,e,t,n),r)}trySetGeometry(e,t=1){let{data:n}=this,{coordinateHelper:i}=n;if(n.type!==e.type||!n.spatialReference.equals(e.spatialReference)||i.hasZ()!==e.hasZ||i.hasM()!==e.hasM||r(n))return;let s=a.fromGeometry(e,this.isGlobal,{allowCurves:this.allowCurves});if(o(n,s))return this.overwriteGeometryDataInPlace(s,t)}overwriteGeometryDataInPlace(e,t=1){return this._apply(new y(this.data,e),t)}createResetState(){if(r(this.data))return this._createResetStateMesh();let e=this.data.geometry.clone();return t(()=>this.trySetGeometry(e))}closePart(e){return this.data.parts.includes(e)?this._apply(new f(this.data,e)):null}canRemoveVertex(e){return e.vertices.length>this._minNumVerticesPerType}createUndoGroup(){let e=new b;return this._apply(e),t(()=>e.close())}groupOperations(e){let t=[],{_undoStack:n}=this;for(;n.length>0;){let r=n.at(-1);if(!r||!e(r))break;n.pop(),t.push(r)}if(t.length>0){let e=new b(t.reverse());return this.recordUndo(e,!0),{group:e,operations:t}}return null}recordUndo(e,t){let n=this.canUndo;this._undoStack.push(e),t&&this.resetRedoStack(),this.emit(`can-redo-change`,{type:`can-redo-change`,canRedo:this.canRedo}),n!==this.canUndo&&this.emit(`can-undo-change`,{type:`can-undo-change`,canUndo:this.canUndo})}recordRedo(e){if(this.disableDefaultRedoBehavior)return;let t=this.canRedo;this._redoStack.push(e),t||this.emit(`can-redo-change`,{type:`can-redo-change`,canRedo:!0})}undo(){if(this._undoStack.length>0){let e=this.canUndo,t=this._undoStack.pop();return t.undo(),this.recordRedo(t),e!==this.canUndo&&this.emit(`can-undo-change`,{type:`can-undo-change`,canUndo:this.canUndo}),t}return null}redo(){if(this._redoStack.length>0){let e=this._redoStack.pop();return e.apply(),this.recordUndo(e,!1),e}return null}resetRedoStack(){this.disableDefaultRedoBehavior||(this._redoStack=[],this.emit(`redo-reset`,{type:`redo-reset`}))}undoHas(e){return this._undoStack.includes(e)}get canUndo(){return this._undoStack.length>0}get canRedo(){return this._redoStack.length>0}get lastOperation(){return this._undoStack.length>0?this._undoStack[this._undoStack.length-1]:null}get nextOperation(){return this._redoStack.length>0?this._redoStack[this._redoStack.length-1]:null}get test(){return{undoLength:this._undoStack.length,redoLength:this._redoStack.length}}get _minNumVerticesPerType(){switch(this.data.type){case`point`:return 1;case`polyline`:return 2;case`polygon`:return 3;default:return 0}}_apply(e,t=1){return t!==0&&this.lastOperation?.accumulate(e)||(e.apply(),this.recordUndo(e,!0)),e}_createResetStateMesh(){if(!r(this.data))return t();let e=this.data.geometry,{vertexSpace:i}=e;if(i.origin){let r=n(i.origin);return t(()=>{e.vertexSpace.origin=r})}let a=e.vertexAttributes.clonePositional();return t(()=>{e.vertexAttributes=a,e.vertexAttributesChanged()})}static fromGeometry(e,t,n){return new x(a.fromGeometry(e,t,n),t,n?.allowCurves)}}export{x as EditGeometryOperations};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{toPartialCoords as e,Part as t,addVertexAndConnectingSegment as n}from"../EditGeometry.js";class r{constructor(e,t,n,r){this._editGeometry=e,this._positions=t,this._part=n,this._viewingMode=r,this._addedPart=null,this._originalPositions=null,this._hasApplied=!1}get part(){return this._addedPart}apply(){let r=this._editGeometry,i=r.parts,a=this._part;if(!this._hasApplied&&a&&i.includes(a)){let t=a.getFirstVertex(),n=a.getLastVertex();this._originalPositions=e(r,{startingVertex:t,endingVertexInclusive:n}).parts[0]}let o=this._addedPart??this._part??(this._addedPart=new t(r.spatialReference,this._viewingMode,r.type===`polygon`));i.includes(o)||(i.push(o),o.index=i.length-1);let s=o.vertices.slice(),c=[];o.segments.length=0,o.vertices.length=0;let l=null;for(let e of this._positions)l=n(o,r.coordinateHelper,l,e),c.push(l);this._hasApplied=!0,r.notifyChanges({operation:this._hasApplied?`redo`:`apply`,addedVertices:c,removedVertices:s,addedParts:this._addedPart?[this._addedPart]:void 0})}undo(){if(!this._hasApplied)return;let{_editGeometry:e,_addedPart:t}=this;if(t){let n=e.parts.indexOf(t);if(n!==-1){e.parts.splice(n,1),e.notifyChanges({operation:`undo`,removedVertices:t.vertices.slice(),removedParts:[t]});return}}let r=this._part;if(!r||!e.parts.includes(r)||!this._originalPositions)return;let i=Array.from(r.iterateVertices()),a=[];r.vertices.length=0,r.segments.length=0;let o=null;for(let t of this._positions)o=n(r,e.coordinateHelper,o,t),a.push(o);e.notifyChanges({operation:`undo`,addedVertices:a,removedVertices:i})}accumulate(e){return e instanceof r&&e._part!=null&&(e._part===this._addedPart||e._part===this._part)&&(this._positions=e._positions,this.apply(),!0)}}export{r as AddOrUpdatePart};
2
+ import{toPartialCoords as e,Part as t,addVertexAndConnectingSegment as n}from"../EditGeometry.js";class r{constructor(e,t,n,r){this._editGeometry=e,this._positions=t,this._part=n,this._isGlobal=r,this._addedPart=null,this._originalPositions=null,this._hasApplied=!1}get part(){return this._addedPart}apply(){let r=this._editGeometry,i=r.parts,a=this._part;if(!this._hasApplied&&a&&i.includes(a)){let t=a.getFirstVertex(),n=a.getLastVertex();this._originalPositions=e(r,{startingVertex:t,endingVertexInclusive:n}).parts[0]}let o=this._addedPart??this._part??(this._addedPart=new t(r.spatialReference,this._isGlobal,r.type===`polygon`));i.includes(o)||(i.push(o),o.index=i.length-1);let s=o.vertices.slice(),c=[];o.segments.length=0,o.vertices.length=0;let l=null;for(let e of this._positions)l=n(o,r.coordinateHelper,l,e),c.push(l);this._hasApplied=!0,r.notifyChanges({operation:this._hasApplied?`redo`:`apply`,addedVertices:c,removedVertices:s,addedParts:this._addedPart?[this._addedPart]:void 0})}undo(){if(!this._hasApplied)return;let{_editGeometry:e,_addedPart:t}=this;if(t){let n=e.parts.indexOf(t);if(n!==-1){e.parts.splice(n,1),e.notifyChanges({operation:`undo`,removedVertices:t.vertices.slice(),removedParts:[t]});return}}let r=this._part;if(!r||!e.parts.includes(r)||!this._originalPositions)return;let i=Array.from(r.iterateVertices()),a=[];r.vertices.length=0,r.segments.length=0;let o=null;for(let t of this._positions)o=n(r,e.coordinateHelper,o,t),a.push(o);e.notifyChanges({operation:`undo`,addedVertices:a,removedVertices:i})}accumulate(e){return e instanceof r&&e._part!=null&&(e._part===this._addedPart||e._part===this._part)&&(this._positions=e._positions,this.apply(),!0)}}export{r as AddOrUpdatePart};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import e from"../../../core/Logger.js";import{equals as t,isGeographic as n,isWebMercator as r,isWGS84 as i}from"../../../geometry/support/spatialReferenceUtils.js";import{getGlbFormatId as a}from"../../../layers/support/infoFor3D.js";const o=`esri.views.layers.support.editableLayerViews`;function s(s,c){let{associatedLayer:l}=s,u=l?.infoFor3D;if(!u)return!1;let d=a(u);if(!(d!=null&&u.queryFormats.includes(d)))return e.getLogger(o).warnOnce(`SceneLayer (${s.title??`Untitled layer`}, ${s.id}) does not support geometry edits because it does not support GLB queries.`),!1;let f=s.spatialReference,p=l.spatialReference;if(!t(f,p))return e.getLogger(o).warnOnce(`SceneLayer (${s.title??`Untitled layer`}, ${s.id}) does not support geometry edits because its spatial reference (wkid:${f.wkid}) is different from its associated FeatureLayer's spatial reference (wkid:${p.wkid}).`),!1;let m=l.sourceJSON?.sourceSpatialReference;if(!(m==null||t(m,p)))return e.getLogger(o).warnOnce(`SceneLayer (${s.title??`Untitled layer`}, ${s.id}) does not support geometry edits because the spatial reference of its associated FeatureLayer's service (wkid:${p.wkid}) is different from its source spatial reference (wkid:${m.wkid}).`),!1;let{view:h}=c;if(c.destroyed||h==null)return!1;let g=h.spatialReference,{viewingMode:_}=h.state,v=n(f),y=_===1;return v&&!y?(e.getLogger(o).warnOnce(`SceneLayer (${s.title??`Untitled layer`}, ${s.id}) does not support geometry edits in local viewing mode because its spatial reference (wkid:${f.wkid}) is geographic. Please consider changing the viewing mode to global.`),!1):!v&&y?(e.getLogger(o).warnOnce(`SceneLayer (${s.title??`Untitled layer`}, ${s.id}) does not support geometry edits in global viewing mode because its spatial reference (wkid:${f.wkid}) is projected. Please consider changing the viewing mode to local.`),!1):t(f,g)||y&&r(g)&&i(f)?!0:(e.getLogger(o).warnOnce(`SceneLayer (${s.title??`Untitled layer`}, ${s.id}) does not support geometry edits because its spatial reference (wkid:${f.wkid}) does not match the view spatial reference (wkid:${g.wkid}).`),!1)}export{s as isGeometryEditableSceneLayer};
2
+ import e from"../../../core/Logger.js";import{equals as t,isGeographic as n,isWebMercator as r,isWGS84 as i}from"../../../geometry/support/spatialReferenceUtils.js";import{getGlbFormatId as a}from"../../../layers/support/infoFor3D.js";const o=`esri.views.layers.support.editableLayerViews`;function s(s,c){let{associatedLayer:l}=s,u=l?.infoFor3D;if(!u)return!1;let d=a(u);if(!(d!=null&&u.queryFormats.includes(d)))return e.getLogger(o).warnOnce(`SceneLayer (${s.title??`Untitled layer`}, ${s.id}) does not support geometry edits because it does not support GLB queries.`),!1;let f=s.spatialReference,p=l.spatialReference;if(!t(f,p))return e.getLogger(o).warnOnce(`SceneLayer (${s.title??`Untitled layer`}, ${s.id}) does not support geometry edits because its spatial reference (wkid:${f.wkid}) is different from its associated FeatureLayer's spatial reference (wkid:${p.wkid}).`),!1;let m=l.sourceJSON?.sourceSpatialReference;if(!(m==null||t(m,p)))return e.getLogger(o).warnOnce(`SceneLayer (${s.title??`Untitled layer`}, ${s.id}) does not support geometry edits because the spatial reference of its associated FeatureLayer's service (wkid:${p.wkid}) is different from its source spatial reference (wkid:${m.wkid}).`),!1;let{view:h}=c;if(c.destroyed||h==null)return!1;let g=h.spatialReference,{isGlobal:_}=h.state,v=n(f);return v&&!_?(e.getLogger(o).warnOnce(`SceneLayer (${s.title??`Untitled layer`}, ${s.id}) does not support geometry edits in local viewing mode because its spatial reference (wkid:${f.wkid}) is geographic. Please consider changing the viewing mode to global.`),!1):!v&&_?(e.getLogger(o).warnOnce(`SceneLayer (${s.title??`Untitled layer`}, ${s.id}) does not support geometry edits in global viewing mode because its spatial reference (wkid:${f.wkid}) is projected. Please consider changing the viewing mode to local.`),!1):t(f,g)||_&&r(g)&&i(f)?!0:(e.getLogger(o).warnOnce(`SceneLayer (${s.title??`Untitled layer`}, ${s.id}) does not support geometry edits because its spatial reference (wkid:${f.wkid}) does not match the view spatial reference (wkid:${g.wkid}).`),!1)}export{s as isGeometryEditableSceneLayer};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import"../../chunks/projector.js";import{h as t}from"../../chunks/h.js";import n from"../../Color.js";import r from"../../core/Accessor.js";import{property as i,subclass as a}from"../../core/accessorSupport/decorators.js";const o={bottom:`esri-text-overlay-item-anchor-bottom`,"bottom-right":`esri-text-overlay-item-anchor-bottom-right`,"bottom-left":`esri-text-overlay-item-anchor-bottom-left`,top:`esri-text-overlay-item-anchor-top`,"top-right":`esri-text-overlay-item-anchor-top-right`,"top-left":`esri-text-overlay-item-anchor-top-left`,center:`esri-text-overlay-item-anchor-center`,right:`esri-text-overlay-item-anchor-right`,left:`esri-text-overlay-item-anchor-left`};let s=class extends r{get position(){return[this.x,this.y]}set position(e){this._set(`x`,e[0]),this._set(`y`,e[1])}set visible(e){this._visible=e}get visible(){return this._visible&&!!this.text}get _textShadowColor(){let{textColor:e,backgroundColor:t}=this,n=t.clone();return n.a*=e.a,n}get _textShadow(){let e=this._textShadowColor.toCss(!0);return`0 0 ${this._textShadowSize}px ${e}`}get padding(){return .5*this.fontSize}get borderRadius(){return this.padding}set borderRadius(e){this._overrideIfSome(`borderRadius`,e)}constructor(e){super(e),this.x=0,this.y=0,this.text=`-`,this.fontSize=14,this.anchor=`center`,this._visible=!0,this.isDecoration=!0,this.backgroundColor=new n([0,0,0,.6]),this.textColor=new n([255,255,255]),this._textShadowSize=1}render(){return t(`div`,{classes:this._cssClasses(),styles:{left:Math.floor(this.x)+`px`,top:Math.floor(this.y)+`px`,visibility:this.visible?`visible`:`hidden`,fontSize:this.fontSize+`px`,lineHeight:this.fontSize+`px`,backgroundColor:this.backgroundColor.toCss(!0),color:this.textColor.toCss(!0),padding:this.padding+`px`,borderRadius:this.borderRadius+`px`,textShadow:this._textShadow}},[this.text])}renderCanvas(e){if(!this.visible)return;let t=e.font.replace(/^(.*?)px/,``);e.font=`${this.fontSize}px ${t}`;let{padding:n,borderRadius:r}=this,i=e.measureText(this.text).width,a=this.text===``?0:this.fontSize,o=c[this.anchor];e.textAlign=`center`,e.textBaseline=`middle`;let s=i+2*n,l=a+2*n,u=this.x+o.x*s,d=this.y+o.y*l;this._roundedRect(e,u,d,s,l,r),e.fillStyle=this.backgroundColor.toCss(!0),e.fill();let f=this.x+(o.x+.5)*s,p=this.y+(o.y+.5)*l;this._renderTextShadow(e,this.text,f,p),e.fillStyle=this.textColor.toCss(!0),e.fillText(this.text,f,p)}_renderTextShadow(e,t,n,r){e.lineJoin=`miter`,e.fillStyle=`rgba(${this._textShadowColor.r}, ${this._textShadowColor.g}, ${this._textShadowColor.b}, ${1/l.length})`;let i=this._textShadowSize;for(let[a,o]of l)e.fillText(t,n+i*a,r+i*o)}_roundedRect(e,t,n,r,i,a){a=Math.min(a,i/2,r/2),e.beginPath(),e.moveTo(t,n+a),e.arcTo(t,n,t+a,n,a),e.lineTo(t+r-a,n),e.arcTo(t+r,n,t+r,n+a,a),e.lineTo(t+r,n+i-a),e.arcTo(t+r,n+i,t+r-a,n+i,a),e.lineTo(t+a,n+i),e.arcTo(t,n+i,t,n+i-a,a),e.closePath()}_cssClasses(){let e={"esri-text-overlay-item":!0},t;for(t in o)e[o[t]]=this.anchor===t;return e}};e([i()],s.prototype,`x`,void 0),e([i()],s.prototype,`y`,void 0),e([i()],s.prototype,`position`,null),e([i()],s.prototype,`text`,void 0),e([i()],s.prototype,`fontSize`,void 0),e([i()],s.prototype,`anchor`,void 0),e([i()],s.prototype,`_visible`,void 0),e([i()],s.prototype,`visible`,null),e([i()],s.prototype,`isDecoration`,void 0),e([i()],s.prototype,`backgroundColor`,void 0),e([i()],s.prototype,`textColor`,void 0),e([i()],s.prototype,`_textShadowSize`,void 0),e([i()],s.prototype,`_textShadowColor`,null),e([i()],s.prototype,`_textShadow`,null),e([i()],s.prototype,`padding`,null),e([i()],s.prototype,`borderRadius`,null),s=e([a(`esri.views.overlay.TextOverlayItem`)],s);const c={bottom:{x:-.5,y:-1,textAlign:`center`,textBaseline:`bottom`},"bottom-left":{x:0,y:-1,textAlign:`left`,textBaseline:`bottom`},"bottom-right":{x:-1,y:-1,textAlign:`right`,textBaseline:`bottom`},center:{x:-.5,y:-.5,textAlign:`center`,textBaseline:`middle`},left:{x:0,y:-.5,textAlign:`left`,textBaseline:`middle`},right:{x:-1,y:-.5,textAlign:`right`,textBaseline:`middle`},top:{x:-.5,y:0,textAlign:`center`,textBaseline:`top`},"top-left":{x:0,y:0,textAlign:`left`,textBaseline:`top`},"top-right":{x:-1,y:0,textAlign:`right`,textBaseline:`top`}},l=[];for(let e=0;e<360;e+=360/16)l.push([Math.cos(Math.PI*e/180),Math.sin(Math.PI*e/180)]);export{s as default};
2
+ import{__decorate as e}from"tslib";import"../../chunks/projector.js";import{h as t}from"../../chunks/h.js";import n from"../../Color.js";import r from"../../core/Accessor.js";import{property as i,subclass as a}from"../../core/accessorSupport/decorators.js";const o={bottom:`esri-text-overlay-item-anchor-bottom`,"bottom-right":`esri-text-overlay-item-anchor-bottom-right`,"bottom-left":`esri-text-overlay-item-anchor-bottom-left`,top:`esri-text-overlay-item-anchor-top`,"top-right":`esri-text-overlay-item-anchor-top-right`,"top-left":`esri-text-overlay-item-anchor-top-left`,center:`esri-text-overlay-item-anchor-center`,right:`esri-text-overlay-item-anchor-right`,left:`esri-text-overlay-item-anchor-left`};let s=class extends r{get position(){return[this.x,this.y]}set position(e){this._set(`x`,e[0]),this._set(`y`,e[1])}set visible(e){this._visible=e}get visible(){return this._visible&&!!this.text}get _textShadowColor(){let{textColor:e,backgroundColor:t}=this,n=t.clone();return n.a*=e.a,n}get _textShadow(){let e=this._textShadowColor.toCss(!0);return`0 0 ${this._textShadowSize}px ${e}`}get padding(){return .5*this.fontSize}get borderRadius(){return this.padding}set borderRadius(e){this._overrideIfSome(`borderRadius`,e)}constructor(e){super(e),this.x=0,this.y=0,this.text=`-`,this.fontSize=14,this.anchor=`center`,this._visible=!0,this.isDecoration=!0,this.backgroundColor=new n([0,0,0,.6]),this.textColor=new n([255,255,255]),this._textShadowSize=1}render(){return t(`div`,{classes:this._cssClasses(),styles:{left:Math.floor(this.x)+`px`,top:Math.floor(this.y)+`px`,visibility:this.visible?`visible`:`hidden`,fontSize:this.fontSize+`px`,lineHeight:this.fontSize+`px`,backgroundColor:this.backgroundColor.toCss(!0),color:this.textColor.toCss(!0),padding:this.padding+`px`,borderRadius:this.borderRadius+`px`,textShadow:this._textShadow}},[this.text])}renderCanvas(e){if(!this.visible)return;let t=e.font.replace(/^(.*?)px/,``);e.font=`${this.fontSize}px ${t}`;let{padding:n,borderRadius:r}=this,i=e.measureText(this.text).width,a=this.text===``?0:this.fontSize,o=c[this.anchor];e.textAlign=`center`,e.textBaseline=`middle`;let s=i+2*n,l=a+2*n,u=this.x+o.x*s,d=this.y+o.y*l;this._roundedRect(e,u,d,s,l,r),e.fillStyle=this.backgroundColor.toCss(!0),e.fill();let f=this.x+(o.x+.5)*s,p=this.y+(o.y+.5)*l;this._renderTextShadow(e,this.text,f,p),e.fillStyle=this.textColor.toCss(!0),e.fillText(this.text,f,p)}_renderTextShadow(e,t,n,r){e.lineJoin=`miter`,e.fillStyle=`rgba(${this._textShadowColor.r}, ${this._textShadowColor.g}, ${this._textShadowColor.b}, ${1/l.length})`;let i=this._textShadowSize;for(let[a,o]of l)e.fillText(t,n+i*a,r+i*o)}_roundedRect(e,t,n,r,i,a){a=Math.min(a,i/2,r/2),e.beginPath(),e.moveTo(t,n+a),e.arcTo(t,n,t+a,n,a),e.lineTo(t+r-a,n),e.arcTo(t+r,n,t+r,n+a,a),e.lineTo(t+r,n+i-a),e.arcTo(t+r,n+i,t+r-a,n+i,a),e.lineTo(t+a,n+i),e.arcTo(t,n+i,t,n+i-a,a),e.closePath()}_cssClasses(){let e={"esri-text-overlay-item":!0},t;for(t in o)e[o[t]]=this.anchor===t;return e}};e([i()],s.prototype,`x`,void 0),e([i()],s.prototype,`y`,void 0),e([i()],s.prototype,`position`,null),e([i()],s.prototype,`text`,void 0),e([i()],s.prototype,`fontSize`,void 0),e([i()],s.prototype,`anchor`,void 0),e([i()],s.prototype,`_visible`,void 0),e([i()],s.prototype,`visible`,null),e([i()],s.prototype,`isDecoration`,void 0),e([i()],s.prototype,`backgroundColor`,void 0),e([i()],s.prototype,`textColor`,void 0),e([i()],s.prototype,`_textShadowSize`,void 0),e([i()],s.prototype,`_textShadowColor`,null),e([i()],s.prototype,`_textShadow`,null),e([i()],s.prototype,`padding`,null),e([i()],s.prototype,`borderRadius`,null),s=e([a(`esri.views.overlay.TextOverlayItem`)],s);const c={bottom:{x:-.5,y:-1,textAlign:`center`,textBaseline:`bottom`},"bottom-left":{x:0,y:-1,textAlign:`left`,textBaseline:`bottom`},"bottom-right":{x:-1,y:-1,textAlign:`right`,textBaseline:`bottom`},center:{x:-.5,y:-.5,textAlign:`center`,textBaseline:`middle`},left:{x:0,y:-.5,textAlign:`left`,textBaseline:`middle`},right:{x:-1,y:-.5,textAlign:`right`,textBaseline:`middle`},top:{x:-.5,y:0,textAlign:`center`,textBaseline:`top`},"top-left":{x:0,y:0,textAlign:`left`,textBaseline:`top`},"top-right":{x:-1,y:0,textAlign:`right`,textBaseline:`top`}},l=[];for(let e=0;e<360;e+=22.5)l.push([Math.cos(Math.PI*e/180),Math.sin(Math.PI*e/180)]);export{s as default};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import t from"../../core/Accessor.js";import{property as n,subclass as r}from"../../core/accessorSupport/decorators.js";import{createTask as i}from"../../core/asyncUtils.js";import{abortMaybe as a}from"../../core/maybe.js";import{isAborted as o,isAbortError as s}from"../../core/promiseUtils.js";import{isCompatible as c,supportsHeightModelInfo as l,getLayerHeightModelInfo as u,deriveHeightModelInfoFromLayer as d}from"../../geometry/support/heightModelInfoUtils.js";import{projectWithEngineOrService as f}from"./projectionUtils.js";let p=class extends t{constructor(e){super(e),this.required={extent:!1,heightModelInfo:!1,tileInfo:!1},this.defaultSpatialReference=null,this.inputSpatialReference=null,this.inputHeightModelInfo=null,this.sourcePreloadCount=10,this.priorityCollection=null,this.requiresExtentInSpatialReference=!0,this.viewReady=!1,this._projectExtentTask={task:null,input:null,output:null,spatialReference:null}}destroy(){this._projectExtentTask.task&&(this._projectExtentTask.task=a(this._projectExtentTask.task)),this._set(`map`,null)}get ready(){return!this._spatialReferenceTask.updating&&!this._tileInfoTask.updating&&!this._extentTask.updating}get heightModelInfoReady(){return!this._heightModelInfoTask.updating}get spatialReference(){return this.inputSpatialReference??this._spatialReferenceTask.spatialReference}get extent(){return this._extentTask.extent}get heightModelInfo(){return this._heightModelInfoTask.heightModelInfo}get combinedHorizontalAndVerticalSpatialReference(){return this.heightModelInfoReady?this._heightModelInfoTask.spatialReference:null}get viewingMode(){return this.inputSpatialReference==null||this.inputSpatialReference.equals(this._spatialReferenceTask.spatialReference)?this._spatialReferenceTask.viewingMode??null:null}get tileInfo(){return this._tileInfoTask.tileInfo}get mapCollections(){let e=this.map?.(),t=[];return this.priorityCollection!=null&&t.push(this.priorityCollection),t.push({parent:e?.basemap,layers:e?.basemap?.baseLayers},{parent:e?.basemap,layers:e?.basemap?.groundLayers},{layers:e?.layers},{parent:e?.ground,layers:e?.ground?.layers},{parent:e?.basemap,layers:e?.basemap?.referenceLayers}),t}get _spatialReferenceTask(){if(this.viewReady)return this._get(`_spatialReferenceTask`)??{updating:!1};let{spatialReference:e,viewingMode:t,updating:n}=this._combinedSpatialReferenceTask(!1);return{spatialReference:e,viewingMode:t,updating:n}}get _heightModelInfoTask(){if(!this.required.heightModelInfo)return{updating:!1};let e=this.viewReady?this._get(`_heightModelInfoTask`):null;return e&&!e.updating&&e.heightModelInfo?e:this._combinedSpatialReferenceTask(!0)}_combinedSpatialReferenceTask(e){let t=null,n=()=>t?.length===1&&(!e||t[0].heightModelInfo!=null);if(this._collectLayers(this.mapCollections,r=>{let i=this._getSupportedSpatialReferences(r,e);if(i.length>0){let e=this._narrowDownSpatialReferenceCandidates(t,i);e!=null&&(t=e)}return!!n()})&&!n())return{updating:!0};let r=this._pickSpatialReferenceCandidate(t);return{heightModelInfo:r?.heightModelInfo??null,spatialReference:r?.spatialReference??null,viewingMode:r?.viewingMode??null,updating:!1}}get _tileInfoTask(){if(!this.required.tileInfo)return this._get(`_tileInfoTask`)??{updating:!1};let e=this.map?.(),t=this.spatialReference;if(!t)return{updating:this._spatialReferenceTask.updating};let n,r=this._collectLayers([{parent:e?.basemap,layers:e?.basemap?.baseLayers},{parent:e?.basemap,layers:e?.basemap?.groundLayers},{layers:e?.layers}],e=>`tileInfo`in e&&e.tileInfo?.spatialReference.equals(t)?(n=e,!0):!1,e=>`tileInfo`in e);return n?{tileInfo:n.tileInfo,updating:!1}:{updating:r}}get _extentCandidatesTask(){if(this.viewReady||!this.required.extent)return this._get(`_extentCandidatesTask`)??{updating:!1};if(!this.spatialReference)return{updating:this._spatialReferenceTask.updating};let e=[];return{candidates:e,updating:this._collectLayers(this.mapCollections,t=>{let n=`fullExtents`in t&&t.fullExtents||(t.fullExtent==null?[]:[t.fullExtent]),r=this.requiresExtentInSpatialReference?null:n[0],i=n.find(e=>e.spatialReference.equals(this.spatialReference))??r;if(i)return e.push({extent:i,layer:t}),!0;if(this._getSupportedSpatialReferences(t).length>0)for(let r of n)e.push({extent:r,layer:t});return!1})}}get _extentTask(){let{candidates:e,updating:t}=this._extentCandidatesTask;if(t)return{updating:t};if(e==null||e.length===0)return{updating:!1};if(!this.spatialReference)return{updating:this._spatialReferenceTask.updating};let n=this._pickExtentCandidate(e),r=this.spatialReference;return n.extent.equals(this._projectExtentTask.input)&&r.equals(this._projectExtentTask.spatialReference)?{extent:this._projectExtentTask.output,updating:this._projectExtentTask.task!=null&&!this._projectExtentTask.task.finished}:(this._projectExtentTask.task!=null&&(this._projectExtentTask.task=a(this._projectExtentTask.task)),this._projectExtentTask={input:n.extent.clone(),output:null,spatialReference:r.clone(),task:i(async e=>{try{let t=await f(n.extent,r,`portalItem`in n.layer?n.layer.portalItem:void 0,e);this._projectExtentTask={...this._projectExtentTask,task:null,output:t}}catch{if(o(e))return;this._projectExtentTask={...this._projectExtentTask,task:null}}})},{updating:!0})}_narrowDownSpatialReferenceCandidates(e,t){if(e==null)return t;let n=[];for(let r of e)for(let e of t){let t=g(r.viewingMode,e.viewingMode);if(r.spatialReference&&!r.spatialReference.equals(e.spatialReference)||c(r.heightModelInfo,e.heightModelInfo,!0)!==0||t===!1)continue;let i=e.heightModelInfo&&!r.heightModelInfo||!r.spatialReference;n.push(new m(i?e.spatialReference:r.spatialReference,i?e.heightModelInfo:r.heightModelInfo,t));break}return n.length>0?n:null}_pickSpatialReferenceCandidate(e){let t=this.defaultSpatialReference;return e?.length?(e.length>1&&t?e.find(({spatialReference:e})=>e?.equals(t)):null)??e[0]:t?{heightModelInfo:null,spatialReference:t,viewingMode:null}:null}_getSupportedSpatialReferences(e,t=!1){let n=`supportedSpatialReferences`in e&&e.supportedSpatialReferences||(e.spatialReference?[e.spatialReference]:[]);if(n.length===0)return[];let r=t?this.inputHeightModelInfo:null,i=t&&l(e),a=i?u(e):null,o=[];for(let t of n){let n=this.getSpatialReferenceSupport(t,e);if(n==null)continue;let s=n.constraints??[{spatialReference:t,viewingMode:null}];for(let{spatialReference:t,viewingMode:n}of s){if(this.requiresExtentInSpatialReference&&!(this.inputSpatialReference?.equals(t)??!0))continue;let s=a??(i?d(e,t):null);c(r,s,!0)===0&&o.push(new m(t,s,n))}}return o}_pickExtentCandidate(e){let t=this.spatialReference;return e.find(({extent:e})=>t.equals(e.spatialReference))||e[0]}_collectLayers(e,t,n=()=>!0){switch(this._loadMaybe(this.map?.())){case`loading`:return!0;case`failed`:return!1}let r=new h(n,t);for(let t of e)if(this._collectCollection(t,r),r.done||r.preloading===this.sourcePreloadCount)break;return r.updating}_collectCollection(e,t){if(e.layers){switch(this._loadMaybe(e.parent)){case`loading`:t.updating=!0,++t.preloading;return;case`failed`:return}for(let n of e.layers)if(!(n.type===`graphics`&&n.internal)&&t.layerFilter(n)){switch(this._loadMaybe(n)){case`failed`:continue;case`loading`:t.updating=!0,++t.preloading;break;case`loaded`:if(t.updating||(t.done=t.pushLayer(n)),t.done||t.preloading===this.sourcePreloadCount)break;`layers`in n&&this._collectCollection({layers:n.layers},t)}if(t.done||t.preloading===this.sourcePreloadCount)break}}}_loadMaybe(e){return!e||!(`loadStatus`in e)||e.loadStatus==null?`loaded`:e.loadStatus===`not-loaded`?(e.load().catch(e=>{s(e)}),`loading`):e.loadStatus}};e([n()],p.prototype,`required`,void 0),e([n({constructOnly:!0})],p.prototype,`map`,void 0),e([n({constructOnly:!0})],p.prototype,`getSpatialReferenceSupport`,void 0),e([n()],p.prototype,`defaultSpatialReference`,void 0),e([n()],p.prototype,`inputSpatialReference`,void 0),e([n()],p.prototype,`inputHeightModelInfo`,void 0),e([n()],p.prototype,`sourcePreloadCount`,void 0),e([n()],p.prototype,`priorityCollection`,void 0),e([n()],p.prototype,`requiresExtentInSpatialReference`,void 0),e([n()],p.prototype,`viewReady`,void 0),e([n({readOnly:!0})],p.prototype,`ready`,null),e([n({readOnly:!0})],p.prototype,`heightModelInfoReady`,null),e([n({readOnly:!0})],p.prototype,`spatialReference`,null),e([n({readOnly:!0})],p.prototype,`extent`,null),e([n({readOnly:!0})],p.prototype,`heightModelInfo`,null),e([n({readOnly:!0})],p.prototype,`combinedHorizontalAndVerticalSpatialReference`,null),e([n({readOnly:!0})],p.prototype,`viewingMode`,null),e([n({readOnly:!0})],p.prototype,`tileInfo`,null),e([n({readOnly:!0})],p.prototype,`mapCollections`,null),e([n({readOnly:!0})],p.prototype,`_spatialReferenceTask`,null),e([n({readOnly:!0})],p.prototype,`_heightModelInfoTask`,null),e([n({readOnly:!0})],p.prototype,`_tileInfoTask`,null),e([n({readOnly:!0})],p.prototype,`_extentCandidatesTask`,null),e([n()],p.prototype,`_extentTask`,null),e([n()],p.prototype,`_projectExtentTask`,void 0),p=e([r(`esri.views.support.DefaultsFromMap`)],p);class m{constructor(e,t,n){this.spatialReference=e,this.heightModelInfo=t,this.viewingMode=n}}class h{constructor(e,t){this.layerFilter=e,this.pushLayer=t,this.preloading=-1,this.updating=!1,this.done=!1}}function g(e,t){return e==null?t:(t==null||e===t)&&e}export{p as DefaultsFromMap};
2
+ import{__decorate as e}from"tslib";import t from"../../core/Accessor.js";import{property as n,subclass as r}from"../../core/accessorSupport/decorators.js";import{createTask as i}from"../../core/asyncUtils.js";import{abortMaybe as a}from"../../core/maybe.js";import{isAborted as o,isAbortError as s}from"../../core/promiseUtils.js";import{isCompatible as c,supportsHeightModelInfo as l,getLayerHeightModelInfo as u,deriveHeightModelInfoFromLayer as d}from"../../geometry/support/heightModelInfoUtils.js";import{projectWithEngineOrService as f}from"./projectionUtils.js";let p=class extends t{constructor(e){super(e),this.required={extent:!1,heightModelInfo:!1,tileInfo:!1},this.defaultSpatialReference=null,this.inputSpatialReference=null,this.inputHeightModelInfo=null,this.sourcePreloadCount=10,this.priorityCollection=null,this.requiresExtentInSpatialReference=!0,this.viewReady=!1,this._projectExtentTask={task:null,input:null,output:null,spatialReference:null}}destroy(){this._projectExtentTask.task&&(this._projectExtentTask.task=a(this._projectExtentTask.task)),this._set(`map`,null)}get ready(){return!this._spatialReferenceTask.updating&&!this._tileInfoTask.updating&&!this._extentTask.updating}get heightModelInfoReady(){return!this._heightModelInfoTask.updating}get spatialReference(){return this.inputSpatialReference??this._spatialReferenceTask.spatialReference}get extent(){return this._extentTask.extent}get heightModelInfo(){return this._heightModelInfoTask.heightModelInfo}get combinedHorizontalAndVerticalSpatialReference(){return this.heightModelInfoReady?this._heightModelInfoTask.spatialReference:null}get viewingMode(){return this.inputSpatialReference==null||this.inputSpatialReference.equals(this._spatialReferenceTask.spatialReference)?this._spatialReferenceTask.viewingMode:null}get tileInfo(){return this._tileInfoTask.tileInfo}get mapCollections(){let e=this.map?.(),t=[];return this.priorityCollection!=null&&t.push(this.priorityCollection),t.push({parent:e?.basemap,layers:e?.basemap?.baseLayers},{parent:e?.basemap,layers:e?.basemap?.groundLayers},{layers:e?.layers},{parent:e?.ground,layers:e?.ground?.layers},{parent:e?.basemap,layers:e?.basemap?.referenceLayers}),t}get _spatialReferenceTask(){if(this.viewReady)return this._get(`_spatialReferenceTask`)??{updating:!1};let{spatialReference:e,viewingMode:t,updating:n}=this._combinedSpatialReferenceTask(!1);return{spatialReference:e,viewingMode:t,updating:n}}get _heightModelInfoTask(){if(!this.required.heightModelInfo)return{updating:!1};let e=this.viewReady?this._get(`_heightModelInfoTask`):null;return e&&!e.updating&&e.heightModelInfo?e:this._combinedSpatialReferenceTask(!0)}_combinedSpatialReferenceTask(e){let t=null,n=()=>t?.length===1&&(!e||t[0].heightModelInfo!=null);if(this._collectLayers(this.mapCollections,r=>{let i=this._getSupportedSpatialReferences(r,e);if(i.length>0){let e=this._narrowDownSpatialReferenceCandidates(t,i);e!=null&&(t=e)}return!!n()})&&!n())return{updating:!0};let r=this._pickSpatialReferenceCandidate(t);return{heightModelInfo:r?.heightModelInfo??null,spatialReference:r?.spatialReference??null,viewingMode:r?.viewingMode??null,updating:!1}}get _tileInfoTask(){if(!this.required.tileInfo)return this._get(`_tileInfoTask`)??{updating:!1};let e=this.map?.(),t=this.spatialReference;if(!t)return{updating:this._spatialReferenceTask.updating};let n,r=this._collectLayers([{parent:e?.basemap,layers:e?.basemap?.baseLayers},{parent:e?.basemap,layers:e?.basemap?.groundLayers},{layers:e?.layers}],e=>`tileInfo`in e&&e.tileInfo?.spatialReference.equals(t)?(n=e,!0):!1,e=>`tileInfo`in e);return n?{tileInfo:n.tileInfo,updating:!1}:{updating:r}}get _extentCandidatesTask(){if(this.viewReady||!this.required.extent)return this._get(`_extentCandidatesTask`)??{updating:!1};if(!this.spatialReference)return{updating:this._spatialReferenceTask.updating};let e=[];return{candidates:e,updating:this._collectLayers(this.mapCollections,t=>{let n=`fullExtents`in t&&t.fullExtents||(t.fullExtent==null?[]:[t.fullExtent]),r=this.requiresExtentInSpatialReference?null:n[0],i=n.find(e=>e.spatialReference.equals(this.spatialReference))??r;if(i)return e.push({extent:i,layer:t}),!0;if(this._getSupportedSpatialReferences(t).length>0)for(let r of n)e.push({extent:r,layer:t});return!1})}}get _extentTask(){let{candidates:e,updating:t}=this._extentCandidatesTask;if(t)return{updating:t};if(e==null||e.length===0)return{updating:!1};if(!this.spatialReference)return{updating:this._spatialReferenceTask.updating};let n=this._pickExtentCandidate(e),r=this.spatialReference;return n.extent.equals(this._projectExtentTask.input)&&r.equals(this._projectExtentTask.spatialReference)?{extent:this._projectExtentTask.output,updating:this._projectExtentTask.task!=null&&!this._projectExtentTask.task.finished}:(this._projectExtentTask.task!=null&&(this._projectExtentTask.task=a(this._projectExtentTask.task)),this._projectExtentTask={input:n.extent.clone(),output:null,spatialReference:r.clone(),task:i(async e=>{try{let t=await f(n.extent,r,`portalItem`in n.layer?n.layer.portalItem:void 0,e);this._projectExtentTask={...this._projectExtentTask,task:null,output:t}}catch{if(o(e))return;this._projectExtentTask={...this._projectExtentTask,task:null}}})},{updating:!0})}_narrowDownSpatialReferenceCandidates(e,t){if(e==null)return t;let n=[];for(let r of e)for(let e of t){let t=g(r.viewingMode,e.viewingMode);if(r.spatialReference&&!r.spatialReference.equals(e.spatialReference)||c(r.heightModelInfo,e.heightModelInfo,!0)!==0||t===!1)continue;let i=e.heightModelInfo&&!r.heightModelInfo||!r.spatialReference;n.push(new m(i?e.spatialReference:r.spatialReference,i?e.heightModelInfo:r.heightModelInfo,t));break}return n.length>0?n:null}_pickSpatialReferenceCandidate(e){let t=this.defaultSpatialReference;return e?.length?(e.length>1&&t?e.find(({spatialReference:e})=>e?.equals(t)):null)??e[0]:t?{heightModelInfo:null,spatialReference:t,viewingMode:null}:null}_getSupportedSpatialReferences(e,t=!1){let n=`supportedSpatialReferences`in e&&e.supportedSpatialReferences||(e.spatialReference?[e.spatialReference]:[]);if(n.length===0)return[];let r=t?this.inputHeightModelInfo:null,i=t&&l(e),a=i?u(e):null,o=[];for(let t of n){let n=this.getSpatialReferenceSupport(t,e);if(n==null)continue;let s=n.constraints??[{spatialReference:t,isGlobal:null}];for(let{spatialReference:t,isGlobal:n}of s){if(this.requiresExtentInSpatialReference&&!(this.inputSpatialReference?.equals(t)??!0))continue;let s=a??(i?d(e,t):null);if(c(r,s,!0)!==0)continue;let l=n==null?null:n?1:2;o.push(new m(t,s,l))}}return o}_pickExtentCandidate(e){let t=this.spatialReference;return e.find(({extent:e})=>t.equals(e.spatialReference))||e[0]}_collectLayers(e,t,n=()=>!0){switch(this._loadMaybe(this.map?.())){case`loading`:return!0;case`failed`:return!1}let r=new h(n,t);for(let t of e)if(this._collectCollection(t,r),r.done||r.preloading===this.sourcePreloadCount)break;return r.updating}_collectCollection(e,t){if(e.layers){switch(this._loadMaybe(e.parent)){case`loading`:t.updating=!0,++t.preloading;return;case`failed`:return}for(let n of e.layers)if(!(n.type===`graphics`&&n.internal)&&t.layerFilter(n)){switch(this._loadMaybe(n)){case`failed`:continue;case`loading`:t.updating=!0,++t.preloading;break;case`loaded`:if(t.updating||(t.done=t.pushLayer(n)),t.done||t.preloading===this.sourcePreloadCount)break;`layers`in n&&this._collectCollection({layers:n.layers},t)}if(t.done||t.preloading===this.sourcePreloadCount)break}}}_loadMaybe(e){return!e||!(`loadStatus`in e)||e.loadStatus==null?`loaded`:e.loadStatus===`not-loaded`?(e.load().catch(e=>{s(e)}),`loading`):e.loadStatus}};e([n()],p.prototype,`required`,void 0),e([n({constructOnly:!0})],p.prototype,`map`,void 0),e([n({constructOnly:!0})],p.prototype,`getSpatialReferenceSupport`,void 0),e([n()],p.prototype,`defaultSpatialReference`,void 0),e([n()],p.prototype,`inputSpatialReference`,void 0),e([n()],p.prototype,`inputHeightModelInfo`,void 0),e([n()],p.prototype,`sourcePreloadCount`,void 0),e([n()],p.prototype,`priorityCollection`,void 0),e([n()],p.prototype,`requiresExtentInSpatialReference`,void 0),e([n()],p.prototype,`viewReady`,void 0),e([n({readOnly:!0})],p.prototype,`ready`,null),e([n({readOnly:!0})],p.prototype,`heightModelInfoReady`,null),e([n({readOnly:!0})],p.prototype,`spatialReference`,null),e([n({readOnly:!0})],p.prototype,`extent`,null),e([n({readOnly:!0})],p.prototype,`heightModelInfo`,null),e([n({readOnly:!0})],p.prototype,`combinedHorizontalAndVerticalSpatialReference`,null),e([n({readOnly:!0})],p.prototype,`viewingMode`,null),e([n({readOnly:!0})],p.prototype,`tileInfo`,null),e([n({readOnly:!0})],p.prototype,`mapCollections`,null),e([n({readOnly:!0})],p.prototype,`_spatialReferenceTask`,null),e([n({readOnly:!0})],p.prototype,`_heightModelInfoTask`,null),e([n({readOnly:!0})],p.prototype,`_tileInfoTask`,null),e([n({readOnly:!0})],p.prototype,`_extentCandidatesTask`,null),e([n()],p.prototype,`_extentTask`,null),e([n()],p.prototype,`_projectExtentTask`,void 0),p=e([r(`esri.views.support.DefaultsFromMap`)],p);class m{constructor(e,t,n){this.spatialReference=e,this.heightModelInfo=t,this.viewingMode=n}}class h{constructor(e,t){this.layerFilter=e,this.pushLayer=t,this.preloading=-1,this.updating=!1,this.done=!1}}function g(e,t){return e==null?t:(t==null||e===t)&&e}export{p as DefaultsFromMap};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{removeUnordered as e,filterInPlace as t}from"../../core/arrayUtils.js";import n from"../../core/Handles.js";import"../../core/has.js";import r from"../../core/Logger.js";import{removeMaybe as i}from"../../core/maybe.js";import{recordPerformance as a}from"../../core/performance.js";import o from"../../core/PerformanceSampler.js";import{isAborted as s,createAbortError as c,when as l,isPromiseLike as u,ignoreAbortErrors as d}from"../../core/promiseUtils.js";import{watch as f,initial as p,when as m}from"../../core/reactiveUtils.js";import{signal as h}from"../../core/signal.js";import{Milliseconds as g}from"../../core/time.js";import _ from"./debugFlags.js";import{PromiseQueue as v}from"./PromiseQueue.js";import{Yield as y}from"./Yield.js";function b(){return new k}const x={RESOURCE_CONTROLLER_IMMEDIATE:`immediate`,RESOURCE_CONTROLLER:`schedule`,SLIDE:`slide`,STREAM_DATA_LOADER:`stream loader`,ELEVATION_QUERY:`elevation query`,TERRAIN_SURFACE:`terrain`,SURFACE_GEOMETRY_UPDATES:`surface geometry updates`,LOD_RENDERER:`LoD renderer`,GRAPHICS_CORE:`Graphics3D`,I3S:`I3S`,LYR3D:`Lyr3D`,TILES3D:`3DTiles`,POINT_CLOUD_LAYER:`point cloud`,FEATURE_TILE_FETCHER:`feature fetcher`,STREAM_CONTROLLER:`stream controller`,SCREEN_POLYGON_INTERSECTION:`screen polygon intersection`,OCCLUSION_QUERY:`occlusion query`,OVERLAY:`overlay`,OVERLAY_RENDERER:`overlay renderer`,STAGE:`stage`,GRAPHICS_DECONFLICTOR:`graphics deconflictor`,FILTER_VISIBILITY:`graphics filter visibility`,SCALE_VISIBILITY:`graphics scale visibility`,FRUSTUM_VISIBILITY:`graphics frustum visibility`,POINT_OF_INTEREST_FREQUENT:`POI frequent`,POINT_OF_INTEREST_INFREQUENT:`POI infrequent`,LABELER:`labeler`,FEATURE_FILTER_HIGHLIGHT:`feature filter highlight`,FEATURE_QUERY_ENGINE:`feature query`,FEATURE_TILE_TREE:`feature tile tree`,FEATURE_TILE_TREE_ACTIVE:`fast feature tile tree`,ELEVATION_ALIGNMENT:`elevation alignment`,ELEVATION_ALIGNMENT_SCENE:`elevation alignment scene`,TEXT_TEXTURE_ATLAS:`text texture atlas`,TEXTURE_UNLOAD:`texture unload`,LINE_OF_SIGHT_TOOL:`line of sight tool`,LINE_OF_SIGHT_TOOL_INTERACTIVE:`interactive line of sight tool`,VOLUME_MEASUREMENT:`volume measurement`,ELEVATION_PROFILE:`elevation profile`,SNAPPING:`snapping`,SHADOW_ACCUMULATOR:`shadow accumulator`,CLOUDS_GENERATOR:`clouds generator`,FLOW_GENERATOR:`flow generator`,GAUSSIAN_SPLAT_SORTING:`gaussian splat sorting`,GAUSSIAN_SPLAT_TEXTURE_ATLAS:`gaussian splat texture atlas`,MAPVIEW_FETCH_QUEUE:`mapview fetch queue`,MAPVIEW_LAYERVIEW_UPDATE:`mapview layerview update`,MAPVIEW_VECTOR_TILE_PARSING_QUEUE:`mapview vector tile parsing queue`,NONE:0,TEST_PRIO:1},S=new Map([[x.RESOURCE_CONTROLLER_IMMEDIATE,0],[x.RESOURCE_CONTROLLER,4],[x.SLIDE,0],[x.STREAM_DATA_LOADER,0],[x.ELEVATION_QUERY,0],[x.TERRAIN_SURFACE,1],[x.SURFACE_GEOMETRY_UPDATES,1],[x.LOD_RENDERER,2],[x.GRAPHICS_CORE,2],[x.I3S,2],[x.LYR3D,2],[x.TILES3D,3],[x.POINT_CLOUD_LAYER,2],[x.FEATURE_TILE_FETCHER,2],[x.STREAM_CONTROLLER,2],[x.SCREEN_POLYGON_INTERSECTION,0],[x.CLOUDS_GENERATOR,2],[x.OCCLUSION_QUERY,2],[x.OVERLAY,4],[x.OVERLAY_RENDERER,4],[x.STAGE,4],[x.GRAPHICS_DECONFLICTOR,4],[x.FILTER_VISIBILITY,4],[x.SCALE_VISIBILITY,4],[x.FRUSTUM_VISIBILITY,4],[x.POINT_OF_INTEREST_FREQUENT,6],[x.POINT_OF_INTEREST_INFREQUENT,30],[x.LABELER,8],[x.FEATURE_FILTER_HIGHLIGHT,2],[x.FEATURE_QUERY_ENGINE,8],[x.FEATURE_TILE_TREE,16],[x.FEATURE_TILE_TREE_ACTIVE,0],[x.ELEVATION_ALIGNMENT,12],[x.ELEVATION_ALIGNMENT_SCENE,14],[x.TEXT_TEXTURE_ATLAS,12],[x.TEXTURE_UNLOAD,12],[x.LINE_OF_SIGHT_TOOL,16],[x.LINE_OF_SIGHT_TOOL_INTERACTIVE,0],[x.VOLUME_MEASUREMENT,4],[x.SNAPPING,0],[x.SHADOW_ACCUMULATOR,30],[x.FLOW_GENERATOR,12],[x.GAUSSIAN_SPLAT_SORTING,2],[x.GAUSSIAN_SPLAT_TEXTURE_ATLAS,12],[x.MAPVIEW_FETCH_QUEUE,0],[x.MAPVIEW_LAYERVIEW_UPDATE,2],[x.MAPVIEW_VECTOR_TILE_PARSING_QUEUE,0]]);function C(e){return S.has(e)?S.get(e):typeof e==`number`?e:1}const w=g(6.5),T=g(1),E=g(30),D=g(1e3/30),O=g(100);class k{get updating(){return this._updating.value}_updatingChanged(){this._updating.value=this._tasks.some(e=>e.needsUpdate)}constructor(){this._updating=h(!0),this._microTaskQueued=!1,this._frameNumber=0,this.performanceInfo={total:new o(`total`),tasks:new Map},this._frameTaskTimes=new Map,this._budget=new j,this.state=1,this._tasks=[],this._runQueue=[],this._load=0,this._forceTask=!1,this._debug=!1,this._debugHandle=f(()=>_.SCHEDULER_LOG_SLOW_TASKS,e=>this._debug=e,p);for(let e of Object.keys(x))this.performanceInfo.tasks.set(x[e],new o(String(x[e])))}destroy(){this._tasks.forEach(e=>e.remove()),this._tasks.length=0,this._runQueue.length=0,i(this._debugHandle),this._microTaskQueued=!1,this._updatingChanged()}taskRunningChanged(e){this._updatingChanged(),e&&this._budget.remaining>0&&!this._microTaskQueued&&(this._microTaskQueued=!0,queueMicrotask(()=>{this._microTaskQueued&&(this._microTaskQueued=!1,this._budget.remaining>0&&this._schedule()&&this._runFrame())}))}registerTask(e,t){let n=new A(this,e,t);return this._tasks.push(n),this._updatingChanged(),this.performanceInfo.tasks.has(e)||this.performanceInfo.tasks.set(e,new o(e)),n}get load(){return this._load}frame(e){if(this._startFrameTaskTimes(),this._updateBudget(e)){let e=this._budget.now();this._runFrame();let t=this._budget.now();this._recordFrameTaskTimes(t-e);let n=this.state===2?`Idle`:this.state===1?`Interacting`:`Animating`;return a(`${n} Frame Tasks`,e,t,`Maps SDK`,`Scheduling`),!0}return this._recordFrameTaskTimes(0),!1}_updateBudget(e){this._test&&(this._test.usedBudget=0),++this._frameNumber;let t=w,n=e.frameDuration,r=T;switch(this.state){case 2:t=g(0),n=g(Math.max(O,e.frameDuration)),r=E;break;case 1:n=g(Math.max(D,e.frameDuration))}return n=g(n-e.elapsedFrameTime-t),this.state!==2&&n<T&&!this._forceTask?(this._forceTask=!0,!1):(n=g(Math.max(n,r)),this._budget.reset(n),this._updateLoad(),this._schedule())}_runFrame(){this._forceTask=!1,this._microTaskQueued=!1,this._run(),this._test&&(this._test.usedBudget=this._budget.elapsed)}stopFrame(){this._budget.reset(g(0)),this._budget.madeProgress()}removeTask(t){e(this._tasks,t),e(this._runQueue,t),this._updatingChanged()}_updateTask(e){this._tasks.forEach(t=>{t.name===e&&t.setPriority(e)})}_getState(e){if(this._runQueue.some(t=>t.name===e))return`s`;let t=`i`;return this._tasks.forEach(n=>{n.name===e&&n.needsUpdate&&(n.schedulePriority<=1?t=`r`:t!==`r`&&(t=`w`))}),t}_getRuntime(e){let t=0;return this._tasks.forEach(n=>{n.name===e&&(t+=n.runtime)}),t}_resetRuntimes(){this._tasks.forEach(e=>e.runtime=0)}_getRunning(){let e=new Map;if(this._tasks.forEach(t=>{t.needsUpdate&&e.set(t.name,(e.get(t.name)||0)+1)}),e.size===0)return null;let t=``;return e.forEach((e,n)=>{t+=e>1?` ${e}x ${n}`:` ${n}`}),t}_updateLoad(){let e=this._tasks.reduce((e,t)=>t.needsUpdate?++e:e,0);this._load=this._load*.9+e*.09999999999999998}_schedule(){for(t(this._runQueue,e=>e.needsUpdate?!0:(e.schedulePriority=e.basePriority,!1)),this._tasks.forEach(e=>{e.basePriority===0&&e.needsUpdate&&!this._runQueue.includes(e)&&e.blockFrame!==this._frameNumber&&this._runQueue.unshift(e)});this._runQueue.length===0;){let e=!1,t=0;if(this._tasks.forEach(n=>{if(n.needsUpdate&&n.schedulePriority!==0&&n.basePriority!==0&&n.blockFrame!==this._frameNumber)switch(e=!0,t=Math.max(t,n.basePriority),n.schedulePriority){case 1:n.schedulePriority=0,this._runQueue.push(n);break;default:--n.schedulePriority}}),!e)return this._updatingChanged(),!1}return this._updatingChanged(),!0}_run(){do for(;this._runQueue.length>0;){let e=this._budget.now(),t=this._runQueue.pop();this._budget.resetProgress();try{t.task.runTask(this._budget)===y&&(t.blockFrame=this._frameNumber)}catch(e){r.getLogger(`esri.views.support.Scheduler`).error(`Exception in task "${t.name}"`,e),t.blockFrame=this._frameNumber}!this._budget.hasProgressed&&t.blockFrame!==this._frameNumber&&t.needsUpdate&&(t.name,x.I3S,t.blockFrame=this._frameNumber),t.schedulePriority=t.basePriority;let n=this._budget.now(),i=n-e;if(a(`${t.name}`,e,n,`Maps SDK`,`Scheduling`),t.runtime+=i,this._frameTaskTimes.set(t.priority,this._frameTaskTimes.get(t.priority)+i),this._budget.remaining<=0){this._updatingChanged();return}}while(this._schedule());this._updatingChanged()}_startFrameTaskTimes(){for(let e of Object.keys(x))this._frameTaskTimes.set(x[e],0)}_recordFrameTaskTimes(e){this._frameTaskTimes.forEach((e,t)=>this.performanceInfo.tasks.get(t).push(e)),this.performanceInfo.total.push(e)}get test(){return this._test}}class A{get task(){return this._task.value}get readyToRun(){return this._queue.readyToRun}get updating(){return this._queue.updating}constructor(e,t,r){this._scheduler=e,this.name=t,this.blockFrame=0,this.runtime=0,this._queue=new v,this._handles=new n,this._basePriority=C(t),this.schedulePriority=this._basePriority,this._task=h(r??this._queue),this._handles.add(m(()=>this.task.readyToRun,t=>e.taskRunningChanged(t)))}remove(){this._queue.drain(M),this._scheduler.removeTask(this),this.schedule=F.schedule,this.reschedule=F.reschedule,this.scheduleGenerator=F.scheduleGenerator,this._handles.destroy()}[Symbol.dispose](){this.remove()}get basePriority(){return this._basePriority}setPriority(e){if(this.name===e)return;this.name=e;let t=C(e);(this._basePriority===0||this.schedulePriority!==0)&&(this.schedulePriority=t),this._basePriority=t}get priority(){return this.name}set priority(e){this.setPriority(e)}get needsUpdate(){return this.readyToRun||!this.task.destroyed&&this.task.readyToRun}schedule(e,t,n){return this._queue.push(e,t,n)}reschedule(e,t,n){return this._queue.unshift(e,t,n)}scheduleGenerator(e,t,n){return this._queue.pushGenerator(e,t,n)}processQueue(e){return this._queue.runTask(e)}}class j{constructor(){this._begin=performance?.now()??0,this._budget=0,this._done=!1,this._progressed=!1,this._enabled=!0}run(e){return!this.done&&(e()===!0&&this.madeProgress(),!0)}get done(){return this._done}get budget(){return this._budget}madeProgress(){return this._progressed=!0,this._done=this._enabled&&this._budget!==1/0&&this.elapsed>=this._budget,this._done}get enabled(){return this._enabled}set enabled(e){this._enabled=e}reset(e){this._begin=this.now(),this._budget=e,this.resetProgress()}get remaining(){return Math.max(this._budget-this.elapsed,0)}now(){return performance.now()}get elapsed(){return this.now()-this._begin}resetProgress(){this._progressed=!1,this._done=!1}get hasProgressed(){return this._progressed}}const M=new j;M.enabled=!1;function N(e){let t=new j;return t.reset(e),t}class P{remove(){}[Symbol.dispose](){this.remove()}processQueue(){}schedule(e,t,n){try{if(s(t)){let e=c();return n?Promise.resolve(n(e)):Promise.reject(e)}return l(e(M))}catch(e){return Promise.reject(e)}}reschedule(e,t,n){return this.schedule(e,t,n)}async scheduleGenerator(e,t,n){if(s(t)){let e=c();if(n)return n(e);throw e}let r=e(M);for(;;){let e=r.next(M),i=u(e)?await e:e;if(s(t)){let e=c();if(n){let t=n(e),i=r.return(null);return u(i)&&await d(i),t}let t=r.throw(e);throw u(t)&&await d(t),e}if(i.done)return i.value}}}const F=new P;export{F as ImmediateTask,x as TaskPriority,C as getTaskPriority,N as makeBudget,b as newScheduler,M as noBudget,S as taskPriorities};
2
+ import{removeUnordered as e,filterInPlace as t}from"../../core/arrayUtils.js";import n from"../../core/Handles.js";import"../../core/has.js";import r from"../../core/Logger.js";import{removeMaybe as i}from"../../core/maybe.js";import{recordPerformance as a}from"../../core/performance.js";import o from"../../core/PerformanceSampler.js";import{isAborted as s,createAbortError as c,when as l,isPromiseLike as u,ignoreAbortErrors as d}from"../../core/promiseUtils.js";import{watch as f,initial as p,when as m}from"../../core/reactiveUtils.js";import{signal as h}from"../../core/signal.js";import{Milliseconds as g}from"../../core/time.js";import _ from"./debugFlags.js";import{PromiseQueue as v}from"./PromiseQueue.js";import{Yield as y}from"./Yield.js";function b(){return new k}const x={RESOURCE_CONTROLLER_IMMEDIATE:`immediate`,RESOURCE_CONTROLLER:`schedule`,SLIDE:`slide`,STREAM_DATA_LOADER:`stream loader`,ELEVATION_QUERY:`elevation query`,TERRAIN_SURFACE:`terrain`,SURFACE_GEOMETRY_UPDATES:`surface geometry updates`,LOD_RENDERER:`LoD renderer`,GRAPHICS_CORE:`Graphics3D`,I3S:`I3S`,LYR3D:`Lyr3D`,TILES3D:`3DTiles`,POINT_CLOUD_LAYER:`point cloud`,FEATURE_TILE_FETCHER:`feature fetcher`,STREAM_CONTROLLER:`stream controller`,SCREEN_POLYGON_INTERSECTION:`screen polygon intersection`,OCCLUSION_QUERY:`occlusion query`,OVERLAY:`overlay`,OVERLAY_RENDERER:`overlay renderer`,STAGE:`stage`,GRAPHICS_DECONFLICTOR:`graphics deconflictor`,FILTER_VISIBILITY:`graphics filter visibility`,SCALE_VISIBILITY:`graphics scale visibility`,FRUSTUM_VISIBILITY:`graphics frustum visibility`,POINT_OF_INTEREST_FREQUENT:`POI frequent`,POINT_OF_INTEREST_INFREQUENT:`POI infrequent`,LABELER:`labeler`,FEATURE_FILTER_HIGHLIGHT:`feature filter highlight`,FEATURE_QUERY_ENGINE:`feature query`,FEATURE_TILE_TREE:`feature tile tree`,FEATURE_TILE_TREE_ACTIVE:`fast feature tile tree`,ELEVATION_ALIGNMENT:`elevation alignment`,ELEVATION_ALIGNMENT_SCENE:`elevation alignment scene`,TEXT_TEXTURE_ATLAS:`text texture atlas`,TEXTURE_UNLOAD:`texture unload`,LINE_OF_SIGHT_TOOL:`line of sight tool`,LINE_OF_SIGHT_TOOL_INTERACTIVE:`interactive line of sight tool`,VOLUME_MEASUREMENT:`volume measurement`,ELEVATION_PROFILE:`elevation profile`,SNAPPING:`snapping`,SHADOW_ACCUMULATOR:`shadow accumulator`,CLOUDS_GENERATOR:`clouds generator`,FLOW_GENERATOR:`flow generator`,GAUSSIAN_SPLAT_SORTING:`gaussian splat sorting`,GAUSSIAN_SPLAT_TEXTURE_ATLAS:`gaussian splat texture atlas`,MAPVIEW_FETCH_QUEUE:`mapview fetch queue`,MAPVIEW_LAYERVIEW_UPDATE:`mapview layerview update`,MAPVIEW_VECTOR_TILE_PARSING_QUEUE:`mapview vector tile parsing queue`,NONE:0,TEST_PRIO:1},S=new Map([[x.RESOURCE_CONTROLLER_IMMEDIATE,0],[x.RESOURCE_CONTROLLER,4],[x.SLIDE,0],[x.STREAM_DATA_LOADER,0],[x.ELEVATION_QUERY,0],[x.TERRAIN_SURFACE,1],[x.SURFACE_GEOMETRY_UPDATES,1],[x.LOD_RENDERER,2],[x.GRAPHICS_CORE,2],[x.I3S,2],[x.LYR3D,2],[x.TILES3D,3],[x.POINT_CLOUD_LAYER,2],[x.FEATURE_TILE_FETCHER,2],[x.STREAM_CONTROLLER,2],[x.SCREEN_POLYGON_INTERSECTION,0],[x.CLOUDS_GENERATOR,2],[x.OCCLUSION_QUERY,2],[x.OVERLAY,4],[x.OVERLAY_RENDERER,4],[x.STAGE,4],[x.GRAPHICS_DECONFLICTOR,4],[x.FILTER_VISIBILITY,4],[x.SCALE_VISIBILITY,4],[x.FRUSTUM_VISIBILITY,4],[x.POINT_OF_INTEREST_FREQUENT,6],[x.POINT_OF_INTEREST_INFREQUENT,30],[x.LABELER,8],[x.FEATURE_FILTER_HIGHLIGHT,2],[x.FEATURE_QUERY_ENGINE,8],[x.FEATURE_TILE_TREE,16],[x.FEATURE_TILE_TREE_ACTIVE,0],[x.ELEVATION_ALIGNMENT,12],[x.ELEVATION_ALIGNMENT_SCENE,14],[x.TEXT_TEXTURE_ATLAS,12],[x.TEXTURE_UNLOAD,12],[x.LINE_OF_SIGHT_TOOL,16],[x.LINE_OF_SIGHT_TOOL_INTERACTIVE,0],[x.VOLUME_MEASUREMENT,4],[x.SNAPPING,0],[x.SHADOW_ACCUMULATOR,30],[x.FLOW_GENERATOR,12],[x.GAUSSIAN_SPLAT_SORTING,2],[x.GAUSSIAN_SPLAT_TEXTURE_ATLAS,12],[x.MAPVIEW_FETCH_QUEUE,0],[x.MAPVIEW_LAYERVIEW_UPDATE,2],[x.MAPVIEW_VECTOR_TILE_PARSING_QUEUE,0]]);function C(e){return S.has(e)?S.get(e):typeof e==`number`?e:1}const w=g(6.5),T=g(1),E=g(30),D=g(1e3/30),O=g(100);class k{get updating(){return this._updating.value}_updatingChanged(){this._updating.value=this._tasks.some(e=>e.needsUpdate)}constructor(){this._updating=h(!0),this._microTaskQueued=!1,this._frameNumber=0,this.performanceInfo={total:new o(`total`),tasks:new Map},this._frameTaskTimes=new Map,this._budget=new j,this.state=1,this._tasks=[],this._runQueue=[],this._load=0,this._forceTask=!1,this._debug=!1,this._debugHandle=f(()=>_.SCHEDULER_LOG_SLOW_TASKS,e=>this._debug=e,p);for(let e of Object.keys(x))this.performanceInfo.tasks.set(x[e],new o(String(x[e])))}destroy(){this._tasks.forEach(e=>e.remove()),this._tasks.length=0,this._runQueue.length=0,i(this._debugHandle),this._microTaskQueued=!1,this._updatingChanged()}taskRunningChanged(e){this._updatingChanged(),e&&this._budget.remaining>0&&!this._microTaskQueued&&(this._microTaskQueued=!0,queueMicrotask(()=>{this._microTaskQueued&&(this._microTaskQueued=!1,this._budget.remaining>0&&this._schedule()&&this._runFrame())}))}registerTask(e,t){let n=new A(this,e,t);return this._tasks.push(n),this._updatingChanged(),this.performanceInfo.tasks.has(e)||this.performanceInfo.tasks.set(e,new o(e)),n}get load(){return this._load}frame(e){if(this._startFrameTaskTimes(),this._updateBudget(e)){let e=this._budget.now();this._runFrame();let t=this._budget.now();this._recordFrameTaskTimes(t-e);let n=this.state===2?`Idle`:this.state===1?`Interacting`:`Animating`;return a(`${n} Frame Tasks`,e,t,`Maps SDK`,`Scheduling`),!0}return this._recordFrameTaskTimes(0),!1}_updateBudget(e){this._test&&(this._test.usedBudget=0),++this._frameNumber;let t=w,n=e.frameDuration,r=T;switch(this.state){case 2:t=g(0),n=g(Math.max(O,e.frameDuration)),r=E;break;case 1:n=g(Math.max(D,e.frameDuration))}return n=g(n-e.elapsedFrameTime-t),this.state!==2&&n<T&&!this._forceTask?(this._forceTask=!0,!1):(n=g(Math.max(n,r)),this._budget.reset(n),this._updateLoad(),this._schedule())}_runFrame(){this._forceTask=!1,this._microTaskQueued=!1,this._run(),this._test&&(this._test.usedBudget=this._budget.elapsed)}stopFrame(){this._budget.reset(g(0)),this._budget.madeProgress()}removeTask(t){e(this._tasks,t),e(this._runQueue,t),this._updatingChanged()}_updateTask(e){this._tasks.forEach(t=>{t.name===e&&t.setPriority(e)})}_getState(e){if(this._runQueue.some(t=>t.name===e))return`s`;let t=`i`;return this._tasks.forEach(n=>{n.name===e&&n.needsUpdate&&(n.schedulePriority<=1?t=`r`:t!==`r`&&(t=`w`))}),t}_getRuntime(e){let t=0;return this._tasks.forEach(n=>{n.name===e&&(t+=n.runtime)}),t}_resetRuntimes(){this._tasks.forEach(e=>e.runtime=0)}_getRunning(){let e=new Map;if(this._tasks.forEach(t=>{t.needsUpdate&&e.set(t.name,(e.get(t.name)||0)+1)}),e.size===0)return null;let t=``;return e.forEach((e,n)=>{t+=e>1?` ${e}x ${n}`:` ${n}`}),t}_updateLoad(){let e=this._tasks.reduce((e,t)=>t.needsUpdate?++e:e,0);this._load=this._load*.9+e*.09999999999999998}_schedule(){for(t(this._runQueue,e=>e.needsUpdate?!0:(e.schedulePriority=e.basePriority,!1)),this._tasks.forEach(e=>{e.basePriority===0&&e.needsUpdate&&!this._runQueue.includes(e)&&e.blockFrame!==this._frameNumber&&this._runQueue.unshift(e)});this._runQueue.length===0;){let e=!1,t=0;if(this._tasks.forEach(n=>{n.needsUpdate&&n.schedulePriority!==0&&n.basePriority!==0&&n.blockFrame!==this._frameNumber&&(e=!0,t=Math.max(t,n.basePriority),n.schedulePriority===1?(n.schedulePriority=0,this._runQueue.push(n)):--n.schedulePriority)}),!e)return this._updatingChanged(),!1}return this._updatingChanged(),!0}_run(){do for(;this._runQueue.length>0;){let e=this._budget.now(),t=this._runQueue.pop();this._budget.resetProgress();try{t.task.runTask(this._budget)===y&&(t.blockFrame=this._frameNumber)}catch(e){r.getLogger(`esri.views.support.Scheduler`).error(`Exception in task "${t.name}"`,e),t.blockFrame=this._frameNumber}!this._budget.hasProgressed&&t.blockFrame!==this._frameNumber&&t.needsUpdate&&(t.name,x.I3S,t.blockFrame=this._frameNumber),t.schedulePriority=t.basePriority;let n=this._budget.now(),i=n-e;if(a(`${t.name}`,e,n,`Maps SDK`,`Scheduling`),t.runtime+=i,this._frameTaskTimes.set(t.priority,this._frameTaskTimes.get(t.priority)+i),this._budget.remaining<=0){this._updatingChanged();return}}while(this._schedule());this._updatingChanged()}_startFrameTaskTimes(){for(let e of Object.keys(x))this._frameTaskTimes.set(x[e],0)}_recordFrameTaskTimes(e){this._frameTaskTimes.forEach((e,t)=>this.performanceInfo.tasks.get(t).push(e)),this.performanceInfo.total.push(e)}get test(){return this._test}}class A{get task(){return this._task.value}get readyToRun(){return this._queue.readyToRun}get updating(){return this._queue.updating}constructor(e,t,r){this._scheduler=e,this.name=t,this.blockFrame=0,this.runtime=0,this._queue=new v,this._handles=new n,this._basePriority=C(t),this.schedulePriority=this._basePriority,this._task=h(r??this._queue),this._handles.add(m(()=>this.task.readyToRun,t=>e.taskRunningChanged(t)))}remove(){this._queue.drain(M),this._scheduler.removeTask(this),this.schedule=F.schedule,this.reschedule=F.reschedule,this.scheduleGenerator=F.scheduleGenerator,this._handles.destroy()}[Symbol.dispose](){this.remove()}get basePriority(){return this._basePriority}setPriority(e){if(this.name===e)return;this.name=e;let t=C(e);(this._basePriority===0||this.schedulePriority!==0)&&(this.schedulePriority=t),this._basePriority=t}get priority(){return this.name}set priority(e){this.setPriority(e)}get needsUpdate(){return this.readyToRun||!this.task.destroyed&&this.task.readyToRun}schedule(e,t,n){return this._queue.push(e,t,n)}reschedule(e,t,n){return this._queue.unshift(e,t,n)}scheduleGenerator(e,t,n){return this._queue.pushGenerator(e,t,n)}processQueue(e){return this._queue.runTask(e)}}class j{constructor(){this._begin=performance?.now()??0,this._budget=0,this._done=!1,this._progressed=!1,this._enabled=!0}run(e){return!this.done&&(e()===!0&&this.madeProgress(),!0)}get done(){return this._done}get budget(){return this._budget}madeProgress(){return this._progressed=!0,this._done=this._enabled&&this._budget!==1/0&&this.elapsed>=this._budget,this._done}get enabled(){return this._enabled}set enabled(e){this._enabled=e}reset(e){this._begin=this.now(),this._budget=e,this.resetProgress()}get remaining(){return Math.max(this._budget-this.elapsed,0)}now(){return performance.now()}get elapsed(){return this.now()-this._begin}resetProgress(){this._progressed=!1,this._done=!1}get hasProgressed(){return this._progressed}}const M=new j;M.enabled=!1;function N(e){let t=new j;return t.reset(e),t}class P{remove(){}[Symbol.dispose](){this.remove()}processQueue(){}schedule(e,t,n){try{if(s(t)){let e=c();return n?Promise.resolve(n(e)):Promise.reject(e)}return l(e(M))}catch(e){return Promise.reject(e)}}reschedule(e,t,n){return this.schedule(e,t,n)}async scheduleGenerator(e,t,n){if(s(t)){let e=c();if(n)return n(e);throw e}let r=e(M);for(;;){let e=r.next(M),i=u(e)?await e:e;if(s(t)){let e=c();if(n){let t=n(e),i=r.return(null);return u(i)&&await d(i),t}let t=r.throw(e);throw u(t)&&await d(t),e}if(i.done)return i.value}}}const F=new P;export{F as ImmediateTask,x as TaskPriority,C as getTaskPriority,N as makeBudget,b as newScheduler,M as noBudget,S as taskPriorities};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- function e(e,t){return e==null?!1:t==null?!0:t===2?!e.isGeographic||e.isWGS84||e.wkid===4490:e.isWebMercator||e.isWGS84||e.wkid===4490||e.wkid===104971||e.wkid===104905||e.wkid===104903}export{e as isSpatialReferenceSupported};
2
+ function e(e,t){return e==null?!1:t==null?!0:t?e.isWebMercator||e.isWGS84||e.wkid===4490||e.wkid===104971||e.wkid===104905||e.wkid===104903:!e.isGeographic||e.isWGS84||e.wkid===4490}export{e as isSpatialReferenceSupported};
@@ -1,7 +1,7 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
2
  import"../../core/has.js";import e from"./reservedWordsGLSL3.js";import{shaderTranspiler as t}from"./testUtils.js";const n=`precision.highp.mediump.lowp.attribute.const.uniform.varying.break.continue.do.for.while.if.else.in.out.inout.float.int.void.bool.true.false.discard.return.mat2.mat3.mat4.vec2.vec3.vec4.ivec2.ivec3.ivec4.uvec2.uvec3.uvec4.bvec2.bvec3.bvec4.sampler1D.sampler2D.sampler3D.usampler1D.usampler2D.usampler3D.samplerCube.sampler1DShadow.sampler2DShadow.struct.asm.class.union.enum.typedef.template.this.packed.goto.switch.default.inline.noinline.volatile.public.static.extern.external.interface.long.short.double.half.fixed.unsigned.input.output.hvec2.hvec3.hvec4.dvec2.dvec3.dvec4.fvec2.fvec3.fvec4.sampler2DRect.sampler3DRect.sampler2DRectShadow.sizeof.cast.namespace.using`.split(`.`),r=`<<= >>= ++ -- << >> <= >= == != && || += -= *= /= %= &= ^^ ^= |= ( ) [ ] . ! ~ * / % + - < > & ^ | ? : = , ; { }`.split(` `),i=`abs.acos.all.any.asin.atan.ceil.clamp.cos.cross.dFdx.dFdy.degrees.distance.dot.equal.exp.exp2.faceforward.floor.fract.gl_BackColor.gl_BackLightModelProduct.gl_BackLightProduct.gl_BackMaterial.gl_BackSecondaryColor.gl_ClipPlane.gl_ClipVertex.gl_Color.gl_DepthRange.gl_DepthRangeParameters.gl_EyePlaneQ.gl_EyePlaneR.gl_EyePlaneS.gl_EyePlaneT.gl_Fog.gl_FogCoord.gl_FogFragCoord.gl_FogParameters.gl_FragColor.gl_FragCoord.gl_FragData.gl_FragDepth.gl_FragDepthEXT.gl_FrontColor.gl_FrontFacing.gl_FrontLightModelProduct.gl_FrontLightProduct.gl_FrontMaterial.gl_FrontSecondaryColor.gl_LightModel.gl_LightModelParameters.gl_LightModelProducts.gl_LightProducts.gl_LightSource.gl_LightSourceParameters.gl_MaterialParameters.gl_MaxClipPlanes.gl_MaxCombinedTextureImageUnits.gl_MaxDrawBuffers.gl_MaxFragmentUniformComponents.gl_MaxLights.gl_MaxTextureCoords.gl_MaxTextureImageUnits.gl_MaxTextureUnits.gl_MaxVaryingFloats.gl_MaxVertexAttribs.gl_MaxVertexTextureImageUnits.gl_MaxVertexUniformComponents.gl_ModelViewMatrix.gl_ModelViewMatrixInverse.gl_ModelViewMatrixInverseTranspose.gl_ModelViewMatrixTranspose.gl_ModelViewProjectionMatrix.gl_ModelViewProjectionMatrixInverse.gl_ModelViewProjectionMatrixInverseTranspose.gl_ModelViewProjectionMatrixTranspose.gl_MultiTexCoord0.gl_MultiTexCoord1.gl_MultiTexCoord2.gl_MultiTexCoord3.gl_MultiTexCoord4.gl_MultiTexCoord5.gl_MultiTexCoord6.gl_MultiTexCoord7.gl_Normal.gl_NormalMatrix.gl_NormalScale.gl_ObjectPlaneQ.gl_ObjectPlaneR.gl_ObjectPlaneS.gl_ObjectPlaneT.gl_Point.gl_PointCoord.gl_PointParameters.gl_PointSize.gl_Position.gl_ProjectionMatrix.gl_ProjectionMatrixInverse.gl_ProjectionMatrixInverseTranspose.gl_ProjectionMatrixTranspose.gl_SecondaryColor.gl_TexCoord.gl_TextureEnvColor.gl_TextureMatrix.gl_TextureMatrixInverse.gl_TextureMatrixInverseTranspose.gl_TextureMatrixTranspose.gl_Vertex.greaterThan.greaterThanEqual.inversesqrt.length.lessThan.lessThanEqual.log.log2.matrixCompMult.max.min.mix.mod.normalize.not.notEqual.pow.radians.reflect.refract.sign.sin.smoothstep.sqrt.step.tan.texture2D.texture2DLod.texture2DProj.texture2DProjLod.textureCube.textureCubeLod.texture2DLodEXT.texture2DProjLodEXT.textureCubeLodEXT.texture2DGradEXT.texture2DProjGradEXT.textureCubeGradEXT.textureSize.texelFetch`.split(`.`);var a=999,o=9999,s=0,c=1,l=2,u=3,d=4,f=5,p=6,m=7,h=8,g=9,_=10,v=11,y=[`block-comment`,`line-comment`,`preprocessor`,`operator`,`integer`,`float`,`ident`,`builtin`,`keyword`,`whitespace`,`eof`,`integer`];function b(){var e=0,t=0,b=a,x,S,C=[],w=[],T=1,E=0,D=0,O=!1,k=!1,A=``,j;return function(e){return w=[],e===null?P():N(e.replace?e.replace(/\r\n/g,`
3
- `):e)};function M(e){e.length&&w.push({type:y[b],data:e,position:D,line:T,column:E})}function N(n){e=0,A+=n,j=A.length;for(var r;x=A[e],e<j;){switch(r=e,b){case s:e=z();break;case c:e=R();break;case l:e=L();break;case u:e=B();break;case d:e=U();break;case v:e=H();break;case f:e=W();break;case o:e=G();break;case g:e=I();break;case a:e=F()}if(r!==e)switch(A[r]){case`
4
- `:E=0,++T;break;default:++E}}return t+=e,A=A.slice(e),w}function P(e){return C.length&&M(C.join(``)),b=_,M(`(eof)`),w}function F(){return C=C.length?[]:C,S===`/`&&x===`*`?(D=t+e-1,b=s,S=x,e+1):S===`/`&&x===`/`?(D=t+e-1,b=c,S=x,e+1):x===`#`?(b=l,D=t+e,e):/\s/.test(x)?(b=g,D=t+e,e):(O=/\d/.test(x),k=/[^\w_]/.test(x),D=t+e,b=O?d:k?u:o,e)}function I(){return/[^\s]/g.test(x)?(M(C.join(``)),b=a,e):(C.push(x),S=x,e+1)}function L(){return(x===`\r`||x===`
3
+ `):e)};function M(e){e.length&&w.push({type:y[b],data:e,position:D,line:T,column:E})}function N(n){e=0,A+=n,j=A.length;for(var r;x=A[e],e<j;){switch(r=e,b){case s:e=z();break;case c:e=R();break;case l:e=L();break;case u:e=B();break;case d:e=U();break;case v:e=H();break;case f:e=W();break;case o:e=G();break;case g:e=I();break;case a:e=F()}r!==e&&(A[r]===`
4
+ `?(E=0,++T):++E)}return t+=e,A=A.slice(e),w}function P(e){return C.length&&M(C.join(``)),b=_,M(`(eof)`),w}function F(){return C=C.length?[]:C,S===`/`&&x===`*`?(D=t+e-1,b=s,S=x,e+1):S===`/`&&x===`/`?(D=t+e-1,b=c,S=x,e+1):x===`#`?(b=l,D=t+e,e):/\s/.test(x)?(b=g,D=t+e,e):(O=/\d/.test(x),k=/[^\w_]/.test(x),D=t+e,b=O?d:k?u:o,e)}function I(){return/[^\s]/g.test(x)?(M(C.join(``)),b=a,e):(C.push(x),S=x,e+1)}function L(){return(x===`\r`||x===`
5
5
  `)&&S!==`\\`?(M(C.join(``)),b=a,e):(C.push(x),S=x,e+1)}function R(){return L()}function z(){return x===`/`&&S===`*`?(C.push(x),M(C.join(``)),b=a,e+1):(C.push(x),S=x,e+1)}function B(){if(S===`.`&&/\d/.test(x))return b=f,e;if(S===`/`&&x===`*`)return b=s,e;if(S===`/`&&x===`/`)return b=c,e;if(x===`.`&&C.length){for(;V(C););return b=f,e}if(x===`;`||x===`)`||x===`(`){if(C.length)for(;V(C););return M(x),b=a,e+1}var t=C.length===2&&x!==`=`;if(/[\w_\d\s]/.test(x)||t){for(;V(C););return b=a,e}return C.push(x),S=x,e+1}function V(e){var t=0,n,i;do{if(n=r.indexOf(e.slice(0,e.length+t).join(``)),i=r[n],n===-1){if(t--+e.length>0)continue;i=e.slice(0,1).join(``)}return M(i),D+=i.length,C=C.slice(i.length),C.length}while(1)}function H(){return/[^a-fA-F0-9]/.test(x)?(M(C.join(``)),b=a,e):(C.push(x),S=x,e+1)}function U(){return x===`.`||/[eE]/.test(x)?(C.push(x),b=f,S=x,e+1):x===`x`&&C.length===1&&C[0]===`0`?(b=v,C.push(x),S=x,e+1):/[^\d]/.test(x)?(M(C.join(``)),b=a,e):(C.push(x),S=x,e+1)}function W(){return x===`f`&&(C.push(x),S=x,e+=1),/[eE]/.test(x)||x===`-`&&/[eE]/.test(S)?(C.push(x),S=x,e+1):/[^\d]/.test(x)?(M(C.join(``)),b=a,e):(C.push(x),S=x,e+1)}function G(){if(/[^\d\w_]/.test(x)){var t=C.join(``);return b=n.indexOf(t)>-1?h:i.indexOf(t)>-1?m:p,M(C.join(``)),b=a,e}return C.push(x),S=x,e+1}}function x(e){var t=b(),n=[];return n=n.concat(t(e)),n=n.concat(t(null)),n}function S(e){return x(e)}function C(e){return e.map(e=>e.type===`eof`?``:e.data).join(``)}const w=new Set([`GL_OES_standard_derivatives`,`GL_EXT_frag_depth`,`GL_EXT_draw_buffers`,`GL_EXT_shader_texture_lod`]);function T(e,t=`100`,n=`300 es`){let r=/^\s*#version\s+([0-9]+(\s+[a-zA-Z]+)?)\s*/;for(let i of e)if(i.type===`preprocessor`){let e=r.exec(i.data);if(e){let r=e[1].replaceAll(/\s{2,}/g,` `);if(r===n)return r;if(r===t)return i.data=`#version `+n,t;throw Error(`unknown glsl version: `+r)}}return e.splice(0,0,{type:`preprocessor`,data:`#version `+n},{type:`whitespace`,data:`
6
6
  `}),null}function E(e,t){for(let n=t-1;n>=0;n--){let t=e[n];if(t.type!==`whitespace`&&t.type!==`block-comment`){if(t.type===`keyword`){if(t.data===`attribute`||t.data===`in`)return!0}else break}}return!1}function D(e,t,n,r){r||=n;for(let i of e)if(i.type===`ident`&&i.data===n){r in t?t[r]++:t[r]=0;let n=t[r];return D(e,t,r+`_`+n,r)}return n}function O(e,t,n=`afterVersion`){function r(e,t){for(let n=t;n<e.length;n++){let t=e[n];if(t.type===`operator`&&t.data===`;`)return n}return null}function i(e){let t=-1,i=0,a=-1;for(let o=0;o<e.length;o++){let s=e[o];if(s.type===`preprocessor`&&(/#(if|ifdef|ifndef)\s+.+/.test(s.data)?++i:/#endif\s*.*/.test(s.data)&&--i),(n===`afterVersion`||n===`afterPrecision`)&&s.type===`preprocessor`&&s.data.startsWith(`#version`)&&(a=Math.max(a,o)),n===`afterPrecision`&&s.type===`keyword`&&s.data===`precision`){let t=r(e,o);if(t===null)throw Error(`precision statement not followed by any semicolons!`);a=Math.max(a,t)}t<a&&i===0&&(t=o)}return t+1}let a={data:`
7
7
  `,type:`whitespace`},o=t=>t<e.length&&/[^\r\n]$/.test(e[t].data),s=i(e);o(s-1)&&e.splice(s++,0,a);for(let n of t)e.splice(s++,0,n);o(s-1)&&o(s)&&e.splice(s,0,a)}function k(e,t,n,r=`lowp`){O(e,[{type:`keyword`,data:`out`},{type:`whitespace`,data:` `},{type:`keyword`,data:r},{type:`whitespace`,data:` `},{type:`keyword`,data:n},{type:`whitespace`,data:` `},{type:`ident`,data:t},{type:`operator`,data:`;`}],`afterPrecision`)}function A(e,t,n,r,i=`lowp`){O(e,[{type:`keyword`,data:`layout`},{type:`operator`,data:`(`},{type:`keyword`,data:`location`},{type:`whitespace`,data:` `},{type:`operator`,data:`=`},{type:`whitespace`,data:` `},{type:`integer`,data:r.toString()},{type:`operator`,data:`)`},{type:`whitespace`,data:` `},{type:`keyword`,data:`out`},{type:`whitespace`,data:` `},{type:`keyword`,data:i},{type:`whitespace`,data:` `},{type:`keyword`,data:n},{type:`whitespace`,data:` `},{type:`ident`,data:t},{type:`operator`,data:`;`}],`afterPrecision`)}function j(e,t){let n,r,i=-1;for(let a=t;a<e.length;a++){let t=e[a];if(t.type===`operator`&&(t.data===`[`&&(n=a),t.data===`]`)){r=a;break}t.type===`integer`&&(i=parseInt(t.data,10))}return n&&r&&e.splice(n,r-n+1),i}function M(t,n){if(t.startsWith(`#version 300`))return t;let r=P(t);if(r!=null)return r;let i=S(t);if(T(i,`100`,`300 es`)===`300 es`)return t;let a=null,o=null,s={},c={};for(let t=0;t<i.length;++t){let r=i[t];switch(r.type){case`keyword`:n===35633&&r.data===`attribute`?r.data=`in`:r.data===`varying`&&(r.data=n===35633?`out`:`in`);break;case`builtin`:if(/^texture(2D|Cube)(Proj)?(Lod|Grad)?(EXT)?$/.test(r.data.trim())&&(r.data=r.data.replaceAll(/(2D|Cube|EXT)/g,``)),n===35632&&r.data===`gl_FragColor`&&(a||(a=D(i,s,`fragColor`),k(i,a,`vec4`)),r.data=a),n===35632&&r.data===`gl_FragData`){let e=j(i,t+1),n=D(i,s,`fragData`);A(i,n,`vec4`,e,`mediump`),r.data=n}else n===35632&&r.data===`gl_FragDepthEXT`&&(o||=D(i,s,`gl_FragDepth`),r.data=o);break;case`ident`:if(e.includes(r.data)){if(n===35633&&E(i,t))throw Error(`attribute in vertex shader uses a name that is a reserved word in glsl 300 es`);r.data in c||(c[r.data]=D(i,s,r.data)),r.data=c[r.data]}}}for(let e=i.length-1;e>=0;--e){let t=i[e];if(t.type===`preprocessor`){let n=t.data.match(/#extension\s+(.*):/);if(n?.[1]&&w.has(n[1].trim())){let t=i[e+1];i.splice(e,t&&t.type===`whitespace`?2:1)}let r=t.data.match(/#ifdef\s+(.*)/);r?.[1]&&w.has(r[1].trim())&&(t.data=`#if 1`);let a=t.data.match(/#ifndef\s+(.*)/);a?.[1]&&w.has(a[1].trim())&&(t.data=`#if 0`)}}return F(t,C(i))}const N=new Map;function P(e){return t.enableCache?N.get(e):null}function F(e,n){return t.enableCache&&N.set(e,n),n}export{M as transpileShader};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import{property as t,subclass as n}from"../../core/accessorSupport/decorators.js";import{multiplyOpacity as r,getContrast as i}from"../../core/colorUtils.js";import{destroyMaybe as a}from"../../core/maybe.js";import{watch as o,initial as s}from"../../core/reactiveUtils.js";import{UpdatingHandles as c}from"../../core/support/UpdatingHandles.js";import{formatDecimal as l,formatImperialArea as u,formatMetricArea as d,formatImperialLength as f,formatMetricLength as p}from"../../core/unitFormatUtils.js";import{convertUnit as m,deriveLengthUnitFromAreaUnit as ee}from"../../core/units.js";import{isSupported as h,geodesicDensify as g,geodesicLengths as _,geodesicAreas as te}from"../../geometry/geodesicUtils.js";import{areaExecute as v}from"../../geometry/operators/areaOperator.js";import{geodeticAreaExecute as y,geodeticAreaLoad as ne}from"../../geometry/operators/geodeticAreaOperator.js";import{geodeticDensifyExecute as b,geodeticDensifyLoad as x}from"../../geometry/operators/geodeticDensifyOperator.js";import{geodeticLengthExecute as S,geodeticLengthLoad as C}from"../../geometry/operators/geodeticLengthOperator.js";import{lengthExecute as w}from"../../geometry/operators/lengthOperator.js";import{simplifyExecute as T}from"../../geometry/operators/simplifyOperator.js";import E from"../../geometry/Point.js";import re from"../../geometry/Polygon.js";import D from"../../geometry/Polyline.js";import{polygonCentroidPoint as ie}from"../../geometry/support/centroid.js";import O from"../../Graphic.js";import{fetchMessageBundle as k,onLocaleChange as A}from"../../intl.js";import j from"../../layers/GraphicsLayer.js";import M from"../../symbols/Font.js";import N from"../../symbols/SimpleFillSymbol.js";import P from"../../symbols/SimpleLineSymbol.js";import F from"../../symbols/SimpleMarkerSymbol.js";import I from"../../symbols/TextSymbol.js";import{SnappingVisualizer2D as L}from"../../views/2d/interactive/SnappingVisualizer2D.js";import R from"../../views/draw/Draw.js";import{createCoordinateHelper as z}from"../../views/interactive/coordinateHelper.js";import{createManipulatorDragEventPipeline as B,screenToMap as V,dragManipulatedObject as H}from"../../views/interactive/dragEventPipeline.js";import{EditGeometry as U}from"../../views/interactive/editGeometry/EditGeometry.js";import{EditGeometryOperations as W}from"../../views/interactive/editGeometry/EditGeometryOperations.js";import{GraphicManipulator as G}from"../../views/interactive/GraphicManipulator.js";import{InteractiveToolBase as K}from"../../views/interactive/InteractiveToolBase.js";import{SnappingContext as q}from"../../views/interactive/snapping/SnappingContext.js";import{createSnapDragEventPipelineStep as J}from"../../views/interactive/snapping/SnappingDragPipelineStep.js";import{setupSnappingToggleHandles as Y}from"../../views/interactive/snapping/snappingUtils.js";const X=1e5;let Z=class extends K{constructor(e){super(e),this._measurementLayer=new j({internal:!0,listMode:`hide`,visible:!1,title:`Area measurement layer`}),this._manipulatorLayer=new j({internal:!0,listMode:`hide`,visible:!1,title:`Area measurement manipulator layer`}),this._snappingLayer=new j({internal:!0,listMode:`hide`,visible:!1,title:`Area measurement snapping layer`}),this._updatingHandles=new c,this._vertices=[],this._drawActive=!1,this.measurement=null,this.measurementLabel=null}initialize(){k(`esri/core/t9n/Units`).then(e=>{this.messages=e});let e=this.view;this._draw=new R({view:e}),e.map.addMany([this._measurementLayer,this._manipulatorLayer,this._snappingLayer]),e.focus(),this.addHandles([A(async()=>{this.messages=await k(`esri/core/t9n/Units`)}),o(()=>[this.unit,this.messages],()=>{this._updateGraphics()},s),o(()=>[this.view.effectiveTheme.accentColor,this.view.effectiveTheme.textColor],()=>{if(!this._vertices.length)return;let e=this._vertices.map(({coord:e})=>e);for(let{handle:e}of this._vertices)e.remove();this._vertices=[],this._measurementLayer.removeAll(),this._manipulatorLayer.removeAll(),this._snappingLayer.removeAll(),this.manipulators.removeAll(),this._updateSketch(e)})]),Y(this)}destroy(){let{map:e}=this.view;this._draw.view=null,this._draw=a(this._draw),e.removeMany([this._measurementLayer,this._manipulatorLayer,this._snappingLayer]),this._measurementLayer.removeAll(),this._manipulatorLayer.removeAll(),this._snappingLayer.removeAll(),this._set(`measurement`,null),this._set(`measurementLabel`,null),this._measurementLayer=a(this._measurementLayer),this._manipulatorLayer=a(this._manipulatorLayer),this._snappingLayer=a(this._snappingLayer),this._updatingHandles=a(this._updatingHandles),this._resetVertices()}get cursor(){return this._drawActive?`crosshair`:null}set editable(e){this._set(`editable`,e),e||this._draw.reset()}get snappingOptions(){return this.snappingManager.options}get updating(){return this._updatingHandles.updating||this.snappingManager.updating}onActivate(){!this._drawActive&&this._vertices.length===0&&this._startSketch()}onShow(){this._measurementLayer.visible=!0,this._manipulatorLayer.visible=!0,this._snappingLayer.visible=!0}onHide(){this._measurementLayer.visible=!1,this._manipulatorLayer.visible=!1,this._snappingLayer.visible=!1}reset(){this.manipulators.removeAll(),this._resetVertices(),this._measurementLayer.removeAll(),this._manipulatorLayer.removeAll(),this._set(`measurement`,null),this._set(`measurementLabel`,null),this._draw.reset(),this._drawActive=!1}_getSnappingContext(e){return new q({elevationInfo:{mode:`on-the-ground`,offset:0},pointer:e,editGeometryOperations:new W(new U(`point`,z(!1,!1,this.view.spatialReference)),2),visualizer:new L(this._snappingLayer)})}_resetVertices(){for(let{handle:e}of this._vertices)e.remove();this._vertices=[]}_startSketch(){this._drawActive=!0;let{snappingManager:e}=this;this._draw.create(`polyline`,{mode:`click`,snappingManager:e}).on([`draw-complete`,`vertex-add`,`vertex-update`,`vertex-remove`,`cursor-update`,`undo`,`redo`],e=>{this._updateSketch(e.vertices),e.type===`draw-complete`&&this._stopSketch()})}_stopSketch(){this._vertices.length<3?(this.reset(),this._startSketch()):(this.manipulators.forEach(({manipulator:e})=>{e.interactive=!0}),this._drawActive=!1,this.finishToolCreation())}_updateSketch(e){let{spatialReference:t}=this.view;for(;this._vertices.length>e.length;){let{handle:e,manipulator:t}=this._vertices.pop();e.remove(),this.manipulators.remove(t)}for(let n=this._vertices.length;n<e.length;n++){let[r,i]=e[n],a=new E({x:r,y:i,spatialReference:t}),o=ae(a,this.view,this._manipulatorLayer);this.manipulators.add(o);let s=W.fromGeometry(a,2);s.on(`vertex-update`,e=>{let t=e.vertices.at(0);t&&(this._vertices[n].coord=[t.pos[0],t.pos[1]],this._updateGraphics())});let c=B(o,(e,t,n,r)=>{let i=this._getSnappingContext(r),{snappingManager:a}=this,o=this._updatingHandles,{snappingStep:c}=J({snappingContext:i,snappingManager:a,updatingHandles:o});t.next(V(this.view)).next(t=>{if(t.action===`start`){let n=new E(t.mapStart);e.graphic.geometry=n,s.trySetGeometry(n)}return t}).next(...c).next(H({operations:s})).next(()=>{e.graphic.geometry=s.data.geometry})});this._vertices.push({manipulator:o,coord:[r,i],handle:c})}if(this._vertices.length){let n=this._vertices.length-1,r=this._vertices[n],[i,a]=e[n];(r.coord[0]!==i||r.coord[1]!==a)&&(r.coord=[i,a],r.manipulator.graphic.geometry=new E({x:i,y:a,spatialReference:t}));let o=this._drawActive?this._vertices[n].manipulator:null;this.manipulators.forEach(({manipulator:e})=>{e.interactive=o==null||e!==o})}this._updateGraphics()}_updateGraphics(){if(this._vertices.length<2){this._measurementLayer.removeAll();return}let e=Q(this._vertices.map(({coord:e})=>e),this.view.spatialReference);if(!e)return;let{measurement:t,fillGeometry:n,outlineGeometry:a}=e;this._set(`measurement`,t);let o=t?$(this.messages,t,this.unit):null;if(this._set(`measurementLabel`,o),!n&&!a)return;let s,c,l,{graphics:u}=this._measurementLayer,d=u.length===3,{effectiveTheme:f}=this.view;d?(s=u.at(0),c=u.at(1),l=u.at(2)):(s=new O({symbol:new N({color:r(f.accentColor,.3),outline:null})}),c=new O({symbol:new P({color:f.accentColor,width:2})}),l=new O({symbol:new I({color:f.textColor,font:new M({size:14,family:`sans-serif`}),haloColor:r(i(f.textColor,160),.5),haloSize:2})}),u.removeAll(),u.addMany([s,c,l])),s.geometry=n,c.geometry=a;let p=n?ie(n):null,m=p?E.fromJSON(p):null;l.geometry=m,l.symbol.text=o?.area??``}};e([t()],Z.prototype,`_drawActive`,void 0),e([t({readOnly:!0})],Z.prototype,`cursor`,null),e([t({value:!0})],Z.prototype,`editable`,null),e([t({readOnly:!0})],Z.prototype,`measurement`,void 0),e([t({readOnly:!0})],Z.prototype,`measurementLabel`,void 0),e([t()],Z.prototype,`messages`,void 0),e([t({constructOnly:!0})],Z.prototype,`snappingManager`,void 0),e([t()],Z.prototype,`unit`,void 0),e([t()],Z.prototype,`updating`,null),e([t({constructOnly:!0})],Z.prototype,`view`,void 0),Z=e([n(`esri.widgets.AreaMeasurement2D.AreaMeasurement2DTool`)],Z);function ae(e,t,n){let i={style:`circle`,color:r(t.effectiveTheme.accentColor,.5),outline:{type:`simple-line`,width:0}},a=new F({...i,size:8}),o=new F({...i,size:12}),s=new O({geometry:e,symbol:a});return new G({view:t,layer:n,graphic:s,focusedSymbol:o,consumesClicks:!1})}function Q(e,t){if(e.length===2){let n=new D({paths:[e],spatialReference:t}),r;return r=t.isGeographic?h(t)?g(n,X):b(n,X,{unit:`meters`}):t.isWebMercator?b(n,X,{unit:`meters`}):n,{measurement:null,fillGeometry:null,outlineGeometry:r}}e.push(e[0]);let n=new D({paths:[e],spatialReference:t}),r=new re({rings:[e],spatialReference:t}),i=null,a=null,o,s;if(t.isGeographic){if(h(t)){if(i=g(n,X),a=g(r,X),a=T(a),!a)return null;o=_([n],`meters`)[0],s=te([a],`square-meters`)[0]}else{if(i=b(n,X,{unit:`meters`}),a=b(r,X,{unit:`meters`}),a=T(a),!a)return null;o=S(n,{unit:`meters`}),s=y(a,{unit:`square-meters`})}}else if(t.isWebMercator){if(i=b(n,X,{unit:`meters`}),a=b(r,X,{unit:`meters`}),!a||!i||(a=T(a),!a))return null;o=S(n,{unit:`meters`}),s=y(a,{unit:`square-meters`})}else{if(i=n,a=T(r),!a)return null;o=w(n,{unit:`meters`}),s=v(a,{unit:`square-meters`})}return{measurement:{geometry:a,area:s,perimeter:o},fillGeometry:a,outlineGeometry:i}}function oe(e){return e!=null}async function se(e){(e?.isGeographic&&!h(e)||e?.isWebMercator)&&await Promise.all([ne(),x(),C()])}function $(e,t,n){if(!t||!e)return null;let r={area:null,perimeter:null},{area:i,perimeter:a}=t;switch(n){case`metric`:r.area=d(e,i,`square-meters`);break;case`imperial`:r.area=u(e,i,`square-meters`);break;default:{let t=m(i,`square-meters`,n);r.area=l(e,t,n);break}}let o=ee(n);if(o)switch(o){case`metric`:r.perimeter=p(e,a,`meters`);break;case`imperial`:r.perimeter=f(e,a,`meters`);break;default:{let t=m(a,`meters`,o);r.perimeter=l(e,t,o);break}}else r.perimeter=``;return r}export{Z as AreaMeasurement2DTool,Q as createAreaMeasurementInfo2D,$ as createAreaMeasurementLabel,oe as isSupported,se as loadGeometryOperators};
2
+ import{__decorate as e}from"tslib";import{property as t,subclass as n}from"../../core/accessorSupport/decorators.js";import{multiplyOpacity as r,getContrast as i}from"../../core/colorUtils.js";import{destroyMaybe as a}from"../../core/maybe.js";import{watch as o,initial as s}from"../../core/reactiveUtils.js";import{UpdatingHandles as c}from"../../core/support/UpdatingHandles.js";import{formatDecimal as l,formatImperialArea as u,formatMetricArea as d,formatImperialLength as f,formatMetricLength as p}from"../../core/unitFormatUtils.js";import{convertUnit as m,deriveLengthUnitFromAreaUnit as ee}from"../../core/units.js";import{isSupported as h,geodesicDensify as g,geodesicLengths as _,geodesicAreas as te}from"../../geometry/geodesicUtils.js";import{areaExecute as v}from"../../geometry/operators/areaOperator.js";import{geodeticAreaExecute as y,geodeticAreaLoad as ne}from"../../geometry/operators/geodeticAreaOperator.js";import{geodeticDensifyExecute as b,geodeticDensifyLoad as x}from"../../geometry/operators/geodeticDensifyOperator.js";import{geodeticLengthExecute as S,geodeticLengthLoad as C}from"../../geometry/operators/geodeticLengthOperator.js";import{lengthExecute as w}from"../../geometry/operators/lengthOperator.js";import{simplifyExecute as T}from"../../geometry/operators/simplifyOperator.js";import E from"../../geometry/Point.js";import re from"../../geometry/Polygon.js";import D from"../../geometry/Polyline.js";import{polygonCentroidPoint as ie}from"../../geometry/support/centroid.js";import O from"../../Graphic.js";import{fetchMessageBundle as k,onLocaleChange as A}from"../../intl.js";import j from"../../layers/GraphicsLayer.js";import M from"../../symbols/Font.js";import N from"../../symbols/SimpleFillSymbol.js";import P from"../../symbols/SimpleLineSymbol.js";import F from"../../symbols/SimpleMarkerSymbol.js";import I from"../../symbols/TextSymbol.js";import{SnappingVisualizer2D as L}from"../../views/2d/interactive/SnappingVisualizer2D.js";import R from"../../views/draw/Draw.js";import{createCoordinateHelper as z}from"../../views/interactive/coordinateHelper.js";import{createManipulatorDragEventPipeline as B,screenToMap as V,dragManipulatedObject as H}from"../../views/interactive/dragEventPipeline.js";import{EditGeometry as U}from"../../views/interactive/editGeometry/EditGeometry.js";import{EditGeometryOperations as W}from"../../views/interactive/editGeometry/EditGeometryOperations.js";import{GraphicManipulator as G}from"../../views/interactive/GraphicManipulator.js";import{InteractiveToolBase as K}from"../../views/interactive/InteractiveToolBase.js";import{SnappingContext as q}from"../../views/interactive/snapping/SnappingContext.js";import{createSnapDragEventPipelineStep as J}from"../../views/interactive/snapping/SnappingDragPipelineStep.js";import{setupSnappingToggleHandles as Y}from"../../views/interactive/snapping/snappingUtils.js";const X=1e5;let Z=class extends K{constructor(e){super(e),this._measurementLayer=new j({internal:!0,listMode:`hide`,visible:!1,title:`Area measurement layer`}),this._manipulatorLayer=new j({internal:!0,listMode:`hide`,visible:!1,title:`Area measurement manipulator layer`}),this._snappingLayer=new j({internal:!0,listMode:`hide`,visible:!1,title:`Area measurement snapping layer`}),this._updatingHandles=new c,this._vertices=[],this._drawActive=!1,this.measurement=null,this.measurementLabel=null}initialize(){k(`esri/core/t9n/Units`).then(e=>{this.messages=e});let e=this.view;this._draw=new R({view:e}),e.map.addMany([this._measurementLayer,this._manipulatorLayer,this._snappingLayer]),e.focus(),this.addHandles([A(async()=>{this.messages=await k(`esri/core/t9n/Units`)}),o(()=>[this.unit,this.messages],()=>{this._updateGraphics()},s),o(()=>[this.view.effectiveTheme.accentColor,this.view.effectiveTheme.textColor],()=>{if(!this._vertices.length)return;let e=this._vertices.map(({coord:e})=>e);for(let{handle:e}of this._vertices)e.remove();this._vertices=[],this._measurementLayer.removeAll(),this._manipulatorLayer.removeAll(),this._snappingLayer.removeAll(),this.manipulators.removeAll(),this._updateSketch(e)})]),Y(this)}destroy(){let{map:e}=this.view;this._draw.view=null,this._draw=a(this._draw),e.removeMany([this._measurementLayer,this._manipulatorLayer,this._snappingLayer]),this._measurementLayer.removeAll(),this._manipulatorLayer.removeAll(),this._snappingLayer.removeAll(),this._set(`measurement`,null),this._set(`measurementLabel`,null),this._measurementLayer=a(this._measurementLayer),this._manipulatorLayer=a(this._manipulatorLayer),this._snappingLayer=a(this._snappingLayer),this._updatingHandles=a(this._updatingHandles),this._resetVertices()}get cursor(){return this._drawActive?`crosshair`:null}set editable(e){this._set(`editable`,e),e||this._draw.reset()}get snappingOptions(){return this.snappingManager.options}get updating(){return this._updatingHandles.updating||this.snappingManager.updating}onActivate(){!this._drawActive&&this._vertices.length===0&&this._startSketch()}onShow(){this._measurementLayer.visible=!0,this._manipulatorLayer.visible=!0,this._snappingLayer.visible=!0}onHide(){this._measurementLayer.visible=!1,this._manipulatorLayer.visible=!1,this._snappingLayer.visible=!1}reset(){this.manipulators.removeAll(),this._resetVertices(),this._measurementLayer.removeAll(),this._manipulatorLayer.removeAll(),this._set(`measurement`,null),this._set(`measurementLabel`,null),this._draw.reset(),this._drawActive=!1}_getSnappingContext(e){return new q({elevationInfo:{mode:`on-the-ground`,offset:0},pointer:e,editGeometryOperations:new W(new U(`point`,z(!1,!1,this.view.spatialReference)),this.view.state.isGlobal),visualizer:new L(this._snappingLayer)})}_resetVertices(){for(let{handle:e}of this._vertices)e.remove();this._vertices=[]}_startSketch(){this._drawActive=!0;let{snappingManager:e}=this;this._draw.create(`polyline`,{mode:`click`,snappingManager:e}).on([`draw-complete`,`vertex-add`,`vertex-update`,`vertex-remove`,`cursor-update`,`undo`,`redo`],e=>{this._updateSketch(e.vertices),e.type===`draw-complete`&&this._stopSketch()})}_stopSketch(){this._vertices.length<3?(this.reset(),this._startSketch()):(this.manipulators.forEach(({manipulator:e})=>{e.interactive=!0}),this._drawActive=!1,this.finishToolCreation())}_updateSketch(e){let{spatialReference:t}=this.view;for(;this._vertices.length>e.length;){let{handle:e,manipulator:t}=this._vertices.pop();e.remove(),this.manipulators.remove(t)}for(let n=this._vertices.length;n<e.length;n++){let[r,i]=e[n],a=new E({x:r,y:i,spatialReference:t}),o=ae(a,this.view,this._manipulatorLayer);this.manipulators.add(o);let s=W.fromGeometry(a,this.view.state.isGlobal);s.on(`vertex-update`,e=>{let t=e.vertices.at(0);t&&(this._vertices[n].coord=[t.pos[0],t.pos[1]],this._updateGraphics())});let c=B(o,(e,t,n,r)=>{let i=this._getSnappingContext(r),{snappingManager:a}=this,o=this._updatingHandles,{snappingStep:c}=J({snappingContext:i,snappingManager:a,updatingHandles:o});t.next(V(this.view)).next(t=>{if(t.action===`start`){let n=new E(t.mapStart);e.graphic.geometry=n,s.trySetGeometry(n)}return t}).next(...c).next(H({operations:s})).next(()=>{e.graphic.geometry=s.data.geometry})});this._vertices.push({manipulator:o,coord:[r,i],handle:c})}if(this._vertices.length){let n=this._vertices.length-1,r=this._vertices[n],[i,a]=e[n];(r.coord[0]!==i||r.coord[1]!==a)&&(r.coord=[i,a],r.manipulator.graphic.geometry=new E({x:i,y:a,spatialReference:t}));let o=this._drawActive?this._vertices[n].manipulator:null;this.manipulators.forEach(({manipulator:e})=>{e.interactive=o==null||e!==o})}this._updateGraphics()}_updateGraphics(){if(this._vertices.length<2){this._measurementLayer.removeAll();return}let e=Q(this._vertices.map(({coord:e})=>e),this.view.spatialReference);if(!e)return;let{measurement:t,fillGeometry:n,outlineGeometry:a}=e;this._set(`measurement`,t);let o=t?$(this.messages,t,this.unit):null;if(this._set(`measurementLabel`,o),!n&&!a)return;let s,c,l,{graphics:u}=this._measurementLayer,d=u.length===3,{effectiveTheme:f}=this.view;d?(s=u.at(0),c=u.at(1),l=u.at(2)):(s=new O({symbol:new N({color:r(f.accentColor,.3),outline:null})}),c=new O({symbol:new P({color:f.accentColor,width:2})}),l=new O({symbol:new I({color:f.textColor,font:new M({size:14,family:`sans-serif`}),haloColor:r(i(f.textColor,160),.5),haloSize:2})}),u.removeAll(),u.addMany([s,c,l])),s.geometry=n,c.geometry=a;let p=n?ie(n):null,m=p?E.fromJSON(p):null;l.geometry=m,l.symbol.text=o?.area??``}};e([t()],Z.prototype,`_drawActive`,void 0),e([t({readOnly:!0})],Z.prototype,`cursor`,null),e([t({value:!0})],Z.prototype,`editable`,null),e([t({readOnly:!0})],Z.prototype,`measurement`,void 0),e([t({readOnly:!0})],Z.prototype,`measurementLabel`,void 0),e([t()],Z.prototype,`messages`,void 0),e([t({constructOnly:!0})],Z.prototype,`snappingManager`,void 0),e([t()],Z.prototype,`unit`,void 0),e([t()],Z.prototype,`updating`,null),e([t({constructOnly:!0})],Z.prototype,`view`,void 0),Z=e([n(`esri.widgets.AreaMeasurement2D.AreaMeasurement2DTool`)],Z);function ae(e,t,n){let i={style:`circle`,color:r(t.effectiveTheme.accentColor,.5),outline:{type:`simple-line`,width:0}},a=new F({...i,size:8}),o=new F({...i,size:12}),s=new O({geometry:e,symbol:a});return new G({view:t,layer:n,graphic:s,focusedSymbol:o,consumesClicks:!1})}function Q(e,t){if(e.length===2){let n=new D({paths:[e],spatialReference:t}),r;return r=t.isGeographic?h(t)?g(n,X):b(n,X,{unit:`meters`}):t.isWebMercator?b(n,X,{unit:`meters`}):n,{measurement:null,fillGeometry:null,outlineGeometry:r}}e.push(e[0]);let n=new D({paths:[e],spatialReference:t}),r=new re({rings:[e],spatialReference:t}),i=null,a=null,o,s;if(t.isGeographic){if(h(t)){if(i=g(n,X),a=g(r,X),a=T(a),!a)return null;o=_([n],`meters`)[0],s=te([a],`square-meters`)[0]}else{if(i=b(n,X,{unit:`meters`}),a=b(r,X,{unit:`meters`}),a=T(a),!a)return null;o=S(n,{unit:`meters`}),s=y(a,{unit:`square-meters`})}}else if(t.isWebMercator){if(i=b(n,X,{unit:`meters`}),a=b(r,X,{unit:`meters`}),!a||!i||(a=T(a),!a))return null;o=S(n,{unit:`meters`}),s=y(a,{unit:`square-meters`})}else{if(i=n,a=T(r),!a)return null;o=w(n,{unit:`meters`}),s=v(a,{unit:`square-meters`})}return{measurement:{geometry:a,area:s,perimeter:o},fillGeometry:a,outlineGeometry:i}}function oe(e){return e!=null}async function se(e){(e?.isGeographic&&!h(e)||e?.isWebMercator)&&await Promise.all([ne(),x(),C()])}function $(e,t,n){if(!t||!e)return null;let r={area:null,perimeter:null},{area:i,perimeter:a}=t;switch(n){case`metric`:r.area=d(e,i,`square-meters`);break;case`imperial`:r.area=u(e,i,`square-meters`);break;default:{let t=m(i,`square-meters`,n);r.area=l(e,t,n);break}}let o=ee(n);if(o)switch(o){case`metric`:r.perimeter=p(e,a,`meters`);break;case`imperial`:r.perimeter=f(e,a,`meters`);break;default:{let t=m(a,`meters`,o);r.perimeter=l(e,t,o);break}}else r.perimeter=``;return r}export{Z as AreaMeasurement2DTool,Q as createAreaMeasurementInfo2D,$ as createAreaMeasurementLabel,oe as isSupported,se as loadGeometryOperators};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{isSome as e}from"../../../core/arrayUtils.js";import t from"../../../core/Error.js";import{throwIfAborted as n}from"../../../core/promiseUtils.js";import{isTiledLayer as r,isBasemap3DSupportedLayer as i,isIntegratedMesh3DTilesLayer as a,isBasemapSupportedTiledLayer as o}from"../../../layers/support/layerUtils.js";import{getTileInfoAndExtentFromWMTSLayer as s,checkIfTileInfoSupportedForView as c}from"../../../views/3d/terrain/terrainUtils.js";import{TilingScheme as l}from"../../../views/3d/terrain/TilingScheme.js";import{isSpatialReferenceSupported as u}from"../../../views/support/spatialReferenceSupport.js";import{stringFromViewingMode as d}from"../../../views/ViewingMode.js";async function f(e,t={}){let{basemap:r,view:i}=e;await r.load(t),h(r),await _(r,i,t),n(t)}async function p(t,i={}){let{basemap:a,view:o}=t;n(i);let s=a.baseLayers.find(e=>e.type===`unknown`)?.loadError;if(s!=null)throw s;if(!o||`spatialReferenceLocked`in o&&!o.spatialReferenceLocked||(await a.load(i),n(i),a.baseLayers.length===0))return;let c=a.baseLayers.at(0);if(!r(c))return;if(a.spatialReference){if(o.spatialReference.equals(a.spatialReference))return;m()}await c.load(i),n(i);let l=((`supportedSpatialReferences`in c?c.supportedSpatialReferences:null)||[`tileInfo`in c?c.tileInfo?.spatialReference:null]).filter(e);l.length!==0&&l.every(e=>!o.spatialReference.equals(e))&&m()}function m(){throw new t(`basemap-compatibility:incompatible-spatial-reference`,`Basemap spatial reference is not compatible with the view`)}function h(e){if(e.baseLayers.length===0&&e.groundLayers.length===0&&e.referenceLayers.length===0)return;let t=e.baseLayers.concat(e.referenceLayers).toArray().filter(e=>!i(e)).map(e=>g(e));if(t.length||e.groundLayers&&e.groundLayers.filter(e=>!a(e)).map(e=>g(e)).length)throw t[0]}function g(e){return new t(`basemap-compatibility:unsupported-basemap-layer-type`,"Unsupported basemap layer type ${operationalLayerType}",{layer:e,operationalLayerType:e.operationalLayerType||`unknown`})}async function _(e,n,r){let i=e.baseLayers.at(0);if(e.groundLayers?.length>0)i=e.groundLayers.at(0);else if(e.baseLayers.length>0)i=e.baseLayers.at(0);else return;if(o(i)){try{await i.load(r)}catch(e){let{name:n=`basemap-compatibility:unknown-error`,message:r=`Unknown basemap compatibility error`,details:i}=e;throw new t(n,r,i)}v(i,n)}}function v(e,n){let r=n.state.viewingMode;if(!r)return;let i,a;if(e?.type===`wmts`){let o=s(e,n.spatialReference,r);if(o.tileInfo==null)throw new t(`basemapgalleryitem:tiling-scheme-incompatible`,`Basemap tiling scheme is incompatible with the view`);i=o.tileInfo,a=o.fullExtent}else i=e.tileInfo,a=e.fullExtent;if(i==null)return;if(!u(i.spatialReference,r))throw new t(`basemapgalleryitem:spatial-reference-unsupported-${d(r)}`,`Basemap spatial reference is unsupported in ${d(r)} mode`);let o=e?.type===`vector-tile`?i.getCompatibleForVTL(256):null;if(r===1){let n=c(i,a,null,r);if(n&&e?.type===`vector-tile`&&a!=null&&o&&!c(o,a,null,r)&&(n=null),n){let e=i.spatialReference.isWebMercator?`web-mercator`:`wgs84`;throw new t(`basemapgalleryitem:tiling-scheme-unsupported-${e}-global`,`Basemap tiling scheme is unsupported in global mode`,{error:n})}}else if(l.checkUnsupported(i))throw new t(`basemapgalleryitem:tiling-scheme-unsupported-local`,`Basemap tiling scheme is unsupported in local mode`);let f=n.basemapTerrain?.tilingScheme;if(f&&!f.compatibleWith(i)&&!(e?.type===`vector-tile`&&o&&f.compatibleWith(o)))throw new t(`basemapgalleryitem:tiling-scheme-incompatible`,`Basemap tiling scheme is incompatible with the view`)}export{p as default2DCompatibility,f as default3DCompatibility};
2
+ import{isSome as e}from"../../../core/arrayUtils.js";import t from"../../../core/Error.js";import{throwIfAborted as n}from"../../../core/promiseUtils.js";import{isTiledLayer as r,isBasemap3DSupportedLayer as i,isIntegratedMesh3DTilesLayer as a,isBasemapSupportedTiledLayer as o}from"../../../layers/support/layerUtils.js";import{getTileInfoAndExtentFromWMTSLayer as s,checkIfTileInfoSupportedForView as c}from"../../../views/3d/terrain/terrainUtils.js";import{TilingScheme as l}from"../../../views/3d/terrain/TilingScheme.js";import{isSpatialReferenceSupported as u}from"../../../views/support/spatialReferenceSupport.js";import{stringFromIsGlobal as d}from"../../../views/ViewingMode.js";async function f(e,t={}){let{basemap:r,view:i}=e;await r.load(t),h(r),await _(r,i,t),n(t)}async function p(t,i={}){let{basemap:a,view:o}=t;n(i);let s=a.baseLayers.find(e=>e.type===`unknown`)?.loadError;if(s!=null)throw s;if(!o||`spatialReferenceLocked`in o&&!o.spatialReferenceLocked||(await a.load(i),n(i),a.baseLayers.length===0))return;let c=a.baseLayers.at(0);if(!r(c))return;if(a.spatialReference){if(o.spatialReference.equals(a.spatialReference))return;m()}await c.load(i),n(i);let l=((`supportedSpatialReferences`in c?c.supportedSpatialReferences:null)||[`tileInfo`in c?c.tileInfo?.spatialReference:null]).filter(e);l.length!==0&&l.every(e=>!o.spatialReference.equals(e))&&m()}function m(){throw new t(`basemap-compatibility:incompatible-spatial-reference`,`Basemap spatial reference is not compatible with the view`)}function h(e){if(e.baseLayers.length===0&&e.groundLayers.length===0&&e.referenceLayers.length===0)return;let t=e.baseLayers.concat(e.referenceLayers).toArray().filter(e=>!i(e)).map(e=>g(e));if(t.length||e.groundLayers&&e.groundLayers.filter(e=>!a(e)).map(e=>g(e)).length)throw t[0]}function g(e){return new t(`basemap-compatibility:unsupported-basemap-layer-type`,"Unsupported basemap layer type ${operationalLayerType}",{layer:e,operationalLayerType:e.operationalLayerType||`unknown`})}async function _(e,n,r){let i=e.baseLayers.at(0);if(e.groundLayers?.length>0)i=e.groundLayers.at(0);else if(e.baseLayers.length>0)i=e.baseLayers.at(0);else return;if(o(i)){try{await i.load(r)}catch(e){let{name:n=`basemap-compatibility:unknown-error`,message:r=`Unknown basemap compatibility error`,details:i}=e;throw new t(n,r,i)}v(i,n)}}function v(e,n){let r=n.state.isGlobal,i,a;if(e?.type===`wmts`){let o=s(e,n.spatialReference,r);if(o.tileInfo==null)throw new t(`basemapgalleryitem:tiling-scheme-incompatible`,`Basemap tiling scheme is incompatible with the view`);i=o.tileInfo,a=o.fullExtent}else i=e.tileInfo,a=e.fullExtent;if(i==null)return;if(!u(i.spatialReference,r))throw new t(`basemapgalleryitem:spatial-reference-unsupported-${d(r)}`,`Basemap spatial reference is unsupported in ${d(r)} mode`);let o=e?.type===`vector-tile`?i.getCompatibleForVTL(256):null;if(r){let n=c(i,a,null,r);if(n&&e?.type===`vector-tile`&&a!=null&&o&&!c(o,a,null,r)&&(n=null),n){let e=i.spatialReference.isWebMercator?`web-mercator`:`wgs84`;throw new t(`basemapgalleryitem:tiling-scheme-unsupported-${e}-global`,`Basemap tiling scheme is unsupported in global mode`,{error:n})}}else if(l.checkUnsupported(i))throw new t(`basemapgalleryitem:tiling-scheme-unsupported-local`,`Basemap tiling scheme is unsupported in local mode`);let f=n.basemapTerrain?.tilingScheme;if(f&&!f.compatibleWith(i)&&!(e?.type===`vector-tile`&&o&&f.compatibleWith(o)))throw new t(`basemapgalleryitem:tiling-scheme-incompatible`,`Basemap tiling scheme is incompatible with the view`)}export{p as default2DCompatibility,f as default3DCompatibility};