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

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 (467) 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/arcgisGlobal.d.ts +1 -0
  10. package/assets/esri/core/workers/RemoteClient.js +1 -1
  11. package/assets/esri/core/workers/chunks/0329fa3aa3403f1c243b.js +1 -0
  12. package/assets/esri/core/workers/chunks/033b9fcd9833db3b6e7d.js +1 -0
  13. package/assets/esri/core/workers/chunks/{6602310c3fcd91fb6a2f.js → 07c8ac092e4b9e8d5b3c.js} +1 -1
  14. package/assets/esri/core/workers/chunks/0978e12dd6a1cbc50b80.js +1 -0
  15. package/assets/esri/core/workers/chunks/0a97b1974367382cfdf5.js +1 -0
  16. package/assets/esri/core/workers/chunks/{db0a7671ab5cbe8afd72.js → 123661019bb69c53f2d3.js} +1 -1
  17. package/assets/esri/core/workers/chunks/{e956845255bce0910944.js → 1507297550c3cd1268e2.js} +1 -1
  18. package/assets/esri/core/workers/chunks/{1b41ba050cde068d2860.js → 193a73a2c7f4f8482c21.js} +1 -1
  19. package/assets/esri/core/workers/chunks/1c0f5c42331fb6fc26cb.js +1 -0
  20. package/assets/esri/core/workers/chunks/20acb6f3ed5140b6c6c6.js +1 -0
  21. package/assets/esri/core/workers/chunks/2cd2fcf4a37d180d5d5c.js +1 -0
  22. package/assets/esri/core/workers/chunks/2f9adf0b809ce8797ebf.js +1 -0
  23. package/assets/esri/core/workers/chunks/{afb4dfb89fbc8a342cc5.js → 3354f1fa90f8ce4c8fde.js} +1 -1
  24. package/assets/esri/core/workers/chunks/3982409149571a827390.js +1 -0
  25. package/assets/esri/core/workers/chunks/{9b458b0d1627f22fdd93.js → 3b11e4d2e69b7aea1d65.js} +1 -1
  26. package/assets/esri/core/workers/chunks/3d851710f7fcc27c5b60.js +2 -0
  27. package/assets/esri/core/workers/chunks/3e8d70039800f2395d66.js +1 -0
  28. package/assets/esri/core/workers/chunks/41694ee8990e799da225.js +1 -0
  29. package/assets/esri/core/workers/chunks/4d8539674fc2e4fea03c.js +1 -0
  30. package/assets/esri/core/workers/chunks/{12add2003631fa314f25.js → 5060be52a380fc4920f8.js} +1 -1
  31. package/assets/esri/core/workers/chunks/{2aa6be0b047a1b25a520.js → 53bbb9aa6e4e4a0a8121.js} +1 -1
  32. package/assets/esri/core/workers/chunks/{c6d82397044e403a1f61.js → 5954f02c3901b28d8e73.js} +1 -1
  33. package/assets/esri/core/workers/chunks/5ba6007c3c49a8153256.js +1 -0
  34. package/assets/esri/core/workers/chunks/5bdd95eeb8f34dbf26f2.js +2 -0
  35. package/assets/esri/core/workers/chunks/{4707aedcc1b3bdf5e987.js → 5c34d49a6c9cc34b7626.js} +1 -1
  36. package/assets/esri/core/workers/chunks/{ced5dfb2bf46fc5eac8c.js → 5e47026c681238038955.js} +2 -2
  37. package/assets/esri/core/workers/chunks/{2baf35b1b19482d603b5.js → 5f7505ada0991cfbdd84.js} +1 -1
  38. package/assets/esri/core/workers/chunks/{976303f47c342b9d1cc0.js → 62ddd3a82864e26f009a.js} +1 -1
  39. package/assets/esri/core/workers/chunks/69a09c6acb5ae03c67f6.js +1 -0
  40. package/assets/esri/core/workers/chunks/{542a9c414c99d84d52ab.js → 6a202ef9ba9b89e09153.js} +1 -1
  41. package/assets/esri/core/workers/chunks/{0826feebdca8a31eb630.js → 6ba6fece5c11fe2a6ace.js} +1 -1
  42. package/assets/esri/core/workers/chunks/{5eb69e2895e5aec81051.js → 6fd10891506925560443.js} +1 -1
  43. package/assets/esri/core/workers/chunks/7b156905d168bf973518.js +1 -0
  44. package/assets/esri/core/workers/chunks/7b6fd287e7043ad50f4e.js +1 -0
  45. package/assets/esri/core/workers/chunks/7baa49055bc31618b56e.js +1 -0
  46. package/assets/esri/core/workers/chunks/8570e3df90fb76a8741a.js +1 -0
  47. package/assets/esri/core/workers/chunks/{c3c0f24a9e0047232ae1.js → 8679dfc0c53355b6feb0.js} +1 -1
  48. package/assets/esri/core/workers/chunks/8a636dc51372e14c98f5.js +1 -0
  49. package/assets/esri/core/workers/chunks/{d14732a57c8e63948c60.js → 9117c9b720c9ba6e7a6e.js} +1 -1
  50. package/assets/esri/core/workers/chunks/{f7e33d37dd11fb08f3f8.js → 97107e64407fa6825620.js} +1 -1
  51. package/assets/esri/core/workers/chunks/{5118c7269b706089c88e.js → a05a2c2aaf0c288f9681.js} +1 -1
  52. package/assets/esri/core/workers/chunks/{944f17e9c9f681b971fb.js → a12e2a345005189c64be.js} +1 -1
  53. package/assets/esri/core/workers/chunks/a22458e5272332d86cb9.js +1 -0
  54. package/assets/esri/core/workers/chunks/{15b3386ad92a0b4149b8.js → a24dc5350af001db417a.js} +1 -1
  55. package/assets/esri/core/workers/chunks/{10967a36c77c5188690d.js → a66d6298236d59a615db.js} +1 -1
  56. package/assets/esri/core/workers/chunks/{3ea480cebf8ee56228a5.js → a7dfca326883384d2751.js} +1 -1
  57. package/assets/esri/core/workers/chunks/{723d8316f5d4b6ce2942.js → a9539393e2f1812a973a.js} +1 -1
  58. package/assets/esri/core/workers/chunks/{ac8d38016e4bee37a77c.js → ab784764ddf9d7f693a1.js} +1 -1
  59. package/assets/esri/core/workers/chunks/{255f5b45c4d32f97f86c.js → ac0861014b3d2f1a1de2.js} +1 -1
  60. package/assets/esri/core/workers/chunks/ace210d313ce53f3ae10.js +1 -0
  61. package/assets/esri/core/workers/chunks/ae48ee283cfa5b3c14b0.js +1 -0
  62. package/assets/esri/core/workers/chunks/b38b6fe08a367e9de4f5.js +1 -0
  63. package/assets/esri/core/workers/chunks/{4e651869e9a196494694.js → b6e628b5d2643af4c19b.js} +1 -1
  64. package/assets/esri/core/workers/chunks/{b37ab6b1cb4cfc85cd9d.js → b7828d7e2c5b75644057.js} +1 -1
  65. package/assets/esri/core/workers/chunks/bbd8fcb0bbba7bde3d9b.js +1 -0
  66. package/assets/esri/core/workers/chunks/{ec465abb0344ad719e9d.js → bd8e329ec74d921d311a.js} +1 -1
  67. package/assets/esri/core/workers/chunks/{56e6e70aa40e51827290.js → c3f94024c6c9eed9f273.js} +1 -1
  68. package/assets/esri/core/workers/chunks/{6d17b45022dfd2548098.js → c5ddf8b347c31fe772a3.js} +1 -1
  69. package/assets/esri/core/workers/chunks/{ee9af58ae202b803bba7.js → c7a0c4ca37ebd1d98cf1.js} +1 -1
  70. package/assets/esri/core/workers/chunks/d0659f1b0495734be4b3.js +1 -0
  71. package/assets/esri/core/workers/chunks/d7763c42754152510e13.js +2 -0
  72. package/assets/esri/core/workers/chunks/{b9a2b05ede02c305e865.js → d8ffb1502def5c85740b.js} +1 -1
  73. package/assets/esri/core/workers/chunks/{7dfe1e78d2e66de6be22.js → d9ef244019954d5a8a27.js} +1 -1
  74. package/assets/esri/core/workers/chunks/{95403bb27a4ea0a4b7b1.js → ddbfa664e69612295785.js} +1 -1
  75. package/assets/esri/core/workers/chunks/dfa1b0308e5e82d1ddfe.js +1120 -0
  76. package/assets/esri/core/workers/chunks/e566102c7ed7a8ebf89e.js +1 -0
  77. package/assets/esri/core/workers/chunks/e74586b074d0fa6abb4b.js +1 -0
  78. package/assets/esri/core/workers/chunks/e7dff025780726d5feae.js +1 -0
  79. package/assets/esri/core/workers/chunks/e96fa029acba59c04e4e.js +2 -0
  80. package/assets/esri/core/workers/chunks/{55d28d3f5b8ced061e39.js → eaf73ce60f39a48ddd2a.js} +1 -1
  81. package/assets/esri/core/workers/chunks/ed2f2a5da830d058e339.js +1 -0
  82. package/assets/esri/core/workers/chunks/{e592f2483db71230e8e5.js → efd6ea0966f60ab19520.js} +1 -1
  83. package/assets/esri/core/workers/chunks/{944cb751c85d3a127f49.js → f52d081bbde5c95265cf.js} +1 -1
  84. package/assets/esri/core/workers/chunks/{1de9be7b65109c207bd5.js → fbd5f3b81cd9f061824d.js} +1 -1
  85. package/assets/esri/core/workers/chunks/fdfbd201be372d3796bf.js +2 -0
  86. package/assets/esri/core/workers/chunks/ff0a0819bba5e8264c47.js +1 -0
  87. package/assets/esri/layers/raster/formats/blosc-wasm.wasm +0 -0
  88. package/assets/esri/libs/librust-parquet/pkg/parquet_bg.wasm +0 -0
  89. package/basemapGallery/support/basemapCompatibilityUtils.js +1 -1
  90. package/chunks/BlendLayers.glsl.js +1 -1
  91. package/chunks/ColorMaterial.glsl.js +14 -14
  92. package/chunks/Component.glsl.js +37 -37
  93. package/chunks/CypherParser.js +1 -1
  94. package/chunks/DefaultMaterial.glsl.js +15 -15
  95. package/chunks/GeodeticDistanceCalculator-zRp89-dW.js +1 -1
  96. package/chunks/HUDMaterial.glsl.js +3 -3
  97. package/chunks/MultiPathImpl.js +1 -1
  98. package/chunks/OperatorGeodesicBuffer.js +1 -1
  99. package/chunks/Path.glsl.js +15 -15
  100. package/chunks/Pattern.glsl.js +20 -20
  101. package/chunks/RasterColorizer.glsl.js +1 -1
  102. package/chunks/ShadowHighlight.glsl.js +1 -1
  103. package/chunks/Terrain.glsl.js +24 -24
  104. package/chunks/UnitFactory.js +1 -1
  105. package/chunks/Water.glsl.js +29 -20
  106. package/chunks/blosc-wasm.js +2 -0
  107. package/chunks/cameraUtilsSpherical.js +1 -1
  108. package/chunks/parquet.js +1 -1
  109. package/chunks/pdf.js +57 -0
  110. package/chunks/text.js +1 -1
  111. package/config.js +1 -1
  112. package/core/accessorSupport/write.js +1 -1
  113. package/core/scheduling.js +1 -1
  114. package/core/sql/SqlInterval.js +1 -1
  115. package/core/urlUtils.js +1 -1
  116. package/geometry/geometryEngine.js +1 -1
  117. package/geometry/operators/gx/operatorOffset.js +1 -1
  118. package/geometry/support/Ellipsoid.js +1 -1
  119. package/geometry/support/curves/ellipticArc7Utils.js +1 -1
  120. package/geometry/support/geodesicConstants.js +1 -1
  121. package/geometry/support/meshUtils/primitives.js +1 -1
  122. package/kernel.js +1 -1
  123. package/layers/Lyr3DWasmPerSceneView.js +1 -1
  124. package/layers/VoxelWasmPerSceneView.js +1 -1
  125. package/layers/effects/parser.js +1 -1
  126. package/layers/geospatialPDF/GeospatialPDFFrame.js +1 -1
  127. package/layers/geospatialPDF/GeospatialPDFLayerWorker.js +1 -56
  128. package/layers/geospatialPDF/GeospatialPDFWorkerClient.js +1 -1
  129. package/layers/geospatialPDF/parserUtils.js +2 -0
  130. package/layers/graphics/controllers/I3SOnDemandController.js +1 -1
  131. package/layers/graphics/data/QueryEngineResult.js +1 -1
  132. package/layers/graphics/sources/support/ParquetSourceWorker.js +1 -1
  133. package/layers/parquet.js +1 -1
  134. package/layers/raster/datasets/ZarrRaster.js +1 -1
  135. package/layers/raster/datasets/wcsCoverageParser.js +1 -1
  136. package/layers/raster/formats/RasterCodec.js +1 -1
  137. package/layers/raster/formats/blosc.js +2 -0
  138. package/layers/support/BuildingFilter.js +1 -1
  139. package/layers/support/ControlPoint.js +1 -1
  140. package/layers/support/ControlPointsGeoreference.js +1 -1
  141. package/layers/support/IntegratedMeshSemantics.js +1 -1
  142. package/layers/support/commonProperties.js +1 -1
  143. package/layers/support/fieldUtils.d.ts +23 -87
  144. package/layers/support/fieldUtils.js +1 -1
  145. package/layers/support/geospatialPDFUtils.d.ts +63 -0
  146. package/layers/support/geospatialPDFUtils.js +2 -0
  147. package/layers/support/layersMapping.js +1 -1
  148. package/layers/video/VideoController.js +1 -1
  149. package/legend/ActiveLayerInfo.js +1 -1
  150. package/libs/ajv/ajv.bundle-wrapper.js +1 -1
  151. package/package.json +6 -6
  152. package/renderers/types.d.ts +1 -1
  153. package/rest/knowledgeGraphService.js +1 -1
  154. package/rest/query/operations/pbfFeatureServiceParser.js +1 -1
  155. package/smartMapping/statistics/support/attributeDensity.js +1 -1
  156. package/smartMapping/support/adapters/support/utils.js +1 -1
  157. package/support/tests/serviceMockDependencies.js +1 -1
  158. package/symbols/CIMSymbol.d.ts +9 -9
  159. package/symbols/PathSymbol3DLayer.d.ts +1 -1
  160. package/symbols/WaterSymbol3DLayer.d.ts +13 -1
  161. package/symbols/WaterSymbol3DLayer.js +1 -1
  162. package/symbols/cim/CIMEffects.js +1 -1
  163. package/symbols/cim/CIMSymbolDrawHelper.js +1 -1
  164. package/symbols/cim/effects/EffectControlMeasureLine.js +1 -1
  165. package/symbols/cim/placements/PlacementInsidePolygon.js +1 -1
  166. package/symbols/cim/rasterizingUtils.js +1 -1
  167. package/views/2d/PaddedViewState.js +1 -1
  168. package/views/2d/engine/vectorTiles/buckets/FillBucket.js +1 -1
  169. package/views/2d/engine/vectorTiles/constants.js +1 -1
  170. package/views/2d/engine/vectorTiles/style/geoJSONVectorTileUtils.js +1 -1
  171. package/views/2d/engine/webgl/effects/HighlightEffect.js +1 -1
  172. package/views/2d/engine/webgl/mesh/templates/segmentUtils.js +1 -1
  173. package/views/2d/engine/webgl/mesh/templates/shapingUtils.js +1 -1
  174. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/constants.js +1 -1
  175. package/views/2d/engine/webgl/shaderGraph/techniques/text/TextShader.js +1 -1
  176. package/views/2d/interactive/editingTools/ControlPointsTransformTool.js +1 -1
  177. package/views/2d/interactive/editingTools/TransformTool.js +1 -1
  178. package/views/2d/layers/FeatureLikeLayerView2D.js +1 -1
  179. package/views/2d/layers/ParquetLayerView2D.js +1 -1
  180. package/views/2d/layers/features/Processor.js +1 -1
  181. package/views/2d/layers/features/aggregation/GridSpatialIndex.js +1 -1
  182. package/views/2d/layers/features/support/AttributeStore.js +1 -1
  183. package/views/2d/layers/features/support/FeatureSetReaderPBF.js +1 -1
  184. package/views/2d/layers/graphics/GraphicsView2D.js +1 -1
  185. package/views/3d/analysis/AreaMeasurement/support/AreaMeasurementPathHelper.js +1 -1
  186. package/views/3d/analysis/Dimension/DimensionTool.js +1 -1
  187. package/views/3d/analysis/Dimension/LengthDimensionSubTool.js +1 -1
  188. package/views/3d/analysis/ElevationProfile/ElevationProfileLineSceneComputation.js +1 -1
  189. package/views/3d/analysis/LineOfSight/LineOfSightController.js +1 -1
  190. package/views/3d/analysis/LineOfSight/LineOfSightItemManipulatedObject3D.js +1 -1
  191. package/views/3d/analysis/LineOfSight/LineOfSightRayIntersector.js +1 -1
  192. package/views/3d/analysis/ShadowCastAnalysisView3D.js +1 -1
  193. package/views/3d/analysis/Slice/SliceTool.js +1 -1
  194. package/views/3d/analysis/Viewshed/ViewshedObserverManipulatedObject3D.js +1 -1
  195. package/views/3d/analysis/Viewshed/ViewshedSnappingController.js +1 -1
  196. package/views/3d/analysis/Viewshed/ViewshedTool.js +1 -1
  197. package/views/3d/analysis/ViewshedAnalysisView3D.js +1 -1
  198. package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementCutFillComputation.js +1 -1
  199. package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementVisualization.js +1 -1
  200. package/views/3d/animation/pointToPoint/Camera.js +1 -1
  201. package/views/3d/camera/constraintUtils/tilt.js +1 -1
  202. package/views/3d/camera/constraintUtils.js +1 -1
  203. package/views/3d/camera/intersectionUtils.js +1 -1
  204. package/views/3d/environment/EnvironmentView.js +1 -1
  205. package/views/3d/focusAreaUtils.js +1 -1
  206. package/views/3d/input/handlers/ground/GroundNavigation.js +1 -1
  207. package/views/3d/interactive/Manipulator3D.js +1 -1
  208. package/views/3d/interactive/Manipulator3DBase.js +1 -1
  209. package/views/3d/interactive/editingTools/ManipulatedObject3DGraphic.js +1 -1
  210. package/views/3d/interactive/editingTools/dragEventPipeline3D.js +1 -1
  211. package/views/3d/interactive/editingTools/manipulations/config.js +1 -1
  212. package/views/3d/interactive/editingTools/media/MediaElementControllerControlPoints.js +1 -1
  213. package/views/3d/interactive/editingTools/media/MediaElementControllerShape.js +1 -1
  214. package/views/3d/interactive/editingTools/move/MoveTool3D.js +1 -1
  215. package/views/3d/interactive/editingTools/transform/ScaleRotateMeshAdapter.js +1 -1
  216. package/views/3d/interactive/editingTools/transform/TransformTool3D.js +1 -1
  217. package/views/3d/interactive/measurementTools/areaMeasurement3D/AreaMeasurement3DTool.js +1 -1
  218. package/views/3d/interactive/measurementTools/areaMeasurement3D/AreaMeasurement3DView.js +1 -1
  219. package/views/3d/interactive/measurementTools/directLineMeasurement3D/DirectLineMeasurement3DTool.js +1 -1
  220. package/views/3d/interactive/measurementTools/directLineMeasurement3D/DirectLineMeasurement3DView.js +1 -1
  221. package/views/3d/interactive/visualElements/Object3DVisualElement.js +1 -1
  222. package/views/3d/interactive/visualElements/RightAngleQuadVisualElement.js +1 -1
  223. package/views/3d/layers/BuildingSceneLayerView3D.js +1 -1
  224. package/views/3d/layers/DrapedSubView3D.js +1 -1
  225. package/views/3d/layers/DynamicLayerView3D.js +1 -1
  226. package/views/3d/layers/FeatureLikeLayerViewBase3D.js +1 -1
  227. package/views/3d/layers/FlowSubView3D.js +1 -1
  228. package/views/3d/layers/GraphicsLayerView3D.js +1 -1
  229. package/views/3d/layers/I3SMeshView3D.js +1 -1
  230. package/views/3d/layers/RouteLayerView3D.js +1 -1
  231. package/views/3d/layers/SceneLayerGraphicsView3D.js +1 -1
  232. package/views/3d/layers/TiledLayerView3D.js +1 -1
  233. package/views/3d/layers/VectorTileLayerView3D.js +1 -1
  234. package/views/3d/layers/VoxelLayerView3D.js +1 -1
  235. package/views/3d/layers/graphics/Deconflictor.js +1 -1
  236. package/views/3d/layers/graphics/Graphics3DExtrudeSymbolLayer.js +1 -1
  237. package/views/3d/layers/graphics/Graphics3DFrustumVisibility.js +1 -1
  238. package/views/3d/layers/graphics/Graphics3DIconSymbolLayer.js +1 -1
  239. package/views/3d/layers/graphics/Graphics3DLineSymbolLayer.js +1 -1
  240. package/views/3d/layers/graphics/Graphics3DMeshFillSymbolLayer.js +1 -1
  241. package/views/3d/layers/graphics/Graphics3DObjectSymbolLayer.js +1 -1
  242. package/views/3d/layers/graphics/Graphics3DPathSymbolLayer.js +1 -1
  243. package/views/3d/layers/graphics/Graphics3DPolygonFillSymbolLayer.js +1 -1
  244. package/views/3d/layers/graphics/Graphics3DSymbolFactory.js +1 -1
  245. package/views/3d/layers/graphics/Graphics3DWaterSymbolLayer.js +1 -1
  246. package/views/3d/layers/graphics/LabelInfo.js +1 -1
  247. package/views/3d/layers/i3s/I3SClientNodeLoader.js +1 -1
  248. package/views/3d/layers/i3s/I3SIndex.js +1 -1
  249. package/views/3d/layers/i3s/I3SIntersectionHandler.js +1 -1
  250. package/views/3d/layers/i3s/I3SMeshViewFilter.js +1 -1
  251. package/views/3d/layers/i3s/I3SNode.js +1 -1
  252. package/views/3d/layers/i3s/I3SOverrides.js +1 -1
  253. package/views/3d/layers/i3s/I3SUtil.js +1 -1
  254. package/views/3d/layers/i3s/I3SViewportQueries.js +1 -1
  255. package/views/3d/layers/i3s/LayerElevationProvider.js +1 -1
  256. package/views/3d/layers/support/FeatureTileFetcher3D.js +1 -1
  257. package/views/3d/layers/support/FeatureTileFetcher3DContext.js +1 -1
  258. package/views/3d/layers/support/FeatureTileMeasurements3D.js +1 -1
  259. package/views/3d/layers/support/FeatureTileVisibility3D.js +1 -1
  260. package/views/3d/layers/support/StageLayerElevationProvider.js +1 -1
  261. package/views/3d/layers/support/Tiles3DBVH.js +1 -1
  262. package/views/3d/layers/support/Tiles3DLayerViewRegistration.js +1 -1
  263. package/views/3d/layers/support/createTileBVHForLayer.js +1 -1
  264. package/views/3d/layers/support/selectTiles3DSpatialReference.js +1 -1
  265. package/views/3d/layers/support/uvUtils.js +1 -1
  266. package/views/3d/state/Constraints.js +1 -1
  267. package/views/3d/state/ConstraintsManager.js +1 -1
  268. package/views/3d/state/NearFarHeuristic.js +1 -1
  269. package/views/3d/state/ViewState.js +1 -1
  270. package/views/3d/state/ViewStateManager.js +1 -1
  271. package/views/3d/state/controllers/PinchAndPanControllerGlobal.js +1 -1
  272. package/views/3d/state/controllers/PinchAndPanControllerLocal.js +1 -1
  273. package/views/3d/state/controllers/PointToPointAnimationController.js +1 -1
  274. package/views/3d/state/controllers/RotateController.js +1 -1
  275. package/views/3d/state/controllers/ZoomControllerGlobal.js +1 -1
  276. package/views/3d/state/controllers/ZoomStepControllerGlobal.js +1 -1
  277. package/views/3d/state/controllers/ZoomStepControllerLocal.js +1 -1
  278. package/views/3d/state/helpers/SceneIntersectionHelper.js +1 -1
  279. package/views/3d/state/utils/OffsetCorrectionController.js +1 -1
  280. package/views/3d/state/utils/groundNavigationUtils.js +1 -1
  281. package/views/3d/state/utils/navigationUtils.js +1 -1
  282. package/views/3d/support/FrustumExtentIntersection.js +1 -1
  283. package/views/3d/support/QualityProfile.js +1 -1
  284. package/views/3d/support/QualitySettings.js +1 -1
  285. package/views/3d/support/RenderCoordsHelper.js +1 -1
  286. package/views/3d/support/SweptSphereVolume.js +1 -1
  287. package/views/3d/support/cameraUtils.js +1 -1
  288. package/views/3d/support/elevationUpdateExtentUtils.js +1 -1
  289. package/views/3d/support/engineContent/line.js +1 -1
  290. package/views/3d/support/engineContent/marker.js +1 -1
  291. package/views/3d/support/flow/StreamlineResources3DShape.js +1 -1
  292. package/views/3d/support/hitTest.js +1 -1
  293. package/views/3d/support/orientedBoundingBox.js +1 -1
  294. package/views/3d/support/pointsOfInterest/CameraOnSurface.js +1 -1
  295. package/views/3d/support/pointsOfInterest/PointsOfInterest.js +1 -1
  296. package/views/3d/support/pointsOfInterest/SurfaceGeometryUpdates.js +1 -1
  297. package/views/3d/support/sunUtils.js +1 -1
  298. package/views/3d/terrain/BlendLayersTechniqueConfiguration.js +1 -1
  299. package/views/3d/terrain/ExtentHelper.js +1 -1
  300. package/views/3d/terrain/OverlayManager.js +1 -1
  301. package/views/3d/terrain/OverlayRenderer.js +1 -1
  302. package/views/3d/terrain/PatchGeometryFactory.js +1 -1
  303. package/views/3d/terrain/RasterColorizerTechniqueConfiguration.js +1 -1
  304. package/views/3d/terrain/TerrainRenderer.js +1 -1
  305. package/views/3d/terrain/TerrainSurface.js +1 -1
  306. package/views/3d/terrain/Tile.js +1 -1
  307. package/views/3d/terrain/TilingSchemeLogic.js +1 -1
  308. package/views/3d/terrain/terrainUtils.js +1 -1
  309. package/views/3d/webgl/RenderCamera.js +1 -1
  310. package/views/3d/webgl-engine/Stage.js +1 -1
  311. package/views/3d/webgl-engine/collections/Component/ComponentObject.js +1 -1
  312. package/views/3d/webgl-engine/collections/Component/ComponentObjectCollection.js +1 -1
  313. package/views/3d/webgl-engine/collections/Component/ComponentObjectElevationAgnosticBVH.js +1 -1
  314. package/views/3d/webgl-engine/collections/Component/ComponentObjectElevationAgnosticComponentGeometryBVH.js +1 -1
  315. package/views/3d/webgl-engine/collections/Component/ElevationAgnosticBVH.js +1 -1
  316. package/views/3d/webgl-engine/collections/Component/IntersectionGeometry.js +1 -1
  317. package/views/3d/webgl-engine/collections/Component/Material/Component.glsl.js +1 -1
  318. package/views/3d/webgl-engine/collections/Component/Material/ComponentMaterial.js +1 -1
  319. package/views/3d/webgl-engine/collections/Component/Material/ComponentMaterialRepository.js +1 -1
  320. package/views/3d/webgl-engine/collections/Component/Material/ComponentTechniqueConfiguration.js +1 -1
  321. package/views/3d/webgl-engine/core/shaderLibrary/clampShadowPosition.glsl.js +2 -0
  322. package/views/3d/webgl-engine/core/shaderLibrary/default/DefaultMaterialAuxiliaryPasses.glsl.js +14 -14
  323. package/views/3d/webgl-engine/core/shaderLibrary/hud/HUD.glsl.js +1 -1
  324. package/views/3d/webgl-engine/core/shaderLibrary/terrain/Overlay.glsl.js +1 -1
  325. package/views/3d/webgl-engine/core/shaderLibrary/terrain/TileComposite.glsl.js +2 -3
  326. package/views/3d/webgl-engine/core/shaderLibrary/util/View.glsl.js +1 -1
  327. package/views/3d/webgl-engine/effects/atmosphere/MarsAtmosphere.js +1 -1
  328. package/views/3d/webgl-engine/effects/debug/RenderNodeVisualizerNode.js +1 -1
  329. package/views/3d/webgl-engine/effects/highlight/ShadowHighlight.js +1 -1
  330. package/views/3d/webgl-engine/effects/laserlines/LaserlinePathData.js +1 -1
  331. package/views/3d/webgl-engine/effects/shadowAccumulation/ShadowAccumulator.js +1 -1
  332. package/views/3d/webgl-engine/lib/BufferGeometry.js +1 -1
  333. package/views/3d/webgl-engine/lib/BufferObject3D.js +1 -1
  334. package/views/3d/webgl-engine/lib/GridLocalOriginFactory.js +1 -1
  335. package/views/3d/webgl-engine/lib/Intersector.js +1 -1
  336. package/views/3d/webgl-engine/lib/Object3D.js +1 -1
  337. package/views/3d/webgl-engine/lib/Program.js +1 -1
  338. package/views/3d/webgl-engine/lib/RenderGeometry.js +1 -1
  339. package/views/3d/webgl-engine/lib/Renderer.js +1 -1
  340. package/views/3d/webgl-engine/lib/ShadowMap.js +1 -1
  341. package/views/3d/webgl-engine/lib/TextRenderParameters.js +1 -1
  342. package/views/3d/webgl-engine/lib/TextRenderer.js +1 -1
  343. package/views/3d/webgl-engine/lib/TriangleIntersectionData.js +1 -1
  344. package/views/3d/webgl-engine/lib/depthRangeUtils.js +1 -1
  345. package/views/3d/webgl-engine/lib/edgeRendering/EdgeView.js +1 -1
  346. package/views/3d/webgl-engine/lib/edgeRendering/strokes.js +1 -1
  347. package/views/3d/webgl-engine/lib/verticalOffsetUtils.js +1 -1
  348. package/views/3d/webgl-engine/materials/DefaultLayouts.js +1 -1
  349. package/views/3d/webgl-engine/materials/DefaultMaterial.js +1 -1
  350. package/views/3d/webgl-engine/materials/Path.glsl.js +1 -1
  351. package/views/3d/webgl-engine/materials/PolygonOffset.js +1 -1
  352. package/views/3d/webgl-engine/materials/RibbonLineMaterial.js +1 -1
  353. package/views/3d/webgl-engine/materials/Water.glsl.js +1 -1
  354. package/views/3d/webgl-engine/materials/WaterMaterial.js +1 -1
  355. package/views/3d/webgl-engine/parts/Model.js +1 -1
  356. package/views/3d/webgl-engine/parts/RenderView.js +1 -1
  357. package/views/3d/webgl-engine/shaders/ColorMaterial.glsl.js +1 -1
  358. package/views/3d/webgl-engine/shaders/DefaultMaterial.glsl.js +1 -1
  359. package/views/3d/webgl-engine/shaders/Pattern.glsl.js +1 -1
  360. package/views/3d/webgl-engine/shaders/Terrain.glsl.js +1 -1
  361. package/views/Attribution.js +5 -5
  362. package/views/DOMContainer.d.ts +2 -1
  363. package/views/MapView.d.ts +1 -0
  364. package/views/SceneView.js +1 -1
  365. package/views/View2D.js +1 -1
  366. package/views/ViewingMode.js +1 -1
  367. package/views/analysis/ElevationProfile/elevationProfileChartBoundsUtils.js +1 -1
  368. package/views/analysis/ElevationProfile/elevationProfileGeometryUtils.js +1 -1
  369. package/views/draw/DrawAction.js +1 -1
  370. package/views/draw/DrawGraphicTool.js +1 -1
  371. package/views/draw/DrawOperation.js +1 -1
  372. package/views/draw/DrawTool.js +1 -1
  373. package/views/draw/SegmentDrawAction.js +1 -1
  374. package/views/draw/support/Reshape.js +1 -1
  375. package/views/draw/support/helpMessageUtils.js +1 -1
  376. package/views/draw/support/managers/EditSessionManager.js +1 -1
  377. package/views/draw/support/surfaceCoordinateSystems.js +1 -1
  378. package/views/interactive/dragEventPipeline.js +1 -1
  379. package/views/interactive/editGeometry/EditGeometry.js +1 -1
  380. package/views/interactive/editGeometry/EditGeometryOperations.js +1 -1
  381. package/views/interactive/editGeometry/operations/AddOrUpdatePart.js +1 -1
  382. package/views/layers/support/editableLayerViews.js +1 -1
  383. package/views/overlay/TextOverlayItem.js +1 -1
  384. package/views/support/DefaultsFromMap.js +1 -1
  385. package/views/support/Scheduler.js +1 -1
  386. package/views/support/spatialReferenceSupport.js +1 -1
  387. package/views/webgl/Program.js +3 -3
  388. package/views/webgl/ShaderBuilder.js +23 -23
  389. package/views/webgl/ShaderTranspiler.js +2 -2
  390. package/webscene/Slide.js +1 -1
  391. package/webscene/VirtualLighting.d.ts +2 -4
  392. package/widgets/AreaMeasurement2D/AreaMeasurement2DTool.js +1 -1
  393. package/widgets/BasemapGallery/support/basemapCompatibilityUtils.js +1 -1
  394. package/widgets/BatchAttributeForm/inputs/FieldInput.d.ts +17 -1
  395. package/widgets/BatchAttributeForm/inputs/FieldInput.js +1 -1
  396. package/widgets/BatchAttributeForm/inputs/support/inputUtils.d.ts +7 -0
  397. package/widgets/BatchAttributeForm/inputs/support/inputUtils.js +1 -1
  398. package/widgets/BatchAttributeForm.js +1 -1
  399. package/widgets/DistanceMeasurement2D/DistanceMeasurement2DTool.js +1 -1
  400. package/widgets/Editor/workflowUtils.js +1 -1
  401. package/widgets/ElevationProfile/ElevationProfileLineView.js +1 -1
  402. package/widgets/ElevationProfile/support/chartUtils.js +1 -1
  403. package/widgets/ElevationProfile/support/geometryUtils.js +1 -1
  404. package/widgets/FeatureForm.js +1 -1
  405. package/widgets/Legend/styles/card/ColorRamp.js +1 -1
  406. package/widgets/Legend/support/ActiveLayerInfo.js +1 -1
  407. package/widgets/Measurement.js +1 -1
  408. package/widgets/OrientedImageryViewer/components/ImageLocationWidget.js +1 -1
  409. package/widgets/OrientedImageryViewer/components/ImageMeasurementWidget.js +1 -1
  410. package/widgets/Search/support/layerSearchUtils.js +1 -1
  411. package/widgets/ShadowCast/ShadowCastViewModel.js +1 -1
  412. package/widgets/Sketch/SketchViewModel.js +1 -1
  413. package/widgets/UtilityNetworkAssociations/UtilityNetworkAssociationsViewModel.js +1 -1
  414. package/widgets/UtilityNetworkAssociations.js +1 -1
  415. package/widgets/Weather/WeatherViewModel.js +1 -1
  416. package/widgets/Weather/css.js +1 -1
  417. package/widgets/Weather.js +1 -1
  418. package/widgets/support/ContingentValuesManager.js +1 -1
  419. package/widgets/support/forms/types.d.ts +23 -1
  420. package/assets/esri/core/workers/chunks/021bd07b9a3e70598840.js +0 -1
  421. package/assets/esri/core/workers/chunks/032733b863426c5bde00.js +0 -1121
  422. package/assets/esri/core/workers/chunks/144f18a3dd2c8cf07cf7.js +0 -1
  423. package/assets/esri/core/workers/chunks/170e68624b71ac96de4a.js +0 -1
  424. package/assets/esri/core/workers/chunks/23fc1c1ed483ed3b2298.js +0 -1
  425. package/assets/esri/core/workers/chunks/2634927d26cb1139c6d0.js +0 -1
  426. package/assets/esri/core/workers/chunks/2d1b8154ee40afc9d40b.js +0 -1
  427. package/assets/esri/core/workers/chunks/2d3e977f3b75474d7ebc.js +0 -1
  428. package/assets/esri/core/workers/chunks/4a41bf3d1e2e9bb79771.js +0 -2
  429. package/assets/esri/core/workers/chunks/5f324d88785ffcb73ae0.js +0 -1
  430. package/assets/esri/core/workers/chunks/70695e0fb53018d48e7b.js +0 -2
  431. package/assets/esri/core/workers/chunks/723c9ad4c25be2b82476.js +0 -1
  432. package/assets/esri/core/workers/chunks/766a1357be2ed7f4e125.js +0 -1
  433. package/assets/esri/core/workers/chunks/817bf487df056da1e6ec.js +0 -1
  434. package/assets/esri/core/workers/chunks/89e55895683369b5277a.js +0 -1
  435. package/assets/esri/core/workers/chunks/8a820e303941b351de81.js +0 -1
  436. package/assets/esri/core/workers/chunks/8c94e987754b3919181e.js +0 -1
  437. package/assets/esri/core/workers/chunks/90d567e920b6982b402d.js +0 -1
  438. package/assets/esri/core/workers/chunks/919115788da38049aea7.js +0 -2
  439. package/assets/esri/core/workers/chunks/97cdcedfe853280f6258.js +0 -1
  440. package/assets/esri/core/workers/chunks/9ebc6026934400fc1e1f.js +0 -1
  441. package/assets/esri/core/workers/chunks/b33e7e74cf8fa3926617.js +0 -1
  442. package/assets/esri/core/workers/chunks/b4a325dcf50e276751d7.js +0 -1
  443. package/assets/esri/core/workers/chunks/bb2af16e55cb39163827.js +0 -1
  444. package/assets/esri/core/workers/chunks/be5857b0d1b00faf430b.js +0 -1
  445. package/assets/esri/core/workers/chunks/cd9100a7c8309dfa7569.js +0 -1
  446. package/assets/esri/core/workers/chunks/d5bb9f9b7b341c671525.js +0 -1
  447. package/assets/esri/core/workers/chunks/d96e63d66f7b1f4ea54a.js +0 -2
  448. package/assets/esri/core/workers/chunks/e3bcd2e356f75afc316a.js +0 -1
  449. package/assets/esri/core/workers/chunks/e507dfc4788295d9c244.js +0 -1
  450. package/assets/esri/core/workers/chunks/e58f51618251f74aaafd.js +0 -1
  451. package/assets/esri/core/workers/chunks/e80526571f1a34de3278.js +0 -1
  452. package/assets/esri/core/workers/chunks/e83806797979138fd22a.js +0 -1
  453. package/assets/esri/core/workers/chunks/ea71850ba87ae6038000.js +0 -1
  454. package/assets/esri/core/workers/chunks/f537a5e808dc546813c7.js +0 -1
  455. package/assets/esri/core/workers/chunks/fe811d651d201f698b8f.js +0 -2
  456. package/chunks/NativeLine.glsl.js +0 -8
  457. package/layers/geospatialPDF/geospatialPDFParserUtils.js +0 -2
  458. package/views/3d/webgl-engine/materials/NativeLineMaterial.js +0 -2
  459. package/views/3d/webgl-engine/shaders/NativeLine.glsl.js +0 -2
  460. package/views/3d/webgl-engine/shaders/NativeLineTechnique.js +0 -2
  461. package/views/3d/webgl-engine/shaders/NativeLineTechniqueConfiguration.js +0 -2
  462. /package/assets/esri/core/workers/chunks/{919115788da38049aea7.js.LICENSE.txt → 3d851710f7fcc27c5b60.js.LICENSE.txt} +0 -0
  463. /package/assets/esri/core/workers/chunks/{fe811d651d201f698b8f.js.LICENSE.txt → 5bdd95eeb8f34dbf26f2.js.LICENSE.txt} +0 -0
  464. /package/assets/esri/core/workers/chunks/{ced5dfb2bf46fc5eac8c.js.LICENSE.txt → 5e47026c681238038955.js.LICENSE.txt} +0 -0
  465. /package/assets/esri/core/workers/chunks/{4a41bf3d1e2e9bb79771.js.LICENSE.txt → d7763c42754152510e13.js.LICENSE.txt} +0 -0
  466. /package/assets/esri/core/workers/chunks/{d96e63d66f7b1f4ea54a.js.LICENSE.txt → e96fa029acba59c04e4e.js.LICENSE.txt} +0 -0
  467. /package/assets/esri/core/workers/chunks/{70695e0fb53018d48e7b.js.LICENSE.txt → fdfbd201be372d3796bf.js.LICENSE.txt} +0 -0
@@ -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,5 +1,5 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{update as e}from"../../core/arrayUtils.js";import has from"../../core/has.js";import{webglValidateShadersEnabled as t,webglDebugEnabled as n}from"./checkWebGLError.js";import{ResourceType as r}from"./enums.js";import{transpileShader as i}from"./ShaderTranspiler.js";const a=!!has(`esri-tests-disable-gpu-memory-measurements`);class o{constructor(e,n,o,c,l=new Map,u=[]){this._context=e,this._compiled=!1,this._linesOfCode=0,this._nameToUniformLocation=new Map,this._nameToUniform1=new Map,this._nameToUniform1v=new Map,this._nameToUniform2=new Map,this._nameToUniform3=new Map,this._nameToUniform4=new Map,this._nameToUniformMatrix3=new Map,this._nameToUniformMatrix4=new Map,e||console.error(`RenderingContext isn't initialized!`),n.length===0&&console.error(`Shaders source should not be empty!`),n=i(n,35633),o=i(o,35632),this._vShader=s(this._context,35633,n),this._fShader=s(this._context,35632,o),d.enabled&&(this._linesOfCode=n.match(/\n/g).length+o.match(/\n/g).length+2,e.instanceCounter.increment(r.LinesOfCode,this._vShader,this._linesOfCode)),this._vShader&&this._fShader||console.error(`Error loading shaders!`),e.instanceCounter.increment(r.Shader,this),t()&&(this.vertexShader=n,this.fragmentShader=o),this.usedMemory=a?0:n.length+o.length;let f=this._context.gl,p=f.createProgram();f.attachShader(p,this._vShader),f.attachShader(p,this._fShader),c.forEach((e,t)=>f.bindAttribLocation(p,e,t)),this.hasTransformFeedbackVaryings=!!u?.length,this.hasTransformFeedbackVaryings&&f.transformFeedbackVaryings(p,u,f.SEPARATE_ATTRIBS),f.linkProgram(p),t()&&!f.getProgramParameter(p,f.LINK_STATUS)&&console.error(`Could not link shader
3
- validated: ${f.getProgramParameter(p,f.VALIDATE_STATUS)}, gl error ${f.getError()}, vertex: ${f.getShaderParameter(this._vShader,f.COMPILE_STATUS)}, fragment: ${f.getShaderParameter(this._fShader,f.COMPILE_STATUS)}, info log: ${f.getProgramInfoLog(p)}, vertex source: ${this.vertexShader}, fragment source: ${this.fragmentShader}`);for(let[e,t]of l){let n=f.getUniformBlockIndex(p,e);n<0xffffffff&&f.uniformBlockBinding(p,n,t)}this._glName=p,e.instanceCounter.increment(r.Program,this)}get glName(){return this._glName}get hasGLName(){return this._glName!=null}get compiled(){return this._compiled?!0:!this._context.capabilities.parallelShaderCompile||this.glName==null?(this._compiled=!0,!0):(this._compiled=!!this._context.gl.getProgramParameter(this.glName,37297),this._compiled)}dispose(){let e=this._context.gl,t=this._context.instanceCounter;this._nameToUniformLocation.forEach(e=>e&&t.decrement(r.Uniform,e)),this._nameToUniformLocation.clear(),this._vShader&&(this._linesOfCode>0&&(t.decrement(r.LinesOfCode,this._vShader,this._linesOfCode),this._linesOfCode=0),e.deleteShader(this._vShader),this._vShader=null,t.decrement(r.Shader,this)),this._fShader&&=(e.deleteShader(this._fShader),null),this._glName&&(e.deleteProgram(this._glName),this._glName=null,t.decrement(r.Program,this))}_getUniformLocation(e){let t=this._nameToUniformLocation.get(e);if(t!==void 0)return t;if(this.glName){let t=this._context.gl.getUniformLocation(this.glName,e);return this._nameToUniformLocation.set(e,t),t&&this._context.instanceCounter.increment(r.Uniform,t),t}return null}hasUniform(e){return this._getUniformLocation(e)!=null}setUniform1i(e,t,n){f(n,t);let r=this._nameToUniform1.get(e);(r===void 0||t!==r)&&(this._context.gl.uniform1i(this._getUniformLocation(e),t),this._nameToUniform1.set(e,t))}setUniform1iv(e,t,n){p(n,t),u(this._nameToUniform1v,e,t)&&this._context.gl.uniform1iv(this._getUniformLocation(e),t)}setUniform2iv(e,t,n){p(n,t),u(this._nameToUniform2,e,t)&&this._context.gl.uniform2iv(this._getUniformLocation(e),t)}setUniform3iv(e,t,n){p(n,t),u(this._nameToUniform3,e,t)&&this._context.gl.uniform3iv(this._getUniformLocation(e),t)}setUniform4iv(e,t,n){p(n,t),u(this._nameToUniform4,e,t)&&this._context.gl.uniform4iv(this._getUniformLocation(e),t)}setUniform1f(e,t,n){f(n,t);let r=this._nameToUniform1.get(e);(r===void 0||t!==r)&&(this._context.gl.uniform1f(this._getUniformLocation(e),t),this._nameToUniform1.set(e,t))}setUniform1fv(e,t,n){p(n,t),u(this._nameToUniform1v,e,t)&&this._context.gl.uniform1fv(this._getUniformLocation(e),t)}setUniform2f(e,t,n,r){f(r,t,n);let i=this._nameToUniform2.get(e);i===void 0?(this._context.gl.uniform2f(this._getUniformLocation(e),t,n),this._nameToUniform2.set(e,[t,n])):(t!==i[0]||n!==i[1])&&(this._context.gl.uniform2f(this._getUniformLocation(e),t,n),i[0]=t,i[1]=n)}setUniform2fv(e,t,n){p(n,t),u(this._nameToUniform2,e,t)&&this._context.gl.uniform2fv(this._getUniformLocation(e),t)}setUniform3f(e,t,n,r,i){f(i,t,n,r);let a=this._nameToUniform3.get(e);a===void 0?(this._context.gl.uniform3f(this._getUniformLocation(e),t,n,r),this._nameToUniform3.set(e,[t,n,r])):(t!==a[0]||n!==a[1]||r!==a[2])&&(this._context.gl.uniform3f(this._getUniformLocation(e),t,n,r),a[0]=t,a[1]=n,a[2]=r)}setUniform3fv(e,t,n){p(n,t);let r=this._getUniformLocation(e);r!=null&&u(this._nameToUniform3,e,t)&&this._context.gl.uniform3fv(r,t)}setUniform4f(e,t,n,r,i,a){f(a,t,n,r,i);let o=this._nameToUniform4.get(e);o===void 0?(this._context.gl.uniform4f(this._getUniformLocation(e),t,n,r,i),this._nameToUniform4.set(e,[t,n,r,i])):(o===void 0||t!==o[0]||n!==o[1]||r!==o[2]||i!==o[3])&&(this._context.gl.uniform4f(this._getUniformLocation(e),t,n,r,i),o[0]=t,o[1]=n,o[2]=r,o[3]=i)}setUniform4fv(e,t,n){p(n,t);let r=this._getUniformLocation(e);r!=null&&u(this._nameToUniform4,e,t)&&this._context.gl.uniform4fv(r,t)}setUniformMatrix3fv(e,t,n=!1,r){p(r,t);let i=this._getUniformLocation(e);i!=null&&u(this._nameToUniformMatrix3,e,t)&&this._context.gl.uniformMatrix3fv(i,n,t)}setUniformMatrix4fv(e,t,n=!1,r){p(r,t);let i=this._getUniformLocation(e);if(i!=null){let r=this._nameToUniformMatrix4,a=r.get(e),o=!1;if(!a)r.set(e,Array.from(t)),o=!0;else{let n=t.length;if(a.length!==n)r.set(e,Array.from(t)),o=!0;else for(let e=0;e<n;++e){let r=t[e];if(a[e]!==r){for(a[e]=r;e<n;++e)a[e]=t[e];o=!0;break}}}o&&this._context.gl.uniformMatrix4fv(i,n,t)}}setUniformMatrices4fv(e,t,n=!1,r){p(r,t);let i=this._getUniformLocation(e);i!=null&&u(this._nameToUniformMatrix4,e,t)&&this._context.gl.uniformMatrix4fv(i,n,t)}stop(){}}function s(e,n,r){let i=e.gl,a=i.createShader(n);return i.shaderSource(a,r),i.compileShader(a),t()&&!i.getShaderParameter(a,i.COMPILE_STATUS)&&(console.error(`Compile error in ${n===35633?`vertex`:`fragment`} shader`),console.error(i.getShaderInfoLog(a)),console.error(c(r))),a}function c(e){let t=2;return e.replaceAll(`
2
+ import{update as e}from"../../core/arrayUtils.js";import has from"../../core/has.js";import t from"../../core/Logger.js";import{webglValidateShadersEnabled as n,webglDebugEnabled as r}from"./checkWebGLError.js";import{ResourceType as i}from"./enums.js";import{transpileShader as a}from"./ShaderTranspiler.js";const o=()=>t.getLogger(`esri.views.webgl.Program`),s=!!has(`esri-tests-disable-gpu-memory-measurements`);class c{constructor(e,t,r,c,u=new Map,d=[]){this._context=e,this._compiled=!1,this._linesOfCode=0,this._nameToUniformLocation=new Map,this._nameToUniform1=new Map,this._nameToUniform1v=new Map,this._nameToUniform2=new Map,this._nameToUniform3=new Map,this._nameToUniform4=new Map,this._nameToUniformMatrix3=new Map,this._nameToUniformMatrix4=new Map,e||o().error(`RenderingContext isn't initialized!`),t.length===0&&o().error(`Shaders source should not be empty!`),t=a(t,35633),r=a(r,35632),this._vShader=l(this._context,35633,t),this._fShader=l(this._context,35632,r),p.enabled&&(this._linesOfCode=t.match(/\n/g).length+r.match(/\n/g).length+2,e.instanceCounter.increment(i.LinesOfCode,this._vShader,this._linesOfCode)),this._vShader&&this._fShader||o().error(`Error loading shaders!`),e.instanceCounter.increment(i.Shader,this),n()&&(this.vertexShader=t,this.fragmentShader=r),this.usedMemory=s?0:t.length+r.length;let f=this._context.gl,m=f.createProgram();f.attachShader(m,this._vShader),f.attachShader(m,this._fShader),c.forEach((e,t)=>f.bindAttribLocation(m,e,t)),this.hasTransformFeedbackVaryings=!!d?.length,this.hasTransformFeedbackVaryings&&f.transformFeedbackVaryings(m,d,f.SEPARATE_ATTRIBS),f.linkProgram(m),n()&&!f.getProgramParameter(m,f.LINK_STATUS)&&o().error(`Could not link shader
3
+ validated: ${f.getProgramParameter(m,f.VALIDATE_STATUS)}, gl error ${f.getError()}, vertex: ${f.getShaderParameter(this._vShader,f.COMPILE_STATUS)}, fragment: ${f.getShaderParameter(this._fShader,f.COMPILE_STATUS)}, info log: ${f.getProgramInfoLog(m)}, vertex source: ${this.vertexShader}, fragment source: ${this.fragmentShader}`);for(let[e,t]of u){let n=f.getUniformBlockIndex(m,e);n<0xffffffff&&f.uniformBlockBinding(m,n,t)}this._glName=m,e.instanceCounter.increment(i.Program,this)}get glName(){return this._glName}get hasGLName(){return this._glName!=null}get compiled(){return this._compiled?!0:!this._context.capabilities.parallelShaderCompile||this.glName==null?(this._compiled=!0,!0):(this._compiled=!!this._context.gl.getProgramParameter(this.glName,37297),this._compiled)}dispose(){let e=this._context.gl,t=this._context.instanceCounter;this._nameToUniformLocation.forEach(e=>e&&t.decrement(i.Uniform,e)),this._nameToUniformLocation.clear(),this._vShader&&(this._linesOfCode>0&&(t.decrement(i.LinesOfCode,this._vShader,this._linesOfCode),this._linesOfCode=0),e.deleteShader(this._vShader),this._vShader=null,t.decrement(i.Shader,this)),this._fShader&&=(e.deleteShader(this._fShader),null),this._glName&&(e.deleteProgram(this._glName),this._glName=null,t.decrement(i.Program,this))}_getUniformLocation(e){let t=this._nameToUniformLocation.get(e);if(t!==void 0)return t;if(this.glName){let t=this._context.gl.getUniformLocation(this.glName,e);return this._nameToUniformLocation.set(e,t),t&&this._context.instanceCounter.increment(i.Uniform,t),t}return null}hasUniform(e){return this._getUniformLocation(e)!=null}setUniform1i(e,t,n){m(n,t);let r=this._nameToUniform1.get(e);(r===void 0||t!==r)&&(this._context.gl.uniform1i(this._getUniformLocation(e),t),this._nameToUniform1.set(e,t))}setUniform1iv(e,t,n){h(n,t),f(this._nameToUniform1v,e,t)&&this._context.gl.uniform1iv(this._getUniformLocation(e),t)}setUniform2iv(e,t,n){h(n,t),f(this._nameToUniform2,e,t)&&this._context.gl.uniform2iv(this._getUniformLocation(e),t)}setUniform3iv(e,t,n){h(n,t),f(this._nameToUniform3,e,t)&&this._context.gl.uniform3iv(this._getUniformLocation(e),t)}setUniform4iv(e,t,n){h(n,t),f(this._nameToUniform4,e,t)&&this._context.gl.uniform4iv(this._getUniformLocation(e),t)}setUniform1f(e,t,n){m(n,t);let r=this._nameToUniform1.get(e);(r===void 0||t!==r)&&(this._context.gl.uniform1f(this._getUniformLocation(e),t),this._nameToUniform1.set(e,t))}setUniform1fv(e,t,n){h(n,t),f(this._nameToUniform1v,e,t)&&this._context.gl.uniform1fv(this._getUniformLocation(e),t)}setUniform2f(e,t,n,r){m(r,t,n);let i=this._nameToUniform2.get(e);i===void 0?(this._context.gl.uniform2f(this._getUniformLocation(e),t,n),this._nameToUniform2.set(e,[t,n])):(t!==i[0]||n!==i[1])&&(this._context.gl.uniform2f(this._getUniformLocation(e),t,n),i[0]=t,i[1]=n)}setUniform2fv(e,t,n){h(n,t),f(this._nameToUniform2,e,t)&&this._context.gl.uniform2fv(this._getUniformLocation(e),t)}setUniform3f(e,t,n,r,i){m(i,t,n,r);let a=this._nameToUniform3.get(e);a===void 0?(this._context.gl.uniform3f(this._getUniformLocation(e),t,n,r),this._nameToUniform3.set(e,[t,n,r])):(t!==a[0]||n!==a[1]||r!==a[2])&&(this._context.gl.uniform3f(this._getUniformLocation(e),t,n,r),a[0]=t,a[1]=n,a[2]=r)}setUniform3fv(e,t,n){h(n,t);let r=this._getUniformLocation(e);r!=null&&f(this._nameToUniform3,e,t)&&this._context.gl.uniform3fv(r,t)}setUniform4f(e,t,n,r,i,a){m(a,t,n,r,i);let o=this._nameToUniform4.get(e);o===void 0?(this._context.gl.uniform4f(this._getUniformLocation(e),t,n,r,i),this._nameToUniform4.set(e,[t,n,r,i])):(o===void 0||t!==o[0]||n!==o[1]||r!==o[2]||i!==o[3])&&(this._context.gl.uniform4f(this._getUniformLocation(e),t,n,r,i),o[0]=t,o[1]=n,o[2]=r,o[3]=i)}setUniform4fv(e,t,n){h(n,t);let r=this._getUniformLocation(e);r!=null&&f(this._nameToUniform4,e,t)&&this._context.gl.uniform4fv(r,t)}setUniformMatrix3fv(e,t,n=!1,r){h(r,t);let i=this._getUniformLocation(e);i!=null&&f(this._nameToUniformMatrix3,e,t)&&this._context.gl.uniformMatrix3fv(i,n,t)}setUniformMatrix4fv(e,t,n=!1,r){h(r,t);let i=this._getUniformLocation(e);if(i!=null){let r=this._nameToUniformMatrix4,a=r.get(e),o=!1;if(!a)r.set(e,Array.from(t)),o=!0;else{let n=t.length;if(a.length!==n)r.set(e,Array.from(t)),o=!0;else for(let e=0;e<n;++e){let r=t[e];if(a[e]!==r){for(a[e]=r;e<n;++e)a[e]=t[e];o=!0;break}}}o&&this._context.gl.uniformMatrix4fv(i,n,t)}}setUniformMatrices4fv(e,t,n=!1,r){h(r,t);let i=this._getUniformLocation(e);i!=null&&f(this._nameToUniformMatrix4,e,t)&&this._context.gl.uniformMatrix4fv(i,n,t)}stop(){}}function l(e,t,r){let i=e.gl,a=i.createShader(t);return i.shaderSource(a,r),i.compileShader(a),n()&&!i.getShaderParameter(a,i.COMPILE_STATUS)&&(o().error(`Compile error in ${t===35633?`vertex`:`fragment`} shader`),o().error(i.getShaderInfoLog(a)),o().error(u(r))),a}function u(e){let t=2;return e.replaceAll(`
4
4
  `,()=>`
5
- `+l(t++)+`:`)}function l(e){return e>=1e3?e.toString():(` `+e).slice(-3)}function u(t,n,r){let i=t.get(n);return i===void 0?(t.set(n,Array.from(r)),!0):e(i,r)}const d={enabled:!1},f=n()?(e,...t)=>p(e,t):()=>{},p=n()?(e,t)=>{if(e?.supportsNaN)return;let n=t.length;for(let e=0;e<n;++e){let n=t[e];Number.isNaN(n)&&console.error(`Got ${n} as uniform value from ${Error().stack}`)}}:()=>{};export{o as DisposableProgram,d as test};
5
+ `+d(t++)+`:`)}function d(e){return e>=1e3?e.toString():(` `+e).slice(-3)}function f(t,n,r){let i=t.get(n);return i===void 0?(t.set(n,Array.from(r)),!0):e(i,r)}const p={enabled:!1},m=r()?(e,...t)=>h(e,t):()=>{},h=r()?(e,t)=>{if(e?.supportsNaN)return;let n=t.length;for(let e=0;e<n;++e){let n=t[e];Number.isNaN(n)&&o().error(`Got ${n} as uniform value from ${Error().stack}`)}}:()=>{};export{c as DisposableProgram,p as test};
@@ -1,5 +1,5 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import e from"../../core/Error.js";import"../../core/has.js";import t from"../../core/Logger.js";const n=()=>t.getLogger(`esri.views.3d.webgl-engine.core.shaderModules.shaderBuilder`);class r{constructor(){this._includedModules=new Map}include(e,t){this._includedModules.has(e)?this._includedModules.get(e):(this._includedModules.set(e,t),e(this.builder,t))}}class i extends r{constructor(){super(...arguments),this.vertex=new l,this.fragment=new l,this.attributes=new u,this.varyings=new d,this.outputs=new f}get attributeNames(){return this.attributes.names}get builder(){return this}generate(e,t=!1){let n=this.attributes.generateSource(e),r=this.varyings.generateSource(e),i=e===`vertex`?this.vertex:this.fragment,a=i.uniforms.generateSource(),o=i.code.generateSource(),s=i.main.generateSource(t),c=this.debugName?`// ${this.debugName}\n`:``,l=e===`vertex`?h:m,u=i.constants.generateSource(),d=this.outputs.generateSource(e);return`#version 300 es
2
+ import{filterInPlace as e}from"../../core/arrayUtils.js";import t from"../../core/Error.js";import"../../core/has.js";import n from"../../core/Logger.js";const r=()=>n.getLogger(`esri.views.3d.webgl-engine.core.shaderModules.ShaderBuilder`);class i{constructor(){this._includedModules=new Map}include(e,t){this._includedModules.has(e)?this._includedModules.get(e):(this._includedModules.set(e,t),e(this.builder,t))}}class a extends i{constructor(){super(...arguments),this.vertex=new u,this.fragment=new u,this.attributes=new d,this.varyings=new f,this.outputs=new p}get attributeNames(){return this.attributes.names}get builder(){return this}generate(e,t=!1){let n=this.attributes.generateSource(e),r=this.varyings.generateSource(e),i=e===`vertex`?this.vertex:this.fragment,a=i.uniforms.generateSource(),o=i.code.generateSource(),s=i.main.generateSource(t),c=this.debugName?`// ${this.debugName}\n`:``,l=e===`vertex`?g:h,u=i.constants.generateSource(),d=this.outputs.generateSource(e);return`#version 300 es
3
3
  ${c}
4
4
  ${l}
5
5
  ${u.join(`
@@ -15,26 +15,26 @@ ${d.join(`
15
15
  ${o.join(`
16
16
  `)}
17
17
  ${s.join(`
18
- `)}`}generateBind(e){let t=new Map;this.vertex.uniforms.entries.forEach(e=>{let n=e.bind[0];n&&t.set(e.name,n)}),this.fragment.uniforms.entries.forEach(e=>{let n=e.bind[0];n&&t.set(e.name,n)});let n=Array.from(t.values()),r=n.length;return t=>{for(let i=0;i<r;++i)n[i](e,t)}}generateBindPass(e){let t=new Map;this.vertex.uniforms.entries.forEach(e=>{let n=e.bind[1];n&&t.set(e.name,n)}),this.fragment.uniforms.entries.forEach(e=>{let n=e.bind[1];n&&t.set(e.name,n)});let n=Array.from(t.values()),r=n.length;return(t,i)=>{for(let a=0;a<r;++a)n[a](e,i,t)}}generateBindDraw(e){let t=new Map;this.vertex.uniforms.entries.forEach(e=>{let n=e.bind[2];n&&t.set(e.name,n)}),this.fragment.uniforms.entries.forEach(e=>{let n=e.bind[2];n&&t.set(e.name,n)});let n=Array.from(t.values()),r=n.length;return(t,i,a)=>{for(let o=0;o<r;++o)n[o](e,a,t,i)}}}class a{constructor(e){this._stage=e,this._entries=new Map}add(...e){for(let t of e)this._add(t);return this._stage}get(e){return this._entries.get(e)}_add(t){if(t==null)n().error(`Trying to add null Uniform from ${Error().stack}.`);else{if(this._entries.has(t.name)&&!this._entries.get(t.name).equals(t))throw new e(`shaderbuilder:duplicate-uniform`,`Duplicate uniform name ${t.name} for different uniform type`);this._entries.set(t.name,t)}}generateSource(){return Array.from(this._entries.values()).map(({name:e,arraySize:t,type:n})=>t==null?`uniform ${n} ${e};`:`uniform ${n} ${e}[${t}];`)}get entries(){return Array.from(this._entries.values())}}class o{constructor(){this._entries=new Map}add(t,n){if(this._entries.has(t))throw new e(`shaderbuilder:duplicate-input`,`Duplicate input for ${t}`);this._entries.set(t,n)}get(t){let n=this._entries.get(t);if(n==null)throw new e(`shaderbuilder:input-resolver-error`,`No resolver for input ${t} found.`);return n()}}class s{constructor(e){this._stage=e,this._bodies=[]}add(e){return this._bodies.push(e),this._stage}generateSource(t){if(this._bodies.length>0){let e=[];for(let t of this._bodies)typeof t==`string`?e.push(t):e.push(...t());return[`void main() {\n ${e.join(`
19
- `)||``} \n}`]}if(t)throw new e(`shaderbuilder:missing-main`,`Shader does not contain main function body.`);return[]}}class c{constructor(e){this._stage=e,this._entries=[]}add(e){return this._entries.push(e),this._stage}generateSource(){let e=[];for(let t of this._entries)typeof t==`string`?e.push(t):e.push(...t());return e}}class l extends r{constructor(){super(...arguments),this.uniforms=new a(this),this.main=new s(this),this.code=new c(this),this.constants=new p(this),this.inputs=new o}get builder(){return this}}class u{constructor(){this._entries=[]}add(e,t){this._entries.push([e,t])}generateSource(e){return e===`fragment`?[]:this._entries.map(e=>`in ${e[1]} ${e[0]};`)}get names(){return this._entries.map(([e])=>e)}}class d{constructor(){this._entries=new Map}add(e,t,r){this._entries.has(e)?n().warn(`Ignoring duplicate varying ${t} ${e}`):this._entries.set(e,{type:t,flat:r?.flat??!1,invariant:r?.invariant??!1})}generateSource(e){let t=[];return this._entries.forEach((n,r)=>t.push((n.invariant&&e===`vertex`?`invariant `:``)+(n.flat?`flat `:``)+(e===`vertex`?`out`:`in`)+` ${n.type} ${r};`)),t}}class f{constructor(){this._entries=new Map}add(e,t,r=0){let i=this._entries.get(r);i?.name===e&&i?.type===t?n().warn(`Fragment shader output location ${r} occupied`):this._entries.set(r,{name:e,type:t})}static{this.DEFAULT_TYPE=`vec4`}static{this.DEFAULT_NAME=`fragColor`}generateSource(e){if(e===`vertex`)return[];this._entries.size===0&&this._entries.set(0,{name:f.DEFAULT_NAME,type:f.DEFAULT_TYPE});let t=[];return this._entries.forEach((e,n)=>t.push(`layout(location = ${n}) out ${e.type} ${e.name};`)),t}}class p{constructor(e){this._stage=e,this._entries=new Set}add(e,t,n){let r=`ERROR_CONSTRUCTOR_STRING`;switch(t){case`float`:r=p._numberToFloatStr(n);break;case`int`:r=p._numberToIntStr(n);break;case`uint`:r=p._numberToUintStr(n);break;case`bool`:r=n.toString();break;case`vec2`:r=`vec2(${p._numberToFloatStr(n[0])},\
20
- ${p._numberToFloatStr(n[1])})`;break;case`vec3`:r=`vec3(${p._numberToFloatStr(n[0])},\
21
- ${p._numberToFloatStr(n[1])},\
22
- ${p._numberToFloatStr(n[2])})`;break;case`vec4`:r=`vec4(${p._numberToFloatStr(n[0])},\
23
- ${p._numberToFloatStr(n[1])},\
24
- ${p._numberToFloatStr(n[2])},\
25
- ${p._numberToFloatStr(n[3])})`;break;case`ivec2`:r=`ivec2(${p._numberToIntStr(n[0])},\
26
- ${p._numberToIntStr(n[1])})`;break;case`ivec3`:r=`ivec3(${p._numberToIntStr(n[0])},\
27
- ${p._numberToIntStr(n[1])},\
28
- ${p._numberToIntStr(n[2])})`;break;case`ivec4`:r=`ivec4(${p._numberToIntStr(n[0])},\
29
- ${p._numberToIntStr(n[1])},\
30
- ${p._numberToIntStr(n[2])},\
31
- ${p._numberToIntStr(n[3])})`;break;case`uvec2`:r=`uvec2(${p._numberToUintStr(n[0])},\
32
- ${p._numberToUintStr(n[1])})`;break;case`uvec3`:r=`uvec3(${p._numberToUintStr(n[0])},\
33
- ${p._numberToUintStr(n[1])},\
34
- ${p._numberToUintStr(n[2])})`;break;case`uvec4`:r=`uvec4(${p._numberToUintStr(n[0])},\
35
- ${p._numberToUintStr(n[1])},\
36
- ${p._numberToUintStr(n[2])},\
37
- ${p._numberToUintStr(n[3])})`;break;case`mat2`:case`mat3`:case`mat4`:r=`${t}(${Array.prototype.map.call(n,e=>p._numberToFloatStr(e)).join(`, `)})`}return this._entries.add(`const ${t} ${e} = ${r};`),this._stage}static _numberToIntStr(e){return e.toFixed(0)}static _numberToUintStr(e){return`${e.toFixed(0)}u`}static _numberToFloatStr(e){return Number.isInteger(e)?e.toFixed(1):e.toString()}generateSource(){return Array.from(this._entries)}}const m=`#ifdef GL_FRAGMENT_PRECISION_HIGH
18
+ `)}`}generateBind(t){let n=new Map;this.vertex.uniforms.entries.forEach(e=>{let t=e.bind[0];t&&n.set(e.name,t)}),this.fragment.uniforms.entries.forEach(e=>{let t=e.bind[0];t&&n.set(e.name,t)});let r=Array.from(n.keys()),i=Array.from(n.values()),a=i.length;return n=>{r&&=(e(i,(e,n)=>t.hasUniform(r[n])),a=i.length,null);for(let e=0;e<a;++e)i[e](t,n)}}generateBindPass(e){let t=new Map;this.vertex.uniforms.entries.forEach(e=>{let n=e.bind[1];n&&t.set(e.name,n)}),this.fragment.uniforms.entries.forEach(e=>{let n=e.bind[1];n&&t.set(e.name,n)});let n=Array.from(t.values()),r=n.length;return(t,i)=>{for(let a=0;a<r;++a)n[a](e,i,t)}}generateBindDraw(e){let t=new Map;this.vertex.uniforms.entries.forEach(e=>{let n=e.bind[2];n&&t.set(e.name,n)}),this.fragment.uniforms.entries.forEach(e=>{let n=e.bind[2];n&&t.set(e.name,n)});let n=Array.from(t.values()),r=n.length;return(t,i,a)=>{for(let o=0;o<r;++o)n[o](e,a,t,i)}}}class o{constructor(e){this._stage=e,this._entries=new Map}add(...e){for(let t of e)this._add(t);return this._stage}get(e){return this._entries.get(e)}_add(e){if(e==null)r().error(`Trying to add null Uniform from ${Error().stack}.`);else{if(this._entries.has(e.name)&&!this._entries.get(e.name).equals(e))throw new t(`shaderbuilder:duplicate-uniform`,`Duplicate uniform name ${e.name} for different uniform type`);this._entries.set(e.name,e)}}generateSource(){return Array.from(this._entries.values()).map(({name:e,arraySize:t,type:n})=>t==null?`uniform ${n} ${e};`:`uniform ${n} ${e}[${t}];`)}get entries(){return Array.from(this._entries.values())}}class s{constructor(){this._entries=new Map}add(e,n){if(this._entries.has(e))throw new t(`shaderbuilder:duplicate-input`,`Duplicate input for ${e}`);this._entries.set(e,n)}get(e){let n=this._entries.get(e);if(n==null)throw new t(`shaderbuilder:input-resolver-error`,`No resolver for input ${e} found.`);return n()}}class c{constructor(e){this._stage=e,this._bodies=[]}add(e){return this._bodies.push(e),this._stage}generateSource(e){if(this._bodies.length>0){let e=[];for(let t of this._bodies)typeof t==`string`?e.push(t):e.push(...t());return[`void main() {\n ${e.join(`
19
+ `)||``} \n}`]}if(e)throw new t(`shaderbuilder:missing-main`,`Shader does not contain main function body.`);return[]}}class l{constructor(e){this._stage=e,this._entries=[]}add(e){return this._entries.push(e),this._stage}generateSource(){let e=[];for(let t of this._entries)typeof t==`string`?e.push(t):e.push(...t());return e}}class u extends i{constructor(){super(...arguments),this.uniforms=new o(this),this.main=new c(this),this.code=new l(this),this.constants=new m(this),this.inputs=new s}get builder(){return this}}class d{constructor(){this._entries=[]}add(e,t){this._entries.push([e,t])}generateSource(e){return e===`fragment`?[]:this._entries.map(e=>`in ${e[1]} ${e[0]};`)}get names(){return this._entries.map(([e])=>e)}}class f{constructor(){this._entries=new Map}add(e,t,n){this._entries.has(e)?r().warn(`Ignoring duplicate varying ${t} ${e}`):this._entries.set(e,{type:t,flat:n?.flat??!1,invariant:n?.invariant??!1})}generateSource(e){let t=[];return this._entries.forEach((n,r)=>t.push((n.invariant&&e===`vertex`?`invariant `:``)+(n.flat?`flat `:``)+(e===`vertex`?`out`:`in`)+` ${n.type} ${r};`)),t}}class p{constructor(){this._entries=new Map}add(e,t,n=0){let i=this._entries.get(n);i?.name===e&&i?.type===t?r().warn(`Fragment shader output location ${n} occupied`):this._entries.set(n,{name:e,type:t})}static{this.DEFAULT_TYPE=`vec4`}static{this.DEFAULT_NAME=`fragColor`}generateSource(e){if(e===`vertex`)return[];this._entries.size===0&&this._entries.set(0,{name:p.DEFAULT_NAME,type:p.DEFAULT_TYPE});let t=[];return this._entries.forEach((e,n)=>t.push(`layout(location = ${n}) out ${e.type} ${e.name};`)),t}}class m{constructor(e){this._stage=e,this._entries=new Set}add(e,t,n){let r=`ERROR_CONSTRUCTOR_STRING`;switch(t){case`float`:r=m._numberToFloatStr(n);break;case`int`:r=m._numberToIntStr(n);break;case`uint`:r=m._numberToUintStr(n);break;case`bool`:r=n.toString();break;case`vec2`:r=`vec2(${m._numberToFloatStr(n[0])},\
20
+ ${m._numberToFloatStr(n[1])})`;break;case`vec3`:r=`vec3(${m._numberToFloatStr(n[0])},\
21
+ ${m._numberToFloatStr(n[1])},\
22
+ ${m._numberToFloatStr(n[2])})`;break;case`vec4`:r=`vec4(${m._numberToFloatStr(n[0])},\
23
+ ${m._numberToFloatStr(n[1])},\
24
+ ${m._numberToFloatStr(n[2])},\
25
+ ${m._numberToFloatStr(n[3])})`;break;case`ivec2`:r=`ivec2(${m._numberToIntStr(n[0])},\
26
+ ${m._numberToIntStr(n[1])})`;break;case`ivec3`:r=`ivec3(${m._numberToIntStr(n[0])},\
27
+ ${m._numberToIntStr(n[1])},\
28
+ ${m._numberToIntStr(n[2])})`;break;case`ivec4`:r=`ivec4(${m._numberToIntStr(n[0])},\
29
+ ${m._numberToIntStr(n[1])},\
30
+ ${m._numberToIntStr(n[2])},\
31
+ ${m._numberToIntStr(n[3])})`;break;case`uvec2`:r=`uvec2(${m._numberToUintStr(n[0])},\
32
+ ${m._numberToUintStr(n[1])})`;break;case`uvec3`:r=`uvec3(${m._numberToUintStr(n[0])},\
33
+ ${m._numberToUintStr(n[1])},\
34
+ ${m._numberToUintStr(n[2])})`;break;case`uvec4`:r=`uvec4(${m._numberToUintStr(n[0])},\
35
+ ${m._numberToUintStr(n[1])},\
36
+ ${m._numberToUintStr(n[2])},\
37
+ ${m._numberToUintStr(n[3])})`;break;case`mat2`:case`mat3`:case`mat4`:r=`${t}(${Array.prototype.map.call(n,e=>m._numberToFloatStr(e)).join(`, `)})`}return this._entries.add(`const ${t} ${e} = ${r};`),this._stage}static _numberToIntStr(e){return e.toFixed(0)}static _numberToUintStr(e){return`${e.toFixed(0)}u`}static _numberToFloatStr(e){return Number.isInteger(e)?e.toFixed(1):e.toString()}generateSource(){return Array.from(this._entries)}}const h=`#ifdef GL_FRAGMENT_PRECISION_HIGH
38
38
  precision highp float;
39
39
  precision highp int;
40
40
  precision highp sampler2D;
@@ -48,7 +48,7 @@ ${s.join(`
48
48
  precision mediump usampler2D;
49
49
  precision mediump sampler2DArray;
50
50
  precision mediump sampler2DShadow;
51
- #endif`,h=`precision highp float;
51
+ #endif`,g=`precision highp float;
52
52
  precision highp int;
53
53
  precision highp sampler2D;
54
54
  precision highp usampler2D;
@@ -57,4 +57,4 @@ ${s.join(`
57
57
 
58
58
 
59
59
  invariant gl_Position;
60
- `;export{c as Code,r as Includes,o as Inputs,s as Main,i as ShaderBuilder,l as Stage,a as Uniforms};
60
+ `;export{l as Code,i as Includes,s as Inputs,c as Main,a as ShaderBuilder,u as Stage,o as Uniforms};
@@ -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};
package/webscene/Slide.js CHANGED
@@ -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"../Basemap.js";import{property as n,cast as r,subclass as i}from"../core/accessorSupport/decorators.js";import{ensureType as a}from"../core/accessorSupport/ensureType.js";import{result as o}from"../core/asyncUtils.js";import{ClonableMixin as s}from"../core/Clonable.js";import c from"../core/Collection.js";import{referenceSetter as l}from"../core/collectionUtils.js";import{EventedMixin as u}from"../core/Evented.js";import{JSONSupport as d}from"../core/JSONSupport.js";import{squaredDistance as f}from"../core/libs/gl-matrix-2/math/vec3.js";import{create as p}from"../core/libs/gl-matrix-2/factories/vec3f64.js";import m from"../core/Logger.js";import{moduloPositive as h}from"../core/mathUtils.js";import{destroyMaybe as g,removeMaybe as _}from"../core/maybe.js";import{onAbortOrThrow as v,createAbortError as y,isAbortError as b}from"../core/promiseUtils.js";import{whenOnce as x,when as S}from"../core/reactiveUtils.js";import{Milliseconds as C,Seconds as w}from"../core/time.js";import T from"../layers/Layer.js";import{basemapEnsureType as E,clonePreservingTiledLayers as D}from"../support/basemapEnsureType.js";import O from"../Viewpoint.js";import{TaskPriority as k}from"../views/support/Scheduler.js";import A from"../webdoc/support/SlideThumbnail.js";import{timeExtent as j}from"../webdoc/support/timeProperties.js";import M from"./SunLighting.js";import N from"./support/Description.js";import P from"./support/SlideElements.js";import F from"./support/SlideEnvironment.js";import I from"./support/SlideGround.js";import L from"./support/SlideVisibleLayer.js";import R from"./support/Title.js";import z from"./VirtualLighting.js";let B=0;const V=c.ofType(L),H=[`caption`,`cover`,`none`];let U=class extends s(u(d)){constructor(e){super(e),this.id=Date.now().toString(16)+`-slide-`+B++,this.hidden=!1,this.viewpoint=null,this.ground=null,this.layout=`caption`,this.enabledFocusAreas=null,this.environment=new F,this.timeExtent=null,this.timeZone=null,this.elements=new P,this.title=new R,this.description=new N,this.thumbnail=new A,this.visibleLayers=new V}destroy(){this.visibleLayers.removeAll(),this.enabledFocusAreas=null,this.basemap=null,this.thumbnail=g(this.thumbnail),this.description=null,this.title=null,this.thumbnail=null,this.elements.destroy()}get title(){return this._get(`title`)}set title(e){e=typeof e==`string`?new R({text:e}):a(R,e),this._set(`title`,e)}get description(){return this._get(`description`)}set description(e){e=typeof e==`string`?new N({text:e}):a(N,e),this._set(`description`,e)}get thumbnail(){return this._get(`thumbnail`)}set thumbnail(e){e=typeof e==`string`?new A({url:e}):a(A,e),this._set(`thumbnail`,e)}get basemap(){return this._get(`basemap`)}set basemap(e){this._set(`basemap`,E(e))}set visibleLayers(e){this._set(`visibleLayers`,l(e,this._get(`visibleLayers`),V))}castVisibleLayers(e){return!e||typeof e.map!=`function`?null:e.map(e=>{if(typeof e==`string`)return{id:e};if(e instanceof T){let t=K(e);return{id:e.id,sublayerIds:t}}return e.id?{id:e.id,sublayerIds:`sublayerIds`in e?e.sublayerIds:void 0}:(m.getLogger(this).warn(`Invalid visible layer, expected { id }, Layer or "id"`),e)})}async _updateVisibleLayers(e){let t=[];await Promise.allSettled(this._getLayers(e.map).map(n=>e.whenLayerView(n).then(e=>{if(e.visible){let r=K(n);t.push(new L({id:e.layer.id,sublayerIds:r}))}})).toArray()),this.visibleLayers.removeAll(),this.visibleLayers.addMany(t)}async updateFrom(e,t){let n={format:`png`,quality:80,width:120,height:75,disableDecorations:!0,...t?.screenshot};await e.when(),this.viewpoint=e.viewpoint.clone(),this.environment.lighting=e.environment.lighting.type===`virtual`?z.prototype.clone.apply(e.environment.lighting):M.prototype.clone.apply(e.environment.lighting),this.environment.weather=e.environment.weather.clone(),this.enabledFocusAreas=new c(e.focusAreasView?.enabledAreas.map(({id:e})=>e)??[]),this.basemap=e.map.basemap?.clone()||null,this.ground=e.map.ground?I.fromGround(e.map.ground):null,this.timeExtent=e.timeExtent?.clone()??null,this.timeZone=e.timeZone,this.elements.analyses.updateFrom(e),await this._updateVisibleLayers(e);let r=await e.takeScreenshot(n);return this.thumbnail=new A({url:r.dataUrl}),this}async applyTo(e,t){this.emit(`apply-slide-start`),this._applyToController!=null&&this._applyToController.abort();let n=new AbortController;this._applyToController=n;let r=v(t,()=>n?.abort()),i=()=>{this._applyToController===n&&(this._applyToController=null),n=null,r?.remove()};try{await x(()=>e.ready,n.signal)}catch(e){throw i(),e}if(n.signal.aborted)throw i(),this.emit(`apply-slide-cancel`),y();let a=e.resourceController.scheduler.registerTask(k.SLIDE),s=!1,c={animate:!0,...t,signal:this._applyToController.signal},l=await o(e.addUpdatingPromise((async()=>{await Promise.all([a.schedule(async()=>s=await this._setViewpointOfInterest(e,c)),a.schedule(()=>this._applyBasemap(e,c),c.signal),a.schedule(()=>this._loadLayersWithSublayerVisibility(e))]),await Promise.all([a.schedule(()=>this._applyLayerVisibility(e),c.signal),a.schedule(()=>this._applyFocusAreaEnabled(e.map?.focusAreas.areas)),a.schedule(()=>this._applyGround(e),c.signal),a.schedule(()=>this.elements.analyses.applyTo(e),c.signal),a.schedule(()=>this._applyViewpoint(e,c),c.signal),a.schedule(()=>e.timeExtent=this.timeExtent?.clone()??null,c.signal),a.schedule(()=>{this.timeZone!=null&&(e.timeZone=this.timeZone)},c.signal),a.schedule(()=>e.environment.weather=this.environment.weather.clone())])})()));if(s&&(e.contentCamera=null),a.remove(),i(),l.ok===!1)throw this.emit(`apply-slide-cancel`),l.error;return this.emit(`apply-slide-complete`),this}async _applyBasemap(e,t){if(this.basemap){try{await this.basemap.load(t)}catch(e){if(b(e))throw e}e.map.basemap=D(this.basemap,e.map.basemap)}}_applyGround(e){this.ground&&(e.map.ground=this.ground.cloneAndApplyTo(e.map.ground))}_applyFocusAreaEnabled(e){if(e&&this.enabledFocusAreas)for(let t of e)t.enabled=this.enabledFocusAreas.includes(t.id)}_getLayers(e){let t=new c;return this._collectLayers(e,t),this._collectLayers(e.ground,t),t}_collectLayers(e,t){e.layers.forEach(e=>{e.persistenceEnabled&&(t.add(e),`layers`in e&&this._collectLayers(e,t))})}async _loadLayersWithSublayerVisibility(e){this.visibleLayers&&await Promise.allSettled(this._getLayers(e.map).items.map(e=>this.visibleLayers.find(t=>t.id===e.id)?.sublayerIds?e.load():null))}_applyLayerVisibility(e){this.visibleLayers&&this._getLayers(e.map).forEach(e=>{let t=this.visibleLayers.find(t=>t.id===e.id);e.visible=t!=null;let n=t?.sublayerIds,r=G(e);n&&r&&r.forEach(e=>e.visible=n.includes(e.id))})}async _setViewpointOfInterest(e,t){if(e.state.fixedContentCamera||!this.viewpoint||t?.ignoreViewpoint||!t?.useDestinationCamera)return!1;let{toCameraAsync:n}=await import(`../views/3d/support/viewpointUtils.js`),r=await n(e,this.viewpoint);return e.contentCamera=r,r!=null}async _applyViewpoint(e,t){if(this._applyCachedCameraTrackingEnabled(e),this.viewpoint&&!t.ignoreViewpoint){let n=this.environment.lighting;if(t.animate&&n.type===`sun`&&n.date)return this._animateToLighting(e,t);t.animate&&(e.environment.applyLighting(n.clone()),await e.goTo(this.viewpoint,t)),e.viewpoint=this.viewpoint}e.environment.applyLighting(this.environment.lighting.clone())}async _animateToLighting(e,t){let n=null;return e.environment.lighting.type!==`virtual`&&this.environment.lighting.type!==`virtual`&&(e.viewingMode===`global`&&(n=this._animateLightingWithCamera(e,e.environment.lighting,this.environment.lighting)),e.environment.cachedCameraTrackingEnabled=e.environment.lighting.cameraTrackingEnabled,e.environment.lighting.cameraTrackingEnabled=!1),e.environment.lighting.glow=this.environment.lighting.glow,e.environment.lighting.directShadowsEnabled=this.environment.lighting.directShadowsEnabled,this.environment.lighting.type===`virtual`||e.environment.lighting.type===`virtual`?(e.environment.applyLighting(this.environment.lighting.clone()),e.environment.lighting.type!==`virtual`&&(e.environment.cachedCameraTrackingEnabled=e.environment.lighting.cameraTrackingEnabled,e.environment.lighting.cameraTrackingEnabled=!1)):this.environment.lighting.displayUTCOffset!=null&&(e.environment.lighting.displayUTCOffset=this.environment.lighting.displayUTCOffset),e.goTo(this.viewpoint,t).then(()=>{this._applyCachedCameraTrackingEnabled(e),e.environment.applyLighting(this.environment.lighting.clone())}).catch(t=>{throw e.animation??this._applyCachedCameraTrackingEnabled(e),t}).finally(()=>{_(n)})}_applyCachedCameraTrackingEnabled(e){e.environment.cachedCameraTrackingEnabled!=null&&(e.environment.lighting.cameraTrackingEnabled=e.environment.cachedCameraTrackingEnabled,e.environment.cachedCameraTrackingEnabled=null)}_getTime(e){return[C(e.getTime()),w(e.getUTCHours()*3600+e.getUTCMinutes()*60+e.getUTCSeconds())]}_setTime(e,t,n){return e.setTime(t),e.setUTCHours(n/3600),e.setUTCMinutes(n%3600/60),e.setUTCSeconds(n%3600%60),e}_animateLightingWithCamera(e,t,n){let r=new Date(t.date.toString()),[i,a]=this._getTime(r),[o,s]=this._getTime(n.date),c=Y(a,s),l=e.renderCoordsHelper,u=p();l.toRenderCoords(e.camera.position,u);let d=p(),m=p();this.viewpoint.camera!=null&&l.toRenderCoords(this.viewpoint.camera.position,d);let h=new Date;return S(()=>e.camera,e=>{l.toRenderCoords(e.position,m);let n=f(u,m),r=f(d,m),s=0;n+r!==0&&(s=n/(n+r));let p=i+(o-i)*s,g=X(a,w(c*s));t.date=this._setTime(h,p,g)})}write(e,t){t?.origin||(t={origin:`web-scene`,...t});let n=super.write(e,t);return n?.elements&&Object.keys(n.elements).length===0&&delete n.elements,n}read(e,t){t?.origin||(t={origin:`web-scene`,...t}),super.read(e,t)}static createFrom(e,t){return new this().updateFrom(e,t)}};e([n({type:String,json:{write:{isRequired:!0}}})],U.prototype,`id`,void 0),e([n({type:R,useTypeForAutocast:!1,json:{default:()=>new R({text:``}),write:{isRequired:!0}}})],U.prototype,`title`,null),e([n({type:N,useTypeForAutocast:!1,json:{write:{overridePolicy(e){return{enabled:!!(e&&e.text)}}}}})],U.prototype,`description`,null),e([n({type:Boolean,nonNullable:!0,json:{write:!0,default:!1}})],U.prototype,`hidden`,void 0),e([n({type:A,useTypeForAutocast:!1,json:{default:()=>new A({url:``}),write:{isRequired:!0}}})],U.prototype,`thumbnail`,null),e([n({type:O,nonNullable:!0,json:{write:{isRequired:!0}}})],U.prototype,`viewpoint`,void 0),e([n({type:t,useTypeForAutocast:!1,json:{read:{source:`baseMap`},write:{target:`baseMap`}}})],U.prototype,`basemap`,null),e([n({type:I,json:{write:!0}})],U.prototype,`ground`,void 0),e([n({type:H,json:{write:!0,default:`caption`},nonNullable:!0})],U.prototype,`layout`,void 0),e([n({type:V,json:{write:{isRequired:!0}}})],U.prototype,`visibleLayers`,null),e([r(`visibleLayers`)],U.prototype,`castVisibleLayers`,null),e([n({type:c.ofType(String),json:{write:!0},clonable:e=>e?new c(e.items):null})],U.prototype,`enabledFocusAreas`,void 0),e([n({type:F,json:{write:!0}})],U.prototype,`environment`,void 0),e([n(j)],U.prototype,`timeExtent`,void 0),e([n({type:String,json:{read:!0,write:!0}})],U.prototype,`timeZone`,void 0),e([n({type:P,nonNullable:!0,json:{write:!0}})],U.prototype,`elements`,void 0),U=e([i(`esri.webscene.Slide`)],U);const W=U;function G(e){if(e.type===`building-scene`||e.type===`map-image`)return e.allSublayers.toArray()}function K(e){let t=G(e);if(t)return t.filter(e=>e.visible).map(e=>e.id)}const q=w(86400),J=w(43200);function Y(e,t){let n=t-e;return n>J&&(n-=q),n<-J&&(n+=q),w(n)}function X(e,t){return w(h(e+t,q))}export{W as default};
2
+ import{__decorate as e}from"tslib";import t from"../Basemap.js";import{property as n,cast as r,subclass as i}from"../core/accessorSupport/decorators.js";import{ensureType as a}from"../core/accessorSupport/ensureType.js";import{result as o}from"../core/asyncUtils.js";import{ClonableMixin as s}from"../core/Clonable.js";import c from"../core/Collection.js";import{referenceSetter as l}from"../core/collectionUtils.js";import{EventedMixin as u}from"../core/Evented.js";import{JSONSupport as d}from"../core/JSONSupport.js";import{squaredDistance as f}from"../core/libs/gl-matrix-2/math/vec3.js";import{create as p}from"../core/libs/gl-matrix-2/factories/vec3f64.js";import m from"../core/Logger.js";import{moduloPositive as h}from"../core/mathUtils.js";import{destroyMaybe as g,removeMaybe as _}from"../core/maybe.js";import{onAbortOrThrow as v,createAbortError as y,isAbortError as b}from"../core/promiseUtils.js";import{whenOnce as x,when as S}from"../core/reactiveUtils.js";import{Milliseconds as C,Seconds as w}from"../core/time.js";import T from"../layers/Layer.js";import{basemapEnsureType as E,clonePreservingTiledLayers as D}from"../support/basemapEnsureType.js";import O from"../Viewpoint.js";import{TaskPriority as k}from"../views/support/Scheduler.js";import A from"../webdoc/support/SlideThumbnail.js";import{timeExtent as j}from"../webdoc/support/timeProperties.js";import M from"./SunLighting.js";import N from"./support/Description.js";import P from"./support/SlideElements.js";import F from"./support/SlideEnvironment.js";import I from"./support/SlideGround.js";import L from"./support/SlideVisibleLayer.js";import R from"./support/Title.js";import z from"./VirtualLighting.js";let B=0;const V=c.ofType(L),H=[`caption`,`cover`,`none`];let U=class extends s(u(d)){constructor(e){super(e),this.id=Date.now().toString(16)+`-slide-`+B++,this.hidden=!1,this.viewpoint=null,this.ground=null,this.layout=`caption`,this.enabledFocusAreas=null,this.environment=new F,this.timeExtent=null,this.timeZone=null,this.elements=new P,this.title=new R,this.description=new N,this.thumbnail=new A,this.visibleLayers=new V}destroy(){this.visibleLayers.removeAll(),this.enabledFocusAreas=null,this.basemap=null,this.thumbnail=g(this.thumbnail),this.description=null,this.title=null,this.thumbnail=null,this.elements.destroy()}get title(){return this._get(`title`)}set title(e){e=typeof e==`string`?new R({text:e}):a(R,e),this._set(`title`,e)}get description(){return this._get(`description`)}set description(e){e=typeof e==`string`?new N({text:e}):a(N,e),this._set(`description`,e)}get thumbnail(){return this._get(`thumbnail`)}set thumbnail(e){e=typeof e==`string`?new A({url:e}):a(A,e),this._set(`thumbnail`,e)}get basemap(){return this._get(`basemap`)}set basemap(e){this._set(`basemap`,E(e))}set visibleLayers(e){this._set(`visibleLayers`,l(e,this._get(`visibleLayers`),V))}castVisibleLayers(e){return!e||typeof e.map!=`function`?null:e.map(e=>{if(typeof e==`string`)return{id:e};if(e instanceof T){let t=K(e);return{id:e.id,sublayerIds:t}}return e.id?{id:e.id,sublayerIds:`sublayerIds`in e?e.sublayerIds:void 0}:(m.getLogger(this).warn(`Invalid visible layer, expected { id }, Layer or "id"`),e)})}async _updateVisibleLayers(e){let t=[];await Promise.allSettled(this._getLayers(e.map).map(n=>e.whenLayerView(n).then(e=>{if(e.visible){let r=K(n);t.push(new L({id:e.layer.id,sublayerIds:r}))}})).toArray()),this.visibleLayers.removeAll(),this.visibleLayers.addMany(t)}async updateFrom(e,t){let n={format:`png`,quality:80,width:120,height:75,disableDecorations:!0,...t?.screenshot};await e.when(),this.viewpoint=e.viewpoint.clone(),this.environment.lighting=e.environment.lighting.type===`virtual`?z.prototype.clone.apply(e.environment.lighting):M.prototype.clone.apply(e.environment.lighting),this.environment.weather=e.environment.weather.clone(),this.enabledFocusAreas=new c(e.focusAreasView?.enabledAreas.map(({id:e})=>e)??[]),this.basemap=e.map.basemap?.clone()||null,this.ground=e.map.ground?I.fromGround(e.map.ground):null,this.timeExtent=e.timeExtent?.clone()??null,this.timeZone=e.timeZone,this.elements.analyses.updateFrom(e),await this._updateVisibleLayers(e);let r=await e.takeScreenshot(n);return this.thumbnail=new A({url:r.dataUrl}),this}async applyTo(e,t){this.emit(`apply-slide-start`),this._applyToController!=null&&this._applyToController.abort();let n=new AbortController;this._applyToController=n;let r=v(t,()=>n?.abort()),i=()=>{this._applyToController===n&&(this._applyToController=null),n=null,r?.remove()};try{await x(()=>e.ready,n.signal)}catch(e){throw i(),e}if(n.signal.aborted)throw i(),this.emit(`apply-slide-cancel`),y();let a=e.resourceController.scheduler.registerTask(k.SLIDE),s=!1,c={animate:!0,...t,signal:this._applyToController.signal},l=await o(e.addUpdatingPromise((async()=>{await Promise.all([a.schedule(async()=>s=await this._setViewpointOfInterest(e,c)),a.schedule(()=>this._applyBasemap(e,c),c.signal),a.schedule(()=>this._loadLayersWithSublayerVisibility(e))]),await Promise.all([a.schedule(()=>this._applyLayerVisibility(e),c.signal),a.schedule(()=>this._applyFocusAreaEnabled(e.map?.focusAreas.areas)),a.schedule(()=>this._applyGround(e),c.signal),a.schedule(()=>this.elements.analyses.applyTo(e),c.signal),a.schedule(()=>this._applyViewpoint(e,c),c.signal),a.schedule(()=>e.timeExtent=this.timeExtent?.clone()??null,c.signal),a.schedule(()=>{this.timeZone!=null&&(e.timeZone=this.timeZone)},c.signal),a.schedule(()=>e.environment.weather=this.environment.weather.clone())])})()));if(s&&(e.contentCamera=null),a.remove(),i(),l.ok===!1)throw this.emit(`apply-slide-cancel`),l.error;return this.emit(`apply-slide-complete`),this}async _applyBasemap(e,t){if(this.basemap){try{await this.basemap.load(t)}catch(e){if(b(e))throw e}e.map.basemap=D(this.basemap,e.map.basemap)}}_applyGround(e){this.ground&&(e.map.ground=this.ground.cloneAndApplyTo(e.map.ground))}_applyFocusAreaEnabled(e){if(e&&this.enabledFocusAreas)for(let t of e)t.enabled=this.enabledFocusAreas.includes(t.id)}_getLayers(e){let t=new c;return this._collectLayers(e,t),this._collectLayers(e.ground,t),t}_collectLayers(e,t){e.layers.forEach(e=>{e.persistenceEnabled&&(t.add(e),`layers`in e&&this._collectLayers(e,t))})}async _loadLayersWithSublayerVisibility(e){this.visibleLayers&&await Promise.allSettled(this._getLayers(e.map).items.map(e=>this.visibleLayers.find(t=>t.id===e.id)?.sublayerIds?e.load():null))}_applyLayerVisibility(e){this.visibleLayers&&this._getLayers(e.map).forEach(e=>{let t=this.visibleLayers.find(t=>t.id===e.id);e.visible=t!=null;let n=t?.sublayerIds,r=G(e);n&&r&&r.forEach(e=>e.visible=n.includes(e.id))})}async _setViewpointOfInterest(e,t){if(e.state.fixedContentCamera||!this.viewpoint||t?.ignoreViewpoint||!t?.useDestinationCamera)return!1;let{toCameraAsync:n}=await import(`../views/3d/support/viewpointUtils.js`),r=await n(e,this.viewpoint);return e.contentCamera=r,r!=null}async _applyViewpoint(e,t){if(this._applyCachedCameraTrackingEnabled(e),this.viewpoint&&!t.ignoreViewpoint){let n=this.environment.lighting;if(t.animate&&n.type===`sun`&&n.date)return this._animateToLighting(e,t);t.animate&&(e.environment.applyLighting(n.clone()),await e.goTo(this.viewpoint,t)),e.viewpoint=this.viewpoint}e.environment.applyLighting(this.environment.lighting.clone())}async _animateToLighting(e,t){let n=null;return e.environment.lighting.type!==`virtual`&&this.environment.lighting.type!==`virtual`&&(e.state.isGlobal&&(n=this._animateLightingWithCamera(e,e.environment.lighting,this.environment.lighting)),e.environment.cachedCameraTrackingEnabled=e.environment.lighting.cameraTrackingEnabled,e.environment.lighting.cameraTrackingEnabled=!1),e.environment.lighting.glow=this.environment.lighting.glow,e.environment.lighting.directShadowsEnabled=this.environment.lighting.directShadowsEnabled,this.environment.lighting.type===`virtual`||e.environment.lighting.type===`virtual`?(e.environment.applyLighting(this.environment.lighting.clone()),e.environment.lighting.type!==`virtual`&&(e.environment.cachedCameraTrackingEnabled=e.environment.lighting.cameraTrackingEnabled,e.environment.lighting.cameraTrackingEnabled=!1)):this.environment.lighting.displayUTCOffset!=null&&(e.environment.lighting.displayUTCOffset=this.environment.lighting.displayUTCOffset),e.goTo(this.viewpoint,t).then(()=>{this._applyCachedCameraTrackingEnabled(e),e.environment.applyLighting(this.environment.lighting.clone())}).catch(t=>{throw e.animation??this._applyCachedCameraTrackingEnabled(e),t}).finally(()=>{_(n)})}_applyCachedCameraTrackingEnabled(e){e.environment.cachedCameraTrackingEnabled!=null&&(e.environment.lighting.cameraTrackingEnabled=e.environment.cachedCameraTrackingEnabled,e.environment.cachedCameraTrackingEnabled=null)}_getTime(e){return[C(e.getTime()),w(e.getUTCHours()*3600+e.getUTCMinutes()*60+e.getUTCSeconds())]}_setTime(e,t,n){return e.setTime(t),e.setUTCHours(n/3600),e.setUTCMinutes(n%3600/60),e.setUTCSeconds(n%3600%60),e}_animateLightingWithCamera(e,t,n){let r=new Date(t.date.toString()),[i,a]=this._getTime(r),[o,s]=this._getTime(n.date),c=Y(a,s),l=e.renderCoordsHelper,u=p();l.toRenderCoords(e.camera.position,u);let d=p(),m=p();this.viewpoint.camera!=null&&l.toRenderCoords(this.viewpoint.camera.position,d);let h=new Date;return S(()=>e.camera,e=>{l.toRenderCoords(e.position,m);let n=f(u,m),r=f(d,m),s=0;n+r!==0&&(s=n/(n+r));let p=i+(o-i)*s,g=X(a,w(c*s));t.date=this._setTime(h,p,g)})}write(e,t){t?.origin||(t={origin:`web-scene`,...t});let n=super.write(e,t);return n?.elements&&Object.keys(n.elements).length===0&&delete n.elements,n}read(e,t){t?.origin||(t={origin:`web-scene`,...t}),super.read(e,t)}static createFrom(e,t){return new this().updateFrom(e,t)}};e([n({type:String,json:{write:{isRequired:!0}}})],U.prototype,`id`,void 0),e([n({type:R,useTypeForAutocast:!1,json:{default:()=>new R({text:``}),write:{isRequired:!0}}})],U.prototype,`title`,null),e([n({type:N,useTypeForAutocast:!1,json:{write:{overridePolicy(e){return{enabled:!!(e&&e.text)}}}}})],U.prototype,`description`,null),e([n({type:Boolean,nonNullable:!0,json:{write:!0,default:!1}})],U.prototype,`hidden`,void 0),e([n({type:A,useTypeForAutocast:!1,json:{default:()=>new A({url:``}),write:{isRequired:!0}}})],U.prototype,`thumbnail`,null),e([n({type:O,nonNullable:!0,json:{write:{isRequired:!0}}})],U.prototype,`viewpoint`,void 0),e([n({type:t,useTypeForAutocast:!1,json:{read:{source:`baseMap`},write:{target:`baseMap`}}})],U.prototype,`basemap`,null),e([n({type:I,json:{write:!0}})],U.prototype,`ground`,void 0),e([n({type:H,json:{write:!0,default:`caption`},nonNullable:!0})],U.prototype,`layout`,void 0),e([n({type:V,json:{write:{isRequired:!0}}})],U.prototype,`visibleLayers`,null),e([r(`visibleLayers`)],U.prototype,`castVisibleLayers`,null),e([n({type:c.ofType(String),json:{write:!0},clonable:e=>e?new c(e.items):null})],U.prototype,`enabledFocusAreas`,void 0),e([n({type:F,json:{write:!0}})],U.prototype,`environment`,void 0),e([n(j)],U.prototype,`timeExtent`,void 0),e([n({type:String,json:{read:!0,write:!0}})],U.prototype,`timeZone`,void 0),e([n({type:P,nonNullable:!0,json:{write:!0}})],U.prototype,`elements`,void 0),U=e([i(`esri.webscene.Slide`)],U);const W=U;function G(e){if(e.type===`building-scene`||e.type===`map-image`)return e.allSublayers.toArray()}function K(e){let t=G(e);if(t)return t.filter(e=>e.visible).map(e=>e.id)}const q=w(86400),J=w(43200);function Y(e,t){let n=t-e;return n>J&&(n-=q),n<-J&&(n+=q),w(n)}function X(e,t){return w(h(e+t,q))}export{W as default};
@@ -30,10 +30,8 @@ export default class VirtualLighting extends JSONSupport {
30
30
  * Shadows are only displayed for real world 3D objects. Terrain doesn't cast shadows. In local scenes at small zoom
31
31
  * levels, shadows are not displayed. For more control on which 3D objects cast shadows use the `castShadows`
32
32
  * property available on [ObjectSymbol3DLayer.castShadows](https://developers.arcgis.com/javascript/latest/references/core/symbols/ObjectSymbol3DLayer/#castShadows),
33
- *
34
- * [FillSymbol3DLayer.castShadows](https://developers.arcgis.com/javascript/latest/references/core/symbols/FillSymbol3DLayer/#castShadows),
35
- * [ExtrudeSymbol3DLayer.castShadows](https://developers.arcgis.com/javascript/latest/references/core/symbols/ExtrudeSymbol3DLayer/#castShadows),
36
- * and [PathSymbol3DLayer.castShadows](https://developers.arcgis.com/javascript/latest/references/core/symbols/PathSymbol3DLayer/#castShadows).
33
+ * [FillSymbol3DLayer.castShadows](https://developers.arcgis.com/javascript/latest/references/core/symbols/FillSymbol3DLayer/#castShadows), [ExtrudeSymbol3DLayer.castShadows](https://developers.arcgis.com/javascript/latest/references/core/symbols/ExtrudeSymbol3DLayer/#castShadows),
34
+ * [WaterSymbol3DLayer.castShadows](https://developers.arcgis.com/javascript/latest/references/core/symbols/WaterSymbol3DLayer/#castShadows), and [PathSymbol3DLayer.castShadows](https://developers.arcgis.com/javascript/latest/references/core/symbols/PathSymbol3DLayer/#castShadows).
37
35
  *
38
36
  * @default false
39
37
  */
@@ -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};
@@ -6,7 +6,7 @@ import type { InputUnion } from "../../../form/elements/inputs/types.js";
6
6
  import type { FieldValue } from "../../../layers/support/fieldUtils.js";
7
7
  import type { NumericRange } from "../../../layers/support/NumericRange.js";
8
8
  import type { DomainUnion as Domain } from "../../../layers/support/types.js";
9
- import type { FieldInputDataTypes } from "../../support/forms/types.js";
9
+ import type { FieldInputDataTypes, FieldValueOptionSet } from "../../support/forms/types.js";
10
10
  import type { EditableInputProperties } from "./EditableInput.js";
11
11
  import type { FieldInputMessage } from "./types.js";
12
12
  import type { InputController } from "./support/controllerUtils.js";
@@ -30,6 +30,8 @@ export default class FieldInput extends EditableInput<any> {
30
30
  * [BatchAttributeFormViewModel](https://developers.arcgis.com/javascript/latest/references/core/widgets/BatchAttributeForm/BatchAttributeFormViewModel/)
31
31
  */
32
32
  constructor(properties: FieldInputProperties);
33
+ /** @internal */
34
+ get codedValueOptions(): FieldValueOptionSet;
33
35
  /**
34
36
  * The type of data displayed by the field input. Possible values are listed below.
35
37
  *
@@ -73,6 +75,12 @@ export default class FieldInput extends EditableInput<any> {
73
75
  accessor inputController: InputController | null;
74
76
  /** An array of features that do not have a valid value for this field. */
75
77
  get invalidFeatures(): Graphic[];
78
+ /**
79
+ * Indicates whether the field is a subtype field for any of the layers associated with this input.
80
+ *
81
+ * @internal
82
+ */
83
+ get isSubtypeField(): boolean;
76
84
  /** The input's label. */
77
85
  get label(): string;
78
86
  /** The maximum length of the input. If no length is specified, the value is `-1`. */
@@ -107,6 +115,14 @@ export default class FieldInput extends EditableInput<any> {
107
115
  get range(): NumericRange;
108
116
  /** Indicates whether the field is required. This property will be true if it is required for any associated layers of the input. */
109
117
  get required(): boolean;
118
+ /**
119
+ * Indicates whether the "No Value" option is enabled for the field input.
120
+ * This property takes into account whether the field is required and whether
121
+ * the input's `showNoValue` property is set`.
122
+ *
123
+ * @internal
124
+ */
125
+ get showNoValueOptionEnabled(): boolean;
110
126
  /**
111
127
  * The status of the field input.
112
128
  *
@@ -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{isSome as r}from"../../../core/arrayUtils.js";import i from"../../../core/Logger.js";import{destroyMaybe as a}from"../../../core/maybe.js";import{isDynamicChoiceInput as o,isMultipleChoiceInput as s}from"../../../form/elements/inputs/inputUtils.js";import c from"../../../layers/support/CodedValue.js";import l from"../../../layers/support/CodedValueDomain.js";import{getDomainRange as u,validateDomainValue as d,dateTimeFieldValuesToNumericRange as f,isDomainValidForField as p}from"../../../layers/support/domainUtils.js";import{getFieldRange as m,isDateOnlyField as h,isTimeOnlyField as g,isTimestampOffsetField as _}from"../../../layers/support/fieldUtils.js";import{supportsFieldConfiguration as v}from"../../../layers/support/layerUtils.js";import y from"../../../layers/support/RangeDomain.js";import{isNumber as b}from"../../../support/guards.js";import{timeResolutionToStepMap as x}from"../../support/dateUtils.js";import{valuesAreEquivalent as S,getMaxLength as C,getMinLength as w,dateIsValid as T,validateFormValue as E}from"../../support/forms/formUtils.js";import D from"./EditableInput.js";import{isMultipleChoiceController as O}from"./support/controllerUtils.js";import k from"./support/DynamicChoiceController.js";import{MultiFeatureError as A,getFieldInputDataType as j,visibilityCodeToBoolean as M,isFieldInputWithShowNoValueOptionInput as N,isWarning as P,isContingentValuesError as F,FormValidationWarning as I,differentValuesString as L}from"./support/inputUtils.js";import R from"./support/MultipleChoiceController.js";import{otherChoiceCheckedPlaceholderValue as z}from"./support/multipleChoiceInputUtils.js";let B=class extends D{constructor(e){super(e),this.getExternalErrorForFeature=null,this.getFieldValueOptionsForFeature=null,this.group=null,this.inputController=null,this.touched=!1,this.type=`field`,this.userHasChangedValue=!1,this._hasIntersectionWithElementFieldDomain=!1}destroy(){this.inputController=a(this.inputController)}initialize(){if(this.input){if(o(this.input)){let{requestDeferredExpressionEvaluation:e}=this;e?this.inputController=new k({fieldInput:this,requestDeferredExpressionEvaluation:e}):i.getLogger(this).error(`requestDeferredExpressionEvaluation callback is required for dynamic choice inputs.`)}s(this.input)&&(this.inputController=new R({fieldInput:this}))}}get compositeError(){if(this.valid)return null;let{errors:e}=this;if(e.length<this.features.length)return A.DIFFERENT_ERRORS;let t=e[0];for(let n of e)if(n.error!==t.error)return A.DIFFERENT_ERRORS;return t.error}get dataType(){return j(this.field)}get domain(){let e=this._allDomains.toArray();return this.calculateDomain(e)}get distinctValues(){if(this.featuresHaveSameValue)return[this.value];let e=new Set;for(let t of this.features)e.add(t.getAttribute(this.fieldName));return Array.from(e)}get editable(){return this.field.editable?this._evaluatedEditableExpression??!0:!1}get label(){let{label:e}=this.template,t=this._computeStringLiteralText(e);if(t)return t;let{field:n,layers:r}=this;if(r.length===1){let e=r[0];if(v(e)){let t=e.getFieldAlias(n.name);if(t!=null&&t!==``)return t}}return n.alias||n.name}get effectiveVisible(){return M(this.effectiveVisibilityCode)}get effectiveVisibilityCode(){let{visibilityCode:e}=this;if(e!==`visible`)return e;let{group:t}=this;if(t==null)return e;let n=t.visibilityCode;return n===`hidden:visibility-expression:all-features`?`hidden:group-visibility-expression:all-features`:n===`hidden:visibility-expression:some-features`?`hidden:group-visibility-expression:some-features`:e}get errors(){return this._validate()}get featuresHaveSameValue(){let{fieldName:e}=this,t=this.features.at(0)?.getAttribute(e);return this.features.every(n=>S(n.getAttribute(e),t))}get field(){return this.template.field}get fieldName(){return this.field.name}get input(){return this.template.input}get invalidFeatures(){return this.errors.map(e=>e.feature)}get isSubtypeField(){return this.layers.some(e=>{if(e&&`subtypeField`in e){let{subtypeField:t,fieldsIndex:n}=e;return(n.get(t)?.name??t)===this.fieldName}return!1})}get showNoValueOptionEnabled(){let{input:e}=this;return this.required?!1:!N(e)||e?.showNoValueOption===!0}get showNoValueLabel(){let{input:e}=this;return N(e)?e?.noValueOptionLabel:null}get includeTime(){let{template:e,field:t}=this;return this.dataType===`date`?t.type===`time-only`?!0:t.type===`date-only`?!1:e.input?.type!==`datetime-picker`||e.input.includeTime:!1}get includeTimeOffset(){if(this.field.type!==`timestamp-offset`)return!1;let{input:e}=this;return!e||e.type===`timestampoffset-picker`&&e.includeTimeOffset}get inputType(){return this.input?.type}get maxLength(){return C({dataType:this.dataType,field:this.field,input:this.input})}get minLength(){return w({dataType:this.dataType,field:this.field,input:this.input})}get multipleChoiceOtherChoiceCheckboxState(){return H(this.inputController)?.otherChoiceCheckboxState??{checked:!1,indeterminate:!1}}get placeholder(){return this.template.hint}get range(){if(this.dataType===`date`)return this._dateRange;let{domain:e,field:t}=this;if(e){let n=u(t,e);return{max:n?.max,min:n?.min}}let n=this._allDomains.toArray().every(e=>!e)?m(t):null;return{max:n?.max===Number.MAX_VALUE?null:n?.max??null,min:n?.min===-Number.MAX_VALUE?null:n?.min??null}}get required(){if(!this.editable)return!1;if(!this.field.nullable||this.isSubtypeField)return!0;let e=this.visible&&this.group?.visible!==!1,t=this._evaluatedRequiredExpression;return e&&t!=null?t:!1}get status(){let{validationMessage:e}=this;return e?P(e)?`idle`:`invalid`:this.valid?`valid`:`idle`}get timeResolution(){let e=this.input;if(!(!e||e.type!==`timestampoffset-picker`&&e.type!==`time-picker`))return e.timeResolution??`minutes`}get timeStep(){return this.timeResolution==null?void 0:x.get(this.timeResolution)}get userInvalid(){return this.errors.some(({error:e})=>F(e))?!0:!this.valid&&this.touched}get valid(){return this.errors.length===0||!this.editable}get validationMessage(){return this.valueIsOutOfDomain&&this.touched?I.OUT_OF_SUBTYPE_DOMAIN:this.userInvalid?this.compositeError??void 0:void 0}get value(){return this.featuresHaveSameValue?this.features.at(0)?.getAttribute(this.fieldName)??null:L}get valueIsOutOfDomain(){let{domain:e,value:t,field:n}=this;return!e||t==null?!1:d(n,t,e)!==null}get visibilityCode(){return this.field.visible?this._fieldShouldHaveDomain&&this.domain==null?`hidden:no-domain-in-common`:this._baseVisibilityCode:`hidden:field-definition`}get codedValueDomainOptions(){return this.domain?.type===`coded-value`?this.domain.codedValues.map(({name:e,code:t})=>({name:e,value:t})):[]}getExplicitMultipleChoiceOtherChoiceCheckedState(){return H(this.inputController)?.getExplicitOtherChoiceCheckedState()}getMultipleChoiceOtherChoiceRenderState(e){let t=H(this.inputController)?.otherChoiceRenderState;return t?{...t,label:t.label??e}:{fieldName:void 0,hint:``,label:e,shouldShow:!1,checkboxState:{checked:!1,indeterminate:!1},value:null,normalizedValue:null,maxLength:void 0,status:`idle`}}hasExplicitMultipleChoiceOtherChoiceCheckedState(){return H(this.inputController)?.hasExplicitOtherChoiceCheckedState()??!1}initializeExplicitMultipleChoiceOtherChoiceCheckedState(){H(this.inputController)?.initializeExplicitOtherChoiceCheckedState()}setExplicitMultipleChoiceOtherChoiceCheckedState(e){H(this.inputController)?.setExplicitOtherChoiceCheckedState(e)}get codedValueOptions(){let{getFieldValueOptionsForFeature:e}=this;if(this.features.length===1&&e){let t=this.features.at(0);return e({domain:this.domain??void 0,feature:t,fieldName:this.fieldName,layer:t.layer})}let t=this.codedValueDomainOptions,{value:n}=this;return{recommended:t,other:[],unsupported:n!=null&&n!==L&&!t.some(e=>e.value===n)?[{name:`${n}`,value:n}]:[],containsEmptyOption:!1}}get _evaluatedRequiredExpression(){let e=!1,t=!0,n=this.template;for(let r of this.features){if(n.getExpressionExecutorsForLayer(r.layer)?.requiredExpression==null)continue;t=!1;let i=this._lookupEvaluatedExpression(r,`requiredExpression`);i?.status===`success`?e||=i.result===!0:e=!0}return t?null:e}get _allDomains(){let e=this.template.domain;return this.features.map(t=>{let n=t.layer.getFieldDomain(this.fieldName,{feature:t.plainGraphic});return n?.type===`range`||e?.type===`range`?n??this.template.domain:n})}get _fieldShouldHaveDomain(){return this._hasIntersectionWithElementFieldDomain?!0:this._allDomains.some(r)}get _dateFormRange(){if(this.dataType!==`date`)return{};let{input:e}=this;if(!e)return{};let{type:t}=e,n={};if((t===`date-picker`||t===`time-picker`||t===`timestampoffset-picker`)&&(n=f(this.field,e.max,e.min)),t===`datetime-picker`){let{max:t,min:r}=e;n={max:t!=null&&T(t)?t.getTime():null,min:r!=null&&T(r)?r.getTime():null}}return{min:n.min,max:n.max,rawMax:n?.rawMax??null,rawMin:n?.rawMin??null}}get _dateRange(){let{_dateFormRange:e,template:t,field:n,domain:r}=this;if(this.dataType!==`date`)return{};if(!r)return this._fieldShouldHaveDomain?{}:e;let i=u(n,r);if(!i)return e;let{max:a,min:o,rawMax:s,rawMin:c}=e,{type:l}=t.field;if(l===`date`){let{max:e,min:t}=i;return{max:b(a)&&(e===null||e!=null&&a<=e)?a:e??null,min:b(o)&&(t===null||t!=null&&o>=t)?o:t??null}}if(l===`date-only`||l===`time-only`||l===`timestamp-offset`){let{max:e,min:t,rawMax:n,rawMin:r}=i,l=b(a)&&s&&(e==null||a<e),u=b(o)&&c&&(t==null||o>t);return{max:l?a:e,min:u?o:t,rawMax:l?s:n,rawMin:u?c:r}}return{}}touch(){this.touched=!0}_validate(){let{dataType:e,fieldName:t,maxLength:n,minLength:r,range:i}=this,a=[],o=O(this.inputController)?this.inputController:void 0,s=o?.input;for(let c of this.features){let{layer:l}=c,u=l.getField(t)??this.field,d=l.getFieldDomain(t,{feature:c.plainGraphic}),f=this.calculateDomain([d]),p=!f||f.type===`coded-value`?null:f,m=this._requiredForFeature(c),h=c.getAttribute(t),g=E(h,{dataType:e,domain:p,field:u,maxLength:n,minLength:r,multipleChoice:s,range:i,required:m})??this.getExternalErrorForFeature?.(c,t);if(!g&&s&&o){let{otherChoice:e}=s,t=o.otherChoiceFieldName,n=o.shouldShowOtherChoice,r=o.otherChoiceEffectiveCheckboxState;if(n&&e&&t&&r.checked){let e=l.getField(t),n=c.getAttribute(t),r=n===z?null:n;if(e){let t=j(e);g=E(r,{dataType:t,domain:e.domain,field:e,maxLength:C({dataType:t,field:e,input:null}),minLength:w({dataType:t,field:e,input:null}),multipleChoice:null,range:{max:void 0,min:void 0},required:!0})}}}g&&a.push({error:g,feature:c.source})}return a}_editableForFeature(e){if(!this.field.editable)return!1;if(this.template.getExpressionExecutorsForLayer(e.layer)?.editableExpression==null)return!0;let t=this._lookupEvaluatedExpression(e,`editableExpression`);return t?.status===`success`&&t.result===!0}_effectiveVisibleFeature(e){if(this.group&&!this.group.visibleForFeature(e))return!1;if(this.template.getExpressionExecutorsForLayer(e.layer)?.visibilityExpression==null)return!0;let t=this._lookupEvaluatedExpression(e,`visibilityExpression`);return t?.status===`success`&&t.result===!0}_requiredForFeature(e){if(!this._editableForFeature(e))return!1;if(!this.field.nullable||this.isSubtypeField)return!0;let t=this._effectiveVisibleFeature(e);if(this.template.getExpressionExecutorsForLayer(e.layer)?.requiredExpression==null)return!1;let n=this._lookupEvaluatedExpression(e,`requiredExpression`);return n?.status===`success`?t&&n.result===!0:t}calculateDomain(e){let t=e.find(e=>e!=null),n=this.template.domain;if(!t)return n&&p(this.field,n)?n:null;switch(t.type){case`coded-value`:if(e.some(e=>!e)){if(!n)return null;e=e.filter(e=>e!==null)}break;case`range`:e=e.filter(e=>e!==null)}if(!e.every(e=>e?.type===t?.type))return null;let r=null;switch(t?.type){case`range`:r=this._intersectRangeDomains(e);break;case`coded-value`:r=this._intersectCodedValueDomains(e)}return r}_intersectCodedValueDomains(e){if(!e.length)return null;let t=new Map(e[0].codedValues.map(({code:e,name:t})=>[e,t])),n=this.template.domain?new Map(this.template.domain.codedValues.map(({code:e,name:t})=>[e,t])):null;for(let n of e)for(let[e,r]of t)n.codedValues.some(t=>t.code===e&&t.name===r)||t.delete(e);let r=t;if(n){r=new Map;for(let[e,i]of n)t.has(e)&&r.set(e,i)}let i=Array.from(r.entries()).map(([e,t])=>new c({code:e,name:t}));return i.length?new l({codedValues:i}):null}_intersectRangeDomains(e){if(!e.length)return null;let t=e[0];for(let n=1;n<e.length;n++){if(!t)return null;t=this._findMinMaxValuesBetweenTwoDomains(t,e[n])}if(t&&!p(this.field,t))return null;let{domain:n}=this.template;if(t&&n&&n instanceof y){let e=this._findMinMaxValuesBetweenTwoDomains(t,n);return this._hasIntersectionWithElementFieldDomain=!!e,e}return t}_getMinMaxFromRangeDomain(e){let t=e.minValue,n=e.maxValue,{field:r}=this;return h(r)||g(r)||_(r)?f(r,n,t):{min:t!=null&&typeof t==`number`?t:null,max:n!=null&&typeof n==`number`?n:null}}_findMinMaxValuesBetweenTwoDomains(e,t){let n=new y,r=this._getMinMaxFromRangeDomain(e),i=this._getMinMaxFromRangeDomain(t),{field:a}=this,o=this._getValidRangeValue(r.min,-1/0),s=this._getValidRangeValue(r.max,1/0),c=this._getValidRangeValue(i.min,-1/0),l=this._getValidRangeValue(i.max,1/0);return n.minValue=Math.max(o,c),n.maxValue=Math.min(s,l),n.minValue===-1/0||n.maxValue===1/0||n.minValue>n.maxValue?null:((h(a)||g(a)||_(a))&&(n.minValue=Number(r.min)>Number(i.min)?r.rawMin:i.rawMin,n.maxValue=Number(r.max)<Number(i.max)?r.rawMax:i.rawMax),n.name=`intersection`,n)}_getValidRangeValue(e,t){return b(e)?e:t}};e([t()],B.prototype,`dataType`,null),e([t()],B.prototype,`domain`,null),e([t()],B.prototype,`distinctValues`,null),e([t()],B.prototype,`editable`,null),e([t()],B.prototype,`label`,null),e([t()],B.prototype,`effectiveVisible`,null),e([t()],B.prototype,`effectiveVisibilityCode`,null),e([t()],B.prototype,`errors`,null),e([t()],B.prototype,`featuresHaveSameValue`,null),e([t()],B.prototype,`field`,null),e([t()],B.prototype,`fieldName`,null),e([t()],B.prototype,`getExternalErrorForFeature`,void 0),e([t()],B.prototype,`getFieldValueOptionsForFeature`,void 0),e([t()],B.prototype,`group`,void 0),e([t()],B.prototype,`input`,null),e([t()],B.prototype,`inputController`,void 0),e([t()],B.prototype,`invalidFeatures`,null),e([t()],B.prototype,`isSubtypeField`,null),e([t()],B.prototype,`showNoValueOptionEnabled`,null),e([t()],B.prototype,`showNoValueLabel`,null),e([t()],B.prototype,`includeTime`,null),e([t()],B.prototype,`includeTimeOffset`,null),e([t({readOnly:!0})],B.prototype,`inputType`,null),e([t()],B.prototype,`maxLength`,null),e([t()],B.prototype,`minLength`,null),e([t()],B.prototype,`multipleChoiceOtherChoiceCheckboxState`,null),e([t()],B.prototype,`placeholder`,null),e([t()],B.prototype,`range`,null),e([t()],B.prototype,`requestDeferredExpressionEvaluation`,void 0),e([t()],B.prototype,`required`,null),e([t()],B.prototype,`status`,null),e([t()],B.prototype,`timeResolution`,null),e([t()],B.prototype,`timeStep`,null),e([t()],B.prototype,`touched`,void 0),e([t({readOnly:!0})],B.prototype,`type`,void 0),e([t()],B.prototype,`userHasChangedValue`,void 0),e([t()],B.prototype,`userInvalid`,null),e([t()],B.prototype,`valid`,null),e([t()],B.prototype,`validationMessage`,null),e([t()],B.prototype,`value`,null),e([t()],B.prototype,`valueIsOutOfDomain`,null),e([t()],B.prototype,`visibilityCode`,null),e([t()],B.prototype,`codedValueDomainOptions`,null),e([t()],B.prototype,`codedValueOptions`,null),e([t()],B.prototype,`_evaluatedRequiredExpression`,null),e([t()],B.prototype,`_hasIntersectionWithElementFieldDomain`,void 0),e([t()],B.prototype,`_allDomains`,null),e([t()],B.prototype,`_fieldShouldHaveDomain`,null),e([t()],B.prototype,`_dateFormRange`,null),e([t()],B.prototype,`_dateRange`,null),B=e([n(`esri.widgets.BatchAttributeForm.inputs.FieldInput`)],B);const V=B;function H(e){return O(e)?e:null}export{V as default};
2
+ import{__decorate as e}from"tslib";import{property as t,subclass as n}from"../../../core/accessorSupport/decorators.js";import{isSome as r}from"../../../core/arrayUtils.js";import i from"../../../core/Logger.js";import{destroyMaybe as a}from"../../../core/maybe.js";import{isDynamicChoiceInput as o,isMultipleChoiceInput as s}from"../../../form/elements/inputs/inputUtils.js";import c from"../../../layers/support/CodedValue.js";import l from"../../../layers/support/CodedValueDomain.js";import{getDomainRange as u,validateDomainValue as d,dateTimeFieldValuesToNumericRange as f,isDomainValidForField as p}from"../../../layers/support/domainUtils.js";import{getFieldRange as m,isDateOnlyField as h,isTimeOnlyField as g,isTimestampOffsetField as _}from"../../../layers/support/fieldUtils.js";import{supportsFieldConfiguration as v}from"../../../layers/support/layerUtils.js";import y from"../../../layers/support/RangeDomain.js";import{isNumber as b}from"../../../support/guards.js";import{timeResolutionToStepMap as x}from"../../support/dateUtils.js";import{valuesAreEquivalent as S,getMaxLength as C,getMinLength as w,dateIsValid as T,validateFormValue as E}from"../../support/forms/formUtils.js";import D from"./EditableInput.js";import{isMultipleChoiceController as O}from"./support/controllerUtils.js";import k from"./support/DynamicChoiceController.js";import{MultiFeatureError as A,getFieldInputDataType as j,visibilityCodeToBoolean as M,isFieldInputWithShowNoValueOptionInput as N,isWarning as P,isContingentValuesError as F,FormValidationWarning as I,differentValuesString as L,noValueString as R}from"./support/inputUtils.js";import z from"./support/MultipleChoiceController.js";import{otherChoiceCheckedPlaceholderValue as B}from"./support/multipleChoiceInputUtils.js";let V=class extends D{constructor(e){super(e),this.getExternalErrorForFeature=null,this.getFieldValueOptionsForFeature=null,this.group=null,this.inputController=null,this.touched=!1,this.type=`field`,this.userHasChangedValue=!1,this._hasIntersectionWithElementFieldDomain=!1}destroy(){this.inputController=a(this.inputController)}initialize(){if(this.input){if(o(this.input)){let{requestDeferredExpressionEvaluation:e}=this;e?this.inputController=new k({fieldInput:this,requestDeferredExpressionEvaluation:e}):i.getLogger(this).error(`requestDeferredExpressionEvaluation callback is required for dynamic choice inputs.`)}s(this.input)&&(this.inputController=new z({fieldInput:this}))}}get compositeError(){if(this.valid)return null;let{errors:e}=this;if(e.length<this.features.length)return A.DIFFERENT_ERRORS;let t=e[0];for(let n of e)if(n.error!==t.error)return A.DIFFERENT_ERRORS;return t.error}get dataType(){return j(this.field)}get domain(){let e=this._allDomains.toArray();return this.calculateDomain(e)}get distinctValues(){if(this.featuresHaveSameValue)return[this.value];let e=new Set;for(let t of this.features)e.add(t.getAttribute(this.fieldName));return Array.from(e)}get editable(){return this.field.editable?this._evaluatedEditableExpression??!0:!1}get label(){let{label:e}=this.template,t=this._computeStringLiteralText(e);if(t)return t;let{field:n,layers:r}=this;if(r.length===1){let e=r[0];if(v(e)){let t=e.getFieldAlias(n.name);if(t!=null&&t!==``)return t}}return n.alias||n.name}get effectiveVisible(){return M(this.effectiveVisibilityCode)}get effectiveVisibilityCode(){let{visibilityCode:e}=this;if(e!==`visible`)return e;let{group:t}=this;if(t==null)return e;let n=t.visibilityCode;return n===`hidden:visibility-expression:all-features`?`hidden:group-visibility-expression:all-features`:n===`hidden:visibility-expression:some-features`?`hidden:group-visibility-expression:some-features`:e}get errors(){return this._validate()}get featuresHaveSameValue(){let{fieldName:e}=this,t=this.features.at(0)?.getAttribute(e);return this.features.every(n=>S(n.getAttribute(e),t))}get field(){return this.template.field}get fieldName(){return this.field.name}get input(){return this.template.input}get invalidFeatures(){return this.errors.map(e=>e.feature)}get isSubtypeField(){return this.layers.some(e=>{if(e&&`subtypeField`in e){let{subtypeField:t,fieldsIndex:n}=e;return(n.get(t)?.name??t)===this.fieldName}return!1})}get showNoValueOptionEnabled(){let{input:e}=this;return this.required?!1:!N(e)||e?.showNoValueOption===!0}get showNoValueLabel(){let{input:e}=this;return N(e)?e?.noValueOptionLabel:null}get includeTime(){let{template:e,field:t}=this;return this.dataType===`date`?t.type===`time-only`?!0:t.type===`date-only`?!1:e.input?.type!==`datetime-picker`||e.input.includeTime:!1}get includeTimeOffset(){if(this.field.type!==`timestamp-offset`)return!1;let{input:e}=this;return!e||e.type===`timestampoffset-picker`&&e.includeTimeOffset}get inputType(){return this.input?.type}get maxLength(){return C({dataType:this.dataType,field:this.field,input:this.input})}get minLength(){return w({dataType:this.dataType,field:this.field,input:this.input})}get multipleChoiceOtherChoiceCheckboxState(){return U(this.inputController)?.otherChoiceCheckboxState??{checked:!1,indeterminate:!1}}get placeholder(){return this.template.hint}get range(){if(this.dataType===`date`)return this._dateRange;let{domain:e,field:t}=this;if(e){let n=u(t,e);return{max:n?.max,min:n?.min}}let n=this._allDomains.toArray().every(e=>!e)?m(t):null;return{max:n?.max===Number.MAX_VALUE?null:n?.max??null,min:n?.min===-Number.MAX_VALUE?null:n?.min??null}}get required(){if(!this.editable)return!1;if(!this.field.nullable||this.isSubtypeField)return!0;let e=this.visible&&this.group?.visible!==!1,t=this._evaluatedRequiredExpression;return e&&t!=null?t:!1}get status(){let{validationMessage:e}=this;return e?P(e)?`idle`:`invalid`:this.valid?`valid`:`idle`}get timeResolution(){let e=this.input;if(!(!e||e.type!==`timestampoffset-picker`&&e.type!==`time-picker`))return e.timeResolution??`minutes`}get timeStep(){return this.timeResolution==null?void 0:x.get(this.timeResolution)}get userInvalid(){return this.errors.some(({error:e})=>F(e))?!0:!this.valid&&this.touched}get valid(){return this.errors.length===0||!this.editable}get validationMessage(){return this.valueIsOutOfDomain&&this.touched?I.OUT_OF_SUBTYPE_DOMAIN:this.userInvalid?this.compositeError??void 0:void 0}get value(){return this.featuresHaveSameValue?this.features.at(0)?.getAttribute(this.fieldName)??null:L}get valueIsOutOfDomain(){let{domain:e,value:t,field:n}=this;return!e||t==null?!1:d(n,t,e)!==null}get visibilityCode(){return this.field.visible?this._fieldShouldHaveDomain&&this.domain==null?`hidden:no-domain-in-common`:this._baseVisibilityCode:`hidden:field-definition`}getExplicitMultipleChoiceOtherChoiceCheckedState(){return U(this.inputController)?.getExplicitOtherChoiceCheckedState()}getMultipleChoiceOtherChoiceRenderState(e){let t=U(this.inputController)?.otherChoiceRenderState;return t?{...t,label:t.label??e}:{fieldName:void 0,hint:``,label:e,shouldShow:!1,checkboxState:{checked:!1,indeterminate:!1},value:null,normalizedValue:null,maxLength:void 0,status:`idle`}}hasExplicitMultipleChoiceOtherChoiceCheckedState(){return U(this.inputController)?.hasExplicitOtherChoiceCheckedState()??!1}initializeExplicitMultipleChoiceOtherChoiceCheckedState(){U(this.inputController)?.initializeExplicitOtherChoiceCheckedState()}setExplicitMultipleChoiceOtherChoiceCheckedState(e){U(this.inputController)?.setExplicitOtherChoiceCheckedState(e)}get codedValueOptions(){let{getFieldValueOptionsForFeature:e,features:t}=this;if(t.length===1&&e){let t=this.features.at(0);return e({domain:this.domain??void 0,feature:t,fieldName:this.fieldName,layer:t.layer,includeEmptyOption:this.showNoValueOptionEnabled,emptyString:this.showNoValueLabel??R})}return this._ownCodedValueOptions}get _evaluatedRequiredExpression(){let e=!1,t=!0,n=this.template;for(let r of this.features){if(n.getExpressionExecutorsForLayer(r.layer)?.requiredExpression==null)continue;t=!1;let i=this._lookupEvaluatedExpression(r,`requiredExpression`);i?.status===`success`?e||=i.result===!0:e=!0}return t?null:e}get _allDomains(){let e=this.template.domain;return this.features.map(t=>{let n=t.layer.getFieldDomain(this.fieldName,{feature:t.plainGraphic});return n?.type===`range`||e?.type===`range`?n??this.template.domain:n})}get _fieldShouldHaveDomain(){return this._hasIntersectionWithElementFieldDomain?!0:this._allDomains.some(r)}get _dateFormRange(){if(this.dataType!==`date`)return{};let{input:e}=this;if(!e)return{};let{type:t}=e,n={};if((t===`date-picker`||t===`time-picker`||t===`timestampoffset-picker`)&&(n=f(this.field,e.max,e.min)),t===`datetime-picker`){let{max:t,min:r}=e;n={max:t!=null&&T(t)?t.getTime():null,min:r!=null&&T(r)?r.getTime():null}}return{min:n.min,max:n.max,rawMax:n?.rawMax??null,rawMin:n?.rawMin??null}}get _dateRange(){let{_dateFormRange:e,template:t,field:n,domain:r}=this;if(this.dataType!==`date`)return{};if(!r)return this._fieldShouldHaveDomain?{}:e;let i=u(n,r);if(!i)return e;let{max:a,min:o,rawMax:s,rawMin:c}=e,{type:l}=t.field;if(l===`date`){let{max:e,min:t}=i;return{max:b(a)&&(e===null||e!=null&&a<=e)?a:e??null,min:b(o)&&(t===null||t!=null&&o>=t)?o:t??null}}if(l===`date-only`||l===`time-only`||l===`timestamp-offset`){let{max:e,min:t,rawMax:n,rawMin:r}=i,l=b(a)&&s&&(e==null||a<e),u=b(o)&&c&&(t==null||o>t);return{max:l?a:e,min:u?o:t,rawMax:l?s:n,rawMin:u?c:r}}return{}}get _ownCodedValueOptions(){let e=this.domain?.type===`coded-value`?this.domain.codedValues.map(({name:e,code:t})=>({name:e,value:t})):[],t=this.value,n=t!=null&&t!==L&&!e.some(e=>e.value===t)?[{name:`${t}`,value:t}]:[],r=this.showNoValueOptionEnabled;return r&&e.unshift({name:this.showNoValueLabel??R,value:``}),{recommended:e,other:[],unsupported:n,containsEmptyOption:r}}touch(){this.touched=!0}_validate(){let{dataType:e,fieldName:t,maxLength:n,minLength:r,range:i}=this,a=[],o=O(this.inputController)?this.inputController:void 0,s=o?.input;for(let c of this.features){let{layer:l}=c,u=l.getField(t)??this.field,d=l.getFieldDomain(t,{feature:c.plainGraphic}),f=this.calculateDomain([d]),p=!f||f.type===`coded-value`?null:f,m=this._requiredForFeature(c),h=c.getAttribute(t),g=E(h,{dataType:e,domain:p,field:u,maxLength:n,minLength:r,multipleChoice:s,range:i,required:m})??this.getExternalErrorForFeature?.(c,t);if(!g&&s&&o){let{otherChoice:e}=s,t=o.otherChoiceFieldName,n=o.shouldShowOtherChoice,r=o.otherChoiceEffectiveCheckboxState;if(n&&e&&t&&r.checked){let e=l.getField(t),n=c.getAttribute(t),r=n===B?null:n;if(e){let t=j(e);g=E(r,{dataType:t,domain:e.domain,field:e,maxLength:C({dataType:t,field:e,input:null}),minLength:w({dataType:t,field:e,input:null}),multipleChoice:null,range:{max:void 0,min:void 0},required:!0})}}}g&&a.push({error:g,feature:c.source})}return a}_editableForFeature(e){if(!this.field.editable)return!1;if(this.template.getExpressionExecutorsForLayer(e.layer)?.editableExpression==null)return!0;let t=this._lookupEvaluatedExpression(e,`editableExpression`);return t?.status===`success`&&t.result===!0}_effectiveVisibleFeature(e){if(this.group&&!this.group.visibleForFeature(e))return!1;if(this.template.getExpressionExecutorsForLayer(e.layer)?.visibilityExpression==null)return!0;let t=this._lookupEvaluatedExpression(e,`visibilityExpression`);return t?.status===`success`&&t.result===!0}_requiredForFeature(e){if(!this._editableForFeature(e))return!1;if(!this.field.nullable||this.isSubtypeField)return!0;let t=this._effectiveVisibleFeature(e);if(this.template.getExpressionExecutorsForLayer(e.layer)?.requiredExpression==null)return!1;let n=this._lookupEvaluatedExpression(e,`requiredExpression`);return n?.status===`success`?t&&n.result===!0:t}calculateDomain(e){let t=e.find(e=>e!=null),n=this.template.domain;if(!t)return n&&p(this.field,n)?n:null;switch(t.type){case`coded-value`:if(e.some(e=>!e)){if(!n)return null;e=e.filter(e=>e!==null)}break;case`range`:e=e.filter(e=>e!==null)}if(!e.every(e=>e?.type===t?.type))return null;let r=null;switch(t?.type){case`range`:r=this._intersectRangeDomains(e);break;case`coded-value`:r=this._intersectCodedValueDomains(e)}return r}_intersectCodedValueDomains(e){if(!e.length)return null;let t=new Map(e[0].codedValues.map(({code:e,name:t})=>[e,t])),n=this.template.domain?new Map(this.template.domain.codedValues.map(({code:e,name:t})=>[e,t])):null;for(let n of e)for(let[e,r]of t)n.codedValues.some(t=>t.code===e&&t.name===r)||t.delete(e);let r=t;if(n){r=new Map;for(let[e,i]of n)t.has(e)&&r.set(e,i)}let i=Array.from(r.entries()).map(([e,t])=>new c({code:e,name:t}));return i.length?new l({codedValues:i}):null}_intersectRangeDomains(e){if(!e.length)return null;let t=e[0];for(let n=1;n<e.length;n++){if(!t)return null;t=this._findMinMaxValuesBetweenTwoDomains(t,e[n])}if(t&&!p(this.field,t))return null;let{domain:n}=this.template;if(t&&n&&n instanceof y){let e=this._findMinMaxValuesBetweenTwoDomains(t,n);return this._hasIntersectionWithElementFieldDomain=!!e,e}return t}_getMinMaxFromRangeDomain(e){let t=e.minValue,n=e.maxValue,{field:r}=this;return h(r)||g(r)||_(r)?f(r,n,t):{min:t!=null&&typeof t==`number`?t:null,max:n!=null&&typeof n==`number`?n:null}}_findMinMaxValuesBetweenTwoDomains(e,t){let n=new y,r=this._getMinMaxFromRangeDomain(e),i=this._getMinMaxFromRangeDomain(t),{field:a}=this,o=this._getValidRangeValue(r.min,-1/0),s=this._getValidRangeValue(r.max,1/0),c=this._getValidRangeValue(i.min,-1/0),l=this._getValidRangeValue(i.max,1/0);return n.minValue=Math.max(o,c),n.maxValue=Math.min(s,l),n.minValue===-1/0||n.maxValue===1/0||n.minValue>n.maxValue?null:((h(a)||g(a)||_(a))&&(n.minValue=Number(r.min)>Number(i.min)?r.rawMin:i.rawMin,n.maxValue=Number(r.max)<Number(i.max)?r.rawMax:i.rawMax),n.name=`intersection`,n)}_getValidRangeValue(e,t){return b(e)?e:t}};e([t()],V.prototype,`dataType`,null),e([t()],V.prototype,`domain`,null),e([t()],V.prototype,`distinctValues`,null),e([t()],V.prototype,`editable`,null),e([t()],V.prototype,`label`,null),e([t()],V.prototype,`effectiveVisible`,null),e([t()],V.prototype,`effectiveVisibilityCode`,null),e([t()],V.prototype,`errors`,null),e([t()],V.prototype,`featuresHaveSameValue`,null),e([t()],V.prototype,`field`,null),e([t()],V.prototype,`fieldName`,null),e([t()],V.prototype,`getExternalErrorForFeature`,void 0),e([t()],V.prototype,`getFieldValueOptionsForFeature`,void 0),e([t()],V.prototype,`group`,void 0),e([t()],V.prototype,`input`,null),e([t()],V.prototype,`inputController`,void 0),e([t()],V.prototype,`invalidFeatures`,null),e([t()],V.prototype,`isSubtypeField`,null),e([t()],V.prototype,`showNoValueOptionEnabled`,null),e([t()],V.prototype,`showNoValueLabel`,null),e([t()],V.prototype,`includeTime`,null),e([t()],V.prototype,`includeTimeOffset`,null),e([t({readOnly:!0})],V.prototype,`inputType`,null),e([t()],V.prototype,`maxLength`,null),e([t()],V.prototype,`minLength`,null),e([t()],V.prototype,`multipleChoiceOtherChoiceCheckboxState`,null),e([t()],V.prototype,`placeholder`,null),e([t()],V.prototype,`range`,null),e([t()],V.prototype,`requestDeferredExpressionEvaluation`,void 0),e([t()],V.prototype,`required`,null),e([t()],V.prototype,`status`,null),e([t()],V.prototype,`timeResolution`,null),e([t()],V.prototype,`timeStep`,null),e([t()],V.prototype,`touched`,void 0),e([t({readOnly:!0})],V.prototype,`type`,void 0),e([t()],V.prototype,`userHasChangedValue`,void 0),e([t()],V.prototype,`userInvalid`,null),e([t()],V.prototype,`valid`,null),e([t()],V.prototype,`validationMessage`,null),e([t()],V.prototype,`value`,null),e([t()],V.prototype,`valueIsOutOfDomain`,null),e([t()],V.prototype,`visibilityCode`,null),e([t()],V.prototype,`codedValueOptions`,null),e([t()],V.prototype,`_evaluatedRequiredExpression`,null),e([t()],V.prototype,`_hasIntersectionWithElementFieldDomain`,void 0),e([t()],V.prototype,`_allDomains`,null),e([t()],V.prototype,`_fieldShouldHaveDomain`,null),e([t()],V.prototype,`_dateFormRange`,null),e([t()],V.prototype,`_dateRange`,null),e([t()],V.prototype,`_ownCodedValueOptions`,null),V=e([n(`esri.widgets.BatchAttributeForm.inputs.FieldInput`)],V);const H=V;function U(e){return O(e)?e:null}export{H as default};
@@ -4,6 +4,13 @@
4
4
  */
5
5
  export const differentValuesString: "esri_BatchAttributeForm_different_values";
6
6
 
7
+ /**
8
+ * Used as the name of the "no value" option when the form template does not
9
+ * specify it. In views, it should be substituted for a localized string. For
10
+ * example, in English it might be displayed as "No value".
11
+ */
12
+ export const noValueString: "esri_BatchAttributeForm_no_value";
13
+
7
14
  /** @internal */
8
15
  export type MultiFeatureError = "batch-attribute-form-validation::features-have-different-errors";
9
16