@arcgis/core 4.34.0-next.66 → 4.34.0-next.68

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 (278) hide show
  1. package/WebDocument2D.js +1 -1
  2. package/arcade/Feature.js +1 -1
  3. package/arcade/functions/measures.js +1 -1
  4. package/assets/esri/core/workers/RemoteClient.js +1 -1
  5. package/assets/esri/core/workers/chunks/{09dd8613bc03e7a3a4cb.js → 0814676e4bac81f96140.js} +1 -1
  6. package/assets/esri/core/workers/chunks/097a5c333de28ec5e16f.js +1 -0
  7. package/assets/esri/core/workers/chunks/{44031bef6d500167ef0b.js → 09dbb3e200ef8d514eb3.js} +1 -1
  8. package/assets/esri/core/workers/chunks/0b71100fa1e7ca706dbb.js +1 -0
  9. package/assets/esri/core/workers/chunks/{3167230555c63f943485.js → 0cbd5335cc92f5891bcf.js} +1 -1
  10. package/assets/esri/core/workers/chunks/{16fe21ca9b24eaee3069.js → 144bfd64daf103a06734.js} +1 -1
  11. package/assets/esri/core/workers/chunks/{c20aead85cdea91c4b74.js → 170ec7fb070c63230c81.js} +1 -1
  12. package/assets/esri/core/workers/chunks/{997a2a1a51039ce7e4e3.js → 1ac6bbaee76684a07b64.js} +1 -1
  13. package/assets/esri/core/workers/chunks/{af1030e4c4437d4eb600.js → 1ada9e6cdd6792e3847a.js} +1 -1
  14. package/assets/esri/core/workers/chunks/1e86df439c564fe752e3.js +1 -0
  15. package/assets/esri/core/workers/chunks/{4459c8e495a37d4c4eb8.js → 25118304c9a914194e90.js} +1 -1
  16. package/assets/esri/core/workers/chunks/28cfe1b270602e0c767b.js +1 -0
  17. package/assets/esri/core/workers/chunks/2ad1d458e4d18232a667.js +1 -0
  18. package/assets/esri/core/workers/chunks/{d823277612f971a9c2f0.js → 3245663da75e168bf85c.js} +1 -1
  19. package/assets/esri/core/workers/chunks/37d7c249114994a7dfac.js +1 -0
  20. package/assets/esri/core/workers/chunks/{2cd27b06226e30aec5da.js → 3f164e587f8d69c306d5.js} +1 -1
  21. package/assets/esri/core/workers/chunks/{96102a9296afd1bfe1a9.js → 451dd3bb44664b4ca2ae.js} +1 -1
  22. package/assets/esri/core/workers/chunks/{dbcef57073075e9cfdfe.js → 489fa17e60f25d5f33ae.js} +1 -1
  23. package/assets/esri/core/workers/chunks/{e97250ae8da4bd0d6bc9.js → 4aa98309081e6889ccbb.js} +1 -1
  24. package/assets/esri/core/workers/chunks/{19e5e011f929b6b940fe.js → 4bc091770bab38874848.js} +1 -1
  25. package/assets/esri/core/workers/chunks/{09f0c9f0b6aa58ae3c52.js → 4f22e5a7f81883e8e5b6.js} +1 -1
  26. package/assets/esri/core/workers/chunks/{7a17e78c76076ed4476f.js → 5185c63fecc5f493e142.js} +1 -1
  27. package/assets/esri/core/workers/chunks/{fa0f94318173db2034de.js → 52483db12203276e726e.js} +1 -1
  28. package/assets/esri/core/workers/chunks/{6fff219dfaa86167c326.js → 5303d77a3ab1b7ddeef3.js} +1 -1
  29. package/assets/esri/core/workers/chunks/{22ec2b0a853911692dc8.js → 5993427325d1add18ed9.js} +1 -1
  30. package/assets/esri/core/workers/chunks/5a95688651d7e8b7101d.js +1 -0
  31. package/assets/esri/core/workers/chunks/{9e3f8c06b4e090a35710.js → 5b84eba4a28e25b6d5c0.js} +1 -1
  32. package/assets/esri/core/workers/chunks/{497214e9e82b936fc94e.js → 5ed381a268855bcad072.js} +1 -1
  33. package/assets/esri/core/workers/chunks/{33718ea851645d9078d1.js → 605acf18cbeb89e4f29f.js} +1 -1
  34. package/assets/esri/core/workers/chunks/{5d8c64693830506c8776.js → 643acb12ec6a1d4b4fbb.js} +1 -1
  35. package/assets/esri/core/workers/chunks/{4d7fcec769369c576847.js → 6e59ba2afd444eb4be18.js} +1 -1
  36. package/assets/esri/core/workers/chunks/{de4da985c398c8bcf2e7.js → 7336bfd57f6172ec7186.js} +1 -1
  37. package/assets/esri/core/workers/chunks/{bafd9b0f6e817252cb31.js → 75dd0acf049c7f3271b8.js} +1 -1
  38. package/assets/esri/core/workers/chunks/{60920d4856a011ace7e2.js → 80b0c88a76bd523a406a.js} +1 -1
  39. package/assets/esri/core/workers/chunks/{117eb1422e9795d37ea3.js → 837830e1cf712d4243a5.js} +1 -1
  40. package/assets/esri/core/workers/chunks/{ad7aa7d09bfceb12609e.js → 87fb5d755860057da164.js} +1 -1
  41. package/assets/esri/core/workers/chunks/{5cb238318a24b70d5ac3.js → 8bc8caa384b24af12411.js} +1 -1
  42. package/assets/esri/core/workers/chunks/{dcad3dcbd4ea2f5a6a04.js → 8e2558b14be70b273ce4.js} +1 -1
  43. package/assets/esri/core/workers/chunks/{8e40c409a9b0a2a768a9.js → 8f02349602b072186a1f.js} +1 -1
  44. package/assets/esri/core/workers/chunks/900eb2aa5cb1b08e1906.js +1 -0
  45. package/assets/esri/core/workers/chunks/{0952aeddddc16705b7a3.js → 99f133a152afb4f1b067.js} +1 -1
  46. package/assets/esri/core/workers/chunks/a6f66492651646c18f10.js +1 -0
  47. package/assets/esri/core/workers/chunks/a895da7fd64ebad3d5a4.js +1 -0
  48. package/assets/esri/core/workers/chunks/{31e7358fe802abb3f8db.js → aa970a547c60c43d6c7f.js} +1 -1
  49. package/assets/esri/core/workers/chunks/{9a6d359ead62a8eadd3c.js → ab727ed4417b7dd94ce9.js} +1 -1
  50. package/assets/esri/core/workers/chunks/{707311e24b2f458d9209.js → ad3ebd4f05cc673140f3.js} +1 -1
  51. package/assets/esri/core/workers/chunks/{0f20c0eec850a39620a1.js → ad69cceec8db593fac14.js} +1 -1
  52. package/assets/esri/core/workers/chunks/{05016b0713ef760fc57d.js → b052d3ef5493eedb44a5.js} +1 -1
  53. package/assets/esri/core/workers/chunks/b335e96f6bcac6d2f0ee.js +1 -0
  54. package/assets/esri/core/workers/chunks/{a44f17397d8589433dae.js → b683b0fa7fc430b4d9c5.js} +1 -1
  55. package/assets/esri/core/workers/chunks/{dd1d9913b33d4e48baff.js → c35dad3d5ceaac6ad5a4.js} +1 -1
  56. package/assets/esri/core/workers/chunks/{e1b573840ec1f7c3afd3.js → c4b2678dd46fa1e22f7e.js} +1 -1
  57. package/assets/esri/core/workers/chunks/{2f7e192ee2066f863e1d.js → c908184d747d33366881.js} +1 -1
  58. package/assets/esri/core/workers/chunks/{bc931865a77fc48871d3.js → c94c797864a85342b105.js} +1 -1
  59. package/assets/esri/core/workers/chunks/{06ff5f34ad9bdf9705de.js → d3f59fbaa524b53fcbc6.js} +6 -0
  60. package/assets/esri/core/workers/chunks/{c7a386ac90e58eb71935.js → da1a5537e2f2ca6cc247.js} +1 -1
  61. package/assets/esri/core/workers/chunks/dd447dfc50ee7f511b84.js +1 -0
  62. package/assets/esri/core/workers/chunks/{a700f57af6856cb5313c.js → de443d29d1a6b5300d00.js} +1 -1
  63. package/assets/esri/core/workers/chunks/e2486bf5546443408c85.js +1 -0
  64. package/assets/esri/core/workers/chunks/{0f9813e7d4e2b47b2c39.js → e47acdb1fbf797342716.js} +1 -1
  65. package/assets/esri/core/workers/chunks/{a16b471c3706ee37f9b6.js → e6f2ac738df16fb5e13a.js} +1 -1
  66. package/assets/esri/core/workers/chunks/{f5101f5f93f776a6456f.js → ed1272e7681e561d843f.js} +1 -1
  67. package/assets/esri/core/workers/chunks/{66ffefd46fe6175c2af4.js → efea3e82cec476d486e0.js} +1 -1
  68. package/assets/esri/core/workers/chunks/{d6f5297f7b323c340727.js → f060a52a9b69eb250d63.js} +1 -1
  69. package/assets/esri/core/workers/chunks/f8adac87e48ea86bec21.js +1 -0
  70. package/assets/esri/core/workers/chunks/{4be2bab8ff3bd14ffdfb.js → f9385d7fb5ff20f7b252.js} +1 -1
  71. package/assets/esri/core/workers/chunks/{b30de4936caa654d7817.js → fac020b6886ff2d75015.js} +1 -1
  72. package/assets/esri/core/workers/chunks/fe353a53968827bcd9cc.js +1 -0
  73. package/assets/esri/themes/base/widgets/_Expand.scss +1 -1
  74. package/assets/esri/themes/dark/main.css +1 -1
  75. package/assets/esri/themes/light/main.css +1 -1
  76. package/assets/esri/themes/light/view.css +1 -1
  77. package/chunks/ComponentShader.glsl.js +42 -36
  78. package/chunks/GlowComposition.glsl.js +5 -5
  79. package/chunks/RibbonLine.glsl.js +2 -2
  80. package/config.js +1 -1
  81. package/core/MemCache.js +1 -1
  82. package/editing/geometry/lineUtils.js +1 -1
  83. package/geometry/ellipsoidUtils.js +1 -1
  84. package/geometry/support/curves/bezierCurveUtils.js +1 -1
  85. package/geometry/support/curves/circleUtils.js +1 -1
  86. package/geometry/support/curves/curveLength.js +1 -1
  87. package/geometry/support/curves/ellipticArc7Utils.js +1 -1
  88. package/interfaces.d.ts +66 -193
  89. package/kernel.js +1 -1
  90. package/layers/GaussianSplatLayer.js +1 -1
  91. package/layers/Layer.js +1 -1
  92. package/layers/MapImageLayer.js +1 -1
  93. package/layers/OrientedImageryLayer.js +1 -1
  94. package/layers/VoxelLayer.js +1 -1
  95. package/layers/graphics/controllers/FeatureTileController3D.js +1 -1
  96. package/layers/graphics/sources/FeatureLayerSource.js +1 -1
  97. package/layers/mixins/ArcGISImageService.js +1 -1
  98. package/layers/mixins/ImageryTileMixin.js +1 -1
  99. package/layers/mixins/OperationalLayer.js +1 -1
  100. package/layers/mixins/TemporalLayer.js +1 -1
  101. package/layers/mixins/TemporalSceneLayer.js +1 -1
  102. package/layers/mixins/operationalLayers.js +1 -1
  103. package/layers/support/FeatureFilter.js +1 -1
  104. package/layers/support/TimeInfo.js +1 -1
  105. package/layers/support/TrackInfo.js +1 -1
  106. package/layers/support/gaussianSplatUtils.js +1 -1
  107. package/layers/support/layersCreator.js +1 -1
  108. package/package.json +2 -2
  109. package/portal/schemas/definitions.js +1 -1
  110. package/portal/support/portalLayers.js +1 -1
  111. package/rest/support/AttributeBinsQuery.js +1 -1
  112. package/rest/support/IdentifyParameters.js +1 -1
  113. package/rest/support/ImageGPSInfoParameters.js +1 -1
  114. package/rest/support/ImageHistogramParameters.js +1 -1
  115. package/rest/support/ImageIdentifyParameters.js +1 -1
  116. package/rest/support/ImageParameters.js +1 -1
  117. package/rest/support/ImageSampleParameters.js +1 -1
  118. package/rest/support/Query.js +1 -1
  119. package/rest/support/TopFeaturesQuery.js +1 -1
  120. package/support/elevationInfoUtils.js +1 -1
  121. package/support/revision.js +1 -1
  122. package/support/timeUtils.js +1 -1
  123. package/time/TimeExtent.js +1 -1
  124. package/time/TimeInterval.js +1 -1
  125. package/views/2d/analysis/ElevationProfileAnalysisView2D.js +1 -1
  126. package/views/2d/engine/webgl/Painter.js +1 -1
  127. package/views/2d/engine/webgl/effects/FeatureEffect.js +1 -1
  128. package/views/2d/engine/webgl/effects/post-processing/EffectManager.js +1 -1
  129. package/views/2d/engine/webgl/shaderGraph/techniques/TestTechnique.js +1 -1
  130. package/views/2d/engine/webgl/shaderGraph/techniques/TextureStatisticsTechnique.js +1 -1
  131. package/views/2d/engine/webgl/shaderGraph/techniques/bloom/BloomTechnique.js +5 -0
  132. package/views/2d/engine/webgl/shaderGraph/techniques/blur/BlurTechnique.js +5 -0
  133. package/views/2d/engine/webgl/shaderGraph/techniques/colorize/ColorizeTechnique.js +5 -0
  134. package/views/2d/engine/webgl/shaderGraph/techniques/dotDensity/DotDensityTechnique.js +1 -1
  135. package/views/2d/engine/webgl/shaderGraph/techniques/drop-shadow/DropShadowTechnique.js +5 -0
  136. package/views/2d/engine/webgl/shaderGraph/techniques/fill/ComplexFillTechnique.js +1 -1
  137. package/views/2d/engine/webgl/shaderGraph/techniques/fill/ComplexOutlineFillTechnique.js +1 -1
  138. package/views/2d/engine/webgl/shaderGraph/techniques/fill/FillTechnique.js +1 -1
  139. package/views/2d/engine/webgl/shaderGraph/techniques/fill/GradientFillTechnique.js +1 -1
  140. package/views/2d/engine/webgl/shaderGraph/techniques/fill/OutlineFillTechnique.js +1 -1
  141. package/views/2d/engine/webgl/shaderGraph/techniques/fill/PatternFillTechnique.js +1 -1
  142. package/views/2d/engine/webgl/shaderGraph/techniques/fill/PatternOutlineFillTechnique.js +1 -1
  143. package/views/2d/engine/webgl/shaderGraph/techniques/grid/GridTechnique.js +1 -1
  144. package/views/2d/engine/webgl/shaderGraph/techniques/heatmap/HeatmapTechnique.js +1 -1
  145. package/views/2d/engine/webgl/shaderGraph/techniques/labels/LabelTechnique.js +1 -1
  146. package/views/2d/engine/webgl/shaderGraph/techniques/line/GradientStrokeTechnique.js +1 -1
  147. package/views/2d/engine/webgl/shaderGraph/techniques/line/LineTechnique.js +1 -1
  148. package/views/2d/engine/webgl/shaderGraph/techniques/line/TexturedLineTechnique.js +1 -1
  149. package/views/2d/engine/webgl/shaderGraph/techniques/magnifier/MagnifierTechnique.js +1 -1
  150. package/views/2d/engine/webgl/shaderGraph/techniques/markers/MarkerTechnique.js +1 -1
  151. package/views/2d/engine/webgl/shaderGraph/techniques/mesh/MeshWriterRegistry.js +1 -1
  152. package/views/2d/engine/webgl/shaderGraph/techniques/opacity/OpacityTechnique.js +5 -0
  153. package/views/2d/engine/webgl/shaderGraph/techniques/overlay/OverlayTechnique.js +1 -1
  154. package/views/2d/engine/webgl/shaderGraph/techniques/pieChart/PieChartTechnique.js +1 -1
  155. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/BlitShader.js +5 -0
  156. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/BloomShader.js +5 -0
  157. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/BlurShader.js +5 -0
  158. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/ColorizeShader.js +5 -0
  159. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/DropShadowShader.js +5 -0
  160. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/PostProcessingShader.js +5 -0
  161. package/views/2d/engine/webgl/shaderGraph/techniques/text/TextTechnique.js +1 -1
  162. package/views/2d/engine/webgl/shaderGraph/techniques/videoScreenRenderer/VideoScreenTechnique.js +1 -1
  163. package/views/2d/engine/webgl/shaders/sources/shaderRepository.js +1 -1
  164. package/views/2d/layers/MediaLayerView2D.js +1 -1
  165. package/views/2d/layers/TileLayerView2D.js +1 -1
  166. package/views/2d/layers/features/FeatureContainer.js +1 -1
  167. package/views/2d/layers/features/RenderState.js +1 -1
  168. package/views/2d/layers/features/sources/FeatureSourceQueryInfo.js +1 -1
  169. package/views/3d/analysis/ElevationProfileAnalysisView3D.js +1 -1
  170. package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementTool.js +5 -0
  171. package/views/3d/analysis/VolumeMeasurement/volumeMeasurementGeometryUtils.js +5 -0
  172. package/views/3d/analysis/VolumeMeasurementAnalysisView3D.js +1 -1
  173. package/views/3d/interactive/editingTools/draw/DrawGraphicTool3D.js +1 -1
  174. package/views/3d/interactive/editingTools/isSupportedObjectUtils.js +1 -1
  175. package/views/3d/interactive/editingTools/move/isSupportedObject.js +1 -1
  176. package/views/3d/interactive/editingTools/reshape/isSupportedObject.js +1 -1
  177. package/views/3d/interactive/editingTools/transform/isSupportedGraphic.js +1 -1
  178. package/views/3d/layers/FeatureLikeLayerView3D.js +1 -1
  179. package/views/3d/layers/GaussianSplatLayerView3D.js +1 -1
  180. package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
  181. package/views/3d/layers/graphics/ElevationContext.js +1 -1
  182. package/views/3d/layers/graphics/Graphics3DCore.js +1 -1
  183. package/views/3d/layers/graphics/Graphics3DExtrudeSymbolLayer.js +1 -1
  184. package/views/3d/layers/graphics/Graphics3DGraphic.js +1 -1
  185. package/views/3d/layers/graphics/Graphics3DGraphicsPipeline.js +1 -1
  186. package/views/3d/layers/graphics/Graphics3DIconSymbolLayer.js +1 -1
  187. package/views/3d/layers/graphics/Graphics3DLineCalloutSymbolLayer.js +1 -1
  188. package/views/3d/layers/graphics/Graphics3DLineSymbolLayer.js +1 -1
  189. package/views/3d/layers/graphics/Graphics3DLodInstanceGraphicLayer.js +1 -1
  190. package/views/3d/layers/graphics/Graphics3DMeshFillSymbolLayer.js +1 -1
  191. package/views/3d/layers/graphics/Graphics3DMeshObject3DGraphicLayer.js +1 -1
  192. package/views/3d/layers/graphics/Graphics3DObject3DGraphicLayer.js +1 -1
  193. package/views/3d/layers/graphics/Graphics3DObjectSymbolLayer.js +1 -1
  194. package/views/3d/layers/graphics/Graphics3DPathSymbolLayer.js +1 -1
  195. package/views/3d/layers/graphics/Graphics3DPointSymbol.js +1 -1
  196. package/views/3d/layers/graphics/Graphics3DPolygonFillSymbolLayer.js +1 -1
  197. package/views/3d/layers/graphics/Graphics3DSymbol.js +1 -1
  198. package/views/3d/layers/graphics/Graphics3DSymbolLayer.js +1 -1
  199. package/views/3d/layers/graphics/Graphics3DTextSymbolLayer.js +1 -1
  200. package/views/3d/layers/graphics/Graphics3DWaterSymbolLayer.js +1 -1
  201. package/views/3d/layers/graphics/Graphics3DWebStyleSymbol.js +1 -1
  202. package/views/3d/layers/graphics/Labeler.js +1 -1
  203. package/views/3d/layers/graphics/QueryEngine.js +1 -1
  204. package/views/3d/layers/graphics/elevationAlignPointsInFeatures.js +1 -1
  205. package/views/3d/layers/graphics/pipeline/Feature3DPipeline.js +1 -1
  206. package/views/3d/layers/graphics/pipeline/Feature3DPipelineWorker.js +1 -1
  207. package/views/3d/layers/graphics/pipeline/Feature3DPipelineWorkerHandle.js +1 -1
  208. package/views/3d/layers/i3s/I3SIndex.js +1 -1
  209. package/views/3d/layers/i3s/I3SViewportQueries.js +1 -1
  210. package/views/3d/layers/support/FeatureTileFetcher3D.js +1 -1
  211. package/views/3d/layers/support/FeatureVisibilityFilter.js +1 -1
  212. package/views/3d/layers/support/Tiles3DIntersectionHandler.js +1 -1
  213. package/views/3d/support/CombinedElevationProvider.js +1 -1
  214. package/views/3d/terrain/TerrainSurface.js +1 -1
  215. package/views/3d/webgl-engine/collections/Component/Material/ComponentMaterial.js +1 -1
  216. package/views/3d/webgl-engine/collections/Component/Material/ComponentTechniqueConfiguration.js +1 -1
  217. package/views/3d/webgl-engine/collections/Component/Material/shader/ComponentShader.glsl.js +1 -1
  218. package/views/3d/webgl-engine/core/shaderLibrary/output/ReadDepth.glsl.js +8 -2
  219. package/views/3d/webgl-engine/effects/focusArea/FocusAreaColor.glsl.js +5 -0
  220. package/views/3d/webgl-engine/effects/focusArea/FocusAreaColorNode.js +1 -1
  221. package/views/3d/webgl-engine/effects/focusArea/FocusAreaColorTechnique.js +1 -1
  222. package/views/3d/webgl-engine/effects/focusArea/FocusAreaMask.glsl.js +5 -0
  223. package/views/3d/webgl-engine/effects/focusArea/FocusAreaMaskNode.js +1 -1
  224. package/views/3d/webgl-engine/effects/focusArea/FocusAreaMaskTechnique.js +1 -1
  225. package/views/3d/webgl-engine/effects/focusArea/FocusAreaOutlineItem.js +1 -1
  226. package/views/3d/webgl-engine/effects/glow/GlowComposition.glsl.js +1 -1
  227. package/views/3d/webgl-engine/effects/glow/GlowRenderNode.js +1 -1
  228. package/views/3d/webgl-engine/lib/GaussianSplatRenderNode.js +1 -1
  229. package/views/3d/webgl-engine/materials/renderers/MergedBuffer.js +1 -1
  230. package/views/3d/webgl-engine/materials/renderers/PerBufferData.js +1 -1
  231. package/views/3d/webgl-engine/materials/renderers/VaoWriter.js +5 -0
  232. package/views/3d/webgl-engine/shaders/SphereDepthInterpolate.glsl.js +17 -0
  233. package/views/GroundView.js +1 -1
  234. package/views/VideoView.js +1 -1
  235. package/views/View.js +1 -1
  236. package/views/analysis/ElevationProfile/ElevationProfileController.js +1 -1
  237. package/views/analysis/ElevationProfile/ElevationProfileGenerationError.js +1 -1
  238. package/views/analysis/ElevationProfile/ElevationProfileResult.js +1 -1
  239. package/webdoc/support/timeProperties.js +1 -1
  240. package/webdoc/widgets/TimeSlider.js +1 -1
  241. package/webmap/InitialViewProperties.js +1 -1
  242. package/widgets/Bookmarks.js +1 -1
  243. package/widgets/Editor/UpdateFeatureWorkflow.js +1 -1
  244. package/widgets/Editor/UpdateFeaturesWorkflow.js +1 -1
  245. package/widgets/Editor/support/EditorItem.js +1 -1
  246. package/widgets/Editor/support/splitFeatureUtils.js +1 -1
  247. package/widgets/Expand.js +1 -1
  248. package/widgets/FeatureTable/support/FeatureStore.js +1 -1
  249. package/widgets/TimeSlider/TimeSliderViewModel.js +1 -1
  250. package/widgets/TimeSlider.js +1 -1
  251. package/TimeExtent.d.ts +0 -4
  252. package/TimeExtent.js +0 -5
  253. package/TimeInterval.d.ts +0 -4
  254. package/TimeInterval.js +0 -5
  255. package/assets/esri/core/workers/chunks/047d6f7b1677cc7ab271.js +0 -1
  256. package/assets/esri/core/workers/chunks/0b01c87db77246632ad9.js +0 -1
  257. package/assets/esri/core/workers/chunks/0cb2f7172190babb4139.js +0 -1
  258. package/assets/esri/core/workers/chunks/0e28cb5d8d89ae29cdd0.js +0 -1
  259. package/assets/esri/core/workers/chunks/1c7b5ca80e80c314f78d.js +0 -1
  260. package/assets/esri/core/workers/chunks/2a938096a42613425c7b.js +0 -1
  261. package/assets/esri/core/workers/chunks/3212a476184be25d17f8.js +0 -1
  262. package/assets/esri/core/workers/chunks/3bc50ee639a4d16c4f80.js +0 -1
  263. package/assets/esri/core/workers/chunks/481aea82501d04667ba2.js +0 -1
  264. package/assets/esri/core/workers/chunks/548818df658b607a364e.js +0 -1
  265. package/assets/esri/core/workers/chunks/7597ef10d1699e7088e5.js +0 -1
  266. package/assets/esri/core/workers/chunks/8e3c09c3524654830b14.js +0 -1
  267. package/assets/esri/core/workers/chunks/8f60804c7ba445f25df8.js +0 -1
  268. package/assets/esri/core/workers/chunks/c696615cae5daefa2d98.js +0 -1
  269. package/assets/esri/core/workers/chunks/ff2614d96ca5228e9685.js +0 -1
  270. package/chunks/TimeExtent.js +0 -5
  271. package/chunks/TimeInterval.js +0 -5
  272. package/views/2d/engine/webgl/effects/post-processing/Bloom.js +0 -5
  273. package/views/2d/engine/webgl/effects/post-processing/Blur.js +0 -5
  274. package/views/2d/engine/webgl/effects/post-processing/Colorize.js +0 -5
  275. package/views/2d/engine/webgl/effects/post-processing/DropShadow.js +0 -5
  276. package/views/2d/engine/webgl/effects/post-processing/Opacity.js +0 -5
  277. package/views/3d/webgl-engine/shaders/FocusAreaColor.glsl.js +0 -5
  278. package/views/3d/webgl-engine/shaders/FocusAreaMask.glsl.js +0 -5
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import t from"../../core/Error.js";import{makeHandle as i}from"../../core/handleUtils.js";import"../../core/has.js";import{destroyMaybe as o}from"../../core/maybe.js";import{watch as s}from"../../core/reactiveUtils.js";import{property as r}from"../../core/accessorSupport/decorators/property.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{subclass as a}from"../../core/accessorSupport/decorators/subclass.js";import l from"../../layers/GraphicsLayer.js";import{hasEffectiveFeatureExpressionInfo as d}from"../../support/elevationInfoUtils.js";import{highlightsSupported as n}from"../../views/support/layerViewUtils.js";import h from"./UpdateFeatureWorkflowData.js";import{UpdateRecordWorkflow as c,handleKeys as p}from"./UpdateRecordWorkflow.js";import{getVisualVariableAttributes as w,setUpGeometryUpdate as u,updateGraphicSymbolWhenRequired as m,swapForEditingSession as y,cloneGraphicExceptMesh as f,canCreateInteractiveEditSession as g,isTerminalUpdateEventType as k}from"./workflowUtils.js";import _ from"../Sketch/SketchViewModel.js";var V;const v={...p,highlights:Symbol(),sketchGraphics:Symbol(),sketchViewModel:Symbol(),waitingForTool:Symbol()};let M=V=class extends c{constructor(e){super(e),this.type="update-feature",this._layerViewEditSession=null,this._sketchGraphicClone=null,this._sketchViewModel=null,this._webStyleCache=new Map}destroy(){this._layerViewEditSession?.rollback()}async commit(){this.removeHandles(v.sketchGraphics);try{const e=this.data.edits.stagedForDelete;await super.commit();const t=this._layerViewEditSession;e?t?.rollback():t?.commit()}catch(e){throw await this._configureSketchViewModel(),new t("editor-workflow:failed-to-commit","An error occurred when sending the updates to the service",{error:e})}}async start(){return await super.start(),await this._initializeSketchViewModel()}_initializeFeatureFormViewModel(){super._initializeFeatureFormViewModel(),this.addHandles([this._featureFormViewModel.on("value-change",e=>{this._layerViewEditSession?.setAttribute(e.fieldName,e.value)}),s(()=>this._featureFormViewModel.feature?.sourceLayer,e=>this._sketchGraphicClone.sourceLayer=e)])}_configureHighlight(){const{edits:e,layerView:t}=this.data;n(t)&&this.addHandles(t.highlight(e.feature),v.highlights)}async _configureSketchViewModel(){const e=this._sketchViewModel;if(!e)return;const{data:t,_featureFormViewModel:i,_sketchGraphicClone:o}=this,{edits:s,viewModel:r}=t,a=s.feature,{view:l}=r,d=w(a),n=await u({feature:a,featureClone:o,visualVariableAttributes:d,sketchViewModel:e,view:l,onUpdate:({geometry:e,attributes:t},o)=>{if(s.updateAttributes(t),s.updateGeometry(e),i.feature&&(i.feature.geometry=e),null!=d.rotation){const{field:e}=d.rotation;i.setValue(e,t[e])}if(null!=d.size){const{field:e}=d.size;i.setValue(e,t[e])}("undo"===o.type||"redo"===o.type||"update"===o.type&&null!=o.toolEventInfo&&k(o.toolEventInfo.type))&&i.notifyFeatureGeometryChanged()},addUpdatingPromise:e=>{this._updatingHandles.addPromise(e)},addHandle:e=>{this.addHandles(e,v.waitingForTool)},webStyleCache:this._webStyleCache});this.addHandles(n,v.sketchGraphics),e.addHandles(n)}async _initializeSketchViewModel(){const{data:e,_sketchGraphicClone:t}=this,{readOnly:s}=e,r=e.edits.feature,{capabilities:a,layer:n}=e.editorItem,{view:h}=e.viewModel;if(this.removeHandles([v.highlights,v.sketchGraphics,v.sketchViewModel,v.waitingForTool]),!a.update.geometry||s||"3d"===h?.type&&d(n.elevationInfo))return{enter:async()=>{this.hasHandles(v.highlights)||this._configureHighlight()},exit:()=>this.removeHandles([v.highlights])};const c=new l({elevationInfo:n.elevationInfo,internal:!0,listMode:"hide",title:"updateFeaturesWorkflow-internal"}),p=new _({allowDeleteKey:!1,layer:c,sketchOptions:e.sketchOptions,snappingManager:e.snappingManager,updateOnGraphicClick:!1,view:h});return this._sketchViewModel=p,h?.map.add(c),await(h?.whenLayerView(c)),this.addHandles(i(()=>{h?.destroyed||h?.map.remove(c),c.destroyed||c.destroy(),this._sketchViewModel=o(p)}),v.sketchViewModel),await m(t,this._webStyleCache,"2d"===h?.type?h.scale:null),this.addHandles([await y(p,r,t)]),{enter:async()=>{this.hasHandles(v.sketchGraphics)||await this._configureSketchViewModel()},exit:()=>this.removeHandles([v.sketchGraphics]),viewModel:p}}_onFullFeatureLoaded(e){super._onFullFeatureLoaded(e);const t=this._sketchGraphicClone=f(e),{edits:i,layerView:o}=this.data;i.updateGeometry(e.geometry),i.trackChanges(),g(o)&&(this._layerViewEditSession=o.createInteractiveEditSession(t))}static async create(e){const t=new V({data:await h.create(e),onCommit:this._onCommitFactory(e.applyEdits)});return t._set("steps",this._createWorkflowSteps(t)),t}get test(){}};e([r()],M.prototype,"_layerViewEditSession",void 0),e([r()],M.prototype,"_sketchGraphicClone",void 0),e([r()],M.prototype,"_sketchViewModel",void 0),M=V=e([a("esri.widgets.Editor.UpdateFeatureWorkflow")],M);export{M as UpdateFeatureWorkflow,v as handleKeys};
5
+ import{__decorate as e}from"tslib";import t from"../../core/Error.js";import{makeHandle as i}from"../../core/handleUtils.js";import"../../core/has.js";import{destroyMaybe as o}from"../../core/maybe.js";import{watch as s}from"../../core/reactiveUtils.js";import{property as a}from"../../core/accessorSupport/decorators/property.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{subclass as r}from"../../core/accessorSupport/decorators/subclass.js";import l from"../../layers/GraphicsLayer.js";import{highlightsSupported as d}from"../../views/support/layerViewUtils.js";import h from"./UpdateFeatureWorkflowData.js";import{UpdateRecordWorkflow as n,handleKeys as c}from"./UpdateRecordWorkflow.js";import{getVisualVariableAttributes as p,setUpGeometryUpdate as w,updateGraphicSymbolWhenRequired as u,swapForEditingSession as m,cloneGraphicExceptMesh as y,canCreateInteractiveEditSession as f,isTerminalUpdateEventType as g}from"./workflowUtils.js";import k from"../Sketch/SketchViewModel.js";var _;const V={...c,highlights:Symbol(),sketchGraphics:Symbol(),sketchViewModel:Symbol(),waitingForTool:Symbol()};let v=_=class extends n{constructor(e){super(e),this.type="update-feature",this._layerViewEditSession=null,this._sketchGraphicClone=null,this._sketchViewModel=null,this._webStyleCache=new Map}destroy(){this._layerViewEditSession?.rollback()}async commit(){this.removeHandles(V.sketchGraphics);try{const e=this.data.edits.stagedForDelete;await super.commit();const t=this._layerViewEditSession;e?t?.rollback():t?.commit()}catch(e){throw await this._configureSketchViewModel(),new t("editor-workflow:failed-to-commit","An error occurred when sending the updates to the service",{error:e})}}async start(){return await super.start(),await this._initializeSketchViewModel()}_initializeFeatureFormViewModel(){super._initializeFeatureFormViewModel(),this.addHandles([this._featureFormViewModel.on("value-change",e=>{this._layerViewEditSession?.setAttribute(e.fieldName,e.value)}),s(()=>this._featureFormViewModel.feature?.sourceLayer,e=>this._sketchGraphicClone.sourceLayer=e)])}_configureHighlight(){const{edits:e,layerView:t}=this.data;d(t)&&this.addHandles(t.highlight(e.feature),V.highlights)}async _configureSketchViewModel(){const e=this._sketchViewModel;if(!e)return;const{data:t,_featureFormViewModel:i,_sketchGraphicClone:o}=this,{edits:s,viewModel:a}=t,r=s.feature,{view:l}=a,d=p(r),h=await w({feature:r,featureClone:o,visualVariableAttributes:d,sketchViewModel:e,view:l,onUpdate:({geometry:e,attributes:t},o)=>{if(s.updateAttributes(t),s.updateGeometry(e),i.feature&&(i.feature.geometry=e),null!=d.rotation){const{field:e}=d.rotation;i.setValue(e,t[e])}if(null!=d.size){const{field:e}=d.size;i.setValue(e,t[e])}("undo"===o.type||"redo"===o.type||"update"===o.type&&null!=o.toolEventInfo&&g(o.toolEventInfo.type))&&i.notifyFeatureGeometryChanged()},addUpdatingPromise:e=>{this._updatingHandles.addPromise(e)},addHandle:e=>{this.addHandles(e,V.waitingForTool)},webStyleCache:this._webStyleCache});this.addHandles(h,V.sketchGraphics),e.addHandles(h)}async _initializeSketchViewModel(){const{data:e,_sketchGraphicClone:t}=this,{readOnly:s}=e,a=e.edits.feature,{capabilities:r,layer:d}=e.editorItem,{view:h}=e.viewModel;if(this.removeHandles([V.highlights,V.sketchGraphics,V.sketchViewModel,V.waitingForTool]),!r.update.geometry||s)return{enter:async()=>{this.hasHandles(V.highlights)||this._configureHighlight()},exit:()=>this.removeHandles([V.highlights])};const n=new l({elevationInfo:d.elevationInfo,internal:!0,listMode:"hide",title:"updateFeaturesWorkflow-internal"}),c=new k({allowDeleteKey:!1,layer:n,sketchOptions:e.sketchOptions,snappingManager:e.snappingManager,updateOnGraphicClick:!1,view:h});return this._sketchViewModel=c,h?.map.add(n),await(h?.whenLayerView(n)),this.addHandles(i(()=>{h?.destroyed||h?.map.remove(n),n.destroyed||n.destroy(),this._sketchViewModel=o(c)}),V.sketchViewModel),await u(t,this._webStyleCache,"2d"===h?.type?h.scale:null),this.addHandles([await m(c,a,t)]),{enter:async()=>{this.hasHandles(V.sketchGraphics)||await this._configureSketchViewModel()},exit:()=>this.removeHandles([V.sketchGraphics]),viewModel:c}}_onFullFeatureLoaded(e){super._onFullFeatureLoaded(e);const t=this._sketchGraphicClone=y(e),{edits:i,layerView:o}=this.data;i.updateGeometry(e.geometry),i.trackChanges(),f(o)&&(this._layerViewEditSession=o.createInteractiveEditSession(t))}static async create(e){const t=new _({data:await h.create(e),onCommit:this._onCommitFactory(e.applyEdits)});return t._set("steps",this._createWorkflowSteps(t)),t}get test(){}};e([a()],v.prototype,"_layerViewEditSession",void 0),e([a()],v.prototype,"_sketchGraphicClone",void 0),e([a()],v.prototype,"_sketchViewModel",void 0),v=_=e([r("esri.widgets.Editor.UpdateFeatureWorkflow")],v);export{v as UpdateFeatureWorkflow,V as handleKeys};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as t}from"tslib";import{unique as e,isSome as r}from"../../core/arrayUtils.js";import o from"../../core/Collection.js";import i from"../../core/Error.js";import a from"../../core/Logger.js";import{destroyMaybe as s}from"../../core/maybe.js";import{whenOnce as n}from"../../core/reactiveUtils.js";import{property as l}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import{subclass as d}from"../../core/accessorSupport/decorators/subclass.js";import{isTable as u}from"../../layers/support/layerUtils.js";import{hasEffectiveFeatureExpressionInfo as p}from"../../support/elevationInfoUtils.js";import c from"../BatchAttributeForm/BatchAttributeFormViewModel.js";import f from"./UpdateFeaturesWorkflowData.js";import h from"./Workflow.js";import{whenEditorLayerView as m,makeMultipleSourceLayersError as y}from"./workflowUtils.js";import{SketchController as w}from"./support/SketchController.js";var g;const F=()=>a.getLogger("esri.widgets.Editor.UpdateFeaturesWorkflow");let _=g=class extends h{constructor(t){super(t),this.type="update-features",this._formViewModel=null,this._sketchController=null}async initialize(){this._initializeFormViewModel();try{await this._updatingHandles.addPromise((async()=>{const{fullFeatures:t}=await this.data.when();this._formViewModel.features=new o(t),await this._initializeVisuals(t)})())}catch(t){this.cancel({force:!0,error:new i("update-features-workflow:initialize","Failed to initialize the workflow data.",t)})}}destroy(){this._sketchController=s(this._sketchController),this._formViewModel.destroy()}get features(){return this.data.features}get formViewModel(){return this._formViewModel}get hasPendingEdits(){const{data:t}=this;return t.features.some(e=>!!t.getPendingEditsForFeature(e)?.modified)}get parent(){return this.data.parent}get parentLayer(){return this.parent?.data.editorItem.layer}get selectedFeature(){return this.data.selectedFeature}get sketchViewModel(){return this._sketchController?.viewModel}get updating(){return this._updatingHandles.updating||this._formViewModel.updating||!!this._sketchController?.updating}async commit(){const{data:t,_formViewModel:e}=this;for(const r of t.fullFeatures)E(t.getPendingEditsForFeature(r),e.getValues(r));await super.commit()}static create(t){const{applyEdits:o,applyEditsFeatureService:i,...a}=t,s=e(t.features.map(t=>t.sourceLayer??t.layer)).map(e=>t.viewModel.editorItems.find(t=>t.layer===e)).filter(r),n=new g({data:new f({...a,editorItems:s}),onCommit:M(t.applyEdits)});return n._set("steps",b()),n}async deleteAndCommit(){return this.data.stageDelete(),this.commit()}enter(){throw new Error("Method not implemented.")}exit(t){throw new Error("Method not implemented.")}async reset(){}async save(){const{formViewModel:t}=this;t.submit(),t.valid&&await super.save()}async start(){await super.start(),await n(()=>!this.updating)}_initializeFormViewModel(){const{data:t}=this,e=t.viewModel.view,r=t.getEditorItemForLayer(k(t)),o=new c({editType:"UPDATE",map:e?.map,readOnly:!1===r?.capabilities.update.attributes,spatialReference:e?.spatialReference,timeZone:t.timeZone});this._formViewModel=o,this.addHandles(o.on("value-change",e=>{for(const r of e.features)t.getPendingEditsForFeature(r)?.setAttribute(e.fieldName,e.value);this._sketchController?.notifyAttributesChanged(e)}))}async _initializeHighlights(t,e,r){const o=await m(r,e);this.addHandles(o.highlight(t))}async _initializeSketchController(t,e,r){const o=new w({sourceLayer:e,view:r,features:t});this._sketchController=o,await n(()=>!o.updating);const{data:i}=this;await o.startUpdatingFeatures(t,t=>{const e=[];for(const{feature:r,geometry:o}of t)i.getPendingEditsForFeature(r)?.updateGeometry(o),e.push(r);this._formViewModel.notifyGeometriesChanged(e)},()=>{F().warnOnce("editor:batch-update-visual-variables","UpdateFeaturesWorkflow does not currently support modifying visual variables through the scale and rotate tools.")})}async _initializeVisuals(t){const{data:e}=this,{view:r}=e.viewModel;if(!r)return;const o=k(e);if(u(o))return;const i=e.getEditorItemForLayer(o);return!i?.capabilities.update.geometry||"3d"===r?.type&&p(o.elevationInfo)?this._initializeHighlights(t,o,r):this._initializeSketchController(t,o,r)}};t([l()],_.prototype,"features",null),t([l()],_.prototype,"formViewModel",null),t([l()],_.prototype,"hasPendingEdits",null),t([l()],_.prototype,"parent",null),t([l()],_.prototype,"parentLayer",null),t([l()],_.prototype,"selectedFeature",null),t([l()],_.prototype,"sketchViewModel",null),t([l()],_.prototype,"type",void 0),t([l()],_.prototype,"updating",null),t([l()],_.prototype,"_formViewModel",void 0),t([l()],_.prototype,"_sketchController",void 0),_=g=t([d("esri.widgets.Editor.UpdateFeaturesWorkflow")],_);const v=_;function b(){return[{id:"editing-features",async setUp(){},async tearDown(){}}]}function M(t){return async e=>{const r=k(e),o=[],i=[];for(const t of e.fullFeatures){const r=e.getPendingEditsForFeature(t),a=r?.stagedForDelete;if(!r?.modified&&!a)continue;const s=t.clone();if(!r?.attributesModified||a){const e=t.sourceLayer;if(!e){F().warn("Feature has no sourceLayer. It will not be included in any applyEdits payload.");continue}const r=e.objectIdField;if(s.attributes={[r]:t.getAttribute(r)},"scene"===e.type&&null!=e.infoFor3D){const r=e.associatedLayer?.globalIdField;null!=r&&s.setAttribute(r,t.getAttribute(r))}}r?.geometryModified&&!a||(s.geometry=null),a?i.push(s):o.push(s)}if(o.length+i.length===0)return void F().warn("No edits to apply. Workflow will finish without sending an applyEdits request.");const a={updateFeatures:o.length>0?o:void 0,deleteFeatures:i.length>0?i:void 0};await t(r,a)}}function k(t){if(t.layers.length>1)throw y();return t.layers[0]}function E(t,e){if(!t||!t.feature)return;const{attributes:r}=t.feature;Object.keys(e).some(t=>e[t]!==r[t])&&t.updateAttributes(e)}export{v as default};
5
+ import{__decorate as t}from"tslib";import{unique as e,isSome as r}from"../../core/arrayUtils.js";import o from"../../core/Collection.js";import i from"../../core/Error.js";import a from"../../core/Logger.js";import{destroyMaybe as s}from"../../core/maybe.js";import{whenOnce as n}from"../../core/reactiveUtils.js";import{property as l}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import{subclass as d}from"../../core/accessorSupport/decorators/subclass.js";import{isTable as u}from"../../layers/support/layerUtils.js";import c from"../BatchAttributeForm/BatchAttributeFormViewModel.js";import p from"./UpdateFeaturesWorkflowData.js";import f from"./Workflow.js";import{whenEditorLayerView as h,makeMultipleSourceLayersError as m}from"./workflowUtils.js";import{SketchController as y}from"./support/SketchController.js";var w;const g=()=>a.getLogger("esri.widgets.Editor.UpdateFeaturesWorkflow");let F=w=class extends f{constructor(t){super(t),this.type="update-features",this._formViewModel=null,this._sketchController=null}async initialize(){this._initializeFormViewModel();try{await this._updatingHandles.addPromise((async()=>{const{fullFeatures:t}=await this.data.when();this._formViewModel.features=new o(t),await this._initializeVisuals(t)})())}catch(t){this.cancel({force:!0,error:new i("update-features-workflow:initialize","Failed to initialize the workflow data.",t)})}}destroy(){this._sketchController=s(this._sketchController),this._formViewModel.destroy()}get features(){return this.data.features}get formViewModel(){return this._formViewModel}get hasPendingEdits(){const{data:t}=this;return t.features.some(e=>!!t.getPendingEditsForFeature(e)?.modified)}get parent(){return this.data.parent}get parentLayer(){return this.parent?.data.editorItem.layer}get selectedFeature(){return this.data.selectedFeature}get sketchViewModel(){return this._sketchController?.viewModel}get updating(){return this._updatingHandles.updating||this._formViewModel.updating||!!this._sketchController?.updating}async commit(){const{data:t,_formViewModel:e}=this;for(const r of t.fullFeatures)k(t.getPendingEditsForFeature(r),e.getValues(r));await super.commit()}static create(t){const{applyEdits:o,applyEditsFeatureService:i,...a}=t,s=e(t.features.map(t=>t.sourceLayer??t.layer)).map(e=>t.viewModel.editorItems.find(t=>t.layer===e)).filter(r),n=new w({data:new p({...a,editorItems:s}),onCommit:v(t.applyEdits)});return n._set("steps",b()),n}async deleteAndCommit(){return this.data.stageDelete(),this.commit()}enter(){throw new Error("Method not implemented.")}exit(t){throw new Error("Method not implemented.")}async reset(){}async save(){const{formViewModel:t}=this;t.submit(),t.valid&&await super.save()}async start(){await super.start(),await n(()=>!this.updating)}_initializeFormViewModel(){const{data:t}=this,e=t.viewModel.view,r=t.getEditorItemForLayer(M(t)),o=new c({editType:"UPDATE",map:e?.map,readOnly:!1===r?.capabilities.update.attributes,spatialReference:e?.spatialReference,timeZone:t.timeZone});this._formViewModel=o,this.addHandles(o.on("value-change",e=>{for(const r of e.features)t.getPendingEditsForFeature(r)?.setAttribute(e.fieldName,e.value);this._sketchController?.notifyAttributesChanged(e)}))}async _initializeHighlights(t,e,r){const o=await h(r,e);this.addHandles(o.highlight(t))}async _initializeSketchController(t,e,r){const o=new y({sourceLayer:e,view:r,features:t});this._sketchController=o,await n(()=>!o.updating);const{data:i}=this;await o.startUpdatingFeatures(t,t=>{const e=[];for(const{feature:r,geometry:o}of t)i.getPendingEditsForFeature(r)?.updateGeometry(o),e.push(r);this._formViewModel.notifyGeometriesChanged(e)},()=>{g().warnOnce("editor:batch-update-visual-variables","UpdateFeaturesWorkflow does not currently support modifying visual variables through the scale and rotate tools.")})}async _initializeVisuals(t){const{data:e}=this,{view:r}=e.viewModel;if(!r)return;const o=M(e);if(u(o))return;const i=e.getEditorItemForLayer(o);return i?.capabilities.update.geometry?this._initializeSketchController(t,o,r):this._initializeHighlights(t,o,r)}};t([l()],F.prototype,"features",null),t([l()],F.prototype,"formViewModel",null),t([l()],F.prototype,"hasPendingEdits",null),t([l()],F.prototype,"parent",null),t([l()],F.prototype,"parentLayer",null),t([l()],F.prototype,"selectedFeature",null),t([l()],F.prototype,"sketchViewModel",null),t([l()],F.prototype,"type",void 0),t([l()],F.prototype,"updating",null),t([l()],F.prototype,"_formViewModel",void 0),t([l()],F.prototype,"_sketchController",void 0),F=w=t([d("esri.widgets.Editor.UpdateFeaturesWorkflow")],F);const _=F;function b(){return[{id:"editing-features",async setUp(){},async tearDown(){}}]}function v(t){return async e=>{const r=M(e),o=[],i=[];for(const t of e.fullFeatures){const r=e.getPendingEditsForFeature(t),a=r?.stagedForDelete;if(!r?.modified&&!a)continue;const s=t.clone();if(!r?.attributesModified||a){const e=t.sourceLayer;if(!e){g().warn("Feature has no sourceLayer. It will not be included in any applyEdits payload.");continue}const r=e.objectIdField;if(s.attributes={[r]:t.getAttribute(r)},"scene"===e.type&&null!=e.infoFor3D){const r=e.associatedLayer?.globalIdField;null!=r&&s.setAttribute(r,t.getAttribute(r))}}r?.geometryModified&&!a||(s.geometry=null),a?i.push(s):o.push(s)}if(o.length+i.length===0)return void g().warn("No edits to apply. Workflow will finish without sending an applyEdits request.");const a={updateFeatures:o.length>0?o:void 0,deleteFeatures:i.length>0?i:void 0};await t(r,a)}}function M(t){if(t.layers.length>1)throw m();return t.layers[0]}function k(t,e){if(!t||!t.feature)return;const{attributes:r}=t.feature;Object.keys(e).some(t=>e[t]!==r[t])&&t.updateAttributes(e)}export{_ 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.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import t from"../../../core/Accessor.js";import{property as r}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{isTable as s}from"../../../layers/support/layerUtils.js";import{hasEffectiveFeatureExpressionInfo as i}from"../../../support/elevationInfoUtils.js";import l from"./EditorEditingCapabilities.js";import{formTemplateHasInvalidFields as a}from"../../FeatureForm/featureFormUtils.js";let p=class extends t{constructor(e){super(e),this.disabled=!1,this.layer=null,this.layerInfo=null,this.layerView=null}get _suspended(){return!!this.layerView?.suspended}get capabilities(){return new l({layer:this.layer,layerInfo:this.layerInfo,layerView:this.layerView})}get editable(){const{create:e,relationship:t,update:r,delete:{enabled:o}}=this.capabilities,s=e.attachments.enabled||r.attachments.enabled;return!this.disabled&&(e.enabled||r.enabled||s||o||t.enabled)}get formTemplate(){return this.capabilities.formTemplate}get hasInvalidFormTemplate(){return a(this.layer,this.formTemplate)}get isTable(){return s(this.layer)}get supportsCreateFeaturesWorkflow(){if(this.disabled)return!1;if("3d"===this.layerView?.view?.type&&i(this.layer.elevationInfo))return!1;const{enabled:e,geometry:t}=this.capabilities.create;return this.isTable?e:e&&t}get supportsUpdateWorkflow(){const{capabilities:e}=this;return!this.disabled&&(e.update.enabled||e.update.attachments.enabled||e.delete.enabled)}get visible(){const{layer:e}=this,t=e.parent;return!this._suspended&&e.visible&&(!t||!("visible"in t)||t.visible)}};e([r()],p.prototype,"_suspended",null),e([r()],p.prototype,"capabilities",null),e([r()],p.prototype,"disabled",void 0),e([r()],p.prototype,"editable",null),e([r()],p.prototype,"formTemplate",null),e([r()],p.prototype,"hasInvalidFormTemplate",null),e([r()],p.prototype,"isTable",null),e([r()],p.prototype,"layer",void 0),e([r()],p.prototype,"layerInfo",void 0),e([r()],p.prototype,"layerView",void 0),e([r()],p.prototype,"supportsCreateFeaturesWorkflow",null),e([r()],p.prototype,"supportsUpdateWorkflow",null),e([r()],p.prototype,"visible",null),p=e([o("esri.widgets.Editor.support.EditorItem")],p);const n=p;export{n as default};
5
+ import{__decorate as e}from"tslib";import t from"../../../core/Accessor.js";import{property as r}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{isTable as o}from"../../../layers/support/layerUtils.js";import i from"./EditorEditingCapabilities.js";import{formTemplateHasInvalidFields as l}from"../../FeatureForm/featureFormUtils.js";let a=class extends t{constructor(e){super(e),this.disabled=!1,this.layer=null,this.layerInfo=null,this.layerView=null}get _suspended(){return!!this.layerView?.suspended}get capabilities(){return new i({layer:this.layer,layerInfo:this.layerInfo,layerView:this.layerView})}get editable(){const{create:e,relationship:t,update:r,delete:{enabled:s}}=this.capabilities,o=e.attachments.enabled||r.attachments.enabled;return!this.disabled&&(e.enabled||r.enabled||o||s||t.enabled)}get formTemplate(){return this.capabilities.formTemplate}get hasInvalidFormTemplate(){return l(this.layer,this.formTemplate)}get isTable(){return o(this.layer)}get supportsCreateFeaturesWorkflow(){if(this.disabled)return!1;const{enabled:e,geometry:t}=this.capabilities.create;return this.isTable?e:e&&t}get supportsUpdateWorkflow(){const{capabilities:e}=this;return!this.disabled&&(e.update.enabled||e.update.attachments.enabled||e.delete.enabled)}get visible(){const{layer:e}=this,t=e.parent;return!this._suspended&&e.visible&&(!t||!("visible"in t)||t.visible)}};e([r()],a.prototype,"_suspended",null),e([r()],a.prototype,"capabilities",null),e([r()],a.prototype,"disabled",void 0),e([r()],a.prototype,"editable",null),e([r()],a.prototype,"formTemplate",null),e([r()],a.prototype,"hasInvalidFormTemplate",null),e([r()],a.prototype,"isTable",null),e([r()],a.prototype,"layer",void 0),e([r()],a.prototype,"layerInfo",void 0),e([r()],a.prototype,"layerView",void 0),e([r()],a.prototype,"supportsCreateFeaturesWorkflow",null),e([r()],a.prototype,"supportsUpdateWorkflow",null),e([r()],a.prototype,"visible",null),a=e([s("esri.widgets.Editor.support.EditorItem")],a);const p=a;export{p 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.34/esri/copyright.txt for details.
4
4
  */
5
- import e from"../../../core/Error.js";import{lineSection as t}from"../../../editing/geometry/lineUtils.js";import{createCoordinateHelper as r}from"../../../views/interactive/coordinateHelper.js";async function n(t,r){if("point"===t.type||"extent"===t.type||"mesh"===t.type)throw new e("editing:unsupported-split-geometry",`Cannot split geometry of type ${t.type}`);if("point"===r.type&&p(t))return await o(t,r);if("polyline"===r.type&&c(t))return a(t,r);if("polygon"===r.type&&s(t))return i(t,r);throw new e("editing:unsupported-split-geometry",`Geometry of type ${r.type} cannot be used to split geometry of type ${t.type}`)}async function o(n,o){const{apiConverter:i,arcadeGeometryFunctions:{planarLength3D:a},arcadeMeasures:{pointToCoordinate:p},lengthOperator:s}=await l(),c=i.fromSpatialReference(n.spatialReference)?.getTolerance()??.001,u=p(n,o);if(null==u||null==u.distance||u.distance>c)return null;const y=p(n,u.coordinate);if(null==y||null==y.distanceAlong)throw new e("editing:split-by-point-failed","Failed to determine the split point on the polyline.");const m=y.coordinate.hasZ&&n.hasZ,f=m?a:s.execute,g=r(m,n.hasM,n.spatialReference),d=f(n),w=t(n,0,y.distanceAlong,g),h=t(n,y.distanceAlong,d,g),O=f(w),j=f(h),P=Math.max(O,j);if(0===P)return null;const x=P===O?w:h;return{remainingPart:x,newPart:0===Math.min(O,j)?null:x===w?h:w}}async function i(e,t){const{differenceOperator:r,intersectionOperator:n}=await u(),o=n.execute(e,t);if(!o)return null;const i=r.execute(e,t);return i?{newPart:o,remainingPart:i}:{newPart:null,remainingPart:o}}async function a(e,t){const{cutOperator:r}=await y(),n=r.execute(e,t);if(2!==n.length)return null;const o=n[0];return{newPart:n[1]??null,remainingPart:o}}function p(e){return"polyline"===e.type}function s(e){return"polygon"===e.type||"polyline"===e.type||"multipoint"===e.type}function c(e){return"polygon"===e.type||"polyline"===e.type}async function l(){const[e,t,r,n]=await Promise.all([import("../../../geometry/operators/support/apiConverter.js"),import("../../../arcade/geometry/functions.js"),import("../../../arcade/functions/measures.js"),import("../../../geometry/operators/lengthOperator.js")]);return{apiConverter:e,arcadeGeometryFunctions:t,lengthOperator:n,arcadeMeasures:r}}async function u(){const[e,t]=await Promise.all([import("../../../geometry/operators/differenceOperator.js"),import("../../../geometry/operators/intersectionOperator.js")]);return{differenceOperator:e,intersectionOperator:t}}async function y(){return{cutOperator:await import("../../../geometry/operators/cutOperator.js")}}export{n as splitGeometry};
5
+ import e from"../../../core/Error.js";import{splitSegmentAtPoint as t}from"../../../editing/geometry/lineUtils.js";import r from"../../../geometry/Polyline.js";import{isCurvedGeometry as n,getEndpoint as o}from"../../../geometry/support/curves/curveUtils.js";import{createCoordinateHelper as a}from"../../../views/interactive/coordinateHelper.js";async function i(t,r){if("point"===t.type||"extent"===t.type||"mesh"===t.type)throw new e("editing:unsupported-split-geometry",`Cannot split geometry of type ${t.type}`);if("point"===r.type&&c(t))return await s(t,r);if("polyline"===r.type&&y(t))return l(t,r);if("polygon"===r.type&&u(t))return p(t,r);throw new e("editing:unsupported-split-geometry",`Geometry of type ${r.type} cannot be used to split geometry of type ${t.type}`)}async function s(i,s){const{apiConverter:p,arcadeGeometryFunctions:{planarLength3D:l},arcadeMeasures:{pointToCoordinate:c},lengthOperator:u}=await f(),y=p.fromSpatialReference(i.spatialReference)?.getTolerance()??.001,m=c(i,s);if(null==m||null==m.distance||m.distance>y)return null;const h=c(i,m.coordinate);if(null==h||null==h.distanceAlong||null==h.partId||null==h.segmentId)throw new e("editing:split-by-point-failed","Failed to determine the split point on the polyline.");const g=h.coordinate.hasZ&&i.hasZ,d=g?l:u.execute,w=a(g,i.hasM,i.spatialReference),P=n(i),j=P?i.curvePaths:i.paths,O=[],v=[];for(let e=0;e<j.length;e++){const r=j[e];if(e<h.partId)O.push(r);else if(e>h.partId)v.push(r);else{const e=[],n=[];for(let a=0;a<r.length;a++){const i=r[a];if(a<h.segmentId)e.push(i);else if(a>h.segmentId)n.push(i);else{const s=o(i),p=r.at(a+1),l=w.pointToArray(h.coordinate);if(a++,!p){e.push(i,l),n.push(l);continue}const[c,u]=t(s,p,l,y);e.push(...c),n.push(...u)}}e.length>0&&O.push(e),n.length>0&&v.push(n)}}const M=new r({[P?"curvePaths":"paths"]:O,spatialReference:i.spatialReference,hasZ:i.hasZ,hasM:i.hasM}),x=new r({[P?"curvePaths":"paths"]:v,spatialReference:i.spatialReference,hasZ:i.hasZ,hasM:i.hasM}),R=d(M),I=d(x),Z=Math.max(R,I);if(0===Z)return null;const C=Z===R?M:x;return{remainingPart:C,newPart:0===Math.min(R,I)?null:C===M?x:M}}async function p(e,t){const{differenceOperator:r,intersectionOperator:n}=await m(),o=n.execute(e,t);if(!o)return null;const a=r.execute(e,t);return a?{newPart:o,remainingPart:a}:{newPart:null,remainingPart:o}}async function l(e,t){const{cutOperator:r}=await h(),n=r.execute(e,t);if(2!==n.length)return null;const o=n[0];return{newPart:n[1]??null,remainingPart:o}}function c(e){return"polyline"===e.type}function u(e){return"polygon"===e.type||"polyline"===e.type||"multipoint"===e.type}function y(e){return"polygon"===e.type||"polyline"===e.type}async function f(){const[e,t,r,n]=await Promise.all([import("../../../geometry/operators/support/apiConverter.js"),import("../../../arcade/geometry/functions.js"),import("../../../arcade/functions/measures.js"),import("../../../geometry/operators/lengthOperator.js")]);return{apiConverter:e,arcadeGeometryFunctions:t,lengthOperator:n,arcadeMeasures:r}}async function m(){const[e,t]=await Promise.all([import("../../../geometry/operators/differenceOperator.js"),import("../../../geometry/operators/intersectionOperator.js")]);return{differenceOperator:e,intersectionOperator:t}}async function h(){return{cutOperator:await import("../../../geometry/operators/cutOperator.js")}}export{i as splitGeometry};
package/widgets/Expand.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.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import{makeHandle as t}from"../core/handleUtils.js";import{watch as o,initial as n}from"../core/reactiveUtils.js";import{property as s}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/Logger.js";import"../core/RandomLCG.js";import{subclass as i}from"../core/accessorSupport/decorators/subclass.js";import l from"./Widget.js";import r from"./Expand/ExpandViewModel.js";import{loadCalciteComponents as a}from"./support/componentsUtils.js";import{globalCss as c}from"./support/globalCss.js";import{isWidget as p,hasDomNode as d}from"./support/widget.js";import{messageBundle as h}from"./support/decorators/messageBundle.js";import{tsx as u}from"./support/jsxFactory.js";const m="esri-expand",g={base:m,toggle:`${m}__toggle`,popoverContent:`${m}__popover-content`,panel:`${m}__panel`,panelContent:`${m}__panel-content`,sheet:`${m}__sheet`,contentContainer:`${m}__content-container`,icon:"esri-collapse__icon",iconFlip:"esri-collapse__icon-flip",iconNumber:`${m}__icon-number`},v="chevrons-left",_="chevrons-right",w=Symbol("scheduleRender-override-handle");let y=class extends l{constructor(e,t){super(e,t),this._boundScheduledRender=this.scheduleRender.bind(this),this.closeOnEsc=!0,this.collapseTooltip="",this.content="",this.expandTooltip="",this.focusTrapDisabled=!1,this.iconNumber=0,this.messages=null,this.messagesCommon=null,this.mode="auto",this.placement=null,this.viewModel=new r,this.toggle=()=>{this.viewModel.expanded=!this.viewModel.expanded},this._handlePopoverClose=e=>{e.target===this._popoverEl&&(this.viewModel.expanded=e.currentTarget.open)},this._handleSheetClose=e=>{this.viewModel.expanded=e.currentTarget.open},this._handlePanelClose=e=>{this.viewModel.expanded=!e.currentTarget.closed},this._handleKeyDown=e=>{this.viewModel.expanded&&"Escape"===e.key&&!this._willCloseOnEsc(e)&&e.preventDefault()},this._storeToggleActionEl=e=>{this._toggleActionEl=e},this._storePopoverEl=e=>{this._popoverEl=e}}initialize(){this.addHandles(o(()=>this.viewModel?.view?.size,()=>this._popoverEl?.reposition(),n))}loadDependencies(){return a({action:()=>import("@esri/calcite-components/dist/components/calcite-action"),icon:()=>import("@esri/calcite-components/dist/components/calcite-icon"),panel:()=>import("@esri/calcite-components/dist/components/calcite-panel"),popover:()=>import("@esri/calcite-components/dist/components/calcite-popover"),sheet:()=>import("@esri/calcite-components/dist/components/calcite-sheet")})}get expandTitle(){const{expanded:e,messagesCommon:t,collapseTooltip:o,expandTooltip:n}=this;return(e?o||t?.collapse:n||t?.expand)??""}get _displaySheet(){switch(this.mode){case"drawer":return!0;case"auto":return"xsmall"===this.viewModel.view?.widthBreakpoint;default:return!1}}get autoCollapse(){return this.viewModel.autoCollapse}set autoCollapse(e){this.viewModel.autoCollapse=e}get collapseIcon(){return _}set collapseIcon(e){this._overrideIfSome("collapseIcon",e)}get expanded(){return this.viewModel.expanded}set expanded(e){this.viewModel.expanded=e}get expandIcon(){return"object"==typeof this.content&&"icon"in this.content&&this.content.icon?this.content.icon:v}set expandIcon(e){this._overrideIfSome("expandIcon",e)}get group(){return this.viewModel.group}set group(e){this.viewModel.group=e}get icon(){return null}get label(){return"object"==typeof this.content&&"label"in this.content&&this.content.label?this.content.label:this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}expand(){this.viewModel.expanded=!0}collapse(){this.viewModel.expanded=!1}render(){const{_displaySheet:e,_toggleActionEl:t,viewModel:{expanded:o},label:n,placement:s}=this;return u("div",{class:this.classes(g.base,c.widget)},this._renderToggle(),e?u("calcite-sheet",{class:g.sheet,heightScale:"l",label:n,onkeydown:this._handleKeyDown,open:o,position:"block-end",onCalciteSheetClose:this._handleSheetClose},u("calcite-panel",{class:g.panel,closable:!0,closed:!o,heading:n,onkeydown:this._handleKeyDown,onCalcitePanelClose:this._handlePanelClose},u("div",{class:g.panelContent},this._renderContent()))):t?u("calcite-popover",{afterCreate:this._storePopoverEl,afterUpdate:this._storePopoverEl,focusTrapDisabled:this.focusTrapDisabled,label:n,onkeydown:this._handleKeyDown,open:o,overlayPositioning:"fixed",placement:s??this._getPlacement(),referenceElement:t,onCalcitePopoverClose:this._handlePopoverClose},u("div",{class:g.popoverContent},this._renderContent())):null)}_getPlacement(){const{container:e,view:t}=this,o=e&&t?t.ui.getPosition(e):null;if(!o||"manual"===o)return"auto";const[n,s]=o.split("-");return`${"right"===s?"left":"right"}-${"bottom"===n?"end":"start"}`}_willCloseOnEsc(e){const{closeOnEsc:t}=this;return"function"==typeof t?t(e):t}_renderBadgeNumber(){const{expanded:e,iconNumber:t}=this;return t&&!e?u("span",{class:g.iconNumber,key:"expand__icon-number"},t):null}_renderToggleButton(){const{expanded:e,expandTitle:t,expandIcon:o,collapseIcon:n}=this,s=e?n:o,i=s===v||s===_;return u("calcite-action",{afterCreate:this._storeToggleActionEl,afterUpdate:this._storeToggleActionEl,class:c.widgetButton,onclick:this.toggle,scale:"s",text:t,title:t},s?u("calcite-icon",{class:this.classes(g.icon,i&&g.iconFlip),icon:s,scale:"s"}):null)}_renderToggle(){return u("div",{class:g.toggle},this._renderToggleButton(),this._renderBadgeNumber())}_renderContent(){const{content:e}=this;return"string"==typeof e?u("div",{class:g.contentContainer,innerHTML:e,key:"content__string"}):p(e)?u("div",{afterCreate:()=>{this._overwriteChildScheduleRender(e)},afterRemoved:()=>this.removeHandles(w),afterUpdate:()=>{e.scheduleRender!==this._boundScheduledRender&&(this.removeHandles(w),this._overwriteChildScheduleRender(e))},class:g.contentContainer,key:"content__widget"},e.render()):e instanceof HTMLElement?u("div",{afterCreate:this._attachToNode,bind:e,class:g.contentContainer,key:"content__html-element"}):d(e)?u("div",{afterCreate:this._attachToNode,bind:e.domNode,class:g.contentContainer,key:"content__node"}):null}_overwriteChildScheduleRender(e){const o=e.scheduleRender;e.scheduleRender=this._boundScheduledRender,this.addHandles(t(()=>e.scheduleRender=o),w)}_attachToNode(e){const t=this;e.appendChild(t)}};e([s({readOnly:!0})],y.prototype,"expandTitle",null),e([s()],y.prototype,"_toggleActionEl",void 0),e([s()],y.prototype,"_displaySheet",null),e([s()],y.prototype,"autoCollapse",null),e([s()],y.prototype,"closeOnEsc",void 0),e([s()],y.prototype,"collapseIcon",null),e([s()],y.prototype,"collapseTooltip",void 0),e([s()],y.prototype,"content",void 0),e([s()],y.prototype,"expanded",null),e([s()],y.prototype,"expandIcon",null),e([s()],y.prototype,"expandTooltip",void 0),e([s()],y.prototype,"focusTrapDisabled",void 0),e([s()],y.prototype,"group",null),e([s()],y.prototype,"icon",null),e([s()],y.prototype,"iconNumber",void 0),e([s()],y.prototype,"label",null),e([s(),h("esri/widgets/Expand/t9n/Expand")],y.prototype,"messages",void 0),e([s(),h("esri/t9n/common")],y.prototype,"messagesCommon",void 0),e([s()],y.prototype,"mode",void 0),e([s()],y.prototype,"placement",void 0),e([s()],y.prototype,"view",null),e([s({type:r})],y.prototype,"viewModel",void 0),y=e([i("esri.widgets.Expand")],y);const C=y;export{C as default};
5
+ import{__decorate as e}from"tslib";import{deprecateWidget as t}from"../core/deprecate.js";import{makeHandle as o}from"../core/handleUtils.js";import n from"../core/Logger.js";import{watch as s,initial as i}from"../core/reactiveUtils.js";import{property as l}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/RandomLCG.js";import{subclass as r}from"../core/accessorSupport/decorators/subclass.js";import a from"./Widget.js";import p from"./Expand/ExpandViewModel.js";import{loadCalciteComponents as c}from"./support/componentsUtils.js";import{globalCss as d}from"./support/globalCss.js";import{isWidget as h,hasDomNode as u}from"./support/widget.js";import{messageBundle as m}from"./support/decorators/messageBundle.js";import{tsx as g}from"./support/jsxFactory.js";const v="esri-expand",_={base:v,toggle:`${v}__toggle`,popoverContent:`${v}__popover-content`,panel:`${v}__panel`,panelContent:`${v}__panel-content`,sheet:`${v}__sheet`,contentContainer:`${v}__content-container`,icon:"esri-collapse__icon",iconFlip:"esri-collapse__icon-flip",iconNumber:`${v}__icon-number`},w="chevrons-left",y="chevrons-right",f=Symbol("scheduleRender-override-handle");let x=class extends a{constructor(e,o){super(e,o),this._boundScheduledRender=this.scheduleRender.bind(this),this.closeOnEsc=!0,this.collapseTooltip="",this.content="",this.expandTooltip="",this.focusTrapDisabled=!1,this.iconNumber=0,this.messages=null,this.messagesCommon=null,this.mode="auto",this.placement=null,this.viewModel=new p,this.toggle=()=>{this.viewModel.expanded=!this.viewModel.expanded},this._handlePopoverClose=e=>{e.target===this._popoverEl&&(this.viewModel.expanded=e.currentTarget.open)},this._handleSheetClose=e=>{this.viewModel.expanded=e.currentTarget.open},this._handlePanelClose=e=>{this.viewModel.expanded=!e.currentTarget.closed},this._handleKeyDown=e=>{this.viewModel.expanded&&"Escape"===e.key&&!this._willCloseOnEsc(e)&&e.preventDefault()},this._storeToggleActionEl=e=>{this._toggleActionEl=e},this._storePopoverEl=e=>{this._popoverEl=e},t(n.getLogger(this),"Expand","arcgis-expand",{version:"4.34"})}initialize(){this.addHandles(s(()=>this.viewModel?.view?.size,()=>this._popoverEl?.reposition(),i))}loadDependencies(){return c({action:()=>import("@esri/calcite-components/dist/components/calcite-action"),icon:()=>import("@esri/calcite-components/dist/components/calcite-icon"),panel:()=>import("@esri/calcite-components/dist/components/calcite-panel"),popover:()=>import("@esri/calcite-components/dist/components/calcite-popover"),sheet:()=>import("@esri/calcite-components/dist/components/calcite-sheet")})}get expandTitle(){const{expanded:e,messagesCommon:t,collapseTooltip:o,expandTooltip:n}=this;return(e?o||t?.collapse:n||t?.expand)??""}get _displaySheet(){switch(this.mode){case"drawer":return!0;case"auto":return"xsmall"===this.viewModel.view?.widthBreakpoint;default:return!1}}get autoCollapse(){return this.viewModel.autoCollapse}set autoCollapse(e){this.viewModel.autoCollapse=e}get collapseIcon(){return y}set collapseIcon(e){this._overrideIfSome("collapseIcon",e)}get expanded(){return this.viewModel.expanded}set expanded(e){this.viewModel.expanded=e}get expandIcon(){return"object"==typeof this.content&&"icon"in this.content&&this.content.icon?this.content.icon:w}set expandIcon(e){this._overrideIfSome("expandIcon",e)}get group(){return this.viewModel.group}set group(e){this.viewModel.group=e}get icon(){return null}get label(){return"object"==typeof this.content&&"label"in this.content&&this.content.label?this.content.label:this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}expand(){this.viewModel.expanded=!0}collapse(){this.viewModel.expanded=!1}render(){const{_displaySheet:e,_toggleActionEl:t,viewModel:{expanded:o},label:n,placement:s}=this;return g("div",{class:this.classes(_.base,d.widget)},this._renderToggle(),e?g("calcite-sheet",{class:_.sheet,heightScale:"l",label:n,onkeydown:this._handleKeyDown,open:o,position:"block-end",onCalciteSheetClose:this._handleSheetClose},g("calcite-panel",{class:_.panel,closable:!0,closed:!o,heading:n,onkeydown:this._handleKeyDown,onCalcitePanelClose:this._handlePanelClose},g("div",{class:_.panelContent},this._renderContent()))):t?g("calcite-popover",{afterCreate:this._storePopoverEl,afterUpdate:this._storePopoverEl,focusTrapDisabled:this.focusTrapDisabled,label:n,onkeydown:this._handleKeyDown,open:o,overlayPositioning:"fixed",placement:s??this._getPlacement(),referenceElement:t,onCalcitePopoverClose:this._handlePopoverClose},g("div",{class:_.popoverContent},this._renderContent())):null)}_getPlacement(){const{container:e,view:t}=this,o=e&&t?t.ui.getPosition(e):null;if(!o||"manual"===o)return"auto";const[n,s]=o.split("-");return`${"right"===s?"left":"right"}-${"bottom"===n?"end":"start"}`}_willCloseOnEsc(e){const{closeOnEsc:t}=this;return"function"==typeof t?t(e):t}_renderBadgeNumber(){const{expanded:e,iconNumber:t}=this;return t&&!e?g("span",{class:_.iconNumber,key:"expand__icon-number"},t):null}_renderToggleButton(){const{expanded:e,expandTitle:t,expandIcon:o,collapseIcon:n}=this,s=e?n:o,i=s===w||s===y;return g("calcite-action",{afterCreate:this._storeToggleActionEl,afterUpdate:this._storeToggleActionEl,class:d.widgetButton,onclick:this.toggle,scale:"s",text:t,title:t},s?g("calcite-icon",{class:this.classes(_.icon,i&&_.iconFlip),icon:s,scale:"s"}):null)}_renderToggle(){return g("div",{class:_.toggle},this._renderToggleButton(),this._renderBadgeNumber())}_renderContent(){const{content:e}=this;return"string"==typeof e?g("div",{class:_.contentContainer,innerHTML:e,key:"content__string"}):h(e)?g("div",{afterCreate:()=>{this._overwriteChildScheduleRender(e)},afterRemoved:()=>this.removeHandles(f),afterUpdate:()=>{e.scheduleRender!==this._boundScheduledRender&&(this.removeHandles(f),this._overwriteChildScheduleRender(e))},class:_.contentContainer,key:"content__widget"},e.render()):e instanceof HTMLElement?g("div",{afterCreate:this._attachToNode,bind:e,class:_.contentContainer,key:"content__html-element"}):u(e)?g("div",{afterCreate:this._attachToNode,bind:e.domNode,class:_.contentContainer,key:"content__node"}):null}_overwriteChildScheduleRender(e){const t=e.scheduleRender;e.scheduleRender=this._boundScheduledRender,this.addHandles(o(()=>e.scheduleRender=t),f)}_attachToNode(e){const t=this;e.appendChild(t)}};e([l({readOnly:!0})],x.prototype,"expandTitle",null),e([l()],x.prototype,"_toggleActionEl",void 0),e([l()],x.prototype,"_displaySheet",null),e([l()],x.prototype,"autoCollapse",null),e([l()],x.prototype,"closeOnEsc",void 0),e([l()],x.prototype,"collapseIcon",null),e([l()],x.prototype,"collapseTooltip",void 0),e([l()],x.prototype,"content",void 0),e([l()],x.prototype,"expanded",null),e([l()],x.prototype,"expandIcon",null),e([l()],x.prototype,"expandTooltip",void 0),e([l()],x.prototype,"focusTrapDisabled",void 0),e([l()],x.prototype,"group",null),e([l()],x.prototype,"icon",null),e([l()],x.prototype,"iconNumber",void 0),e([l()],x.prototype,"label",null),e([l(),m("esri/widgets/Expand/t9n/Expand")],x.prototype,"messages",void 0),e([l(),m("esri/t9n/common")],x.prototype,"messagesCommon",void 0),e([l()],x.prototype,"mode",void 0),e([l()],x.prototype,"placement",void 0),e([l()],x.prototype,"view",null),e([l({type:p})],x.prototype,"viewModel",void 0),x=e([r("esri.widgets.Expand")],x);const C=x;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.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import t from"../../../Graphic.js";import r from"../../../core/Accessor.js";import{equals as s,isSome as i}from"../../../core/arrayUtils.js";import a from"../../../core/Collection.js";import o from"../../../core/Error.js";import{clone as n}from"../../../core/lang.js";import u from"../../../core/Logger.js";import p from"../../../core/ReactiveMap.js";import{watch as l,when as h}from"../../../core/reactiveUtils.js";import{property as d}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import{subclass as c}from"../../../core/accessorSupport/decorators/subclass.js";import{geometryTypes as y}from"../../../geometry/support/typeUtils.js";import{isSubtypeGroupLayer as m,isSubtypeSublayer as _}from"../../../layers/support/layerUtils.js";import f from"../../../rest/support/AttachmentQuery.js";import g from"../../../rest/support/RelationshipQuery.js";import{T as b}from"../../../chunks/TimeExtent.js";import{isIFeatureTableSupportedLayerWithAttachments as v,isIFeatureTableSupportedLayerWithAttachmentsEditing as O,isIFeatureTableSupportedLayerWithEditing as A,isIFeatureTableSupportedLayerWithRelationships as I,findRelatedLayer as j}from"./tableUtils.js";let C=class extends r{constructor(e){super(e),this._attachmentsOperationQueue=new a,this._defaultOutFields=["*"],this._editOperationQueue=new a,this._loaded=!1,this._loadError=!1,this._loading=!1,this._objectIdCache=new a,this._queryOperationQueue=new a,this.attachmentsEnabled=!1,this.count=0,this.failures=new a,this.filterGeometry=null,this.initialSize=null,this.layer=null,this.objectIds=null,this.outFields=null,this.pageCache=new p,this.pageSize=50,this.relationshipConfig=null,this.relatedRecordsEnabled=!1,this.returnGeometry=!1,this.returnZ=!1,this.returnM=!1,this.sortOrders=[],this.timeExtent=null,this.view=null,this.where=null}initialize(){this.addHandles([l(()=>[this.filterGeometry,this.layer,this.objectIds,this.outFields,this.pageSize,this.relationshipConfig,this.returnGeometry,this.returnM,this.returnZ,this.timeExtent,this.where],()=>this._reset()),l(()=>this.orderByFields,()=>this._clearCaches(),{equals:s}),h(()=>this.attachmentsEnabled,()=>this._reset()),h(()=>this.relatedRecordsEnabled,()=>this._reset())])}destroy(){this.layer=null,this.itemCache?.destroy(),this.failures?.destroy()}get _capabilities(){const{layer:e}=this;return e?.effectiveCapabilities??e?.capabilities}get _effectiveReturnZ(){return this.returnZ&&this.supportsZ}get _effectiveReturnM(){return this.returnM&&this.supportsM}get _layerWithAttachments(){const{layer:e}=this;return e&&this._capabilities&&this.attachmentsEnabled&&this.supportsAttachments&&v(e)?e:null}get _layerWithAttachmentsEditing(){const{_layerWithAttachments:e}=this;return e&&O(e)&&this.supportsEditing?e:null}get _layerWithEditing(){const e=this.layer;return A(e)&&this.supportsEditing?e:null}get _layerWithRelationships(){const e=this.layer;return I(e)&&this.supportsQueryRelated?e:null}get _relatedLayer(){return this.relationshipConfig?.relatedLayer}get _relatedLayerCapabilities(){const{_relatedLayer:e}=this;return e?.effectiveCapabilities??e?.capabilities}get _relatedLayerSupportsCacheHint(){return!!this._relatedLayerCapabilities?.queryRelated?.supportsCacheHint}get _relatedLayerSupportsQuery(){return!!this._relatedLayerCapabilities?.operations.supportsQuery}get _relatedLayerSupportsQueryRelated(){const{_relatedLayerCapabilities:e}=this;return!!e?.queryRelated?.supportsCount&&!!e?.queryRelated?.supportsPagination}get _sortedFieldNames(){return this.sortOrders.map(({fieldName:e})=>e)}get _subtypeCode(){return this.layer?.subtypeCode??null}get _subtypeField(){const{layer:e}=this;return m(e?.parent)?e.subtypeField:null}get _canUseRelatedLayer(){return!(!this._relatedLayerSupportsQuery||!this._relatedLayerSupportsQueryRelated)}get canAddRelatedFeature(){const{state:e,relationship:t,supportsAdd:r,supportsEditing:s}=this;if("loaded"!==e||!t||!r||!s)return!1;const{count:i}=this,{cardinality:a,role:o}=t,n=i>0;return("one-to-one"!==a||!n)&&("one-to-many"!==a||"origin"!==o||!n)}get effectiveOutFields(){const{layer:e,outFields:t}=this;if(!e||!t?.length)return this._defaultOutFields;const r=[];t.forEach(t=>{const s=e.fieldsIndex.normalizeFieldName(t);s&&r.push(s)});const{objectIdField:s}=e,i=e.fieldsIndex.normalizeFieldName(s)??s;return i&&!r.includes(i)&&r.unshift(i),r}get effectiveTimeExtent(){const{layer:e,timeExtent:t}=this;return t||e&&"timeExtent"in e&&e.timeExtent||null}get effectiveWhere(){const{layer:e,where:t}=this;return null!=t&&""!==t?t:_(e)&&e.parent?.definitionExpression?e.parent.definitionExpression:e?.definitionExpression||"1=1"}get isQuerying(){return this._queryOperationQueue.length>0}get isSyncing(){return this.isSyncingFeatureEdits||this.isSyncingAttachmentEdits}get isSyncingAttachmentEdits(){return this._attachmentsOperationQueue.length>0}get isSyncingFeatureEdits(){return this._editOperationQueue.length>0}get itemCache(){return new a({items:[...this.pageCache.values()].flat()})}get layerView(){const{layer:e,view:t}=this;if(!e||!t)return null;const r="sublayer"===e.type||_(e)?e.parent:e;return t.allLayerViews.find(e=>e.layer===r)}get orderByFields(){const{_sortedFieldNames:e,layer:t,sortOrders:r}=this,s=r.filter(({fieldName:t,direction:r},s)=>e.indexOf(t)===s&&null!=r).map(({fieldName:e,direction:t})=>`${e} ${t?.toUpperCase()}`);if(t&&!s.length&&!t.objectIdField&&t.fields?.length){const e=t.fields.find(e=>e.name);if(e){const r=t.fieldsIndex.normalizeFieldName(e.name);r&&s.push(`${r} ASC`)}}return s}get relationship(){const{relationshipConfig:e}=this;return null==e?.relationshipId?null:this.relationships?.find(t=>t.id===e.relationshipId)}get relationshipIds(){return this.relationships?.map(e=>e.id)??[]}get relationshipInfos(){const{_layerWithRelationships:e,relatedRecordsEnabled:t,relationships:r,view:s}=this,i=[];return t&&e?.loaded&&s?.map&&r?.length?(r.forEach(t=>{const r=j(e,s,t);r&&(r.load(),i.push({layer:e,relatedLayer:r,relationshipId:t.id}))}),i):i}get relationships(){return this._layerWithRelationships?.relationships}get state(){const{layer:e,_loaded:t,_loadError:r,_loading:s}=this;return!e||e.destroyed?"disabled":r||e.loadError?"error":"loaded"===e.loadStatus&&t?"loaded":s?"loading":"ready"}get supportsAdd(){return!!this._capabilities?.operations.supportsAdd}get supportsAddingAttachments(){return!(!this._layerWithAttachmentsEditing||!this.supportsAdd)}get supportsAttachments(){const{_capabilities:e}=this;return!(!e?.data?.supportsAttachment||!e?.operations.supportsQueryAttachments)}get supportsCacheHint(){return!!this._capabilities?.query?.supportsCacheHint}get supportsCacheHintQueryRelated(){return!!this._capabilities?.queryRelated?.supportsCacheHint}get supportsDelete(){return!!this._capabilities?.operations.supportsDelete}get supportsDeletingAttachments(){return!(!this._layerWithAttachmentsEditing||!this.supportsDelete)}get supportsEditing(){return!!this._capabilities?.operations.supportsEditing}get supportsM(){return!!this.layer?.hasM&&!!this._capabilities?.data?.supportsM}get supportsOrderBy(){return!!this._capabilities?.query?.supportsOrderBy}get supportsPagination(){return!!this._capabilities?.query?.supportsPagination}get supportsQuery(){return!!this._capabilities?.operations.supportsQuery}get supportsQueryRelated(){const{_capabilities:e}=this;return!!e?.queryRelated?.supportsCount&&!!e?.queryRelated?.supportsPagination}get supportsResizeAttachments(){const{_capabilities:e}=this;return!(!this.supportsAttachments||!e?.attachment?.supportsResize)}get supportsUpdate(){return!!this._capabilities?.operations.supportsUpdate}get supportsUpdateAttachments(){return!(!this._layerWithAttachmentsEditing||!this.supportsUpdate)}get supportsZ(){return!!this.layer?.hasZ&&!!this._capabilities?.data?.supportsZ}async addAttachment(e,t){const{_layerWithAttachmentsEditing:r}=this;if(!r||!this.supportsAddingAttachments)return{};const s=await this._queueAttachmentsOperation(e,()=>r.addAttachment(this._createBaseGraphic(r,e),t));return this._ensureArrayContent(s)}async deleteAttachments(e,t){const{_layerWithAttachmentsEditing:r}=this;if(!r||!this.supportsDeletingAttachments||!t.length)return[];const s=await this._queueAttachmentsOperation(e,()=>r.deleteAttachments(this._createBaseGraphic(r,e),t));return this._ensureArray(s)}async deleteRowsByObjectId(e){const{_layerWithEditing:t}=this;if(!this.supportsDelete||!t)throw new o("store:delete-error","Delete is not supported.");const r=e.map(e=>this.getItemByObjectId(e)?.feature).filter(i);return this._queueEditOperation(()=>t.applyEdits({deleteFeatures:r}))}async fetchItems(e){const{page:t}=e,{pageSize:r}=this,s=t*r,i=s+r,{layer:a,state:o}=this;return a&&"loaded"===o?this._query({layer:a,start:s,num:i,page:t,pageSize:r}):[]}async getAttachmentsByObjectId(e,t){const r=this.getItemByObjectId(e)?.attachments??[];if(!r.length&&t){return(await this._queryAttachments([e]))[e]??[]}return r}getItemByObjectId(e){for(const t of this.pageCache.values())for(const r of t)if(r.objectId===e)return r}getItemIndexByObjectId(e){const{pageCache:t,pageSize:r}=this,s=t.entries();let i=-1;for(const[a,o]of s)if(o.some((t,s)=>{const o=t.objectId===e;return o&&(i=a*r+s),o}),i>-1)break;return i}async load(){const{layer:e}=this;if(!this._loading&&!this._loaded&&e){this._reset(),this._loading=!0;try{await e.load(),e.parent&&m(e.parent)&&await e.parent.loadAll(),await e.when();const t=this.initialSize;this.initialSize=null,await this.refresh(t),this._loaded=!0,this._loading=!1}catch(t){throw this._reset(),this._loadError=!0,this._logError("store:load-error","An error occurred."),t}}}async query(e){const{state:t}=this;return this.supportsQuery&&"loaded"===t?this._query(e):[]}async refresh(e){this._clearCaches(),await this._syncCount(e),await this._syncObjectIdCache()}reset(){this._reset()}async updateAttachment(e,t,r){const{_layerWithAttachmentsEditing:s}=this;if(!s||!this.supportsUpdateAttachments)return{};const i=await this._queueAttachmentsOperation(e,()=>s.updateAttachment(this._createBaseGraphic(s,e),t,r));return this._ensureArrayContent(i)}async updateItem(e){const{_sortedFieldNames:t}=this,r=e.updates.map(({fieldName:e})=>e),s=await this._update(e);return!s.updateFeatureResults.find(e=>e.error)&&r.some(e=>t.includes(e))&&this._clearCaches(),s}async verifyFeaturesByObjectId(e){const{layer:t,state:r}=this;if(!t||"loaded"!==r)return[];const{objectIdField:s}=t,i=await this._verifyFeaturesByObjectId(e);return e.map(e=>i.some(t=>{const r=t.getObjectId()??t.attributes[s];return e===r}))}_clearCaches(){this.pageCache.clear(),this._objectIdCache.removeAll()}_createBaseGraphic(e,r){const s=new t({attributes:{[e.objectIdField]:r}});return this._subtypeField&&null!=this._subtypeCode&&(s.attributes[this._subtypeField]=this._subtypeCode),s}_ensureArray(e){return Array.isArray(e)?e:[e]}_ensureArrayContent(e){return Array.isArray(e)?e[0]:e}_getObjectIdsForPage(e,t){const r=this._objectIdCache.toArray();return r.length>=e+t?r.slice(e,e+t):r.slice(e)}_logError(e,t){u.getLogger(this).error(e,t)}_reset(){this._clearCaches(),this.failures.removeAll(),this._attachmentsOperationQueue.removeAll(),this._editOperationQueue.removeAll(),this._queryOperationQueue.removeAll(),this._loading=!1,this._loaded=!1,this._loadError=!1,this._set("count",0)}async _syncCount(e){null==e?await this._queryCount().then(e=>this._set("count",e)):this._set("count",e)}async _syncObjectIdCache(){if(this.supportsPagination)return;const e=await this._queryObjectIds();this._objectIdCache.removeAll(),this._objectIdCache.addMany(e)}async _verifyFeaturesByObjectId(e){const{layer:t}=this;if(!t||!this.supportsQuery)throw new o("store:query-error","Layer does not support query operation.");const{effectiveTimeExtent:r,effectiveWhere:s,orderByFields:i,supportsCacheHint:a,supportsOrderBy:n}=this,u=t.createQuery();u.where=s,u.timeExtent=r,u.returnGeometry=!1,u.objectIds=e.length?e:void 0,u.outFields=[t.objectIdField],n&&(u.orderByFields=i),a&&(u.cacheHint=!0);return(await t.queryFeatures(u)).features}async _update(e){const{objectId:r,updates:s}=e,{_layerWithEditing:i}=this;if(!this.supportsUpdate||!i)throw new o("store:update-error","Update is not supported.");const a=this.getItemByObjectId(r)?.feature;if(!a)throw new o("store:update-error","Feature with provided 'objectId' not found.");const u=n(a.attributes);s.forEach(({fieldName:e,value:t})=>u[e]=t);const p=new t({attributes:u}),l=i.applyEdits({updateFeatures:[p]}).then(e=>{const{updateFeatureResults:t}=e,r=t.find(e=>!!e.error);if(r)throw r.error;return t.length&&(a.attributes=u),e});return this._queueEditOperation(()=>l)}_prepareFeatureData(e){const{attachments:t,features:r,layer:s,relatedRecords:i}=e,a=s.objectIdField;return r.map(e=>{const r=e.getObjectId()??e.attributes[a],o=[];return e.layer||e.sourceLayer||(e.layer=s,e.sourceLayer=s),i.forEach((e,t)=>{o.push({relationshipId:t,count:e[r]??0})}),{objectId:r,feature:e,attachments:t[r]??null,relatedRecords:o}})}async _query(e){const{page:t,refresh:r}=e;!0===r&&await this.refresh();const s=this.pageCache.get(t);if(s)return s;const i=await this._queryPage(e);return this.pageCache.set(t,i),i}_queryAttachments(e){const{_layerWithAttachments:t,effectiveWhere:r}=this;return t?e.some(e=>"number"!=typeof e)?Promise.reject(new o("invalid-object-id","Only numeric object ids are valid to query attachments")):t.queryAttachments(new f({objectIds:e,where:r,returnMetadata:!0})):Promise.resolve({})}async _queryCount(){const{_relatedLayerSupportsCacheHint:e,layer:t,relationshipConfig:r,supportsCacheHint:s}=this;if(!t)return 0;if(r&&this._canUseRelatedLayer){const{objectId:t,relatedLayer:s,relationshipId:i}=r;return(await s.queryRelatedFeaturesCount(new g({cacheHint:e,relationshipId:i,objectIds:[t]})))[t]??0}const{effectiveTimeExtent:i,effectiveWhere:a,filterGeometry:o,objectIds:n}=this,u=t.createQuery();return u.geometry=o,u.returnGeometry=!1,u.where=a,u.timeExtent=i,u.objectIds=n?.length?n:void 0,s&&(u.cacheHint=!0),t.queryFeatureCount(u)}async _queryFeatures(e){const{relationshipConfig:t}=this;if(t&&this._canUseRelatedLayer)return this._queryRelatedFeatures(e,t);const{_effectiveReturnM:r,_effectiveReturnZ:s,effectiveOutFields:i,effectiveTimeExtent:a,effectiveWhere:o,filterGeometry:n,objectIds:u,orderByFields:p,pageSize:l,returnGeometry:h,supportsCacheHint:d,supportsOrderBy:c,supportsPagination:y}=this,{layer:m,start:_}=e,f=u?.length,g=m.createQuery();g.returnGeometry=h,g.outFields=i,g.returnM=r,g.returnZ=s,y?(g.start=_,g.num=l,g.where=o,g.timeExtent=a,g.objectIds=f?u:void 0):g.objectIds=f?u:this._getObjectIdsForPage(_,l??0),c&&(g.orderByFields=p),n&&(g.geometry=n),d&&(g.cacheHint=!0);return(await m.queryFeatures(g)).features}_queryObjectIds(){const{effectiveTimeExtent:e,effectiveWhere:t,filterGeometry:r,layer:s,objectIds:i,orderByFields:a,supportsCacheHint:o,supportsOrderBy:n}=this;if(!s)return Promise.resolve([]);const u=s.createQuery();return u.geometry=r,u.outFields=[s.objectIdField],u.returnGeometry=!1,u.where=t,u.timeExtent=e,u.objectIds=i?.length?i:void 0,n&&(u.orderByFields=a),o&&(u.cacheHint=!0),s.queryObjectIds(u)}async _queryPage(e){const{layer:t}=e;return this._queueQueryOperation(async()=>{const r=await this._queryFeatures(e),s=r.map(e=>e.getObjectId()??e.attributes[t.objectIdField]),i=await this._queryAttachments(s),a=await this._queryRelatedCounts(s);return this._prepareFeatureData({layer:t,features:r,attachments:i,relatedRecords:a})||[]})}async _queryRelatedCounts(e){const{_layerWithRelationships:t,relationshipIds:r,supportsCacheHintQueryRelated:s}=this,i=new Map;return t&&e?.length&&r.length?(await Promise.allSettled(r.map(async r=>{const a=await t.queryRelatedFeaturesCount(new g({cacheHint:s,relationshipId:r,objectIds:e}));i.set(r,a)})),i):i}async _queryRelatedFeatures(e,t){const{_defaultOutFields:r,_effectiveReturnM:s,_effectiveReturnZ:i,orderByFields:a,pageSize:o,returnGeometry:n,supportsCacheHint:u}=this,{layer:p,start:l}=e,{objectId:h,relatedLayer:d,relationshipId:c}=t,y=p.createQuery(),m=new g({cacheHint:u,num:o,objectIds:[h],orderByFields:a,outFields:r,relationshipId:c,returnGeometry:n,returnM:s,returnZ:i,start:l,where:y.where??void 0}),_=await d.queryRelatedFeatures(m);return _[h]?.features||[]}_queueAttachmentsOperation(e,t){return this._attachmentsOperationQueue.push(t),t().then(async r=>{this._attachmentsOperationQueue.remove(t);const s=this._ensureArray(r),i=s.some(e=>e.error),a=this.getItemByObjectId(e);if(a&&(!i||s.length>1)){const t=await this._queryAttachments([e]);a.attachments=t[e]}return r}).catch(async r=>{this._logError("store:attachment-error","An error occurred.");const s={error:r,retry:()=>{this.failures.remove(s),this._queueAttachmentsOperation(e,t)},cancel:()=>this.failures.remove(s)};throw this.failures.add(s),this._attachmentsOperationQueue.remove(t),r})}_queueEditOperation(e){return this._editOperationQueue.push(e),e().then(t=>(this._editOperationQueue.remove(e),t)).catch(t=>{this._logError("store:edit-error","An error occurred.");const r={error:t,retry:()=>{this.failures.remove(r),this._queueEditOperation(e)},cancel:()=>this.failures.remove(r)};throw this.failures.add(r),this._editOperationQueue.remove(e),t})}_queueQueryOperation(e){return this._queryOperationQueue.push(e),e().then(t=>this._queryOperationQueue.includes(e)?t:[]).catch(t=>{this._logError("store:query-error","An error occurred.");const r={error:t,retry:()=>{this.failures.remove(r),this._queueQueryOperation(e)},cancel:()=>this.failures.remove(r)};return this.failures.add(r),[]}).then(t=>(this._queryOperationQueue.remove(e),t))}};e([d()],C.prototype,"_attachmentsOperationQueue",void 0),e([d({readOnly:!0})],C.prototype,"_capabilities",null),e([d()],C.prototype,"_defaultOutFields",void 0),e([d()],C.prototype,"_editOperationQueue",void 0),e([d()],C.prototype,"_effectiveReturnZ",null),e([d()],C.prototype,"_effectiveReturnM",null),e([d({readOnly:!0})],C.prototype,"_layerWithAttachments",null),e([d({readOnly:!0})],C.prototype,"_layerWithAttachmentsEditing",null),e([d({readOnly:!0})],C.prototype,"_layerWithEditing",null),e([d({readOnly:!0})],C.prototype,"_layerWithRelationships",null),e([d()],C.prototype,"_loaded",void 0),e([d()],C.prototype,"_loadError",void 0),e([d()],C.prototype,"_loading",void 0),e([d()],C.prototype,"_objectIdCache",void 0),e([d()],C.prototype,"_queryOperationQueue",void 0),e([d({readOnly:!0})],C.prototype,"_relatedLayer",null),e([d({readOnly:!0})],C.prototype,"_relatedLayerCapabilities",null),e([d({readOnly:!0})],C.prototype,"_relatedLayerSupportsCacheHint",null),e([d()],C.prototype,"_relatedLayerSupportsQuery",null),e([d()],C.prototype,"_relatedLayerSupportsQueryRelated",null),e([d()],C.prototype,"_sortedFieldNames",null),e([d()],C.prototype,"_subtypeCode",null),e([d()],C.prototype,"_subtypeField",null),e([d()],C.prototype,"_canUseRelatedLayer",null),e([d()],C.prototype,"attachmentsEnabled",void 0),e([d()],C.prototype,"canAddRelatedFeature",null),e([d({readOnly:!0})],C.prototype,"count",void 0),e([d()],C.prototype,"effectiveOutFields",null),e([d()],C.prototype,"effectiveTimeExtent",null),e([d()],C.prototype,"effectiveWhere",null),e([d({readOnly:!0})],C.prototype,"failures",void 0),e([d({types:y})],C.prototype,"filterGeometry",void 0),e([d()],C.prototype,"initialSize",void 0),e([d({readOnly:!0})],C.prototype,"isQuerying",null),e([d({readOnly:!0})],C.prototype,"isSyncing",null),e([d({readOnly:!0})],C.prototype,"isSyncingAttachmentEdits",null),e([d({readOnly:!0})],C.prototype,"isSyncingFeatureEdits",null),e([d({readOnly:!0})],C.prototype,"itemCache",null),e([d()],C.prototype,"layer",void 0),e([d()],C.prototype,"layerView",null),e([d()],C.prototype,"objectIds",void 0),e([d()],C.prototype,"orderByFields",null),e([d()],C.prototype,"outFields",void 0),e([d({readOnly:!0})],C.prototype,"pageCache",void 0),e([d()],C.prototype,"pageSize",void 0),e([d()],C.prototype,"relationship",null),e([d()],C.prototype,"relationshipConfig",void 0),e([d()],C.prototype,"relationshipIds",null),e([d()],C.prototype,"relationshipInfos",null),e([d()],C.prototype,"relationships",null),e([d()],C.prototype,"relatedRecordsEnabled",void 0),e([d()],C.prototype,"returnGeometry",void 0),e([d()],C.prototype,"returnZ",void 0),e([d()],C.prototype,"returnM",void 0),e([d()],C.prototype,"sortOrders",void 0),e([d({readOnly:!0})],C.prototype,"state",null),e([d()],C.prototype,"supportsAdd",null),e([d()],C.prototype,"supportsAddingAttachments",null),e([d()],C.prototype,"supportsAttachments",null),e([d()],C.prototype,"supportsCacheHint",null),e([d()],C.prototype,"supportsCacheHintQueryRelated",null),e([d()],C.prototype,"supportsDelete",null),e([d()],C.prototype,"supportsDeletingAttachments",null),e([d()],C.prototype,"supportsEditing",null),e([d()],C.prototype,"supportsM",null),e([d()],C.prototype,"supportsOrderBy",null),e([d()],C.prototype,"supportsPagination",null),e([d()],C.prototype,"supportsQuery",null),e([d()],C.prototype,"supportsQueryRelated",null),e([d()],C.prototype,"supportsResizeAttachments",null),e([d()],C.prototype,"supportsUpdate",null),e([d()],C.prototype,"supportsUpdateAttachments",null),e([d()],C.prototype,"supportsZ",null),e([d({type:b})],C.prototype,"timeExtent",void 0),e([d()],C.prototype,"view",void 0),e([d()],C.prototype,"where",void 0),C=e([c("esri.widgets.FeatureTable.support.FeatureStore")],C);const w=C;export{w as default};
5
+ import{__decorate as e}from"tslib";import t from"../../../Graphic.js";import r from"../../../core/Accessor.js";import{equals as s,isSome as i}from"../../../core/arrayUtils.js";import a from"../../../core/Collection.js";import o from"../../../core/Error.js";import{clone as n}from"../../../core/lang.js";import u from"../../../core/Logger.js";import p from"../../../core/ReactiveMap.js";import{watch as l,when as h}from"../../../core/reactiveUtils.js";import{property as d}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import{subclass as c}from"../../../core/accessorSupport/decorators/subclass.js";import{geometryTypes as y}from"../../../geometry/support/typeUtils.js";import{isSubtypeGroupLayer as m,isSubtypeSublayer as _}from"../../../layers/support/layerUtils.js";import f from"../../../rest/support/AttachmentQuery.js";import g from"../../../rest/support/RelationshipQuery.js";import b from"../../../time/TimeExtent.js";import{isIFeatureTableSupportedLayerWithAttachments as v,isIFeatureTableSupportedLayerWithAttachmentsEditing as O,isIFeatureTableSupportedLayerWithEditing as A,isIFeatureTableSupportedLayerWithRelationships as I,findRelatedLayer as j}from"./tableUtils.js";let C=class extends r{constructor(e){super(e),this._attachmentsOperationQueue=new a,this._defaultOutFields=["*"],this._editOperationQueue=new a,this._loaded=!1,this._loadError=!1,this._loading=!1,this._objectIdCache=new a,this._queryOperationQueue=new a,this.attachmentsEnabled=!1,this.count=0,this.failures=new a,this.filterGeometry=null,this.initialSize=null,this.layer=null,this.objectIds=null,this.outFields=null,this.pageCache=new p,this.pageSize=50,this.relationshipConfig=null,this.relatedRecordsEnabled=!1,this.returnGeometry=!1,this.returnZ=!1,this.returnM=!1,this.sortOrders=[],this.timeExtent=null,this.view=null,this.where=null}initialize(){this.addHandles([l(()=>[this.filterGeometry,this.layer,this.objectIds,this.outFields,this.pageSize,this.relationshipConfig,this.returnGeometry,this.returnM,this.returnZ,this.timeExtent,this.where],()=>this._reset()),l(()=>this.orderByFields,()=>this._clearCaches(),{equals:s}),h(()=>this.attachmentsEnabled,()=>this._reset()),h(()=>this.relatedRecordsEnabled,()=>this._reset())])}destroy(){this.layer=null,this.itemCache?.destroy(),this.failures?.destroy()}get _capabilities(){const{layer:e}=this;return e?.effectiveCapabilities??e?.capabilities}get _effectiveReturnZ(){return this.returnZ&&this.supportsZ}get _effectiveReturnM(){return this.returnM&&this.supportsM}get _layerWithAttachments(){const{layer:e}=this;return e&&this._capabilities&&this.attachmentsEnabled&&this.supportsAttachments&&v(e)?e:null}get _layerWithAttachmentsEditing(){const{_layerWithAttachments:e}=this;return e&&O(e)&&this.supportsEditing?e:null}get _layerWithEditing(){const e=this.layer;return A(e)&&this.supportsEditing?e:null}get _layerWithRelationships(){const e=this.layer;return I(e)&&this.supportsQueryRelated?e:null}get _relatedLayer(){return this.relationshipConfig?.relatedLayer}get _relatedLayerCapabilities(){const{_relatedLayer:e}=this;return e?.effectiveCapabilities??e?.capabilities}get _relatedLayerSupportsCacheHint(){return!!this._relatedLayerCapabilities?.queryRelated?.supportsCacheHint}get _relatedLayerSupportsQuery(){return!!this._relatedLayerCapabilities?.operations.supportsQuery}get _relatedLayerSupportsQueryRelated(){const{_relatedLayerCapabilities:e}=this;return!!e?.queryRelated?.supportsCount&&!!e?.queryRelated?.supportsPagination}get _sortedFieldNames(){return this.sortOrders.map(({fieldName:e})=>e)}get _subtypeCode(){return this.layer?.subtypeCode??null}get _subtypeField(){const{layer:e}=this;return m(e?.parent)?e.subtypeField:null}get _canUseRelatedLayer(){return!(!this._relatedLayerSupportsQuery||!this._relatedLayerSupportsQueryRelated)}get canAddRelatedFeature(){const{state:e,relationship:t,supportsAdd:r,supportsEditing:s}=this;if("loaded"!==e||!t||!r||!s)return!1;const{count:i}=this,{cardinality:a,role:o}=t,n=i>0;return("one-to-one"!==a||!n)&&("one-to-many"!==a||"origin"!==o||!n)}get effectiveOutFields(){const{layer:e,outFields:t}=this;if(!e||!t?.length)return this._defaultOutFields;const r=[];t.forEach(t=>{const s=e.fieldsIndex.normalizeFieldName(t);s&&r.push(s)});const{objectIdField:s}=e,i=e.fieldsIndex.normalizeFieldName(s)??s;return i&&!r.includes(i)&&r.unshift(i),r}get effectiveTimeExtent(){const{layer:e,timeExtent:t}=this;return t||e&&"timeExtent"in e&&e.timeExtent||null}get effectiveWhere(){const{layer:e,where:t}=this;return null!=t&&""!==t?t:_(e)&&e.parent?.definitionExpression?e.parent.definitionExpression:e?.definitionExpression||"1=1"}get isQuerying(){return this._queryOperationQueue.length>0}get isSyncing(){return this.isSyncingFeatureEdits||this.isSyncingAttachmentEdits}get isSyncingAttachmentEdits(){return this._attachmentsOperationQueue.length>0}get isSyncingFeatureEdits(){return this._editOperationQueue.length>0}get itemCache(){return new a({items:[...this.pageCache.values()].flat()})}get layerView(){const{layer:e,view:t}=this;if(!e||!t)return null;const r="sublayer"===e.type||_(e)?e.parent:e;return t.allLayerViews.find(e=>e.layer===r)}get orderByFields(){const{_sortedFieldNames:e,layer:t,sortOrders:r}=this,s=r.filter(({fieldName:t,direction:r},s)=>e.indexOf(t)===s&&null!=r).map(({fieldName:e,direction:t})=>`${e} ${t?.toUpperCase()}`);if(t&&!s.length&&!t.objectIdField&&t.fields?.length){const e=t.fields.find(e=>e.name);if(e){const r=t.fieldsIndex.normalizeFieldName(e.name);r&&s.push(`${r} ASC`)}}return s}get relationship(){const{relationshipConfig:e}=this;return null==e?.relationshipId?null:this.relationships?.find(t=>t.id===e.relationshipId)}get relationshipIds(){return this.relationships?.map(e=>e.id)??[]}get relationshipInfos(){const{_layerWithRelationships:e,relatedRecordsEnabled:t,relationships:r,view:s}=this,i=[];return t&&e?.loaded&&s?.map&&r?.length?(r.forEach(t=>{const r=j(e,s,t);r&&(r.load(),i.push({layer:e,relatedLayer:r,relationshipId:t.id}))}),i):i}get relationships(){return this._layerWithRelationships?.relationships}get state(){const{layer:e,_loaded:t,_loadError:r,_loading:s}=this;return!e||e.destroyed?"disabled":r||e.loadError?"error":"loaded"===e.loadStatus&&t?"loaded":s?"loading":"ready"}get supportsAdd(){return!!this._capabilities?.operations.supportsAdd}get supportsAddingAttachments(){return!(!this._layerWithAttachmentsEditing||!this.supportsAdd)}get supportsAttachments(){const{_capabilities:e}=this;return!(!e?.data?.supportsAttachment||!e?.operations.supportsQueryAttachments)}get supportsCacheHint(){return!!this._capabilities?.query?.supportsCacheHint}get supportsCacheHintQueryRelated(){return!!this._capabilities?.queryRelated?.supportsCacheHint}get supportsDelete(){return!!this._capabilities?.operations.supportsDelete}get supportsDeletingAttachments(){return!(!this._layerWithAttachmentsEditing||!this.supportsDelete)}get supportsEditing(){return!!this._capabilities?.operations.supportsEditing}get supportsM(){return!!this.layer?.hasM&&!!this._capabilities?.data?.supportsM}get supportsOrderBy(){return!!this._capabilities?.query?.supportsOrderBy}get supportsPagination(){return!!this._capabilities?.query?.supportsPagination}get supportsQuery(){return!!this._capabilities?.operations.supportsQuery}get supportsQueryRelated(){const{_capabilities:e}=this;return!!e?.queryRelated?.supportsCount&&!!e?.queryRelated?.supportsPagination}get supportsResizeAttachments(){const{_capabilities:e}=this;return!(!this.supportsAttachments||!e?.attachment?.supportsResize)}get supportsUpdate(){return!!this._capabilities?.operations.supportsUpdate}get supportsUpdateAttachments(){return!(!this._layerWithAttachmentsEditing||!this.supportsUpdate)}get supportsZ(){return!!this.layer?.hasZ&&!!this._capabilities?.data?.supportsZ}async addAttachment(e,t){const{_layerWithAttachmentsEditing:r}=this;if(!r||!this.supportsAddingAttachments)return{};const s=await this._queueAttachmentsOperation(e,()=>r.addAttachment(this._createBaseGraphic(r,e),t));return this._ensureArrayContent(s)}async deleteAttachments(e,t){const{_layerWithAttachmentsEditing:r}=this;if(!r||!this.supportsDeletingAttachments||!t.length)return[];const s=await this._queueAttachmentsOperation(e,()=>r.deleteAttachments(this._createBaseGraphic(r,e),t));return this._ensureArray(s)}async deleteRowsByObjectId(e){const{_layerWithEditing:t}=this;if(!this.supportsDelete||!t)throw new o("store:delete-error","Delete is not supported.");const r=e.map(e=>this.getItemByObjectId(e)?.feature).filter(i);return this._queueEditOperation(()=>t.applyEdits({deleteFeatures:r}))}async fetchItems(e){const{page:t}=e,{pageSize:r}=this,s=t*r,i=s+r,{layer:a,state:o}=this;return a&&"loaded"===o?this._query({layer:a,start:s,num:i,page:t,pageSize:r}):[]}async getAttachmentsByObjectId(e,t){const r=this.getItemByObjectId(e)?.attachments??[];if(!r.length&&t){return(await this._queryAttachments([e]))[e]??[]}return r}getItemByObjectId(e){for(const t of this.pageCache.values())for(const r of t)if(r.objectId===e)return r}getItemIndexByObjectId(e){const{pageCache:t,pageSize:r}=this,s=t.entries();let i=-1;for(const[a,o]of s)if(o.some((t,s)=>{const o=t.objectId===e;return o&&(i=a*r+s),o}),i>-1)break;return i}async load(){const{layer:e}=this;if(!this._loading&&!this._loaded&&e){this._reset(),this._loading=!0;try{await e.load(),e.parent&&m(e.parent)&&await e.parent.loadAll(),await e.when();const t=this.initialSize;this.initialSize=null,await this.refresh(t),this._loaded=!0,this._loading=!1}catch(t){throw this._reset(),this._loadError=!0,this._logError("store:load-error","An error occurred."),t}}}async query(e){const{state:t}=this;return this.supportsQuery&&"loaded"===t?this._query(e):[]}async refresh(e){this._clearCaches(),await this._syncCount(e),await this._syncObjectIdCache()}reset(){this._reset()}async updateAttachment(e,t,r){const{_layerWithAttachmentsEditing:s}=this;if(!s||!this.supportsUpdateAttachments)return{};const i=await this._queueAttachmentsOperation(e,()=>s.updateAttachment(this._createBaseGraphic(s,e),t,r));return this._ensureArrayContent(i)}async updateItem(e){const{_sortedFieldNames:t}=this,r=e.updates.map(({fieldName:e})=>e),s=await this._update(e);return!s.updateFeatureResults.find(e=>e.error)&&r.some(e=>t.includes(e))&&this._clearCaches(),s}async verifyFeaturesByObjectId(e){const{layer:t,state:r}=this;if(!t||"loaded"!==r)return[];const{objectIdField:s}=t,i=await this._verifyFeaturesByObjectId(e);return e.map(e=>i.some(t=>{const r=t.getObjectId()??t.attributes[s];return e===r}))}_clearCaches(){this.pageCache.clear(),this._objectIdCache.removeAll()}_createBaseGraphic(e,r){const s=new t({attributes:{[e.objectIdField]:r}});return this._subtypeField&&null!=this._subtypeCode&&(s.attributes[this._subtypeField]=this._subtypeCode),s}_ensureArray(e){return Array.isArray(e)?e:[e]}_ensureArrayContent(e){return Array.isArray(e)?e[0]:e}_getObjectIdsForPage(e,t){const r=this._objectIdCache.toArray();return r.length>=e+t?r.slice(e,e+t):r.slice(e)}_logError(e,t){u.getLogger(this).error(e,t)}_reset(){this._clearCaches(),this.failures.removeAll(),this._attachmentsOperationQueue.removeAll(),this._editOperationQueue.removeAll(),this._queryOperationQueue.removeAll(),this._loading=!1,this._loaded=!1,this._loadError=!1,this._set("count",0)}async _syncCount(e){null==e?await this._queryCount().then(e=>this._set("count",e)):this._set("count",e)}async _syncObjectIdCache(){if(this.supportsPagination)return;const e=await this._queryObjectIds();this._objectIdCache.removeAll(),this._objectIdCache.addMany(e)}async _verifyFeaturesByObjectId(e){const{layer:t}=this;if(!t||!this.supportsQuery)throw new o("store:query-error","Layer does not support query operation.");const{effectiveTimeExtent:r,effectiveWhere:s,orderByFields:i,supportsCacheHint:a,supportsOrderBy:n}=this,u=t.createQuery();u.where=s,u.timeExtent=r,u.returnGeometry=!1,u.objectIds=e.length?e:void 0,u.outFields=[t.objectIdField],n&&(u.orderByFields=i),a&&(u.cacheHint=!0);return(await t.queryFeatures(u)).features}async _update(e){const{objectId:r,updates:s}=e,{_layerWithEditing:i}=this;if(!this.supportsUpdate||!i)throw new o("store:update-error","Update is not supported.");const a=this.getItemByObjectId(r)?.feature;if(!a)throw new o("store:update-error","Feature with provided 'objectId' not found.");const u=n(a.attributes);s.forEach(({fieldName:e,value:t})=>u[e]=t);const p=new t({attributes:u}),l=i.applyEdits({updateFeatures:[p]}).then(e=>{const{updateFeatureResults:t}=e,r=t.find(e=>!!e.error);if(r)throw r.error;return t.length&&(a.attributes=u),e});return this._queueEditOperation(()=>l)}_prepareFeatureData(e){const{attachments:t,features:r,layer:s,relatedRecords:i}=e,a=s.objectIdField;return r.map(e=>{const r=e.getObjectId()??e.attributes[a],o=[];return e.layer||e.sourceLayer||(e.layer=s,e.sourceLayer=s),i.forEach((e,t)=>{o.push({relationshipId:t,count:e[r]??0})}),{objectId:r,feature:e,attachments:t[r]??null,relatedRecords:o}})}async _query(e){const{page:t,refresh:r}=e;!0===r&&await this.refresh();const s=this.pageCache.get(t);if(s)return s;const i=await this._queryPage(e);return this.pageCache.set(t,i),i}_queryAttachments(e){const{_layerWithAttachments:t,effectiveWhere:r}=this;return t?e.some(e=>"number"!=typeof e)?Promise.reject(new o("invalid-object-id","Only numeric object ids are valid to query attachments")):t.queryAttachments(new f({objectIds:e,where:r,returnMetadata:!0})):Promise.resolve({})}async _queryCount(){const{_relatedLayerSupportsCacheHint:e,layer:t,relationshipConfig:r,supportsCacheHint:s}=this;if(!t)return 0;if(r&&this._canUseRelatedLayer){const{objectId:t,relatedLayer:s,relationshipId:i}=r;return(await s.queryRelatedFeaturesCount(new g({cacheHint:e,relationshipId:i,objectIds:[t]})))[t]??0}const{effectiveTimeExtent:i,effectiveWhere:a,filterGeometry:o,objectIds:n}=this,u=t.createQuery();return u.geometry=o,u.returnGeometry=!1,u.where=a,u.timeExtent=i,u.objectIds=n?.length?n:void 0,s&&(u.cacheHint=!0),t.queryFeatureCount(u)}async _queryFeatures(e){const{relationshipConfig:t}=this;if(t&&this._canUseRelatedLayer)return this._queryRelatedFeatures(e,t);const{_effectiveReturnM:r,_effectiveReturnZ:s,effectiveOutFields:i,effectiveTimeExtent:a,effectiveWhere:o,filterGeometry:n,objectIds:u,orderByFields:p,pageSize:l,returnGeometry:h,supportsCacheHint:d,supportsOrderBy:c,supportsPagination:y}=this,{layer:m,start:_}=e,f=u?.length,g=m.createQuery();g.returnGeometry=h,g.outFields=i,g.returnM=r,g.returnZ=s,y?(g.start=_,g.num=l,g.where=o,g.timeExtent=a,g.objectIds=f?u:void 0):g.objectIds=f?u:this._getObjectIdsForPage(_,l??0),c&&(g.orderByFields=p),n&&(g.geometry=n),d&&(g.cacheHint=!0);return(await m.queryFeatures(g)).features}_queryObjectIds(){const{effectiveTimeExtent:e,effectiveWhere:t,filterGeometry:r,layer:s,objectIds:i,orderByFields:a,supportsCacheHint:o,supportsOrderBy:n}=this;if(!s)return Promise.resolve([]);const u=s.createQuery();return u.geometry=r,u.outFields=[s.objectIdField],u.returnGeometry=!1,u.where=t,u.timeExtent=e,u.objectIds=i?.length?i:void 0,n&&(u.orderByFields=a),o&&(u.cacheHint=!0),s.queryObjectIds(u)}async _queryPage(e){const{layer:t}=e;return this._queueQueryOperation(async()=>{const r=await this._queryFeatures(e),s=r.map(e=>e.getObjectId()??e.attributes[t.objectIdField]),i=await this._queryAttachments(s),a=await this._queryRelatedCounts(s);return this._prepareFeatureData({layer:t,features:r,attachments:i,relatedRecords:a})||[]})}async _queryRelatedCounts(e){const{_layerWithRelationships:t,relationshipIds:r,supportsCacheHintQueryRelated:s}=this,i=new Map;return t&&e?.length&&r.length?(await Promise.allSettled(r.map(async r=>{const a=await t.queryRelatedFeaturesCount(new g({cacheHint:s,relationshipId:r,objectIds:e}));i.set(r,a)})),i):i}async _queryRelatedFeatures(e,t){const{_defaultOutFields:r,_effectiveReturnM:s,_effectiveReturnZ:i,orderByFields:a,pageSize:o,returnGeometry:n,supportsCacheHint:u}=this,{layer:p,start:l}=e,{objectId:h,relatedLayer:d,relationshipId:c}=t,y=p.createQuery(),m=new g({cacheHint:u,num:o,objectIds:[h],orderByFields:a,outFields:r,relationshipId:c,returnGeometry:n,returnM:s,returnZ:i,start:l,where:y.where??void 0}),_=await d.queryRelatedFeatures(m);return _[h]?.features||[]}_queueAttachmentsOperation(e,t){return this._attachmentsOperationQueue.push(t),t().then(async r=>{this._attachmentsOperationQueue.remove(t);const s=this._ensureArray(r),i=s.some(e=>e.error),a=this.getItemByObjectId(e);if(a&&(!i||s.length>1)){const t=await this._queryAttachments([e]);a.attachments=t[e]}return r}).catch(async r=>{this._logError("store:attachment-error","An error occurred.");const s={error:r,retry:()=>{this.failures.remove(s),this._queueAttachmentsOperation(e,t)},cancel:()=>this.failures.remove(s)};throw this.failures.add(s),this._attachmentsOperationQueue.remove(t),r})}_queueEditOperation(e){return this._editOperationQueue.push(e),e().then(t=>(this._editOperationQueue.remove(e),t)).catch(t=>{this._logError("store:edit-error","An error occurred.");const r={error:t,retry:()=>{this.failures.remove(r),this._queueEditOperation(e)},cancel:()=>this.failures.remove(r)};throw this.failures.add(r),this._editOperationQueue.remove(e),t})}_queueQueryOperation(e){return this._queryOperationQueue.push(e),e().then(t=>this._queryOperationQueue.includes(e)?t:[]).catch(t=>{this._logError("store:query-error","An error occurred.");const r={error:t,retry:()=>{this.failures.remove(r),this._queueQueryOperation(e)},cancel:()=>this.failures.remove(r)};return this.failures.add(r),[]}).then(t=>(this._queryOperationQueue.remove(e),t))}};e([d()],C.prototype,"_attachmentsOperationQueue",void 0),e([d({readOnly:!0})],C.prototype,"_capabilities",null),e([d()],C.prototype,"_defaultOutFields",void 0),e([d()],C.prototype,"_editOperationQueue",void 0),e([d()],C.prototype,"_effectiveReturnZ",null),e([d()],C.prototype,"_effectiveReturnM",null),e([d({readOnly:!0})],C.prototype,"_layerWithAttachments",null),e([d({readOnly:!0})],C.prototype,"_layerWithAttachmentsEditing",null),e([d({readOnly:!0})],C.prototype,"_layerWithEditing",null),e([d({readOnly:!0})],C.prototype,"_layerWithRelationships",null),e([d()],C.prototype,"_loaded",void 0),e([d()],C.prototype,"_loadError",void 0),e([d()],C.prototype,"_loading",void 0),e([d()],C.prototype,"_objectIdCache",void 0),e([d()],C.prototype,"_queryOperationQueue",void 0),e([d({readOnly:!0})],C.prototype,"_relatedLayer",null),e([d({readOnly:!0})],C.prototype,"_relatedLayerCapabilities",null),e([d({readOnly:!0})],C.prototype,"_relatedLayerSupportsCacheHint",null),e([d()],C.prototype,"_relatedLayerSupportsQuery",null),e([d()],C.prototype,"_relatedLayerSupportsQueryRelated",null),e([d()],C.prototype,"_sortedFieldNames",null),e([d()],C.prototype,"_subtypeCode",null),e([d()],C.prototype,"_subtypeField",null),e([d()],C.prototype,"_canUseRelatedLayer",null),e([d()],C.prototype,"attachmentsEnabled",void 0),e([d()],C.prototype,"canAddRelatedFeature",null),e([d({readOnly:!0})],C.prototype,"count",void 0),e([d()],C.prototype,"effectiveOutFields",null),e([d()],C.prototype,"effectiveTimeExtent",null),e([d()],C.prototype,"effectiveWhere",null),e([d({readOnly:!0})],C.prototype,"failures",void 0),e([d({types:y})],C.prototype,"filterGeometry",void 0),e([d()],C.prototype,"initialSize",void 0),e([d({readOnly:!0})],C.prototype,"isQuerying",null),e([d({readOnly:!0})],C.prototype,"isSyncing",null),e([d({readOnly:!0})],C.prototype,"isSyncingAttachmentEdits",null),e([d({readOnly:!0})],C.prototype,"isSyncingFeatureEdits",null),e([d({readOnly:!0})],C.prototype,"itemCache",null),e([d()],C.prototype,"layer",void 0),e([d()],C.prototype,"layerView",null),e([d()],C.prototype,"objectIds",void 0),e([d()],C.prototype,"orderByFields",null),e([d()],C.prototype,"outFields",void 0),e([d({readOnly:!0})],C.prototype,"pageCache",void 0),e([d()],C.prototype,"pageSize",void 0),e([d()],C.prototype,"relationship",null),e([d()],C.prototype,"relationshipConfig",void 0),e([d()],C.prototype,"relationshipIds",null),e([d()],C.prototype,"relationshipInfos",null),e([d()],C.prototype,"relationships",null),e([d()],C.prototype,"relatedRecordsEnabled",void 0),e([d()],C.prototype,"returnGeometry",void 0),e([d()],C.prototype,"returnZ",void 0),e([d()],C.prototype,"returnM",void 0),e([d()],C.prototype,"sortOrders",void 0),e([d({readOnly:!0})],C.prototype,"state",null),e([d()],C.prototype,"supportsAdd",null),e([d()],C.prototype,"supportsAddingAttachments",null),e([d()],C.prototype,"supportsAttachments",null),e([d()],C.prototype,"supportsCacheHint",null),e([d()],C.prototype,"supportsCacheHintQueryRelated",null),e([d()],C.prototype,"supportsDelete",null),e([d()],C.prototype,"supportsDeletingAttachments",null),e([d()],C.prototype,"supportsEditing",null),e([d()],C.prototype,"supportsM",null),e([d()],C.prototype,"supportsOrderBy",null),e([d()],C.prototype,"supportsPagination",null),e([d()],C.prototype,"supportsQuery",null),e([d()],C.prototype,"supportsQueryRelated",null),e([d()],C.prototype,"supportsResizeAttachments",null),e([d()],C.prototype,"supportsUpdate",null),e([d()],C.prototype,"supportsUpdateAttachments",null),e([d()],C.prototype,"supportsZ",null),e([d({type:b})],C.prototype,"timeExtent",void 0),e([d()],C.prototype,"view",void 0),e([d()],C.prototype,"where",void 0),C=e([c("esri.widgets.FeatureTable.support.FeatureStore")],C);const w=C;export{w as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as t}from"tslib";import e from"../../core/Collection.js";import{EventedAccessor as i}from"../../core/Evented.js";import n from"../../core/Logger.js";import{after as s,isAbortError as r}from"../../core/promiseUtils.js";import{watch as o,initial as l,syncAndInitial as a,whenOnce as m}from"../../core/reactiveUtils.js";import{offsetDate as u}from"../../core/timeUtils.js";import{property as p}from"../../core/accessorSupport/decorators/property.js";import{ensureType as h}from"../../core/accessorSupport/ensureType.js";import"../../core/has.js";import"../../core/RandomLCG.js";import{subclass as d}from"../../core/accessorSupport/decorators/subclass.js";import{T as c}from"../../chunks/TimeExtent.js";import{T as f}from"../../chunks/TimeInterval.js";import w from"../../webdoc/Widgets.js";import g from"../../webdoc/widgets/TimeSlider.js";const v=1e4;function T(t){return null!=t&&void 0!==t.count}function x(t){return null!=t&&void 0!==t.interval}function E(t){return null!=t&&void 0!==t.dates}let _=class extends i{constructor(t){super(t),this._animationController=null,this._isViewTimeExtentInitialized=!1,this._timerId=null,this.actions=new e,this.fullTimeExtent=null,this.loop=!1,this.mode="time-window",this.stops={count:10},this.timeExtent=null,this.view=null}initialize(){this.addHandles([o(()=>this.effectiveStops,()=>{this.timeExtent??=this._getDefaultTimeExtent()},l),o(()=>this.view,(t,e)=>{this._unregisterWidget(e),this._registerWidget(t)},a),o(()=>this.timeExtent,t=>{if(!this.view)return;const e=this.view.timeExtent;(t&&!t.isAllTime||e&&!e.isAllTime)&&(t&&e&&t.equals(e)||(this.view.timeExtent=t))},l),o(()=>this.view?.timeExtent,t=>{this._isViewTimeExtentInitialized?(t&&!t.isAllTime||this.timeExtent&&!this.timeExtent.isAllTime)&&(t&&this.timeExtent&&t.equals(this.timeExtent)||(this.timeExtent=t)):this._isViewTimeExtentInitialized=!0})])}destroy(){null!=this._timerId&&(clearInterval(this._timerId),this._timerId=null),this._unregisterWidget(this.view),this.view=null,this._animationController&&(this._animationController.abort(),this._animationController=null)}get effectiveStops(){const{fullTimeExtent:t,stops:e}=this;if(E(e)){const{dates:i}=e;if(!i?.length)return null;const n=i.sort((t,e)=>t.getTime()-e.getTime());if(!t)return n;const{start:s,end:r}=t;if(!s||!r)return n;return n.filter(t=>!(t.getTime()<s.getTime()||t.getTime()>r.getTime()))}if(T(e)){const i=e.timeExtent??t;return this._divideTimeExtentByCount(i,e.count)}if(x(e)){const i=e.timeExtent??t;return this._divideTimeExtentByInterval(i,e.interval)}return[]}set playRate(t){t<=0||t>36e5||("playing"===this.state&&this._startAnimation(),this._set("playRate",t))}get state(){return this.fullTimeExtent?this._animationController?"playing":"ready":"disabled"}get timeExtentValues(){const{mode:t,timeExtent:e}=this;if(!e||e.isAllTime||e.isEmpty)return null;const{start:i,end:n}=e;switch(t){case"cumulative-from-end":case"instant":return i?[i.getTime()]:null;case"cumulative-from-start":return n?[n.getTime()]:null;case"time-window":return i&&n?[i.getTime(),n.getTime()]:null}}next(){this._step({forward:!0,allowRestart:!1})}play(){this._startAnimation()}previous(){this._step({forward:!1,allowRestart:!1})}stop(){this._stopAnimation()}triggerAction(t){this.emit("trigger-action",{action:t})}updateWebDocument(t){const e=new g({currentTimeExtent:this.timeExtent,fullTimeExtent:this.fullTimeExtent,loop:this.loop,numStops:T(this.stops)?this.stops.count:null,numThumbs:"time-window"===this.mode?2:1,stopDelay:this.playRate,stopInterval:x(this.stops)?this.stops.interval:null,stops:E(this.stops)?this.stops.dates:null});t.widgets?t.widgets.timeSlider=e:t.widgets=new w({timeSlider:e})}valuesToTimeExtent(t){if(!t)return null;const e=t.sort((t,e)=>t-e).map(t=>new Date(t)),i=e.length>0?e[0]:null,n=e.length>1?e[1]:null;switch(this.mode){case"time-window":return new c({start:i,end:n});case"instant":return new c({start:i,end:i});case"cumulative-from-start":return new c({start:null,end:i});case"cumulative-from-end":return new c({start:i,end:null});default:return c.allTime}}async _animate(){try{const t=this.view,e=this._animationController?.signal;await Promise.all([s(this.playRate,null,e),t&&m(()=>!t.updating,e)])}catch(t){return r(t)||n.getLogger(this).error(t),void(this._animationController=null)}this._step({forward:!0,allowRestart:!1}),this._animationController&&this._animate()}_divideTimeExtentByCount(t,e=10){if(!t||!e)return[];const{start:i,end:n}=t;if(!i||!n)return[];if(e>v)return this._divideTimeExtentByCount(t);const s=[],r=i.getTime(),o=n.getTime()-r;for(let l=0;l<=e;l++)s.push(new Date(r+l/e*o));return s}_divideTimeExtentByInterval(t,e,i=v){if(!t||!e)return[];const{start:n,end:s}=t;if(!n||!s)return[];const r=s.getTime()-n.getTime(),o=e.toMilliseconds();if(o<=0||r/o>i)return this._divideTimeExtentByCount(t);const l=[],{value:a,unit:m}=e;let p=n;for(;p.getTime()<=s.getTime();)l.push(new Date(p)),p=u(p,a,m);return l}_getDefaultTimeExtent(){const{effectiveStops:t,mode:e}=this;if(!t||!e)return null;switch(e){case"time-window":return t.length>1?new c({start:t[0],end:t[1]}):null;case"cumulative-from-start":return t.length>0?new c({start:null,end:t[0]}):null;case"cumulative-from-end":return t.length>0?new c({start:t[0],end:null}):null;case"instant":return t.length>0?new c({start:t[0],end:t[0]}):null;default:return null}}_registerWidget(t){if(t){t.persistableViewModels.includes(this)||t.persistableViewModels.add(this)}}_startAnimation(){this._stopAnimation(),this._animationController=new AbortController,this._step({forward:!0,allowRestart:!0}),this._animate()}_step(t){const{forward:e,allowRestart:i}=t,{effectiveStops:n}=this;if(!this.timeExtentValues||!n)return;const s=n.map(t=>t.getTime()),r=this.timeExtentValues.map(t=>{const e=s.indexOf(t);if(-1!==e)return e;const i=s.reduce((e,i)=>Math.abs(i-t)<Math.abs(e-t)?i:e);return s.indexOf(i)}),o=r.map(t=>t+(e?1:-1)),l=o.some(t=>t<0||t>s.length-1),{loop:a,state:m}=this;if(l)if(a||i){const t=Math.min(...r),i=Math.max(...r),n=(e?r.map(e=>e-t):r.map(t=>t+(s.length-1-i))).map(t=>s[t]);this.timeExtent=this.valuesToTimeExtent(n)}else"playing"===m&&this.stop();else{const t=o.map(t=>s[t]);this.timeExtent=this.valuesToTimeExtent(t)}}_stopAnimation(){null!=this._animationController&&(this._animationController.abort(),this._animationController=null)}_unregisterWidget(t){null!=t&&t.persistableViewModels.remove(this)}};t([p()],_.prototype,"_animationController",void 0),t([p({type:e})],_.prototype,"actions",void 0),t([p({readOnly:!0})],_.prototype,"effectiveStops",null),t([p({type:c})],_.prototype,"fullTimeExtent",void 0),t([p({nonNullable:!0})],_.prototype,"loop",void 0),t([p({nonNullable:!0})],_.prototype,"mode",void 0),t([p({nonNullable:!0,value:1e3})],_.prototype,"playRate",null),t([p({readOnly:!0})],_.prototype,"state",null),t([p({cast:t=>t?(x(t)&&(t.interval=h(f,t.interval)),(x(t)||T(t))&&(t.timeExtent=h(c,t.timeExtent)),t):null})],_.prototype,"stops",void 0),t([p({type:c})],_.prototype,"timeExtent",void 0),t([p({readOnly:!0})],_.prototype,"timeExtentValues",null),t([p()],_.prototype,"view",void 0),t([p()],_.prototype,"next",null),t([p()],_.prototype,"play",null),t([p()],_.prototype,"previous",null),t([p()],_.prototype,"stop",null),t([p()],_.prototype,"updateWebDocument",null),_=t([d("esri.widgets.TimeSlider.TimeSliderViewModel")],_);const y=_;export{y as default};
5
+ import{__decorate as t}from"tslib";import e from"../../core/Collection.js";import{EventedAccessor as i}from"../../core/Evented.js";import n from"../../core/Logger.js";import{after as s,isAbortError as r}from"../../core/promiseUtils.js";import{watch as o,initial as l,syncAndInitial as a,whenOnce as m}from"../../core/reactiveUtils.js";import{offsetDate as u}from"../../core/timeUtils.js";import{property as p}from"../../core/accessorSupport/decorators/property.js";import{ensureType as d}from"../../core/accessorSupport/ensureType.js";import"../../core/has.js";import"../../core/RandomLCG.js";import{subclass as h}from"../../core/accessorSupport/decorators/subclass.js";import c from"../../time/TimeExtent.js";import f from"../../time/TimeInterval.js";import w from"../../webdoc/Widgets.js";import g from"../../webdoc/widgets/TimeSlider.js";const v=1e4;function T(t){return null!=t&&void 0!==t.count}function x(t){return null!=t&&void 0!==t.interval}function E(t){return null!=t&&void 0!==t.dates}let _=class extends i{constructor(t){super(t),this._animationController=null,this._isViewTimeExtentInitialized=!1,this._timerId=null,this.actions=new e,this.fullTimeExtent=null,this.loop=!1,this.mode="time-window",this.stops={count:10},this.timeExtent=null,this.view=null}initialize(){this.addHandles([o(()=>this.effectiveStops,()=>{this.timeExtent??=this._getDefaultTimeExtent()},l),o(()=>this.view,(t,e)=>{this._unregisterWidget(e),this._registerWidget(t)},a),o(()=>this.timeExtent,t=>{if(!this.view)return;const e=this.view.timeExtent;(t&&!t.isAllTime||e&&!e.isAllTime)&&(t&&e&&t.equals(e)||(this.view.timeExtent=t))},l),o(()=>this.view?.timeExtent,t=>{this._isViewTimeExtentInitialized?(t&&!t.isAllTime||this.timeExtent&&!this.timeExtent.isAllTime)&&(t&&this.timeExtent&&t.equals(this.timeExtent)||(this.timeExtent=t)):this._isViewTimeExtentInitialized=!0})])}destroy(){null!=this._timerId&&(clearInterval(this._timerId),this._timerId=null),this._unregisterWidget(this.view),this.view=null,this._animationController&&(this._animationController.abort(),this._animationController=null)}get effectiveStops(){const{fullTimeExtent:t,stops:e}=this;if(E(e)){const{dates:i}=e;if(!i?.length)return null;const n=i.sort((t,e)=>t.getTime()-e.getTime());if(!t)return n;const{start:s,end:r}=t;if(!s||!r)return n;return n.filter(t=>!(t.getTime()<s.getTime()||t.getTime()>r.getTime()))}if(T(e)){const i=e.timeExtent??t;return this._divideTimeExtentByCount(i,e.count)}if(x(e)){const i=e.timeExtent??t;return this._divideTimeExtentByInterval(i,e.interval)}return[]}set playRate(t){t<=0||t>36e5||("playing"===this.state&&this._startAnimation(),this._set("playRate",t))}get state(){return this.fullTimeExtent?this._animationController?"playing":"ready":"disabled"}get timeExtentValues(){const{mode:t,timeExtent:e}=this;if(!e||e.isAllTime||e.isEmpty)return null;const{start:i,end:n}=e;switch(t){case"cumulative-from-end":case"instant":return i?[i.getTime()]:null;case"cumulative-from-start":return n?[n.getTime()]:null;case"time-window":return i&&n?[i.getTime(),n.getTime()]:null}}next(){this._step({forward:!0,allowRestart:!1})}play(){this._startAnimation()}previous(){this._step({forward:!1,allowRestart:!1})}stop(){this._stopAnimation()}triggerAction(t){this.emit("trigger-action",{action:t})}updateWebDocument(t){const e=new g({currentTimeExtent:this.timeExtent,fullTimeExtent:this.fullTimeExtent,loop:this.loop,numStops:T(this.stops)?this.stops.count:null,numThumbs:"time-window"===this.mode?2:1,stopDelay:this.playRate,stopInterval:x(this.stops)?this.stops.interval:null,stops:E(this.stops)?this.stops.dates:null});t.widgets?t.widgets.timeSlider=e:t.widgets=new w({timeSlider:e})}valuesToTimeExtent(t){if(!t)return null;const e=t.sort((t,e)=>t-e).map(t=>new Date(t)),i=e.length>0?e[0]:null,n=e.length>1?e[1]:null;switch(this.mode){case"time-window":return new c({start:i,end:n});case"instant":return new c({start:i,end:i});case"cumulative-from-start":return new c({start:null,end:i});case"cumulative-from-end":return new c({start:i,end:null});default:return c.allTime}}async _animate(){try{const t=this.view,e=this._animationController?.signal;await Promise.all([s(this.playRate,null,e),t&&m(()=>!t.updating,e)])}catch(t){return r(t)||n.getLogger(this).error(t),void(this._animationController=null)}this._step({forward:!0,allowRestart:!1}),this._animationController&&this._animate()}_divideTimeExtentByCount(t,e=10){if(!t||!e)return[];const{start:i,end:n}=t;if(!i||!n)return[];if(e>v)return this._divideTimeExtentByCount(t);const s=[],r=i.getTime(),o=n.getTime()-r;for(let l=0;l<=e;l++)s.push(new Date(r+l/e*o));return s}_divideTimeExtentByInterval(t,e,i=v){if(!t||!e)return[];const{start:n,end:s}=t;if(!n||!s)return[];const r=s.getTime()-n.getTime(),o=e.toMilliseconds();if(o<=0||r/o>i)return this._divideTimeExtentByCount(t);const l=[],{value:a,unit:m}=e;let p=n;for(;p.getTime()<=s.getTime();)l.push(new Date(p)),p=u(p,a,m);return l}_getDefaultTimeExtent(){const{effectiveStops:t,mode:e}=this;if(!t||!e)return null;switch(e){case"time-window":return t.length>1?new c({start:t[0],end:t[1]}):null;case"cumulative-from-start":return t.length>0?new c({start:null,end:t[0]}):null;case"cumulative-from-end":return t.length>0?new c({start:t[0],end:null}):null;case"instant":return t.length>0?new c({start:t[0],end:t[0]}):null;default:return null}}_registerWidget(t){if(t){t.persistableViewModels.includes(this)||t.persistableViewModels.add(this)}}_startAnimation(){this._stopAnimation(),this._animationController=new AbortController,this._step({forward:!0,allowRestart:!0}),this._animate()}_step(t){const{forward:e,allowRestart:i}=t,{effectiveStops:n}=this;if(!this.timeExtentValues||!n)return;const s=n.map(t=>t.getTime()),r=this.timeExtentValues.map(t=>{const e=s.indexOf(t);if(-1!==e)return e;const i=s.reduce((e,i)=>Math.abs(i-t)<Math.abs(e-t)?i:e);return s.indexOf(i)}),o=r.map(t=>t+(e?1:-1)),l=o.some(t=>t<0||t>s.length-1),{loop:a,state:m}=this;if(l)if(a||i){const t=Math.min(...r),i=Math.max(...r),n=(e?r.map(e=>e-t):r.map(t=>t+(s.length-1-i))).map(t=>s[t]);this.timeExtent=this.valuesToTimeExtent(n)}else"playing"===m&&this.stop();else{const t=o.map(t=>s[t]);this.timeExtent=this.valuesToTimeExtent(t)}}_stopAnimation(){null!=this._animationController&&(this._animationController.abort(),this._animationController=null)}_unregisterWidget(t){null!=t&&t.persistableViewModels.remove(this)}};t([p()],_.prototype,"_animationController",void 0),t([p({type:e})],_.prototype,"actions",void 0),t([p({readOnly:!0})],_.prototype,"effectiveStops",null),t([p({type:c})],_.prototype,"fullTimeExtent",void 0),t([p({nonNullable:!0})],_.prototype,"loop",void 0),t([p({nonNullable:!0})],_.prototype,"mode",void 0),t([p({nonNullable:!0,value:1e3})],_.prototype,"playRate",null),t([p({readOnly:!0})],_.prototype,"state",null),t([p({cast:t=>t?(x(t)&&(t.interval=d(f,t.interval)),(x(t)||T(t))&&(t.timeExtent=d(c,t.timeExtent)),t):null})],_.prototype,"stops",void 0),t([p({type:c})],_.prototype,"timeExtent",void 0),t([p({readOnly:!0})],_.prototype,"timeExtentValues",null),t([p()],_.prototype,"view",void 0),t([p()],_.prototype,"next",null),t([p()],_.prototype,"play",null),t([p()],_.prototype,"previous",null),t([p()],_.prototype,"stop",null),t([p()],_.prototype,"updateWebDocument",null),_=t([h("esri.widgets.TimeSlider.TimeSliderViewModel")],_);const y=_;export{y 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.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as t}from"tslib";import{equals as e}from"../core/arrayUtils.js";import{neverReached as i}from"../core/compilerUtils.js";import{watch as a,initial as s}from"../core/reactiveUtils.js";import{truncateDate as r,offsetDate as o}from"../core/timeUtils.js";import{property as n}from"../core/accessorSupport/decorators/property.js";import"../core/Logger.js";import{subclass as l}from"../core/accessorSupport/decorators/subclass.js";import{formatDate as m,convertDateFormatToIntlOptions as u}from"../intl/date.js";import{unknown as c,system as d}from"../time/constants.js";import{T as p}from"../chunks/TimeInterval.js";import h from"./Slider.js";import v from"./Widget.js";import{loadCalciteComponents as f}from"./support/componentsUtils.js";import{globalCss as y}from"./support/globalCss.js";import{onResize as g}from"./support/widgetUtils.js";import{messageBundle as b}from"./support/decorators/messageBundle.js";import{vmEvent as x}from"./support/decorators/vmEvent.js";import{tsx as w}from"./support/jsxFactory.js";import{getCalciteModeClass as E}from"../support/modeUtils.js";import{css as k}from"./TimeSlider/css.js";import j from"./TimeSlider/TimeSliderViewModel.js";const T=3,_=858,S=[{minor:{value:100,unit:"milliseconds"},major:{value:1,unit:"seconds"},format:{second:"numeric"}},{minor:{value:500,unit:"milliseconds"},major:{value:5,unit:"seconds"},format:{second:"numeric"}},{minor:{value:1,unit:"seconds"},major:{value:20,unit:"seconds"},format:{minute:"numeric",second:"numeric"}},{minor:{value:2,unit:"seconds"},major:{value:30,unit:"seconds"},format:{minute:"numeric",second:"numeric"}},{minor:{value:10,unit:"seconds"},major:{value:1,unit:"minutes"},format:{minute:"numeric"}},{minor:{value:15,unit:"seconds"},major:{value:5,unit:"minutes"},format:{hour:"numeric",minute:"numeric"}},{minor:{value:1,unit:"minutes"},major:{value:20,unit:"minutes"},format:{hour:"numeric",minute:"numeric"}},{minor:{value:5,unit:"minutes"},major:{value:2,unit:"hours"},format:{hour:"numeric",minute:"numeric"}},{minor:{value:15,unit:"minutes"},major:{value:6,unit:"hours"},format:{hour:"numeric",minute:"numeric"}},{minor:{value:1,unit:"hours"},major:{value:1,unit:"days"},format:{day:"numeric",month:"short"}},{minor:{value:6,unit:"hours"},major:{value:1,unit:"weeks"},format:{day:"numeric",month:"short"}},{minor:{value:1,unit:"days"},major:{value:1,unit:"months"},format:{month:"long"}},{minor:{value:2,unit:"days"},major:{value:1,unit:"months"},format:{month:"short"}},{minor:{value:3,unit:"days"},major:{value:1,unit:"months"},format:{month:"short"}},{minor:{value:4,unit:"days"},major:{value:3,unit:"months"},format:{month:"short",year:"numeric"}},{minor:{value:1,unit:"weeks"},major:{value:1,unit:"years"},format:{year:"numeric"}},{minor:{value:1,unit:"months"},major:{value:1,unit:"years"},format:{year:"numeric"}},{minor:{value:2,unit:"months"},major:{value:2,unit:"years"},format:{year:"numeric"}},{minor:{value:1,unit:"years"},major:{value:1,unit:"decades"},format:{year:"numeric"}},{minor:{value:2,unit:"years"},major:{value:5,unit:"decades"},format:{year:"numeric"}},{minor:{value:5,unit:"decades"},major:{value:10,unit:"centuries"},format:{era:"short",year:"numeric"}},{minor:{value:1,unit:"centuries"},major:{value:10,unit:"centuries"},format:{era:"short",year:"numeric"}},{minor:{value:2,unit:"centuries"},major:{value:20,unit:"centuries"},format:{era:"short",year:"numeric"}},{minor:{value:5,unit:"centuries"},major:{value:50,unit:"centuries"},format:{era:"short",year:"numeric"}},{minor:{value:10,unit:"centuries"},major:{value:100,unit:"centuries"},format:{era:"short",year:"numeric"}},{minor:{value:20,unit:"centuries"},major:{value:200,unit:"centuries"},format:{era:"short",year:"numeric"}},{minor:{value:50,unit:"centuries"},major:{value:500,unit:"centuries"},format:{era:"short",year:"numeric"}},{minor:{value:100,unit:"centuries"},major:{value:1e3,unit:"centuries"},format:{era:"short",year:"numeric"}},{minor:{value:200,unit:"centuries"},major:{value:1e3,unit:"centuries"},format:{era:"short",year:"numeric"}},{minor:{value:500,unit:"centuries"},major:{value:5e3,unit:"centuries"},format:{era:"short",year:"numeric"}},{minor:{value:1e3,unit:"centuries"},major:{value:1e4,unit:"centuries"},format:{era:"short",year:"numeric"}}];function M(t){return w("div",{class:k.warning},w("calcite-icon",{class:k.warningIcon,icon:"exclamation-mark-triangle"}),w("calcite-label",{alignment:"center",class:k.warningLabel,scale:"s"},t))}let F=class extends v{constructor(t,e){super(t,e),this._allLayouts=["auto","compact","wide"],this._ignoreNextSliderUpdate=!1,this._slider=new h({precision:0,visibleElements:{rangeLabels:!1},rangeLabelInputsEnabled:!1,thumbsConstrained:!1}),this._tickFormat=null,this.disabled=!1,this.labelFormatFunction=null,this.messages=null,this.tickConfigs=null,this.timeVisible=!1,this.viewModel=new j}initialize(){this.addHandles([a(()=>this._slider.values,t=>{if(this._ignoreNextSliderUpdate)return void(this._ignoreNextSliderUpdate=!1);const e=this.viewModel.valuesToTimeExtent(t);this.timeExtent?e?this.timeExtent.equals(e)||(this.timeExtent=e):this.timeExtent=null:e&&(this.timeExtent=e)}),a(()=>this.effectiveStops,()=>this._updateSliderSteps(),s)])}loadDependencies(){return f({action:()=>import("@esri/calcite-components/dist/components/calcite-action"),"action-menu":()=>import("@esri/calcite-components/dist/components/calcite-action-menu"),button:()=>import("@esri/calcite-components/dist/components/calcite-button"),icon:()=>import("@esri/calcite-components/dist/components/calcite-icon"),label:()=>import("@esri/calcite-components/dist/components/calcite-label")})}destroy(){this._slider.destroy(),this._tickFormat=null}get _dateFormat(){return this._getIntlOptions("short-date")}get _timeFormat(){return this._getIntlOptions("long-time")}get actions(){return this.viewModel.actions}set actions(t){this.viewModel.actions=t}get effectiveStops(){return this.viewModel.effectiveStops}get fullTimeExtent(){return this.viewModel.fullTimeExtent}set fullTimeExtent(t){this.viewModel.fullTimeExtent=t}get icon(){return"clock"}set icon(t){this._overrideIfSome("icon",t)}get interactive(){return!(this.disabled||"disabled"===this.viewModel.state||this.timeZone===c)}get label(){return this.messages?.widgetLabel??""}set label(t){this._overrideIfSome("label",t)}set layout(t){this._set("layout",this._allLayouts.includes(t)?t:"auto")}get loop(){return this.viewModel.loop}set loop(t){this.viewModel.loop=t}get mode(){return this.viewModel.mode}set mode(t){this.viewModel.mode=t}get playRate(){return this.viewModel.playRate}set playRate(t){this.viewModel.playRate=t}get stops(){return this.viewModel.stops}set stops(t){this.viewModel.stops=t}get tickFormats(){const{timeZone:t}=this;return S.map(({minor:e,major:i,format:a})=>({minor:new p(e),major:new p(i),format:{...a,timeZone:t}}))}get timeExtent(){return this.viewModel.timeExtent}set timeExtent(t){this.viewModel.timeExtent=t}get timeZone(){return this.viewModel.view?.timeZone??d}set timeZone(t){this._overrideIfSome("timeZone",t)}get view(){return this.viewModel.view}set view(t){this.viewModel.view=t}next(){return this.viewModel.next()}play(){return this.viewModel.play()}previous(){return this.viewModel.previous()}stop(){return this.viewModel.stop()}render(){const{_slider:t,actions:i,domNode:a,effectiveStops:s,fullTimeExtent:r,interactive:o,messages:n,mode:l,tickConfigs:u,timeExtent:c,timeVisible:d,viewModel:{state:p,timeExtentValues:h}}=this;if(r){const{start:e,end:i}=r;if(e&&i){const a=e.getTime(),s=i.getTime(),r=t.min!==a||t.max!==s;if(r&&(t.min=a,t.max=s),u)t.tickConfigs!==u&&(t.tickConfigs=u);else{const e=(s-a)/(t.trackElement?.offsetWidth||400),i=this.tickFormats.find(({minor:t})=>t.toMilliseconds()>T*e)??this.tickFormats.at(-1),o=i&&this._tickFormat!==i;if(o&&(this._tickFormat=i),r||o){const e={mode:"position",values:this._getTickPositions(i.minor),labelsVisible:!1,tickCreatedFunction:(t,e)=>{e?.classList.add(k.sliderMinorTick)}},a={mode:"position",values:this._getTickPositions(i.major),labelsVisible:!0,tickCreatedFunction:(t,e)=>{e?.classList.add(k.sliderMajorTick)},labelFormatFunction:t=>m(t,i.format)};t.tickConfigs=[e,a]}}}}const v=!this.fullTimeExtent?.start||!this.fullTimeExtent.end||!this.timeExtent||this.timeExtent.isAllTime||this.timeExtent.isEmpty||this.timeExtent.start&&(this.timeExtent.start<this.fullTimeExtent.start||this.timeExtent.start>this.fullTimeExtent.end)||this.timeExtent.end&&(this.timeExtent.end>this.fullTimeExtent.end||this.timeExtent.end<this.fullTimeExtent.start);if(v)switch(this._ignoreNextSliderUpdate=!0,l){case"time-window":t.values=[t.min,t.max];break;case"instant":case"cumulative-from-end":t.values=[t.min];break;case"cumulative-from-start":t.values=[t.max]}else h?e(t.values,h)||(t.values=h):t.values=null;t.disabled=!o;const f=v||!o||!s?.length,b="auto"===this.layout?a.clientWidth<_?"compact":"wide":this.layout,x=w("calcite-button",{appearance:"transparent",bind:this,class:k.play,disabled:f,iconStart:"playing"===p?"pause":"play",kind:"neutral",label:"playing"===p?n.control.stop:n.control.play,onclick:this._playOrStopClick,scale:"wide"===b?"l":"m",width:"full"}),j=this.labelFormatFunction?w("div",{afterCreate:this._createLabel,afterUpdate:this._createLabel,bind:this,class:k.timeExtentStartDate,"data-date":c?[c.start,c.end]:null,"data-layout":b,"data-type":"extent",key:k.timeExtentStartDate}):!c||c.isAllTime?M(n.noTimeExtent):c.isEmpty?M(n.emptyTimeExtent):[c?.start&&w("div",{class:k.timeExtentStartGroup,key:k.timeExtentStartGroup},w("calcite-label",{alignment:"center",class:k.timeExtentStartDate,key:k.timeExtentStartDate,scale:"s"},this._formatDate(c.start)),d?w("calcite-label",{alignment:"center",class:k.timeExtentStartTime,key:k.timeExtentStartTime,scale:"s"},this._formatTime(c.start)):null),c.start&&c.end&&c.start.getTime()!==c.end.getTime()&&w("div",{class:k.timeExtentSeparator,key:k.timeExtentSeparator}),c?.end&&(!c.start||c.start.getTime()!==c.end.getTime())&&w("div",{class:k.timeExtentEndGroup,key:k.timeExtentEndGroup},w("calcite-label",{alignment:"center",class:k.timeExtentEndDate,key:k.timeExtentEndDate,scale:"s"},this._formatDate(c.end)),d?w("calcite-label",{alignment:"center",class:k.timeExtentEndTime,key:k.timeExtentEndTime,scale:"s"},this._formatTime(c.end)):null)],S=w("div",{class:k.timeExtent},j),F=this.labelFormatFunction?w("div",{afterCreate:this._createLabel,afterUpdate:this._createLabel,bind:this,class:k.minDate,"data-date":r?.start,"data-layout":b,"data-type":"min",key:k.minDate}):r?.start&&[w("calcite-label",{class:k.minDate,key:k.minDate,scale:"s"},this._formatDate(r.start)),d&&w("calcite-label",{class:k.minTime,key:k.minTime,scale:"s"},this._formatTime(r.start))],D=w("div",{class:k.min},F),C=w("div",{class:k.slider},t.render()),L=this.labelFormatFunction?w("div",{afterCreate:this._createLabel,afterUpdate:this._createLabel,bind:this,class:k.maxDate,"data-date":r?.end,"data-layout":b,"data-type":"max",key:k.maxDate}):r?.end&&[w("calcite-label",{class:k.maxDate,key:k.maxDate,scale:"s"},this._formatDate(r.end)),d&&w("calcite-label",{class:k.maxTime,key:k.maxTime,scale:"s"},this._formatTime(r.end))],U=w("div",{class:k.max},L),Z=w("calcite-button",{appearance:"transparent",bind:this,class:k.previous,disabled:f||"playing"===p,iconStart:"reverse",kind:"neutral",label:n.pagination.previous,onclick:this._previousClick,scale:"wide"===b?"l":"m",width:"full"}),R=w("calcite-button",{appearance:"transparent",bind:this,class:k.next,disabled:f||"playing"===p,iconStart:"forward",kind:"neutral",label:n.pagination.next,onclick:this._nextClick,scale:"wide"===b?"l":"m",width:"full"}),I=i?.length>0,O=I&&w("calcite-action-menu",{class:k.actions,label:n.options},i.toArray().map(t=>w("calcite-action",{bind:this,icon:t.icon,id:t.id,onclick:()=>this.viewModel.triggerAction(t),text:t.title,textEnabled:!0})));return w("div",{afterCreate:t=>{this.addHandles(g(t,()=>this.scheduleRender()))},"aria-label":n.widgetLabel,class:this.classes(k.timeSlider,y.widget,`${k.timeSliderMode}${l}`,`${k.timeSliderLayout}${b}`,!o&&k.timeSliderDisabled,v&&k.timeSliderOutOfBounds,I&&k.hasActions,E())},"wide"===b&&w("div",{class:k.timeSliderRow},w("div",{class:k.playbackControls},[x,S,D,C,U,Z,R]),O),"compact"===b&&[w("div",{class:k.timeSliderRow,key:"time-slider-row-1"},[S,O]),w("div",{class:k.timeSliderRow,key:"time-slider-row-2"},[C]),w("div",{class:k.timeSliderRow,key:"time-slider-row-3"},[D,Z,x,R,U])])}updateWebDocument(t){this.viewModel?.updateWebDocument(t)}_createLabel(t){if(!this.labelFormatFunction)return;const e=t.getAttribute("data-type"),i=t.getAttribute("data-layout"),a=t["data-date"];this.labelFormatFunction(a,e,t,i)}_formatDate(t){return m(t,this._dateFormat)}_formatTime(t){return m(t,this._timeFormat)}_getIntlOptions(t){const{timeZone:e}=this;return{...u(t),timeZone:e}}_getTickPositions(t){const{fullTimeExtent:e}=this;if(!e?.start||!e.end)return[];const{start:i,end:a}=e,s=[],{value:n,unit:l}=t;let m=r(i,l,this.timeZone);for(;m.getTime()<=a.getTime();)m.getTime()>=i.getTime()&&s.push(m.getTime()),m=o(m,n,l,this.timeZone);return s}_updateSliderSteps(){this._slider.steps=this.effectiveStops&&this.effectiveStops.length>0?this.effectiveStops.map(t=>t.getTime()):null}_playOrStopClick(){switch(this.viewModel.state){case"ready":this.viewModel.play();break;case"playing":this.viewModel.stop();break;case"disabled":break;default:i(this.viewModel.state)}}_previousClick(){this.viewModel.previous()}_nextClick(){this.viewModel.next()}};t([n()],F.prototype,"_dateFormat",null),t([n()],F.prototype,"_timeFormat",null),t([n()],F.prototype,"actions",null),t([n()],F.prototype,"disabled",void 0),t([n()],F.prototype,"effectiveStops",null),t([n()],F.prototype,"fullTimeExtent",null),t([n()],F.prototype,"icon",null),t([n({readOnly:!0})],F.prototype,"interactive",null),t([n()],F.prototype,"label",null),t([n()],F.prototype,"labelFormatFunction",void 0),t([n({value:"auto"})],F.prototype,"layout",null),t([n()],F.prototype,"loop",null),t([n(),b("esri/widgets/TimeSlider/t9n/TimeSlider")],F.prototype,"messages",void 0),t([n()],F.prototype,"mode",null),t([n()],F.prototype,"playRate",null),t([n()],F.prototype,"stops",null),t([n()],F.prototype,"tickConfigs",void 0),t([n()],F.prototype,"tickFormats",null),t([n()],F.prototype,"timeExtent",null),t([n({nonNullable:!0})],F.prototype,"timeVisible",void 0),t([n()],F.prototype,"timeZone",null),t([n()],F.prototype,"view",null),t([n({type:j}),x("trigger-action")],F.prototype,"viewModel",void 0),F=t([l("esri.widgets.TimeSlider")],F);const D=F;export{D as default};
5
+ import{__decorate as t}from"tslib";import{equals as e}from"../core/arrayUtils.js";import{neverReached as i}from"../core/compilerUtils.js";import{watch as a,initial as s}from"../core/reactiveUtils.js";import{truncateDate as r,offsetDate as o}from"../core/timeUtils.js";import{property as n}from"../core/accessorSupport/decorators/property.js";import"../core/Logger.js";import{subclass as l}from"../core/accessorSupport/decorators/subclass.js";import{formatDate as m,convertDateFormatToIntlOptions as u}from"../intl/date.js";import{unknown as c,system as d}from"../time/constants.js";import p from"../time/TimeInterval.js";import h from"./Slider.js";import v from"./Widget.js";import{loadCalciteComponents as f}from"./support/componentsUtils.js";import{globalCss as y}from"./support/globalCss.js";import{onResize as g}from"./support/widgetUtils.js";import{messageBundle as b}from"./support/decorators/messageBundle.js";import{vmEvent as x}from"./support/decorators/vmEvent.js";import{tsx as w}from"./support/jsxFactory.js";import{getCalciteModeClass as E}from"../support/modeUtils.js";import{css as k}from"./TimeSlider/css.js";import j from"./TimeSlider/TimeSliderViewModel.js";const T=3,_=858,S=[{minor:{value:100,unit:"milliseconds"},major:{value:1,unit:"seconds"},format:{second:"numeric"}},{minor:{value:500,unit:"milliseconds"},major:{value:5,unit:"seconds"},format:{second:"numeric"}},{minor:{value:1,unit:"seconds"},major:{value:20,unit:"seconds"},format:{minute:"numeric",second:"numeric"}},{minor:{value:2,unit:"seconds"},major:{value:30,unit:"seconds"},format:{minute:"numeric",second:"numeric"}},{minor:{value:10,unit:"seconds"},major:{value:1,unit:"minutes"},format:{minute:"numeric"}},{minor:{value:15,unit:"seconds"},major:{value:5,unit:"minutes"},format:{hour:"numeric",minute:"numeric"}},{minor:{value:1,unit:"minutes"},major:{value:20,unit:"minutes"},format:{hour:"numeric",minute:"numeric"}},{minor:{value:5,unit:"minutes"},major:{value:2,unit:"hours"},format:{hour:"numeric",minute:"numeric"}},{minor:{value:15,unit:"minutes"},major:{value:6,unit:"hours"},format:{hour:"numeric",minute:"numeric"}},{minor:{value:1,unit:"hours"},major:{value:1,unit:"days"},format:{day:"numeric",month:"short"}},{minor:{value:6,unit:"hours"},major:{value:1,unit:"weeks"},format:{day:"numeric",month:"short"}},{minor:{value:1,unit:"days"},major:{value:1,unit:"months"},format:{month:"long"}},{minor:{value:2,unit:"days"},major:{value:1,unit:"months"},format:{month:"short"}},{minor:{value:3,unit:"days"},major:{value:1,unit:"months"},format:{month:"short"}},{minor:{value:4,unit:"days"},major:{value:3,unit:"months"},format:{month:"short",year:"numeric"}},{minor:{value:1,unit:"weeks"},major:{value:1,unit:"years"},format:{year:"numeric"}},{minor:{value:1,unit:"months"},major:{value:1,unit:"years"},format:{year:"numeric"}},{minor:{value:2,unit:"months"},major:{value:2,unit:"years"},format:{year:"numeric"}},{minor:{value:1,unit:"years"},major:{value:1,unit:"decades"},format:{year:"numeric"}},{minor:{value:2,unit:"years"},major:{value:5,unit:"decades"},format:{year:"numeric"}},{minor:{value:5,unit:"decades"},major:{value:10,unit:"centuries"},format:{era:"short",year:"numeric"}},{minor:{value:1,unit:"centuries"},major:{value:10,unit:"centuries"},format:{era:"short",year:"numeric"}},{minor:{value:2,unit:"centuries"},major:{value:20,unit:"centuries"},format:{era:"short",year:"numeric"}},{minor:{value:5,unit:"centuries"},major:{value:50,unit:"centuries"},format:{era:"short",year:"numeric"}},{minor:{value:10,unit:"centuries"},major:{value:100,unit:"centuries"},format:{era:"short",year:"numeric"}},{minor:{value:20,unit:"centuries"},major:{value:200,unit:"centuries"},format:{era:"short",year:"numeric"}},{minor:{value:50,unit:"centuries"},major:{value:500,unit:"centuries"},format:{era:"short",year:"numeric"}},{minor:{value:100,unit:"centuries"},major:{value:1e3,unit:"centuries"},format:{era:"short",year:"numeric"}},{minor:{value:200,unit:"centuries"},major:{value:1e3,unit:"centuries"},format:{era:"short",year:"numeric"}},{minor:{value:500,unit:"centuries"},major:{value:5e3,unit:"centuries"},format:{era:"short",year:"numeric"}},{minor:{value:1e3,unit:"centuries"},major:{value:1e4,unit:"centuries"},format:{era:"short",year:"numeric"}}];function M(t){return w("div",{class:k.warning},w("calcite-icon",{class:k.warningIcon,icon:"exclamation-mark-triangle"}),w("calcite-label",{alignment:"center",class:k.warningLabel,scale:"s"},t))}let F=class extends v{constructor(t,e){super(t,e),this._allLayouts=["auto","compact","wide"],this._ignoreNextSliderUpdate=!1,this._slider=new h({precision:0,visibleElements:{rangeLabels:!1},rangeLabelInputsEnabled:!1,thumbsConstrained:!1}),this._tickFormat=null,this.disabled=!1,this.labelFormatFunction=null,this.messages=null,this.tickConfigs=null,this.timeVisible=!1,this.viewModel=new j}initialize(){this.addHandles([a(()=>this._slider.values,t=>{if(this._ignoreNextSliderUpdate)return void(this._ignoreNextSliderUpdate=!1);const e=this.viewModel.valuesToTimeExtent(t);this.timeExtent?e?this.timeExtent.equals(e)||(this.timeExtent=e):this.timeExtent=null:e&&(this.timeExtent=e)}),a(()=>this.effectiveStops,()=>this._updateSliderSteps(),s)])}loadDependencies(){return f({action:()=>import("@esri/calcite-components/dist/components/calcite-action"),"action-menu":()=>import("@esri/calcite-components/dist/components/calcite-action-menu"),button:()=>import("@esri/calcite-components/dist/components/calcite-button"),icon:()=>import("@esri/calcite-components/dist/components/calcite-icon"),label:()=>import("@esri/calcite-components/dist/components/calcite-label")})}destroy(){this._slider.destroy(),this._tickFormat=null}get _dateFormat(){return this._getIntlOptions("short-date")}get _timeFormat(){return this._getIntlOptions("long-time")}get actions(){return this.viewModel.actions}set actions(t){this.viewModel.actions=t}get effectiveStops(){return this.viewModel.effectiveStops}get fullTimeExtent(){return this.viewModel.fullTimeExtent}set fullTimeExtent(t){this.viewModel.fullTimeExtent=t}get icon(){return"clock"}set icon(t){this._overrideIfSome("icon",t)}get interactive(){return!(this.disabled||"disabled"===this.viewModel.state||this.timeZone===c)}get label(){return this.messages?.widgetLabel??""}set label(t){this._overrideIfSome("label",t)}set layout(t){this._set("layout",this._allLayouts.includes(t)?t:"auto")}get loop(){return this.viewModel.loop}set loop(t){this.viewModel.loop=t}get mode(){return this.viewModel.mode}set mode(t){this.viewModel.mode=t}get playRate(){return this.viewModel.playRate}set playRate(t){this.viewModel.playRate=t}get stops(){return this.viewModel.stops}set stops(t){this.viewModel.stops=t}get tickFormats(){const{timeZone:t}=this;return S.map(({minor:e,major:i,format:a})=>({minor:new p(e),major:new p(i),format:{...a,timeZone:t}}))}get timeExtent(){return this.viewModel.timeExtent}set timeExtent(t){this.viewModel.timeExtent=t}get timeZone(){return this.viewModel.view?.timeZone??d}set timeZone(t){this._overrideIfSome("timeZone",t)}get view(){return this.viewModel.view}set view(t){this.viewModel.view=t}next(){return this.viewModel.next()}play(){return this.viewModel.play()}previous(){return this.viewModel.previous()}stop(){return this.viewModel.stop()}render(){const{_slider:t,actions:i,domNode:a,effectiveStops:s,fullTimeExtent:r,interactive:o,messages:n,mode:l,tickConfigs:u,timeExtent:c,timeVisible:d,viewModel:{state:p,timeExtentValues:h}}=this;if(r){const{start:e,end:i}=r;if(e&&i){const a=e.getTime(),s=i.getTime(),r=t.min!==a||t.max!==s;if(r&&(t.min=a,t.max=s),u)t.tickConfigs!==u&&(t.tickConfigs=u);else{const e=(s-a)/(t.trackElement?.offsetWidth||400),i=this.tickFormats.find(({minor:t})=>t.toMilliseconds()>T*e)??this.tickFormats.at(-1),o=i&&this._tickFormat!==i;if(o&&(this._tickFormat=i),r||o){const e={mode:"position",values:this._getTickPositions(i.minor),labelsVisible:!1,tickCreatedFunction:(t,e)=>{e?.classList.add(k.sliderMinorTick)}},a={mode:"position",values:this._getTickPositions(i.major),labelsVisible:!0,tickCreatedFunction:(t,e)=>{e?.classList.add(k.sliderMajorTick)},labelFormatFunction:t=>m(t,i.format)};t.tickConfigs=[e,a]}}}}const v=!this.fullTimeExtent?.start||!this.fullTimeExtent.end||!this.timeExtent||this.timeExtent.isAllTime||this.timeExtent.isEmpty||this.timeExtent.start&&(this.timeExtent.start<this.fullTimeExtent.start||this.timeExtent.start>this.fullTimeExtent.end)||this.timeExtent.end&&(this.timeExtent.end>this.fullTimeExtent.end||this.timeExtent.end<this.fullTimeExtent.start);if(v)switch(this._ignoreNextSliderUpdate=!0,l){case"time-window":t.values=[t.min,t.max];break;case"instant":case"cumulative-from-end":t.values=[t.min];break;case"cumulative-from-start":t.values=[t.max]}else h?e(t.values,h)||(t.values=h):t.values=null;t.disabled=!o;const f=v||!o||!s?.length,b="auto"===this.layout?a.clientWidth<_?"compact":"wide":this.layout,x=w("calcite-button",{appearance:"transparent",bind:this,class:k.play,disabled:f,iconStart:"playing"===p?"pause":"play",kind:"neutral",label:"playing"===p?n.control.stop:n.control.play,onclick:this._playOrStopClick,scale:"wide"===b?"l":"m",width:"full"}),j=this.labelFormatFunction?w("div",{afterCreate:this._createLabel,afterUpdate:this._createLabel,bind:this,class:k.timeExtentStartDate,"data-date":c?[c.start,c.end]:null,"data-layout":b,"data-type":"extent",key:k.timeExtentStartDate}):!c||c.isAllTime?M(n.noTimeExtent):c.isEmpty?M(n.emptyTimeExtent):[c?.start&&w("div",{class:k.timeExtentStartGroup,key:k.timeExtentStartGroup},w("calcite-label",{alignment:"center",class:k.timeExtentStartDate,key:k.timeExtentStartDate,scale:"s"},this._formatDate(c.start)),d?w("calcite-label",{alignment:"center",class:k.timeExtentStartTime,key:k.timeExtentStartTime,scale:"s"},this._formatTime(c.start)):null),c.start&&c.end&&c.start.getTime()!==c.end.getTime()&&w("div",{class:k.timeExtentSeparator,key:k.timeExtentSeparator}),c?.end&&(!c.start||c.start.getTime()!==c.end.getTime())&&w("div",{class:k.timeExtentEndGroup,key:k.timeExtentEndGroup},w("calcite-label",{alignment:"center",class:k.timeExtentEndDate,key:k.timeExtentEndDate,scale:"s"},this._formatDate(c.end)),d?w("calcite-label",{alignment:"center",class:k.timeExtentEndTime,key:k.timeExtentEndTime,scale:"s"},this._formatTime(c.end)):null)],S=w("div",{class:k.timeExtent},j),F=this.labelFormatFunction?w("div",{afterCreate:this._createLabel,afterUpdate:this._createLabel,bind:this,class:k.minDate,"data-date":r?.start,"data-layout":b,"data-type":"min",key:k.minDate}):r?.start&&[w("calcite-label",{class:k.minDate,key:k.minDate,scale:"s"},this._formatDate(r.start)),d&&w("calcite-label",{class:k.minTime,key:k.minTime,scale:"s"},this._formatTime(r.start))],D=w("div",{class:k.min},F),C=w("div",{class:k.slider},t.render()),L=this.labelFormatFunction?w("div",{afterCreate:this._createLabel,afterUpdate:this._createLabel,bind:this,class:k.maxDate,"data-date":r?.end,"data-layout":b,"data-type":"max",key:k.maxDate}):r?.end&&[w("calcite-label",{class:k.maxDate,key:k.maxDate,scale:"s"},this._formatDate(r.end)),d&&w("calcite-label",{class:k.maxTime,key:k.maxTime,scale:"s"},this._formatTime(r.end))],U=w("div",{class:k.max},L),Z=w("calcite-button",{appearance:"transparent",bind:this,class:k.previous,disabled:f||"playing"===p,iconStart:"reverse",kind:"neutral",label:n.pagination.previous,onclick:this._previousClick,scale:"wide"===b?"l":"m",width:"full"}),R=w("calcite-button",{appearance:"transparent",bind:this,class:k.next,disabled:f||"playing"===p,iconStart:"forward",kind:"neutral",label:n.pagination.next,onclick:this._nextClick,scale:"wide"===b?"l":"m",width:"full"}),I=i?.length>0,O=I&&w("calcite-action-menu",{class:k.actions,label:n.options},i.toArray().map(t=>w("calcite-action",{bind:this,icon:t.icon,id:t.id,onclick:()=>this.viewModel.triggerAction(t),text:t.title,textEnabled:!0})));return w("div",{afterCreate:t=>{this.addHandles(g(t,()=>this.scheduleRender()))},"aria-label":n.widgetLabel,class:this.classes(k.timeSlider,y.widget,`${k.timeSliderMode}${l}`,`${k.timeSliderLayout}${b}`,!o&&k.timeSliderDisabled,v&&k.timeSliderOutOfBounds,I&&k.hasActions,E())},"wide"===b&&w("div",{class:k.timeSliderRow},w("div",{class:k.playbackControls},[x,S,D,C,U,Z,R]),O),"compact"===b&&[w("div",{class:k.timeSliderRow,key:"time-slider-row-1"},[S,O]),w("div",{class:k.timeSliderRow,key:"time-slider-row-2"},[C]),w("div",{class:k.timeSliderRow,key:"time-slider-row-3"},[D,Z,x,R,U])])}updateWebDocument(t){this.viewModel?.updateWebDocument(t)}_createLabel(t){if(!this.labelFormatFunction)return;const e=t.getAttribute("data-type"),i=t.getAttribute("data-layout"),a=t["data-date"];this.labelFormatFunction(a,e,t,i)}_formatDate(t){return m(t,this._dateFormat)}_formatTime(t){return m(t,this._timeFormat)}_getIntlOptions(t){const{timeZone:e}=this;return{...u(t),timeZone:e}}_getTickPositions(t){const{fullTimeExtent:e}=this;if(!e?.start||!e.end)return[];const{start:i,end:a}=e,s=[],{value:n,unit:l}=t;let m=r(i,l,this.timeZone);for(;m.getTime()<=a.getTime();)m.getTime()>=i.getTime()&&s.push(m.getTime()),m=o(m,n,l,this.timeZone);return s}_updateSliderSteps(){this._slider.steps=this.effectiveStops&&this.effectiveStops.length>0?this.effectiveStops.map(t=>t.getTime()):null}_playOrStopClick(){switch(this.viewModel.state){case"ready":this.viewModel.play();break;case"playing":this.viewModel.stop();break;case"disabled":break;default:i(this.viewModel.state)}}_previousClick(){this.viewModel.previous()}_nextClick(){this.viewModel.next()}};t([n()],F.prototype,"_dateFormat",null),t([n()],F.prototype,"_timeFormat",null),t([n()],F.prototype,"actions",null),t([n()],F.prototype,"disabled",void 0),t([n()],F.prototype,"effectiveStops",null),t([n()],F.prototype,"fullTimeExtent",null),t([n()],F.prototype,"icon",null),t([n({readOnly:!0})],F.prototype,"interactive",null),t([n()],F.prototype,"label",null),t([n()],F.prototype,"labelFormatFunction",void 0),t([n({value:"auto"})],F.prototype,"layout",null),t([n()],F.prototype,"loop",null),t([n(),b("esri/widgets/TimeSlider/t9n/TimeSlider")],F.prototype,"messages",void 0),t([n()],F.prototype,"mode",null),t([n()],F.prototype,"playRate",null),t([n()],F.prototype,"stops",null),t([n()],F.prototype,"tickConfigs",void 0),t([n()],F.prototype,"tickFormats",null),t([n()],F.prototype,"timeExtent",null),t([n({nonNullable:!0})],F.prototype,"timeVisible",void 0),t([n()],F.prototype,"timeZone",null),t([n()],F.prototype,"view",null),t([n({type:j}),x("trigger-action")],F.prototype,"viewModel",void 0),F=t([l("esri.widgets.TimeSlider")],F);const D=F;export{D as default};
package/TimeExtent.d.ts DELETED
@@ -1,4 +0,0 @@
1
- import "./interfaces";
2
-
3
- import esriTimeExtent = __esri.esriTimeExtent;
4
- export default esriTimeExtent;
package/TimeExtent.js DELETED
@@ -1,5 +0,0 @@
1
- /*
2
- All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
- See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
- */
5
- import{deprecatedModule as e}from"./core/deprecate.js";import r from"./core/Logger.js";import{T as t}from"./chunks/TimeExtent.js";export{a as default}from"./chunks/TimeExtent.js";e(r.getLogger("esri.TimeExtent"),"esri.TimeExtent",{replacement:"esri.time.TimeExtent",version:"4.31",warnOnce:!0});
package/TimeInterval.d.ts DELETED
@@ -1,4 +0,0 @@
1
- import "./interfaces";
2
-
3
- import esriTimeInterval = __esri.esriTimeInterval;
4
- export default esriTimeInterval;
package/TimeInterval.js DELETED
@@ -1,5 +0,0 @@
1
- /*
2
- All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
- See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
- */
5
- import{deprecatedModule as e}from"./core/deprecate.js";import r from"./core/Logger.js";import{T as m}from"./chunks/TimeInterval.js";export{a as default}from"./chunks/TimeInterval.js";e(r.getLogger("esri.TimeInterval"),"esri.TimeInterval",{replacement:"esri.time.TimeInterval",version:"4.31",warnOnce:!0});