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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (376) hide show
  1. package/assets/esri/core/workers/RemoteClient.js +1 -1
  2. package/assets/esri/core/workers/chunks/{24e38b7d1e9984a1472e.js → 033032715c3b04e0fc7d.js} +1 -1
  3. package/assets/esri/core/workers/chunks/{cfc93bbd35cc4bfde7c0.js → 045336db17aae6eef68f.js} +1 -1
  4. package/assets/esri/core/workers/chunks/04de7b2937d5ca7c23e2.js +1 -0
  5. package/assets/esri/core/workers/chunks/12a4b3706162872c2b41.js +769 -0
  6. package/assets/esri/core/workers/chunks/142b1336533fa2ac470b.js +47 -0
  7. package/assets/esri/core/workers/chunks/185e596f86767c22f951.js +1 -0
  8. package/assets/esri/core/workers/chunks/{cd8d595d577b74817623.js → 1a4b3820136fb615b730.js} +1 -1
  9. package/assets/esri/core/workers/chunks/29b157b41dfa16da886b.js +1 -0
  10. package/assets/esri/core/workers/chunks/300b57846114fedd12be.js +1 -0
  11. package/assets/esri/core/workers/chunks/{3f75b7ed24b440b4508a.js → 3d5f37c2f355260e6dc6.js} +1 -1
  12. package/assets/esri/core/workers/chunks/{a9eba26d62b62592cee1.js → 42861d54a336146753d8.js} +1 -1
  13. package/assets/esri/core/workers/chunks/4c8deac4bf72a5e2597a.js +1 -0
  14. package/assets/esri/core/workers/chunks/52107d450c55450f5c04.js +274 -0
  15. package/assets/esri/core/workers/chunks/6d54222301b6d819c904.js +1 -0
  16. package/assets/esri/core/workers/chunks/{eb0f180ed20af220a82e.js → 6ddece9cd94b60efe3d7.js} +1 -1
  17. package/assets/esri/core/workers/chunks/{566844774388a031fd74.js → 7125cff7fd288ff7bd5f.js} +1 -1
  18. package/assets/esri/core/workers/chunks/74de734a20b4cd2d7efb.js +1 -0
  19. package/assets/esri/core/workers/chunks/7712a23dc68220edaa64.js +1 -0
  20. package/assets/esri/core/workers/chunks/{ea561b2460e634a643fc.js → 7f35380809e7de99c302.js} +1 -1
  21. package/assets/esri/core/workers/chunks/7f3d49b667e9b46449e7.js +1 -0
  22. package/assets/esri/core/workers/chunks/8a2faf12938e811a9fc9.js +1 -0
  23. package/assets/esri/core/workers/chunks/{796c64b9caa1303e26ed.js → 8af503fa88c1668872eb.js} +1 -1
  24. package/assets/esri/core/workers/chunks/{e2a6f77c05d0818e3f74.js → 8e42ce8305cefba5debc.js} +1 -1
  25. package/assets/esri/core/workers/chunks/93169e55e472fec4bc50.js +1 -0
  26. package/assets/esri/core/workers/chunks/985c1f42aab564008c0d.js +1 -0
  27. package/assets/esri/core/workers/chunks/9a32d9d720cb81abfba2.js +1 -0
  28. package/assets/esri/core/workers/chunks/b171d57b4d0142f687d0.js +1 -0
  29. package/assets/esri/core/workers/chunks/d5e376893cd47605a438.js +1 -0
  30. package/assets/esri/core/workers/chunks/df9daac7ea581e9e5ca4.js +1 -0
  31. package/assets/esri/core/workers/chunks/f11ae249cc8e995bbccc.js +1 -0
  32. package/assets/esri/core/workers/chunks/{65d8011cf756b066cade.js → f218316de8b4635653b2.js} +1 -1
  33. package/assets/esri/libs/linkchartlayout/lclayout.wasm +0 -0
  34. package/assets/esri/libs/vxl/vxlLayer.wasm +0 -0
  35. package/assets/esri/themes/base/_core.scss +2 -0
  36. package/assets/esri/themes/base/widgets/_Grid.scss +0 -8
  37. package/assets/esri/themes/base/widgets/_GridControls.scss +86 -0
  38. package/assets/esri/themes/base/widgets/_Print.scss +13 -15
  39. package/assets/esri/themes/dark/main.css +1 -1
  40. package/assets/esri/themes/light/main.css +1 -1
  41. package/assets/esri/themes/light/view.css +1 -1
  42. package/assets/esri/widgets/Print/t9n/Print.json +1 -1
  43. package/assets/esri/widgets/Print/t9n/Print_ar.json +1 -1
  44. package/assets/esri/widgets/Print/t9n/Print_bg.json +1 -1
  45. package/assets/esri/widgets/Print/t9n/Print_bs.json +1 -1
  46. package/assets/esri/widgets/Print/t9n/Print_ca.json +1 -1
  47. package/assets/esri/widgets/Print/t9n/Print_cs.json +1 -1
  48. package/assets/esri/widgets/Print/t9n/Print_da.json +1 -1
  49. package/assets/esri/widgets/Print/t9n/Print_de.json +1 -1
  50. package/assets/esri/widgets/Print/t9n/Print_el.json +1 -1
  51. package/assets/esri/widgets/Print/t9n/Print_en.json +1 -1
  52. package/assets/esri/widgets/Print/t9n/Print_es.json +1 -1
  53. package/assets/esri/widgets/Print/t9n/Print_et.json +1 -1
  54. package/assets/esri/widgets/Print/t9n/Print_fi.json +1 -1
  55. package/assets/esri/widgets/Print/t9n/Print_fr.json +1 -1
  56. package/assets/esri/widgets/Print/t9n/Print_he.json +1 -1
  57. package/assets/esri/widgets/Print/t9n/Print_hr.json +1 -1
  58. package/assets/esri/widgets/Print/t9n/Print_hu.json +1 -1
  59. package/assets/esri/widgets/Print/t9n/Print_id.json +1 -1
  60. package/assets/esri/widgets/Print/t9n/Print_it.json +1 -1
  61. package/assets/esri/widgets/Print/t9n/Print_ja.json +1 -1
  62. package/assets/esri/widgets/Print/t9n/Print_ko.json +1 -1
  63. package/assets/esri/widgets/Print/t9n/Print_lt.json +1 -1
  64. package/assets/esri/widgets/Print/t9n/Print_lv.json +1 -1
  65. package/assets/esri/widgets/Print/t9n/Print_nb.json +1 -1
  66. package/assets/esri/widgets/Print/t9n/Print_nl.json +1 -1
  67. package/assets/esri/widgets/Print/t9n/Print_pl.json +1 -1
  68. package/assets/esri/widgets/Print/t9n/Print_pt-BR.json +1 -1
  69. package/assets/esri/widgets/Print/t9n/Print_pt-PT.json +1 -1
  70. package/assets/esri/widgets/Print/t9n/Print_ro.json +1 -1
  71. package/assets/esri/widgets/Print/t9n/Print_ru.json +1 -1
  72. package/assets/esri/widgets/Print/t9n/Print_sk.json +1 -1
  73. package/assets/esri/widgets/Print/t9n/Print_sl.json +1 -1
  74. package/assets/esri/widgets/Print/t9n/Print_sr.json +1 -1
  75. package/assets/esri/widgets/Print/t9n/Print_sv.json +1 -1
  76. package/assets/esri/widgets/Print/t9n/Print_th.json +1 -1
  77. package/assets/esri/widgets/Print/t9n/Print_tr.json +1 -1
  78. package/assets/esri/widgets/Print/t9n/Print_uk.json +1 -1
  79. package/assets/esri/widgets/Print/t9n/Print_vi.json +1 -1
  80. package/assets/esri/widgets/Print/t9n/Print_zh-CN.json +1 -1
  81. package/assets/esri/widgets/Print/t9n/Print_zh-HK.json +1 -1
  82. package/assets/esri/widgets/Print/t9n/Print_zh-TW.json +1 -1
  83. package/assets/esri/widgets/support/GridControls/t9n/GridControls.json +1 -0
  84. package/assets/esri/widgets/support/GridControls/t9n/GridControls_en.json +1 -0
  85. package/chunks/CloudsComposition.glsl.js +3 -3
  86. package/chunks/ComponentShader.glsl.js +53 -61
  87. package/chunks/DefaultMaterial.glsl.js +1 -1
  88. package/chunks/FocusAreaColor.glsl.js +12 -0
  89. package/chunks/FocusAreaMask.glsl.js +5 -0
  90. package/chunks/Laserlines.glsl.js +1 -1
  91. package/chunks/Path.glsl.js +22 -17
  92. package/chunks/PointRenderer.glsl.js +3 -3
  93. package/chunks/Precipitation.glsl.js +1 -1
  94. package/chunks/Terrain.glsl.js +1 -1
  95. package/chunks/WaterSurface.glsl.js +18 -18
  96. package/chunks/boundedPlane.js +1 -1
  97. package/chunks/cameraUtilsPlanar.js +1 -1
  98. package/chunks/cameraUtilsSpherical.js +1 -1
  99. package/chunks/sphere.js +1 -1
  100. package/chunks/terrainUtilsPlanar.js +1 -1
  101. package/chunks/vec32.js +1 -1
  102. package/chunks/vxlLayer.js +1 -1
  103. package/core/libs/gl-matrix-2/math/quat.js +1 -1
  104. package/core/libs/gl-matrix-2/math/vec3.js +1 -1
  105. package/core/mathUtils.js +1 -1
  106. package/core/perspectiveUtils.js +1 -1
  107. package/exports/csv.js +1 -1
  108. package/geometry/operators/support/converterAPI.js +1 -1
  109. package/geometry/projection/localLinearScaleFactors.js +1 -1
  110. package/geometry/support/buffer/internals/Vec3.js +1 -1
  111. package/geometry/support/clipRay.js +1 -1
  112. package/geometry/support/coordinateSystem.js +1 -1
  113. package/geometry/support/frustum.js +1 -1
  114. package/geometry/support/heightModelInfoUtils.js +1 -1
  115. package/geometry/support/lineSegment.js +1 -1
  116. package/geometry/support/meshUtils/exporters/gltf/geometry.js +1 -1
  117. package/geometry/support/meshUtils/rotate.js +1 -1
  118. package/geometry/support/meshUtils/scale.js +1 -1
  119. package/geometry/support/plane.js +1 -1
  120. package/geometry/support/polygonUtils.js +1 -1
  121. package/geometry/support/ray.js +1 -1
  122. package/geometry/support/sphere.js +1 -1
  123. package/geometry/support/sphereUtils.js +5 -0
  124. package/geometry/support/triangle.js +1 -1
  125. package/geometry/support/vector.js +1 -1
  126. package/interfaces.d.ts +68 -9
  127. package/layers/FocusAreaLayer.js +5 -0
  128. package/layers/VoxelLayer.js +1 -1
  129. package/layers/VoxelWasmPerSceneView.js +1 -1
  130. package/layers/mixins/operationalLayerModuleMap.js +1 -1
  131. package/layers/orientedImagery/transformations/imageToGroundUtils.js +1 -1
  132. package/layers/video/VideoCameraSensorModel.js +1 -1
  133. package/package.json +1 -1
  134. package/support/revision.js +1 -1
  135. package/symbols/cim/CIMSymbolDrawHelper.js +1 -1
  136. package/symbols/support/Symbol3DFillMaterial.js +1 -1
  137. package/symbols/support/Symbol3DMaterial.js +1 -1
  138. package/views/2d/engine/webgl/AFeatureTile.js +1 -1
  139. package/views/2d/engine/webgl/WorldExtentClipRenderer.js +1 -1
  140. package/views/2d/grid/GridView2D.js +1 -1
  141. package/views/2d/grid/constants.js +5 -0
  142. package/views/2d/interactive/editingTools/TransformTool.js +1 -1
  143. package/views/2d/interactive/editingTools/manipulations/ScaleManipulation.js +1 -1
  144. package/views/2d/layerViewModuleImportUtils.js +1 -1
  145. package/views/2d/support/highlightGroupUtils.js +1 -1
  146. package/views/3d/analysis/AreaMeasurement/support/MeasurementData.js +1 -1
  147. package/views/3d/analysis/Dimension/lengthDimensionConstraintUtils.js +1 -1
  148. package/views/3d/analysis/Dimension/lengthDimensionManipulatorUtils.js +1 -1
  149. package/views/3d/analysis/Dimension/lengthDimensionUtils.js +1 -1
  150. package/views/3d/analysis/LineOfSight/LineOfSightRayIntersector.js +1 -1
  151. package/views/3d/analysis/Slice/ShiftManipulator.js +1 -1
  152. package/views/3d/analysis/Slice/SliceTool.js +1 -1
  153. package/views/3d/analysis/Slice/SliceVisualization.js +1 -1
  154. package/views/3d/analysis/Slice/sliceToolUtils.js +1 -1
  155. package/views/3d/analysis/Viewshed/FieldOfViewManipulation.js +1 -1
  156. package/views/3d/analysis/Viewshed/ScaleOrientManipulation.js +1 -1
  157. package/views/3d/analysis/Viewshed/ViewshedSubTool.js +1 -1
  158. package/views/3d/analysis/Viewshed/ViewshedTool.js +1 -1
  159. package/views/3d/analysis/Viewshed/ViewshedVisualization.js +1 -1
  160. package/views/3d/analysis/Viewshed/viewshedToolUtils.js +1 -1
  161. package/views/3d/analysis/support/measurementUtils.js +1 -1
  162. package/views/3d/animation/pointToPoint/Animation.js +1 -1
  163. package/views/3d/animation/pointToPoint/Camera.js +1 -1
  164. package/views/3d/camera/constraintUtils/common.js +1 -1
  165. package/views/3d/camera/constraintUtils/surfaceCollision.js +1 -1
  166. package/views/3d/camera/constraintUtils/tilt.js +1 -1
  167. package/views/3d/camera/intersectionUtils.js +1 -1
  168. package/views/3d/environment/ChapmanAtmosphere.js +1 -1
  169. package/views/3d/environment/CloudsComposition.glsl.js +1 -1
  170. package/views/3d/environment/CloudsParameters.js +1 -1
  171. package/views/3d/environment/EnvironmentRenderer.js +1 -1
  172. package/views/3d/environment/Fog.js +1 -1
  173. package/views/3d/environment/MarsAtmosphere.js +1 -1
  174. package/views/3d/interactive/Manipulator3D.js +1 -1
  175. package/views/3d/interactive/editingTools/dragEventPipeline3D.js +1 -1
  176. package/views/3d/interactive/editingTools/draw/DrawGraphicTool3D.js +1 -1
  177. package/views/3d/interactive/editingTools/lineObjectVisualElementUtils.js +1 -1
  178. package/views/3d/interactive/editingTools/manipulations/MoveXYAxisManipulation.js +1 -1
  179. package/views/3d/interactive/editingTools/manipulations/MoveXYDiscManipulation.js +1 -1
  180. package/views/3d/interactive/editingTools/manipulations/MoveZManipulation.js +1 -1
  181. package/views/3d/interactive/editingTools/originGeometryVisualElementUtils.js +1 -1
  182. package/views/3d/interactive/editingTools/reshape/ReshapeOperation.js +1 -1
  183. package/views/3d/interactive/editingTools/transform/ScaleRotateTransform.js +1 -1
  184. package/views/3d/interactive/editingTools/transform/extentTransform/ExtentScale.js +1 -1
  185. package/views/3d/interactive/editingTools/transform/extentTransform/extentUtils.js +1 -1
  186. package/views/3d/interactive/visualElements/LineVisualElement.js +1 -1
  187. package/views/3d/interactive/visualElements/OutlineVisualElement.js +1 -1
  188. package/views/3d/interactive/visualElements/PointVisualElement.js +1 -1
  189. package/views/3d/interactive/visualElements/VerticesVisualElement.js +1 -1
  190. package/views/3d/layerViewModuleImportUtils.js +1 -1
  191. package/views/3d/layers/FocusAreaLayerView3D.js +5 -0
  192. package/views/3d/layers/I3SMeshView3D.js +1 -1
  193. package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
  194. package/views/3d/layers/IntegratedMeshLayerView3D.js +1 -1
  195. package/views/3d/layers/PointCloudLayerView3D.js +1 -1
  196. package/views/3d/layers/SceneLayerGraphicsView3D.js +1 -1
  197. package/views/3d/layers/VoxelGraphic.js +5 -0
  198. package/views/3d/layers/VoxelLayerView3D.js +1 -1
  199. package/views/3d/layers/graphics/Deconflictor.js +1 -1
  200. package/views/3d/layers/graphics/ElevationAligners.js +1 -1
  201. package/views/3d/layers/graphics/Graphics3DCore.js +1 -1
  202. package/views/3d/layers/graphics/Graphics3DDrapedGraphicLayer.js +1 -1
  203. package/views/3d/layers/graphics/Graphics3DExtrudeSymbolLayer.js +1 -1
  204. package/views/3d/layers/graphics/Graphics3DLodInstanceGraphicLayer.js +1 -1
  205. package/views/3d/layers/graphics/Graphics3DMeshFillSymbolLayer.js +1 -1
  206. package/views/3d/layers/graphics/Graphics3DObjectSymbolLayer.js +1 -1
  207. package/views/3d/layers/graphics/Graphics3DPathSymbolLayer.js +1 -1
  208. package/views/3d/layers/graphics/elevationAlignmentUtils.js +1 -1
  209. package/views/3d/layers/graphics/labelPlacement.js +1 -1
  210. package/views/3d/layers/graphics/objectResourceUtils.js +1 -1
  211. package/views/3d/layers/i3s/I3SMeshViewFilter.js +1 -1
  212. package/views/3d/layers/i3s/I3SUtil.js +1 -1
  213. package/views/3d/layers/i3s/I3SViewportQueries.js +1 -1
  214. package/views/3d/layers/i3s/LayerElevationProvider.js +1 -1
  215. package/views/3d/layers/i3s/LoDUtil.js +1 -1
  216. package/views/3d/layers/i3s/PointRenderer.js +1 -1
  217. package/views/3d/layers/support/FastSymbolUpdates.js +1 -1
  218. package/views/3d/layers/support/FeatureTileMeasurements3D.js +1 -1
  219. package/views/3d/layers/support/FeatureTileVisibility3D.js +1 -1
  220. package/views/3d/layers/support/uvUtils.js +1 -1
  221. package/views/3d/state/NearFarHeuristic.js +1 -1
  222. package/views/3d/state/ViewStateManager.js +1 -1
  223. package/views/3d/state/controllers/GamepadKeyboardController.js +1 -1
  224. package/views/3d/state/controllers/PinchAndPanControllerGlobal.js +1 -1
  225. package/views/3d/state/controllers/PinchAndPanControllerLocal.js +1 -1
  226. package/views/3d/state/controllers/RotateController.js +1 -1
  227. package/views/3d/state/controllers/ZoomControllerGlobal.js +1 -1
  228. package/views/3d/state/controllers/ZoomControllerLocal.js +1 -1
  229. package/views/3d/state/controllers/ZoomStepControllerGlobal.js +1 -1
  230. package/views/3d/state/controllers/ZoomStepControllerLocal.js +1 -1
  231. package/views/3d/state/helpers/SceneIntersectionHelper.js +1 -1
  232. package/views/3d/state/utils/navigationUtils.js +1 -1
  233. package/views/3d/state/utils/viewUtils.js +1 -1
  234. package/views/3d/support/FrustumExtentIntersection.js +1 -1
  235. package/views/3d/support/cameraUtilsInternal.js +1 -1
  236. package/views/3d/support/geometryUtils/ray.js +1 -1
  237. package/views/3d/support/intersectionUtils.js +1 -1
  238. package/views/3d/support/mathUtils.js +1 -1
  239. package/views/3d/support/orientedBoundingBox.js +1 -1
  240. package/views/3d/support/pointsOfInterest/Focus.js +1 -1
  241. package/views/3d/support/sunUtils.js +1 -1
  242. package/views/3d/support/viewpointUtils.js +1 -1
  243. package/views/3d/terrain/OverlayRenderer.js +1 -1
  244. package/views/3d/terrain/PatchRenderData.js +1 -1
  245. package/views/3d/terrain/SphericalPatch.js +1 -1
  246. package/views/3d/terrain/TerrainRenderer.js +1 -1
  247. package/views/3d/terrain/TerrainSurface.js +1 -1
  248. package/views/3d/terrain/Tile.js +1 -1
  249. package/views/3d/terrain/isTerrainSurfaceLayer.js +1 -1
  250. package/views/3d/webgl/RenderCamera.js +1 -1
  251. package/views/3d/webgl-engine/collections/Component/ComponentObjectCollection.js +1 -1
  252. package/views/3d/webgl-engine/collections/Component/DepthRange.js +1 -1
  253. package/views/3d/webgl-engine/collections/Component/Material/ComponentMaterial.js +1 -1
  254. package/views/3d/webgl-engine/collections/Component/Material/ComponentTechnique.js +1 -1
  255. package/views/3d/webgl-engine/collections/Component/Material/ComponentTechniqueConfiguration.js +1 -1
  256. package/views/3d/webgl-engine/collections/Component/Material/shader/ComponentShader.glsl.js +1 -1
  257. package/views/3d/webgl-engine/core/renderPasses/RenderPassManager.js +1 -1
  258. package/views/3d/webgl-engine/core/shaderLibrary/ShaderOutput.js +1 -1
  259. package/views/3d/webgl-engine/core/shaderLibrary/Slice.glsl.js +1 -1
  260. package/views/3d/webgl-engine/core/shaderLibrary/attributes/InstancedDoublePrecision.glsl.js +1 -1
  261. package/views/3d/webgl-engine/core/shaderLibrary/attributes/NormalAttribute.glsl.js +1 -1
  262. package/views/3d/webgl-engine/core/shaderLibrary/attributes/VertexNormal.glsl.js +2 -6
  263. package/views/3d/webgl-engine/core/shaderLibrary/output/Emissions.glsl.js +2 -2
  264. package/views/3d/webgl-engine/core/shaderLibrary/shading/ComputeFragmentNormals.glsl.js +13 -0
  265. package/views/3d/webgl-engine/core/shaderLibrary/shading/EvaluateAmbientLighting.glsl.js +1 -1
  266. package/views/3d/webgl-engine/core/shaderLibrary/shading/EvaluateSceneLighting.glsl.js +11 -13
  267. package/views/3d/webgl-engine/core/shaderLibrary/shading/MainLighting.glsl.js +4 -4
  268. package/views/3d/webgl-engine/core/shaderLibrary/shading/PhysicallyBasedRendering.glsl.js +1 -4
  269. package/views/3d/webgl-engine/core/shaderLibrary/shading/ReadBaseColorTexture.glsl.js +3 -3
  270. package/views/3d/webgl-engine/core/shaderLibrary/shading/ReadShadowMap.glsl.js +1 -1
  271. package/views/3d/webgl-engine/core/shaderLibrary/shading/Water.glsl.js +2 -2
  272. package/views/3d/webgl-engine/core/shaderLibrary/util/ScreenSizePerspective.glsl.js +1 -1
  273. package/views/3d/webgl-engine/core/shaderLibrary/util/View.glsl.js +1 -1
  274. package/views/3d/webgl-engine/effects/focusArea/FocusAreaColorRenderNodeTechnique.js +5 -0
  275. package/views/3d/webgl-engine/effects/focusArea/FocusAreaMaskRenderNodeTechnique.js +5 -0
  276. package/views/3d/webgl-engine/effects/focusArea/FocusAreaParameters.js +5 -0
  277. package/views/3d/webgl-engine/effects/focusArea/FocusAreaRenderNode.js +5 -0
  278. package/views/3d/webgl-engine/effects/highlight/ShadowHighlight.js +1 -1
  279. package/views/3d/webgl-engine/effects/laserlines/LaserlinePathData.js +1 -1
  280. package/views/3d/webgl-engine/lib/BoundingInfo.js +1 -1
  281. package/views/3d/webgl-engine/lib/GeometryUtil.js +1 -1
  282. package/views/3d/webgl-engine/lib/Intersector.js +1 -1
  283. package/views/3d/webgl-engine/lib/Object3D.js +1 -1
  284. package/views/3d/webgl-engine/lib/Octree.js +1 -1
  285. package/views/3d/webgl-engine/lib/OrderIndependentTransparency.js +1 -1
  286. package/views/3d/webgl-engine/lib/Path.js +1 -1
  287. package/views/3d/webgl-engine/lib/PathGeometryData.js +1 -1
  288. package/views/3d/webgl-engine/lib/PathVertex.js +1 -1
  289. package/views/3d/webgl-engine/lib/RayIntersections.js +1 -1
  290. package/views/3d/webgl-engine/lib/Renderer.js +1 -1
  291. package/views/3d/webgl-engine/lib/ShadowMap.js +1 -1
  292. package/views/3d/webgl-engine/lib/edgeRendering/EdgeRenderer.js +1 -1
  293. package/views/3d/webgl-engine/lib/edgeRendering/EdgeView.js +1 -1
  294. package/views/3d/webgl-engine/lib/edgeRendering/edgePreprocessing.js +1 -1
  295. package/views/3d/webgl-engine/lib/geometryDataUtils.js +1 -1
  296. package/views/3d/webgl-engine/lib/lodRendering/InstanceData.js +1 -1
  297. package/views/3d/webgl-engine/lib/lodRendering/LodRenderer.js +1 -1
  298. package/views/3d/webgl-engine/lib/pathGeometryUtils.js +1 -1
  299. package/views/3d/webgl-engine/lib/triangleIntersectionUtils.js +1 -1
  300. package/views/3d/webgl-engine/lib/verticalOffsetUtils.js +1 -1
  301. package/views/3d/webgl-engine/lighting/SphericalHarmonics.js +1 -1
  302. package/views/3d/webgl-engine/materials/DefaultMaterial.js +1 -1
  303. package/views/3d/webgl-engine/materials/HUDMaterial.js +1 -1
  304. package/views/3d/webgl-engine/materials/LineMarkerMaterial.js +1 -1
  305. package/views/3d/webgl-engine/materials/MeasurementArrowMaterial.js +1 -1
  306. package/views/3d/webgl-engine/materials/NativeLineMaterial.js +1 -1
  307. package/views/3d/webgl-engine/materials/PathMaterial.js +1 -1
  308. package/views/3d/webgl-engine/materials/PathTechnique.js +1 -1
  309. package/views/3d/webgl-engine/materials/RibbonLineMaterial.js +1 -1
  310. package/views/3d/webgl-engine/materials/ShadedColorMaterial.js +1 -1
  311. package/views/3d/webgl-engine/shaders/DefaultMaterialTechnique.js +1 -1
  312. package/views/3d/webgl-engine/shaders/FocusAreaColor.glsl.js +5 -0
  313. package/views/3d/webgl-engine/shaders/FocusAreaMask.glsl.js +5 -0
  314. package/views/3d/webgl-engine/shaders/OutputColorHighlightOID.glsl.js +8 -8
  315. package/views/3d/webgl-engine/shaders/Path.glsl.js +1 -1
  316. package/views/draw/support/helpMessageUtils3d.js +1 -1
  317. package/views/draw/support/surfaceCoordinateSystems.js +1 -1
  318. package/views/input/gamepad/GamepadSource.js +1 -1
  319. package/views/interactive/coordinateHelper.js +1 -1
  320. package/views/interactive/editGeometry/operations/OffsetEdgeVertex.js +1 -1
  321. package/views/interactive/sketch/constraints.js +1 -1
  322. package/views/interactive/snapping/FeatureSnappingEngine.js +1 -1
  323. package/views/interactive/snapping/GridSnappingEngine.js +5 -0
  324. package/views/interactive/snapping/RightAngleSnapper.js +1 -1
  325. package/views/interactive/snapping/SnappingOptions.js +1 -1
  326. package/views/interactive/snapping/featureSources/featureServiceSource/tileUtils.js +1 -1
  327. package/views/interactive/snapping/snappingUtils.js +1 -1
  328. package/views/navigation/PanPlanarMomentumEstimator.js +1 -1
  329. package/views/support/angularMeasurementUtils.js +1 -1
  330. package/views/support/euclideanAreaMeasurementUtils.js +1 -1
  331. package/views/support/euclideanLengthMeasurementUtils.js +1 -1
  332. package/views/support/geometry3dUtils.js +1 -1
  333. package/webscene/Slide.js +1 -1
  334. package/widgets/CoordinateConversion/support/formatUtils.js +1 -1
  335. package/widgets/ElevationProfile/ElevationProfileLineView.js +1 -1
  336. package/widgets/Feature/FeatureMedia.js +1 -1
  337. package/widgets/FeatureTable/FeatureTableViewModel.js +1 -1
  338. package/widgets/FeatureTable/Grid/Column.js +1 -1
  339. package/widgets/FeatureTable.js +1 -1
  340. package/widgets/GridControls/GridControlsViewModel.d.ts +4 -0
  341. package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
  342. package/widgets/PanoramicViewer/PanoramicViewerViewModel.js +1 -1
  343. package/widgets/Print/CustomTemplate.js +1 -1
  344. package/widgets/Print/PrintViewModel.js +1 -1
  345. package/widgets/Print/TemplateOptions.js +1 -1
  346. package/widgets/Print/utils.js +5 -0
  347. package/widgets/Print.js +1 -1
  348. package/widgets/ShadowCast/ShadowCastViewModel.js +1 -1
  349. package/widgets/support/GridControls/GridControlsViewModel.d.ts +4 -0
  350. package/widgets/support/GridControls/GridControlsViewModel.js +5 -0
  351. package/widgets/support/GridControls/VisibleElements.js +5 -0
  352. package/widgets/support/GridControls/gridUtils.js +5 -0
  353. package/widgets/support/GridControls.d.ts +4 -0
  354. package/widgets/support/GridControls.js +5 -0
  355. package/widgets/support/exportUtils.js +1 -1
  356. package/assets/esri/core/workers/chunks/14dc47896456e3c66b24.js +0 -1
  357. package/assets/esri/core/workers/chunks/2e88af8ab1e2713e7655.js +0 -1
  358. package/assets/esri/core/workers/chunks/3b204e75b613bcfbc8b9.js +0 -1
  359. package/assets/esri/core/workers/chunks/3e57f493d5a9d7aa7a48.js +0 -1
  360. package/assets/esri/core/workers/chunks/4e5ae81c612543130d9a.js +0 -1
  361. package/assets/esri/core/workers/chunks/4e746f8fca1d932dd684.js +0 -1
  362. package/assets/esri/core/workers/chunks/544eec13338b2d71680f.js +0 -1
  363. package/assets/esri/core/workers/chunks/5e7e12863cbed07451d0.js +0 -1
  364. package/assets/esri/core/workers/chunks/6c129767cda74aa672e0.js +0 -1
  365. package/assets/esri/core/workers/chunks/6f7c2d02fbd29870f6ee.js +0 -1
  366. package/assets/esri/core/workers/chunks/7802e70422f4151b95bc.js +0 -1
  367. package/assets/esri/core/workers/chunks/920557db2bd107a3c579.js +0 -1
  368. package/assets/esri/core/workers/chunks/9443b9ec03f25c723c2c.js +0 -47
  369. package/assets/esri/core/workers/chunks/991295637f51e8207efe.js +0 -1
  370. package/assets/esri/core/workers/chunks/ace8b6351ed35b03499b.js +0 -1
  371. package/assets/esri/core/workers/chunks/b1e4896acfae0bf9a9a8.js +0 -1
  372. package/assets/esri/core/workers/chunks/ca12b1c470e67ca7b30e.js +0 -1
  373. package/assets/esri/core/workers/chunks/cd9f48dcee2a1fc261ed.js +0 -774
  374. package/assets/esri/core/workers/chunks/d3626c01d2569d84e01e.js +0 -1
  375. package/assets/esri/core/workers/chunks/e5474bcde5b8fa037b56.js +0 -278
  376. package/views/3d/webgl-engine/core/shaderLibrary/shading/ComputeShadingNormal.glsl.js +0 -31
@@ -0,0 +1,5 @@
1
+ /*
2
+ All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
+ See https://js.arcgis.com/4.31/esri/copyright.txt for details.
4
+ */
5
+ import{_ as t}from"../../../chunks/tslib.es6.js";import e from"../../../core/Accessor.js";import r from"../../../core/Logger.js";import{deg2rad as i}from"../../../core/mathUtils.js";import{convertUnit as o,getMetersPerUnitForSR as n}from"../../../core/unitUtils.js";import{property as s}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/RandomLCG.js";import{subclass as a}from"../../../core/accessorSupport/decorators/subclass.js";import{K as p}from"../../../chunks/vec32.js";import{project as c}from"../../../geometry/projection.js";import{getResolutionInMetersForScale as l}from"../../../geometry/support/scaleUtils.js";import{pixelsPerCell as d}from"../../2d/grid/constants.js";import{logWithBase as u}from"../../3d/webgl-engine/lib/Util.js";import{create as g,createWritable as f}from"../sketch/normalizedPoint.js";import{gridPlacementGraphicSymbol as h}from"./snappingUtils.js";import{IntersectionSnappingCandidate as m}from"./candidates/IntersectionSnappingCandidate.js";import{LineSnappingCandidate as y}from"./candidates/LineSnappingCandidate.js";let S=class extends e{constructor(t){super(t),this.options=null}destroy(){this._set("options",null)}get grid(){return this.view.grid}get effectiveViewRotation(){return this.grid?.rotateWithMap?0:i(this.view.rotation??0)}get gridRotation(){return i(this.grid?.rotation??0)}get gridCenter(){const{spatialReference:t,grid:e}=this;if(!e||!t)return null;try{const r=c(e.center,t);return g(r.x,r.y,r.z)}catch(i){return r.getLogger(this).errorOnce("Grid Snapping - Failed to project grid center.",i),null}}get offsetScaleFactor(){const{pixelsPerStride:t,grid:e}=this;if(!e||!t)return 1;const{majorLineInterval:r,dynamicScaling:i}=e;if(r<1)return null;const o=1===r?10:r;return o**(i?Math.round(u(d/t,o)):0)}get spatialReference(){return this.view.spatialReference}get gridMetersPerStride(){const{grid:t}=this;return t?o(t.spacing,t.units,"meters"):null}get viewMetersPerPixel(){return l(this.view.scale)}get pixelsPerStride(){const{gridMetersPerStride:t,viewMetersPerPixel:e}=this;return e&&t?t/e:null}get updating(){return!1}async fetchCandidates(t,e,r){const{options:i,view:o}=this;if(!i?.effectiveGridEnabled||!o.grid||r.feature?.attributes&&h in r.feature.attributes)return[];const n=r.coordinateHelper.arrayToPoint(t),s=i.distance*("touch"===r.pointer?i.touchSensitivityMultiplier:1);return this.fetchCandidatesSync(n,s)}fetchCandidatesSync(t,e){const r=[],{grid:i,effectiveViewRotation:o,gridRotation:s,gridCenter:a,viewMetersPerPixel:p,offsetScaleFactor:l,spatialReference:d,gridMetersPerStride:u}=this;if(!(i&&p&&a&&d&&l&&u))return r;const f=c(t,d),h=g(f.x,f.y,f.z),S=j(h,-s,a,-o),M=n(d),x=u/M*l,R=v(S,x,a),{shouldSnapX:b,shouldSnapY:C}=P(R,S,e,p,M);if(!b&&!C)return[];const L=g((b?R:S)[0],(C?R:S)[1]),U=j(L,s,a,o),E=j(R,s,a,o);if(C){const t=w(R,S,x,"y"),e=j(t,s,a,o);r.push(new y({lineStart:E,lineEnd:e,targetPoint:U,isDraped:!1}))}if(b){const t=w(R,S,x,"x"),e=j(t,s,a,o);r.push(new y({lineStart:E,lineEnd:e,targetPoint:U,isDraped:!1}))}return b&&C&&r.push(new m(U,r[0],r[1],!1)),r}};t([s({constructOnly:!0})],S.prototype,"view",void 0),t([s()],S.prototype,"options",void 0),t([s()],S.prototype,"grid",null),t([s()],S.prototype,"effectiveViewRotation",null),t([s()],S.prototype,"gridRotation",null),t([s()],S.prototype,"gridCenter",null),t([s()],S.prototype,"offsetScaleFactor",null),t([s()],S.prototype,"spatialReference",null),t([s()],S.prototype,"gridMetersPerStride",null),t([s()],S.prototype,"viewMetersPerPixel",null),t([s()],S.prototype,"pixelsPerStride",null),t([s()],S.prototype,"updating",null),S=t([a("esri.views.interactive.snapping.GridSnappingEngine")],S);const j=(t,e,r,i)=>{const o=f(t[0],t[1],t[2]);return p(o,p(o,o,r,e),r,i)},v=(t,e,r)=>{const i=(t[0]-r[0])/e,o=(t[1]-r[1])/e,n=Math.trunc(i),s=Math.trunc(o),a=Math.round(i%1),p=Math.round(o%1),c=r[0]+(n+a)*e,l=r[1]+(s+p)*e;return g(c,l)},P=(t,e,r,i,o)=>{if(i<=0)return{shouldSnapX:!1,shouldSnapY:!1};const n=(t[0]-e[0])/i,s=(t[1]-e[1])/i;return{shouldSnapX:Math.abs(n*o)<r,shouldSnapY:Math.abs(s*o)<r}},w=(t,e,r,i)=>{if("y"===i){const i=e[0]>t[0]?1:-1;return g(t[0]+r*i,t[1])}const o=e[1]>t[1]?1:-1;return g(t[0],t[1]+r*o)};export{S as GridSnappingEngine};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.31/esri/copyright.txt for details.
4
4
  */
5
- import{cyclical2PI as e}from"../../../core/Cyclical.js";import{createAngle as t,valueInUnit as r}from"../../../core/quantityUtils.js";import{subtract as i,dot as s,squaredLength as n,scaleAndAdd as o}from"../../../core/libs/gl-matrix-2/math/vec2.js";import{create as a}from"../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{r as c,f as p,s as g}from"../../../chunks/vec32.js";import{create as h}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{absoluteHeightElevationInfo as l}from"../../../support/elevationInfoUtils.js";import{VerticalHalfPlaneConstraint as f}from"../sketch/constraints.js";import{fromAnyMapPoint as d,asVec2 as m,markAsTarget as u,fromValues as x,fromVec3 as V}from"../sketch/normalizedPoint.js";import{SnappingAlgorithm as E}from"./SnappingAlgorithm.js";import{squaredScreenDistance as j}from"./snappingUtils.js";import{SelfSnappingRightAngleType as v,RightAngleSnappingCandidate as S,OtherVertexType as k}from"./candidates/RightAngleSnappingCandidate.js";import{vectorToScreenPoint as C}from"../support/viewUtils.js";import{radiansGeographicBetweenVec as w,pointFromDistanceAlongAzimuth as y}from"../../support/angularMeasurementUtils.js";import{geodesicDistance as F}from"../../support/geodesicLengthMeasurementUtils.js";class R extends E{snapNewVertex(e,t){const r=t.editGeometryOperations.data.components[0],i=[];if(r.vertices.length<2)return i;const{view:s}=this,n=C(e,t.spatialReference,l,s),o=r.vertices.at(-1);this._checkForSnappingCandidate(v.LastVertex,i,o.leftEdge,o,o.leftEdge.leftVertex,e,n,t);const a=r.vertices[0];return this._checkForSnappingCandidate(v.FirstVertex,i,a.rightEdge,a,a.rightEdge.rightVertex,e,n,t),i}snapExistingVertex(e,t){const r=[],i=t.vertexHandle;if(i.component.vertices.length<3)return r;const{view:s}=this,n=C(e,t.spatialReference,l,s),o=i.leftEdge,a=i.rightEdge;if(o?.leftVertex.leftEdge){const i=o.leftVertex.leftEdge;this._checkForSnappingCandidate(v.ExistingEdge,r,i,i.rightVertex,i.leftVertex,e,n,t)}if(a?.rightVertex.rightEdge){const i=a.rightVertex.rightEdge;this._checkForSnappingCandidate(v.ExistingEdge,r,i,i.leftVertex,i.rightVertex,e,n,t)}return r}_checkForSnappingCandidate(e,t,r,i,s,n,o,a){if(!this.edgeExceedsShortLineThreshold(r,a))return;const c=this.view,p=d(i.pos,c,a),g=d(s.pos,c,a);_(T,g,p,n,a),this._checkForSnappingCandidateAlongProjectedRay(e,t,g,p,T,n,o,a)}_checkForSnappingCandidateAlongProjectedRay(e,t,r,a,p,g,d,E){const{spatialReference:v,pointer:w}=E,y=i(M,m(g),m(a)),F=s(p,y)/n(p),R=o(M,m(a),p,F),_=u(x(R[0],R[1],g[2]));if(j(d,C(_,v,l,this.view))>this.squaredProximityThreshold(w)||this.isVertical(_,a,E)||this.isVertical(a,r,E))return;const P=c(h(),a,p,Math.sign(F));t.push(new S({targetPoint:_,constraint:new f(a,V(P)),previousVertex:r,otherVertex:a,otherVertexType:k.CENTER,selfSnappingType:e,isDraped:"on-the-ground"===E.elevationInfo?.mode}))}}function _(e,t,r,i,s){P(e,t,r,i,s)||U(e,t,r)}function P(i,s,n,o,{spatialReference:a}){const c=w(s,n,a,a);if(null==c)return!1;const g=w(n,o,a,a);if(null==g)return!1;const l=Math.sign(e.shortestSignedDiff(c,g))*Math.PI*.5,f=t(c+l,"radians","geographic"),d=h(),m=F(n,o,a);return null!=m&&(y(d,n,a,r(m,"meters"),f,"geodesic"),p(i,d,n),!0)}function U(e,t,r){const s=i(M,m(r),m(t));g(e,s[1],-s[0],0)}const M=a(),T=h();export{R as RightAngleSnapper};
5
+ import{cyclical2PI as e}from"../../../core/Cyclical.js";import{createAngle as t,valueInUnit as r}from"../../../core/quantityUtils.js";import{subtract as i,dot as n,squaredLength as s,scaleAndAdd as o}from"../../../core/libs/gl-matrix-2/math/vec2.js";import{create as a}from"../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{r as c,f as p,a as g}from"../../../chunks/vec32.js";import{create as h}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{absoluteHeightElevationInfo as l}from"../../../support/elevationInfoUtils.js";import{VerticalHalfPlaneConstraint as f}from"../sketch/constraints.js";import{fromAnyMapPoint as d,asVec2 as m,markAsTarget as u,fromValues as x,fromVec3 as V}from"../sketch/normalizedPoint.js";import{SnappingAlgorithm as E}from"./SnappingAlgorithm.js";import{squaredScreenDistance as j}from"./snappingUtils.js";import{SelfSnappingRightAngleType as v,RightAngleSnappingCandidate as S,OtherVertexType as k}from"./candidates/RightAngleSnappingCandidate.js";import{vectorToScreenPoint as C}from"../support/viewUtils.js";import{radiansGeographicBetweenVec as w,pointFromDistanceAlongAzimuth as y}from"../../support/angularMeasurementUtils.js";import{geodesicDistance as F}from"../../support/geodesicLengthMeasurementUtils.js";class R extends E{snapNewVertex(e,t){const r=t.editGeometryOperations.data.components[0],i=[];if(r.vertices.length<2)return i;const{view:n}=this,s=C(e,t.spatialReference,l,n),o=r.vertices.at(-1);this._checkForSnappingCandidate(v.LastVertex,i,o.leftEdge,o,o.leftEdge.leftVertex,e,s,t);const a=r.vertices[0];return this._checkForSnappingCandidate(v.FirstVertex,i,a.rightEdge,a,a.rightEdge.rightVertex,e,s,t),i}snapExistingVertex(e,t){const r=[],i=t.vertexHandle;if(i.component.vertices.length<3)return r;const{view:n}=this,s=C(e,t.spatialReference,l,n),o=i.leftEdge,a=i.rightEdge;if(o?.leftVertex.leftEdge){const i=o.leftVertex.leftEdge;this._checkForSnappingCandidate(v.ExistingEdge,r,i,i.rightVertex,i.leftVertex,e,s,t)}if(a?.rightVertex.rightEdge){const i=a.rightVertex.rightEdge;this._checkForSnappingCandidate(v.ExistingEdge,r,i,i.leftVertex,i.rightVertex,e,s,t)}return r}_checkForSnappingCandidate(e,t,r,i,n,s,o,a){if(!this.edgeExceedsShortLineThreshold(r,a))return;const c=this.view,p=d(i.pos,c,a),g=d(n.pos,c,a);_(T,g,p,s,a),this._checkForSnappingCandidateAlongProjectedRay(e,t,g,p,T,s,o,a)}_checkForSnappingCandidateAlongProjectedRay(e,t,r,a,p,g,d,E){const{spatialReference:v,pointer:w}=E,y=i(M,m(g),m(a)),F=n(p,y)/s(p),R=o(M,m(a),p,F),_=u(x(R[0],R[1],g[2]));if(j(d,C(_,v,l,this.view))>this.squaredProximityThreshold(w)||this.isVertical(_,a,E)||this.isVertical(a,r,E))return;const P=c(h(),a,p,Math.sign(F));t.push(new S({targetPoint:_,constraint:new f(a,V(P)),previousVertex:r,otherVertex:a,otherVertexType:k.CENTER,selfSnappingType:e,isDraped:"on-the-ground"===E.elevationInfo?.mode}))}}function _(e,t,r,i,n){P(e,t,r,i,n)||U(e,t,r)}function P(i,n,s,o,{spatialReference:a}){const c=w(n,s,a,a);if(null==c)return!1;const g=w(s,o,a,a);if(null==g)return!1;const l=Math.sign(e.shortestSignedDiff(c,g))*Math.PI*.5,f=t(c+l,"radians","geographic"),d=h(),m=F(s,o,a);return null!=m&&(y(d,s,a,r(m,"meters"),f,"geodesic"),p(i,d,s),!0)}function U(e,t,r){const n=i(M,m(r),m(t));g(e,n[1],-n[0],0)}const M=a(),T=h();export{R as RightAngleSnapper};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.31/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../chunks/tslib.es6.js";import t from"../../../core/Accessor.js";import{difference as r}from"../../../core/arrayUtils.js";import o from"../../../core/Collection.js";import s from"../../../core/Logger.js";import{property as i}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import{subclass as a}from"../../../core/accessorSupport/decorators/subclass.js";import n from"./FeatureSnappingLayerSource.js";import{defaults as l}from"./Settings.js";let u=class extends t{constructor(e){super(e),this.enabled=!1,this.enabledToggled=!1,this.forceDisabled=!1,this.selfEnabled=!0,this.featureEnabled=!0,this.attributeRulesEnabled=!1,this.featureSources=new o,this.distance=l.distance,this.touchSensitivityMultiplier=l.touchSensitivityMultiplier}get effectiveEnabled(){return!this.forceDisabled&&(this.enabledToggled?!this.enabled:this.enabled)}get effectiveSelfEnabled(){return this.effectiveEnabled&&this.selfEnabled}get effectiveFeatureEnabled(){return this.effectiveEnabled&&this.featureEnabled}get _effectiveFeatureSources(){const e=this.featureSources;e.some(p)&&s.getLogger(this).warnOnce("Do not configure SubtypeGroupLayer sources in SnappingOptions.featureSources directly. Create a FeatureSnappingLayerSource for each SubtypeSublayer.");const t=e.filter(d),i=this._get("_effectiveFeatureSources")?.filter(p)??new o;for(const r of t){const e=i.find((e=>e.layer===r.layer.parent));if(e)e.sublayerSources.includes(r)||e.sublayerSources.add(r);else if(r.layer.parent){const e=new n({layer:r.layer.parent});e.sublayerSources.add(r),i.add(e)}}for(const r of i){const e=r.sublayerSources.filter((e=>!t.includes(e)));r.sublayerSources.removeMany(e)}i.removeMany(i.filter((e=>0===e.sublayerSources.length)));const a=e.filter(f),l=this._get("_effectiveFeatureSources")??new o,{added:u,removed:c}=r(l.toArray(),[...a,...i]);return l.removeMany(c),l.addMany(u),l}};e([i()],u.prototype,"enabled",void 0),e([i()],u.prototype,"enabledToggled",void 0),e([i()],u.prototype,"forceDisabled",void 0),e([i()],u.prototype,"selfEnabled",void 0),e([i()],u.prototype,"featureEnabled",void 0),e([i()],u.prototype,"attributeRulesEnabled",void 0),e([i({type:o.ofType(n)})],u.prototype,"featureSources",void 0),e([i()],u.prototype,"distance",void 0),e([i()],u.prototype,"touchSensitivityMultiplier",void 0),e([i({readOnly:!0})],u.prototype,"effectiveEnabled",null),e([i({readOnly:!0})],u.prototype,"effectiveSelfEnabled",null),e([i({readOnly:!0})],u.prototype,"effectiveFeatureEnabled",null),e([i({readOnly:!0})],u.prototype,"_effectiveFeatureSources",null),u=e([a("esri.views.interactive.snapping.SnappingOptions")],u);const c=u;function p(e){return"subtype-group"===e.layer.type}function f(e){return"subtype-group"!==e.layer.type}function d(e){return"subtype-sublayer"===e.layer.type}export{c as default};
5
+ import{_ as e}from"../../../chunks/tslib.es6.js";import t from"../../../core/Accessor.js";import{difference as r}from"../../../core/arrayUtils.js";import o from"../../../core/Collection.js";import i from"../../../core/Logger.js";import{property as s}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import{subclass as a}from"../../../core/accessorSupport/decorators/subclass.js";import n from"./FeatureSnappingLayerSource.js";import{defaults as l}from"./Settings.js";let u=class extends t{constructor(e){super(e),this.enabled=!1,this.enabledToggled=!1,this.forceDisabled=!1,this.selfEnabled=!0,this.featureEnabled=!0,this.gridEnabled=!1,this.attributeRulesEnabled=!1,this.featureSources=new o,this.distance=l.distance,this.touchSensitivityMultiplier=l.touchSensitivityMultiplier}get effectiveEnabled(){return!this.forceDisabled&&(this.enabledToggled?!this.enabled:this.enabled)}get effectiveGridEnabled(){return this.effectiveEnabled&&this.gridEnabled}get effectiveSelfEnabled(){return this.effectiveEnabled&&this.selfEnabled}get effectiveFeatureEnabled(){return this.effectiveEnabled&&this.featureEnabled}get _effectiveFeatureSources(){const e=this.featureSources;e.some(p)&&i.getLogger(this).warnOnce("Do not configure SubtypeGroupLayer sources in SnappingOptions.featureSources directly. Create a FeatureSnappingLayerSource for each SubtypeSublayer.");const t=e.filter(f),s=this._get("_effectiveFeatureSources")?.filter(p)??new o;for(const r of t){const e=s.find((e=>e.layer===r.layer.parent));if(e)e.sublayerSources.includes(r)||e.sublayerSources.add(r);else if(r.layer.parent){const e=new n({layer:r.layer.parent});e.sublayerSources.add(r),s.add(e)}}for(const r of s){const e=r.sublayerSources.filter((e=>!t.includes(e)));r.sublayerSources.removeMany(e)}s.removeMany(s.filter((e=>0===e.sublayerSources.length)));const a=e.filter(d),l=this._get("_effectiveFeatureSources")??new o,{added:u,removed:c}=r(l.toArray(),[...a,...s]);return l.removeMany(c),l.addMany(u),l}};e([s()],u.prototype,"enabled",void 0),e([s()],u.prototype,"enabledToggled",void 0),e([s()],u.prototype,"forceDisabled",void 0),e([s()],u.prototype,"selfEnabled",void 0),e([s()],u.prototype,"featureEnabled",void 0),e([s()],u.prototype,"gridEnabled",void 0),e([s()],u.prototype,"attributeRulesEnabled",void 0),e([s({type:o.ofType(n)})],u.prototype,"featureSources",void 0),e([s()],u.prototype,"distance",void 0),e([s()],u.prototype,"touchSensitivityMultiplier",void 0),e([s({readOnly:!0})],u.prototype,"effectiveEnabled",null),e([s({readOnly:!0})],u.prototype,"effectiveGridEnabled",null),e([s({readOnly:!0})],u.prototype,"effectiveSelfEnabled",null),e([s({readOnly:!0})],u.prototype,"effectiveFeatureEnabled",null),e([s({readOnly:!0})],u.prototype,"_effectiveFeatureSources",null),u=e([a("esri.views.interactive.snapping.SnappingOptions")],u);const c=u;function p(e){return"subtype-group"===e.layer.type}function d(e){return"subtype-group"!==e.layer.type}function f(e){return"subtype-sublayer"===e.layer.type}export{c as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.31/esri/copyright.txt for details.
4
4
  */
5
- import{s}from"../../../../../chunks/vec32.js";import{create as r}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{a as e,h as o,j as t}from"../../../../../chunks/boundedPlane.js";function a(r,e){return o(e.extent,c),t(c,s(n,r.x,r.y,0))}const c=e(),n=r();export{a as distanceToTile};
5
+ import{a as r}from"../../../../../chunks/vec32.js";import{create as s}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{a as e,h as o,j as t}from"../../../../../chunks/boundedPlane.js";function a(s,e){return o(e.extent,c),t(c,r(n,s.x,s.y,0))}const c=e(),n=s();export{a as distanceToTile};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.31/esri/copyright.txt for details.
4
4
  */
5
- import{watch as e,syncAndInitial as t}from"../../../core/reactiveUtils.js";import{intersection as n}from"../../../core/SetUtils.js";import{sqlAnd as r}from"../../../core/sql.js";import{mergeTimeExtents as o}from"../../../core/timeUtils.js";import{a as i}from"../../../chunks/vec32.js";import{makeDehydratedPoint as s}from"../../../layers/graphics/dehydratedPoint.js";import a from"../../../rest/support/Query.js";import{ViewEventPriorities as l}from"../../input/InputManager.js";import{snappingKeys as c}from"../keybindings.js";import{fromAnyMapPoint as p}from"../sketch/normalizedPoint.js";import{isWebMap as u}from"../../../webmap/utils.js";function m(e,t){const n=e.length===t.length&&e[0]===t[0]&&e[1]===t[1];switch(e.length){case 2:return n;case 3:return n&&e[2]===t[2];case 4:return n&&e[2]===t[2]&&e[3]===t[3]}return!1}function d(e,t){const n=e.x-t.x,r=e.y-t.y;return n*n+r*r}function g(e,t){return Math.sqrt(d(e,t))}function f(e,t){t.sort(((t,n)=>i(t.targetPoint,e)-i(n.targetPoint,e)))}var E;function y({point:e,distance:t,returnEdge:n,vertexMode:i,coordinateHelper:{spatialReference:l},filter:c},p,u){return u=null!=u?u.clone():new a({where:"1=1"}),c&&(u.geometry=c.geometry,u.distance=c.distance,u.spatialRelationship=c.spatialRelationship,u.where=r(u.where,c.where),u.timeExtent=o(u.timeExtent,c.timeExtent),u.objectIds=h(u.objectIds,c.objectIds)),{point:s(e[0],e[1],e[2],l.toJSON()),mode:p,distance:t,returnEdge:n,vertexMode:i,query:u.toJSON()}}function h(e,t){return e||t?t?e?Array.from(n(new Set(e),new Set(t))):t:e:null}function w(e,t,n){return{left:p(e.leftVertex.pos,t,n),right:p(e.rightVertex.pos,t,n)}}function j(e){return e.createQuery()}!function(e){e[e.TARGET=0]="TARGET",e[e.REFERENCE=1]="REFERENCE",e[e.REFERENCE_EXTENSION=2]="REFERENCE_EXTENSION"}(E||(E={}));const R=Symbol("snapping-toggle");function N(n,r=()=>{}){const o=e((()=>({view:n.view,snappingOptions:n.snappingOptions})),(({view:e,snappingOptions:t})=>{if(n.removeHandles(R),!e||!t)return;const o=l.TOOL,i=[e.on("key-down",(e=>{e.key!==c.toggle||e.repeat||(t.enabledToggled=!0,r())}),o),e.on("key-up",(e=>{e.key===c.toggle&&(t.enabledToggled=!1,r())}),o),e.on("pointer-move",(e=>{const n=e.native.ctrlKey;t.enabledToggled!==n&&(t.enabledToggled=n,r())}),o)];n.addHandles(i,R)}),t);n.addHandles(o)}function v(e){return u(e)&&"utilityNetworks"in e&&!!e.utilityNetworks?.length}export{E as LineSegmentHintType,w as editEdgeToSnappingEdge,v as isUtilityNetworkWebMap,j as makeFilter,y as makeSnappingQuery,m as objectEqual,g as screenDistance,N as setupSnappingToggleHandles,f as sortCandidatesInPlace,d as squaredScreenDistance};
5
+ import{watch as e,syncAndInitial as t}from"../../../core/reactiveUtils.js";import{intersection as n}from"../../../core/SetUtils.js";import{sqlAnd as r}from"../../../core/sql.js";import{mergeTimeExtents as o}from"../../../core/timeUtils.js";import{s as i}from"../../../chunks/vec32.js";import{makeDehydratedPoint as s}from"../../../layers/graphics/dehydratedPoint.js";import a from"../../../rest/support/Query.js";import{ViewEventPriorities as c}from"../../input/InputManager.js";import{snappingKeys as l}from"../keybindings.js";import{fromAnyMapPoint as p}from"../sketch/normalizedPoint.js";import{isWebMap as u}from"../../../webmap/utils.js";const m=Symbol("grid-placement-graphic");function d(e,t){const n=e.length===t.length&&e[0]===t[0]&&e[1]===t[1];switch(e.length){case 2:return n;case 3:return n&&e[2]===t[2];case 4:return n&&e[2]===t[2]&&e[3]===t[3]}return!1}function g(e,t){const n=e.x-t.x,r=e.y-t.y;return n*n+r*r}function f(e,t){return Math.sqrt(g(e,t))}function E(e,t){t.sort(((t,n)=>i(t.targetPoint,e)-i(n.targetPoint,e)))}var y;function h({point:e,distance:t,returnEdge:n,vertexMode:i,coordinateHelper:{spatialReference:c},filter:l},p,u){return u=null!=u?u.clone():new a({where:"1=1"}),l&&(u.geometry=l.geometry,u.distance=l.distance,u.spatialRelationship=l.spatialRelationship,u.where=r(u.where,l.where),u.timeExtent=o(u.timeExtent,l.timeExtent),u.objectIds=w(u.objectIds,l.objectIds)),{point:s(e[0],e[1],e[2],c.toJSON()),mode:p,distance:t,returnEdge:n,vertexMode:i,query:u.toJSON()}}function w(e,t){return e||t?t?e?Array.from(n(new Set(e),new Set(t))):t:e:null}function j(e,t,n){return{left:p(e.leftVertex.pos,t,n),right:p(e.rightVertex.pos,t,n)}}function R(e){return e.createQuery()}!function(e){e[e.TARGET=0]="TARGET",e[e.REFERENCE=1]="REFERENCE",e[e.REFERENCE_EXTENSION=2]="REFERENCE_EXTENSION"}(y||(y={}));const N=Symbol("snapping-toggle");function b(n,r=()=>{}){const o=e((()=>({view:n.view,snappingOptions:n.snappingOptions})),(({view:e,snappingOptions:t})=>{if(n.removeHandles(N),!e||!t)return;const o=c.TOOL,i=[e.on("key-down",(e=>{e.key!==l.toggle||e.repeat||(t.enabledToggled=!0,r())}),o),e.on("key-up",(e=>{e.key===l.toggle&&(t.enabledToggled=!1,r())}),o),e.on("pointer-move",(e=>{const n=e.native.ctrlKey;t.enabledToggled!==n&&(t.enabledToggled=n,r())}),o)];n.addHandles(i,N)}),t);n.addHandles(o)}function v(e){return u(e)&&"utilityNetworks"in e&&!!e.utilityNetworks?.length}export{y as LineSegmentHintType,j as editEdgeToSnappingEdge,m as gridPlacementGraphicSymbol,v as isUtilityNetworkWebMap,R as makeFilter,h as makeSnappingQuery,d as objectEqual,f as screenDistance,b as setupSnappingToggleHandles,E as sortCandidatesInPlace,g as squaredScreenDistance};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.31/esri/copyright.txt for details.
4
4
  */
5
- import{s as e,l as t,j as i}from"../../chunks/vec32.js";import{create as s}from"../../core/libs/gl-matrix-2/factories/vec3f64.js";import{FilteredFiniteDifference as n}from"./FilteredFiniteDifference.js";import{Momentum as r}from"./Momentum.js";class l extends r{constructor(e,t,i,s,n){super(e,t,i),this._sceneVelocity=s,this.direction=n}value(e){return super.valueFromInitialVelocity(this._sceneVelocity,e)}}class c{constructor(e=300,t=12,i=.84){this._minimumInitialVelocity=e,this._stopVelocity=t,this._friction=i,this.enabled=!0,this._time=new n(.6),this._screen=[new n(.4),new n(.4)],this._scene=[new n(.6),new n(.6),new n(.6)],this._tmpDirection=s()}add(e,t,i){if(this.enabled){if(this._time.hasLastValue()){if(this._time.computeDelta(i)<.015)return}this._screen[0].update(e[0]),this._screen[1].update(e[1]),this._scene[0].update(t[0]),this._scene[1].update(t[1]),this._scene[2].update(t[2]),this._time.update(i)}}reset(){this._screen[0].reset(),this._screen[1].reset(),this._scene[0].reset(),this._scene[1].reset(),this._scene[2].reset(),this._time.reset()}evaluateMomentum(){if(!this.enabled||!this._screen[0].hasFilteredDelta()||!this._time.hasFilteredDelta())return null;const e=this._screen[0].filteredDelta,t=this._screen[1].filteredDelta,i=null==e||null==t?0:Math.sqrt(e*e+t*t),s=this._time.filteredDelta,n=null==s||null==i?0:i/s;return Math.abs(n)<this._minimumInitialVelocity?null:this.createMomentum(n,this._stopVelocity,this._friction)}createMomentum(s,n,r){e(this._tmpDirection,this._scene[0].filteredDelta??0,this._scene[1].filteredDelta??0,this._scene[2].filteredDelta??0);const c=t(this._tmpDirection);c>0&&i(this._tmpDirection,this._tmpDirection,1/c);const h=this._time.filteredDelta;return new l(s,n,r,null==h?0:c/h,this._tmpDirection)}}export{l as PanPlanarMomentum,c as PanPlanarMomentumEstimator};
5
+ import{a as e,m as t,j as i}from"../../chunks/vec32.js";import{create as s}from"../../core/libs/gl-matrix-2/factories/vec3f64.js";import{FilteredFiniteDifference as n}from"./FilteredFiniteDifference.js";import{Momentum as r}from"./Momentum.js";class l extends r{constructor(e,t,i,s,n){super(e,t,i),this._sceneVelocity=s,this.direction=n}value(e){return super.valueFromInitialVelocity(this._sceneVelocity,e)}}class c{constructor(e=300,t=12,i=.84){this._minimumInitialVelocity=e,this._stopVelocity=t,this._friction=i,this.enabled=!0,this._time=new n(.6),this._screen=[new n(.4),new n(.4)],this._scene=[new n(.6),new n(.6),new n(.6)],this._tmpDirection=s()}add(e,t,i){if(this.enabled){if(this._time.hasLastValue()){if(this._time.computeDelta(i)<.015)return}this._screen[0].update(e[0]),this._screen[1].update(e[1]),this._scene[0].update(t[0]),this._scene[1].update(t[1]),this._scene[2].update(t[2]),this._time.update(i)}}reset(){this._screen[0].reset(),this._screen[1].reset(),this._scene[0].reset(),this._scene[1].reset(),this._scene[2].reset(),this._time.reset()}evaluateMomentum(){if(!this.enabled||!this._screen[0].hasFilteredDelta()||!this._time.hasFilteredDelta())return null;const e=this._screen[0].filteredDelta,t=this._screen[1].filteredDelta,i=null==e||null==t?0:Math.sqrt(e*e+t*t),s=this._time.filteredDelta,n=null==s||null==i?0:i/s;return Math.abs(n)<this._minimumInitialVelocity?null:this.createMomentum(n,this._stopVelocity,this._friction)}createMomentum(s,n,r){e(this._tmpDirection,this._scene[0].filteredDelta??0,this._scene[1].filteredDelta??0,this._scene[2].filteredDelta??0);const c=t(this._tmpDirection);c>0&&i(this._tmpDirection,this._tmpDirection,1/c);const h=this._time.filteredDelta;return new l(s,n,r,null==h?0:c/h,this._tmpDirection)}}export{l as PanPlanarMomentum,c as PanPlanarMomentumEstimator};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.31/esri/copyright.txt for details.
4
4
  */
5
- import{cyclicalDegrees as e,Cyclical as t}from"../../core/Cyclical.js";import{createAngle as r,convertRotationType as i}from"../../core/quantityUtils.js";import{convertUnit as o}from"../../core/unitUtils.js";import{angle as n}from"../../core/libs/gl-matrix-2/math/vec2.js";import{UNIT_Y as a,create as s}from"../../core/libs/gl-matrix-2/factories/vec2f64.js";import{s as c,e as l,c as u}from"../../chunks/vec32.js";import{create as f}from"../../core/libs/gl-matrix-2/factories/vec3f64.js";import{projectVectorToVector as m}from"../../geometry/projection/projectVectorToVector.js";import{geodesicCompatibleSpatialReference as g,inverseGeodeticSolver as p,directGeodeticSolver as v,InverseGeodeticSolverResult as d}from"../../geometry/support/geodesicUtils.js";import{equals as h}from"../../geometry/support/spatialReferenceUtils.js";var j;function R(e,t){if(null==e||null==t)return;const i=b(e,t);return null!=i?r(i,"radians","geographic"):void 0}!function(e){e.Absolute="absolute",e.Relative="relative",e.RelativeBilateral="relative-bilateral"}(j||(j={}));const b=(()=>{const e=f(),t=f();return(r,i)=>(c(e,r.x,r.y,r.z??0),c(t,i.x,i.y,i.z??0),y(e,t,r.spatialReference,i.spatialReference))})(),y=(()=>{const e=s(),t=f(),r=f();return(i,s,c,u)=>{if(l(i,s))return;const f=g(c),v=g(u);if(f&&v&&h(f,v)&&m(i,c,t,f)&&m(s,u,r,v)){const{azimuth:e}=p(k,t,r,f);return null!=e?o(e,"degrees","radians"):void 0}e[0]=s[0]-i[0],e[1]=s[1]-i[1];let d=n(a,e);return e[0]<0&&(d=q-d),d}})();function x(e,t,r,i=j.Absolute){if(t&&r)switch(i){case j.Absolute:return R(t,r);case j.Relative:return w(z(e,t,r),j.Relative);case j.RelativeBilateral:return w(z(e,t,r),j.RelativeBilateral)}}function z(e,t,i){if(!e||!t||!i)return;const o=b(e,t),n=b(t,i);return null!=o&&null!=n?r(n-o,"radians","geographic"):void 0}function w(e,t){if(null!=e)switch(t){case j.Absolute:return A(e);case j.Relative:{const t=T(e);let i=I.normalize(t,0,!0);return-180===i&&(i=180),r(i,"degrees","geographic")}case j.RelativeBilateral:{const t=T(e),i=Math.abs(I.normalize(t,0,!0));return r(i,"degrees","geographic")}}}function A(e){const t=T(e),i=C.normalize(t,0,!0);return r(i,"degrees","geographic")}function B(e,t,n){let a=o(e.value,e.unit,"degrees");return a=i(a,e.rotationType,n),a=o(a,"degrees",t),r(a,t,n)}const M=(()=>{const e=f();return(t,r,n,a,s,l="geodesic")=>{u(e,r);const f=T(s);if("geodesic"===l){const i=g(n);if(i&&m(e,n,e,i))return v(t,e,f,a,i),t[2]=r[2],!!m(t,i,t,n)}const p=i(f,"geographic","arithmetic"),d=o(p,"degrees","radians"),h=r[0]+a*Math.cos(d),j=r[1]+a*Math.sin(d),R=r[2];return c(t,h,j,R),!0}})();function T(e){if(null!=e)return i(V(e),e.rotationType,"geographic")}function U(e){if(null!=e)return i(V(e),e.rotationType,"arithmetic")}function V(e){return o(e.value,e.unit,"degrees")}const k=new d,q=2*Math.PI,C=e,I=new t(-180,180);export{j as DirectionMode,B as convertAngle,R as directionBetweenPoints,x as directionForVertices,U as getDegreesArithmetic,T as getDegreesGeographic,w as getNormalizedDirection,A as getNormalizedGeographicOrientation,M as pointFromDistanceAlongAzimuth,y as radiansGeographicBetweenVec};
5
+ import{cyclicalDegrees as e,Cyclical as t}from"../../core/Cyclical.js";import{createAngle as r,convertRotationType as i}from"../../core/quantityUtils.js";import{convertUnit as o}from"../../core/unitUtils.js";import{angle as n}from"../../core/libs/gl-matrix-2/math/vec2.js";import{UNIT_Y as a,create as s}from"../../core/libs/gl-matrix-2/factories/vec2f64.js";import{a as c,e as l,c as u}from"../../chunks/vec32.js";import{create as f}from"../../core/libs/gl-matrix-2/factories/vec3f64.js";import{projectVectorToVector as m}from"../../geometry/projection/projectVectorToVector.js";import{geodesicCompatibleSpatialReference as g,inverseGeodeticSolver as p,directGeodeticSolver as v,InverseGeodeticSolverResult as d}from"../../geometry/support/geodesicUtils.js";import{equals as h}from"../../geometry/support/spatialReferenceUtils.js";var j;function R(e,t){if(null==e||null==t)return;const i=b(e,t);return null!=i?r(i,"radians","geographic"):void 0}!function(e){e.Absolute="absolute",e.Relative="relative",e.RelativeBilateral="relative-bilateral"}(j||(j={}));const b=(()=>{const e=f(),t=f();return(r,i)=>(c(e,r.x,r.y,r.z??0),c(t,i.x,i.y,i.z??0),y(e,t,r.spatialReference,i.spatialReference))})(),y=(()=>{const e=s(),t=f(),r=f();return(i,s,c,u)=>{if(l(i,s))return;const f=g(c),v=g(u);if(f&&v&&h(f,v)&&m(i,c,t,f)&&m(s,u,r,v)){const{azimuth:e}=p(k,t,r,f);return null!=e?o(e,"degrees","radians"):void 0}e[0]=s[0]-i[0],e[1]=s[1]-i[1];let d=n(a,e);return e[0]<0&&(d=q-d),d}})();function x(e,t,r,i=j.Absolute){if(t&&r)switch(i){case j.Absolute:return R(t,r);case j.Relative:return w(z(e,t,r),j.Relative);case j.RelativeBilateral:return w(z(e,t,r),j.RelativeBilateral)}}function z(e,t,i){if(!e||!t||!i)return;const o=b(e,t),n=b(t,i);return null!=o&&null!=n?r(n-o,"radians","geographic"):void 0}function w(e,t){if(null!=e)switch(t){case j.Absolute:return A(e);case j.Relative:{const t=T(e);let i=I.normalize(t,0,!0);return-180===i&&(i=180),r(i,"degrees","geographic")}case j.RelativeBilateral:{const t=T(e),i=Math.abs(I.normalize(t,0,!0));return r(i,"degrees","geographic")}}}function A(e){const t=T(e),i=C.normalize(t,0,!0);return r(i,"degrees","geographic")}function B(e,t,n){let a=o(e.value,e.unit,"degrees");return a=i(a,e.rotationType,n),a=o(a,"degrees",t),r(a,t,n)}const M=(()=>{const e=f();return(t,r,n,a,s,l="geodesic")=>{u(e,r);const f=T(s);if("geodesic"===l){const i=g(n);if(i&&m(e,n,e,i))return v(t,e,f,a,i),t[2]=r[2],!!m(t,i,t,n)}const p=i(f,"geographic","arithmetic"),d=o(p,"degrees","radians"),h=r[0]+a*Math.cos(d),j=r[1]+a*Math.sin(d),R=r[2];return c(t,h,j,R),!0}})();function T(e){if(null!=e)return i(V(e),e.rotationType,"geographic")}function U(e){if(null!=e)return i(V(e),e.rotationType,"arithmetic")}function V(e){return o(e.value,e.unit,"degrees")}const k=new d,q=2*Math.PI,C=e,I=new t(-180,180);export{j as DirectionMode,B as convertAngle,R as directionBetweenPoints,x as directionForVertices,U as getDegreesArithmetic,T as getDegreesGeographic,w as getNormalizedDirection,A as getNormalizedGeographicOrientation,M as pointFromDistanceAlongAzimuth,y as radiansGeographicBetweenVec};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.31/esri/copyright.txt for details.
4
4
  */
5
- import{createArea as t}from"../../core/quantityUtils.js";import{areaUnitFromSpatialReference as o}from"../../core/unitUtils.js";import{e as r}from"../../chunks/earcut.js";import{s as n,r as e,q as s}from"../../chunks/vec32.js";import{create as i}from"../../core/libs/gl-matrix-2/factories/vec3f64.js";import{projectVectorToVector as c}from"../../geometry/projection/projectVectorToVector.js";import{fromPoints as f,wrap as l,getNormal as u,projectPointLocal as m}from"../../geometry/support/plane.js";import{areaPoints2d as p}from"../../geometry/support/triangle.js";import{computeEuclideanMeasurementSR as a}from"./measurementUtils.js";function g(t,o=U()){return h(t,o)}function j(t,o=U()){return h(t,o,!1)}function h(r,g,j=r.hasZ){const h=a(r.spatialReference),U=o(h);if(null==U)return null;const q=(t,o)=>!(o.length<2)&&(n(t,o[0],o[1],j&&o[2]||0),!0);let v=0;for(const t of r.rings){const o=t.length;if(o<3)continue;const{positionsWorldCoords:a}=g;for(;a.length<o;)a.push(i());const j=y,U=n(d,0,0,0),x=1/o;for(let n=0;n<o;n++){if(!q(j,t[n]))return null;if(!c(j,r.spatialReference,a[n],h))return null;e(U,U,a[n],x)}const C=f(a[0],a[1],U,l());if(0===s(u(C)))continue;for(let t=0;t<o;t++)m(C,U,a[t],a[t]);const R=k(a);for(let t=0;t<R.length;t+=3)v+=p(a[R[t]],a[R[t+1]],a[R[t+2]])}return t(v,U)}const y=i(),d=i();function U(){return{positionsWorldCoords:[]}}function k(t){return r(q(t),[],2)}function q(t){const o=new Float64Array(2*t.length);for(let r=0;r<t.length;++r){const n=t[r],e=2*r;o[e]=n[0],o[e+1]=n[1]}return o}export{h as computeEuclideanPlanarArea,U as createEuclideanPlanarAreaCache,j as euclideanHorizontalPlanarArea,g as euclideanPlanarArea,k as triangulate};
5
+ import{createArea as t}from"../../core/quantityUtils.js";import{areaUnitFromSpatialReference as o}from"../../core/unitUtils.js";import{e as r}from"../../chunks/earcut.js";import{a as n,r as e,q as s}from"../../chunks/vec32.js";import{create as i}from"../../core/libs/gl-matrix-2/factories/vec3f64.js";import{projectVectorToVector as c}from"../../geometry/projection/projectVectorToVector.js";import{fromPoints as f,wrap as l,getNormal as u,projectPointLocal as m}from"../../geometry/support/plane.js";import{areaPoints2d as p}from"../../geometry/support/triangle.js";import{computeEuclideanMeasurementSR as a}from"./measurementUtils.js";function g(t,o=U()){return h(t,o)}function j(t,o=U()){return h(t,o,!1)}function h(r,g,j=r.hasZ){const h=a(r.spatialReference),U=o(h);if(null==U)return null;const q=(t,o)=>!(o.length<2)&&(n(t,o[0],o[1],j&&o[2]||0),!0);let v=0;for(const t of r.rings){const o=t.length;if(o<3)continue;const{positionsWorldCoords:a}=g;for(;a.length<o;)a.push(i());const j=y,U=n(d,0,0,0),x=1/o;for(let n=0;n<o;n++){if(!q(j,t[n]))return null;if(!c(j,r.spatialReference,a[n],h))return null;e(U,U,a[n],x)}const C=f(a[0],a[1],U,l());if(0===s(u(C)))continue;for(let t=0;t<o;t++)m(C,U,a[t],a[t]);const R=k(a);for(let t=0;t<R.length;t+=3)v+=p(a[R[t]],a[R[t+1]],a[R[t+2]])}return t(v,U)}const y=i(),d=i();function U(){return{positionsWorldCoords:[]}}function k(t){return r(q(t),[],2)}function q(t){const o=new Float64Array(2*t.length);for(let r=0;r<t.length;++r){const n=t[r],e=2*r;o[e]=n[0],o[e+1]=n[1]}return o}export{h as computeEuclideanPlanarArea,U as createEuclideanPlanarAreaCache,j as euclideanHorizontalPlanarArea,g as euclideanPlanarArea,k as triangulate};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.31/esri/copyright.txt for details.
4
4
  */
5
- import{createLength as t}from"../../core/quantityUtils.js";import{lengthUnitFromSpatialReference as n,verticalLengthUnitFromSpatialReference as r}from"../../core/unitUtils.js";import{p as e,s as i}from"../../chunks/vec32.js";import{create as l}from"../../core/libs/gl-matrix-2/factories/vec3f64.js";import{projectVectorToVector as o}from"../../geometry/projection/projectVectorToVector.js";import{equals as c}from"../../geometry/support/spatialReferenceUtils.js";import{computeEuclideanMeasurementSR as u}from"./measurementUtils.js";var a;function s(t){return p(t,a.Direct)}function f(t){return p(t,a.Horizontal)}function p(r,e){const{hasZ:i,spatialReference:l}=r,o=u(l);let c=0;const s=n(o);if(null==s)return null;const f=e===a.Direct?Z:j;for(const t of r.paths){if(t.length<2)continue;const n=t.length-1;for(let r=0;r<n;++r){const n=t[r];D[0]=n[0],D[1]=n[1],D[2]=i?n[2]:0;const e=t[r+1];H[0]=e[0],H[1]=e[1],H[2]=i?e[2]:0;const o=f(D,H,l);if(null==o)return null;c+=o.value}}return t(c,s)}function h(t,n){const{spatialReference:r}=t;return c(r,n.spatialReference)?(D[0]=t.x,D[1]=t.y,D[2]=t.hasZ?t.z:0,H[0]=n.x,H[1]=n.y,H[2]=n.hasZ?n.z:0,x(D,H,r)):null}function m(t,n){const{spatialReference:r}=t;return c(r,n.spatialReference)?(D[0]=t.x,D[1]=t.y,D[2]=t.hasZ?t.z:0,H[0]=n.x,H[1]=n.y,H[2]=n.hasZ?n.z:0,Z(D,H,r)):null}function z(t,n){const{spatialReference:r}=t;return c(r,n.spatialReference)?(D[0]=t.x,D[1]=t.y,D[2]=t.hasZ?t.z:0,H[0]=n.x,H[1]=n.y,H[2]=n.hasZ?n.z:0,j(D,H,r)):null}function y(t,n){const{spatialReference:r}=t;return c(r,n.spatialReference)?(D[0]=t.x,D[1]=t.y,D[2]=t.hasZ?t.z:0,H[0]=n.x,H[1]=n.y,H[2]=n.hasZ?n.z:0,g(D,H,r)):null}function R(t){return null!=t?v(t.hasZ?t.z:0,t.spatialReference):null}function v(n,e){const i=r(e);return null!=i?t(n??0,i):null}function x(n,r,e){const i=V(n,r,e);return null!=i?{direct:t(i.direct,i.unit),horizontal:t(i.horizontal,i.unit),vertical:t(i.vertical,i.unit)}:null}function Z(n,r,e){const i=V(n,r,e,a.Direct);return null!=i?t(i.direct,i.unit):null}function j(n,r,e){const i=V(n,r,e,a.Horizontal);return null!=i?t(i.horizontal,i.unit):null}function d(n,r,e){const i=V(n,r,e,a.Vertical);return null!=i?t(Math.abs(i.verticalSigned),i.unit):null}function g(n,r,e){const i=V(n,r,e,a.Vertical);return null!=i?t(i.verticalSigned,i.unit):null}function V(t,r,l,c){const s=u(l),f=n(s);if(null==f)return null;const p=r[2]-t[2];if(c===a.Vertical)return{verticalSigned:p,unit:f};if(!o(t,l,U,s)||!o(r,l,b,s))return null;if(c===a.Direct){return{direct:e(b,U),unit:f}}if(i(S,t[0],t[1],r[2]),!o(S,l,S,s))return null;const h=e(S,b);if(c===a.Horizontal)return{horizontal:h,unit:f};return{direct:e(b,U),horizontal:h,vertical:Math.abs(p),unit:f}}!function(t){t[t.Direct=0]="Direct",t[t.Horizontal=1]="Horizontal",t[t.Vertical=2]="Vertical"}(a||(a={}));const D=l(),H=l(),U=l(),b=l(),S=l();export{R as elevationFromPoint,v as elevationFromZ,Z as euclideanDirectDistance,m as euclideanDirectDistanceBetweenPoints,x as euclideanDistance,h as euclideanDistanceBetweenPoints,j as euclideanHorizontalDistance,z as euclideanHorizontalDistanceBetweenPoints,f as euclideanHorizontalLength,s as euclideanLength,d as verticalDistance,g as verticalSignedDistance,y as verticalSignedDistanceBetweenPoints};
5
+ import{createLength as t}from"../../core/quantityUtils.js";import{lengthUnitFromSpatialReference as n,verticalLengthUnitFromSpatialReference as r}from"../../core/unitUtils.js";import{p as e,a as i}from"../../chunks/vec32.js";import{create as l}from"../../core/libs/gl-matrix-2/factories/vec3f64.js";import{projectVectorToVector as o}from"../../geometry/projection/projectVectorToVector.js";import{equals as c}from"../../geometry/support/spatialReferenceUtils.js";import{computeEuclideanMeasurementSR as u}from"./measurementUtils.js";var a;function s(t){return p(t,a.Direct)}function f(t){return p(t,a.Horizontal)}function p(r,e){const{hasZ:i,spatialReference:l}=r,o=u(l);let c=0;const s=n(o);if(null==s)return null;const f=e===a.Direct?Z:j;for(const t of r.paths){if(t.length<2)continue;const n=t.length-1;for(let r=0;r<n;++r){const n=t[r];D[0]=n[0],D[1]=n[1],D[2]=i?n[2]:0;const e=t[r+1];H[0]=e[0],H[1]=e[1],H[2]=i?e[2]:0;const o=f(D,H,l);if(null==o)return null;c+=o.value}}return t(c,s)}function h(t,n){const{spatialReference:r}=t;return c(r,n.spatialReference)?(D[0]=t.x,D[1]=t.y,D[2]=t.hasZ?t.z:0,H[0]=n.x,H[1]=n.y,H[2]=n.hasZ?n.z:0,x(D,H,r)):null}function m(t,n){const{spatialReference:r}=t;return c(r,n.spatialReference)?(D[0]=t.x,D[1]=t.y,D[2]=t.hasZ?t.z:0,H[0]=n.x,H[1]=n.y,H[2]=n.hasZ?n.z:0,Z(D,H,r)):null}function z(t,n){const{spatialReference:r}=t;return c(r,n.spatialReference)?(D[0]=t.x,D[1]=t.y,D[2]=t.hasZ?t.z:0,H[0]=n.x,H[1]=n.y,H[2]=n.hasZ?n.z:0,j(D,H,r)):null}function y(t,n){const{spatialReference:r}=t;return c(r,n.spatialReference)?(D[0]=t.x,D[1]=t.y,D[2]=t.hasZ?t.z:0,H[0]=n.x,H[1]=n.y,H[2]=n.hasZ?n.z:0,g(D,H,r)):null}function R(t){return null!=t?v(t.hasZ?t.z:0,t.spatialReference):null}function v(n,e){const i=r(e);return null!=i?t(n??0,i):null}function x(n,r,e){const i=V(n,r,e);return null!=i?{direct:t(i.direct,i.unit),horizontal:t(i.horizontal,i.unit),vertical:t(i.vertical,i.unit)}:null}function Z(n,r,e){const i=V(n,r,e,a.Direct);return null!=i?t(i.direct,i.unit):null}function j(n,r,e){const i=V(n,r,e,a.Horizontal);return null!=i?t(i.horizontal,i.unit):null}function d(n,r,e){const i=V(n,r,e,a.Vertical);return null!=i?t(Math.abs(i.verticalSigned),i.unit):null}function g(n,r,e){const i=V(n,r,e,a.Vertical);return null!=i?t(i.verticalSigned,i.unit):null}function V(t,r,l,c){const s=u(l),f=n(s);if(null==f)return null;const p=r[2]-t[2];if(c===a.Vertical)return{verticalSigned:p,unit:f};if(!o(t,l,U,s)||!o(r,l,b,s))return null;if(c===a.Direct){return{direct:e(b,U),unit:f}}if(i(S,t[0],t[1],r[2]),!o(S,l,S,s))return null;const h=e(S,b);if(c===a.Horizontal)return{horizontal:h,unit:f};return{direct:e(b,U),horizontal:h,vertical:Math.abs(p),unit:f}}!function(t){t[t.Direct=0]="Direct",t[t.Horizontal=1]="Horizontal",t[t.Vertical=2]="Vertical"}(a||(a={}));const D=l(),H=l(),U=l(),b=l(),S=l();export{R as elevationFromPoint,v as elevationFromZ,Z as euclideanDirectDistance,m as euclideanDirectDistanceBetweenPoints,x as euclideanDistance,h as euclideanDistanceBetweenPoints,j as euclideanHorizontalDistance,z as euclideanHorizontalDistanceBetweenPoints,f as euclideanHorizontalLength,s as euclideanLength,d as verticalDistance,g as verticalSignedDistance,y as verticalSignedDistanceBetweenPoints};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.31/esri/copyright.txt for details.
4
4
  */
5
- import{floatEqualAbsolute as t}from"../../core/mathUtils.js";import{subtract as n,squaredLength as r,dot as s,scaleAndAdd as e,sub as o,length as c,distance as i,squaredDistance as u,lerp as a,set as f}from"../../core/libs/gl-matrix-2/math/vec2.js";import{create as p,fromValues as m,ZEROS as L}from"../../core/libs/gl-matrix-2/factories/vec2f64.js";import{s as h,z as A,m as d,r as l,p as E,b as N,G as y,c as P,f as b,x as j}from"../../chunks/vec32.js";import{create as M,clone as I}from"../../core/libs/gl-matrix-2/factories/vec3f64.js";import{getEpsilon as x}from"../../core/libs/gl-matrix-2/math/common.js";import{create as R,fromPositionAndNormal as Y,distance as g,intersectLine as v,isPointInside as q}from"../../geometry/support/plane.js";import{tangentFrame as F}from"../3d/support/mathUtils.js";import{LineType as H,intersectLineLikeAndCircle as _}from"./geometry2dUtils.js";function U({start:t,end:o,type:c},i,u){const a=[],f=n(et,o,t),m=n(ot,t,i),L=r(f),h=2*s(f,m),A=h*h-4*L*(r(m)-u*u);if(0===A){const n=-h/(2*L);(c===rt.PLANE||n>=0)&&a.push(e(p(),t,f,n))}else if(A>0){const n=Math.sqrt(A),r=(-h+n)/(2*L);(c===rt.PLANE||r>=0)&&a.push(e(p(),t,f,r));const s=(-h-n)/(2*L);(c===rt.PLANE||s>=0)&&a.push(e(p(),t,f,s))}return a}function k(t,r){const e=t.start,c=t.end,i=n(et,c,e),u=h(it,-i[1],i[0],0),a=r.start,f=r.end,p=A(ut,f,a),m=d(p,u),L=h(at,e[0],e[1],0),E=A(ft,L,a),N=d(E,u),y=x();if(Math.abs(m)<y)return Math.abs(N),[];const P=l(pt,a,p,N/m);if(r.type===H.RAY){const t=A(mt,P,a);if(d(t,p)<-y)return[]}if(t.type===rt.HALF_PLANE){const t=o(ot,P,e);if(s(t,i)<-y)return[]}return[I(P)]}function w(t,n){return T(X(ht,n[2],t),n)}function z(t,n){const r=0;return S(X(ht,r,t),X(At,r,n)).map((([t,n])=>m(t,n)))}function C(t,n,r){return J(t,X(ht,t[2],n),r)}function G(t,n){return K(X(ht,t[2],n),t)}function B(t,r,s,o=M()){const i=n(et,t,r),u=c(i);return e(o,r,i,0===u?1:s/u),o[2]=t[2],o}function D(t,n,r){return i(t,n)-r}function J(t,{start:n,end:r,type:s},e=M()){const o=A(ct,t,n),c=A(it,r,n),i=d(o,c)/d(c,c);return l(e,n,c,s===H.RAY?Math.max(i,0):i)}function K({start:t,end:n,type:r},s){const e=A(ct,s,t),o=A(it,n,t);if(r===H.RAY&&d(o,e)<-x())return E(t,s);const c=N(ut,o,e);return y(c)/y(o)}const O=(()=>{const t=M(),n=M(),r=M();return({start:s,end:e},{center:o,radius:c,normal:i,slicePlane:u})=>{const a=Y(o,i,Lt);if($(g(a,s),0)&&$(g(a,e),0)){F(i,t,n);const a=(s,e)=>(b(r,e,o),f(s,d(r,t),d(r,n)),s),p=_({start:a(et,s),end:a(ot,e),type:H.LINE},L,c),m=[];for(const[r,s]of p){const e=P(M(),o);l(e,e,t,r),l(e,e,n,s),u&&!nt(u,e)||m.push(e)}return m}const p=M();return v(a,s,e,p)?!$(E(p,o),c)||u&&!nt(u,p)?[]:[p]:[]}})();function Q({start:t,end:e,type:o},c,i){const u=[],a=b(ct,e,t),f=n(ot,t,c),p=r(a),m=2*s(a,f),L=m*m-4*p*(r(f)-i*i);if(0===L){const n=-m/(2*p);(o===H.LINE||n>=0)&&u.push(l(M(),t,a,n))}else if(L>0){const n=Math.sqrt(L),r=(-m+n)/(2*p);(o===H.LINE||r>=0)&&u.push(l(M(),t,a,r));const s=(-m-n)/(2*p);(o===H.LINE||s>=0)&&u.push(l(M(),t,a,s))}return u}function S(t,n){const r=t.start,s=t.end,e=n.start,o=n.end,c=A(ct,s,r),i=A(it,o,e),u=A(ut,e,r),a=N(at,c,i);if(!$(d(u,a),0))return[];const f=j(a);if($(f,0))return[];const p=N(ft,u,i),m=d(p,a)/f,L=l(pt,r,c,m);if(t.type===H.RAY){const t=A(mt,L,r);if(d(c,t)<-x())return[]}if(n.type===H.RAY){const t=A(mt,L,e);if(d(i,t)<-x())return[]}return[I(L)]}function T({start:t,end:n,type:r},s){const e=A(ct,s,t),o=A(it,n,t),c=N(ut,o,e),i=j(c)/j(o),u=x();if(i<u)switch(r){case H.LINE:return[I(s)];case H.RAY:return d(o,e)<-u?[]:[I(s)]}return[]}function V(t,n,r){return $(u(r,t),n*n)?[I(r)]:[]}function W(t,n,r,s){const[e,o]=t,[c,i]=r,u=c-e,f=i-o,p=u*u+f*f,L=Math.sqrt(p);if(L>n+s)return[];if(L<Math.abs(n-s))return[];if($(L,0)&&$(n,s))return[];const h=(n*n-s*s+p)/(2*L),A=Math.sqrt(n*n-h*h),d=A*f/L,l=A*u/L,[E,N]=a(et,t,r,h/L);return $(d,l)?[m(E,N)]:[m(E+d,N-l),m(E-d,N+l)]}function X(t,n,{start:r,end:s,type:e}){return h(t.start,r[0],r[1],n),h(t.end,s[0],s[1],n),t.type=st[e],t}function Z(t,n){return $(t[2],n[2])}function $(n,r){return t(Math.abs(n-r),0,x())}function tt(t,n){return n.filter((n=>nt(t,n)))}function nt(t,n){return q(t,n)}var rt;!function(t){t[t.PLANE=0]="PLANE",t[t.HALF_PLANE=1]="HALF_PLANE"}(rt||(rt={}));const st={[rt.PLANE]:H.LINE,[rt.HALF_PLANE]:H.RAY},et=p(),ot=p(),ct=M(),it=M(),ut=M(),at=M(),ft=M(),pt=M(),mt=M(),Lt=R(),ht={start:M(),end:M(),type:H.LINE},At={start:M(),end:M(),type:H.LINE};export{H as LineType,rt as VerticalPlaneType,T as intersectLineAndPoint,O as intersectLineLikeAndCircle,Q as intersectLineLikeAndVerticalCylinder,S as intersectLineLikes,V as intersectVerticalCylinderAndPoint,W as intersectVerticalCylinders,k as intersectVerticalPlaneAndLineLike,w as intersectVerticalPlaneAndPoint,U as intersectVerticalPlaneAndVerticalCylinder,z as intersectVerticalPlanes,$ as isClose,nt as isPointInsidePlane,K as pointToLineLikeDistance,D as pointToVerticalCylinderDistance,G as pointToVerticalPlaneDistance,tt as pointsInsidePlane,J as projectPointToLineLike,B as projectPointToVerticalCylinder,C as projectPointToVerticalPlane,Z as vectorsHaveCloseZ};
5
+ import{floatEqualAbsolute as t}from"../../core/mathUtils.js";import{subtract as n,squaredLength as r,dot as s,scaleAndAdd as e,sub as o,length as c,distance as i,squaredDistance as u,lerp as a,set as f}from"../../core/libs/gl-matrix-2/math/vec2.js";import{create as p,fromValues as m,ZEROS as L}from"../../core/libs/gl-matrix-2/factories/vec2f64.js";import{a as h,z as A,l as d,r as l,p as E,b as N,G as y,c as P,f as b,x as j}from"../../chunks/vec32.js";import{create as M,clone as I}from"../../core/libs/gl-matrix-2/factories/vec3f64.js";import{getEpsilon as x}from"../../core/libs/gl-matrix-2/math/common.js";import{create as R,fromPositionAndNormal as Y,distance as g,intersectLine as v,isPointInside as q}from"../../geometry/support/plane.js";import{tangentFrame as F}from"../3d/support/mathUtils.js";import{LineType as H,intersectLineLikeAndCircle as _}from"./geometry2dUtils.js";function U({start:t,end:o,type:c},i,u){const a=[],f=n(et,o,t),m=n(ot,t,i),L=r(f),h=2*s(f,m),A=h*h-4*L*(r(m)-u*u);if(0===A){const n=-h/(2*L);(c===rt.PLANE||n>=0)&&a.push(e(p(),t,f,n))}else if(A>0){const n=Math.sqrt(A),r=(-h+n)/(2*L);(c===rt.PLANE||r>=0)&&a.push(e(p(),t,f,r));const s=(-h-n)/(2*L);(c===rt.PLANE||s>=0)&&a.push(e(p(),t,f,s))}return a}function k(t,r){const e=t.start,c=t.end,i=n(et,c,e),u=h(it,-i[1],i[0],0),a=r.start,f=r.end,p=A(ut,f,a),m=d(p,u),L=h(at,e[0],e[1],0),E=A(ft,L,a),N=d(E,u),y=x();if(Math.abs(m)<y)return Math.abs(N),[];const P=l(pt,a,p,N/m);if(r.type===H.RAY){const t=A(mt,P,a);if(d(t,p)<-y)return[]}if(t.type===rt.HALF_PLANE){const t=o(ot,P,e);if(s(t,i)<-y)return[]}return[I(P)]}function w(t,n){return T(X(ht,n[2],t),n)}function z(t,n){const r=0;return S(X(ht,r,t),X(At,r,n)).map((([t,n])=>m(t,n)))}function C(t,n,r){return J(t,X(ht,t[2],n),r)}function G(t,n){return K(X(ht,t[2],n),t)}function B(t,r,s,o=M()){const i=n(et,t,r),u=c(i);return e(o,r,i,0===u?1:s/u),o[2]=t[2],o}function D(t,n,r){return i(t,n)-r}function J(t,{start:n,end:r,type:s},e=M()){const o=A(ct,t,n),c=A(it,r,n),i=d(o,c)/d(c,c);return l(e,n,c,s===H.RAY?Math.max(i,0):i)}function K({start:t,end:n,type:r},s){const e=A(ct,s,t),o=A(it,n,t);if(r===H.RAY&&d(o,e)<-x())return E(t,s);const c=N(ut,o,e);return y(c)/y(o)}const O=(()=>{const t=M(),n=M(),r=M();return({start:s,end:e},{center:o,radius:c,normal:i,slicePlane:u})=>{const a=Y(o,i,Lt);if($(g(a,s),0)&&$(g(a,e),0)){F(i,t,n);const a=(s,e)=>(b(r,e,o),f(s,d(r,t),d(r,n)),s),p=_({start:a(et,s),end:a(ot,e),type:H.LINE},L,c),m=[];for(const[r,s]of p){const e=P(M(),o);l(e,e,t,r),l(e,e,n,s),u&&!nt(u,e)||m.push(e)}return m}const p=M();return v(a,s,e,p)?!$(E(p,o),c)||u&&!nt(u,p)?[]:[p]:[]}})();function Q({start:t,end:e,type:o},c,i){const u=[],a=b(ct,e,t),f=n(ot,t,c),p=r(a),m=2*s(a,f),L=m*m-4*p*(r(f)-i*i);if(0===L){const n=-m/(2*p);(o===H.LINE||n>=0)&&u.push(l(M(),t,a,n))}else if(L>0){const n=Math.sqrt(L),r=(-m+n)/(2*p);(o===H.LINE||r>=0)&&u.push(l(M(),t,a,r));const s=(-m-n)/(2*p);(o===H.LINE||s>=0)&&u.push(l(M(),t,a,s))}return u}function S(t,n){const r=t.start,s=t.end,e=n.start,o=n.end,c=A(ct,s,r),i=A(it,o,e),u=A(ut,e,r),a=N(at,c,i);if(!$(d(u,a),0))return[];const f=j(a);if($(f,0))return[];const p=N(ft,u,i),m=d(p,a)/f,L=l(pt,r,c,m);if(t.type===H.RAY){const t=A(mt,L,r);if(d(c,t)<-x())return[]}if(n.type===H.RAY){const t=A(mt,L,e);if(d(i,t)<-x())return[]}return[I(L)]}function T({start:t,end:n,type:r},s){const e=A(ct,s,t),o=A(it,n,t),c=N(ut,o,e),i=j(c)/j(o),u=x();if(i<u)switch(r){case H.LINE:return[I(s)];case H.RAY:return d(o,e)<-u?[]:[I(s)]}return[]}function V(t,n,r){return $(u(r,t),n*n)?[I(r)]:[]}function W(t,n,r,s){const[e,o]=t,[c,i]=r,u=c-e,f=i-o,p=u*u+f*f,L=Math.sqrt(p);if(L>n+s)return[];if(L<Math.abs(n-s))return[];if($(L,0)&&$(n,s))return[];const h=(n*n-s*s+p)/(2*L),A=Math.sqrt(n*n-h*h),d=A*f/L,l=A*u/L,[E,N]=a(et,t,r,h/L);return $(d,l)?[m(E,N)]:[m(E+d,N-l),m(E-d,N+l)]}function X(t,n,{start:r,end:s,type:e}){return h(t.start,r[0],r[1],n),h(t.end,s[0],s[1],n),t.type=st[e],t}function Z(t,n){return $(t[2],n[2])}function $(n,r){return t(Math.abs(n-r),0,x())}function tt(t,n){return n.filter((n=>nt(t,n)))}function nt(t,n){return q(t,n)}var rt;!function(t){t[t.PLANE=0]="PLANE",t[t.HALF_PLANE=1]="HALF_PLANE"}(rt||(rt={}));const st={[rt.PLANE]:H.LINE,[rt.HALF_PLANE]:H.RAY},et=p(),ot=p(),ct=M(),it=M(),ut=M(),at=M(),ft=M(),pt=M(),mt=M(),Lt=R(),ht={start:M(),end:M(),type:H.LINE},At={start:M(),end:M(),type:H.LINE};export{H as LineType,rt as VerticalPlaneType,T as intersectLineAndPoint,O as intersectLineLikeAndCircle,Q as intersectLineLikeAndVerticalCylinder,S as intersectLineLikes,V as intersectVerticalCylinderAndPoint,W as intersectVerticalCylinders,k as intersectVerticalPlaneAndLineLike,w as intersectVerticalPlaneAndPoint,U as intersectVerticalPlaneAndVerticalCylinder,z as intersectVerticalPlanes,$ as isClose,nt as isPointInsidePlane,K as pointToLineLikeDistance,D as pointToVerticalCylinderDistance,G as pointToVerticalPlaneDistance,tt as pointsInsidePlane,J as projectPointToLineLike,B as projectPointToVerticalCylinder,C as projectPointToVerticalPlane,Z as vectorsHaveCloseZ};
package/webscene/Slide.js CHANGED
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.31/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../chunks/tslib.es6.js";import t from"../Basemap.js";import i from"../Viewpoint.js";import{result as n}from"../core/asyncUtils.js";import{ClonableMixin as r}from"../core/Clonable.js";import o from"../core/Collection.js";import{referenceSetter as s}from"../core/collectionUtils.js";import{JSONSupport as a}from"../core/JSONSupport.js";import l from"../core/Logger.js";import{moduloPositive as p}from"../core/mathUtils.js";import{destroyMaybe as m,removeMaybe as c}from"../core/maybe.js";import{onAbortOrThrow as h,createAbortError as d,isAbortError as u}from"../core/promiseUtils.js";import{whenOnce as y,when as g}from"../core/reactiveUtils.js";import{property as v}from"../core/accessorSupport/decorators/property.js";import{cast as b}from"../core/accessorSupport/decorators/cast.js";import"../core/RandomLCG.js";import"../core/has.js";import{subclass as w}from"../core/accessorSupport/decorators/subclass.js";import{ensureType as f}from"../core/accessorSupport/ensureType.js";import{a as T}from"../chunks/vec32.js";import{create as L}from"../core/libs/gl-matrix-2/factories/vec3f64.js";import j from"../layers/Layer.js";import{ensureType as C,clonePreservingTiledLayers as _}from"../support/basemapUtils.js";import{TaskPriority as E}from"../views/support/Scheduler.js";import{SlideThumbnail as S}from"../webdoc/support/SlideThumbnail.js";import{timeExtent as k}from"../webdoc/support/timeProperties.js";import U from"./SunLighting.js";import V from"./VirtualLighting.js";import x from"./support/Description.js";import{SlideEnvironment as I}from"./support/SlideEnvironment.js";import D from"./support/SlideGround.js";import{SlideVisibleLayer as R}from"./support/SlideVisibleLayer.js";import A from"./support/Title.js";let P=0;const q=o.ofType(R),B=["caption","cover","none"];let M=class extends(r(a)){constructor(e){super(e),this.id=Date.now().toString(16)+"-slide-"+P++,this.title=new A,this.description=new x,this.hidden=!1,this.thumbnail=new S,this.viewpoint=null,this.basemap=null,this.ground=null,this.layout="none",this.environment=new I,this.timeExtent=null,this.visibleLayers=new q}destroy(){this.visibleLayers.removeAll(),this.basemap=null,this.thumbnail=m(this.thumbnail),this.description=null,this.title=null,this.thumbnail=null}castTitle(e){return"string"==typeof e?new A({text:e}):f(A,e)}castDescription(e){return"string"==typeof e?new x({text:e}):f(x,e)}castThumbnail(e){return"string"==typeof e?new S({url:e}):f(S,e)}castBasemap(e){return C(e)}set visibleLayers(e){this._set("visibleLayers",s(e,this._get("visibleLayers"),q))}castVisibleLayers(e){return e&&"function"==typeof e.map?e.map((e=>{if("string"==typeof e)return{id:e};if(e instanceof j){const t=G(e);return{id:e.id,sublayerIds:t}}return e.id?{id:e.id,sublayerIds:"sublayerIds"in e?e.sublayerIds:void 0}:(l.getLogger(this).warn('Invalid visible layer, expected { id }, Layer or "id"'),e)})):null}async _updateVisibleLayersFrom(e){const t=[];await Promise.allSettled(this._getLayers(e.map).map((i=>e.whenLayerView(i).then((e=>{if(e.visible){const n=G(i);t.push(new R({id:e.layer.id,sublayerIds:n}))}})))).toArray()),this.visibleLayers.removeAll(),this.visibleLayers.addMany(t)}updateFrom(e,t){const i={format:"png",quality:80,width:120,height:75,disableDecorations:!0,...t?.screenshot};return e.when((()=>(this.viewpoint=e.viewpoint.clone(),this.environment.lighting="virtual"===e.environment.lighting.type?V.prototype.clone.apply(e.environment.lighting):U.prototype.clone.apply(e.environment.lighting),this.environment.weather=e.environment.weather.clone(),this.basemap=e.map.basemap&&e.map.basemap.clone()||null,this.ground=e.map.ground?D.fromGround(e.map.ground):null,this.timeExtent=e.timeExtent?.clone()??null,this._updateVisibleLayersFrom(e)))).then((()=>e.takeScreenshot(i))).then((e=>(this.thumbnail=new S({url:e.dataUrl}),this)))}async applyTo(e,t){null!=this._applyToController&&this._applyToController.abort();let i=new AbortController;this._applyToController=i;const r=h(t,(()=>i?.abort())),o=()=>{this._applyToController===i&&(this._applyToController=null),i=null,r?.remove()};try{await y((()=>e.ready),i.signal)}catch(c){throw o(),c}if(i.signal.aborted)throw o(),d();const s=e.resourceController.scheduler.registerTask(E.SLIDE);let a=!1;const l={animate:!0,...t,signal:this._applyToController.signal},p=async()=>{await Promise.all([s.schedule((async()=>a=await this._setViewpointOfInterest(e,l))),s.schedule((()=>this._applyBasemap(e,l)),l.signal)]),await this._loadLayersWithSublayerVisibility(e),await Promise.all([s.schedule((()=>this._applyLayerVisibility(e)),l.signal),s.schedule((()=>this._applyGround(e)),l.signal),s.schedule((()=>this._applyViewpoint(e,l)),l.signal),s.schedule((()=>e.timeExtent=this.timeExtent?.clone()??null),l.signal)]),await s.schedule((()=>e.environment.weather=this.environment.weather.clone()))},m=await n(e.addUpdatingPromise(p()));if(a&&(e.contentCamera=null),s.remove(),o(),!1===m.ok)throw m.error;return this}async _applyBasemap(e,t){if(this.basemap){try{await this.basemap.load(t)}catch(i){if(u(i))throw i}e.map.basemap=_(this.basemap,e.map.basemap)}}_applyGround(e){this.ground&&(e.map.ground=this.ground.cloneAndApplyTo(e.map.ground))}_getLayers(e){const t=new o;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=>{const t=this.visibleLayers.find((t=>t.id===e.id))?.sublayerIds;return t?e.load():null})))}_applyLayerVisibility(e){if(!this.visibleLayers)return;this._getLayers(e.map).forEach((e=>{const t=this.visibleLayers.find((t=>t.id===e.id));e.visible=null!=t;const i=t?.sublayerIds,n=F(e);i&&n&&n.forEach((e=>e.visible=i.includes(e.id)))}))}async _setViewpointOfInterest(e,t){if(e.state.fixedContentCamera||!this.viewpoint||t?.ignoreViewpoint||!t?.useDestinationCamera)return!1;const{toCameraAsync:i}=await import("../views/3d/support/viewpointUtils.js"),n=await i(e,this.viewpoint);return e.contentCamera=n,null!=n}async _applyViewpoint(e,t){if(this._applyCachedCameraTrackingEnabled(e),this.viewpoint&&!t.ignoreViewpoint){null!=this.viewpoint.camera&&(this.viewpoint.camera.fov=e.camera.fov);const i=this.environment.lighting;if(t.animate&&"sun"===i.type&&i.date)return this._animateToLighting(e,t);t.animate&&(e.environment.applyLighting(i.clone()),await e.goTo(this.viewpoint,t)),e.viewpoint=this.viewpoint}e.environment.applyLighting(this.environment.lighting.clone())}async _animateToLighting(e,t){let i=null;"virtual"!==e.environment.lighting.type&&"virtual"!==this.environment.lighting.type&&("global"===e.viewingMode&&(i=this._animateLightingWithCamera(e,e.environment.lighting,this.environment.lighting)),e.environment.cachedCameraTrackingEnabled=e.environment.lighting.cameraTrackingEnabled,e.environment.lighting.cameraTrackingEnabled=!1),e.environment.lighting.directShadowsEnabled=this.environment.lighting.directShadowsEnabled,"virtual"===this.environment.lighting.type||"virtual"===e.environment.lighting.type?(e.environment.applyLighting(this.environment.lighting.clone()),"virtual"!==e.environment.lighting.type&&(e.environment.cachedCameraTrackingEnabled=e.environment.lighting.cameraTrackingEnabled,e.environment.lighting.cameraTrackingEnabled=!1)):null!=this.environment.lighting.displayUTCOffset&&(e.environment.lighting.displayUTCOffset=this.environment.lighting.displayUTCOffset);return e.goTo(this.viewpoint,t).then((()=>{this._applyCachedCameraTrackingEnabled(e),e.environment.applyLighting(this.environment.lighting.clone())})).catch((t=>{throw null==e.animation&&this._applyCachedCameraTrackingEnabled(e),t})).finally((()=>{c(i)}))}_applyCachedCameraTrackingEnabled(e){null!=e.environment.cachedCameraTrackingEnabled&&(e.environment.lighting.cameraTrackingEnabled=e.environment.cachedCameraTrackingEnabled,e.environment.cachedCameraTrackingEnabled=null)}_getTime(e){return[e.getTime(),3600*e.getUTCHours()+60*e.getUTCMinutes()+e.getUTCSeconds()]}_setTime(e,t,i){return e.setTime(t),e.setUTCHours(i/3600),e.setUTCMinutes(i%3600/60),e.setUTCSeconds(i%3600%60),e}_animateLightingWithCamera(e,t,i){const n=new Date(t.date.toString()),[r,o]=this._getTime(n),[s,a]=this._getTime(i.date),l=H(o,a),p=e.renderCoordsHelper,m=L();p.toRenderCoords(e.camera.position,m);const c=L(),h=L();null!=this.viewpoint.camera&&p.toRenderCoords(this.viewpoint.camera.position,c);const d=new Date;return g((()=>e.camera),(e=>{p.toRenderCoords(e.position,h);const i=T(m,h),n=T(c,h);let a=0;i+n!==0&&(a=i/(i+n));const u=r+(s-r)*a,y=J(o,l*a);t.date=this._setTime(d,u,y)}))}static createFrom(e,t){return(new this).updateFrom(e,t)}};e([v({type:String,json:{write:{isRequired:!0}}})],M.prototype,"id",void 0),e([v({type:A,json:{default:()=>new A({text:""}),write:{isRequired:!0}}})],M.prototype,"title",void 0),e([b("title")],M.prototype,"castTitle",null),e([v({type:x,json:{write:{overridePolicy:e=>({enabled:!(!e||!e.text)})}}})],M.prototype,"description",void 0),e([b("description")],M.prototype,"castDescription",null),e([v({type:Boolean,nonNullable:!0,json:{write:!0,default:!1}})],M.prototype,"hidden",void 0),e([v({type:S,json:{default:()=>new S({url:""}),write:{isRequired:!0}}})],M.prototype,"thumbnail",void 0),e([b("thumbnail")],M.prototype,"castThumbnail",null),e([v({type:i,nonNullable:!0,json:{write:{isRequired:!0}}})],M.prototype,"viewpoint",void 0),e([v({type:t,json:{read:{source:"baseMap"},write:{target:"baseMap"}}})],M.prototype,"basemap",void 0),e([b("basemap")],M.prototype,"castBasemap",null),e([v({type:D,json:{write:!0}})],M.prototype,"ground",void 0),e([v({type:B,json:{write:!0,default:"none"},nonNullable:!0})],M.prototype,"layout",void 0),e([v({type:q,json:{write:{isRequired:!0}}})],M.prototype,"visibleLayers",null),e([b("visibleLayers")],M.prototype,"castVisibleLayers",null),e([v({type:I,json:{write:!0}})],M.prototype,"environment",void 0),e([v(k)],M.prototype,"timeExtent",void 0),M=e([w("esri.webscene.Slide")],M);const O=M;function F(e){if("building-scene"===e.type||"map-image"===e.type)return e.allSublayers.toArray()}function G(e){const t=F(e);if(t)return t.filter((e=>e.visible)).map((e=>e.id))}const N=86400,W=43200;function H(e,t){let i=t-e;return i>W&&(i-=N),i<-W&&(i+=N),i}function J(e,t){return p(e+t,N)}export{O as default};
5
+ import{_ as e}from"../chunks/tslib.es6.js";import t from"../Basemap.js";import i from"../Viewpoint.js";import{result as n}from"../core/asyncUtils.js";import{ClonableMixin as r}from"../core/Clonable.js";import o from"../core/Collection.js";import{referenceSetter as s}from"../core/collectionUtils.js";import{JSONSupport as a}from"../core/JSONSupport.js";import l from"../core/Logger.js";import{moduloPositive as p}from"../core/mathUtils.js";import{destroyMaybe as m,removeMaybe as c}from"../core/maybe.js";import{onAbortOrThrow as h,createAbortError as d,isAbortError as u}from"../core/promiseUtils.js";import{whenOnce as y,when as g}from"../core/reactiveUtils.js";import{property as v}from"../core/accessorSupport/decorators/property.js";import{cast as b}from"../core/accessorSupport/decorators/cast.js";import"../core/RandomLCG.js";import"../core/has.js";import{subclass as w}from"../core/accessorSupport/decorators/subclass.js";import{ensureType as f}from"../core/accessorSupport/ensureType.js";import{s as T}from"../chunks/vec32.js";import{create as L}from"../core/libs/gl-matrix-2/factories/vec3f64.js";import j from"../layers/Layer.js";import{ensureType as C,clonePreservingTiledLayers as _}from"../support/basemapUtils.js";import{TaskPriority as E}from"../views/support/Scheduler.js";import{SlideThumbnail as S}from"../webdoc/support/SlideThumbnail.js";import{timeExtent as k}from"../webdoc/support/timeProperties.js";import U from"./SunLighting.js";import V from"./VirtualLighting.js";import x from"./support/Description.js";import{SlideEnvironment as I}from"./support/SlideEnvironment.js";import D from"./support/SlideGround.js";import{SlideVisibleLayer as R}from"./support/SlideVisibleLayer.js";import A from"./support/Title.js";let P=0;const q=o.ofType(R),B=["caption","cover","none"];let M=class extends(r(a)){constructor(e){super(e),this.id=Date.now().toString(16)+"-slide-"+P++,this.title=new A,this.description=new x,this.hidden=!1,this.thumbnail=new S,this.viewpoint=null,this.basemap=null,this.ground=null,this.layout="none",this.environment=new I,this.timeExtent=null,this.visibleLayers=new q}destroy(){this.visibleLayers.removeAll(),this.basemap=null,this.thumbnail=m(this.thumbnail),this.description=null,this.title=null,this.thumbnail=null}castTitle(e){return"string"==typeof e?new A({text:e}):f(A,e)}castDescription(e){return"string"==typeof e?new x({text:e}):f(x,e)}castThumbnail(e){return"string"==typeof e?new S({url:e}):f(S,e)}castBasemap(e){return C(e)}set visibleLayers(e){this._set("visibleLayers",s(e,this._get("visibleLayers"),q))}castVisibleLayers(e){return e&&"function"==typeof e.map?e.map((e=>{if("string"==typeof e)return{id:e};if(e instanceof j){const t=G(e);return{id:e.id,sublayerIds:t}}return e.id?{id:e.id,sublayerIds:"sublayerIds"in e?e.sublayerIds:void 0}:(l.getLogger(this).warn('Invalid visible layer, expected { id }, Layer or "id"'),e)})):null}async _updateVisibleLayersFrom(e){const t=[];await Promise.allSettled(this._getLayers(e.map).map((i=>e.whenLayerView(i).then((e=>{if(e.visible){const n=G(i);t.push(new R({id:e.layer.id,sublayerIds:n}))}})))).toArray()),this.visibleLayers.removeAll(),this.visibleLayers.addMany(t)}updateFrom(e,t){const i={format:"png",quality:80,width:120,height:75,disableDecorations:!0,...t?.screenshot};return e.when((()=>(this.viewpoint=e.viewpoint.clone(),this.environment.lighting="virtual"===e.environment.lighting.type?V.prototype.clone.apply(e.environment.lighting):U.prototype.clone.apply(e.environment.lighting),this.environment.weather=e.environment.weather.clone(),this.basemap=e.map.basemap&&e.map.basemap.clone()||null,this.ground=e.map.ground?D.fromGround(e.map.ground):null,this.timeExtent=e.timeExtent?.clone()??null,this._updateVisibleLayersFrom(e)))).then((()=>e.takeScreenshot(i))).then((e=>(this.thumbnail=new S({url:e.dataUrl}),this)))}async applyTo(e,t){null!=this._applyToController&&this._applyToController.abort();let i=new AbortController;this._applyToController=i;const r=h(t,(()=>i?.abort())),o=()=>{this._applyToController===i&&(this._applyToController=null),i=null,r?.remove()};try{await y((()=>e.ready),i.signal)}catch(c){throw o(),c}if(i.signal.aborted)throw o(),d();const s=e.resourceController.scheduler.registerTask(E.SLIDE);let a=!1;const l={animate:!0,...t,signal:this._applyToController.signal},p=async()=>{await Promise.all([s.schedule((async()=>a=await this._setViewpointOfInterest(e,l))),s.schedule((()=>this._applyBasemap(e,l)),l.signal)]),await this._loadLayersWithSublayerVisibility(e),await Promise.all([s.schedule((()=>this._applyLayerVisibility(e)),l.signal),s.schedule((()=>this._applyGround(e)),l.signal),s.schedule((()=>this._applyViewpoint(e,l)),l.signal),s.schedule((()=>e.timeExtent=this.timeExtent?.clone()??null),l.signal)]),await s.schedule((()=>e.environment.weather=this.environment.weather.clone()))},m=await n(e.addUpdatingPromise(p()));if(a&&(e.contentCamera=null),s.remove(),o(),!1===m.ok)throw m.error;return this}async _applyBasemap(e,t){if(this.basemap){try{await this.basemap.load(t)}catch(i){if(u(i))throw i}e.map.basemap=_(this.basemap,e.map.basemap)}}_applyGround(e){this.ground&&(e.map.ground=this.ground.cloneAndApplyTo(e.map.ground))}_getLayers(e){const t=new o;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=>{const t=this.visibleLayers.find((t=>t.id===e.id))?.sublayerIds;return t?e.load():null})))}_applyLayerVisibility(e){if(!this.visibleLayers)return;this._getLayers(e.map).forEach((e=>{const t=this.visibleLayers.find((t=>t.id===e.id));e.visible=null!=t;const i=t?.sublayerIds,n=F(e);i&&n&&n.forEach((e=>e.visible=i.includes(e.id)))}))}async _setViewpointOfInterest(e,t){if(e.state.fixedContentCamera||!this.viewpoint||t?.ignoreViewpoint||!t?.useDestinationCamera)return!1;const{toCameraAsync:i}=await import("../views/3d/support/viewpointUtils.js"),n=await i(e,this.viewpoint);return e.contentCamera=n,null!=n}async _applyViewpoint(e,t){if(this._applyCachedCameraTrackingEnabled(e),this.viewpoint&&!t.ignoreViewpoint){null!=this.viewpoint.camera&&(this.viewpoint.camera.fov=e.camera.fov);const i=this.environment.lighting;if(t.animate&&"sun"===i.type&&i.date)return this._animateToLighting(e,t);t.animate&&(e.environment.applyLighting(i.clone()),await e.goTo(this.viewpoint,t)),e.viewpoint=this.viewpoint}e.environment.applyLighting(this.environment.lighting.clone())}async _animateToLighting(e,t){let i=null;"virtual"!==e.environment.lighting.type&&"virtual"!==this.environment.lighting.type&&("global"===e.viewingMode&&(i=this._animateLightingWithCamera(e,e.environment.lighting,this.environment.lighting)),e.environment.cachedCameraTrackingEnabled=e.environment.lighting.cameraTrackingEnabled,e.environment.lighting.cameraTrackingEnabled=!1),e.environment.lighting.directShadowsEnabled=this.environment.lighting.directShadowsEnabled,"virtual"===this.environment.lighting.type||"virtual"===e.environment.lighting.type?(e.environment.applyLighting(this.environment.lighting.clone()),"virtual"!==e.environment.lighting.type&&(e.environment.cachedCameraTrackingEnabled=e.environment.lighting.cameraTrackingEnabled,e.environment.lighting.cameraTrackingEnabled=!1)):null!=this.environment.lighting.displayUTCOffset&&(e.environment.lighting.displayUTCOffset=this.environment.lighting.displayUTCOffset);return e.goTo(this.viewpoint,t).then((()=>{this._applyCachedCameraTrackingEnabled(e),e.environment.applyLighting(this.environment.lighting.clone())})).catch((t=>{throw null==e.animation&&this._applyCachedCameraTrackingEnabled(e),t})).finally((()=>{c(i)}))}_applyCachedCameraTrackingEnabled(e){null!=e.environment.cachedCameraTrackingEnabled&&(e.environment.lighting.cameraTrackingEnabled=e.environment.cachedCameraTrackingEnabled,e.environment.cachedCameraTrackingEnabled=null)}_getTime(e){return[e.getTime(),3600*e.getUTCHours()+60*e.getUTCMinutes()+e.getUTCSeconds()]}_setTime(e,t,i){return e.setTime(t),e.setUTCHours(i/3600),e.setUTCMinutes(i%3600/60),e.setUTCSeconds(i%3600%60),e}_animateLightingWithCamera(e,t,i){const n=new Date(t.date.toString()),[r,o]=this._getTime(n),[s,a]=this._getTime(i.date),l=H(o,a),p=e.renderCoordsHelper,m=L();p.toRenderCoords(e.camera.position,m);const c=L(),h=L();null!=this.viewpoint.camera&&p.toRenderCoords(this.viewpoint.camera.position,c);const d=new Date;return g((()=>e.camera),(e=>{p.toRenderCoords(e.position,h);const i=T(m,h),n=T(c,h);let a=0;i+n!==0&&(a=i/(i+n));const u=r+(s-r)*a,y=J(o,l*a);t.date=this._setTime(d,u,y)}))}static createFrom(e,t){return(new this).updateFrom(e,t)}};e([v({type:String,json:{write:{isRequired:!0}}})],M.prototype,"id",void 0),e([v({type:A,json:{default:()=>new A({text:""}),write:{isRequired:!0}}})],M.prototype,"title",void 0),e([b("title")],M.prototype,"castTitle",null),e([v({type:x,json:{write:{overridePolicy:e=>({enabled:!(!e||!e.text)})}}})],M.prototype,"description",void 0),e([b("description")],M.prototype,"castDescription",null),e([v({type:Boolean,nonNullable:!0,json:{write:!0,default:!1}})],M.prototype,"hidden",void 0),e([v({type:S,json:{default:()=>new S({url:""}),write:{isRequired:!0}}})],M.prototype,"thumbnail",void 0),e([b("thumbnail")],M.prototype,"castThumbnail",null),e([v({type:i,nonNullable:!0,json:{write:{isRequired:!0}}})],M.prototype,"viewpoint",void 0),e([v({type:t,json:{read:{source:"baseMap"},write:{target:"baseMap"}}})],M.prototype,"basemap",void 0),e([b("basemap")],M.prototype,"castBasemap",null),e([v({type:D,json:{write:!0}})],M.prototype,"ground",void 0),e([v({type:B,json:{write:!0,default:"none"},nonNullable:!0})],M.prototype,"layout",void 0),e([v({type:q,json:{write:{isRequired:!0}}})],M.prototype,"visibleLayers",null),e([b("visibleLayers")],M.prototype,"castVisibleLayers",null),e([v({type:I,json:{write:!0}})],M.prototype,"environment",void 0),e([v(k)],M.prototype,"timeExtent",void 0),M=e([w("esri.webscene.Slide")],M);const O=M;function F(e){if("building-scene"===e.type||"map-image"===e.type)return e.allSublayers.toArray()}function G(e){const t=F(e);if(t)return t.filter((e=>e.visible)).map((e=>e.id))}const N=86400,W=43200;function H(e,t){let i=t-e;return i>W&&(i-=N),i<-W&&(i+=N),i}function J(e,t){return p(e+t,N)}export{O as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.31/esri/copyright.txt for details.
4
4
  */
5
- import{getCustoms as t,format as e,parse as i}from"../../../core/number.js";import{getLocale as n}from"../../../intl/locale.js";import a from"./Format.js";const s=t().decimal,r={N:"north",S:"south",E:"east",W:"west"},o=`°${"‎"}`,u=new RegExp(`-?\\d+[\\.|\\${s}]?\\d*`),d=/^[\\0]+(?=\d)/;function c(e,i){const a="ar"===n(),s=e.abbreviatedDirections.north,u=e.abbreviatedDirections.south,d=e.abbreviatedDirections.east,c=e.abbreviatedDirections.west,p=t().decimal,h={[s]:"N",[u]:"S",[d]:"E",[c]:"W"},g=new RegExp(`-?\\d+[\\.|\\${p}]?\\d*`),P=new RegExp(`N|S|${s}|${u}`,"i"),$=new RegExp(`E|W|${d}|${c}`,"i"),m={ddm:`Y${o} A'${e.abbreviatedDirections.north}, X${o} B'${e.abbreviatedDirections.east}`,dms:`Y${o} A' B"${e.abbreviatedDirections.north}, X${o} C' D"${e.abbreviatedDirections.east}`,dd:`Y${o}${e.abbreviatedDirections.north}, X${o}${e.abbreviatedDirections.east}`,xy:`X${o}, Y${o}`,basemap:"X, Y"},w={ddm:`${e.abbreviatedDirections.north}${o}Y 'A ,${e.abbreviatedDirections.east}${o}X 'B`,dms:`${e.abbreviatedDirections.north}${o}Y 'A "B ,${e.abbreviatedDirections.east}${o}X 'C "D`,dd:`${e.abbreviatedDirections.north}${o}Y ,${e.abbreviatedDirections.east}${o}X`,xy:`X${o} ,Y${o}`,basemap:"X ,Y"},D=t=>null!=t&&Object.keys(m).includes(t),E=new RegExp(`\\d{1,2}[\\.|\\${p}]?\\d*`,"i"),v=new RegExp(`\\d{1,3}[\\.|\\${p}]?\\d*`,"i");i.forEach((t=>{const{name:i}=t;if("dd"===i?t.coordinateSegments=[{alias:"Y",description:"degrees latitude",searchPattern:E,substitution:{input:t=>b(t),output:t=>l(t)}},{alias:e.abbreviatedDirections.north,description:"north/south indicator",searchPattern:P,substitution:{input:t=>h[t],output:t=>e.abbreviatedDirections[r[t]]}},{alias:"X",description:"degrees longitude",searchPattern:v,substitution:{input:t=>b(t),output:t=>l(t)}},{alias:e.abbreviatedDirections.east,description:"east/west indicator",searchPattern:$,substitution:{input:t=>h[t],output:t=>e.abbreviatedDirections[r[t]]}}]:"ddm"===i?t.coordinateSegments=[{alias:"Y",description:"degrees latitude",searchPattern:E,substitution:{input:t=>b(t),output:t=>l(t)}},{alias:"A",description:"minutes latitude",searchPattern:E,substitution:{input:t=>b(t),output:t=>l(t)}},{alias:e.abbreviatedDirections.north,description:"north/south indicator",searchPattern:P,substitution:{input:t=>h[t],output:t=>e.abbreviatedDirections[r[t]]}},{alias:"X",description:"degrees longitude",searchPattern:v,substitution:{input:t=>b(t),output:t=>l(t)}},{alias:"B",description:"minutes longitude",searchPattern:E,substitution:{input:t=>b(t),output:t=>l(t)}},{alias:e.abbreviatedDirections.east,description:"east/west indicator",searchPattern:$,substitution:{input:t=>h[t],output:t=>e.abbreviatedDirections[r[t]]}}]:"dms"===i?t.coordinateSegments=[{alias:"Y",description:"degrees latitude",searchPattern:E,substitution:{input:t=>b(t),output:t=>l(t)}},{alias:"A",description:"minutes latitude",searchPattern:E,substitution:{input:t=>b(t),output:t=>l(t)}},{alias:"B",description:"seconds latitude",searchPattern:E,substitution:{input:t=>b(t),output:t=>l(t)}},{alias:e.abbreviatedDirections.north,description:"north/south indicator",searchPattern:P,substitution:{input:t=>h[t],output:t=>e.abbreviatedDirections[r[t]]}},{alias:"X",description:"degrees longitude",searchPattern:v,substitution:{input:t=>b(t),output:t=>l(t)}},{alias:"C",description:"minutes longitude",searchPattern:E,substitution:{input:t=>b(t),output:t=>l(t)}},{alias:"D",description:"seconds longitude",searchPattern:E,substitution:{input:t=>b(t),output:t=>l(t)}},{alias:e.abbreviatedDirections.east,description:"east/west indicator",searchPattern:$,substitution:{input:t=>h[t],output:t=>e.abbreviatedDirections[r[t]]}}]:("xy"===t.name||"basemap"===t.name)&&(t.coordinateSegments=[{alias:"X",description:"easting",searchPattern:g,substitution:{input:t=>b(t),output:t=>l(t)}},{alias:"Y",description:"northing",searchPattern:g,substitution:{input:t=>b(t),output:t=>l(t)}}]),D(i)){const e=a?w[i]:m[i];t.defaultPattern=e,t.currentPattern=e}}))}function p(){const t=new RegExp("N|S","i"),e=new RegExp("E|W","i");return[new a({name:"basemap",coordinateSegments:[{alias:"X",description:"easting",searchPattern:u,substitution:{input:t=>b(t),output:t=>l(t)}},{alias:"Y",description:"northing",searchPattern:u,substitution:{input:t=>b(t),output:t=>l(t)}}],defaultPattern:"X, Y",viewModel:null}),new a({name:"dd",coordinateSegments:[{alias:"Y",description:"degrees latitude",searchPattern:new RegExp(`\\d{1,2}[\\.|\\${s}]?\\d*(?=\\D*?[N|S])`,"i"),substitution:{input:t=>b(t),output:t=>l(t)}},{alias:"N",description:"north/south indicator",searchPattern:t},{alias:"X",description:"degrees longitude",searchPattern:new RegExp(`\\d{1,3}[\\.|\\${s}]?\\d*(?=\\D*?[E|W|])`,"i"),substitution:{input:t=>b(t),output:t=>l(t)}},{alias:"E",description:"east/west indicator",searchPattern:e}],defaultPattern:`Y${o}N, X${o}E`,viewModel:null}),new a({name:"ddm",coordinateSegments:[{alias:"Y",description:"degrees latitude",searchPattern:new RegExp("\\d{1,2}(?=.*?\\s+.*?[N|S])","i"),substitution:{input:t=>b(t),output:t=>l(t)}},{alias:"A",description:"minutes latitude",searchPattern:new RegExp(`\\d{1,2}[\\.\\${s}]?\\d*(?=.*?[N|S])`,"i"),substitution:{input:t=>b(t),output:t=>l(t)}},{alias:"N",description:"north/south indicator",searchPattern:t},{alias:"X",description:"degrees longitude",searchPattern:new RegExp("\\d{1,3}(?=\\D*?\\s+.*?[E|W])","i"),substitution:{input:t=>b(t),output:t=>l(t)}},{alias:"B",description:"minutes longitude",searchPattern:new RegExp(`\\d{1,2}[\\.|\\|${s}]?\\d*(?=.*?[E|W])`,"i"),substitution:{input:t=>b(t),output:t=>l(t)}},{alias:"E",description:"east/west indicator",searchPattern:e}],defaultPattern:`Y${o} A'N, X${o} B'E`,viewModel:null}),new a({name:"dms",coordinateSegments:[{alias:"Y",description:"degrees latitude",searchPattern:new RegExp("\\d{1,2}(?=.*?\\s+.*?[N|S])","i"),substitution:{input:t=>b(t),output:t=>l(t)}},{alias:"A",description:"minutes latitude",searchPattern:new RegExp("\\d{1,2}(?=.*?[N|S])","i"),substitution:{input:t=>b(t),output:t=>l(t)}},{alias:"B",description:"seconds latitude",searchPattern:new RegExp(`\\d{1,2}[\\.|\\${s}]?\\d*(?=.*?[N|S])`,"i"),substitution:{input:t=>b(t),output:t=>l(t)}},{alias:"N",description:"north/south indicator",searchPattern:t},{alias:"X",description:"degrees longitude",searchPattern:new RegExp("\\d{1,3}(?=.*?\\s+.*?[E|W])","i"),substitution:{input:t=>b(t),output:t=>l(t)}},{alias:"C",description:"minutes longitude",searchPattern:new RegExp("\\d{1,2}(?=.*?[E|W])","i"),substitution:{input:t=>b(t),output:t=>l(t)}},{alias:"D",description:"seconds longitude",searchPattern:new RegExp(`\\d{1,2}[\\.|\\${s}]?\\d*(?=.*?[E|W])`,"i"),substitution:{input:t=>b(t),output:t=>l(t)}},{alias:"E",description:"east/west indicator",searchPattern:e}],defaultPattern:`Y${o} A' B"N, X${o} C' D"E`,viewModel:null}),new a({name:"xy",coordinateSegments:[{alias:"X",description:"longitude",searchPattern:u,substitution:{input:t=>b(t),output:t=>l(t)}},{alias:"Y",description:"latitude",searchPattern:u,substitution:{input:t=>b(t),output:t=>l(t)}}],defaultPattern:`X${o}, Y${o}`,viewModel:null}),new a({name:"mgrs",coordinateSegments:[{alias:"Z",description:"grid zone",searchPattern:/\d{1,2}\w|[abyz]/i},{alias:"S",description:"grid square",searchPattern:/\w{2}/},{alias:"X",description:"easting",searchPattern:/^\d{5}(?=.?\d{5}$)|^\d{4}(?=.?\d{4}$)|^\d{3}(?=.?\d{3}$)|^\d{2}(?=.?\d{2}$)|^\d(?=.?\d$)/},{alias:"Y",description:"northing",searchPattern:/^\d{1,5}/}],defaultPattern:"Z S X Y",viewModel:null}),new a({name:"usng",coordinateSegments:[{alias:"Z",description:"grid zone",searchPattern:/\d{1,2}\w|[abyz]/i},{alias:"S",description:"grid square",searchPattern:/\w{2}/},{alias:"X",description:"easting",searchPattern:/^\d{5}(?=.?\d{5}$)|^\d{4}(?=.?\d{4}$)|^\d{3}(?=.?\d{3}$)|^\d{2}(?=.?\d{2}$)|^\d(?=.?\d$)/},{alias:"Y",description:"northing",searchPattern:/^\d{1,5}/}],defaultPattern:"Z S X Y",viewModel:null}),new a({name:"utm",coordinateSegments:[{alias:"Z",description:"zone number",searchPattern:/\d{1,2}|[abyz]/i},{alias:"B",description:"latitude band",searchPattern:/^\D/},{alias:"X",description:"easting",searchPattern:/\d{1,7}(?=\s*\d{7}$)/},{alias:"Y",description:"northing",searchPattern:/\d{1,7}/}],defaultPattern:"ZB X Y",viewModel:null})]}function l(t){const i=t.match(d),n=i?i[0]:"",a=t.includes(".")?t.split(".")[1].length:0;return n+e(Number(t),{pattern:"###0.###",places:a,round:-1})}function b(t){return i(t)}export{p as generateDefaultFormats,c as setDefaultPatterns};
5
+ import{getCustoms as t,format as e,parse as i}from"../../../core/number.js";import{getLocale as n}from"../../../intl/locale.js";import a from"./Format.js";const s=t().decimal,r={N:"north",S:"south",E:"east",W:"west"},o=`°${"‎"}`,u=new RegExp(`-?\\d+[\\.|\\${s}]?\\d*`),d=/^[\\0]+(?=\d)/;function c(e,i){const a="ar"===n(),s=e.abbreviatedDirections.north,u=e.abbreviatedDirections.south,d=e.abbreviatedDirections.east,c=e.abbreviatedDirections.west,p=t().decimal,h={[s]:"N",[u]:"S",[d]:"E",[c]:"W"},g=new RegExp(`-?\\d+[\\.|\\${p}]?\\d*`),P=new RegExp(`N|S|${s}|${u}`,"i"),$=new RegExp(`E|W|${d}|${c}`,"i"),m={ddm:`Y${o} A'${e.abbreviatedDirections.north}, X${o} B'${e.abbreviatedDirections.east}`,dms:`Y${o} A' B"${e.abbreviatedDirections.north}, X${o} C' D"${e.abbreviatedDirections.east}`,dd:`Y${o}${e.abbreviatedDirections.north}, X${o}${e.abbreviatedDirections.east}`,xy:`X${o}, Y${o}`,basemap:"X, Y"},w={ddm:`${e.abbreviatedDirections.north}${o}Y 'A ,${e.abbreviatedDirections.east}${o}X 'B`,dms:`${e.abbreviatedDirections.north}${o}Y 'A "B ,${e.abbreviatedDirections.east}${o}X 'C "D`,dd:`${e.abbreviatedDirections.north}${o}Y ,${e.abbreviatedDirections.east}${o}X`,xy:`X${o} ,Y${o}`,basemap:"X ,Y"},D=t=>null!=t&&Object.keys(m).includes(t),E=new RegExp(`\\d{1,2}[\\.|\\${p}]?\\d*`,"i"),v=new RegExp(`\\d{1,3}[\\.|\\${p}]?\\d*`,"i");i.forEach((t=>{const{name:i}=t;if("dd"===i?t.coordinateSegments=[{alias:"Y",description:"degrees latitude",searchPattern:E,substitution:{input:t=>b(t),output:t=>l(t)}},{alias:e.abbreviatedDirections.north,description:"north/south indicator",searchPattern:P,substitution:{input:t=>h[t],output:t=>e.abbreviatedDirections[r[t]]}},{alias:"X",description:"degrees longitude",searchPattern:v,substitution:{input:t=>b(t),output:t=>l(t)}},{alias:e.abbreviatedDirections.east,description:"east/west indicator",searchPattern:$,substitution:{input:t=>h[t],output:t=>e.abbreviatedDirections[r[t]]}}]:"ddm"===i?t.coordinateSegments=[{alias:"Y",description:"degrees latitude",searchPattern:E,substitution:{input:t=>b(t),output:t=>l(t)}},{alias:"A",description:"minutes latitude",searchPattern:E,substitution:{input:t=>b(t),output:t=>l(t)}},{alias:e.abbreviatedDirections.north,description:"north/south indicator",searchPattern:P,substitution:{input:t=>h[t],output:t=>e.abbreviatedDirections[r[t]]}},{alias:"X",description:"degrees longitude",searchPattern:v,substitution:{input:t=>b(t),output:t=>l(t)}},{alias:"B",description:"minutes longitude",searchPattern:E,substitution:{input:t=>b(t),output:t=>l(t)}},{alias:e.abbreviatedDirections.east,description:"east/west indicator",searchPattern:$,substitution:{input:t=>h[t],output:t=>e.abbreviatedDirections[r[t]]}}]:"dms"===i?t.coordinateSegments=[{alias:"Y",description:"degrees latitude",searchPattern:E,substitution:{input:t=>b(t),output:t=>l(t)}},{alias:"A",description:"minutes latitude",searchPattern:E,substitution:{input:t=>b(t),output:t=>l(t)}},{alias:"B",description:"seconds latitude",searchPattern:E,substitution:{input:t=>b(t),output:t=>l(t)}},{alias:e.abbreviatedDirections.north,description:"north/south indicator",searchPattern:P,substitution:{input:t=>h[t],output:t=>e.abbreviatedDirections[r[t]]}},{alias:"X",description:"degrees longitude",searchPattern:v,substitution:{input:t=>b(t),output:t=>l(t)}},{alias:"C",description:"minutes longitude",searchPattern:E,substitution:{input:t=>b(t),output:t=>l(t)}},{alias:"D",description:"seconds longitude",searchPattern:E,substitution:{input:t=>b(t),output:t=>l(t)}},{alias:e.abbreviatedDirections.east,description:"east/west indicator",searchPattern:$,substitution:{input:t=>h[t],output:t=>e.abbreviatedDirections[r[t]]}}]:("xy"===t.name||"basemap"===t.name)&&(t.coordinateSegments=[{alias:"X",description:"easting",searchPattern:g,substitution:{input:t=>b(t),output:t=>l(t)}},{alias:"Y",description:"northing",searchPattern:g,substitution:{input:t=>b(t),output:t=>l(t)}}]),D(i)){const e=a?w[i]:m[i];t.defaultPattern=e,t.currentPattern=e}}))}function p(){const t=new RegExp("N|S","i"),e=new RegExp("E|W","i");return[new a({name:"basemap",coordinateSegments:[{alias:"X",description:"easting",searchPattern:u,substitution:{input:t=>b(t),output:t=>l(t)}},{alias:"Y",description:"northing",searchPattern:u,substitution:{input:t=>b(t),output:t=>l(t)}}],defaultPattern:"X, Y",viewModel:null}),new a({name:"dd",coordinateSegments:[{alias:"Y",description:"degrees latitude",searchPattern:new RegExp(`\\d{1,2}[\\.|\\${s}]?\\d*(?=\\D*?[N|S])`,"i"),substitution:{input:t=>b(t),output:t=>l(t)}},{alias:"N",description:"north/south indicator",searchPattern:t},{alias:"X",description:"degrees longitude",searchPattern:new RegExp(`\\d{1,3}[\\.|\\${s}]?\\d*(?=\\D*?[E|W|])`,"i"),substitution:{input:t=>b(t),output:t=>l(t)}},{alias:"E",description:"east/west indicator",searchPattern:e}],defaultPattern:`Y${o}N, X${o}E`,viewModel:null}),new a({name:"ddm",coordinateSegments:[{alias:"Y",description:"degrees latitude",searchPattern:new RegExp("\\d{1,2}(?=.*?\\s+.*?[N|S])","i"),substitution:{input:t=>b(t),output:t=>l(t)}},{alias:"A",description:"minutes latitude",searchPattern:new RegExp(`\\d{1,2}[\\.\\${s}]?\\d*(?=.*?[N|S])`,"i"),substitution:{input:t=>b(t),output:t=>l(t)}},{alias:"N",description:"north/south indicator",searchPattern:t},{alias:"X",description:"degrees longitude",searchPattern:new RegExp("\\d{1,3}(?=\\D*?\\s+.*?[E|W])","i"),substitution:{input:t=>b(t),output:t=>l(t)}},{alias:"B",description:"minutes longitude",searchPattern:new RegExp(`\\d{1,2}[\\.|\\|${s}]?\\d*(?=.*?[E|W])`,"i"),substitution:{input:t=>b(t),output:t=>l(t)}},{alias:"E",description:"east/west indicator",searchPattern:e}],defaultPattern:`Y${o} A'N, X${o} B'E`,viewModel:null}),new a({name:"dms",coordinateSegments:[{alias:"Y",description:"degrees latitude",searchPattern:new RegExp("\\d{1,2}(?=.*?\\s+.*?[N|S])","i"),substitution:{input:t=>b(t),output:t=>l(t)}},{alias:"A",description:"minutes latitude",searchPattern:new RegExp("\\d{1,2}(?=.*?[N|S])","i"),substitution:{input:t=>b(t),output:t=>l(t)}},{alias:"B",description:"seconds latitude",searchPattern:new RegExp(`\\d{1,2}[\\.|\\${s}]?\\d*(?=.*?[N|S])`,"i"),substitution:{input:t=>b(t),output:t=>l(t)}},{alias:"N",description:"north/south indicator",searchPattern:t},{alias:"X",description:"degrees longitude",searchPattern:new RegExp("\\d{1,3}(?=.*?\\s+.*?[E|W])","i"),substitution:{input:t=>b(t),output:t=>l(t)}},{alias:"C",description:"minutes longitude",searchPattern:new RegExp("\\d{1,2}(?=.*?[E|W])","i"),substitution:{input:t=>b(t),output:t=>l(t)}},{alias:"D",description:"seconds longitude",searchPattern:new RegExp(`\\d{1,2}[\\.|\\${s}]?\\d*(?=.*?[E|W])`,"i"),substitution:{input:t=>b(t),output:t=>l(t)}},{alias:"E",description:"east/west indicator",searchPattern:e}],defaultPattern:`Y${o} A' B"N, X${o} C' D"E`,viewModel:null}),new a({name:"xy",coordinateSegments:[{alias:"X",description:"longitude",searchPattern:u,substitution:{input:t=>b(t),output:t=>l(t)}},{alias:"Y",description:"latitude",searchPattern:u,substitution:{input:t=>b(t),output:t=>l(t)}}],defaultPattern:`X${o}, Y${o}`,viewModel:null}),new a({name:"mgrs",coordinateSegments:[{alias:"Z",description:"grid zone",searchPattern:/\d{1,2}\w|[abyz]/i},{alias:"S",description:"grid square",searchPattern:/\w{2}/},{alias:"X",description:"easting",searchPattern:/^\d{5}(?=.?\d{5}$)|^\d{4}(?=.?\d{4}$)|^\d{3}(?=.?\d{3}$)|^\d{2}(?=.?\d{2}$)|^\d(?=.?\d$)/},{alias:"Y",description:"northing",searchPattern:/^\d{1,5}/}],defaultPattern:"Z S X Y",viewModel:null}),new a({name:"usng",coordinateSegments:[{alias:"Z",description:"grid zone",searchPattern:/\d{1,2}\w|[abyz]/i},{alias:"S",description:"grid square",searchPattern:/\w{2}/},{alias:"X",description:"easting",searchPattern:/^\d{5}(?=.?\d{5}$)|^\d{4}(?=.?\d{4}$)|^\d{3}(?=.?\d{3}$)|^\d{2}(?=.?\d{2}$)|^\d(?=.?\d$)/},{alias:"Y",description:"northing",searchPattern:/^\d{1,5}/}],defaultPattern:"Z S X Y",viewModel:null}),new a({name:"utm",coordinateSegments:[{alias:"Z",description:"zone number",searchPattern:/\d{1,2}|[abyz]/i},{alias:"B",description:"latitude band",searchPattern:/^\D/},{alias:"X",description:"easting",searchPattern:/\d{1,7}(?=\s*\d{7}$)/},{alias:"Y",description:"northing",searchPattern:/\d{1,7}/}],defaultPattern:"ZB X Y",viewModel:null})]}function l(t){const i=t.match(d),n=i?i[0]:"",a=t.includes(".")?t.split(".")[1].length:0;return n+e(Number(t),{pattern:"###0.###",places:a,round:-1})}function b(t){return i(t)}export{o as degreeSymbol,p as generateDefaultFormats,c as setDefaultPatterns};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.31/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../chunks/tslib.es6.js";import t from"../../Color.js";import{handlesGroup as r}from"../../core/handleUtils.js";import{memoize as i}from"../../core/memoize.js";import{watch as o,on as n}from"../../core/reactiveUtils.js";import{union as s}from"../../core/SetUtils.js";import{getMetersPerVerticalUnitForSR as l}from"../../core/unitUtils.js";import{property as c}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{subclass as a}from"../../core/accessorSupport/decorators/subclass.js";import{s as u}from"../../chunks/vec32.js";import{create as p}from"../../core/libs/gl-matrix-2/factories/vec3f64.js";import{getReferenceEllipsoid as d}from"../../geometry/ellipsoidUtils.js";import{create as m,fromPoints as v}from"../../geometry/support/ray.js";import{GeometryDescriptor as y}from"../../layers/support/ElevationQuery.js";import{externalToInternalIntersectOptions as f}from"../../views/3d/support/hitTest.js";import{newIntersector as h}from"../../views/3d/webgl-engine/lib/Intersector.js";import{StoreResults as w}from"../../views/3d/webgl-engine/lib/IntersectorInterfaces.js";import{toGraphic as _}from"../../views/3d/webgl-engine/lib/intersectorUtilsConversions.js";import g from"./ElevationProfileLine.js";const j=2e5;let I=class extends g{constructor(e){super(e),this.type="view",this.color=new t("#cf4ccf"),this.viewVisualizationEnabled=!0,this.include=null,this.exclude=null,this.numSamplesForPreview=50,this.numSamplesPerChunk=25,this._getQueryElevationDependencies=i(((e,t,r,i,o,n,s)=>({inputGraphicUid:null!=e?x(e):null,visibleLayers:t,maxIntersectionDistance:r,intersectOptions:i,view:o,stationary:n,spatialReference:s}))),this._vecA=p(),this._vecB=p(),this._ray=m()}get minDemResolution(){const e=this._viewModel?.view;if(null==e||"3d"!==e.type)return null;const t=e.pointsOfInterest?.focus?.worldUnitsPerContentPixel;return null==t?null:t*l(e.spatialReference)}get queryElevationDependencies(){const e=this._view;return e?this._getQueryElevationDependencies(this._viewModel?.input,this._visibleLayers,this._maxIntersectionDistance,this._intersectOptions,e,e.stationary,e.spatialReference):null}get _visibleLayers(){return this._view?.map?.allLayers?.filter((e=>e.visible)).toArray()??[]}get _intersectOptions(){const e=this._view;if(null==e||e.destroyed)return{};const t=f(e,{include:this.include,exclude:this.exclude}),r=f(e,{exclude:this._pointCloudLayers});return t.exclude=s(t.exclude,r.exclude),t}get _pointCloudLayers(){const e=this._view;return null==e?[]:e.allLayerViews.toArray().filter((e=>"point-cloud"===e.layer?.type)).map((e=>e.layer))}get _view(){const e=this._viewModel?.view;return null!=e&&"3d"===e.type?e:null}get _maxIntersectionDistance(){const e=this._view;return e?.renderCoordsHelper?d(e.spatialReference).radius/e.renderCoordsHelper.unitInMeters:Number.POSITIVE_INFINITY}get _intersector(){const e=this._view;if(null==e)return null;const t=h(e.state.viewingMode),r=t.options;return r.hud=!1,r.invisibleTerrain=!1,r.backfacesTerrain=!1,r.selectionMode=!1,r.store=w.ALL,t}async queryElevation(e,{noDataValue:t,signal:r}){const i=this.queryElevationDependencies;if(null==i)throw new Error("ElevationProfileLineInput: no dependencies");const o=this._intersector;if(null==o)throw new Error("ElevationProfileLineInput: no view");const{intersectOptions:n,view:s,spatialReference:l}=i,c=s.renderCoordsHelper,a=s.sceneIntersectionHelper,p=this._vecA,d=this._vecA,m=this._vecB,f=this._ray;if(!l)return{geometry:e,noDataValue:t};const h=await y.fromGeometry(e).project(l,r);if(!h)return{geometry:e,noDataValue:t};const w=h.coordinates,_=w.length;for(let y=0;y<_;++y){const e=w[y];u(m,e.x,e.y,e.z??0),c.toRenderCoords(m,l,m),c.setAltitude(p,j,m);const r=v(p,m,f);a.computeIntersection(r,o,n,!0);const s=b(i,o.results.all);s?(s.getIntersectionPoint(d),c.fromRenderCoords(d,d,l),e.z=d[2]):e.z=t}return{geometry:h.export(),noDataValue:t}}attach(e){const t=()=>this._onChange();return r([super.attach(e),o((()=>this.queryElevationDependencies),t),n((()=>e.elevationProvider),"elevation-change",t,{onListenerAdd:t,onListenerRemove:t})])}};function b({view:e,inputGraphicUid:t,maxIntersectionDistance:r},i){for(const o of i){if(null!=o.distanceInRenderSpace&&o.distanceInRenderSpace>r)continue;const i=_(o,e);if(null==i||x(i)!==t)return o}return null}function x(e){if(e.layer&&"objectIdField"in e.layer){const t=e.attributes[e.layer.objectIdField];if(t)return`o-${e.layer.id}-${t}`}return`u-${e.uid}`}e([c({type:t,nonNullable:!0})],I.prototype,"color",void 0),e([c()],I.prototype,"viewVisualizationEnabled",void 0),e([c()],I.prototype,"include",void 0),e([c()],I.prototype,"exclude",void 0),e([c({readOnly:!0})],I.prototype,"minDemResolution",null),e([c()],I.prototype,"queryElevationDependencies",null),e([c()],I.prototype,"_visibleLayers",null),e([c()],I.prototype,"_intersectOptions",null),e([c()],I.prototype,"_pointCloudLayers",null),e([c()],I.prototype,"_view",null),e([c()],I.prototype,"_maxIntersectionDistance",null),e([c()],I.prototype,"_intersector",null),I=e([a("esri.widgets.ElevationProfile.ElevationProfileLineView")],I);const L=I;export{L as default};
5
+ import{_ as e}from"../../chunks/tslib.es6.js";import t from"../../Color.js";import{handlesGroup as r}from"../../core/handleUtils.js";import{memoize as i}from"../../core/memoize.js";import{watch as o,on as n}from"../../core/reactiveUtils.js";import{union as s}from"../../core/SetUtils.js";import{getMetersPerVerticalUnitForSR as l}from"../../core/unitUtils.js";import{property as c}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{subclass as a}from"../../core/accessorSupport/decorators/subclass.js";import{a as u}from"../../chunks/vec32.js";import{create as p}from"../../core/libs/gl-matrix-2/factories/vec3f64.js";import{getReferenceEllipsoid as d}from"../../geometry/ellipsoidUtils.js";import{create as m,fromPoints as v}from"../../geometry/support/ray.js";import{GeometryDescriptor as y}from"../../layers/support/ElevationQuery.js";import{externalToInternalIntersectOptions as f}from"../../views/3d/support/hitTest.js";import{newIntersector as h}from"../../views/3d/webgl-engine/lib/Intersector.js";import{StoreResults as w}from"../../views/3d/webgl-engine/lib/IntersectorInterfaces.js";import{toGraphic as _}from"../../views/3d/webgl-engine/lib/intersectorUtilsConversions.js";import g from"./ElevationProfileLine.js";const j=2e5;let I=class extends g{constructor(e){super(e),this.type="view",this.color=new t("#cf4ccf"),this.viewVisualizationEnabled=!0,this.include=null,this.exclude=null,this.numSamplesForPreview=50,this.numSamplesPerChunk=25,this._getQueryElevationDependencies=i(((e,t,r,i,o,n,s)=>({inputGraphicUid:null!=e?x(e):null,visibleLayers:t,maxIntersectionDistance:r,intersectOptions:i,view:o,stationary:n,spatialReference:s}))),this._vecA=p(),this._vecB=p(),this._ray=m()}get minDemResolution(){const e=this._viewModel?.view;if(null==e||"3d"!==e.type)return null;const t=e.pointsOfInterest?.focus?.worldUnitsPerContentPixel;return null==t?null:t*l(e.spatialReference)}get queryElevationDependencies(){const e=this._view;return e?this._getQueryElevationDependencies(this._viewModel?.input,this._visibleLayers,this._maxIntersectionDistance,this._intersectOptions,e,e.stationary,e.spatialReference):null}get _visibleLayers(){return this._view?.map?.allLayers?.filter((e=>e.visible)).toArray()??[]}get _intersectOptions(){const e=this._view;if(null==e||e.destroyed)return{};const t=f(e,{include:this.include,exclude:this.exclude}),r=f(e,{exclude:this._pointCloudLayers});return t.exclude=s(t.exclude,r.exclude),t}get _pointCloudLayers(){const e=this._view;return null==e?[]:e.allLayerViews.toArray().filter((e=>"point-cloud"===e.layer?.type)).map((e=>e.layer))}get _view(){const e=this._viewModel?.view;return null!=e&&"3d"===e.type?e:null}get _maxIntersectionDistance(){const e=this._view;return e?.renderCoordsHelper?d(e.spatialReference).radius/e.renderCoordsHelper.unitInMeters:Number.POSITIVE_INFINITY}get _intersector(){const e=this._view;if(null==e)return null;const t=h(e.state.viewingMode),r=t.options;return r.hud=!1,r.invisibleTerrain=!1,r.backfacesTerrain=!1,r.selectionMode=!1,r.store=w.ALL,t}async queryElevation(e,{noDataValue:t,signal:r}){const i=this.queryElevationDependencies;if(null==i)throw new Error("ElevationProfileLineInput: no dependencies");const o=this._intersector;if(null==o)throw new Error("ElevationProfileLineInput: no view");const{intersectOptions:n,view:s,spatialReference:l}=i,c=s.renderCoordsHelper,a=s.sceneIntersectionHelper,p=this._vecA,d=this._vecA,m=this._vecB,f=this._ray;if(!l)return{geometry:e,noDataValue:t};const h=await y.fromGeometry(e).project(l,r);if(!h)return{geometry:e,noDataValue:t};const w=h.coordinates,_=w.length;for(let y=0;y<_;++y){const e=w[y];u(m,e.x,e.y,e.z??0),c.toRenderCoords(m,l,m),c.setAltitude(p,j,m);const r=v(p,m,f);a.computeIntersection(r,o,n,!0);const s=b(i,o.results.all);s?(s.getIntersectionPoint(d),c.fromRenderCoords(d,d,l),e.z=d[2]):e.z=t}return{geometry:h.export(),noDataValue:t}}attach(e){const t=()=>this._onChange();return r([super.attach(e),o((()=>this.queryElevationDependencies),t),n((()=>e.elevationProvider),"elevation-change",t,{onListenerAdd:t,onListenerRemove:t})])}};function b({view:e,inputGraphicUid:t,maxIntersectionDistance:r},i){for(const o of i){if(null!=o.distanceInRenderSpace&&o.distanceInRenderSpace>r)continue;const i=_(o,e);if(null==i||x(i)!==t)return o}return null}function x(e){if(e.layer&&"objectIdField"in e.layer){const t=e.attributes[e.layer.objectIdField];if(t)return`o-${e.layer.id}-${t}`}return`u-${e.uid}`}e([c({type:t,nonNullable:!0})],I.prototype,"color",void 0),e([c()],I.prototype,"viewVisualizationEnabled",void 0),e([c()],I.prototype,"include",void 0),e([c()],I.prototype,"exclude",void 0),e([c({readOnly:!0})],I.prototype,"minDemResolution",null),e([c()],I.prototype,"queryElevationDependencies",null),e([c()],I.prototype,"_visibleLayers",null),e([c()],I.prototype,"_intersectOptions",null),e([c()],I.prototype,"_pointCloudLayers",null),e([c()],I.prototype,"_view",null),e([c()],I.prototype,"_maxIntersectionDistance",null),e([c()],I.prototype,"_intersector",null),I=e([a("esri.widgets.ElevationProfile.ElevationProfileLineView")],I);const L=I;export{L as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.31/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../chunks/tslib.es6.js";import"../../intl.js";import{prefersReducedMotion as t}from"../../core/a11yUtils.js";import{watch as i,initial as r}from"../../core/reactiveUtils.js";import{property as a}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{subclass as s}from"../../core/accessorSupport/decorators/subclass.js";import{getColorsFromRenderer as o}from"../../renderers/support/utils.js";import n from"../Widget.js";import l from"./FeatureMedia/FeatureMediaViewModel.js";import d from"./support/FeatureElementInfo.js";import{shouldOpenInNewTab as m}from"./support/featureUtils.js";import{loadCalciteComponents as c}from"../support/componentsUtils.js";import{isRTL as h}from"../support/widgetUtils.js";import{messageBundle as p}from"../support/decorators/messageBundle.js";import{tsx as u}from"../support/jsxFactory.js";import{isDarkTheme as f}from"../../support/themeUtils.js";import{substitute as _}from"../../intl/substitute.js";const v="esri-feature-media",g={base:v,mediaContainer:`${v}__container`,mediaItemContainer:`${v}__item-container`,mediaItem:`${v}__item`,mediaItemText:`${v}__item-text`,mediaItemTitle:`${v}__item-title`,mediaItemCaption:`${v}__item-caption`,mediaNavigation:`${v}__item-navigation`,mediaPagination:`${v}__pagination`,mediaPaginationText:`${v}__pagination-text`,mediaPrevious:`${v}__previous`,mediaPreviousIconLTR:`${v}__previous-icon`,mediaPreviousIconRTL:`${v}__previous-icon--rtl`,mediaNext:`${v}__next`,mediaNextIconLTR:`${v}__next-icon`,mediaNextIconRTL:`${v}__next-icon--rtl`,mediaChart:`${v}__chart`,mediaPaginationButton:`${v}__pagination-button`,mediaPaginationIcon:`${v}__pagination-icon`,mediaChartRendered:`${v}__chart--rendered`},M=15,w="category",I="value",A="rgba(50, 50, 50, 1)",C=250,y=500,x=200;let T=class extends n{constructor(e,t){super(e,t),this._refreshTimer=null,this._refreshIntervalInfo=null,this._featureElementInfo=null,this._chartRootMap=new WeakMap,this.viewModel=new l,this.messages=null,this._disposeChart=e=>{this._chartRootMap.get(e)?.dispose(),this._chartRootMap.delete(e)},this._createChart=async e=>{const{destroyed:t,viewModel:i}=this;if(t||!i||!e)return;const{createRoot:r}=await import("../support/chartUtilsAm5.js"),a=await r(e);this._chartRootMap.set(e,a),this._renderChart({mediaInfo:i.activeMediaInfo,root:a})}}initialize(){this._featureElementInfo=new d,this.addHandles([i((()=>[this.viewModel?.activeMediaInfo,this.viewModel?.activeMediaInfoIndex]),(()=>this._setupMediaRefreshTimer()),r),i((()=>[this.viewModel?.description,this.viewModel?.title]),(()=>this._setupFeatureElementInfo()),r)])}loadDependencies(){return c({icon:()=>import("@esri/calcite-components/dist/components/calcite-icon.js")})}destroy(){this._clearMediaRefreshTimer(),this._featureElementInfo?.destroy()}get attributes(){return this.viewModel.attributes}set attributes(e){this.viewModel.attributes=e}get activeMediaInfoIndex(){return this.viewModel.activeMediaInfoIndex}set activeMediaInfoIndex(e){this.viewModel.activeMediaInfoIndex=e}get description(){return this.viewModel.description}set description(e){this.viewModel.description=e}get fieldInfoMap(){return this.viewModel.fieldInfoMap}set fieldInfoMap(e){this.viewModel.fieldInfoMap=e}get layer(){return this.viewModel.layer}set layer(e){this.viewModel.layer=e}get mediaInfos(){return this.viewModel.mediaInfos}set mediaInfos(e){this.viewModel.mediaInfos=e}get popupTemplate(){return this.viewModel.popupTemplate}set popupTemplate(e){this.viewModel.popupTemplate=e}get relatedInfos(){return this.viewModel.relatedInfos}set relatedInfos(e){this.viewModel.relatedInfos=e}get title(){return this.viewModel.title}set title(e){this.viewModel.title=e}render(){return u("div",{bind:this,class:g.base,onkeyup:this._handleMediaKeyup},this._featureElementInfo?.render(),this._renderMedia())}_renderMedia(){const{formattedMediaInfoCount:e,activeMediaInfoIndex:t}=this.viewModel,i=this._renderMediaText();return e?u("div",{class:g.mediaContainer,key:"media-element-container"},this._renderMediaInfo(),u("div",{class:g.mediaNavigation},i,e>1?u("div",{class:g.mediaPagination},this._renderMediaPageButton("previous"),u("span",{class:g.mediaPaginationText},_(this.messages.pageText,{index:t+1,total:e})),this._renderMediaPageButton("next")):null)):null}_renderMediaText(){const{activeMediaInfo:e}=this.viewModel;if(!e)return null;const t=e&&e.title?u("div",{class:g.mediaItemTitle,innerHTML:e.title,key:"media-title"}):null,i=e&&e.caption?u("div",{class:g.mediaItemCaption,innerHTML:e.caption,key:"media-caption"}):null;return t||i?u("div",{class:g.mediaItemText,key:"media-text"},t,i):null}_renderImageMediaInfo(e){if(!e.value)return null;const{_refreshIntervalInfo:t}=this,{activeMediaInfoIndex:i,formattedMediaInfoCount:r}=this.viewModel,{value:a,refreshInterval:s,altText:o,title:n,type:l}=e,{sourceURL:d,linkURL:c}=a,h=m(c??void 0)?"_blank":"_self",p="_blank"===h?"noreferrer":"",f=s?t:null,_=f?f.timestamp:0,v=f?f.sourceURL:d,g=u("img",{alt:o||n,key:`media-${l}-${i}-${r}-${_}`,src:v??void 0});return(c?u("a",{href:c,rel:p,target:h,title:n},g):null)??g}_renderChartMediaInfo(e){const{activeMediaInfoIndex:t,formattedMediaInfoCount:i}=this.viewModel;return u("div",{afterCreate:this._createChart,afterRemoved:this._disposeChart,bind:this,class:g.mediaChart,key:`media-${e.type}-${t}-${i}`})}_renderMediaInfoType(){const{activeMediaInfo:e}=this.viewModel;return e?"image"===e.type?this._renderImageMediaInfo(e):e.type.includes("chart")?this._renderChartMediaInfo(e):null:null}_renderMediaInfo(){const{activeMediaInfo:e}=this.viewModel;return e?u("div",{class:g.mediaItemContainer,key:"media-container"},u("div",{class:g.mediaItem,key:"media-item-container"},this._renderMediaInfoType())):null}_renderMediaPageButton(e){if(this.viewModel.formattedMediaInfoCount<2)return null;const t="previous"===e,i=t?this.messages.previous:this.messages.next,r=t?"chevron-left":"chevron-right",a=t?"media-previous":"media-next",s=t?this._previous:this._next;return u("button",{"aria-label":i,bind:this,class:g.mediaPaginationButton,key:a,onclick:s,tabIndex:0,title:i,type:"button"},u("calcite-icon",{class:g.mediaPaginationIcon,icon:r,scale:"s"}))}_setupFeatureElementInfo(){const{description:e,title:t}=this;this._featureElementInfo?.set({description:e,title:t})}_next(){this.viewModel.next()}_previous(){this.viewModel.previous()}_getRenderer(){if(!this.viewModel)return;const{isAggregate:e,layer:t}=this.viewModel;return e&&t?.featureReduction&&"renderer"in t.featureReduction?t.featureReduction.renderer:t?.renderer}async _getSeriesColors(e){const{colorAm5:t}=await import("./FeatureMedia/chartCommon.js"),i=new Map;return e.forEach((e=>{e.color&&i.set(e,t(e.color.toCss(!0)))})),i}async _getRendererColors(){const{colorAm5:e}=await import("./FeatureMedia/chartCommon.js"),t=new Map,i=this._getRenderer(),r="default";if(!i)return t;const a=await o(i);a.delete(r);return Array.from(a.values()).every((e=>1===e?.length))?(Array.from(a.keys()).forEach((i=>{const r=a.get(i)?.[0]?.toCss(!0);r&&t.set(i,e(r))})),t):t}_handleMediaKeyup(e){const{key:t}=e;"ArrowLeft"===t&&(e.stopPropagation(),this.viewModel.previous()),"ArrowRight"===t&&(e.stopPropagation(),this.viewModel.next())}_canAnimateChart(){return!!this.viewModel&&(!!this.viewModel.abilities.chartAnimation&&!t())}_getChartAnimationMS(){return this._canAnimateChart()?C:0}_getChartSeriesAnimationMS(){return this._canAnimateChart()?y:0}async _renderChart(e){const{root:t,mediaInfo:i}=e,{value:r,type:a}=i,{ResponsiveThemeAm5:s,DarkThemeAm5:o,AnimatedThemeAm5:n,ColorSetAm5:l,ThemeAm5:d,esriChartColorSet:m}=await import("./FeatureMedia/chartCommon.js"),c=d.new(t);c.rule("ColorSet").set("colors",m),c.rule("ColorSet").set("reuse",!0);const h=[s.new(t),c];f()&&h.push(o.new(t)),this._canAnimateChart()&&h.push(n.new(t)),t.setThemes(h);const p=await this._getRendererColors(),u=await this._getSeriesColors(r.series),_=l.new(t,{}),v=u.get(r.series[0]),g=v?{lineSettings:{stroke:v}}:void 0,M=r.series.map(((e,t)=>{const i=u.get(e)||p.get(e.fieldName)||_.getIndex(t);return{[w]:e.tooltip,[I]:e.value,columnSettings:{fill:i,stroke:i},...g}})).filter((e=>"pie-chart"!==a||null!=e.value&&e.value>0));"pie-chart"===a?this._createPieChart(e,M):this._createXYChart(e,M)}_getDirection(){return h(this.container)?"rtl":"ltr"}_isInversed(){return!!h(this.container)}async _customizeChartTooltip(e,t="horizontal"){const{colorAm5:i}=await import("./FeatureMedia/chartCommon.js");e.setAll({pointerOrientation:t}),e.get("background")?.setAll({stroke:i(A)}),e.label.setAll({direction:this._getDirection(),oversizedBehavior:"wrap",maxWidth:x})}async _createPieChart(e,t){const{TooltipAm5:i}=await import("./FeatureMedia/chartCommon.js"),{PieChartAm5:r,PieSeriesAm5:a}=await import("./FeatureMedia/pieChart.js"),{mediaInfo:s,root:o}=e,{title:n}=s,l=5,d=s?.altText||s?.title||"",m=o.container.children.push(r.new(o,{ariaLabel:d,focusable:!0,paddingBottom:l,paddingTop:l,paddingLeft:l,paddingRight:l})),c="{category}: {valuePercentTotal.formatNumber('0.00')}%\n ({value})",h=i.new(o,{labelText:c}),p=m.series.push(a.new(o,{name:n,valueField:I,categoryField:w,tooltip:h}));p.ticks.template.set("forceHidden",!0),p.labels.template.set("forceHidden",!0),p.slices.template.states.create("active",{shiftRadius:l}),this._customizeChartTooltip(h),p.slices.template.setAll({ariaLabel:c,focusable:!0,templateField:"columnSettings"}),p.data.setAll(t),p.appear(this._getChartSeriesAnimationMS()),m.appear(this._getChartAnimationMS()),m.root.dom.classList.toggle(g.mediaChartRendered,!0)}_getMinSeriesValue(e){let t=0;return e.forEach((e=>t=Math.min(e.value,t))),t}async _createColumnChart(e,t,i){const{TooltipAm5:r,ScrollbarAm5:a}=await import("./FeatureMedia/chartCommon.js"),{CategoryAxisAm5:s,AxisRendererXAm5:o,ValueAxisAm5:n,AxisRendererYAm5:l,ColumnSeriesAm5:d}=await import("./FeatureMedia/xyChart.js"),{mediaInfo:m,root:c}=t,{value:h,title:p}=m;e.setAll({wheelX:"panX",wheelY:"zoomX"});const u=e.xAxes.push(s.new(c,{renderer:o.new(c,{inversed:this._isInversed()}),categoryField:w}));u.get("renderer").labels.template.setAll({forceHidden:!0});const f=e.yAxes.push(n.new(c,{renderer:l.new(c,{inside:!1}),min:this._getMinSeriesValue(h.series)}));f.get("renderer").labels.template.setAll({direction:this._getDirection()});const _="{categoryX}",v=r.new(c,{labelText:_}),g=e.series.push(d.new(c,{name:p,xAxis:u,yAxis:f,valueYField:I,categoryXField:w,tooltip:v}));this._customizeChartTooltip(v),g.columns.template.setAll({ariaLabel:_,focusable:!0,templateField:"columnSettings"}),h.series.length>M&&e.set("scrollbarX",a.new(c,{orientation:"horizontal"})),u.data.setAll(i),g.data.setAll(i),g.appear(this._getChartSeriesAnimationMS()),e.appear(this._getChartAnimationMS())}async _createBarChart(e,t,i){const{TooltipAm5:r,ScrollbarAm5:a}=await import("./FeatureMedia/chartCommon.js"),{CategoryAxisAm5:s,AxisRendererXAm5:o,ValueAxisAm5:n,AxisRendererYAm5:l,ColumnSeriesAm5:d}=await import("./FeatureMedia/xyChart.js"),{mediaInfo:m,root:c}=t,{value:h,title:p}=m;e.setAll({wheelX:"panY",wheelY:"zoomY"});const u=e.yAxes.push(s.new(c,{renderer:l.new(c,{inversed:!0}),categoryField:w}));u.get("renderer").labels.template.setAll({forceHidden:!0});const f=e.xAxes.push(n.new(c,{renderer:o.new(c,{inside:!1,inversed:this._isInversed()}),min:this._getMinSeriesValue(h.series)}));f.get("renderer").labels.template.setAll({direction:this._getDirection()});const _="{categoryY}",v=r.new(c,{labelText:_}),g=e.series.push(d.new(c,{name:p,xAxis:f,yAxis:u,valueXField:I,categoryYField:w,tooltip:v}));this._customizeChartTooltip(v,"vertical"),g.columns.template.setAll({ariaLabel:_,focusable:!0,templateField:"columnSettings"}),h.series.length>M&&e.set("scrollbarY",a.new(c,{orientation:"vertical"})),u.data.setAll(i),g.data.setAll(i),g.appear(this._getChartSeriesAnimationMS()),e.appear(this._getChartAnimationMS())}async _createLineChart(e,t,i){const{TooltipAm5:r,ScrollbarAm5:a}=await import("./FeatureMedia/chartCommon.js"),{CategoryAxisAm5:s,AxisRendererXAm5:o,ValueAxisAm5:n,AxisRendererYAm5:l,LineSeriesAm5:d}=await import("./FeatureMedia/xyChart.js"),{root:m,mediaInfo:c}=t,{value:h,title:p}=c;e.setAll({wheelX:"panX",wheelY:"zoomX"});const u=e.xAxes.push(s.new(m,{renderer:o.new(m,{inversed:this._isInversed()}),categoryField:w}));u.get("renderer").labels.template.setAll({forceHidden:!0});const f=e.yAxes.push(n.new(m,{renderer:l.new(m,{inside:!1}),min:this._getMinSeriesValue(h.series)}));f.get("renderer").labels.template.setAll({direction:this._getDirection()});const _="{categoryX}",v=i[0]?.lineSettings?.stroke,g=r.new(m,{getFillFromSprite:!v,labelText:_});v&&g.get("background")?.setAll({fill:v});const A=e.series.push(d.new(m,{name:p,xAxis:u,yAxis:f,valueYField:I,categoryXField:w,tooltip:g}));A.strokes.template.setAll({templateField:"lineSettings"}),this._customizeChartTooltip(g,"vertical"),h.series.length>M&&e.set("scrollbarX",a.new(m,{orientation:"horizontal"})),u.data.setAll(i),A.data.setAll(i),A.appear(this._getChartSeriesAnimationMS()),e.appear(this._getChartAnimationMS())}async _createXYChart(e,t){const{XYChartAm5:i,XYCursorAm5:r}=await import("./FeatureMedia/xyChart.js"),{root:a,mediaInfo:s}=e,{type:o}=s,n=s?.altText||s?.title||"",l=a.container.children.push(i.new(a,{ariaLabel:n,focusable:!0,panX:!0,panY:!0}));l.set("cursor",r.new(a,{})),"column-chart"===o&&await this._createColumnChart(l,e,t),"bar-chart"===o&&await this._createBarChart(l,e,t),"line-chart"===o&&await this._createLineChart(l,e,t),l.root.dom.classList.toggle(g.mediaChartRendered,!0)}_clearMediaRefreshTimer(){const{_refreshTimer:e}=this;e&&(clearTimeout(e),this._refreshTimer=null)}_updateMediaInfoTimestamp(e){const t=Date.now();this._refreshIntervalInfo={timestamp:t,sourceURL:e&&this._getImageSource(e,t)}}_setupMediaRefreshTimer(){this._clearMediaRefreshTimer();const{activeMediaInfo:e}=this.viewModel;"image"===e?.type&&e?.refreshInterval>0&&this._setRefreshTimeout(e)}_setRefreshTimeout(e){const{refreshInterval:t,value:i}=e,r=6e4*t;this._updateMediaInfoTimestamp(i.sourceURL);const a=setInterval((()=>{this._updateMediaInfoTimestamp(i.sourceURL)}),r);this._refreshTimer=a}_getImageSource(e,t){const i=e.includes("?")?"&":"?",[r,a=""]=e.split("#");return`${r}${i}timestamp=${t}${a?"#":""}${a}`}};e([a()],T.prototype,"_refreshIntervalInfo",void 0),e([a()],T.prototype,"attributes",null),e([a()],T.prototype,"activeMediaInfoIndex",null),e([a()],T.prototype,"description",null),e([a()],T.prototype,"fieldInfoMap",null),e([a()],T.prototype,"layer",null),e([a()],T.prototype,"mediaInfos",null),e([a()],T.prototype,"popupTemplate",null),e([a()],T.prototype,"relatedInfos",null),e([a()],T.prototype,"title",null),e([a({type:l})],T.prototype,"viewModel",void 0),e([a(),p("esri/widgets/Feature/t9n/Feature")],T.prototype,"messages",void 0),T=e([s("esri.widgets.Feature.FeatureMedia")],T);const b=T;export{b as default};
5
+ import{_ as e}from"../../chunks/tslib.es6.js";import"../../intl.js";import{prefersReducedMotion as t}from"../../core/a11yUtils.js";import{watch as i,initial as r}from"../../core/reactiveUtils.js";import{property as a}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{subclass as o}from"../../core/accessorSupport/decorators/subclass.js";import{getColorsFromRenderer as s}from"../../renderers/support/utils.js";import n from"../Widget.js";import l from"./FeatureMedia/FeatureMediaViewModel.js";import d from"./support/FeatureElementInfo.js";import{shouldOpenInNewTab as m}from"./support/featureUtils.js";import{loadCalciteComponents as c}from"../support/componentsUtils.js";import{isRTL as p}from"../support/widgetUtils.js";import{messageBundle as h}from"../support/decorators/messageBundle.js";import{tsx as u}from"../support/jsxFactory.js";import{isDarkTheme as f}from"../../support/themeUtils.js";import{substitute as _}from"../../intl/substitute.js";const g="esri-feature-media",v={base:g,mediaContainer:`${g}__container`,mediaItemContainer:`${g}__item-container`,mediaItem:`${g}__item`,mediaItemText:`${g}__item-text`,mediaItemTitle:`${g}__item-title`,mediaItemCaption:`${g}__item-caption`,mediaNavigation:`${g}__item-navigation`,mediaPagination:`${g}__pagination`,mediaPaginationText:`${g}__pagination-text`,mediaPrevious:`${g}__previous`,mediaPreviousIconLTR:`${g}__previous-icon`,mediaPreviousIconRTL:`${g}__previous-icon--rtl`,mediaNext:`${g}__next`,mediaNextIconLTR:`${g}__next-icon`,mediaNextIconRTL:`${g}__next-icon--rtl`,mediaChart:`${g}__chart`,mediaPaginationButton:`${g}__pagination-button`,mediaPaginationIcon:`${g}__pagination-icon`,mediaChartRendered:`${g}__chart--rendered`},M=15,w="category",A="value",I="rgba(50, 50, 50, 1)",C=250,y=500,x=200;let T=class extends n{constructor(e,t){super(e,t),this._refreshTimer=null,this._refreshIntervalInfo=null,this._featureElementInfo=null,this._chartRootMap=new WeakMap,this.viewModel=new l,this.messages=null,this._disposeChart=e=>{this._chartRootMap.get(e)?.dispose(),this._chartRootMap.delete(e)},this._createChart=async e=>{const{destroyed:t,viewModel:i}=this;if(t||!i||!e)return;const{createRoot:r}=await import("../support/chartUtilsAm5.js"),a=await r(e);this._chartRootMap.set(e,a),this._renderChart({mediaInfo:i.activeMediaInfo,root:a})}}initialize(){this._featureElementInfo=new d,this.addHandles([i((()=>[this.viewModel?.activeMediaInfo,this.viewModel?.activeMediaInfoIndex]),(()=>this._setupMediaRefreshTimer()),r),i((()=>[this.viewModel?.description,this.viewModel?.title]),(()=>this._setupFeatureElementInfo()),r)])}loadDependencies(){return c({icon:()=>import("@esri/calcite-components/dist/components/calcite-icon.js")})}destroy(){this._clearMediaRefreshTimer(),this._featureElementInfo?.destroy()}get attributes(){return this.viewModel.attributes}set attributes(e){this.viewModel.attributes=e}get activeMediaInfoIndex(){return this.viewModel.activeMediaInfoIndex}set activeMediaInfoIndex(e){this.viewModel.activeMediaInfoIndex=e}get description(){return this.viewModel.description}set description(e){this.viewModel.description=e}get fieldInfoMap(){return this.viewModel.fieldInfoMap}set fieldInfoMap(e){this.viewModel.fieldInfoMap=e}get layer(){return this.viewModel.layer}set layer(e){this.viewModel.layer=e}get mediaInfos(){return this.viewModel.mediaInfos}set mediaInfos(e){this.viewModel.mediaInfos=e}get popupTemplate(){return this.viewModel.popupTemplate}set popupTemplate(e){this.viewModel.popupTemplate=e}get relatedInfos(){return this.viewModel.relatedInfos}set relatedInfos(e){this.viewModel.relatedInfos=e}get title(){return this.viewModel.title}set title(e){this.viewModel.title=e}render(){return u("div",{bind:this,class:v.base,onkeyup:this._handleMediaKeyup},this._featureElementInfo?.render(),this._renderMedia())}_renderMedia(){const{formattedMediaInfoCount:e,activeMediaInfoIndex:t}=this.viewModel,i=this._renderMediaText();return e?u("div",{class:v.mediaContainer,key:"media-element-container"},this._renderMediaInfo(),u("div",{class:v.mediaNavigation},i,e>1?u("div",{class:v.mediaPagination},this._renderMediaPageButton("previous"),u("span",{class:v.mediaPaginationText},_(this.messages.pageText,{index:t+1,total:e})),this._renderMediaPageButton("next")):null)):null}_renderMediaText(){const{activeMediaInfo:e}=this.viewModel;if(!e)return null;const t=e&&e.title?u("div",{class:v.mediaItemTitle,innerHTML:e.title,key:"media-title"}):null,i=e&&e.caption?u("div",{class:v.mediaItemCaption,innerHTML:e.caption,key:"media-caption"}):null;return t||i?u("div",{class:v.mediaItemText,key:"media-text"},t,i):null}_renderImageMediaInfo(e){if(!e.value)return null;const{_refreshIntervalInfo:t}=this,{activeMediaInfoIndex:i,formattedMediaInfoCount:r}=this.viewModel,{value:a,refreshInterval:o,altText:s,title:n,type:l}=e,{sourceURL:d,linkURL:c}=a,p=m(c??void 0)?"_blank":"_self",h="_blank"===p?"noreferrer":"",f=o?t:null,_=f?f.timestamp:0,g=f?f.sourceURL:d,v=u("img",{alt:s||n,key:`media-${l}-${i}-${r}-${_}`,src:g??void 0});return(c?u("a",{href:c,rel:h,target:p,title:n},v):null)??v}_renderChartMediaInfo(e){const{activeMediaInfoIndex:t,formattedMediaInfoCount:i}=this.viewModel;return u("div",{afterCreate:this._createChart,afterRemoved:this._disposeChart,bind:this,class:v.mediaChart,key:`media-${e.type}-${t}-${i}`})}_renderMediaInfoType(){const{activeMediaInfo:e}=this.viewModel;return e?"image"===e.type?this._renderImageMediaInfo(e):e.type.includes("chart")?this._renderChartMediaInfo(e):null:null}_renderMediaInfo(){const{activeMediaInfo:e}=this.viewModel;return e?u("div",{class:v.mediaItemContainer,key:"media-container"},u("div",{class:v.mediaItem,key:"media-item-container"},this._renderMediaInfoType())):null}_renderMediaPageButton(e){if(this.viewModel.formattedMediaInfoCount<2)return null;const t="previous"===e,i=t?this.messages.previous:this.messages.next,r=t?"chevron-left":"chevron-right",a=t?"media-previous":"media-next",o=t?this._previous:this._next;return u("button",{"aria-label":i,bind:this,class:v.mediaPaginationButton,key:a,onclick:o,tabIndex:0,title:i,type:"button"},u("calcite-icon",{class:v.mediaPaginationIcon,icon:r,scale:"s"}))}_setupFeatureElementInfo(){const{description:e,title:t}=this;this._featureElementInfo?.set({description:e,title:t})}_next(){this.viewModel.next()}_previous(){this.viewModel.previous()}_getRenderer(){if(!this.viewModel)return;const{isAggregate:e,layer:t}=this.viewModel;return e&&t?.featureReduction&&"renderer"in t.featureReduction?t.featureReduction.renderer:t?.renderer}async _getSeriesColors(e){const{colorAm5:t}=await import("./FeatureMedia/chartCommon.js"),i=new Map;return e.forEach((e=>{e.color&&i.set(e,t(e.color.toCss(!0)))})),i}async _getRendererColors(){const{colorAm5:e}=await import("./FeatureMedia/chartCommon.js"),t=new Map,i=this._getRenderer(),r="default";if(!i)return t;const a=await s(i);a.delete(r);return Array.from(a.values()).every((e=>1===e?.length))?(Array.from(a.keys()).forEach((i=>{const r=a.get(i)?.[0]?.toCss(!0);r&&t.set(i,e(r))})),t):t}_handleMediaKeyup(e){const{key:t}=e;"ArrowLeft"===t&&(e.stopPropagation(),this.viewModel.previous()),"ArrowRight"===t&&(e.stopPropagation(),this.viewModel.next())}_canAnimateChart(){return!!this.viewModel&&(!!this.viewModel.abilities.chartAnimation&&!t())}_getChartAnimationMS(){return this._canAnimateChart()?C:0}_getChartSeriesAnimationMS(){return this._canAnimateChart()?y:0}async _renderChart(e){const{root:t,mediaInfo:i}=e,{value:r,type:a}=i,{ResponsiveThemeAm5:o,DarkThemeAm5:s,AnimatedThemeAm5:n,ColorSetAm5:l,ThemeAm5:d,esriChartColorSet:m}=await import("./FeatureMedia/chartCommon.js"),c=d.new(t);c.rule("ColorSet").set("colors",m),c.rule("ColorSet").set("reuse",!0);const p=[o.new(t),c];f()&&p.push(s.new(t)),this._canAnimateChart()&&p.push(n.new(t)),t.setThemes(p);const h=await this._getRendererColors(),u=await this._getSeriesColors(r.series),_=l.new(t,{}),g=u.get(r.series[0]),v=g?{lineSettings:{stroke:g}}:void 0,M=r.series.map(((e,t)=>{const i=u.get(e)||h.get(e.fieldName)||_.getIndex(t);return{[w]:e.tooltip,[A]:e.value,columnSettings:{fill:i,stroke:i},...v}})).filter((e=>"pie-chart"!==a||null!=e.value&&e.value>0));"pie-chart"===a?this._createPieChart(e,M):this._createXYChart(e,M)}_getDirection(){return p(this.container)?"rtl":"ltr"}async _customizeChartTooltip(e,t="horizontal"){const{colorAm5:i}=await import("./FeatureMedia/chartCommon.js");e.setAll({pointerOrientation:t}),e.get("background")?.setAll({stroke:i(I)}),e.label.setAll({direction:this._getDirection(),oversizedBehavior:"wrap",maxWidth:x})}async _createPieChart(e,t){const{TooltipAm5:i}=await import("./FeatureMedia/chartCommon.js"),{PieChartAm5:r,PieSeriesAm5:a}=await import("./FeatureMedia/pieChart.js"),{mediaInfo:o,root:s}=e,{title:n}=o,l=5,d=o?.altText||o?.title||"",m=s.container.children.push(r.new(s,{ariaLabel:d,focusable:!0,paddingBottom:l,paddingTop:l,paddingLeft:l,paddingRight:l})),c="{category}: {valuePercentTotal.formatNumber('0.00')}%\n ({value})",p=i.new(s,{labelText:c}),h=m.series.push(a.new(s,{name:n,valueField:A,categoryField:w,tooltip:p}));h.ticks.template.set("forceHidden",!0),h.labels.template.set("forceHidden",!0),h.slices.template.states.create("active",{shiftRadius:l}),this._customizeChartTooltip(p),h.slices.template.setAll({ariaLabel:c,focusable:!0,templateField:"columnSettings"}),h.data.setAll(t),h.appear(this._getChartSeriesAnimationMS()),m.appear(this._getChartAnimationMS()),m.root.dom.classList.toggle(v.mediaChartRendered,!0)}_getMinSeriesValue(e){let t=0;return e.forEach((e=>t=Math.min(e.value,t))),t}async _createColumnChart(e,t,i){const{TooltipAm5:r,ScrollbarAm5:a}=await import("./FeatureMedia/chartCommon.js"),{CategoryAxisAm5:o,AxisRendererXAm5:s,ValueAxisAm5:n,AxisRendererYAm5:l,ColumnSeriesAm5:d}=await import("./FeatureMedia/xyChart.js"),{mediaInfo:m,root:c}=t,{value:h,title:u}=m;e.setAll({wheelX:"panX",wheelY:"zoomX"});const f=e.xAxes.push(o.new(c,{renderer:s.new(c,{inversed:p(this.container)}),categoryField:w}));f.get("renderer").labels.template.setAll({forceHidden:!0});const _=e.yAxes.push(n.new(c,{renderer:l.new(c,{inside:!1}),min:this._getMinSeriesValue(h.series)}));_.get("renderer").labels.template.setAll({direction:this._getDirection()});const g="{categoryX}",v=r.new(c,{labelText:g}),I=e.series.push(d.new(c,{name:u,xAxis:f,yAxis:_,valueYField:A,categoryXField:w,tooltip:v}));this._customizeChartTooltip(v),I.columns.template.setAll({ariaLabel:g,focusable:!0,templateField:"columnSettings"}),h.series.length>M&&e.set("scrollbarX",a.new(c,{orientation:"horizontal"})),f.data.setAll(i),I.data.setAll(i),I.appear(this._getChartSeriesAnimationMS()),e.appear(this._getChartAnimationMS())}async _createBarChart(e,t,i){const{TooltipAm5:r,ScrollbarAm5:a}=await import("./FeatureMedia/chartCommon.js"),{CategoryAxisAm5:o,AxisRendererXAm5:s,ValueAxisAm5:n,AxisRendererYAm5:l,ColumnSeriesAm5:d}=await import("./FeatureMedia/xyChart.js"),{mediaInfo:m,root:c}=t,{value:h,title:u}=m;e.setAll({wheelX:"panY",wheelY:"zoomY"});const f=e.yAxes.push(o.new(c,{renderer:l.new(c,{inversed:!0}),categoryField:w}));f.get("renderer").labels.template.setAll({forceHidden:!0});const _=e.xAxes.push(n.new(c,{renderer:s.new(c,{inside:!1,inversed:p(this.container)}),min:this._getMinSeriesValue(h.series)}));_.get("renderer").labels.template.setAll({direction:this._getDirection()});const g="{categoryY}",v=r.new(c,{labelText:g}),I=e.series.push(d.new(c,{name:u,xAxis:_,yAxis:f,valueXField:A,categoryYField:w,tooltip:v}));this._customizeChartTooltip(v,"vertical"),I.columns.template.setAll({ariaLabel:g,focusable:!0,templateField:"columnSettings"}),h.series.length>M&&e.set("scrollbarY",a.new(c,{orientation:"vertical"})),f.data.setAll(i),I.data.setAll(i),I.appear(this._getChartSeriesAnimationMS()),e.appear(this._getChartAnimationMS())}async _createLineChart(e,t,i){const{TooltipAm5:r,ScrollbarAm5:a}=await import("./FeatureMedia/chartCommon.js"),{CategoryAxisAm5:o,AxisRendererXAm5:s,ValueAxisAm5:n,AxisRendererYAm5:l,LineSeriesAm5:d}=await import("./FeatureMedia/xyChart.js"),{root:m,mediaInfo:c}=t,{value:h,title:u}=c;e.setAll({wheelX:"panX",wheelY:"zoomX"});const f=e.xAxes.push(o.new(m,{renderer:s.new(m,{inversed:p(this.container)}),categoryField:w}));f.get("renderer").labels.template.setAll({forceHidden:!0});const _=e.yAxes.push(n.new(m,{renderer:l.new(m,{inside:!1}),min:this._getMinSeriesValue(h.series)}));_.get("renderer").labels.template.setAll({direction:this._getDirection()});const g="{categoryX}",v=i[0]?.lineSettings?.stroke,I=r.new(m,{getFillFromSprite:!v,labelText:g});v&&I.get("background")?.setAll({fill:v});const C=e.series.push(d.new(m,{name:u,xAxis:f,yAxis:_,valueYField:A,categoryXField:w,tooltip:I}));C.strokes.template.setAll({templateField:"lineSettings"}),this._customizeChartTooltip(I,"vertical"),h.series.length>M&&e.set("scrollbarX",a.new(m,{orientation:"horizontal"})),f.data.setAll(i),C.data.setAll(i),C.appear(this._getChartSeriesAnimationMS()),e.appear(this._getChartAnimationMS())}async _createXYChart(e,t){const{XYChartAm5:i,XYCursorAm5:r}=await import("./FeatureMedia/xyChart.js"),{root:a,mediaInfo:o}=e,{type:s}=o,n=o?.altText||o?.title||"",l=a.container.children.push(i.new(a,{ariaLabel:n,focusable:!0,panX:!0,panY:!0}));l.set("cursor",r.new(a,{})),"column-chart"===s&&await this._createColumnChart(l,e,t),"bar-chart"===s&&await this._createBarChart(l,e,t),"line-chart"===s&&await this._createLineChart(l,e,t),l.root.dom.classList.toggle(v.mediaChartRendered,!0)}_clearMediaRefreshTimer(){const{_refreshTimer:e}=this;e&&(clearTimeout(e),this._refreshTimer=null)}_updateMediaInfoTimestamp(e){const t=Date.now();this._refreshIntervalInfo={timestamp:t,sourceURL:e&&this._getImageSource(e,t)}}_setupMediaRefreshTimer(){this._clearMediaRefreshTimer();const{activeMediaInfo:e}=this.viewModel;"image"===e?.type&&e?.refreshInterval>0&&this._setRefreshTimeout(e)}_setRefreshTimeout(e){const{refreshInterval:t,value:i}=e,r=6e4*t;this._updateMediaInfoTimestamp(i.sourceURL);const a=setInterval((()=>{this._updateMediaInfoTimestamp(i.sourceURL)}),r);this._refreshTimer=a}_getImageSource(e,t){const i=e.includes("?")?"&":"?",[r,a=""]=e.split("#");return`${r}${i}timestamp=${t}${a?"#":""}${a}`}};e([a()],T.prototype,"_refreshIntervalInfo",void 0),e([a()],T.prototype,"attributes",null),e([a()],T.prototype,"activeMediaInfoIndex",null),e([a()],T.prototype,"description",null),e([a()],T.prototype,"fieldInfoMap",null),e([a()],T.prototype,"layer",null),e([a()],T.prototype,"mediaInfos",null),e([a()],T.prototype,"popupTemplate",null),e([a()],T.prototype,"relatedInfos",null),e([a()],T.prototype,"title",null),e([a({type:l})],T.prototype,"viewModel",void 0),e([a(),h("esri/widgets/Feature/t9n/Feature")],T.prototype,"messages",void 0),T=e([o("esri.widgets.Feature.FeatureMedia")],T);const b=T;export{b as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.31/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../chunks/tslib.es6.js";import"../../intl.js";import t from"../../core/Collection.js";import{referenceSetter as i}from"../../core/collectionUtils.js";import{deprecatedFunction as s}from"../../core/deprecate.js";import o from"../../core/Handles.js";import r from"../../core/Logger.js";import{debounce as n,ignoreAbortErrors as l}from"../../core/promiseUtils.js";import{watch as a,initial as h,on as d}from"../../core/reactiveUtils.js";import{property as g}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/RandomLCG.js";import{subclass as m}from"../../core/accessorSupport/decorators/subclass.js";import{getLowerCaseDefaultHiddenFields as c}from"../../layers/support/fieldUtils.js";import{getTimeZoneFormattingOptions as p,system as u}from"../../time/timeZoneUtils.js";import{highlightsSupported as f}from"../../views/support/layerViewUtils.js";import{isSelectableLayer as y}from"../../views/support/selectionUtils.js";import b from"./ActionColumn.js";import _ from"./AttachmentsColumn.js";import I from"./FieldColumn.js";import C from"./RelationshipColumn.js";import v from"./Grid/Column.js";import w from"./Grid/Grid.js";import E from"./Grid/GridViewModel.js";import T from"./Grid/GroupColumn.js";import S from"./support/FeatureStore.js";import j from"./support/TableTemplate.js";import{uniqueColumnNames as F}from"./support/tableUtils.js";import{exportToCSV as R}from"../support/exportUtils.js";import"../support/widgetUtils.js";import{messageBundle as x}from"../support/decorators/messageBundle.js";import{onLocaleChange as U}from"../../intl/locale.js";import{convertDateFormatToIntlOptions as O}from"../../intl/date.js";import{fetchMessageBundle as L}from"../../intl/messages.js";let z=class extends E{constructor(e){super(e),this._debounceRefresh=n((()=>this._refresh())),this._highlights=new o,this.actionColumnConfig=null,this.autoRefreshEnabled=!0,this.columns=new t,this.dataProvider=async(e,t)=>{const{layer:i,store:s}=this;if(!t)return;if(!i||!s)return void(t&&t([]));await i.load();const{objectIds:o}=this;if(this.filterBySelectionEnabled&&!this.highlightIds.length||1===o.length&&-1===o.items[0])return void t([]);"loaded"!==s.state&&"loading"!==s.state&&await s.load();const r=this.paginationEnabled?this.pageIndex:e.page,n=await s.fetchItems({...e,page:r});t&&t(n)},this.editingEnabled=!1,this.grid=null,this.highlightEnabled=!0,this.itemIdPath="objectId",this.layer=null,this.messages=null,this.messagesCommon=null,this.messagesURIUtils=null,this.relationshipColumnConfigs=null,this.selectionSource="table",this.showRelatedTableCallback=null,this.store=null,this.tableTemplate=null,this.tableTemplateOverride=null,this.timeZone=null,this._onLayerRefresh=this._onLayerRefresh.bind(this),this._set("store",new S),this._set("grid",new w({itemIdPath:this.itemIdPath,viewModel:this}))}initialize(){const e=async()=>{this.messages=await L("esri/widgets/FeatureTable/t9n/FeatureTable"),this.messagesCommon=await L("esri/t9n/common"),this.messagesURIUtils=await L("esri/widgets/support/t9n/uriUtils")};e(),this.addHandles([U((()=>{e(),this._generateColumns()})),a((()=>[this.messages,this.messagesCommon,this.messagesURIUtils]),(()=>{const e=this.messages;this.grid&&(this.grid.messages=e),this.columns.forEach((t=>{t.messages=e,t.messagesCommon=this.messagesCommon,t.messagesURIUtils=this.messagesURIUtils})),this._requestContentUpdate()}),h),d((()=>this.highlightIds),"change",(e=>this._onHighlightIdsChange(e)),{onListenerAdd:()=>this._syncSelection(),onListenerRemove:()=>this._highlights.removeAll()}),a((()=>this.attachmentsEnabled),(e=>{const{attachmentsColumn:t,columns:i}=this;t&&i.remove(t),e&&i.length&&i.add(this._generateAttachmentsColumn(),this._getIndexOfFirstFrozenToEndColumn())})),a((()=>this._viewSelection),(()=>{this._viewSelectionReady&&(this.highlightIds.items=this._viewSelection)})),a((()=>[this._tableHighlightsReady,this._viewSelectionReady]),(()=>this._syncSelection())),a((()=>this.layer),(async(e,t)=>{const i=this.grid;i&&(i.clearSort(),e&&t&&await this.reset()),this.goToPage(0),this._drainColumns(),this.store.layer=e,e&&(e.loaded?this._onLayerLoad():e.load().catch((()=>{})))})),a((()=>this.layer?.loaded),(e=>e&&this._onLayerLoad())),a((()=>this.store.state),(e=>{"loaded"===e&&(this.scrollToTop(),this.refreshCellContent())})),a((()=>this._effectiveTableTemplate),(()=>{this.scrollLeft(),this.layer?.loaded&&this._generateColumns()})),a((()=>[this.timeZone,this.view?.timeZone]),(()=>{this.columns.forEach((e=>{if("field"in e&&e.field){const{timeZone:t,timeZoneName:i}=this._getTimeZoneInfoForFieldColumn(e.field);e.set({timeZone:t,timeZoneName:i})}})),this._requestContentUpdate()})),a((()=>this.editingEnabled),(e=>{this.editorColumns.forEach((t=>t.tableEditingEnabled=e)),this._requestContentUpdate()})),a((()=>this.layer?.definitionExpression),((e,t)=>(e||t)&&"loaded"===this.store.state&&this.reset())),a((()=>this.layer?.timeExtent),((e,t)=>(e||t)&&!this.timeExtent&&"loaded"===this.store.state&&this.reset())),d((()=>this.layer),"refresh",(e=>this._onLayerRefresh(e))),d((()=>this.grid),["cell-click","cell-dblclick","cell-pointerover","cell-pointerout","cell-keydown"],(({index:e,item:t,native:i,path:s,type:o})=>{const r=t?.feature;this.emit(o,{feature:r,index:e,native:i,type:o,fieldName:s??void 0,objectId:r?.getObjectId()})})),a((()=>this.actionColumnConfig),(e=>{const{actionColumn:t,columns:i}=this;t?e?t.set(e):i.remove(t):e&&i.length&&i.add(this._generateActionColumn(),!1!==e.frozenToEnd?void 0:this._getIndexOfFirstFrozenToEndColumn())})),a((()=>[this.relationshipColumnConfigs?.length,this.relatedRecordsEnabled]),(([e,t])=>{const{columns:i,relationshipColumns:s}=this;s.length&&i.removeMany(s),i.length&&t&&i.addMany(this._generateRelationshipColumns(),this._getIndexOfFirstFrozenToEndColumn())})),d((()=>this.objectIds),"change",(()=>this._onObjectIdsChange()),{onListenerAdd:()=>this._onObjectIdsChange()}),a((()=>[this.paginationEnabled,this.pageIndex]),(()=>this.refreshPageCache())),a((()=>this.activeSortOrders),(e=>this.store.sortOrders=e)),a((()=>this.pageCount),(()=>{this.pageIndex>=this.pageCount&&this.goToPage(0)}))])}destroy(){this._drainColumns(),this._highlights.removeAll(),this._highlights.destroy(),this.grid?.destroy(),this.columns.destroyed||this.columns.destroy(),this.layer=null,this.view=null}get _defaultHiddenFields(){return c(this.layer)}get _effectiveTableTemplate(){return this.tableTemplateOverride||this.tableTemplate}get _highlightableLayerView(){const e=this.layerView;return f(e)?e:null}get _relationshipInfos(){return this.store.relationshipInfos}get _selectionManager(){const{view:e}=this;return!e||e.destroyed?null:e.selectionManager?.sources?.length?e.selectionManager:null}get _selectableLayer(){const{layer:e}=this;return y(e)&&this._selectionManager?.sources.includes(e)?e:null}get _tableHighlightsReady(){return!("table"!==this.selectionSource||!this.highlightEnabled||!this._highlightableLayerView)}get _viewSelection(){const{_selectableLayer:e}=this;return e?this._selectionManager?.getSelection(e)??[]:[]}get _viewSelectionReady(){return!(!this.layer||"view"!==this.selectionSource||!this._selectionManager)}get activeFilters(){const{filterGeometry:e,objectIds:i,filterBySelectionEnabled:s,highlightIds:o}=this,r=new t;return e&&r.push({type:"geometry",geometry:e}),s?r.push({type:"selection",objectIds:o.toArray()}):i.length&&r.push({type:"objectId",objectIds:i.toArray()}),r}get activeSortOrders(){return this.grid?.sortOrders?this.grid.sortOrders.map((({path:e,direction:t})=>({fieldName:e,direction:t}))).filter((e=>e.fieldName&&e.direction)):[]}get attachmentsEnabled(){return this.store.attachmentsEnabled}set attachmentsEnabled(e){this.store.attachmentsEnabled=e}get filterGeometry(){return this.store.filterGeometry}set filterGeometry(e){this.store.filterGeometry=e}get filterBySelectionEnabled(){return!!this._get("filterBySelectionEnabled")}set filterBySelectionEnabled(e){const{objectIds:t}=this,i=t.length;e?(i&&(t.removeAll(),this._logWarning("Selection filter has been applied with an objectID filter. Object ID filter has been removed.")),this.filterGeometry&&this._logWarning("Selection filter has been applied with a geometry filter. Results may appear inconsistent"),this._syncObjectIdsWithStore(this.highlightIds.toArray())):i||this._syncObjectIdsWithStore(null),this._set("filterBySelectionEnabled",e)}get hiddenFields(){return this._get("hiddenFields")??new t}set hiddenFields(e){this._set("hiddenFields",i(e,this._get("hiddenFields"),t))}get isQueryingOrSyncing(){const{store:e}=this;return e?.syncing||e?.querying}get layerView(){return this.store.layerView}get outFields(){return this.store.outFields}set outFields(e){this.store.outFields=e}get relatedRecordsEnabled(){return this.store.relatedRecordsEnabled}set relatedRecordsEnabled(e){this.store.relatedRecordsEnabled=e}get relationship(){const e=this.relationshipConfig?.relationshipId;return null==e?null:this.relationships?.find((({id:t})=>t===e))}get relationshipConfig(){return this.store.relationshipConfig}set relationshipConfig(e){this.objectIds.removeAll(),this.filterBySelectionEnabled=!1,this.store.relationshipConfig=e}get relationships(){return this.store.relationships}get returnGeometryEnabled(){return this.store.returnGeometry}set returnGeometryEnabled(e){this.store.returnGeometry=e}get returnMEnabled(){return this.store.returnM}set returnMEnabled(e){this.store.returnM=e}get returnZEnabled(){return this.store.returnZ}set returnZEnabled(e){this.store.returnZ=e}get timeExtent(){return this.store.timeExtent}set timeExtent(e){this.store.timeExtent=e}get view(){return this.store.view}set view(e){this.store.view=e}async deleteSelection(){const e=this.highlightIds.toArray();if(!e?.length)return;const{deleteFeatureResults:t}=await this.store.deleteRowsByObjectId(e),i=t.filter((e=>!e.error)).map((e=>e.objectId));i.length&&(this.highlightIds.removeMany(i),await this.refresh())}async exportSelectionToCSV(){const{highlightIds:e,layer:t,outFields:i}=this;t&&e.length?await R({layer:t,objectIds:e.toArray(),outFields:i}):this._logWarning("Export failed.")}filterBySelection(){this.filterBySelectionEnabled?this._logWarning("Property 'filterBySelectionEnabled' is already 'true'. This method has no effect."):(s(r.getLogger(this),"`FeatureTable.filterBySelection` is deprecated in favor of 'filterBySelectionEnabled' and 'objectIds'",{replacement:"FeatureTable.filterBySelectionEnabled or FeatureTable.objectIds",version:"4.30",warnOnce:!0}),this.objectIds.addMany(this.highlightIds.toArray()))}getObjectIdIndex(e){return this.store.getItemIndexByObjectId(e)}getValue(e,t){const i=this.store.getItemByObjectId(e);return i?.feature?.attributes[t]}getVirtualPageIndex(){return this.grid?.getVirtualPageIndex()??0}goToPage(e){if(null==e||!Number.isInteger(e))return void this._logWarning("Invalid 'page' parameter provided to 'goToPage()'. Current page will remain the same.");const{pageCount:t}=this;(e>=t||-1===e)&&(e=t-1),e<-1&&(e=0),e!==this.pageIndex&&(this.pageIndex=e),this.paginationEnabled||this.scrollToIndex(e*this.pageSize)}nextPage(){const e=this.paginationEnabled?this.pageIndex:this.getVirtualPageIndex();this.goToPage(e+1)}previousPage(){const e=this.paginationEnabled?this.pageIndex:this.getVirtualPageIndex();this.goToPage(e-1)}async refresh(){return l(this._debounceRefresh())}refreshCellContent(){this._requestContentUpdate()}refreshPageCache(){this.grid?.refreshPageCache()}async reset(){this.goToPage(0),await(this.grid?.reset())}scrollLeft(){this.grid?.scrollLeft(0)}scrollToBottom(){this.grid?.scrollToBottom()}scrollToIndex(e){this.grid?.scrollToIndex(e)}scrollToRow(e){const t=this.store.getItemIndexByObjectId(e);t>-1?this.grid?.scrollToIndex(t):this._logWarning("Row not found. Associated data may not be loaded yet.")}scrollToTop(){this.grid?.scrollToTop()}clearSelectionFilter(){s(r.getLogger(this),"`FeatureTable.clearSelectionFilter` is deprecated in favor of 'filterBySelectionEnabled' and 'objectIds'",{replacement:"FeatureTable.filterBySelectionEnabled or FeatureTable.objectIds",version:"4.30",warnOnce:!0}),this.objectIds.removeAll()}async zoomToSelection(){const{layer:e,view:t}=this,i=this.highlightIds.toArray();if(!e||!t||!i.length)return;const s=e.createQuery();s.objectIds=i,s.returnGeometry=!0;const o=await e.queryFeatures(s);try{await t.goTo(o.features)}catch(r){"AbortError"!==r.name&&console.error(r)}}_requestContentUpdate(){this.grid?.requestContentUpdate()}async _refresh(){await this.store.refreshLayerInfo();const e=this.highlightIds.toArray();if(e.length){(await this.store.verifyFeaturesByObjectId(e)).forEach(((t,i)=>{t||this.highlightIds.remove(e[i])}))}this.refreshPageCache()}_onLayerLoad(){const{layer:e,pageSize:t}=this;if(!e)return;const i=e.capabilities.query?.maxRecordCount,s=i&&i<t,o=s?i:t;s&&(this._logWarning("The value for 'pageSize' has been adjusted due to the provided layer's max record count."),this.pageSize=o),this.grid?.set("pageSize",o),this.store.load(),this._generateColumns()}_onLayerRefresh(e){this.autoRefreshEnabled&&e.dataChanged&&this.refresh()}_generateColumns(){this._drainColumns();const e=this._effectiveTableTemplate?.columnTemplates,t=e?this._generateColumnsFromTemplates(e):this._generateDefaultFieldColumns();t.length&&this.attachmentsEnabled&&t.push(this._generateAttachmentsColumn()),t.length&&this.relatedRecordsEnabled&&this._relationshipInfos.length&&t.push(...this._generateRelationshipColumns()),this.actionColumnConfig&&t.push(this._generateActionColumn()),t.sort(((e,t)=>e.frozen&&t.frozen||e.frozenToEnd&&t.frozenToEnd?0:e.frozen||t.frozenToEnd?-1:0)),this.columns.addMany(t)}_generateColumnsFromTemplates(e){const{editingEnabled:t,_effectiveTableTemplate:i,grid:s,layer:o,messages:r,messagesCommon:n,messagesURIUtils:l,store:a,timeZone:h}=this;if(!o)return[];const d=o.fields??[],g=[],m=e=>d.find((t=>e.fieldName.toLowerCase()===t.name?.toLowerCase()));return e.forEach((e=>{const{autoWidth:d,direction:c,flexGrow:p,fieldName:u,formatFunction:f,frozen:y,frozenToEnd:b,icon:_,initialSortPriority:C,invalid:w,label:E,menuConfig:S,resizable:j,sortable:F,textAlign:R,textWrap:x,type:U,width:O}=e;if(!U)return void this._logWarning("Property 'type' is missing from the provided template. Skipped generating a column for this template.");if(y&&b)return void this._logWarning("Both 'frozen' and 'frozenToEnd' cannot be true for a single template. Skipped generating a column for this template.");const L=!1===e.visible;if("group"===U){if(!e.columnTemplates?.length)return void this._logWarning("Group columns must contain column templates. Skipped generating a column for this template.");if(!e.label)return void this._logWarning("Group columns require a label. Skipped generating a column for this template.");const t=this._generateColumnsFromTemplates(e.columnTemplates),i=L||this._isFieldHidden(e.label);g.push(new T({autoWidth:d,columns:t,flexGrow:p,frozen:y,frozenToEnd:b,grid:s,hidden:i,icon:_,invalid:w,label:E,menuConfig:S,messages:r,messagesCommon:n,messagesURIUtils:l,resizable:j,textAlign:R,textWrap:x,width:O}))}if(!u)return void this._logWarning("'fieldName' was missing from the provided template. Skipped generating a column for this template.");const z=L||this._isFieldHidden(u);if("column"===U&&g.push(new v({autoWidth:d,direction:c,fieldName:u,flexGrow:p,formatFunction:f,frozen:y,frozenToEnd:b,grid:s,hidden:z,icon:_,initialSortPriority:C,invalid:w,label:E,menuConfig:S,messages:r,messagesCommon:n,messagesURIUtils:l,resizable:j,sortable:F,textAlign:R,textWrap:x,timeZone:h,width:O})),"field"===U){const h=m(e);if(!h)return void this._logWarning("A valid 'field' could not be found for the provided template. Skipped generating a column for this template.");const{editable:u,required:v}=e,T=i?.expressionInfos||null,{timeZone:U,timeZoneName:L}=this._getTimeZoneInfoForFieldColumn(h);g.push(new I({autoWidth:d,direction:c,editable:u,expressionInfos:T,field:h,fieldName:h.name,flexGrow:p,formatFunction:f,frozen:y,frozenToEnd:b,grid:s,hidden:z,icon:_,initialSortPriority:C,invalid:w,label:E,layer:o,messages:r,messagesCommon:n,messagesURIUtils:l,menuConfig:S,sortable:F,store:a,required:v,resizable:j,tableEditingEnabled:t,template:e,textAlign:R,textWrap:x,timeZone:U,timeZoneName:L,width:O}))}})),g}_generateDefaultFieldColumns(){const{editingEnabled:e,grid:t,layer:i,messages:s,messagesCommon:o,messagesURIUtils:r,store:n}=this,l=[];return i?.fields.length?(i.fields.forEach((a=>{if(!a.visible||"geometry"===a.type)return;const{timeZone:h,timeZoneName:d}=this._getTimeZoneInfoForFieldColumn(a),g=a.name;l.push(new I({field:a,fieldName:g,grid:t,hidden:this._isFieldHidden(g),layer:i,messages:s,messagesCommon:o,messagesURIUtils:r,store:n,tableEditingEnabled:e,timeZone:h,timeZoneName:d}))})),l):l}_getTimeZoneInfoForFieldColumn(e){const{layer:t,timeZone:i,view:s}=this;return!t||"date"!==e?.type&&"timestamp-offset"!==e?.type?{timeZone:void 0,timeZoneName:void 0}:p(t.preferredTimeZone||null,!!t.datesInUnknownTimezone,i??s?.timeZone??u,O("short-time"),e.type)}_generateAttachmentsColumn(){return new _({hidden:this._isFieldHidden(F.attachments),messages:this.messages})}_generateRelationshipColumns(){const{_relationshipInfos:e,grid:t,messages:i,messagesCommon:s,messagesURIUtils:o,relationshipColumnConfigs:r}=this,n=[];if(!e?.length)return n;const l={grid:t,messages:i,messagesCommon:s,messagesURIUtils:o};return r?r.forEach((t=>{const{relationshipId:i}=t,s=e.find((e=>e.relationshipId===i));s&&n.push(new C({...t,...l,fieldName:`${F.relationship}-${i}`,layer:s.relatedLayer,relatedLayer:s.layer,relationshipId:i,showRelatedTableCallback:e=>this._onShowRelatedTable(e)}))})):e.forEach((({layer:e,relatedLayer:t,relationshipId:i})=>{n.push(new C({...l,fieldName:`${F.relationship}-${i}`,layer:t,relatedLayer:e,relationshipId:i,showRelatedTableCallback:e=>this._onShowRelatedTable(e)}))})),n}_generateActionColumn(){return new b({hidden:this._isFieldHidden(F.action),...this.actionColumnConfig})}_isFieldHidden(e){const t=e?.toLowerCase();return(this.hiddenFields??this._defaultHiddenFields).some((e=>e.toLowerCase()===t))}_addTableHighlight(e){const{_highlightableLayerView:t,layer:i}=this;if(t&&i){const s=this.store.getItemByObjectId(e),o=s?.feature??e;this._highlights.add(t.highlight(o),`${i.id}-${e}`)}}_removeTableHighlight(e){const{layer:t}=this;t&&this._highlights.remove(`${t.id}-${e}`)}_syncSelection(){this._highlights.removeAll(),this._tableHighlightsReady?this.highlightIds.forEach((e=>this._addTableHighlight(e))):this._viewSelectionReady&&(this.highlightIds.items=this._viewSelection)}_appendToViewSelection(e){const{_selectableLayer:t}=this;t&&this._selectionManager?.appendToSelection(t,e)}_removeFromViewSelection(e){const{_selectableLayer:t}=this;t&&this._selectionManager?.removeFromSelection(t,e)}_onHighlightIdsChange(e){const{added:t,removed:i}=e;this._tableHighlightsReady?(i.forEach((e=>this._removeTableHighlight(e))),t.forEach((e=>this._addTableHighlight(e)))):this._viewSelectionReady&&(this._removeFromViewSelection(i),this._appendToViewSelection(t)),this.filterBySelectionEnabled&&this._syncObjectIdsWithStore(this.highlightIds.toArray())}_onShowRelatedTable(e){const{highlightIds:t}=this,{objectId:i}=e;t.removeAll(),t.add(i),this.showRelatedTableCallback?this.showRelatedTableCallback(e):this.emit("show-related-table",e)}_onObjectIdsChange(){const e=this.objectIds.toArray();e.length&&this.filterBySelectionEnabled&&(this.filterBySelectionEnabled=!1,this._logWarning("Object ID filter was applied while a selection filter was applied. Selection filter has been removed.")),this._syncObjectIdsWithStore(e)}_syncObjectIdsWithStore(e){this.store.objectIds=e,this.refreshPageCache()}_drainColumns(){this.columns.drain((e=>!e.destroyed&&e.destroy()))}_getIndexOfFirstFrozenToEndColumn(){const e=this.columns.findIndex((e=>e.frozenToEnd));return e>-1?e:void 0}_logWarning(e){r.getLogger(this).warn(e)}};e([g()],z.prototype,"_defaultHiddenFields",null),e([g()],z.prototype,"_effectiveTableTemplate",null),e([g()],z.prototype,"_highlights",void 0),e([g()],z.prototype,"_highlightableLayerView",null),e([g()],z.prototype,"_relationshipInfos",null),e([g()],z.prototype,"_selectionManager",null),e([g()],z.prototype,"_selectableLayer",null),e([g()],z.prototype,"_tableHighlightsReady",null),e([g()],z.prototype,"_viewSelection",null),e([g()],z.prototype,"_viewSelectionReady",null),e([g()],z.prototype,"actionColumnConfig",void 0),e([g()],z.prototype,"activeFilters",null),e([g({readOnly:!0})],z.prototype,"activeSortOrders",null),e([g()],z.prototype,"attachmentsEnabled",null),e([g()],z.prototype,"autoRefreshEnabled",void 0),e([g({readOnly:!0})],z.prototype,"columns",void 0),e([g()],z.prototype,"dataProvider",void 0),e([g()],z.prototype,"editingEnabled",void 0),e([g()],z.prototype,"filterGeometry",null),e([g()],z.prototype,"filterBySelectionEnabled",null),e([g({readOnly:!0})],z.prototype,"grid",void 0),e([g()],z.prototype,"hiddenFields",null),e([g()],z.prototype,"highlightEnabled",void 0),e([g()],z.prototype,"isQueryingOrSyncing",null),e([g({readOnly:!0})],z.prototype,"itemIdPath",void 0),e([g()],z.prototype,"layer",void 0),e([g()],z.prototype,"layerView",null),e([g()],z.prototype,"messages",void 0),e([g(),x("esri/t9n/common")],z.prototype,"messagesCommon",void 0),e([g(),x("esri/widgets/support/t9n/uriUtils")],z.prototype,"messagesURIUtils",void 0),e([g()],z.prototype,"outFields",null),e([g()],z.prototype,"relatedRecordsEnabled",null),e([g()],z.prototype,"relationship",null),e([g()],z.prototype,"relationshipColumnConfigs",void 0),e([g()],z.prototype,"relationshipConfig",null),e([g()],z.prototype,"relationships",null),e([g()],z.prototype,"returnGeometryEnabled",null),e([g()],z.prototype,"returnMEnabled",null),e([g()],z.prototype,"returnZEnabled",null),e([g()],z.prototype,"selectionSource",void 0),e([g()],z.prototype,"showRelatedTableCallback",void 0),e([g({readOnly:!0,type:S})],z.prototype,"store",void 0),e([g({type:j})],z.prototype,"tableTemplate",void 0),e([g()],z.prototype,"tableTemplateOverride",void 0),e([g()],z.prototype,"timeExtent",null),e([g()],z.prototype,"timeZone",void 0),e([g()],z.prototype,"view",null),z=e([m("esri.widgets.FeatureTable.FeatureTableViewModel")],z);const A=z;export{A as default};
5
+ import{_ as e}from"../../chunks/tslib.es6.js";import"../../intl.js";import t from"../../core/Collection.js";import{referenceSetter as i}from"../../core/collectionUtils.js";import{deprecatedFunction as s}from"../../core/deprecate.js";import o from"../../core/Handles.js";import r from"../../core/Logger.js";import{debounce as n,ignoreAbortErrors as l}from"../../core/promiseUtils.js";import{watch as a,initial as h,on as d}from"../../core/reactiveUtils.js";import{property as g}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/RandomLCG.js";import{subclass as m}from"../../core/accessorSupport/decorators/subclass.js";import{getLowerCaseDefaultHiddenFields as c}from"../../layers/support/fieldUtils.js";import{getTimeZoneFormattingOptions as p,system as u}from"../../time/timeZoneUtils.js";import{highlightsSupported as f}from"../../views/support/layerViewUtils.js";import{isSelectableLayer as y}from"../../views/support/selectionUtils.js";import b from"./ActionColumn.js";import _ from"./AttachmentsColumn.js";import I from"./FieldColumn.js";import C from"./RelationshipColumn.js";import v from"./Grid/Column.js";import w from"./Grid/Grid.js";import E from"./Grid/GridViewModel.js";import T from"./Grid/GroupColumn.js";import S from"./support/FeatureStore.js";import j from"./support/TableTemplate.js";import{uniqueColumnNames as F}from"./support/tableUtils.js";import{exportToCSV as R}from"../support/exportUtils.js";import"../support/widgetUtils.js";import{messageBundle as x}from"../support/decorators/messageBundle.js";import{onLocaleChange as U}from"../../intl/locale.js";import{convertDateFormatToIntlOptions as O}from"../../intl/date.js";import{fetchMessageBundle as L}from"../../intl/messages.js";let z=class extends E{constructor(e){super(e),this._debounceRefresh=n((()=>this._refresh())),this._highlights=new o,this.actionColumnConfig=null,this.autoRefreshEnabled=!0,this.columns=new t,this.dataProvider=async(e,t)=>{const{layer:i,store:s}=this;if(!t)return;if(!i||!s)return void(t&&t([]));await i.load();const{objectIds:o}=this;if(this.filterBySelectionEnabled&&!this.highlightIds.length||1===o.length&&-1===o.items[0])return void t([]);"loaded"!==s.state&&"loading"!==s.state&&await s.load();const r=this.paginationEnabled?this.pageIndex:e.page,n=await s.fetchItems({...e,page:r});t&&t(n)},this.editingEnabled=!1,this.grid=null,this.highlightEnabled=!0,this.itemIdPath="objectId",this.layer=null,this.messages=null,this.messagesCommon=null,this.messagesURIUtils=null,this.relationshipColumnConfigs=null,this.selectionSource="table",this.showRelatedTableCallback=null,this.store=null,this.tableTemplate=null,this.tableTemplateOverride=null,this.timeZone=null,this._onLayerRefresh=this._onLayerRefresh.bind(this),this._set("store",new S),this._set("grid",new w({itemIdPath:this.itemIdPath,viewModel:this}))}initialize(){const e=async()=>{this.messages=await L("esri/widgets/FeatureTable/t9n/FeatureTable"),this.messagesCommon=await L("esri/t9n/common"),this.messagesURIUtils=await L("esri/widgets/support/t9n/uriUtils")};e(),this.addHandles([U((()=>{e(),this._generateColumns()})),a((()=>[this.messages,this.messagesCommon,this.messagesURIUtils]),(()=>{const e=this.messages;this.grid&&(this.grid.messages=e),this.columns.forEach((t=>{t.messages=e,t.messagesCommon=this.messagesCommon,t.messagesURIUtils=this.messagesURIUtils})),this._requestContentUpdate()}),h),d((()=>this.highlightIds),"change",(e=>this._onHighlightIdsChange(e)),{onListenerAdd:()=>this._syncSelection(),onListenerRemove:()=>this._highlights.removeAll()}),a((()=>this.attachmentsEnabled),(e=>{const{attachmentsColumn:t,columns:i}=this;t&&i.remove(t),e&&i.length&&i.add(this._generateAttachmentsColumn(),this._getIndexOfFirstFrozenToEndColumn())})),a((()=>this._viewSelection),(()=>{this._viewSelectionReady&&(this.highlightIds.items=this._viewSelection)})),a((()=>[this._tableHighlightsReady,this._viewSelectionReady]),(()=>this._syncSelection())),a((()=>this.layer),(async(e,t)=>{const i=this.grid;i&&(i.clearSort(),e&&t&&await this.reset()),this.goToPage(0),this._drainColumns(),this.store.layer=e,e&&(e.loaded?this._onLayerLoad():e.load().catch((()=>{})))})),a((()=>this.layer?.loaded),(e=>e&&this._onLayerLoad())),a((()=>this.store.state),(e=>{"loaded"===e&&(this.scrollToTop(),this.refreshCellContent())})),a((()=>this._effectiveTableTemplate),(()=>{this.scrollLeft(),this.layer?.loaded&&this._generateColumns()})),a((()=>[this.timeZone,this.view?.timeZone]),(()=>{this.columns.forEach((e=>{if("field"in e&&e.field){const{timeZone:t,timeZoneName:i}=this._getTimeZoneInfoForFieldColumn(e.field);e.set({timeZone:t,timeZoneName:i})}})),this._requestContentUpdate()})),a((()=>this.editingEnabled),(e=>{this.editorColumns.forEach((t=>t.tableEditingEnabled=e)),this._requestContentUpdate()})),a((()=>this.layer?.definitionExpression),((e,t)=>(e||t)&&"loaded"===this.store.state&&this.reset())),a((()=>this.layer?.timeExtent),((e,t)=>(e||t)&&!this.timeExtent&&"loaded"===this.store.state&&this.reset())),d((()=>this.layer),"refresh",(e=>this._onLayerRefresh(e))),d((()=>this.grid),["cell-click","cell-dblclick","cell-pointerover","cell-pointerout","cell-keydown"],(({index:e,item:t,native:i,path:s,type:o})=>{const r=t?.feature;this.emit(o,{feature:r,index:e,native:i,type:o,fieldName:s??void 0,objectId:r?.getObjectId()})})),a((()=>this.actionColumnConfig),(e=>{const{actionColumn:t,columns:i}=this;t?e?t.set(e):i.remove(t):e&&i.length&&i.add(this._generateActionColumn(),!1!==e.frozenToEnd?void 0:this._getIndexOfFirstFrozenToEndColumn())})),a((()=>[this.relationshipColumnConfigs?.length,this.relatedRecordsEnabled]),(([e,t])=>{const{columns:i,relationshipColumns:s}=this;s.length&&i.removeMany(s),i.length&&t&&i.addMany(this._generateRelationshipColumns(),this._getIndexOfFirstFrozenToEndColumn())})),d((()=>this.objectIds),"change",(()=>this._onObjectIdsChange()),{onListenerAdd:()=>this._onObjectIdsChange()}),a((()=>[this.paginationEnabled,this.pageIndex]),(()=>this.refreshPageCache())),a((()=>this.activeSortOrders),(e=>this.store.sortOrders=e)),a((()=>this.pageCount),(()=>{this.pageIndex>=this.pageCount&&this.goToPage(0)}))])}destroy(){this._drainColumns(),this._highlights.removeAll(),this._highlights.destroy(),this.grid?.destroy(),this.columns.destroyed||this.columns.destroy(),this.layer=null,this.view=null}get _defaultHiddenFields(){return c(this.layer)}get _effectiveTableTemplate(){return this.tableTemplateOverride||this.tableTemplate}get _highlightableLayerView(){const e=this.layerView;return f(e)?e:null}get _relationshipInfos(){return this.store.relationshipInfos}get _selectionManager(){const{view:e}=this;return!e||e.destroyed?null:e.selectionManager?.sources?.length?e.selectionManager:null}get _selectableLayer(){const{layer:e}=this;return y(e)&&this._selectionManager?.sources.includes(e)?e:null}get _tableHighlightsReady(){return!("table"!==this.selectionSource||!this.highlightEnabled||!this._highlightableLayerView)}get _viewSelection(){const{_selectableLayer:e}=this;return e?this._selectionManager?.getSelection(e)??[]:[]}get _viewSelectionReady(){return!(!this.layer||"view"!==this.selectionSource||!this._selectionManager)}get activeFilters(){const{filterGeometry:e,objectIds:i,filterBySelectionEnabled:s,highlightIds:o}=this,r=new t;return e&&r.push({type:"geometry",geometry:e}),s?r.push({type:"selection",objectIds:o.toArray()}):i.length&&r.push({type:"objectId",objectIds:i.toArray()}),r}get activeSortOrders(){return this.grid?.sortOrders?this.grid.sortOrders.map((({path:e,direction:t})=>({fieldName:e,direction:t}))).filter((e=>e.fieldName&&e.direction)):[]}get attachmentsEnabled(){return this.store.attachmentsEnabled}set attachmentsEnabled(e){this.store.attachmentsEnabled=e}get filterGeometry(){return this.store.filterGeometry}set filterGeometry(e){this.store.filterGeometry=e}get filterBySelectionEnabled(){return!!this._get("filterBySelectionEnabled")}set filterBySelectionEnabled(e){const{objectIds:t}=this,i=t.length;e?(i&&(t.removeAll(),this._logWarning("Selection filter has been applied with an objectID filter. Object ID filter has been removed.")),this.filterGeometry&&this._logWarning("Selection filter has been applied with a geometry filter. Results may appear inconsistent"),this._syncObjectIdsWithStore(this.highlightIds.toArray())):i||this._syncObjectIdsWithStore(null),this._set("filterBySelectionEnabled",e)}get hiddenFields(){return this._get("hiddenFields")??new t}set hiddenFields(e){this._set("hiddenFields",i(e,this._get("hiddenFields"),t))}get isQueryingOrSyncing(){const{store:e}=this;return e?.syncing||e?.querying}get layerView(){return this.store.layerView}get outFields(){return this.store.outFields}set outFields(e){this.store.outFields=e}get relatedRecordsEnabled(){return this.store.relatedRecordsEnabled}set relatedRecordsEnabled(e){this.store.relatedRecordsEnabled=e}get relationship(){const e=this.relationshipConfig?.relationshipId;return null==e?null:this.relationships?.find((({id:t})=>t===e))}get relationshipConfig(){return this.store.relationshipConfig}set relationshipConfig(e){this.objectIds.removeAll(),this.filterBySelectionEnabled=!1,this.store.relationshipConfig=e}get relationships(){return this.store.relationships}get returnGeometryEnabled(){return this.store.returnGeometry}set returnGeometryEnabled(e){this.store.returnGeometry=e}get returnMEnabled(){return this.store.returnM}set returnMEnabled(e){this.store.returnM=e}get returnZEnabled(){return this.store.returnZ}set returnZEnabled(e){this.store.returnZ=e}get timeExtent(){return this.store.timeExtent}set timeExtent(e){this.store.timeExtent=e}get view(){return this.store.view}set view(e){this.store.view=e}async deleteSelection(){const e=this.highlightIds.toArray();if(!e?.length)return;const{deleteFeatureResults:t}=await this.store.deleteRowsByObjectId(e),i=t.filter((e=>!e.error)).map((e=>e.objectId));i.length&&(this.highlightIds.removeMany(i),await this.refresh())}async exportSelectionToCSV(e){const{highlightIds:t,layer:i,outFields:s}=this;i&&t.length?await R({layer:i,objectIds:t.toArray(),outFields:s,includeGeometry:e}):this._logWarning("Export failed.")}filterBySelection(){this.filterBySelectionEnabled?this._logWarning("Property 'filterBySelectionEnabled' is already 'true'. This method has no effect."):(s(r.getLogger(this),"`FeatureTable.filterBySelection` is deprecated in favor of 'filterBySelectionEnabled' and 'objectIds'",{replacement:"FeatureTable.filterBySelectionEnabled or FeatureTable.objectIds",version:"4.30",warnOnce:!0}),this.objectIds.addMany(this.highlightIds.toArray()))}getObjectIdIndex(e){return this.store.getItemIndexByObjectId(e)}getValue(e,t){const i=this.store.getItemByObjectId(e);return i?.feature?.attributes[t]}getVirtualPageIndex(){return this.grid?.getVirtualPageIndex()??0}goToPage(e){if(null==e||!Number.isInteger(e))return void this._logWarning("Invalid 'page' parameter provided to 'goToPage()'. Current page will remain the same.");const{pageCount:t}=this;(e>=t||-1===e)&&(e=t-1),e<-1&&(e=0),e!==this.pageIndex&&(this.pageIndex=e),this.paginationEnabled||this.scrollToIndex(e*this.pageSize)}nextPage(){const e=this.paginationEnabled?this.pageIndex:this.getVirtualPageIndex();this.goToPage(e+1)}previousPage(){const e=this.paginationEnabled?this.pageIndex:this.getVirtualPageIndex();this.goToPage(e-1)}async refresh(){return l(this._debounceRefresh())}refreshCellContent(){this._requestContentUpdate()}refreshPageCache(){this.grid?.refreshPageCache()}async reset(){this.goToPage(0),await(this.grid?.reset())}scrollLeft(){this.grid?.scrollLeft(0)}scrollToBottom(){this.grid?.scrollToBottom()}scrollToIndex(e){this.grid?.scrollToIndex(e)}scrollToRow(e){const t=this.store.getItemIndexByObjectId(e);t>-1?this.grid?.scrollToIndex(t):this._logWarning("Row not found. Associated data may not be loaded yet.")}scrollToTop(){this.grid?.scrollToTop()}clearSelectionFilter(){s(r.getLogger(this),"`FeatureTable.clearSelectionFilter` is deprecated in favor of 'filterBySelectionEnabled' and 'objectIds'",{replacement:"FeatureTable.filterBySelectionEnabled or FeatureTable.objectIds",version:"4.30",warnOnce:!0}),this.objectIds.removeAll()}async zoomToSelection(){const{layer:e,view:t}=this,i=this.highlightIds.toArray();if(!e||!t||!i.length)return;const s=e.createQuery();s.objectIds=i,s.returnGeometry=!0;const o=await e.queryFeatures(s);try{await t.goTo(o.features)}catch(r){"AbortError"!==r.name&&console.error(r)}}_requestContentUpdate(){this.grid?.requestContentUpdate()}async _refresh(){await this.store.refreshLayerInfo();const e=this.highlightIds.toArray();if(e.length){(await this.store.verifyFeaturesByObjectId(e)).forEach(((t,i)=>{t||this.highlightIds.remove(e[i])}))}this.refreshPageCache()}_onLayerLoad(){const{layer:e,pageSize:t}=this;if(!e)return;const i=e.capabilities.query?.maxRecordCount,s=i&&i<t,o=s?i:t;s&&(this._logWarning("The value for 'pageSize' has been adjusted due to the provided layer's max record count."),this.pageSize=o),this.grid?.set("pageSize",o),this.store.load(),this._generateColumns()}_onLayerRefresh(e){this.autoRefreshEnabled&&e.dataChanged&&this.refresh()}_generateColumns(){this._drainColumns();const e=this._effectiveTableTemplate?.columnTemplates,t=e?this._generateColumnsFromTemplates(e):this._generateDefaultFieldColumns();t.length&&this.attachmentsEnabled&&t.push(this._generateAttachmentsColumn()),t.length&&this.relatedRecordsEnabled&&this._relationshipInfos.length&&t.push(...this._generateRelationshipColumns()),this.actionColumnConfig&&t.push(this._generateActionColumn()),t.sort(((e,t)=>e.frozen&&t.frozen||e.frozenToEnd&&t.frozenToEnd?0:e.frozen||t.frozenToEnd?-1:0)),this.columns.addMany(t)}_generateColumnsFromTemplates(e){const{editingEnabled:t,_effectiveTableTemplate:i,grid:s,layer:o,messages:r,messagesCommon:n,messagesURIUtils:l,store:a,timeZone:h}=this;if(!o)return[];const d=o.fields??[],g=[],m=e=>d.find((t=>e.fieldName.toLowerCase()===t.name?.toLowerCase()));return e.forEach((e=>{const{autoWidth:d,direction:c,flexGrow:p,fieldName:u,formatFunction:f,frozen:y,frozenToEnd:b,icon:_,initialSortPriority:C,invalid:w,label:E,menuConfig:S,resizable:j,sortable:F,textAlign:R,textWrap:x,type:U,width:O}=e;if(!U)return void this._logWarning("Property 'type' is missing from the provided template. Skipped generating a column for this template.");if(y&&b)return void this._logWarning("Both 'frozen' and 'frozenToEnd' cannot be true for a single template. Skipped generating a column for this template.");const L=!1===e.visible;if("group"===U){if(!e.columnTemplates?.length)return void this._logWarning("Group columns must contain column templates. Skipped generating a column for this template.");if(!e.label)return void this._logWarning("Group columns require a label. Skipped generating a column for this template.");const t=this._generateColumnsFromTemplates(e.columnTemplates),i=L||this._isFieldHidden(e.label);g.push(new T({autoWidth:d,columns:t,flexGrow:p,frozen:y,frozenToEnd:b,grid:s,hidden:i,icon:_,invalid:w,label:E,menuConfig:S,messages:r,messagesCommon:n,messagesURIUtils:l,resizable:j,textAlign:R,textWrap:x,width:O}))}if(!u)return void this._logWarning("'fieldName' was missing from the provided template. Skipped generating a column for this template.");const z=L||this._isFieldHidden(u);if("column"===U&&g.push(new v({autoWidth:d,direction:c,fieldName:u,flexGrow:p,formatFunction:f,frozen:y,frozenToEnd:b,grid:s,hidden:z,icon:_,initialSortPriority:C,invalid:w,label:E,menuConfig:S,messages:r,messagesCommon:n,messagesURIUtils:l,resizable:j,sortable:F,textAlign:R,textWrap:x,timeZone:h,width:O})),"field"===U){const h=m(e);if(!h)return void this._logWarning("A valid 'field' could not be found for the provided template. Skipped generating a column for this template.");const{editable:u,required:v}=e,T=i?.expressionInfos||null,{timeZone:U,timeZoneName:L}=this._getTimeZoneInfoForFieldColumn(h);g.push(new I({autoWidth:d,direction:c,editable:u,expressionInfos:T,field:h,fieldName:h.name,flexGrow:p,formatFunction:f,frozen:y,frozenToEnd:b,grid:s,hidden:z,icon:_,initialSortPriority:C,invalid:w,label:E,layer:o,messages:r,messagesCommon:n,messagesURIUtils:l,menuConfig:S,sortable:F,store:a,required:v,resizable:j,tableEditingEnabled:t,template:e,textAlign:R,textWrap:x,timeZone:U,timeZoneName:L,width:O}))}})),g}_generateDefaultFieldColumns(){const{editingEnabled:e,grid:t,layer:i,messages:s,messagesCommon:o,messagesURIUtils:r,store:n}=this,l=[];return i?.fields.length?(i.fields.forEach((a=>{if(!a.visible||"geometry"===a.type)return;const{timeZone:h,timeZoneName:d}=this._getTimeZoneInfoForFieldColumn(a),g=a.name;l.push(new I({field:a,fieldName:g,grid:t,hidden:this._isFieldHidden(g),layer:i,messages:s,messagesCommon:o,messagesURIUtils:r,store:n,tableEditingEnabled:e,timeZone:h,timeZoneName:d}))})),l):l}_getTimeZoneInfoForFieldColumn(e){const{layer:t,timeZone:i,view:s}=this;return!t||"date"!==e?.type&&"timestamp-offset"!==e?.type?{timeZone:void 0,timeZoneName:void 0}:p(t.preferredTimeZone||null,!!t.datesInUnknownTimezone,i??s?.timeZone??u,O("short-time"),e.type)}_generateAttachmentsColumn(){return new _({hidden:this._isFieldHidden(F.attachments),messages:this.messages})}_generateRelationshipColumns(){const{_relationshipInfos:e,grid:t,messages:i,messagesCommon:s,messagesURIUtils:o,relationshipColumnConfigs:r}=this,n=[];if(!e?.length)return n;const l={grid:t,messages:i,messagesCommon:s,messagesURIUtils:o};return r?r.forEach((t=>{const{relationshipId:i}=t,s=e.find((e=>e.relationshipId===i));s&&n.push(new C({...t,...l,fieldName:`${F.relationship}-${i}`,layer:s.relatedLayer,relatedLayer:s.layer,relationshipId:i,showRelatedTableCallback:e=>this._onShowRelatedTable(e)}))})):e.forEach((({layer:e,relatedLayer:t,relationshipId:i})=>{n.push(new C({...l,fieldName:`${F.relationship}-${i}`,layer:t,relatedLayer:e,relationshipId:i,showRelatedTableCallback:e=>this._onShowRelatedTable(e)}))})),n}_generateActionColumn(){return new b({hidden:this._isFieldHidden(F.action),...this.actionColumnConfig})}_isFieldHidden(e){const t=e?.toLowerCase();return(this.hiddenFields??this._defaultHiddenFields).some((e=>e.toLowerCase()===t))}_addTableHighlight(e){const{_highlightableLayerView:t,layer:i}=this;if(t&&i){const s=this.store.getItemByObjectId(e),o=s?.feature??e;this._highlights.add(t.highlight(o),`${i.id}-${e}`)}}_removeTableHighlight(e){const{layer:t}=this;t&&this._highlights.remove(`${t.id}-${e}`)}_syncSelection(){this._highlights.removeAll(),this._tableHighlightsReady?this.highlightIds.forEach((e=>this._addTableHighlight(e))):this._viewSelectionReady&&(this.highlightIds.items=this._viewSelection)}_appendToViewSelection(e){const{_selectableLayer:t}=this;t&&this._selectionManager?.appendToSelection(t,e)}_removeFromViewSelection(e){const{_selectableLayer:t}=this;t&&this._selectionManager?.removeFromSelection(t,e)}_onHighlightIdsChange(e){const{added:t,removed:i}=e;this._tableHighlightsReady?(i.forEach((e=>this._removeTableHighlight(e))),t.forEach((e=>this._addTableHighlight(e)))):this._viewSelectionReady&&(this._removeFromViewSelection(i),this._appendToViewSelection(t)),this.filterBySelectionEnabled&&this._syncObjectIdsWithStore(this.highlightIds.toArray())}_onShowRelatedTable(e){const{highlightIds:t}=this,{objectId:i}=e;t.removeAll(),t.add(i),this.showRelatedTableCallback?this.showRelatedTableCallback(e):this.emit("show-related-table",e)}_onObjectIdsChange(){const e=this.objectIds.toArray();e.length&&this.filterBySelectionEnabled&&(this.filterBySelectionEnabled=!1,this._logWarning("Object ID filter was applied while a selection filter was applied. Selection filter has been removed.")),this._syncObjectIdsWithStore(e)}_syncObjectIdsWithStore(e){this.store.objectIds=e,this.refreshPageCache()}_drainColumns(){this.columns.drain((e=>!e.destroyed&&e.destroy()))}_getIndexOfFirstFrozenToEndColumn(){const e=this.columns.findIndex((e=>e.frozenToEnd));return e>-1?e:void 0}_logWarning(e){r.getLogger(this).warn(e)}};e([g()],z.prototype,"_defaultHiddenFields",null),e([g()],z.prototype,"_effectiveTableTemplate",null),e([g()],z.prototype,"_highlights",void 0),e([g()],z.prototype,"_highlightableLayerView",null),e([g()],z.prototype,"_relationshipInfos",null),e([g()],z.prototype,"_selectionManager",null),e([g()],z.prototype,"_selectableLayer",null),e([g()],z.prototype,"_tableHighlightsReady",null),e([g()],z.prototype,"_viewSelection",null),e([g()],z.prototype,"_viewSelectionReady",null),e([g()],z.prototype,"actionColumnConfig",void 0),e([g()],z.prototype,"activeFilters",null),e([g({readOnly:!0})],z.prototype,"activeSortOrders",null),e([g()],z.prototype,"attachmentsEnabled",null),e([g()],z.prototype,"autoRefreshEnabled",void 0),e([g({readOnly:!0})],z.prototype,"columns",void 0),e([g()],z.prototype,"dataProvider",void 0),e([g()],z.prototype,"editingEnabled",void 0),e([g()],z.prototype,"filterGeometry",null),e([g()],z.prototype,"filterBySelectionEnabled",null),e([g({readOnly:!0})],z.prototype,"grid",void 0),e([g()],z.prototype,"hiddenFields",null),e([g()],z.prototype,"highlightEnabled",void 0),e([g()],z.prototype,"isQueryingOrSyncing",null),e([g({readOnly:!0})],z.prototype,"itemIdPath",void 0),e([g()],z.prototype,"layer",void 0),e([g()],z.prototype,"layerView",null),e([g()],z.prototype,"messages",void 0),e([g(),x("esri/t9n/common")],z.prototype,"messagesCommon",void 0),e([g(),x("esri/widgets/support/t9n/uriUtils")],z.prototype,"messagesURIUtils",void 0),e([g()],z.prototype,"outFields",null),e([g()],z.prototype,"relatedRecordsEnabled",null),e([g()],z.prototype,"relationship",null),e([g()],z.prototype,"relationshipColumnConfigs",void 0),e([g()],z.prototype,"relationshipConfig",null),e([g()],z.prototype,"relationships",null),e([g()],z.prototype,"returnGeometryEnabled",null),e([g()],z.prototype,"returnMEnabled",null),e([g()],z.prototype,"returnZEnabled",null),e([g()],z.prototype,"selectionSource",void 0),e([g()],z.prototype,"showRelatedTableCallback",void 0),e([g({readOnly:!0,type:S})],z.prototype,"store",void 0),e([g({type:j})],z.prototype,"tableTemplate",void 0),e([g()],z.prototype,"tableTemplateOverride",void 0),e([g()],z.prototype,"timeExtent",null),e([g()],z.prototype,"timeZone",void 0),e([g()],z.prototype,"view",null),z=e([m("esri.widgets.FeatureTable.FeatureTableViewModel")],z);const A=z;export{A as default};