@arcgis/core 4.34.0-next.91 → 4.34.0-next.93

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 (212) hide show
  1. package/Color.js +1 -1
  2. package/Ground.js +1 -1
  3. package/WebScene.js +1 -1
  4. package/assets/esri/core/workers/RemoteClient.js +1 -1
  5. package/assets/esri/core/workers/chunks/004b13c1db79c9e668b1.js +1 -0
  6. package/assets/esri/core/workers/chunks/{700b5a536f97233bc4af.js → 03b455e9405a8b6fec68.js} +1 -1
  7. package/assets/esri/core/workers/chunks/{a244afea77127e54dd3a.js → 08b0fc6bfe9640ee2525.js} +1 -1
  8. package/assets/esri/core/workers/chunks/0a981061df08da19372c.js +1 -0
  9. package/assets/esri/core/workers/chunks/20003728a679479b14dc.js +1 -0
  10. package/assets/esri/core/workers/chunks/352511dbc67166face40.js +1 -0
  11. package/assets/esri/core/workers/chunks/3acd79a6a0572926a799.js +1 -0
  12. package/assets/esri/core/workers/chunks/3d7923d25734d03a4d27.js +1 -0
  13. package/assets/esri/core/workers/chunks/48133effac2eacc2196e.js +1 -0
  14. package/assets/esri/core/workers/chunks/4dfcd03082be83600f3a.js +1 -0
  15. package/assets/esri/core/workers/chunks/503c81dda242e6077317.js +1 -0
  16. package/assets/esri/core/workers/chunks/{06aed0a5464965be8d52.js → 56b3bb68b61b77138186.js} +1 -1
  17. package/assets/esri/core/workers/chunks/5746c4861af83c1d57a8.js +1 -0
  18. package/assets/esri/core/workers/chunks/5aacd1c6b171c99b41f5.js +1 -0
  19. package/assets/esri/core/workers/chunks/5eb7f6f5121c8830c561.js +1 -0
  20. package/assets/esri/core/workers/chunks/6810ecdeccf4b7eae5e2.js +1 -0
  21. package/assets/esri/core/workers/chunks/6b208f5d423da64c8559.js +1 -0
  22. package/assets/esri/core/workers/chunks/{8bdbd94a59269e216fba.js → 6c3b585b9cb6bb640fb0.js} +1 -1
  23. package/assets/esri/core/workers/chunks/{7a240ab31d9ff2d2c5af.js → 73db6c070b049fe05147.js} +1 -1
  24. package/assets/esri/core/workers/chunks/801451fb572bc5f1f270.js +1 -0
  25. package/assets/esri/core/workers/chunks/82e0d22619dc26920ca9.js +1 -0
  26. package/assets/esri/core/workers/chunks/{6aa349e1adf844df4b5b.js → 8b9a50cfaa5a7df02dad.js} +1 -1
  27. package/assets/esri/core/workers/chunks/8de9e50de0ac66ae1573.js +1 -0
  28. package/assets/esri/core/workers/chunks/8f426cb210a4250517d5.js +1 -0
  29. package/assets/esri/core/workers/chunks/94ddf029698991d853b9.js +1 -0
  30. package/assets/esri/core/workers/chunks/97eb2cfc1f036feea9a9.js +1 -0
  31. package/assets/esri/core/workers/chunks/{a85acb948cc7d22be592.js → 992b1389710d716d3450.js} +1 -1
  32. package/assets/esri/core/workers/chunks/9adecee0ed2f1df3b0d2.js +1 -0
  33. package/assets/esri/core/workers/chunks/a0fab8cd791c33d3895d.js +1 -0
  34. package/assets/esri/core/workers/chunks/{e99fc64b67bb0c71dc34.js → ad67e5eb4b8c0c14cea6.js} +1 -1
  35. package/assets/esri/core/workers/chunks/b5c829e904bc9cb5347d.js +1 -0
  36. package/assets/esri/core/workers/chunks/bec9ddd38c9ab9f2561b.js +1 -0
  37. package/assets/esri/core/workers/chunks/bf9031749d10e7d457b6.js +1 -0
  38. package/assets/esri/core/workers/chunks/bf9d09493fd849ea69fd.js +1 -0
  39. package/assets/esri/core/workers/chunks/{58e2652810143f509fe1.js → c473b15d4d52f0a63d20.js} +1 -1
  40. package/assets/esri/core/workers/chunks/c8e4fe0e3b109eb80e8e.js +1 -0
  41. package/assets/esri/core/workers/chunks/cd0c222a36caa7f80860.js +1 -0
  42. package/assets/esri/core/workers/chunks/ce175801937e80e3c487.js +1 -0
  43. package/assets/esri/core/workers/chunks/{100a0041ee42b0b2fa32.js → e5d974593043d5e2b502.js} +1 -1
  44. package/assets/esri/core/workers/chunks/{1194c2432c31def87db1.js → f71b76c9506178124fa3.js} +1 -1
  45. package/assets/esri/themes/base/_core.scss +0 -2
  46. package/assets/esri/themes/base/widgets/_OrientedImageryViewerNavigationUI.scss +10 -7
  47. package/assets/esri/themes/dark/main.css +1 -1
  48. package/assets/esri/themes/light/main.css +1 -1
  49. package/assets/esri/themes/light/view.css +1 -1
  50. package/chunks/CutFillComposition.glsl.js +15 -3
  51. package/chunks/CutFillMask.glsl.js +1 -1
  52. package/chunks/languageUtils.js +1 -1
  53. package/config.js +1 -1
  54. package/core/CollectionFlattener.js +1 -1
  55. package/editing/sharedTemplates/executor/support/createPresetServiceEdit.js +1 -1
  56. package/geometry/operators/json/graphicBufferOperator.js +1 -1
  57. package/geometry/support/aaBoundingRect.js +1 -1
  58. package/geometry/support/geometryUtils.js +1 -1
  59. package/geometry/support/meshUtils/elevationSampler.js +1 -1
  60. package/geometry/support/meshUtils.js +1 -1
  61. package/geometry/support/triangle.js +1 -1
  62. package/interfaces.d.ts +52 -261
  63. package/kernel.js +1 -1
  64. package/layers/BaseElevationLayer.js +1 -1
  65. package/layers/BaseTileLayer.js +1 -1
  66. package/layers/ElevationLayer.js +1 -1
  67. package/layers/FeatureLayer.js +1 -1
  68. package/layers/GaussianSplatLayer.js +1 -1
  69. package/layers/ImageryTileLayer.js +1 -1
  70. package/layers/ParquetLayer.js +1 -1
  71. package/layers/graphics/sources/ParquetSource.js +1 -1
  72. package/layers/graphics/sources/support/ParquetSourceWorker.js +1 -1
  73. package/layers/orientedImagery/transformations/updateElevationUtils.js +1 -1
  74. package/layers/support/ElevationQuery.js +1 -1
  75. package/layers/support/ElevationQueryContext.js +5 -0
  76. package/layers/support/ElevationSampler.js +1 -1
  77. package/layers/support/ElevationTile.js +1 -1
  78. package/layers/support/GeometryDescriptor.js +1 -1
  79. package/layers/support/ParquetEncodingLocation.js +1 -1
  80. package/layers/support/ParquetEncodingWkb.js +1 -1
  81. package/layers/support/RasterBandInfo.js +1 -1
  82. package/layers/support/TileElevationSampler.js +5 -0
  83. package/layers/support/TileInfo.js +1 -1
  84. package/layers/support/TileKey.js +1 -1
  85. package/layers/support/TilemapCache.js +1 -1
  86. package/layers/support/layerUtils.js +1 -1
  87. package/layers/support/parquetEncodingUtils.js +5 -0
  88. package/layers/support/parquetUtils.js +1 -1
  89. package/networks/UtilityNetwork.js +1 -1
  90. package/networks/support/typeUtils.js +1 -1
  91. package/package.json +2 -2
  92. package/popup/FieldInfo.js +1 -1
  93. package/rest/networks/support/Association.js +1 -1
  94. package/rest/print.js +1 -1
  95. package/support/revision.js +1 -1
  96. package/symbols/cim/CIMSymbolHelper.js +1 -1
  97. package/symbols/cim/cimAnalyzer.js +1 -1
  98. package/symbols/cim/effects/EffectOffset.js +1 -1
  99. package/views/2d/analysis/ElevationProfile/ElevationProfileLineVisualization2D.js +1 -1
  100. package/views/2d/analysis/ElevationProfileAnalysisView2D.js +1 -1
  101. package/views/2d/engine/Stage.js +1 -1
  102. package/views/2d/engine/flow/BrushFlow.js +1 -1
  103. package/views/2d/engine/vectorTiles/VectorTileRendererHelper3D.js +1 -1
  104. package/views/2d/engine/webgl/Overlay.js +1 -1
  105. package/views/2d/engine/webgl/OverlayMultipoint.js +1 -1
  106. package/views/2d/engine/webgl/SpriteMosaic.js +1 -1
  107. package/views/2d/engine/webgl/TextureManager.js +1 -1
  108. package/views/2d/engine/webgl/animatedFormats/AnimatableTextureResource.js +1 -1
  109. package/views/2d/engine/webgl/animatedFormats/utils.js +1 -1
  110. package/views/2d/engine/webgl/shaderGraph/techniques/animated/AnimatedMarkerMeshWriter.js +1 -1
  111. package/views/2d/engine/webgl/shaderGraph/techniques/animated/AnimatedTechnique.js +1 -1
  112. package/views/2d/engine/webgl/shaderGraph/techniques/fill/ComplexFillTechnique.js +1 -1
  113. package/views/2d/engine/webgl/shaderGraph/techniques/fill/ComplexOutlineFillTechnique.js +1 -1
  114. package/views/2d/engine/webgl/shaderGraph/techniques/fill/GradientFillTechnique.js +1 -1
  115. package/views/2d/engine/webgl/shaderGraph/techniques/fill/PatternFillTechnique.js +1 -1
  116. package/views/2d/engine/webgl/shaderGraph/techniques/fill/PatternOutlineFillTechnique.js +1 -1
  117. package/views/2d/engine/webgl/shaderGraph/techniques/labels/LabelTechnique.js +1 -1
  118. package/views/2d/engine/webgl/shaderGraph/techniques/line/GradientStrokeTechnique.js +1 -1
  119. package/views/2d/engine/webgl/shaderGraph/techniques/line/TexturedLineTechnique.js +1 -1
  120. package/views/2d/engine/webgl/shaderGraph/techniques/markers/MarkerTechnique.js +1 -1
  121. package/views/2d/engine/webgl/shaderGraph/techniques/text/TextTechnique.js +1 -1
  122. package/views/2d/engine/webgl/shaderGraph/utils.js +1 -1
  123. package/views/2d/interactive/snapping/featureSources/featureServiceSource/FeatureServiceTiles2D.js +1 -1
  124. package/views/2d/layers/VideoLayerView2D.js +1 -1
  125. package/views/2d/navigation/actions/Pan.js +1 -1
  126. package/views/3d/analysis/ElevationProfile/ElevationProfileLineSceneComputation.js +1 -1
  127. package/views/3d/analysis/ElevationProfile/ElevationProfileLineVisualization3D.js +1 -1
  128. package/views/3d/analysis/ElevationProfile/ElevationProfileVisualization3D.js +1 -1
  129. package/views/3d/analysis/ElevationProfileAnalysisView3D.js +1 -1
  130. package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementCutFillVisualization.js +1 -1
  131. package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementTool.js +1 -1
  132. package/views/3d/interactive/snapping/featureSources/featureServiceSource/FeatureServiceTiles3D.js +1 -1
  133. package/views/3d/support/hitTest.js +1 -1
  134. package/views/3d/support/pointsOfInterest/StableSurfaceCenter.js +1 -1
  135. package/views/3d/support/popupHitTest.js +1 -1
  136. package/views/3d/terrain/ExtentHelper.js +1 -1
  137. package/views/3d/webgl-engine/lib/CutFillColor.js +1 -1
  138. package/views/3d/webgl-engine/shaders/CutFillComposition.glsl.js +1 -1
  139. package/views/SceneView.js +1 -1
  140. package/views/View2D.js +1 -1
  141. package/views/Viewport2DMixin.js +1 -1
  142. package/views/analysis/ElevationProfile/ElevationProfileController.js +1 -1
  143. package/views/analysis/ElevationProfile/ElevationProfileLineComputation.js +1 -1
  144. package/views/analysis/ElevationProfile/ElevationProfileLineQueryComputation.js +1 -1
  145. package/views/analysis/ElevationProfile/ElevationProfileResult.js +1 -1
  146. package/views/analysis/ExclusiveOperationManager.js +5 -0
  147. package/views/interactive/snapping/featureSources/FeatureServiceSnappingSource.js +1 -1
  148. package/views/interactive/snapping/featureSources/WorkerTileTreeDebugger.js +1 -1
  149. package/views/interactive/snapping/featureSources/featureServiceSource/FeatureServiceSnappingSourceWorker.js +1 -1
  150. package/views/interactive/snapping/featureSources/featureServiceSource/FeatureServiceSnappingSourceWorkerHandle.js +1 -1
  151. package/views/interactive/snapping/featureSources/featureServiceSource/FeatureServiceTileStore.js +1 -1
  152. package/views/interactive/snapping/featureSources/featureServiceSource/FeatureServiceTiledFetcher.js +1 -1
  153. package/views/interactive/snapping/featureSources/featureServiceSource/FeatureServiceTilesSimple.js +1 -1
  154. package/views/interactive/snapping/featureSources/featureServiceSource/PendingFeatureTile.js +1 -1
  155. package/views/interactive/snapping/featureSources/queryEngineUtils.js +1 -1
  156. package/views/navigation/Navigation.js +1 -1
  157. package/views/support/GroundViewElevationSampler.js +1 -1
  158. package/views/video/VideoOperationalDataView.js +1 -1
  159. package/widgets/BasemapGallery/support/basemapCompatibilityUtils.js +1 -1
  160. package/widgets/Feature/FeatureExpression.js +1 -1
  161. package/widgets/Feature/FeatureMedia.js +1 -1
  162. package/widgets/Feature/FeatureViewModel.js +1 -1
  163. package/widgets/Feature.js +1 -1
  164. package/widgets/FeatureTable/FeatureTableViewModel.js +1 -1
  165. package/widgets/FeatureTable.js +1 -1
  166. package/widgets/Legend/LegendViewModel.js +1 -1
  167. package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
  168. package/widgets/OrientedImageryViewer/components/ImageViewer.js +1 -1
  169. package/widgets/OrientedImageryViewer/components/NavigationUI360.js +1 -1
  170. package/widgets/OrientedImageryViewer/components/NavigationUIPanoramicViewModel.js +1 -1
  171. package/widgets/OrientedImageryViewer/services/DepthImageService.js +5 -0
  172. package/widgets/PanoramicViewer.js +1 -1
  173. package/widgets/Search/SearchViewModel.js +1 -1
  174. package/widgets/Sketch/SketchViewModel.js +1 -1
  175. package/widgets/support/decorators/vmEvent.js +1 -1
  176. package/assets/esri/core/workers/chunks/08374e5805fcedc1cb57.js +0 -1
  177. package/assets/esri/core/workers/chunks/14114be3afd6d292f89c.js +0 -1
  178. package/assets/esri/core/workers/chunks/2605062e44f2d4e73f14.js +0 -1
  179. package/assets/esri/core/workers/chunks/282c4f3484c605ce7d5e.js +0 -1
  180. package/assets/esri/core/workers/chunks/2e1cc11462846febb3b2.js +0 -1
  181. package/assets/esri/core/workers/chunks/37b5007660535f1c91c6.js +0 -1
  182. package/assets/esri/core/workers/chunks/393274af1804e5b6046a.js +0 -1
  183. package/assets/esri/core/workers/chunks/3ff3e1507220d3869c76.js +0 -1
  184. package/assets/esri/core/workers/chunks/4133ab8720e7e4afa9a6.js +0 -1
  185. package/assets/esri/core/workers/chunks/4d807bfe75108438db83.js +0 -1
  186. package/assets/esri/core/workers/chunks/5ad1985a9e66fb2232ae.js +0 -1
  187. package/assets/esri/core/workers/chunks/5b7a2ee44883b1fb2a5f.js +0 -1
  188. package/assets/esri/core/workers/chunks/614a00a3179f8fe23f45.js +0 -1
  189. package/assets/esri/core/workers/chunks/83065bef261314f9b2c5.js +0 -1
  190. package/assets/esri/core/workers/chunks/8cae725e631d922853c8.js +0 -1
  191. package/assets/esri/core/workers/chunks/8f4cfef97716c3502b0f.js +0 -1
  192. package/assets/esri/core/workers/chunks/9bb6984f24cd5461a754.js +0 -1
  193. package/assets/esri/core/workers/chunks/9f2a3f37fe9b19ef1209.js +0 -1
  194. package/assets/esri/core/workers/chunks/a1196637268b89281780.js +0 -1
  195. package/assets/esri/core/workers/chunks/b240298b8b643a323d34.js +0 -1
  196. package/assets/esri/core/workers/chunks/b47f26d6aa9a2848a677.js +0 -1
  197. package/assets/esri/core/workers/chunks/b661ea374fe38c8e29ca.js +0 -1
  198. package/assets/esri/core/workers/chunks/b8997ae5893afa0298d1.js +0 -1
  199. package/assets/esri/core/workers/chunks/baa48614d9567d5f240d.js +0 -1
  200. package/assets/esri/core/workers/chunks/c20862fe15295a294bbd.js +0 -1
  201. package/assets/esri/core/workers/chunks/c3020747f9001ca6a6e7.js +0 -1
  202. package/assets/esri/core/workers/chunks/c7c76a8a1c47eb62bef1.js +0 -1
  203. package/assets/esri/core/workers/chunks/eea9d49d55c2d1355497.js +0 -1
  204. package/assets/esri/core/workers/chunks/fb6ebb780bb59e252887.js +0 -1
  205. package/assets/esri/core/workers/chunks/ff6d189ba78980d40bb5.js +0 -1
  206. package/assets/esri/themes/base/widgets/_ButtonMenu.scss +0 -87
  207. package/widgets/FeatureTable/Grid/support/ButtonMenu.d.ts +0 -4
  208. package/widgets/FeatureTable/Grid/support/ButtonMenu.js +0 -5
  209. package/widgets/FeatureTable/Grid/support/ButtonMenuItem.d.ts +0 -4
  210. package/widgets/FeatureTable/Grid/support/ButtonMenuItem.js +0 -5
  211. package/widgets/FeatureTable/Grid/support/ButtonMenuViewModel.d.ts +0 -4
  212. package/widgets/FeatureTable/Grid/support/ButtonMenuViewModel.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 t}from"tslib";import{Clonable as e}from"../../../core/Clonable.js";import{memoize as o}from"../../../core/memoize.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 i from"../../../geometry/Point.js";import{binaryFindClosest as l}from"./elevationProfileGenerationUtils.js";import{convertSamples as n,convertStatistics as a}from"./elevationProfileUnitUtils.js";let p=class extends e{constructor(t){super(t),this._getSamplesMemoized=o((t,e)=>n(t,e)),this._getStatisticsMemoized=o((t,e)=>a(t,e)),this.rawResult=null}get available(){const{computation:t}=this;return t.profileLine.enabled&&t.available}get progress(){return null!=this.rawResult&&this.computation.profileLine.enabled?this.rawResult.progress:0}get samples(){return this._getSamplesMemoized(this.rawResult,this.computation.controller.effectiveUnits)}get statistics(){return this._getStatisticsMemoized(this.rawResult,this.computation.controller.effectiveUnits)}get hoveredPoint(){if(!this.computation.profileLine.enabled)return null;const t=this.computation.controller.analysisViewData.hoveredPosition;if(null==t)return null;const{rawResult:e,samples:o}=this;if(null==o||null==e)return null;const r=o.length;if(0===r)return null;const s=o[r-1].distance,n=l(o,t*s,t=>t.distance);if(null==n)return null;const{x:a,y:p,z:u}=n;return null==u?null:new i({x:a,y:p,z:u,spatialReference:e.spatialReference})}};t([r()],p.prototype,"available",null),t([r()],p.prototype,"progress",null),t([r()],p.prototype,"samples",null),t([r()],p.prototype,"statistics",null),t([r({constructOnly:!0})],p.prototype,"computation",void 0),t([r()],p.prototype,"rawResult",void 0),t([r()],p.prototype,"hoveredPoint",null),p=t([s("esri.views.analysis.ElevationProfile.ElevationProfileResult")],p);export{p as default};
5
+ import{__decorate as t}from"tslib";import{Clonable as e}from"../../../core/Clonable.js";import{memoize as o}from"../../../core/memoize.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 l from"../../../geometry/Point.js";import{binaryFindClosest as i}from"./elevationProfileGenerationUtils.js";import{convertSamples as n,convertStatistics as a}from"./elevationProfileUnitUtils.js";let p=class extends e{constructor(t){super(t),this._getSamplesMemoized=o((t,e)=>n(t,e)),this._getStatisticsMemoized=o((t,e)=>a(t,e)),this.rawResult=null}get available(){const{computation:t}=this;return t.profile.enabled&&t.available}get profile(){return this.computation.profile}get progress(){return null!=this.rawResult&&this.computation.profile.enabled?this.rawResult.progress:0}get samples(){return this._getSamplesMemoized(this.rawResult,this.computation.controller.effectiveUnits)}get statistics(){return this._getStatisticsMemoized(this.rawResult,this.computation.controller.effectiveUnits)}get hoveredPoint(){if(!this.computation.profile.enabled)return null;const t=this.computation.controller.analysisViewData.hoveredPosition;if(null==t)return null;const{rawResult:e,samples:o}=this;if(null==o||null==e)return null;const r=o.length;if(0===r)return null;const s=o[r-1].distance,n=i(o,t*s,t=>t.distance);if(null==n)return null;const{x:a,y:p,z:u}=n;return null==u?null:new l({x:a,y:p,z:u,spatialReference:e.spatialReference})}};t([r()],p.prototype,"available",null),t([r({readOnly:!0})],p.prototype,"profile",null),t([r({readOnly:!0})],p.prototype,"progress",null),t([r()],p.prototype,"samples",null),t([r()],p.prototype,"statistics",null),t([r({constructOnly:!0})],p.prototype,"computation",void 0),t([r()],p.prototype,"rawResult",void 0),t([r()],p.prototype,"hoveredPoint",null),p=t([s("esri.views.analysis.ElevationProfile.ElevationProfileResult")],p);export{p as default};
@@ -0,0 +1,5 @@
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{isSome as t}from"../../core/arrayUtils.js";import{removeHandles as r}from"../../core/handleUtils.js";import{createResolver as s,onAbort as e,throwIfAborted as o,createAbortError as i}from"../../core/promiseUtils.js";class n{constructor(){this._currentOperation=null}destroy(){this.stop()}async start(n,a){const l=this._currentOperation;l?.stop();const p=new AbortController,c=a?.signal,h=AbortSignal.any([p.signal,c].filter(t)),m=s();let u=!1;const d=()=>{u||(u=!0,m.reject(i()))},y={resolve:()=>{u||(u=!0,m.resolve({}))},reject:d,promise:m.promise,stop:()=>p.abort(),handles:[]};this._currentOperation=y,y.handles.push(e(c,()=>{p.abort()}),e(h,()=>{r(y.handles),u||d()}));try{return l&&(await l.promise.catch(()=>{}),o(h)),await n(y,h),await m.promise}finally{r(y.handles),this._currentOperation===y&&(this._currentOperation=null)}}stop(){this._currentOperation?.stop()}}export{n as ExclusiveOperationManager};
@@ -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{createTask as r}from"../../../../core/asyncUtils.js";import{destroyHandle as i}from"../../../../core/handleUtils.js";import{memoize as s}from"../../../../core/memoize.js";import{throwIfAborted as o,ignoreAbortErrors as a}from"../../../../core/promiseUtils.js";import{watch as n,on as l,initial as d,sync as u,syncAndInitial as p}from"../../../../core/reactiveUtils.js";import{sqlAnd as h}from"../../../../core/sql.js";import{property as c}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as y}from"../../../../core/accessorSupport/decorators/subclass.js";import{UpdatingHandles as f}from"../../../../core/support/UpdatingHandles.js";import{isSubtypeGroupLayer as m}from"../../../../layers/support/layerUtils.js";import{elevationContextAffectsAlignment as _}from"../../../../support/elevationInfoUtils.js";import{FeatureServiceTiles2D as g}from"../../../2d/interactive/snapping/featureSources/featureServiceSource/FeatureServiceTiles2D.js";import{FeatureServiceTiles3D as w}from"../../../3d/interactive/snapping/featureSources/featureServiceSource/FeatureServiceTiles3D.js";import{isUtilityNetworkWebMap as S}from"../snappingUtils.js";import{makeGetGroundElevation as v,convertSnappingCandidate as b}from"./queryEngineUtils.js";import{WorkerTileTreeDebugger as I}from"./WorkerTileTreeDebugger.js";import{FeatureServiceSnappingSourceWorkerHandle as H}from"./featureServiceSource/FeatureServiceSnappingSourceWorkerHandle.js";import{FeatureServiceTilesSimple as F}from"./featureServiceSource/FeatureServiceTilesSimple.js";import j from"../../../support/debugFlags.js";let O=class extends t{get _updateTilesParameters(){return{tiles:this._tilesOfInterest.tiles,tileInfo:this._tilesOfInterest.tileInfo,tileSize:this._tilesOfInterest.tileSize}}get _layerView(){return this.view?.allLayerViews.find(e=>e.layer===this._layer)}get _isSuspended(){if(m(this._layer)){if(!this.layerSource.sublayerSources.some(e=>e.enabled&&e.layer.visible))return!0}return!!this.view&&(!1!==this._layerView?.suspended||!this.layerSource.enabled)}get updating(){return this._workerHandle?.updating||this._updatingHandles.updating}get _outFields(){const{view:e,_layerView:t,layerSource:r}=this,{layer:i}=r,{fieldsIndex:s,timeInfo:o,floorInfo:a,subtypeField:n}=i,l=t&&"filter"in t?t.filter:null,d=l?.where&&"1=1"!==l.where?this._getOrLoadWhereFields(l.where,s):[];if(l?.timeExtent&&o){const{startField:e,endField:t}=o,r=s.get(e)?.name??e,i=s.get(t)?.name??t;r&&d.push(r),i&&d.push(i)}if(e?.map&&S(e.map)&&e.map.utilityNetworks?.find(e=>e.isUtilityLayer(i))){const e=i.fieldsIndex.get("assetGroup")?.name,t=i.fieldsIndex.get("assetType")?.name;e&&t&&(d.push(e),d.push(t))}if(i&&a?.floorField&&e?.floors?.length){const e=s.get(a.floorField)?.name??a.floorField;e&&d.push(e)}if(n){const e=s.get(n)?.name??n;e&&d.push(e)}return new Set(d)}get configuration(){const{view:e}=this,{apiKey:t,customParameters:r}=this._layer,i=null!=e?e.type:"2d",s=this._layer.createQuery();return this._layerView&&"effectiveDisplayFilter"in this._layerView&&(s.where=h(s.where,this._layerView.effectiveDisplayFilter?.where)),{filter:s,customParameters:t?{...r,token:t}:r,viewType:i}}get availability(){return this._workerHandle?.availability??0}get _layer(){return this.layerSource.layer}constructor(e){super(e),this._updatingHandles=new f,this._workerHandle=null,this._debug=null,this._memoizedMakeGetGroundElevation=s(v)}initialize(){let e;const t=this.view;if(null==t||t.destroyed)this._tilesOfInterest=new F({layer:this._layer}),e=this._workerHandle=new H;else switch(t.type){case"2d":this._tilesOfInterest=new g({view:t,layer:this._layer}),e=this._workerHandle=new H;break;case"3d":{const{resourceController:r}=t,i=this._layer;this._tilesOfInterest=new w({view:t}),e=this._workerHandle=new H({schedule:e=>r.immediate.schedule(e),hasZ:this._layer.hasZ&&(this._layer.returnZ??!0),elevationAlignPointsInFeatures:async(e,r)=>{const s=await t.whenLayerView(i);return o(r),s.elevationAlignPointsInFeatures(e,r)},queryForSymbologySnapping:async(e,r)=>{const s=await t.whenLayerView(i);return o(r),s.queryForSymbologySnapping(e,r)}}),this.addHandles([t.elevationProvider.on("elevation-change",({context:t})=>{const{elevationInfo:r}=i;_(t,r)&&a(e.notifyElevationSourceChange())}),n(()=>i.elevationInfo,()=>a(e.notifyElevationSourceChange()),d),n(()=>this._layerView?.layer?.renderer,()=>a(e.notifySymbologyChange()),d),n(()=>this._layerView?.symbologySnappingSupported??!1,t=>a(e.setSymbologySnappingSupported(t)),d),l(()=>this._layerView?.layer,["edits","apply-edits","graphic-update"],()=>e.notifySymbologyChange())]);break}}this.addHandles([i(e)]),a(e.setup({layer:this._layer,spatialReference:this.spatialReference,configuration:this.configuration},null)),this._updatingHandles.add(()=>this._updateTilesParameters,()=>a(e.updateTiles(this._updateTilesParameters,null)),d),this.addHandles([n(()=>this.configuration,t=>a(e.configure(t,null)),u),n(()=>this._layer.historicMoment,t=>a(e.setHistoricMoment(t)),p),n(()=>this._outFields,t=>a(e.updateOutFields(t)),d),n(()=>this._isSuspended,t=>a(e.setSuspended(t)),p)]),null!=t&&this.addHandles(n(()=>j.FEATURE_SERVICE_SNAPPING_SOURCE_TILE_TREE_SHOW_TILES,r=>{r&&!this._debug?(this._debug=new I({view:t,handle:e}),this.addHandles(i(this._debug),"debug")):!r&&this._debug&&this.removeHandles("debug")},d)),this.addHandles([this.layerSource.layer.on("edits",t=>a(e.handleEdits(t,null))),this.layerSource.layer.on("apply-edits",e=>this._updatingHandles.addPromise(e.result))])}destroy(){this._updatingHandles.destroy(),this._tilesOfInterest.destroy()}refresh(){this._workerHandle?.refresh(null)}async fetchCandidates(e,t){const{coordinateHelper:r,point:i}=e;this._tilesOfInterest.pointOfInterest=r.arrayToPoint(i);const s=this._memoizedMakeGetGroundElevation(this.view,r.spatialReference);return(await this._workerHandle.fetchCandidates({...e},t)).candidates.map(e=>b(e,s))}getDebugInfo(e){return this._workerHandle.getDebugInfo(e)}_getOrLoadWhereFields(e,t){const{_whereModule:i}=this;if(!this._loadWhereModuleTask&&!i){const e=r(async()=>{const e=await import("../../../../core/sql/WhereClause.js");return this._whereModule=e.default,this._whereModule});return this._loadWhereModuleTask=e,this._updatingHandles.addPromise(e.promise),[]}if(!i)return[];try{return i.create(e,{fieldsIndex:t}).fieldNames}catch(s){return[]}}};e([c({constructOnly:!0})],O.prototype,"spatialReference",void 0),e([c({constructOnly:!0})],O.prototype,"layerSource",void 0),e([c({constructOnly:!0})],O.prototype,"view",void 0),e([c()],O.prototype,"_tilesOfInterest",void 0),e([c({readOnly:!0})],O.prototype,"_updateTilesParameters",null),e([c()],O.prototype,"_layerView",null),e([c()],O.prototype,"_isSuspended",null),e([c({readOnly:!0})],O.prototype,"updating",null),e([c()],O.prototype,"_outFields",null),e([c({readOnly:!0})],O.prototype,"configuration",null),e([c({readOnly:!0})],O.prototype,"availability",null),e([c()],O.prototype,"_loadWhereModuleTask",void 0),e([c()],O.prototype,"_whereModule",void 0),O=e([y("esri.views.interactive.snapping.featureSources.FeatureServiceSnappingSource")],O);export{O as FeatureServiceSnappingSource};
5
+ import{__decorate as e}from"tslib";import t from"../../../../core/Accessor.js";import{createTask as r}from"../../../../core/asyncUtils.js";import{destroyHandle as i}from"../../../../core/handleUtils.js";import{memoize as s}from"../../../../core/memoize.js";import{throwIfAborted as o,ignoreAbortErrors as a}from"../../../../core/promiseUtils.js";import{watch as n,on as l,initial as d,sync as u,syncAndInitial as p}from"../../../../core/reactiveUtils.js";import{sqlAnd as h}from"../../../../core/sql.js";import{property as c}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as y}from"../../../../core/accessorSupport/decorators/subclass.js";import{UpdatingHandles as f}from"../../../../core/support/UpdatingHandles.js";import{isSubtypeGroupLayer as m}from"../../../../layers/support/layerUtils.js";import{elevationContextAffectsAlignment as _}from"../../../../support/elevationInfoUtils.js";import{FeatureServiceTiles2D as g}from"../../../2d/interactive/snapping/featureSources/featureServiceSource/FeatureServiceTiles2D.js";import{FeatureServiceTiles3D as w}from"../../../3d/interactive/snapping/featureSources/featureServiceSource/FeatureServiceTiles3D.js";import{isUtilityNetworkWebMap as S}from"../snappingUtils.js";import{makeGetGroundElevation as v,convertSnappingCandidate as b}from"./queryEngineUtils.js";import{WorkerTileTreeDebugger as I}from"./WorkerTileTreeDebugger.js";import{FeatureServiceSnappingSourceWorkerHandle as H}from"./featureServiceSource/FeatureServiceSnappingSourceWorkerHandle.js";import{FeatureServiceTilesSimple as F}from"./featureServiceSource/FeatureServiceTilesSimple.js";import j from"../../../support/debugFlags.js";let O=class extends t{get _updateTilesParameters(){return{tiles:this._tilesOfInterest.tiles,tileInfo:this._tilesOfInterest.tileInfo,tileSize:this._tilesOfInterest.tileSize}}get _layerView(){return this.view?.allLayerViews.find(e=>e.layer===this._layer)}get _isSuspended(){if(m(this._layer)){if(!this.layerSource.sublayerSources.some(e=>e.enabled&&e.layer.visible))return!0}return!!this.view&&(!1!==this._layerView?.suspended||!this.layerSource.enabled)}get updating(){return this._workerHandle?.updating||this._updatingHandles.updating}get _outFields(){const{view:e,_layerView:t,layerSource:r}=this,{layer:i}=r,{fieldsIndex:s,timeInfo:o,floorInfo:a,subtypeField:n}=i,l=t&&"filter"in t?t.filter:null,d=l?.where&&"1=1"!==l.where?this._getOrLoadWhereFields(l.where,s):[];if(l?.timeExtent&&o){const{startField:e,endField:t}=o,r=s.get(e)?.name??e,i=s.get(t)?.name??t;r&&d.push(r),i&&d.push(i)}if(e?.map&&S(e.map)&&e.map.utilityNetworks?.find(e=>e.isUtilityLayer(i))){const e=i.fieldsIndex.get("assetGroup")?.name,t=i.fieldsIndex.get("assetType")?.name;e&&t&&(d.push(e),d.push(t))}if(i&&a?.floorField&&e?.floors?.length){const e=s.get(a.floorField)?.name??a.floorField;e&&d.push(e)}if(n){const e=s.get(n)?.name??n;e&&d.push(e)}return new Set(d)}get configuration(){const{view:e}=this,{apiKey:t,customParameters:r}=this._layer,i=null!=e?e.type:"2d",s=this._layer.createQuery();return this._layerView&&"effectiveDisplayFilter"in this._layerView&&(s.where=h(s.where,this._layerView.effectiveDisplayFilter?.where)),{filter:s,customParameters:t?{...r,token:t}:r,viewType:i}}get availability(){return this._workerHandle?.availability??0}get _layer(){return this.layerSource.layer}constructor(e){super(e),this._updatingHandles=new f,this._workerHandle=null,this._debug=null,this._memoizedMakeGetGroundElevation=s(v)}initialize(){let e;const t=this.view;if(null==t||t.destroyed)this._tilesOfInterest=new F({layer:this._layer}),e=this._workerHandle=new H;else switch(t.type){case"2d":this._tilesOfInterest=new g({view:t,layer:this._layer}),e=this._workerHandle=new H;break;case"3d":{const{resourceController:r}=t,i=this._layer;this._tilesOfInterest=new w({view:t}),e=this._workerHandle=new H({schedule:e=>r.immediate.schedule(e),hasZ:i.hasZ&&(i.returnZ??!0),elevationAlignPointsInFeatures:async(e,r)=>{const s=await t.whenLayerView(i);return o(r),s.elevationAlignPointsInFeatures(e,r)},queryForSymbologySnapping:async(e,r)=>{const s=await t.whenLayerView(i);return o(r),s.queryForSymbologySnapping(e,r)}}),this.addHandles([t.elevationProvider.on("elevation-change",({context:t})=>{const{elevationInfo:r}=i;_(t,r)&&a(e.notifyElevationSourceChange())}),n(()=>i.elevationInfo,()=>a(e.notifyElevationSourceChange()),d),n(()=>this._layerView?.layer?.renderer,()=>a(e.notifySymbologyChange()),d),n(()=>this._layerView?.symbologySnappingSupported??!1,t=>a(e.setSymbologySnappingSupported(t)),d),l(()=>this._layerView?.layer,["edits","apply-edits","graphic-update"],()=>e.notifySymbologyChange())]);break}}this.addHandles([i(e)]),a(e.setup({layer:this._layer,spatialReference:this.spatialReference,configuration:this.configuration},null)),this._updatingHandles.add(()=>this._updateTilesParameters,()=>a(e.updateTiles(this._updateTilesParameters,null)),d),this.addHandles([n(()=>this.configuration,t=>a(e.configure(t,null)),u),n(()=>this._layer.historicMoment,t=>a(e.setHistoricMoment(t)),p),n(()=>this._outFields,t=>a(e.updateOutFields(t)),d),n(()=>this._isSuspended,t=>a(e.setSuspended(t)),p)]),null!=t&&this.addHandles(n(()=>j.FEATURE_SERVICE_SNAPPING_SOURCE_TILE_TREE_SHOW_TILES,r=>{r&&!this._debug?(this._debug=new I({view:t,handle:e}),this.addHandles(i(this._debug),"debug")):!r&&this._debug&&this.removeHandles("debug")},d)),this.addHandles([this.layerSource.layer.on("edits",t=>a(e.handleEdits(t,null))),this.layerSource.layer.on("apply-edits",e=>this._updatingHandles.addPromise(e.result))])}destroy(){this._updatingHandles.destroy(),this._tilesOfInterest.destroy()}refresh(){this._workerHandle?.refresh(null)}async fetchCandidates(e,t){const{coordinateHelper:r,point:i}=e;this._tilesOfInterest.pointOfInterest=r.arrayToPoint(i);const s=this._memoizedMakeGetGroundElevation(this.view,r.spatialReference);return(await this._workerHandle.fetchCandidates({...e},t)).candidates.map(e=>b(e,s))}getDebugInfo(e){return this._workerHandle.getDebugInfo(e)}_getOrLoadWhereFields(e,t){const{_whereModule:i}=this;if(!this._loadWhereModuleTask&&!i){const e=r(async()=>{const e=await import("../../../../core/sql/WhereClause.js");return this._whereModule=e.default,this._whereModule});return this._loadWhereModuleTask=e,this._updatingHandles.addPromise(e.promise),[]}if(!i)return[];try{return i.create(e,{fieldsIndex:t}).fieldNames}catch(s){return[]}}};e([c({constructOnly:!0})],O.prototype,"spatialReference",void 0),e([c({constructOnly:!0})],O.prototype,"layerSource",void 0),e([c({constructOnly:!0})],O.prototype,"view",void 0),e([c()],O.prototype,"_tilesOfInterest",void 0),e([c({readOnly:!0})],O.prototype,"_updateTilesParameters",null),e([c()],O.prototype,"_layerView",null),e([c()],O.prototype,"_isSuspended",null),e([c({readOnly:!0})],O.prototype,"updating",null),e([c()],O.prototype,"_outFields",null),e([c({readOnly:!0})],O.prototype,"configuration",null),e([c({readOnly:!0})],O.prototype,"availability",null),e([c()],O.prototype,"_loadWhereModuleTask",void 0),e([c()],O.prototype,"_whereModule",void 0),O=e([y("esri.views.interactive.snapping.featureSources.FeatureServiceSnappingSource")],O);export{O as FeatureServiceSnappingSource};
@@ -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{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 s from"../../../../geometry/Polygon.js";import{toExtent as a}from"../../../../geometry/support/aaBoundingRect.js";import{TileTreeDebugger as i}from"../../../support/TileTreeDebugger.js";let n=class extends i{constructor(e){super(e)}initialize(){const e=setInterval(()=>this._fetchDebugInfo(),2e3);this.addHandles(t(()=>clearInterval(e)))}getTiles(){if(!this._debugInfo)return[];const e=new Map,t=new Map;this._debugInfo.storedTiles.forEach(t=>{e.set(t.data.id,t.featureCount)}),this._debugInfo.pendingTiles.forEach(r=>{e.set(r.data.id,r.featureCount),t.set(r.data.id,r.state)});const r=r=>{const o=t.get(r),s=e.get(r)??"?";return o?`${o}:${s}\n${r}`:`store:${s}\n${r}`},o=new Map;return this._debugInfo.storedTiles.forEach(e=>{o.set(e.data.id,e.data)}),this._debugInfo.pendingTiles.forEach(e=>{o.set(e.data.id,e.data)}),Array.from(o.values()).map(e=>({lij:[e.level,e.row,e.col],level:e.level,geometry:s.fromExtent(a(e.extent,this.view.spatialReference)),label:r(e.id)}))}_fetchDebugInfo(){this.handle.getDebugInfo(null).then(e=>{this._debugInfo=e,this.update()})}};e([r({constructOnly:!0})],n.prototype,"handle",void 0),n=e([o("esri.views.interactive.snapping.featureSources.WorkerTileTreeDebugger")],n);export{n as WorkerTileTreeDebugger};
5
+ import{__decorate as e}from"tslib";import{makeHandle as t}from"../../../../core/handleUtils.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 s from"../../../../geometry/Polygon.js";import{toExtent as i}from"../../../../geometry/support/aaBoundingRect.js";import{TileKey as n}from"../../../../layers/support/TileKey.js";import{TileTreeDebugger as a}from"../../../support/TileTreeDebugger.js";let l=class extends a{constructor(e){super(e)}initialize(){const e=setInterval(()=>this._fetchDebugInfo(),2e3);this.addHandles(t(()=>clearInterval(e)))}getTiles(){if(!this._debugInfo)return[];const e=new Map,t=new Map;this._debugInfo.storedTiles.forEach(t=>e.set(n.fromJSON(t.key).id,t.featureCount)),this._debugInfo.pendingTiles.forEach(r=>{e.set(r.key.id,r.featureCount),t.set(r.key.id,r.state)});const r=r=>{const o=t.get(r),s=e.get(r)??"?";return o?`${o}:${s}\n${r}`:`store:${s}\n${r}`},o=new Map;return this._debugInfo.storedTiles.forEach(e=>{const t=n.fromJSON(e.key);o.set(t.id,t)}),this._debugInfo.pendingTiles.forEach(e=>{o.set(e.key.id,e.key)}),Array.from(o.values()).map(e=>({lij:[e.level,e.row,e.col],level:e.level,geometry:s.fromExtent(i(e.extent,this.view.spatialReference)),label:r(e.id)}))}_fetchDebugInfo(){this.handle.getDebugInfo(null).then(e=>{this._debugInfo=e,this.update()})}};e([r({constructOnly:!0})],l.prototype,"handle",void 0),l=e([o("esri.views.interactive.snapping.featureSources.WorkerTileTreeDebugger")],l);export{l as WorkerTileTreeDebugger};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import{EventedAccessor as t}from"../../../../../core/Evented.js";import{createResolver as i,throwIfAborted as r}from"../../../../../core/promiseUtils.js";import{watch as s,sync as a,whenOnce as n}from"../../../../../core/reactiveUtils.js";import{property as o}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/has.js";import"../../../../../core/Logger.js";import"../../../../../core/RandomLCG.js";import{subclass as l}from"../../../../../core/accessorSupport/decorators/subclass.js";import{UpdatingHandles as u}from"../../../../../core/support/UpdatingHandles.js";import d from"../../../../../geometry/SpatialReference.js";import{fromJSON as h}from"../../../../../geometry/support/jsonUtils.js";import c from"../../../../../layers/graphics/data/FeatureStore.js";import{QueryEngine as p}from"../../../../../layers/graphics/data/QueryEngine.js";import f from"../../../../../layers/support/TileInfo.js";import m from"../../../../../rest/support/Query.js";import g from"../../../../../symbols/support/ElevationInfo.js";import{getSnappingCandidateElevationAligner as y}from"../snappingCandidateElevationAlignment.js";import{getSnappingCandidateElevationFilter as _}from"../snappingCandidateElevationFilter.js";import{getSymbologySnappingCandidatesFetcher as S}from"../symbologySnappingCandidates.js";import{FeatureServiceTiledFetcher as F}from"./FeatureServiceTiledFetcher.js";import{FeatureServiceTileStore as v}from"./FeatureServiceTileStore.js";let I=class extends t{constructor(){super(...arguments),this._isInitializing=!0,this.remoteClient=null,this._whenSetup=i(),this._elevationAligner=y(),this._elevationFilter=_(),this._symbologyCandidatesFetcher=S(),this._updatingHandles=new u,this._alignPointsInFeatures=async(e,t)=>{const i={query:e},s=await this.remoteClient.invoke("alignElevation",i,{signal:t});return r(t),s},this._getSymbologyCandidates=async(e,t)=>{const i={candidates:e,spatialReference:this._spatialReference.toJSON()},s=await this.remoteClient.invoke("getSymbologyCandidates",i,{signal:t});return r(t),s}}get updating(){return this._isInitializing||this._updatingHandles.updating||this._featureFetcher.updating}destroy(){this._featureFetcher?.destroy(),this._queryEngine?.destroy(),this._featureStore?.clear()}async setup(e){if(this.destroyed)return{result:{}};const{geometryType:t,objectIdField:i,timeInfo:r,fieldsIndex:n}=e.serviceInfo,{hasZ:o}=e,l=d.fromJSON(e.spatialReference);this._spatialReference=l,this._featureStore=new c({...e.serviceInfo,hasZ:o,hasM:!1}),this._featureStore.estimateFeatureUsedMemory=e=>e.usedMemory,this._queryEngine=new p({spatialReference:e.spatialReference,featureStore:this._featureStore,geometryType:t,fieldsIndex:n,hasZ:o,hasM:!1,featureIdInfo:{type:"object-id",fieldName:i},timeInfo:r}),this._featureFetcher=new F({store:new v({featureStore:this._featureStore}),url:e.serviceInfo.url,objectIdField:e.serviceInfo.objectIdField,globalIdField:e.serviceInfo.globalIdField,capabilities:e.serviceInfo.capabilities,spatialReference:l,sourceSpatialReference:d.fromJSON(e.serviceInfo.spatialReference),customParameters:e.configuration.customParameters});const u="3d"===e.configuration.viewType;return this._elevationAligner=y(u,{elevationInfo:null!=e.elevationInfo?g.fromJSON(e.elevationInfo):null,alignPointsInFeatures:this._alignPointsInFeatures}),this._elevationFilter=_(u),this.addHandles([s(()=>this._featureFetcher.availability,e=>this.emit("notify-availability",{availability:e}),a),s(()=>this.updating,()=>this._notifyUpdating())]),this._whenSetup.resolve(),this._isInitializing=!1,this.configure(e.configuration)}async configure(e){return await this._updatingHandles.addPromise(this._whenSetup.promise),this._updateFeatureFetcherConfiguration(e),j}async setSuspended(e,t){return await this._updatingHandles.addPromise(this._whenSetup.promise),r(t),this._featureFetcher.suspended=e,j}async updateOutFields(e,t){return await this._updatingHandles.addPromise(this._whenSetup.promise),r(t),this._featureFetcher.outFields=new Set(e??[]),j}async fetchCandidates(e,t){await this._whenSetup.promise,r(t);const i=b(e,this._featureStore.hasZ),s=t?.signal,a=await this._queryEngine.executeQueryForSnapping(i,s);r(s);const n=await this._elevationAligner.alignCandidates(a.candidates,d.fromJSON(e.point.spatialReference)??d.WGS84,s);r(s);const o=await this._symbologyCandidatesFetcher.fetch(n,s);r(s);const l=0===o.length?n:n.concat(o);return{result:{candidates:this._elevationFilter.filter(i,l)}}}async updateTiles(e,t){return await this._updatingHandles.addPromise(this._whenSetup.promise),r(t),this._featureFetcher.tileSize=e.tileSize,this._featureFetcher.tilesOfInterest=e.tiles,this._featureFetcher.tileInfo=null!=e.tileInfo?f.fromJSON(e.tileInfo):null,j}async refresh(e,t){return await this._updatingHandles.addPromise(this._whenSetup.promise),r(t),this._featureFetcher.refresh(),j}async whenNotUpdating(e,t){return await this._updatingHandles.addPromise(this._whenSetup.promise),r(t),await n(()=>!this.updating,t),r(t),j}async getDebugInfo(e,t){return r(t),{result:this._featureFetcher.debugInfo}}async handleEdits(e,t){return await this._updatingHandles.addPromise(this._whenSetup.promise),r(t),await this._updatingHandles.addPromise(this._featureFetcher.handleEdits(e)),r(t),j}async setHistoricMoment(e,t){return this._featureFetcher.setHistoricMoment(e.moment),j}async notifyElevationSourceChange(e,t){return this._elevationAligner.notifyElevationSourceChange(),j}async notifySymbologyChange(e,t){return this._symbologyCandidatesFetcher.notifySymbologyChange(),j}async setSymbologySnappingSupported(e){return this._symbologyCandidatesFetcher=S(e,this._getSymbologyCandidates),j}_updateFeatureFetcherConfiguration(e){this._featureFetcher.filter=null!=e.filter?m.fromJSON(e.filter):null,this._featureFetcher.customParameters=e.customParameters}_notifyUpdating(){this.emit("notify-updating",{updating:this.updating})}};e([o({readOnly:!0})],I.prototype,"updating",null),e([o()],I.prototype,"_isInitializing",void 0),I=e([l("esri.views.interactive.snapping.featureSources.featureServiceSource.FeatureServiceSnappingSourceWorker")],I);const w=I;function b(e,t){const i=!!t||void 0;if(!e.filter)return{...e,query:{where:"1=1",returnZ:i}};const{distance:r,units:s,spatialRel:a,where:n,timeExtent:o,objectIds:l}=e.filter,u={geometry:e.filter.geometry?h(e.filter.geometry):void 0,distance:r,units:s,spatialRel:a,timeExtent:o,objectIds:l,returnZ:i,where:n??"1=1"};return{...e,query:u}}const j={result:{}};export{w as default};
5
+ import{__decorate as e}from"tslib";import{EventedAccessor as t}from"../../../../../core/Evented.js";import{createResolver as i,throwIfAborted as r}from"../../../../../core/promiseUtils.js";import{watch as s,sync as a,whenOnce as n}from"../../../../../core/reactiveUtils.js";import{property as o}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/has.js";import"../../../../../core/Logger.js";import"../../../../../core/RandomLCG.js";import{subclass as l}from"../../../../../core/accessorSupport/decorators/subclass.js";import{UpdatingHandles as u}from"../../../../../core/support/UpdatingHandles.js";import d from"../../../../../geometry/SpatialReference.js";import{fromJSON as p}from"../../../../../geometry/support/jsonUtils.js";import h from"../../../../../layers/graphics/data/FeatureStore.js";import{QueryEngine as c}from"../../../../../layers/graphics/data/QueryEngine.js";import f from"../../../../../layers/support/TileInfo.js";import{TileKey as m}from"../../../../../layers/support/TileKey.js";import g from"../../../../../rest/support/Query.js";import y from"../../../../../symbols/support/ElevationInfo.js";import{getSnappingCandidateElevationAligner as _}from"../snappingCandidateElevationAlignment.js";import{getSnappingCandidateElevationFilter as S}from"../snappingCandidateElevationFilter.js";import{getSymbologySnappingCandidatesFetcher as F}from"../symbologySnappingCandidates.js";import{FeatureServiceTiledFetcher as v}from"./FeatureServiceTiledFetcher.js";import{FeatureServiceTileStore as I}from"./FeatureServiceTileStore.js";let w=class extends t{constructor(){super(...arguments),this._isInitializing=!0,this.remoteClient=null,this._whenSetup=i(),this._elevationAligner=_(),this._elevationFilter=S(),this._symbologyCandidatesFetcher=F(),this._updatingHandles=new u,this._alignPointsInFeatures=async(e,t)=>{const i={query:e},s=await this.remoteClient.invoke("alignElevation",i,{signal:t});return r(t),s},this._getSymbologyCandidates=async(e,t)=>{const i={candidates:e,spatialReference:this._spatialReference.toJSON()},s=await this.remoteClient.invoke("getSymbologyCandidates",i,{signal:t});return r(t),s}}get updating(){return this._isInitializing||this._updatingHandles.updating||this._featureFetcher.updating}destroy(){this._featureFetcher?.destroy(),this._queryEngine?.destroy(),this._featureStore?.clear()}async setup(e){if(this.destroyed)return{result:{}};const{geometryType:t,objectIdField:i,timeInfo:r,fieldsIndex:n}=e.serviceInfo,{hasZ:o}=e,l=d.fromJSON(e.spatialReference);this._spatialReference=l,this._featureStore=new h({...e.serviceInfo,hasZ:o,hasM:!1}),this._featureStore.estimateFeatureUsedMemory=e=>e.usedMemory,this._queryEngine=new c({spatialReference:e.spatialReference,featureStore:this._featureStore,geometryType:t,fieldsIndex:n,hasZ:o,hasM:!1,featureIdInfo:{type:"object-id",fieldName:i},timeInfo:r}),this._featureFetcher=new v({store:new I({featureStore:this._featureStore}),url:e.serviceInfo.url,objectIdField:e.serviceInfo.objectIdField,globalIdField:e.serviceInfo.globalIdField,capabilities:e.serviceInfo.capabilities,spatialReference:l,sourceSpatialReference:d.fromJSON(e.serviceInfo.spatialReference),customParameters:e.configuration.customParameters});const u="3d"===e.configuration.viewType;return this._elevationAligner=_(u,{elevationInfo:null!=e.elevationInfo?y.fromJSON(e.elevationInfo):null,alignPointsInFeatures:this._alignPointsInFeatures}),this._elevationFilter=S(u),this.addHandles([s(()=>this._featureFetcher.availability,e=>this.emit("notify-availability",{availability:e}),a),s(()=>this.updating,()=>this._notifyUpdating())]),this._whenSetup.resolve(),this._isInitializing=!1,this.configure(e.configuration)}async configure(e){return await this._updatingHandles.addPromise(this._whenSetup.promise),this._updateFeatureFetcherConfiguration(e),C}async setSuspended(e,t){return await this._updatingHandles.addPromise(this._whenSetup.promise),r(t),this._featureFetcher.suspended=e,C}async updateOutFields(e,t){return await this._updatingHandles.addPromise(this._whenSetup.promise),r(t),this._featureFetcher.outFields=new Set(e??[]),C}async fetchCandidates(e,t){await this._whenSetup.promise,r(t);const i=j(e,this._featureStore.hasZ),s=t?.signal,a=await this._queryEngine.executeQueryForSnapping(i,s);r(s);const n=await this._elevationAligner.alignCandidates(a.candidates,d.fromJSON(e.point.spatialReference)??d.WGS84,s);r(s);const o=await this._symbologyCandidatesFetcher.fetch(n,s);r(s);const l=0===o.length?n:n.concat(o);return{result:{candidates:this._elevationFilter.filter(i,l)}}}async updateTiles(e,t){return await this._updatingHandles.addPromise(this._whenSetup.promise),r(t),this._featureFetcher.tileSize=e.tileSize,this._featureFetcher.tilesOfInterest=e.tiles.map(e=>m.fromJSON(e)),this._featureFetcher.tileInfo=null!=e.tileInfo?f.fromJSON(e.tileInfo):null,C}async refresh(e,t){return await this._updatingHandles.addPromise(this._whenSetup.promise),r(t),this._featureFetcher.refresh(),C}async whenNotUpdating(e,t){return await this._updatingHandles.addPromise(this._whenSetup.promise),r(t),await n(()=>!this.updating,t),r(t),C}async getDebugInfo(e,t){return r(t),{result:this._featureFetcher.debugInfo}}async handleEdits(e,t){return await this._updatingHandles.addPromise(this._whenSetup.promise),r(t),await this._updatingHandles.addPromise(this._featureFetcher.handleEdits(e)),r(t),C}async setHistoricMoment(e,t){return this._featureFetcher.setHistoricMoment(e.moment),C}async notifyElevationSourceChange(e,t){return this._elevationAligner.notifyElevationSourceChange(),C}async notifySymbologyChange(e,t){return this._symbologyCandidatesFetcher.notifySymbologyChange(),C}async setSymbologySnappingSupported(e){return this._symbologyCandidatesFetcher=F(e,this._getSymbologyCandidates),C}_updateFeatureFetcherConfiguration(e){this._featureFetcher.filter=null!=e.filter?g.fromJSON(e.filter):null,this._featureFetcher.customParameters=e.customParameters}_notifyUpdating(){this.emit("notify-updating",{updating:this.updating})}};e([o({readOnly:!0})],w.prototype,"updating",null),e([o()],w.prototype,"_isInitializing",void 0),w=e([l("esri.views.interactive.snapping.featureSources.featureServiceSource.FeatureServiceSnappingSourceWorker")],w);const b=w;function j(e,t){const i=!!t||void 0;if(!e.filter)return{...e,query:{where:"1=1",returnZ:i}};const{distance:r,units:s,spatialRel:a,where:n,timeExtent:o,objectIds:l}=e.filter,u={geometry:e.filter.geometry?p(e.filter.geometry):void 0,distance:r,units:s,spatialRel:a,timeExtent:o,objectIds:l,returnZ:i,where:n??"1=1"};return{...e,query:u}}const C={result:{}};export{b as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import t from"../../../../../core/Accessor.js";import{isSome as o}from"../../../../../core/arrayUtils.js";import{abortMaybe as i}from"../../../../../core/maybe.js";import{debounce as n}from"../../../../../core/promiseUtils.js";import{property as a}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/has.js";import"../../../../../core/Logger.js";import{subclass as r}from"../../../../../core/accessorSupport/decorators/subclass.js";import{UpdatingHandles as s}from"../../../../../core/support/UpdatingHandles.js";import{WorkerHandle as d}from"../../../../../core/workers/WorkerHandle.js";import{featureGeometryTypeKebabDictionary as l}from"../../../../../geometry/support/typeUtils.js";import{makeDehydratedPoint as p}from"../../../../../layers/graphics/dehydratedPoint.js";let u=class extends t{get updating(){return this._updatingHandles.updating||this._workerHandleUpdating}constructor(e){super(e),this._updatingHandles=new s,this._suspendController=null,this.schedule=null,this.hasZ=!1,this.elevationAlignPointsInFeatures=async e=>{const t=[];for(const{points:o}of e.pointsInFeatures)for(const{z:e}of o)t.push(e);return{elevations:t,drapedObjectIds:new Set,failedObjectIds:new Set}},this.queryForSymbologySnapping=async()=>({candidates:[],sourceCandidateIndices:[]}),this.availability=0,this._workerHandleUpdating=!0,this.updateOutFields=n(async(e,t)=>{await this._updatingHandles.addPromise(this._workerHandle.invokeMethod("updateOutFields",[...e],t)),this._updatingHandles.addPromise(this._workerHandle.invokeMethod("whenNotUpdating",{},t))})}destroy(){this._suspendController=i(this._suspendController),this._workerHandle.destroy(),this._updatingHandles.destroy()}initialize(){this._workerHandle=new y(this.schedule,{alignElevation:async(e,{signal:t})=>({result:await this.elevationAlignPointsInFeatures(e.query,t)}),getSymbologyCandidates:async(e,{signal:t})=>({result:await this.queryForSymbologySnapping(e,t)})}),this.addHandles([this._workerHandle.on("notify-updating",({updating:e})=>this._workerHandleUpdating=e),this._workerHandle.on("notify-availability",({availability:e})=>this._set("availability",e))])}async setup(e,t){const o=c(e.layer);if(null==o)return;const i={configuration:h(e.configuration),serviceInfo:o,spatialReference:e.spatialReference.toJSON(),hasZ:this.hasZ,elevationInfo:e.layer.elevationInfo?.toJSON()};await this._updatingHandles.addPromise(this._workerHandle.invokeMethod("setup",i,t)),this._updatingHandles.addPromise(this._workerHandle.invokeMethod("whenNotUpdating",{},t))}async configure(e,t){const o=h(e);await this._updatingHandles.addPromise(this._workerHandle.invokeMethod("configure",o,t)),this._updatingHandles.addPromise(this._workerHandle.invokeMethod("whenNotUpdating",{},t))}async refresh(e){await this._updatingHandles.addPromise(this._workerHandle.invokeMethod("refresh",{},e)),this._updatingHandles.addPromise(this._workerHandle.invokeMethod("whenNotUpdating",{},e))}async fetchCandidates(e,t){const{point:o,filter:i,coordinateHelper:n}=e,a={...e,point:p(o[0],o[1],o[2],n.spatialReference.toJSON()),filter:i?.toJSON()};return this._workerHandle.invoke(a,t)}async updateTiles(e,t){const o={tiles:e.tiles,tileInfo:null!=e.tileInfo?e.tileInfo.toJSON():null,tileSize:e.tileSize};await this._updatingHandles.addPromise(this._workerHandle.invokeMethod("updateTiles",o,t)),this._updatingHandles.addPromise(this._workerHandle.invokeMethod("whenNotUpdating",{},t))}async handleEdits({historicMoment:e,addedFeatures:t,deletedFeatures:i,updatedFeatures:n},a){const r={historicMoment:e,addedFeatures:t?.map(({objectId:e})=>e).filter(o)??[],deletedFeatures:i?.map(({objectId:e,globalId:t})=>({objectId:e,globalId:t}))??[],updatedFeatures:n?.map(({objectId:e})=>e).filter(o)??[]};await this._updatingHandles.addPromise(this._workerHandle.invokeMethod("handleEdits",r,a)),this._updatingHandles.addPromise(this._workerHandle.invokeMethod("whenNotUpdating",{},a))}async setHistoricMoment(e,t){await this._updatingHandles.addPromise(this._workerHandle.invokeMethod("setHistoricMoment",{moment:e},t))}getDebugInfo(e){return this._workerHandle.invokeMethod("getDebugInfo",{},e)}async notifyElevationSourceChange(){await this._workerHandle.invokeMethod("notifyElevationSourceChange",{})}async notifySymbologyChange(){await this._workerHandle.invokeMethod("notifySymbologyChange",{})}async setSymbologySnappingSupported(e){await this._workerHandle.invokeMethod("setSymbologySnappingSupported",e)}async setSuspended(e){this._suspendController?.abort(),this._suspendController=new AbortController,await this._workerHandle.invokeMethod("setSuspended",e,this._suspendController.signal)}};function h(e){return{filter:null!=e.filter?e.filter.toJSON():null,customParameters:e.customParameters,viewType:e.viewType}}function c(e){return"multipatch"===e.geometryType||"mesh"===e.geometryType?null:{url:e.parsedUrl?.path??"",fieldsIndex:e.fieldsIndex.toJSON(),geometryType:l.toJSON(e.geometryType),capabilities:e.capabilities,objectIdField:e.objectIdField,globalIdField:e.globalIdField,spatialReference:e.spatialReference.toJSON(),timeInfo:e.timeInfo?.toJSON()}}e([a({constructOnly:!0})],u.prototype,"schedule",void 0),e([a({constructOnly:!0})],u.prototype,"hasZ",void 0),e([a({constructOnly:!0})],u.prototype,"elevationAlignPointsInFeatures",void 0),e([a({constructOnly:!0})],u.prototype,"queryForSymbologySnapping",void 0),e([a({readOnly:!0})],u.prototype,"updating",null),e([a({readOnly:!0})],u.prototype,"availability",void 0),e([a()],u.prototype,"_workerHandleUpdating",void 0),u=e([r("esri.views.interactive.snapping.featureSources.featureServiceSource.FeatureServiceSnappingSourceWorkerHandle")],u);class y extends d{constructor(e,t){super("FeatureServiceSnappingSourceWorker","fetchCandidates",{},e,{strategy:"dedicated",client:t})}}export{u as FeatureServiceSnappingSourceWorkerHandle};
5
+ import{__decorate as e}from"tslib";import t from"../../../../../core/Accessor.js";import{isSome as o}from"../../../../../core/arrayUtils.js";import{abortMaybe as i}from"../../../../../core/maybe.js";import{debounce as n}from"../../../../../core/promiseUtils.js";import{property as a}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/has.js";import"../../../../../core/Logger.js";import{subclass as r}from"../../../../../core/accessorSupport/decorators/subclass.js";import{UpdatingHandles as s}from"../../../../../core/support/UpdatingHandles.js";import{WorkerHandle as d}from"../../../../../core/workers/WorkerHandle.js";import{featureGeometryTypeKebabDictionary as l}from"../../../../../geometry/support/typeUtils.js";import{makeDehydratedPoint as p}from"../../../../../layers/graphics/dehydratedPoint.js";let u=class extends t{get updating(){return this._updatingHandles.updating||this._workerHandleUpdating}constructor(e){super(e),this._updatingHandles=new s,this._suspendController=null,this.schedule=null,this.hasZ=!1,this.elevationAlignPointsInFeatures=async e=>{const t=[];for(const{points:o}of e.pointsInFeatures)for(const{z:e}of o)t.push(e);return{elevations:t,drapedObjectIds:new Set,failedObjectIds:new Set}},this.queryForSymbologySnapping=async()=>({candidates:[],sourceCandidateIndices:[]}),this.availability=0,this._workerHandleUpdating=!0,this.updateOutFields=n(async(e,t)=>{await this._updatingHandles.addPromise(this._workerHandle.invokeMethod("updateOutFields",[...e],t)),this._updatingHandles.addPromise(this._workerHandle.invokeMethod("whenNotUpdating",{},t))})}destroy(){this._suspendController=i(this._suspendController),this._workerHandle.destroy(),this._updatingHandles.destroy()}initialize(){this._workerHandle=new y(this.schedule,{alignElevation:async(e,{signal:t})=>({result:await this.elevationAlignPointsInFeatures(e.query,t)}),getSymbologyCandidates:async(e,{signal:t})=>({result:await this.queryForSymbologySnapping(e,t)})}),this.addHandles([this._workerHandle.on("notify-updating",({updating:e})=>this._workerHandleUpdating=e),this._workerHandle.on("notify-availability",({availability:e})=>this._set("availability",e))])}async setup(e,t){const o=c(e.layer);if(null==o)return;const i={configuration:h(e.configuration),serviceInfo:o,spatialReference:e.spatialReference.toJSON(),hasZ:this.hasZ,elevationInfo:e.layer.elevationInfo?.toJSON()};await this._updatingHandles.addPromise(this._workerHandle.invokeMethod("setup",i,t)),this._updatingHandles.addPromise(this._workerHandle.invokeMethod("whenNotUpdating",{},t))}async configure(e,t){const o=h(e);await this._updatingHandles.addPromise(this._workerHandle.invokeMethod("configure",o,t)),this._updatingHandles.addPromise(this._workerHandle.invokeMethod("whenNotUpdating",{},t))}async refresh(e){await this._updatingHandles.addPromise(this._workerHandle.invokeMethod("refresh",{},e)),this._updatingHandles.addPromise(this._workerHandle.invokeMethod("whenNotUpdating",{},e))}async fetchCandidates(e,t){const{point:o,filter:i,coordinateHelper:n}=e,a={...e,point:p(o[0],o[1],o[2],n.spatialReference.toJSON()),filter:i?.toJSON()};return this._workerHandle.invoke(a,t)}async updateTiles(e,t){const o={tiles:e.tiles.map(e=>e.toJSON()),tileInfo:null!=e.tileInfo?e.tileInfo.toJSON():null,tileSize:e.tileSize};await this._updatingHandles.addPromise(this._workerHandle.invokeMethod("updateTiles",o,t)),this._updatingHandles.addPromise(this._workerHandle.invokeMethod("whenNotUpdating",{},t))}async handleEdits({historicMoment:e,addedFeatures:t,deletedFeatures:i,updatedFeatures:n},a){const r={historicMoment:e,addedFeatures:t?.map(({objectId:e})=>e).filter(o)??[],deletedFeatures:i?.map(({objectId:e,globalId:t})=>({objectId:e,globalId:t}))??[],updatedFeatures:n?.map(({objectId:e})=>e).filter(o)??[]};await this._updatingHandles.addPromise(this._workerHandle.invokeMethod("handleEdits",r,a)),this._updatingHandles.addPromise(this._workerHandle.invokeMethod("whenNotUpdating",{},a))}async setHistoricMoment(e,t){await this._updatingHandles.addPromise(this._workerHandle.invokeMethod("setHistoricMoment",{moment:e},t))}getDebugInfo(e){return this._workerHandle.invokeMethod("getDebugInfo",{},e)}async notifyElevationSourceChange(){await this._workerHandle.invokeMethod("notifyElevationSourceChange",{})}async notifySymbologyChange(){await this._workerHandle.invokeMethod("notifySymbologyChange",{})}async setSymbologySnappingSupported(e){await this._workerHandle.invokeMethod("setSymbologySnappingSupported",e)}async setSuspended(e){this._suspendController?.abort(),this._suspendController=new AbortController,await this._workerHandle.invokeMethod("setSuspended",e,this._suspendController.signal)}};function h(e){return{filter:null!=e.filter?e.filter.toJSON():null,customParameters:e.customParameters,viewType:e.viewType}}function c(e){return"multipatch"===e.geometryType||"mesh"===e.geometryType?null:{url:e.parsedUrl?.path??"",fieldsIndex:e.fieldsIndex.toJSON(),geometryType:l.toJSON(e.geometryType),capabilities:e.capabilities,objectIdField:e.objectIdField,globalIdField:e.globalIdField,spatialReference:e.spatialReference.toJSON(),timeInfo:e.timeInfo?.toJSON()}}e([a({constructOnly:!0})],u.prototype,"schedule",void 0),e([a({constructOnly:!0})],u.prototype,"hasZ",void 0),e([a({constructOnly:!0})],u.prototype,"elevationAlignPointsInFeatures",void 0),e([a({constructOnly:!0})],u.prototype,"queryForSymbologySnapping",void 0),e([a({readOnly:!0})],u.prototype,"updating",null),e([a({readOnly:!0})],u.prototype,"availability",void 0),e([a()],u.prototype,"_workerHandleUpdating",void 0),u=e([r("esri.views.interactive.snapping.featureSources.featureServiceSource.FeatureServiceSnappingSourceWorkerHandle")],u);class y extends d{constructor(e,t){super("FeatureServiceSnappingSourceWorker","fetchCandidates",{},e,{strategy:"dedicated",client:t})}}export{u as FeatureServiceSnappingSourceWorkerHandle};
@@ -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"../../../../../core/has.js";import{intersection as s,isSubsetOf as i}from"../../../../../core/SetUtils.js";import{property as r}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/Logger.js";import"../../../../../core/RandomLCG.js";import{subclass as o}from"../../../../../core/accessorSupport/decorators/subclass.js";import{create as n,intersects as l,fromExtent as u,area as c}from"../../../../../geometry/support/aaBoundingRect.js";import{getBoundsOptimizedGeometry as a}from"../../../../../layers/graphics/featureConversionUtils.js";import{BoundsStore as h}from"../../../../../layers/graphics/data/BoundsStore.js";import{TileKey as d}from"../../../../../layers/support/TileKey.js";import{executeQueryForCount as f}from"../../../../../rest/query/operations/query.js";import{FeatureServiceTileCache as _}from"./FeatureServiceTileCache.js";let m=class extends t{setPriorityOrderByKey(e){this._tiles.setPriorityOrderByKey(e)}get _memoryLimitExceeded(){return this.featureStore.usedMemory>=this.maximumByteSize}constructor(e){super(e),this.tileInfo=null,this.extent=null,this.maximumByteSize=10485760,this._tileBounds=new h,this._tiles=new _,this._refCounts=new Map,this._tileFeatureCounts=new Map,this._tmpBoundingRect=n()}add(e,t){for(const s of t)this._referenceFeature(s.objectId);const i=this.featureStore.upsertMany(t),r=i.map(e=>new Set(Object.keys(e.attributes))).reduce((e,t)=>s(e,t),new Set(Object.keys(i[0]?.attributes??[]))),o=this._memoryLimitExceeded;this._addTileStorage(e,new Set(i.map(e=>e.objectId)),r),o&&this._applyCacheMemoryLimits()}_applyCacheMemoryLimits(){if(!this._memoryLimitExceeded)return;const{_tiles:e,featureStore:t,maximumByteSize:s}=this;e.someFromLowestToHighestPriority(e=>!this._memoryLimitExceeded||t.usedMemory-this._estimateRemoveTileMemoryReduction(e)<s||(this._removeTileStorage(e),!1))}_estimateRemoveTileMemoryReduction(e){let t=0;for(const s of e.objectIds){if(1===this._refCounts.get(s)){const e=this.featureStore.getFeature(s);e&&(t+=this.featureStore.estimateFeatureUsedMemory?.(e)??0)}}return t}getAttributesForTile(e){return e?this._tiles.get(e)?.attributeKeys:null}destroy(){this.clear(),this._tileFeatureCounts.clear()}clear(){this.featureStore.clear(),this._tileBounds.clear(),this._tiles.clear(),this._refCounts.clear()}refresh(){this.clear(),this._tileFeatureCounts.clear()}processEdits(e,t,s){return this._processEditsDelete(e.deletedFeatures.concat(e.updatedFeatures)),this._processEditsRefetch(e.addedFeatures.concat(e.updatedFeatures),t,s)}_addTileStorage(e,t,s){const i=e.id;this._tiles.set(i,new g(e,t,s)),this._tileBounds.set(i,e.extent),this._tileFeatureCounts.set(i,t.size)}_remove({id:e}){const t=this._tiles.get(e);t&&this._removeTileStorage(t)}_removeTileStorage(e){const t=[];for(const i of e.objectIds)1===this._unreferenceFeature(i)&&t.push(i);this.featureStore.removeManyById(t);const s=e.data.id;this._tiles.delete(s),this._tileBounds.delete(s)}_processEditsDelete(e){this.featureStore.removeManyById(e);for(const t of this._tiles.values()){for(const s of e)t.objectIds.delete(s);this._tileFeatureCounts.set(t.data.id,t.objectIds.size)}for(const t of e)this._refCounts.delete(t)}async _processEditsRefetch(e,t,s){if(!e.length)return;const i=(await t(e,s)).features,{hasZ:r,hasM:o}=this.featureStore;for(const n of i){const e=a(this._tmpBoundingRect,n.geometry,r,o);null!=e&&this._tileBounds.forEachInBounds(e,e=>{const t=this._tiles.get(e);this.featureStore.add(n);const s=n.objectId;t.objectIds.has(s)||(t.objectIds.add(s),this._referenceFeature(s),this._tileFeatureCounts.set(t.data.id,t.objectIds.size))})}}process(e,t=()=>!0,s){if(null==this.tileInfo||!e.extent||null!=this.extent&&!l(u(this.extent,this._tmpBoundingRect),e.extent))return new v(e);if(this._memoryLimitExceeded&&!this._tiles.hasLowerPriority(e.id??""))return new v(e);const r=this.getAttributesForTile(e.id);if(i(s,r))return new v(e);const o=this._createTileTree(e,this.tileInfo);return this._simplify(o,t,null,0,1),this._collectMissingTiles(e,o,this.tileInfo,s)}get debugInfo(){return Array.from(this._tiles.values()).map(({data:e})=>({data:e,featureCount:this._tileFeatureCounts.get(e.id)||0}))}getFeatureCount(e){return this._tileFeatureCounts.get(e.id)??0}async fetchCount(e,t,s,i){const r=this._tileFeatureCounts.get(e.id);if(null!=r)return r;const o=await f(t,s,i);return this._tileFeatureCounts.set(e.id,o.data.count),o.data.count}_createTileTree(e,t){const s=new y(e.level,e.row,e.col);return t.updateTileInfo(s,1),this._tileBounds.forEachInBounds(e.extent,i=>{const r=this._tiles.get(i)?.data;r&&p(e,r)&&this._populateChildren(s,r,t,this._tileFeatureCounts.get(r.id)||0)}),s}_populateChildren(e,t,s,i){const r=t.level-e.level-1;if(r<0)return void(e.isLeaf=!0);const o=t.row>>r,n=t.col>>r,l=e.row<<1,u=n-(e.col<<1)+(o-l<<1),c=e.children[u];if(null!=c)this._populateChildren(c,t,s,i);else{const r=new y(e.level+1,o,n);s.updateTileInfo(r,1),e.children[u]=r,this._populateChildren(r,t,s,i)}}_simplify(e,t,s,i,r){const o=r*r;if(e.isLeaf)return t(this.getFeatureCount(e),r)?0:(this._remove(e),null!=s&&(s.children[i]=null),o);const n=r/2,l=n*n;let u=0;for(let c=0;c<e.children.length;c++){const s=e.children[c];u+=null!=s?this._simplify(s,t,e,c,n):l}return 0===u?this._mergeChildren(e):1-u/o<S&&(this._purge(e),null!=s&&(s.children[i]=null),u=o),u}_mergeChildren(e){const t=new Set;let i;this._forEachLeaf(e,e=>{const r=this._tiles.get(e.id);if(r){i=i?s(i,r.attributeKeys):new Set(r.attributeKeys);for(const e of r.objectIds)t.has(e)||(t.add(e),this._referenceFeature(e));this._remove(e)}}),this._addTileStorage(e,t,i??new Set),e.isLeaf=!0,e.children[0]=e.children[1]=e.children[2]=e.children[3]=null,this._tileFeatureCounts.set(e.id,t.size)}_forEachLeaf(e,t){for(const s of e.children)null!=s&&(s.isLeaf?t(s):this._forEachLeaf(s,t))}_purge(e){if(null!=e)if(e.isLeaf)this._remove(e);else for(let t=0;t<e.children.length;t++){const s=e.children[t];this._purge(s),e.children[t]=null}}_collectMissingTiles(e,t,s,i){const r=new C(s,e,this.extent);return this._collectMissingTilesRecurse(t,r,1,i),r.info}_collectMissingTilesRecurse(e,t,s,r){const o=this.getAttributesForTile(e.id),n=o&&!i(r,o);if(n&&t.addMissing(e.level,e.row,e.col,s),e.isLeaf)return;if(!e.hasChildren)return void(n||t.addMissing(e.level,e.row,e.col,s));const l=s/2;for(let i=0;i<e.children.length;i++){const s=e.children[i];null==s?t.addMissing(e.level+1,(e.row<<1)+((2&i)>>1),(e.col<<1)+(1&i),l):this._collectMissingTilesRecurse(s,t,l,r)}}_referenceFeature(e){const t=(this._refCounts.get(e)||0)+1;return this._refCounts.set(e,t),1===t?0:2}_unreferenceFeature(e){const t=(this._refCounts.get(e)||0)-1;return 0===t?(this._refCounts.delete(e),1):(t>0&&this._refCounts.set(e,t),2)}get test(){}};function p(e,t){if(!e||!t)return!1;if(e.level===t.level)return e.row===t.row&&e.col===t.col;const s=e.level<t.level,i=s?e:t,r=s?t:e,o=1<<r.level-i.level;return Math.floor(r.row/o)===i.row&&Math.floor(r.col/o)===i.col}e([r({constructOnly:!0})],m.prototype,"featureStore",void 0),e([r()],m.prototype,"tileInfo",void 0),e([r()],m.prototype,"extent",void 0),e([r()],m.prototype,"maximumByteSize",void 0),m=e([o("esri.views.interactive.snapping.featureSources.featureServiceSource.FeatureServiceTileStore")],m);class g{constructor(e,t,s){this.data=e,this.objectIds=t,this.attributeKeys=s}}class y{constructor(e,t,s){this.level=e,this.row=t,this.col=s,this.isLeaf=!1,this.extent=null,this.children=[null,null,null,null]}get hasChildren(){return!this.isLeaf&&(null!=this.children[0]||null!=this.children[1]||null!=this.children[2]||null!=this.children[3])}}class v{constructor(e,t=[]){this.missingTiles=t,this.fullArea=0,this.coveredArea=0,this.fullArea=c(e.extent),this.coveredArea=this.fullArea}prepend(e){this.missingTiles=e.missingTiles.concat(this.missingTiles),this.coveredArea+=e.coveredArea,this.fullArea+=e.fullArea}}class C{constructor(e,t,s){this._tileInfo=e,this._extent=null,this.info=new v(t),null!=s&&(this._extent=u(s))}addMissing(e,t,s,i){const r=new d(null,e,t,s);this._tileInfo.updateTileInfo(r,1),null==r.extent||null!=this._extent&&!l(this._extent,r.extent)||(this.info.missingTiles.push({data:r,resolution:i}),this.info.coveredArea-=c(r.extent))}}const S=.18751;export{m as FeatureServiceTileStore,v as ProcessResult};
5
+ import{__decorate as e}from"tslib";import t from"../../../../../core/Accessor.js";import"../../../../../core/has.js";import{intersection as s,isSubsetOf as i}from"../../../../../core/SetUtils.js";import{property as r}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/Logger.js";import"../../../../../core/RandomLCG.js";import{subclass as o}from"../../../../../core/accessorSupport/decorators/subclass.js";import{create as n,intersects as l,fromExtent as u,area as c}from"../../../../../geometry/support/aaBoundingRect.js";import{getBoundsOptimizedGeometry as h}from"../../../../../layers/graphics/featureConversionUtils.js";import{BoundsStore as a}from"../../../../../layers/graphics/data/BoundsStore.js";import{TileKey as d}from"../../../../../layers/support/TileKey.js";import{executeQueryForCount as f}from"../../../../../rest/query/operations/query.js";import{FeatureServiceTileCache as _}from"./FeatureServiceTileCache.js";let m=class extends t{setPriorityOrderByKey(e){this._tiles.setPriorityOrderByKey(e)}get _memoryLimitExceeded(){return this.featureStore.usedMemory>=this.maximumByteSize}constructor(e){super(e),this.tileInfo=null,this.extent=null,this.maximumByteSize=10485760,this._tileBounds=new a,this._tiles=new _,this._refCounts=new Map,this._tileFeatureCounts=new Map,this._tmpBoundingRect=n()}add(e,t){for(const s of t)this._referenceFeature(s.objectId);const i=this.featureStore.upsertMany(t),r=i.map(e=>new Set(Object.keys(e.attributes))).reduce((e,t)=>s(e,t),new Set(Object.keys(i[0]?.attributes??[]))),o=this._memoryLimitExceeded;this._addTileStorage(e,new Set(i.map(e=>e.objectId)),r),o&&this._applyCacheMemoryLimits()}_applyCacheMemoryLimits(){if(!this._memoryLimitExceeded)return;const{_tiles:e,featureStore:t,maximumByteSize:s}=this;e.someFromLowestToHighestPriority(e=>!this._memoryLimitExceeded||t.usedMemory-this._estimateRemoveTileMemoryReduction(e)<s||(this._removeTileStorage(e),!1))}_estimateRemoveTileMemoryReduction(e){let t=0;for(const s of e.objectIds){if(1===this._refCounts.get(s)){const e=this.featureStore.getFeature(s);e&&(t+=this.featureStore.estimateFeatureUsedMemory?.(e)??0)}}return t}getAttributesForTile(e){return e?this._tiles.get(e)?.attributeKeys:null}destroy(){this.clear(),this._tileFeatureCounts.clear()}clear(){this.featureStore.clear(),this._tileBounds.clear(),this._tiles.clear(),this._refCounts.clear()}refresh(){this.clear(),this._tileFeatureCounts.clear()}processEdits(e,t,s){return this._processEditsDelete(e.deletedFeatures.concat(e.updatedFeatures)),this._processEditsRefetch(e.addedFeatures.concat(e.updatedFeatures),t,s)}_addTileStorage(e,t,s){const i=e.id;this._tiles.set(i,new y(e,t,s)),this._tileBounds.set(i,e.extent),this._tileFeatureCounts.set(i,t.size)}_remove({id:e}){const t=this._tiles.get(e);t&&this._removeTileStorage(t)}_removeTileStorage(e){const t=[];for(const i of e.objectIds)1===this._unreferenceFeature(i)&&t.push(i);this.featureStore.removeManyById(t);const s=e.key.id;this._tiles.delete(s),this._tileBounds.delete(s)}_processEditsDelete(e){this.featureStore.removeManyById(e);for(const t of this._tiles.values()){for(const s of e)t.objectIds.delete(s);this._tileFeatureCounts.set(t.key.id,t.objectIds.size)}for(const t of e)this._refCounts.delete(t)}async _processEditsRefetch(e,t,s){if(!e.length)return;const i=(await t(e,s)).features,{hasZ:r,hasM:o}=this.featureStore;for(const n of i){const e=h(this._tmpBoundingRect,n.geometry,r,o);null!=e&&this._tileBounds.forEachInBounds(e,e=>{const t=this._tiles.get(e);this.featureStore.add(n);const s=n.objectId;t.objectIds.has(s)||(t.objectIds.add(s),this._referenceFeature(s),this._tileFeatureCounts.set(t.key.id,t.objectIds.size))})}}process(e,t=()=>!0,s){if(null==this.tileInfo||!e.extent||null!=this.extent&&!l(u(this.extent,this._tmpBoundingRect),e.extent))return new v(e);if(this._memoryLimitExceeded&&!this._tiles.hasLowerPriority(e.id??""))return new v(e);const r=this.getAttributesForTile(e.id);if(i(s,r))return new v(e);const o=this._createTileTree(e,this.tileInfo);return this._simplify(o,t,null,0,1),this._collectMissingTiles(e,o,this.tileInfo,s)}get debugInfo(){return Array.from(this._tiles.values()).map(({key:e})=>({key:e.toJSON(),featureCount:this._tileFeatureCounts.get(e.id)||0}))}getFeatureCount(e){return this._tileFeatureCounts.get(e.id)??0}async fetchCount(e,t,s,i){const r=this._tileFeatureCounts.get(e.id);if(null!=r)return r;const o=await f(t,s,i);return this._tileFeatureCounts.set(e.id,o.data.count),o.data.count}_createTileTree(e,t){const s=new g(e.level,e.row,e.col);return t.updateTileInfo(s,1),this._tileBounds.forEachInBounds(e.extent,i=>{const r=this._tiles.get(i)?.key;r&&p(e,r)&&this._populateChildren(s,r,t,this._tileFeatureCounts.get(r.id)||0)}),s}_populateChildren(e,t,s,i){const r=t.level-e.level-1;if(r<0)return void(e.isLeaf=!0);const o=t.row>>r,n=t.col>>r,l=e.row<<1,u=n-(e.col<<1)+(o-l<<1),c=e.children[u];if(null!=c)this._populateChildren(c,t,s,i);else{const r=new g(e.level+1,o,n);s.updateTileInfo(r,1),e.children[u]=r,this._populateChildren(r,t,s,i)}}_simplify(e,t,s,i,r){const o=r*r;if(e.isLeaf)return t(this.getFeatureCount(e),r)?0:(this._remove(e),null!=s&&(s.children[i]=null),o);const n=r/2,l=n*n;let u=0;for(let c=0;c<e.children.length;c++){const s=e.children[c];u+=null!=s?this._simplify(s,t,e,c,n):l}return 0===u?this._mergeChildren(e):1-u/o<S&&(this._purge(e),null!=s&&(s.children[i]=null),u=o),u}_mergeChildren(e){const t=new Set;let i;this._forEachLeaf(e,e=>{const r=this._tiles.get(e.id);if(r){i=i?s(i,r.attributeKeys):new Set(r.attributeKeys);for(const e of r.objectIds)t.has(e)||(t.add(e),this._referenceFeature(e));this._remove(e)}}),this._addTileStorage(e,t,i??new Set),e.isLeaf=!0,e.children[0]=e.children[1]=e.children[2]=e.children[3]=null,this._tileFeatureCounts.set(e.id,t.size)}_forEachLeaf(e,t){for(const s of e.children)null!=s&&(s.isLeaf?t(s):this._forEachLeaf(s,t))}_purge(e){if(null!=e)if(e.isLeaf)this._remove(e);else for(let t=0;t<e.children.length;t++){const s=e.children[t];this._purge(s),e.children[t]=null}}_collectMissingTiles(e,t,s,i){const r=new C(s,e,this.extent);return this._collectMissingTilesRecurse(t,r,1,i),r.info}_collectMissingTilesRecurse(e,t,s,r){const o=this.getAttributesForTile(e.id),n=o&&!i(r,o);if(n&&t.addMissing(e.level,e.row,e.col,s),e.isLeaf)return;if(!e.hasChildren)return void(n||t.addMissing(e.level,e.row,e.col,s));const l=s/2;for(let i=0;i<e.children.length;i++){const s=e.children[i];null==s?t.addMissing(e.level+1,(e.row<<1)+((2&i)>>1),(e.col<<1)+(1&i),l):this._collectMissingTilesRecurse(s,t,l,r)}}_referenceFeature(e){const t=(this._refCounts.get(e)||0)+1;return this._refCounts.set(e,t),1===t?0:2}_unreferenceFeature(e){const t=(this._refCounts.get(e)||0)-1;return 0===t?(this._refCounts.delete(e),1):(t>0&&this._refCounts.set(e,t),2)}get test(){}};function p(e,t){if(!e||!t)return!1;if(e.level===t.level)return e.row===t.row&&e.col===t.col;const s=e.level<t.level,i=s?e:t,r=s?t:e,o=1<<r.level-i.level;return Math.floor(r.row/o)===i.row&&Math.floor(r.col/o)===i.col}e([r({constructOnly:!0})],m.prototype,"featureStore",void 0),e([r()],m.prototype,"tileInfo",void 0),e([r()],m.prototype,"extent",void 0),e([r()],m.prototype,"maximumByteSize",void 0),m=e([o("esri.views.interactive.snapping.featureSources.featureServiceSource.FeatureServiceTileStore")],m);class y{constructor(e,t,s){this.key=e,this.objectIds=t,this.attributeKeys=s}}class g extends d{constructor(){super(...arguments),this.isLeaf=!1,this.children=[null,null,null,null]}get hasChildren(){return!this.isLeaf&&(null!=this.children[0]||null!=this.children[1]||null!=this.children[2]||null!=this.children[3])}}class v{constructor(e,t=[]){this.missingTiles=t,this.fullArea=0,this.coveredArea=0,this.fullArea=c(e.extent),this.coveredArea=this.fullArea}prepend(e){this.missingTiles=e.missingTiles.concat(this.missingTiles),this.coveredArea+=e.coveredArea,this.fullArea+=e.fullArea}}class C{constructor(e,t,s){this._tileInfo=e,this._extent=null,this.info=new v(t),null!=s&&(this._extent=u(s))}addMissing(e,t,s,i){const r=new d(e,t,s);this._tileInfo.updateTileInfo(r,1)&&(null==this._extent||l(this._extent,r.extent))&&(this.info.missingTiles.push({data:r,resolution:i}),this.info.coveredArea-=c(r.extent))}}const S=.18751;export{m as FeatureServiceTileStore,v as ProcessResult};
@@ -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{equals as i}from"../../../../../core/arrayUtils.js";import{createTask as s}from"../../../../../core/asyncUtils.js";import r from"../../../../../core/Logger.js";import{throwIfAbortError as o}from"../../../../../core/promiseUtils.js";import{when as n}from"../../../../../core/reactiveUtils.js";import{union as a,equals as l,isSubsetOf as u,difference as d}from"../../../../../core/SetUtils.js";import{normalizeGlobalID as c}from"../../../../../core/uuid.js";import{property as h}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/has.js";import{subclass as p}from"../../../../../core/accessorSupport/decorators/subclass.js";import{UpdatingHandles as f}from"../../../../../core/support/UpdatingHandles.js";import y from"../../../../../geometry/Extent.js";import{toExtent as m}from"../../../../../geometry/support/aaBoundingRect.js";import{unquantizeOptimizedFeatureSet as _,convertFromFeatureSet as g}from"../../../../../layers/graphics/featureConversionUtils.js";import{isHostedAgolService as F}from"../../../../../layers/support/arcgisLayerUrl.js";import{OptimizedFeatureSetParserContext as b}from"../../../../../rest/query/operations/pbfOptimizedFeatureSet.js";import{executeQueryForExtent as T,executeQueryPBF as P,executeQuery as v}from"../../../../../rest/query/operations/query.js";import I from"../../../../../rest/support/Query.js";import{PendingFeatureTile as O}from"./PendingFeatureTile.js";let S=class extends t{get _minimumVerticesPerFeature(){switch(this.store?.featureStore.geometryType){case"esriGeometryPoint":case"esriGeometryMultipoint":return 1;case"esriGeometryPolygon":return 4;case"esriGeometryPolyline":return 2}}get _mandatoryOutFields(){const e=new Set;return this.objectIdField&&e.add(this.objectIdField),this.globalIdField&&e.add(this.globalIdField),e}set outFields(e){const t=this._get("outFields"),i=a(e,this._mandatoryOutFields);l(i,t)||(this._set("outFields",i),u(i,t)||this.refresh())}get outFields(){return this._get("outFields")??this._mandatoryOutFields}set filter(e){const t=this._get("filter"),i=this._filterProperties(e);JSON.stringify(t)!==JSON.stringify(i)&&this._set("filter",i)}set customParameters(e){const t=this._get("customParameters");JSON.stringify(t)!==JSON.stringify(e)&&this._set("customParameters",e)}get _configuration(){return{filter:this.filter,customParameters:this.customParameters,tileInfo:this.tileInfo,tileSize:this.tileSize}}set tileInfo(e){const t=this._get("tileInfo");t!==e&&(null!=e&&null!=t&&JSON.stringify(e)===JSON.stringify(t)||(this._set("tileInfo",e),this.store.tileInfo=e))}set tileSize(e){this._get("tileSize")!==e&&this._set("tileSize",e)}get updating(){return this._updatingHandles.updating}get hasZ(){return this.store.featureStore.hasZ}constructor(e){super(e),this.suspended=!0,this._historicMoment=null,this.tilesOfInterest=[],this.availability=0,this._pendingTiles=new Map,this._updatingHandles=new f}initialize(){this._initializeFetchExtent(),this._updatingHandles.add(()=>this._configuration,()=>this.refresh()),this._updatingHandles.add(()=>this.tilesOfInterest,()=>{this._updatePriorities(),this._process()},{sync:!0,initial:!0,equals:(e,t)=>i(e,t,({id:e},{id:t})=>e===t)}),this.addHandles(n(()=>!this.suspended,()=>this._process()))}_updatePriorities(){this.store.setPriorityOrderByKey(this.tilesOfInterest.map(e=>e.id??"")??[])}destroy(){this._pendingTiles.forEach(e=>this._deletePendingTile(e)),this._pendingTiles.clear(),this.store.destroy(),this.tilesOfInterest.length=0,this._updatingHandles.destroy()}refresh(){this.store.refresh(),this._pendingTiles.forEach(e=>this._deletePendingTile(e)),this._process()}async handleEdits(e){if(e.historicMoment&&(this._historicMoment=e.historicMoment),!e.addedFeatures.length&&!e.updatedFeatures.length&&!e.deletedFeatures.length)return;for(const s of this._pendingTiles.values())s.reset();const t={...e,deletedFeatures:e.deletedFeatures.map(({objectId:e,globalId:t})=>e&&-1!==e?e:this._lookupObjectIdByGlobalId(t))},i=s(async e=>{try{await this.store.processEdits(t,(e,t)=>this._queryFeaturesById(e,t),e),this._processPendingTiles()}catch(i){o(i),r.getLogger(this).warn("Failed to apply edits",i)}});this.addHandles(i),await this._updatingHandles.addPromise(i.promise)}setHistoricMoment(e){e?.getTime()!==this._historicMoment?.getTime()&&(this._historicMoment=e,this.refresh())}_initializeFetchExtent(){if(!this.capabilities.query.supportsExtent||!F(this.url))return;const e=s(async e=>{try{const t=await T(this.url,new I({where:"1=1",outSpatialReference:this.spatialReference,cacheHint:this.capabilities.query.supportsCacheHint??void 0}),{query:this._configuration.customParameters,signal:e});this.store.extent=y.fromJSON(t.data?.extent)}catch(t){o(t),r.getLogger(this).warn("Failed to fetch data extent",t)}});this._updatingHandles.addPromise(e.promise.then(()=>this._process())),this.addHandles(e)}get debugInfo(){return{numberOfFeatures:this.store.featureStore.numFeatures,tilesOfInterest:this.tilesOfInterest,pendingTiles:Array.from(this._pendingTiles.values()).map(e=>e.debugInfo),storedTiles:this.store.debugInfo}}_process(){this._markTilesNotAlive(),this._createPendingTiles(),this._deletePendingTiles(),this._processPendingTiles()}_markTilesNotAlive(){for(const e of this._pendingTiles.values())e.alive=!1}_createPendingTiles(){if(this.suspended)return;const e=this._collectMissingTilesInfo();if(this._setAvailability(null==e?1:e.coveredArea/e.fullArea),null!=e)for(const{data:t,resolution:i}of e.missingTiles){const e=this._pendingTiles.get(t.id);e?(e.resolution=i,e.alive=!0):this._createPendingTile(t,i)}}_collectMissingTilesInfo(){let e=null;for(const t of this.tilesOfInterest){const i=this.store.process(t,(e,t)=>this._verifyTileComplexity(e,t),this.outFields);null==e?e=i:e.prepend(i)}return e}_deletePendingTiles(){for(const e of this._pendingTiles.values())e.alive||this._deletePendingTile(e)}_processPendingTiles(){const e={fetchCount:(e,t)=>this._fetchCount(e,t),fetchFeatures:(e,t,i)=>this._fetchFeatures(e,t,i),finish:(e,t)=>this._finishPendingTile(e,t),resume:()=>this._processPendingTiles()};if(this._ensureFetchAllCounts(e))for(const t of this._pendingTiles.values())this._verifyTileComplexity(this.store.getFeatureCount(t.data),t.resolution)&&this._updatingHandles.addPromise(t.process(e))}_verifyTileComplexity(e,t){return this._verifyVertexComplexity(e)&&this._verifyFeatureDensity(e,t)}_verifyVertexComplexity(e){return e*this._minimumVerticesPerFeature<w}_verifyFeatureDensity(e,t){if(null==this.tileInfo)return!1;const i=this.tileSize*t;return e*(C/(i*i))<q}_ensureFetchAllCounts(e){let t=!0;for(const i of this._pendingTiles.values())i.state.type<2&&this._updatingHandles.addPromise(i.process(e)),i.state.type<=1&&(t=!1);return t}_finishPendingTile(e,t){this.store.add(e.data,t),this._deletePendingTile(e),this._updateAvailability()}_updateAvailability(){const e=this._collectMissingTilesInfo();this._setAvailability(null==e?1:e.coveredArea/e.fullArea)}_setAvailability(e){this._set("availability",e)}_createPendingTile(e,t){const i=new O(e,t);return this._pendingTiles.set(e.id,i),i}_deletePendingTile(e){e.reset(),this._pendingTiles.delete(e.data.id)}async _fetchCount(e,t){return this.store.fetchCount(e.data,this.url,this._createCountQuery(e),{query:this.customParameters,timeout:x,signal:t})}async _fetchFeatures(e,t,i){let s=0;const r=[];let o=0,n=t;for(;;){const a=this._createFeaturesQuery(e),l=this._setPagingParameters(a,s,n),{features:u,exceededTransferLimit:d}=await this._queryFeatures(a,i);l&&(s+=a.num),o+=u.length;for(const e of u)r.push(e);if(n=t-o,!l||!d||n<=0)return r}}_filterProperties(e){return null==e?{where:"1=1",gdbVersion:void 0,timeExtent:void 0}:{where:e.where||"1=1",timeExtent:e.timeExtent,gdbVersion:e.gdbVersion}}_lookupObjectIdByGlobalId(e){const t=this.globalIdField,i=this.objectIdField;if(null==t)throw new Error("Expected globalIdField to be defined");let s=null;const r=e?c(e):e;if(this.store.featureStore.forEach(e=>{r===c(e.attributes[t])&&(s=e.objectId??e.attributes[i])}),null==s)throw new Error(`Expected to find a feature with globalId ${e}`);return s}_queryFeaturesById(e,t){const i=this._createFeaturesQuery();return i.objectIds=e,this._queryFeatures(i,t)}_queryFeatures(e,t){return this.capabilities.query.supportsFormatPBF?this._queryFeaturesPBF(e,t):this._queryFeaturesJSON(e,t)}async _queryFeaturesPBF(e,t){const{sourceSpatialReference:i}=this,{data:s}=await P(this.url,e,new b({sourceSpatialReference:i}),{query:this._configuration.customParameters,timeout:x,signal:t});return _(s)}async _queryFeaturesJSON(e,t){const{sourceSpatialReference:i}=this,{data:s}=await v(this.url,e,i,{query:this._configuration.customParameters,timeout:x,signal:t});return g(s,{type:"object-id",fieldName:this.objectIdField})}_createCountQuery(e){const t=this._createBaseQuery(e);return this.capabilities.query.supportsCacheHint&&(t.cacheHint=!0),t}_createFeaturesQuery(e=null){const t=this._createBaseQuery(e),i=null!=e?.data?this.store.getAttributesForTile(e?.data?.id):null,s=a(d(this.outFields,i??new Set),this._mandatoryOutFields);return t.outFields=Array.from(s),t.returnGeometry=!0,null!=e&&(this.capabilities.query.supportsResultType?t.resultType="tile":this.capabilities.query.supportsCacheHint&&(t.cacheHint=!0)),t}_createBaseQuery(e){const t=new I({returnZ:this.hasZ,returnM:!1,historicMoment:this._historicMoment,geometry:null!=this.tileInfo&&null!=e?m(e.data.extent,this.tileInfo.spatialReference):void 0}),i=this._configuration.filter;return null!=i&&(t.where=i.where,t.gdbVersion=i.gdbVersion,t.timeExtent=i.timeExtent),t.outSpatialReference=this.spatialReference,t}_setPagingParameters(e,t,i){if(!this.capabilities.query.supportsPagination)return!1;const{supportsMaxRecordCountFactor:s,supportsCacheHint:r,tileMaxRecordCount:o,maxRecordCount:n,supportsResultType:a}=this.capabilities.query,l=s?I.MAX_MAX_RECORD_COUNT_FACTOR:1,u=l*((a||r)&&o?o:n||j);return e.start=t,s?(e.maxRecordCountFactor=Math.min(l,Math.ceil(i/u)),e.num=Math.min(i,e.maxRecordCountFactor*u)):e.num=Math.min(i,u),!0}};e([h({constructOnly:!0})],S.prototype,"url",void 0),e([h({constructOnly:!0})],S.prototype,"objectIdField",void 0),e([h({constructOnly:!0})],S.prototype,"globalIdField",void 0),e([h({constructOnly:!0})],S.prototype,"capabilities",void 0),e([h({constructOnly:!0})],S.prototype,"sourceSpatialReference",void 0),e([h({constructOnly:!0})],S.prototype,"spatialReference",void 0),e([h({constructOnly:!0})],S.prototype,"store",void 0),e([h({readOnly:!0})],S.prototype,"_minimumVerticesPerFeature",null),e([h()],S.prototype,"_mandatoryOutFields",null),e([h()],S.prototype,"outFields",null),e([h()],S.prototype,"suspended",void 0),e([h()],S.prototype,"_historicMoment",void 0),e([h()],S.prototype,"filter",null),e([h()],S.prototype,"customParameters",null),e([h({readOnly:!0})],S.prototype,"_configuration",null),e([h()],S.prototype,"tileInfo",null),e([h()],S.prototype,"tileSize",null),e([h()],S.prototype,"tilesOfInterest",void 0),e([h({readOnly:!0})],S.prototype,"updating",null),e([h({readOnly:!0})],S.prototype,"availability",void 0),e([h()],S.prototype,"hasZ",null),S=e([p("esri.views.interactive.snapping.featureSources.featureServiceSource.FeatureServiceTiledFetcher")],S);const j=2e3,x=6e5,w=1e6,C=25,q=1;export{S as FeatureServiceTiledFetcher};
5
+ import{__decorate as e}from"tslib";import t from"../../../../../core/Accessor.js";import{equals as i}from"../../../../../core/arrayUtils.js";import{createTask as s}from"../../../../../core/asyncUtils.js";import r from"../../../../../core/Logger.js";import{throwIfAbortError as o}from"../../../../../core/promiseUtils.js";import{when as n}from"../../../../../core/reactiveUtils.js";import{union as a,equals as l,isSubsetOf as u,difference as d}from"../../../../../core/SetUtils.js";import{normalizeGlobalID as c}from"../../../../../core/uuid.js";import{property as h}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/has.js";import{subclass as p}from"../../../../../core/accessorSupport/decorators/subclass.js";import{UpdatingHandles as y}from"../../../../../core/support/UpdatingHandles.js";import f from"../../../../../geometry/Extent.js";import{toExtent as m}from"../../../../../geometry/support/aaBoundingRect.js";import{unquantizeOptimizedFeatureSet as _,convertFromFeatureSet as g}from"../../../../../layers/graphics/featureConversionUtils.js";import{isHostedAgolService as F}from"../../../../../layers/support/arcgisLayerUrl.js";import{OptimizedFeatureSetParserContext as b}from"../../../../../rest/query/operations/pbfOptimizedFeatureSet.js";import{executeQueryForExtent as T,executeQueryPBF as P,executeQuery as v}from"../../../../../rest/query/operations/query.js";import I from"../../../../../rest/support/Query.js";import{PendingFeatureTile as O}from"./PendingFeatureTile.js";let S=class extends t{get _minimumVerticesPerFeature(){switch(this.store?.featureStore.geometryType){case"esriGeometryPoint":case"esriGeometryMultipoint":return 1;case"esriGeometryPolygon":return 4;case"esriGeometryPolyline":return 2}}get _mandatoryOutFields(){const e=new Set;return this.objectIdField&&e.add(this.objectIdField),this.globalIdField&&e.add(this.globalIdField),e}set outFields(e){const t=this._get("outFields"),i=a(e,this._mandatoryOutFields);l(i,t)||(this._set("outFields",i),u(i,t)||this.refresh())}get outFields(){return this._get("outFields")??this._mandatoryOutFields}set filter(e){const t=this._get("filter"),i=this._filterProperties(e);JSON.stringify(t)!==JSON.stringify(i)&&this._set("filter",i)}set customParameters(e){const t=this._get("customParameters");JSON.stringify(t)!==JSON.stringify(e)&&this._set("customParameters",e)}get _configuration(){return{filter:this.filter,customParameters:this.customParameters,tileInfo:this.tileInfo,tileSize:this.tileSize}}set tileInfo(e){const t=this._get("tileInfo");t!==e&&(null!=e&&null!=t&&JSON.stringify(e)===JSON.stringify(t)||(this._set("tileInfo",e),this.store.tileInfo=e))}set tileSize(e){this._get("tileSize")!==e&&this._set("tileSize",e)}get updating(){return this._updatingHandles.updating}get hasZ(){return this.store.featureStore.hasZ}constructor(e){super(e),this.suspended=!0,this._historicMoment=null,this.tilesOfInterest=new Array,this.availability=0,this._pendingTiles=new Map,this._updatingHandles=new y}initialize(){this._initializeFetchExtent(),this._updatingHandles.add(()=>this._configuration,()=>this.refresh()),this._updatingHandles.add(()=>this.tilesOfInterest,()=>{this._updatePriorities(),this._process()},{sync:!0,initial:!0,equals:(e,t)=>i(e,t,({id:e},{id:t})=>e===t)}),this.addHandles(n(()=>!this.suspended,()=>this._process()))}_updatePriorities(){this.store.setPriorityOrderByKey(this.tilesOfInterest.map(({id:e})=>e)??[])}destroy(){this._pendingTiles.forEach(e=>this._deletePendingTile(e)),this._pendingTiles.clear(),this.store.destroy(),this.tilesOfInterest.length=0,this._updatingHandles.destroy()}refresh(){this.store.refresh(),this._pendingTiles.forEach(e=>this._deletePendingTile(e)),this._process()}async handleEdits(e){if(e.historicMoment&&(this._historicMoment=e.historicMoment),!e.addedFeatures.length&&!e.updatedFeatures.length&&!e.deletedFeatures.length)return;for(const s of this._pendingTiles.values())s.reset();const t={...e,deletedFeatures:e.deletedFeatures.map(({objectId:e,globalId:t})=>e&&-1!==e?e:this._lookupObjectIdByGlobalId(t))},i=s(async e=>{try{await this.store.processEdits(t,(e,t)=>this._queryFeaturesById(e,t),e),this._processPendingTiles()}catch(i){o(i),r.getLogger(this).warn("Failed to apply edits",i)}});this.addHandles(i),await this._updatingHandles.addPromise(i.promise)}setHistoricMoment(e){e?.getTime()!==this._historicMoment?.getTime()&&(this._historicMoment=e,this.refresh())}_initializeFetchExtent(){if(!this.capabilities.query.supportsExtent||!F(this.url))return;const e=s(async e=>{try{const t=await T(this.url,new I({where:"1=1",outSpatialReference:this.spatialReference,cacheHint:this.capabilities.query.supportsCacheHint??void 0}),{query:this._configuration.customParameters,signal:e});this.store.extent=f.fromJSON(t.data?.extent)}catch(t){o(t),r.getLogger(this).warn("Failed to fetch data extent",t)}});this._updatingHandles.addPromise(e.promise.then(()=>this._process())),this.addHandles(e)}get debugInfo(){return{numberOfFeatures:this.store.featureStore.numFeatures,tilesOfInterest:this.tilesOfInterest,pendingTiles:Array.from(this._pendingTiles.values()).map(e=>e.debugInfo),storedTiles:this.store.debugInfo}}_process(){this._markTilesNotAlive(),this._createPendingTiles(),this._deletePendingTiles(),this._processPendingTiles()}_markTilesNotAlive(){for(const e of this._pendingTiles.values())e.alive=!1}_createPendingTiles(){if(this.suspended)return;const e=this._collectMissingTilesInfo();if(this._setAvailability(null==e?1:e.coveredArea/e.fullArea),null!=e)for(const{data:t,resolution:i}of e.missingTiles){const e=this._pendingTiles.get(t.id);e?(e.resolution=i,e.alive=!0):this._createPendingTile(t,i)}}_collectMissingTilesInfo(){let e=null;for(const t of this.tilesOfInterest){const i=this.store.process(t,(e,t)=>this._verifyTileComplexity(e,t),this.outFields);null==e?e=i:e.prepend(i)}return e}_deletePendingTiles(){for(const e of this._pendingTiles.values())e.alive||this._deletePendingTile(e)}_processPendingTiles(){const e={fetchCount:(e,t)=>this._fetchCount(e,t),fetchFeatures:(e,t,i)=>this._fetchFeatures(e,t,i),finish:(e,t)=>this._finishPendingTile(e,t),resume:()=>this._processPendingTiles()};if(this._ensureFetchAllCounts(e))for(const t of this._pendingTiles.values())this._verifyTileComplexity(this.store.getFeatureCount(t.key),t.resolution)&&this._updatingHandles.addPromise(t.process(e))}_verifyTileComplexity(e,t){return this._verifyVertexComplexity(e)&&this._verifyFeatureDensity(e,t)}_verifyVertexComplexity(e){return e*this._minimumVerticesPerFeature<x}_verifyFeatureDensity(e,t){if(null==this.tileInfo)return!1;const i=this.tileSize*t;return e*(C/(i*i))<q}_ensureFetchAllCounts(e){let t=!0;for(const i of this._pendingTiles.values())i.state.type<2&&this._updatingHandles.addPromise(i.process(e)),i.state.type<=1&&(t=!1);return t}_finishPendingTile(e,t){this.store.add(e.key,t),this._deletePendingTile(e),this._updateAvailability()}_updateAvailability(){const e=this._collectMissingTilesInfo();this._setAvailability(null==e?1:e.coveredArea/e.fullArea)}_setAvailability(e){this._set("availability",e)}_createPendingTile(e,t){const i=new O(e,t);return this._pendingTiles.set(e.id,i),i}_deletePendingTile(e){e.reset(),this._pendingTiles.delete(e.key.id)}async _fetchCount(e,t){return this.store.fetchCount(e.key,this.url,this._createCountQuery(e),{query:this.customParameters,timeout:w,signal:t})}async _fetchFeatures(e,t,i){let s=0;const r=[];let o=0,n=t;for(;;){const a=this._createFeaturesQuery(e),l=this._setPagingParameters(a,s,n),{features:u,exceededTransferLimit:d}=await this._queryFeatures(a,i);l&&(s+=a.num),o+=u.length;for(const e of u)r.push(e);if(n=t-o,!l||!d||n<=0)return r}}_filterProperties(e){return null==e?{where:"1=1",gdbVersion:void 0,timeExtent:void 0}:{where:e.where||"1=1",timeExtent:e.timeExtent,gdbVersion:e.gdbVersion}}_lookupObjectIdByGlobalId(e){const t=this.globalIdField,i=this.objectIdField;if(null==t)throw new Error("Expected globalIdField to be defined");let s=null;const r=e?c(e):e;if(this.store.featureStore.forEach(e=>{r===c(e.attributes[t])&&(s=e.objectId??e.attributes[i])}),null==s)throw new Error(`Expected to find a feature with globalId ${e}`);return s}_queryFeaturesById(e,t){const i=this._createFeaturesQuery();return i.objectIds=e,this._queryFeatures(i,t)}_queryFeatures(e,t){return this.capabilities.query.supportsFormatPBF?this._queryFeaturesPBF(e,t):this._queryFeaturesJSON(e,t)}async _queryFeaturesPBF(e,t){const{sourceSpatialReference:i}=this,{data:s}=await P(this.url,e,new b({sourceSpatialReference:i}),{query:this._configuration.customParameters,timeout:w,signal:t});return _(s)}async _queryFeaturesJSON(e,t){const{sourceSpatialReference:i}=this,{data:s}=await v(this.url,e,i,{query:this._configuration.customParameters,timeout:w,signal:t});return g(s,{type:"object-id",fieldName:this.objectIdField})}_createCountQuery(e){const t=this._createBaseQuery(e);return this.capabilities.query.supportsCacheHint&&(t.cacheHint=!0),t}_createFeaturesQuery(e=null){const t=this._createBaseQuery(e),i=null!=e?.key?this.store.getAttributesForTile(e?.key?.id):null,s=a(d(this.outFields,i??new Set),this._mandatoryOutFields);return t.outFields=Array.from(s),t.returnGeometry=!0,null!=e&&(this.capabilities.query.supportsResultType?t.resultType="tile":this.capabilities.query.supportsCacheHint&&(t.cacheHint=!0)),t}_createBaseQuery(e){const t=new I({returnZ:this.hasZ,returnM:!1,historicMoment:this._historicMoment,geometry:null!=this.tileInfo&&null!=e?m(e.key.extent,this.tileInfo.spatialReference):void 0}),i=this._configuration.filter;return null!=i&&(t.where=i.where,t.gdbVersion=i.gdbVersion,t.timeExtent=i.timeExtent),t.outSpatialReference=this.spatialReference,t}_setPagingParameters(e,t,i){if(!this.capabilities.query.supportsPagination)return!1;const{supportsMaxRecordCountFactor:s,supportsCacheHint:r,tileMaxRecordCount:o,maxRecordCount:n,supportsResultType:a}=this.capabilities.query,l=s?I.MAX_MAX_RECORD_COUNT_FACTOR:1,u=l*((a||r)&&o?o:n||j);return e.start=t,s?(e.maxRecordCountFactor=Math.min(l,Math.ceil(i/u)),e.num=Math.min(i,e.maxRecordCountFactor*u)):e.num=Math.min(i,u),!0}};e([h({constructOnly:!0})],S.prototype,"url",void 0),e([h({constructOnly:!0})],S.prototype,"objectIdField",void 0),e([h({constructOnly:!0})],S.prototype,"globalIdField",void 0),e([h({constructOnly:!0})],S.prototype,"capabilities",void 0),e([h({constructOnly:!0})],S.prototype,"sourceSpatialReference",void 0),e([h({constructOnly:!0})],S.prototype,"spatialReference",void 0),e([h({constructOnly:!0})],S.prototype,"store",void 0),e([h({readOnly:!0})],S.prototype,"_minimumVerticesPerFeature",null),e([h()],S.prototype,"_mandatoryOutFields",null),e([h()],S.prototype,"outFields",null),e([h()],S.prototype,"suspended",void 0),e([h()],S.prototype,"_historicMoment",void 0),e([h()],S.prototype,"filter",null),e([h()],S.prototype,"customParameters",null),e([h({readOnly:!0})],S.prototype,"_configuration",null),e([h()],S.prototype,"tileInfo",null),e([h()],S.prototype,"tileSize",null),e([h()],S.prototype,"tilesOfInterest",void 0),e([h({readOnly:!0})],S.prototype,"updating",null),e([h({readOnly:!0})],S.prototype,"availability",void 0),e([h()],S.prototype,"hasZ",null),S=e([p("esri.views.interactive.snapping.featureSources.featureServiceSource.FeatureServiceTiledFetcher")],S);const j=2e3,w=6e5,x=1e6,C=25,q=1;export{S as FeatureServiceTiledFetcher};
@@ -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 r from"../../../../../core/Accessor.js";import{property as t}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 s from"../../../../../geometry/Point.js";import{fromValues as i}from"../../../../../geometry/support/aaBoundingRect.js";import p from"../../../../../layers/support/LOD.js";import l from"../../../../../layers/support/TileInfo.js";import{TileKey as n}from"../../../../../layers/support/TileKey.js";let a=class extends r{get tiles(){return[new n("0/0/0",0,0,0,i(-1e8,-1e8,1e8,1e8))]}get tileInfo(){return new l({origin:new s({x:-1e8,y:1e8,spatialReference:this.layer.spatialReference}),size:[512,512],lods:[new p({level:0,scale:1,resolution:390625})],spatialReference:this.layer.spatialReference})}get tileSize(){return this.tileInfo.size[0]}constructor(e){super(e),this.pointOfInterest=null}};e([t({readOnly:!0})],a.prototype,"tiles",null),e([t({readOnly:!0})],a.prototype,"tileInfo",null),e([t({readOnly:!0})],a.prototype,"tileSize",null),e([t({constructOnly:!0})],a.prototype,"layer",void 0),e([t()],a.prototype,"pointOfInterest",void 0),a=e([o("esri.views.interactive.snapping.featureSources.featureServiceSource.FeatureServiceTilesSimple")],a);export{a as FeatureServiceTilesSimple};
5
+ import{__decorate as e}from"tslib";import r from"../../../../../core/Accessor.js";import{property as t}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 s from"../../../../../geometry/Point.js";import{fromValues as i}from"../../../../../geometry/support/aaBoundingRect.js";import p from"../../../../../layers/support/LOD.js";import l from"../../../../../layers/support/TileInfo.js";import{TileKey as n}from"../../../../../layers/support/TileKey.js";let a=class extends r{get tiles(){return[new n(0,0,0,i(-1e8,-1e8,1e8,1e8))]}get tileInfo(){return new l({origin:new s({x:-1e8,y:1e8,spatialReference:this.layer.spatialReference}),size:[512,512],lods:[new p({level:0,scale:1,resolution:390625})],spatialReference:this.layer.spatialReference})}get tileSize(){return this.tileInfo.size[0]}constructor(e){super(e),this.pointOfInterest=null}};e([t({readOnly:!0})],a.prototype,"tiles",null),e([t({readOnly:!0})],a.prototype,"tileInfo",null),e([t({readOnly:!0})],a.prototype,"tileSize",null),e([t({constructOnly:!0})],a.prototype,"layer",void 0),e([t()],a.prototype,"pointOfInterest",void 0),a=e([o("esri.views.interactive.snapping.featureSources.featureServiceSource.FeatureServiceTilesSimple")],a);export{a as FeatureServiceTilesSimple};
@@ -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{createTask as t,resultOrAbort as e}from"../../../../../core/asyncUtils.js";import{fromExtent as s,create as a,intersects as r}from"../../../../../geometry/support/aaBoundingRect.js";class u{constructor(t,e){this.data=t,this.resolution=e,this.state={type:0},this.alive=!0}process(t){switch(this.state.type){case 0:return this.state=this._gotoFetchCount(this.state,t),this.state.task.promise.then(t.resume,t.resume);case 1:case 3:break;case 2:return this.state=this._gotoFetchFeatures(this.state,t),this.state.task.promise.then(t.resume,t.resume);case 4:this.state=this._goToDone(this.state,t)}return null}get debugInfo(){return{data:this.data,featureCount:this._featureCount,state:this._stateToString}}get _featureCount(){switch(this.state.type){case 0:case 1:return 0;case 2:return this.state.featureCount;case 3:return this.state.previous.featureCount;case 4:return this.state.features.length;case 5:return this.state.previous.features.length}}get _stateToString(){switch(this.state.type){case 0:return"created";case 1:return"fetch-count";case 2:return"fetched-count";case 3:return"fetch-features";case 4:return"fetched-features";case 5:return"done"}}_gotoFetchCount(s,a){return{type:1,previous:s,task:t(async t=>{const s=await e(a.fetchCount(this,t));1===this.state.type&&(this.state=i(this.state,s.ok?s.value:1/0))})}}_gotoFetchFeatures(s,a){return{type:3,previous:s,task:t(async t=>{const r=await e(a.fetchFeatures(this,s.featureCount,t));3===this.state.type&&(this.state=n(this.state,r.ok?r.value:[]))})}}_goToDone(t,e){return e.finish(this,t.features),{type:5,previous:t}}reset(){const t=this.state;switch(this.state={type:0},t.type){case 0:case 2:case 4:case 5:break;case 1:case 3:t.task.abort()}}intersects(t){return null==t||!this.data.extent||(s(t,o),r(this.data.extent,o))}}function i(t,e){return{type:2,featureCount:e,previous:t}}function n(t,e){return{type:4,previous:t,features:e}}const o=a();export{u as PendingFeatureTile};
5
+ import{createTask as t,resultOrAbort as e}from"../../../../../core/asyncUtils.js";class s{constructor(t,e){this.key=t,this.resolution=e,this.state={type:0},this.alive=!0}process(t){switch(this.state.type){case 0:return this.state=this._gotoFetchCount(this.state,t),this.state.task.promise.then(t.resume,t.resume);case 1:case 3:break;case 2:return this.state=this._gotoFetchFeatures(this.state,t),this.state.task.promise.then(t.resume,t.resume);case 4:this.state=this._goToDone(this.state,t)}return null}get debugInfo(){return{key:this.key,featureCount:this._featureCount,state:this._stateToString}}get _featureCount(){switch(this.state.type){case 0:case 1:return 0;case 2:return this.state.featureCount;case 3:return this.state.previous.featureCount;case 4:return this.state.features.length;case 5:return this.state.previous.features.length}}get _stateToString(){switch(this.state.type){case 0:return"created";case 1:return"fetch-count";case 2:return"fetched-count";case 3:return"fetch-features";case 4:return"fetched-features";case 5:return"done"}}_gotoFetchCount(s,r){return{type:1,previous:s,task:t(async t=>{const s=await e(r.fetchCount(this,t));1===this.state.type&&(this.state=a(this.state,s.ok?s.value:1/0))})}}_gotoFetchFeatures(s,a){return{type:3,previous:s,task:t(async t=>{const u=await e(a.fetchFeatures(this,s.featureCount,t));3===this.state.type&&(this.state=r(this.state,u.ok?u.value:[]))})}}_goToDone(t,e){return e.finish(this,t.features),{type:5,previous:t}}reset(){const t=this.state;switch(this.state={type:0},t.type){case 0:case 2:case 4:case 5:break;case 1:case 3:t.task.abort()}}}function a(t,e){return{type:2,featureCount:e,previous:t}}function r(t,e){return{type:4,previous:t,features:e}}export{s as PendingFeatureTile};
@@ -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{markAsTarget as e,fromValues as t}from"../../sketch/normalizedPoint.js";import{DrapedEdgeSnappingCandidate as n}from"../candidates/DrapedEdgeSnappingCandidate.js";import{EdgeSnappingCandidate as d}from"../candidates/EdgeSnappingCandidate.js";import{VertexSnappingCandidate as r}from"../candidates/VertexSnappingCandidate.js";function a({x:e,y:n,z:d}){return t(e,n,d??0)}function o(t,o){switch(t.type){case"edge":return t.draped?new n({edgeStart:a(t.start),edgeEnd:a(t.end),targetPoint:e(a(t.target)),objectId:t.objectId,getGroundElevation:o}):new d({edgeStart:a(t.start),edgeEnd:a(t.end),targetPoint:e(a(t.target)),objectId:t.objectId,isDraped:!1});case"vertex":return new r({targetPoint:e(a(t.target)),objectId:t.objectId,isDraped:!1})}}function i(e,t){return null!=e&&"3d"===e.type?(n,d)=>e.elevationProvider.getElevation(n,d,0,t,"ground"):()=>null}export{o as convertSnappingCandidate,i as makeGetGroundElevation};
5
+ import{markAsTarget as e,fromValues as t}from"../../sketch/normalizedPoint.js";import{DrapedEdgeSnappingCandidate as n}from"../candidates/DrapedEdgeSnappingCandidate.js";import{EdgeSnappingCandidate as d}from"../candidates/EdgeSnappingCandidate.js";import{VertexSnappingCandidate as r}from"../candidates/VertexSnappingCandidate.js";function a({x:e,y:n,z:d}){return t(e,n,d??0)}function o(t,o){switch(t.type){case"edge":return t.draped?new n({edgeStart:a(t.start),edgeEnd:a(t.end),targetPoint:e(a(t.target)),objectId:t.objectId,getGroundElevation:o}):new d({edgeStart:a(t.start),edgeEnd:a(t.end),targetPoint:e(a(t.target)),objectId:t.objectId,isDraped:!1});case"vertex":return new r({targetPoint:e(a(t.target)),objectId:t.objectId,isDraped:!1})}}function i(e,t){return"3d"===e?.type?(n,d)=>e.elevationProvider.getElevation(n,d,0,t,"ground"):()=>null}export{o as convertSnappingCandidate,i as makeGetGroundElevation};
@@ -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 o}from"tslib";import{prefersReducedMotion as e}from"../../core/a11yUtils.js";import t from"../../core/Accessor.js";import{deprecatedProperty as r}from"../../core/deprecate.js";import a from"../../core/Logger.js";import{property as s}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/RandomLCG.js";import{subclass as m}from"../../core/accessorSupport/decorators/subclass.js";import n from"./NavigationActionMap.js";import p from"./gamepad/GamepadSettings.js";let i=class extends t{constructor(o){super(o),this.actionMap=new n,this.browserTouchPanEnabled=!0,this.gamepad=new p,this.momentumEnabled=!0}get effectiveMomentumEnabled(){return this.momentumEnabled&&!e()}get mouseWheelZoomEnabled(){return"zoom"===this.actionMap.mouseWheel}set mouseWheelZoomEnabled(o){r(a.getLogger(this),"mouseWheelZoomEnabled",{replacement:"actionMap.mouseWheel",version:"4.32",warnOnce:!0}),this.actionMap.mouseWheel=o?"zoom":"none"}};o([s({type:n,nonNullable:!0})],i.prototype,"actionMap",void 0),o([s({type:Boolean})],i.prototype,"browserTouchPanEnabled",void 0),o([s({type:p,nonNullable:!0})],i.prototype,"gamepad",void 0),o([s({type:Boolean})],i.prototype,"momentumEnabled",void 0),o([s({type:Boolean})],i.prototype,"mouseWheelZoomEnabled",null),i=o([m("esri.views.navigation.Navigation")],i);const l=i;export{l as default};
5
+ import{__decorate as o}from"tslib";import e from"../../core/Accessor.js";import{deprecatedProperty as t}from"../../core/deprecate.js";import r from"../../core/Logger.js";import{property as a}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/RandomLCG.js";import{subclass as s}from"../../core/accessorSupport/decorators/subclass.js";import p from"./NavigationActionMap.js";import n from"./gamepad/GamepadSettings.js";let m=class extends e{constructor(o){super(o),this.actionMap=new p,this.browserTouchPanEnabled=!0,this.gamepad=new n,this.momentumEnabled=!0}get mouseWheelZoomEnabled(){return"zoom"===this.actionMap.mouseWheel}set mouseWheelZoomEnabled(o){t(r.getLogger(this),"mouseWheelZoomEnabled",{replacement:"actionMap.mouseWheel",version:"4.32",warnOnce:!0}),this.actionMap.mouseWheel=o?"zoom":"none"}};o([a({type:p,nonNullable:!0})],m.prototype,"actionMap",void 0),o([a({type:Boolean})],m.prototype,"browserTouchPanEnabled",void 0),o([a({type:n,nonNullable:!0})],m.prototype,"gamepad",void 0),o([a({type:Boolean})],m.prototype,"momentumEnabled",void 0),o([a({type:Boolean})],m.prototype,"mouseWheelZoomEnabled",null),m=o([s("esri.views.navigation.Navigation")],m);const i=m;export{i 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 r}from"tslib";import{EventedAccessor as o}from"../../core/Evented.js";import{property as e}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{subclass as t}from"../../core/accessorSupport/decorators/subclass.js";import{updateGeometryElevation as s}from"../../layers/support/ElevationSampler.js";import{elevationNoDataValue as p}from"../3d/terrain/TerrainConst.js";let a=class extends o{constructor(r){super(r),this.noDataValue=p}queryElevation(r){return s(r.clone(),this)}};r([e({constructOnly:!0})],a.prototype,"view",void 0),r([e({readOnly:!0})],a.prototype,"noDataValue",void 0),a=r([t("esri.views.support.GroundViewElevationSampler")],a);export{a as GroundViewElevationSampler};
5
+ import{__decorate as r}from"tslib";import{property as o}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{subclass as t}from"../../core/accessorSupport/decorators/subclass.js";import e from"../../layers/support/ElevationSampler.js";import{elevationNoDataValue as s}from"../3d/terrain/TerrainConst.js";let p=class extends e{constructor(r){super(r),this.noDataValue=s}};r([o({constructOnly:!0})],p.prototype,"view",void 0),r([o({readOnly:!0})],p.prototype,"noDataValue",void 0),p=r([t("esri.views.support.GroundViewElevationSampler")],p);export{p as GroundViewElevationSampler};
@@ -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"../../Viewpoint.js";import i from"../../core/CollectionFlattener.js";import{destroyMaybe as r}from"../../core/maybe.js";import{whenOnce as s,watch as a,syncAndInitial as o}from"../../core/reactiveUtils.js";import{initialize as n}from"../../core/workers/workers.js";import{property as l}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{subclass as p}from"../../core/accessorSupport/decorators/subclass.js";import{isLoadedOrLoadFor as h}from"../../geometry/projectionUtils.js";import c from"../../layers/support/TileInfo.js";import d from"../View.js";import{Viewport2DBaseMixin as m}from"../Viewport2DBaseMixin.js";import g from"../2d/AnimationManager.js";import{GoToManager as u}from"../2d/GoToManager.js";import{layerView2DImporter as w}from"../2d/layerViewModuleImportUtils.js";import y from"../2d/tiling/TileInfoView.js";import"../2d/tiling/TileKey.js";import"../2d/tiling/TileQueue.js";import"../2d/tiling/TileStrategy.js";import{extentToScale as f}from"../2d/viewpointUtils.js";import V from"../2d/layers/features/support/TileStore.js";import{hitTest as v}from"../2d/support/hitTestUtils.js";import{Timeline as M}from"../2d/support/Timeline.js";let j,T,_,S;async function b(){const[,{GraphicsView2D:e,GraphicContainer:t,LabelManager:i,MapViewNavigation:r}]=await Promise.all([import("../2d/webglDeps.js"),import("../2d/mapViewDeps.js")]);j=e,T=t,_=i,S=r}let C=class extends(m(d)){constructor(e){super(e),this.stage=null,this.rootLayerViews=new i({getCollections:()=>[this.layerViews],getChildrenFunction:()=>null}),this.featuresTilingScheme=null,this.graphicsView=null,this.timeline=new M,this.goToManager=new u({view:this}),this.labelManager=null,this.map=null,this.surface=null,this.padding={top:0,right:0,bottom:0,left:0},n()}initialize(){this.addResolvingPromise(s(()=>this.ready))}destroy(){this.layerViewManager.clear(),this._set("preconditionsReady",!1),this.frameTask=r(this.frameTask),this.goToManager.destroy(),this.rootLayerViews.destroy()}get graphicsTileStore(){return new V(this.featuresTilingScheme)}get typeSpecificPreconditionsReady(){const e=this._getDefaultViewpoint();if(!e)return!1;const t=e.targetGeometry,i=this.spatialReference;return h(t.spatialReference,i)}async hitTest(e,t){return v(this,e,t)}goTo(e,t){return this.goToManager.goTo(e,t)}toMap(e){return this.stateManager.toMap(e)}requestUpdate(){this.ready&&this.frameTask.requestUpdate()}loadAsyncDependencies(){return b()}hasLayerViewModule(e){return w.hasLayerViewModule(e)}importLayerView(e){return w.importLayerView(e)}_getDefaultViewpoint(){const{constraints:e,initialExtent:i,map:r,padding:s,size:a}=this;if(!e)return null;const o=r&&"initialViewProperties"in r?r.initialViewProperties:void 0,n=this.stateManager.getUserStartupOptions(this.size),l=o?.viewpoint,p=l?.targetGeometry?.extent??i,h=p?.center,c=l?.rotation??0,d=l?.scale||p&&f(p,[a[0]-s.left-s.right,a[1]-s.top-s.bottom]),m=n.center??h,g=n.rotation??c,u=n.scale??d;return m&&u?new t({targetGeometry:m,scale:u,rotation:g}):null}_updateStageChildren(){this.stage.removeAllChildren(),this.rootLayerViews.forEach(e=>{this.stage.addChild(e.container)});const e=this.graphicsView;this.stage.addChild(e.container)}_startup(){this.timeline.begin("VideoOperationalDataView Startup");const e=this._getDefaultViewpoint();this.stateManager.startup(e,this.size,this.spatialReference,this.defaultsFromMap.extent?.center),this.graphics.owner=this;const t=new _({view:this});this._set("labelManager",t);const i=new g({view:this});this._set("animationManager",i);const r=new S({view:this,animationManager:i});this._set("mapViewNavigation",r);const s=new y(c.create({spatialReference:this.spatialReference,size:512,numLODs:36}));this._set("featuresTilingScheme",s);const n=new j({view:this,graphics:this.graphics,requestUpdateCallback:()=>this.requestUpdate(),container:new T(s)});this._set("graphicsView",n),this.addHandles([this.rootLayerViews.on("change",()=>this._updateStageChildren()),this.stage.on("webgl-error",e=>this.fatalError=e.error),a(()=>this.stationary,e=>this.stage.stationary=e,o),a(()=>this.state.id,()=>this.stage.state=this.state,o)],"video-graphics-view"),this._updateStageChildren(),this.timeline.end("VideoOperationalDataView Startup"),this.frameTask.start(),this.stage.viewIsReady=!0,this._set("ready",!0)}_teardown(){this.removeHandles("video-graphics-view"),this.mapViewNavigation.destroy(),this._set("mapViewNavigation",null),this.animation=null,this.animationManager.destroy(),this._set("animationManager",null),this.layerViewManager.clear(),this.stage.destroy(),this.stage=null;const e=this.graphicsView;this._set("graphicsView",null),e.destroy(),this._set("featuresTilingScheme",null),this._set("mapViewNavigation",null),this.graphics.owner=null,this.frameTask.stop(),this.stationaryManager.clear(),this._set("ready",!1),this.stateManager.teardown()}};e([l()],C.prototype,"stage",void 0),e([l({readOnly:!0})],C.prototype,"featuresTilingScheme",void 0),e([l({readOnly:!0})],C.prototype,"graphicsTileStore",null),e([l()],C.prototype,"graphicsView",void 0),e([l({type:M,readOnly:!0})],C.prototype,"timeline",void 0),e([l()],C.prototype,"goToManager",void 0),e([l()],C.prototype,"labelManager",void 0),e([l()],C.prototype,"map",void 0),e([l({readOnly:!0})],C.prototype,"typeSpecificPreconditionsReady",null),e([l({readOnly:!0})],C.prototype,"surface",void 0),C=e([p("esri.views.video.VideoOperationalDataView")],C);const D=C;export{D as default};
5
+ import{__decorate as e}from"tslib";import t from"../../Viewpoint.js";import i from"../../core/CollectionFlattener.js";import{destroyMaybe as s}from"../../core/maybe.js";import{whenOnce as r,watch as a,syncAndInitial as o}from"../../core/reactiveUtils.js";import{initialize as n}from"../../core/workers/workers.js";import{property as l}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{subclass as p}from"../../core/accessorSupport/decorators/subclass.js";import{isLoadedOrLoadFor as h}from"../../geometry/projectionUtils.js";import d from"../../layers/support/TileInfo.js";import m from"../View.js";import{Viewport2DBaseMixin as c}from"../Viewport2DBaseMixin.js";import g from"../2d/AnimationManager.js";import{GoToManager as u}from"../2d/GoToManager.js";import{layerView2DImporter as w}from"../2d/layerViewModuleImportUtils.js";import y from"../2d/tiling/TileInfoView.js";import"../2d/tiling/TileKey.js";import"../2d/tiling/TileQueue.js";import"../2d/tiling/TileStrategy.js";import{extentToScale as f}from"../2d/viewpointUtils.js";import V from"../2d/layers/features/support/TileStore.js";import{hitTest as v}from"../2d/support/hitTestUtils.js";import{Timeline as M}from"../2d/support/Timeline.js";let j,T,_,S;async function b(){const[,{GraphicsView2D:e,GraphicContainer:t,LabelManager:i,MapViewNavigation:s}]=await Promise.all([import("../2d/webglDeps.js"),import("../2d/mapViewDeps.js")]);j=e,T=t,_=i,S=s}let C=class extends(c(m)){constructor(e){super(e),this.stage=null,this.rootLayerViews=new i({getCollections:()=>[this.layerViews],getChildrenFunction:()=>null}),this.featuresTilingScheme=null,this.graphicsView=null,this.timeline=new M,this.goToManager=new u({view:this}),this.labelManager=null,this.animationsEnabled=!0,this.map=null,this.surface=null,this.padding={top:0,right:0,bottom:0,left:0},n()}initialize(){this.addResolvingPromise(r(()=>this.ready))}destroy(){this.layerViewManager.clear(),this._set("preconditionsReady",!1),this.frameTask=s(this.frameTask),this.goToManager.destroy(),this.rootLayerViews.destroy()}get graphicsTileStore(){return new V(this.featuresTilingScheme)}get typeSpecificPreconditionsReady(){const e=this._getDefaultViewpoint();if(!e)return!1;const t=e.targetGeometry,i=this.spatialReference;return h(t.spatialReference,i)}async hitTest(e,t){return v(this,e,t)}goTo(e,t){return this.goToManager.goTo(e,t)}toMap(e){return this.stateManager.toMap(e)}requestUpdate(){this.ready&&this.frameTask.requestUpdate()}loadAsyncDependencies(){return b()}hasLayerViewModule(e){return w.hasLayerViewModule(e)}importLayerView(e){return w.importLayerView(e)}_getDefaultViewpoint(){const{constraints:e,initialExtent:i,map:s,padding:r,size:a}=this;if(!e)return null;const o=s&&"initialViewProperties"in s?s.initialViewProperties:void 0,n=this.stateManager.getUserStartupOptions(this.size),l=o?.viewpoint,p=l?.targetGeometry?.extent??i,h=p?.center,d=l?.rotation??0,m=l?.scale||p&&f(p,[a[0]-r.left-r.right,a[1]-r.top-r.bottom]),c=n.center??h,g=n.rotation??d,u=n.scale??m;return c&&u?new t({targetGeometry:c,scale:u,rotation:g}):null}_updateStageChildren(){this.stage.removeAllChildren(),this.rootLayerViews.forEach(e=>{this.stage.addChild(e.container)});const e=this.graphicsView;this.stage.addChild(e.container)}_startup(){this.timeline.begin("VideoOperationalDataView Startup");const e=this._getDefaultViewpoint();this.stateManager.startup(e,this.size,this.spatialReference,this.defaultsFromMap.extent?.center),this.graphics.owner=this;const t=new _({view:this});this._set("labelManager",t);const i=new g({view:this});this._set("animationManager",i);const s=new S({view:this,animationManager:i});this._set("mapViewNavigation",s);const r=new y(d.create({spatialReference:this.spatialReference,size:512,numLODs:36}));this._set("featuresTilingScheme",r);const n=new j({view:this,graphics:this.graphics,requestUpdateCallback:()=>this.requestUpdate(),container:new T(r)});this._set("graphicsView",n),this.addHandles([this.rootLayerViews.on("change",()=>this._updateStageChildren()),this.stage.on("webgl-error",e=>this.fatalError=e.error),a(()=>this.stationary,e=>this.stage.stationary=e,o),a(()=>this.state.id,()=>this.stage.state=this.state,o)],"video-graphics-view"),this._updateStageChildren(),this.timeline.end("VideoOperationalDataView Startup"),this.frameTask.start(),this.stage.viewIsReady=!0,this._set("ready",!0)}_teardown(){this.removeHandles("video-graphics-view"),this.mapViewNavigation.destroy(),this._set("mapViewNavigation",null),this.animation=null,this.animationManager.destroy(),this._set("animationManager",null),this.layerViewManager.clear(),this.stage.destroy(),this.stage=null;const e=this.graphicsView;this._set("graphicsView",null),e.destroy(),this._set("featuresTilingScheme",null),this._set("mapViewNavigation",null),this.graphics.owner=null,this.frameTask.stop(),this.stationaryManager.clear(),this._set("ready",!1),this.stateManager.teardown()}};e([l()],C.prototype,"stage",void 0),e([l({readOnly:!0})],C.prototype,"featuresTilingScheme",void 0),e([l({readOnly:!0})],C.prototype,"graphicsTileStore",null),e([l()],C.prototype,"graphicsView",void 0),e([l({type:M,readOnly:!0})],C.prototype,"timeline",void 0),e([l()],C.prototype,"goToManager",void 0),e([l()],C.prototype,"labelManager",void 0),e([l()],C.prototype,"animationsEnabled",void 0),e([l()],C.prototype,"map",void 0),e([l({readOnly:!0})],C.prototype,"typeSpecificPreconditionsReady",null),e([l({readOnly:!0})],C.prototype,"surface",void 0),C=e([p("esri.views.video.VideoOperationalDataView")],C);const D=C;export{D as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{isSome as e}from"../../../core/arrayUtils.js";import t from"../../../core/Error.js";import{throwIfAborted as a}from"../../../core/promiseUtils.js";import{isTiledLayer as i,isBasemap3DSupportedLayer as r,isIntegratedMesh3DTilesLayer as n,isBasemapSupportedTiledLayer as s}from"../../../layers/support/layerUtils.js";import{stringFromViewingMode as l}from"../../../views/ViewingMode.js";import{getTileInfoAndExtentFromWMTSLayer as o,checkIfTileInfoSupportedForView as p}from"../../../views/3d/terrain/terrainUtils.js";import{TilingScheme as c}from"../../../views/3d/terrain/TilingScheme.js";import{isSpatialReferenceSupported as m}from"../../../views/support/spatialReferenceSupport.js";async function f(e,t={}){const{basemap:i,view:r}=e;await i.load(t),w(i),await h(i,r,t),a(t)}async function u(t,r={}){const{basemap:n,view:s}=t;a(r);const l=n.baseLayers.find(e=>"unknown"===e.type)?.loadError;if(null!=l)throw l;if(!s||"spatialReferenceLocked"in s&&!s.spatialReferenceLocked)return;if(await n.load(r),a(r),0===n.baseLayers.length)return;const o=n.baseLayers.at(0);if(!i(o))return;if(n.spatialReference){if(s.spatialReference.equals(n.spatialReference))return;y()}await o.load(r),a(r);const p=(("supportedSpatialReferences"in o?o.supportedSpatialReferences:null)||["tileInfo"in o?o.tileInfo?.spatialReference:null]).filter(e);0!==p.length&&p.every(e=>!s.spatialReference.equals(e))&&y()}function y(){throw new t("basemap-compatibility:incompatible-spatial-reference","Basemap spatial reference is not compatible with the view")}function w(e){if(0===e.baseLayers.length&&0===e.groundLayers.length&&0===e.referenceLayers.length)return;const t=e.baseLayers.concat(e.referenceLayers).toArray().filter(e=>!r(e)).map(e=>b(e));if(t.length)throw t[0];if(e.groundLayers){if(e.groundLayers.filter(e=>!n(e.type)).map(e=>b(e)).length)throw t[0]}}function b(e){return new t("basemap-compatibility:unsupported-basemap-layer-type","Unsupported basemap layer type ${operationalLayerType}",{layer:e,operationalLayerType:e.operationalLayerType||"unknown"})}async function h(e,a,i){let r=e.baseLayers.at(0);if(e.groundLayers?.length>0)r=e.groundLayers.at(0);else{if(!(e.baseLayers.length>0))return;r=e.baseLayers.at(0)}if(s(r)){try{await r.load(i)}catch(n){const e="basemap-compatibility:unknown-error",a="Unknown basemap compatibility error",{name:i=e,message:r=a,details:s}=n;throw new t(i,r,s)}g(r,a)}}function g(e,a){const i=a.state.viewingMode;if(!i)return;let r,n;if("wmts"===e?.type){const s=o(e,a.spatialReference,i);if(null==s.tileInfo)throw new t("basemapgalleryitem:tiling-scheme-incompatible","Basemap tiling scheme is incompatible with the view");r=s.tileInfo,n=s.fullExtent}else r=e.tileInfo,n=e.fullExtent;if(null==r)return;if(!m(r.spatialReference,i))throw new t(`basemapgalleryitem:spatial-reference-unsupported-${l(i)}`,`Basemap spatial reference is unsupported in ${l(i)} mode`);const s="vector-tile"===e?.type?r.getCompatibleForVTL(256):null;if(1===i){let a=p(r,n,null,i);if(a&&"vector-tile"===e?.type&&null!=n&&s&&!p(s,n,null,i)&&(a=null),a){const e=r.spatialReference.isWebMercator?"web-mercator":"wgs84";throw new t(`basemapgalleryitem:tiling-scheme-unsupported-${e}-global`,"Basemap tiling scheme is unsupported in global mode",{error:a})}}else if(c.checkUnsupported(r))throw new t("basemapgalleryitem:tiling-scheme-unsupported-local","Basemap tiling scheme is unsupported in local mode");const f=a.basemapTerrain?.tilingScheme;if(f&&!f.compatibleWith(r)&&("vector-tile"!==e?.type||!s||!f.compatibleWith(s)))throw new t("basemapgalleryitem:tiling-scheme-incompatible","Basemap tiling scheme is incompatible with the view")}export{u as default2DCompatibility,f as default3DCompatibility};
5
+ import{isSome as e}from"../../../core/arrayUtils.js";import t from"../../../core/Error.js";import{throwIfAborted as a}from"../../../core/promiseUtils.js";import{isTiledLayer as i,isBasemap3DSupportedLayer as r,isIntegratedMesh3DTilesLayer as n,isBasemapSupportedTiledLayer as s}from"../../../layers/support/layerUtils.js";import{stringFromViewingMode as l}from"../../../views/ViewingMode.js";import{getTileInfoAndExtentFromWMTSLayer as o,checkIfTileInfoSupportedForView as p}from"../../../views/3d/terrain/terrainUtils.js";import{TilingScheme as c}from"../../../views/3d/terrain/TilingScheme.js";import{isSpatialReferenceSupported as m}from"../../../views/support/spatialReferenceSupport.js";async function f(e,t={}){const{basemap:i,view:r}=e;await i.load(t),w(i),await h(i,r,t),a(t)}async function u(t,r={}){const{basemap:n,view:s}=t;a(r);const l=n.baseLayers.find(e=>"unknown"===e.type)?.loadError;if(null!=l)throw l;if(!s||"spatialReferenceLocked"in s&&!s.spatialReferenceLocked)return;if(await n.load(r),a(r),0===n.baseLayers.length)return;const o=n.baseLayers.at(0);if(!i(o))return;if(n.spatialReference){if(s.spatialReference.equals(n.spatialReference))return;y()}await o.load(r),a(r);const p=(("supportedSpatialReferences"in o?o.supportedSpatialReferences:null)||["tileInfo"in o?o.tileInfo?.spatialReference:null]).filter(e);0!==p.length&&p.every(e=>!s.spatialReference.equals(e))&&y()}function y(){throw new t("basemap-compatibility:incompatible-spatial-reference","Basemap spatial reference is not compatible with the view")}function w(e){if(0===e.baseLayers.length&&0===e.groundLayers.length&&0===e.referenceLayers.length)return;const t=e.baseLayers.concat(e.referenceLayers).toArray().filter(e=>!r(e)).map(e=>b(e));if(t.length)throw t[0];if(e.groundLayers){if(e.groundLayers.filter(e=>!n(e)).map(e=>b(e)).length)throw t[0]}}function b(e){return new t("basemap-compatibility:unsupported-basemap-layer-type","Unsupported basemap layer type ${operationalLayerType}",{layer:e,operationalLayerType:e.operationalLayerType||"unknown"})}async function h(e,a,i){let r=e.baseLayers.at(0);if(e.groundLayers?.length>0)r=e.groundLayers.at(0);else{if(!(e.baseLayers.length>0))return;r=e.baseLayers.at(0)}if(s(r)){try{await r.load(i)}catch(n){const e="basemap-compatibility:unknown-error",a="Unknown basemap compatibility error",{name:i=e,message:r=a,details:s}=n;throw new t(i,r,s)}g(r,a)}}function g(e,a){const i=a.state.viewingMode;if(!i)return;let r,n;if("wmts"===e?.type){const s=o(e,a.spatialReference,i);if(null==s.tileInfo)throw new t("basemapgalleryitem:tiling-scheme-incompatible","Basemap tiling scheme is incompatible with the view");r=s.tileInfo,n=s.fullExtent}else r=e.tileInfo,n=e.fullExtent;if(null==r)return;if(!m(r.spatialReference,i))throw new t(`basemapgalleryitem:spatial-reference-unsupported-${l(i)}`,`Basemap spatial reference is unsupported in ${l(i)} mode`);const s="vector-tile"===e?.type?r.getCompatibleForVTL(256):null;if(1===i){let a=p(r,n,null,i);if(a&&"vector-tile"===e?.type&&null!=n&&s&&!p(s,n,null,i)&&(a=null),a){const e=r.spatialReference.isWebMercator?"web-mercator":"wgs84";throw new t(`basemapgalleryitem:tiling-scheme-unsupported-${e}-global`,"Basemap tiling scheme is unsupported in global mode",{error:a})}}else if(c.checkUnsupported(r))throw new t("basemapgalleryitem:tiling-scheme-unsupported-local","Basemap tiling scheme is unsupported in local mode");const f=a.basemapTerrain?.tilingScheme;if(f&&!f.compatibleWith(r)&&("vector-tile"!==e?.type||!s||!f.compatibleWith(s)))throw new t("basemapgalleryitem:tiling-scheme-incompatible","Basemap tiling scheme is incompatible with the view")}export{u as default2DCompatibility,f as default3DCompatibility};
@@ -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{watch as t,initial as o}from"../../core/reactiveUtils.js";import{property as i}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{subclass as r}from"../../core/accessorSupport/decorators/subclass.js";import s from"../Widget.js";import n from"./FeatureContent.js";import d from"./FeatureFields.js";import l from"./FeatureMedia.js";import a from"./FeatureExpression/FeatureExpressionViewModel.js";import{loadCalciteComponents as p}from"../support/componentsUtils.js";import"../support/widgetUtils.js";import{tsx as c}from"../support/jsxFactory.js";import"@arcgis/toolkit/dom";const m="esri-feature",u={base:`${m}-expression`,loadingSpinnerContainer:`${m}__loading-container`};let g=class extends s{constructor(e,t){super(e,t),this._contentWidget=null,this.viewModel=new a}initialize(){this.addHandles(t(()=>this.viewModel?.contentElementViewModel,()=>this._setupExpressionWidget(),o))}loadDependencies(){return p({loader:()=>import("@esri/calcite-components/dist/components/calcite-loader")})}destroy(){this._destroyContentWidget()}render(){const{state:e}=this.viewModel;return c("div",{class:u.base},"loading"===e?this._renderLoading():"disabled"===e?null:this._contentWidget?.render())}_renderLoading(){return c("div",{class:u.loadingSpinnerContainer,key:"loading-container"},c("calcite-loader",{inline:!0,label:""}))}_destroyContentWidget(){const{_contentWidget:e}=this;e&&(e.viewModel=null,e.destroy()),this._contentWidget=null}_setupExpressionWidget(){const{contentElementViewModel:e,contentElement:t}=this.viewModel,o=t?.type;this._destroyContentWidget();const i=e?"fields"===o?new d({viewModel:e}):"media"===o?new l({viewModel:e}):"text"===o?new n({viewModel:e}):null:null;this._contentWidget=i,this.scheduleRender()}};e([i({type:a})],g.prototype,"viewModel",void 0),g=e([r("esri.widgets.Feature.FeatureExpression")],g);export{g as default};
5
+ import{__decorate as e}from"tslib";import{watch as t,initial as o}from"../../core/reactiveUtils.js";import{property as i}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{subclass as r}from"../../core/accessorSupport/decorators/subclass.js";import s from"../Widget.js";import n from"./FeatureContent.js";import d from"./FeatureFields.js";import l from"./FeatureMedia.js";import a from"./FeatureExpression/FeatureExpressionViewModel.js";import{loadCalciteComponents as p}from"../support/componentsUtils.js";import"../support/widgetUtils.js";import{tsx as c}from"../support/jsxFactory.js";import"@arcgis/toolkit/dom";const m="esri-feature",u={base:`${m}-expression`,loadingSpinnerContainer:`${m}__loading-container`};let g=class extends s{constructor(e,t){super(e,t),this._contentWidget=null,this.viewModel=new a}initialize(){this.addHandles(t(()=>this.viewModel?.contentElementViewModel,()=>this._setupExpressionWidget(),o))}loadDependencies(){return p({loader:()=>import("@esri/calcite-components/dist/components/calcite-loader")})}destroy(){this._destroyContentWidget()}render(){const{state:e}=this.viewModel;return c("div",{class:u.base},"loading"===e?this._renderLoading():"disabled"===e?null:this._contentWidget?.render())}_renderLoading(){return c("div",{class:u.loadingSpinnerContainer,key:"loading-container"},c("calcite-loader",{inline:!0,label:""}))}_destroyContentWidget(){const{_contentWidget:e}=this;e&&(e.viewModel=null,e.destroy()),this._contentWidget=null}_setupExpressionWidget(){const{contentElementViewModel:e,contentElement:t}=this.viewModel,o=t?.type;this._destroyContentWidget();const i=e?"fields"===o?new d({viewModel:e}):"media"===o?new l({viewModel:e,view:this.viewModel.view}):"text"===o?new n({viewModel:e}):null:null;this._contentWidget=i,this.scheduleRender()}};e([i({type:a})],g.prototype,"viewModel",void 0),g=e([r("esri.widgets.Feature.FeatureExpression")],g);export{g 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"../../intl.js";import{prefersReducedMotion as t}from"../../core/a11yUtils.js";import{watch as i,initial as a}from"../../core/reactiveUtils.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{getColorsFromRenderer as s}from"../../renderers/support/utils.js";import n from"../Widget.js";import l from"./FeatureMedia/FeatureMediaViewModel.js";import d from"./support/FeatureElementInfo.js";import{shouldOpenInNewTab as m}from"./support/featureUtils.js";import{loadCalciteComponents as c}from"../support/componentsUtils.js";import{isRTL as h}from"../support/widgetUtils.js";import{messageBundle as p}from"../support/decorators/messageBundle.js";import{tsx as u}from"../support/jsxFactory.js";import{isDarkMode as f}from"../../support/modeUtils.js";import{substitute as g}from"../../intl/substitute.js";const M="esri-feature-media",_={base:M,mediaContainer:`${M}__container`,mediaItemContainer:`${M}__item-container`,mediaItem:`${M}__item`,mediaItemText:`${M}__item-text`,mediaItemTitle:`${M}__item-title`,mediaItemCaption:`${M}__item-caption`,mediaNavigation:`${M}__item-navigation`,mediaPagination:`${M}__pagination`,mediaPaginationText:`${M}__pagination-text`,mediaChart:`${M}__chart`,mediaPaginationButton:`${M}__pagination-button`,mediaPaginationIcon:`${M}__pagination-icon`,mediaChartRendered:`${M}__chart--rendered`},v=15,w="category",A="value",I="rgba(50, 50, 50, 1)",C=250,y=500,x=200;let T=class extends n{constructor(e,t){super(e,t),this._refreshTimer=null,this._refreshIntervalInfo=null,this._featureElementInfo=null,this._chartRootMap=new WeakMap,this.viewModel=new l,this.messages=null,this._disposeChart=e=>{this._chartRootMap.get(e)?.dispose(),this._chartRootMap.delete(e)},this._createChart=async e=>{const{destroyed:t,viewModel:i}=this;if(t||!i||!e)return;const{createRoot:a}=await import("../support/chartUtilsAm5.js"),r=await a(e);this._chartRootMap.set(e,r),await this._renderChart({mediaInfo:i.activeMediaInfo,root:r})}}initialize(){this._featureElementInfo=new d,this.addHandles([i(()=>[this.viewModel?.activeMediaInfo,this.viewModel?.activeMediaInfoIndex],()=>this._setupMediaRefreshTimer(),a),i(()=>[this.viewModel?.description,this.viewModel?.title],()=>this._setupFeatureElementInfo(),a)])}loadDependencies(){return c({icon:()=>import("@esri/calcite-components/dist/components/calcite-icon")})}destroy(){this._clearMediaRefreshTimer(),this._featureElementInfo?.destroy()}get attributes(){return this.viewModel.attributes}set attributes(e){this.viewModel.attributes=e}get activeMediaInfoIndex(){return this.viewModel.activeMediaInfoIndex}set activeMediaInfoIndex(e){this.viewModel.activeMediaInfoIndex=e}get description(){return this.viewModel.description}set description(e){this.viewModel.description=e}get fieldInfoMap(){return this.viewModel.fieldInfoMap}set fieldInfoMap(e){this.viewModel.fieldInfoMap=e}get layer(){return this.viewModel.layer}set layer(e){this.viewModel.layer=e}get mediaInfos(){return this.viewModel.mediaInfos}set mediaInfos(e){this.viewModel.mediaInfos=e}get popupTemplate(){return this.viewModel.popupTemplate}set popupTemplate(e){this.viewModel.popupTemplate=e}get relatedInfos(){return this.viewModel.relatedInfos}set relatedInfos(e){this.viewModel.relatedInfos=e}get title(){return this.viewModel.title}set title(e){this.viewModel.title=e}render(){return u("div",{bind:this,class:_.base,onkeyup:this._handleMediaKeyup},this._featureElementInfo?.render(),this._renderMedia())}_renderMedia(){const{formattedMediaInfoCount:e,activeMediaInfoIndex:t}=this.viewModel,i=this._renderMediaText();return e?u("div",{class:_.mediaContainer,key:"media-element-container"},this._renderMediaInfo(),u("div",{class:_.mediaNavigation},i,e>1?u("div",{class:_.mediaPagination},this._renderMediaPageButton("previous"),u("span",{class:_.mediaPaginationText},g(this.messages.pageText,{index:t+1,total:e})),this._renderMediaPageButton("next")):null)):null}_renderMediaText(){const{activeMediaInfo:e}=this.viewModel;if(!e)return null;const t=e&&e.title?u("div",{class:_.mediaItemTitle,innerHTML:e.title,key:"media-title"}):null,i=e&&e.caption?u("div",{class:_.mediaItemCaption,innerHTML:e.caption,key:"media-caption"}):null;return t||i?u("div",{class:_.mediaItemText,key:"media-text"},t,i):null}_renderImageMediaInfo(e){if(!e.value)return null;const{_refreshIntervalInfo:t}=this,{activeMediaInfoIndex:i,formattedMediaInfoCount:a}=this.viewModel,{value:r,refreshInterval:o,altText:s,title:n,type:l}=e,{sourceURL:d,linkURL:c}=r,h=m(c??void 0)?"_blank":"_self",p="_blank"===h?"noreferrer":"",f=o?t:null,g=f?f.timestamp:0,M=f?f.sourceURL:d,_=u("img",{alt:s||n,key:`media-${l}-${i}-${a}-${g}`,src:M??void 0});return(c?u("a",{href:c,rel:p,target:h,title:n},_):null)??_}_renderChartMediaInfo(e){const{activeMediaInfoIndex:t,formattedMediaInfoCount:i}=this.viewModel;return u("div",{afterCreate:this._createChart,afterRemoved:this._disposeChart,bind:this,class:_.mediaChart,key:`media-${e.type}-${t}-${i}`})}_renderMediaInfoType(){const{activeMediaInfo:e}=this.viewModel;return e?"image"===e.type?this._renderImageMediaInfo(e):e.type.includes("chart")?this._renderChartMediaInfo(e):null:null}_renderMediaInfo(){const{activeMediaInfo:e}=this.viewModel;return e?u("div",{class:_.mediaItemContainer,key:"media-container"},u("div",{class:_.mediaItem,key:"media-item-container"},this._renderMediaInfoType())):null}_renderMediaPageButton(e){if(this.viewModel.formattedMediaInfoCount<2)return null;const t="previous"===e,i=t?this.messages.previous:this.messages.next,a=t?"chevron-left":"chevron-right",r=t?"media-previous":"media-next",o=t?this._previous:this._next;return u("button",{"aria-label":i,bind:this,class:_.mediaPaginationButton,key:r,onclick:o,tabIndex:0,title:i,type:"button"},u("calcite-icon",{class:_.mediaPaginationIcon,icon:a,scale:"s"}))}_setupFeatureElementInfo(){const{description:e,title:t}=this;this._featureElementInfo?.set({description:e,title:t})}_next(){this.viewModel.next()}_previous(){this.viewModel.previous()}_getRenderer(){if(!this.viewModel)return;const{isAggregate:e,layer:t}=this.viewModel;return e&&t?.featureReduction&&"renderer"in t.featureReduction?t.featureReduction.renderer:t?.renderer}async _getSeriesColors(e){const{colorAm5:t}=await import("./FeatureMedia/chartCommon.js"),i=new Map;return e.forEach(e=>{e.color&&i.set(e,t(e.color.toCss(!0)))}),i}async _getRendererColors(){const{colorAm5:e}=await import("./FeatureMedia/chartCommon.js"),t=new Map,i=this._getRenderer(),a="default";if(!i)return t;const r=await s(i);r.delete(a);return Array.from(r.values()).every(e=>1===e?.length)?(Array.from(r.keys()).forEach(i=>{const a=r.get(i)?.[0]?.toCss(!0);a&&t.set(i,e(a))}),t):t}_handleMediaKeyup(e){const{key:t}=e;"ArrowLeft"===t&&(e.stopPropagation(),this.viewModel.previous()),"ArrowRight"===t&&(e.stopPropagation(),this.viewModel.next())}_canAnimateChart(){return!!this.viewModel&&(!!this.viewModel.abilities.chartAnimation&&!t())}_getChartAnimationMS(){return this._canAnimateChart()?C:0}_getChartSeriesAnimationMS(){return this._canAnimateChart()?y:0}async _renderChart(e){const{root:t,mediaInfo:i}=e,{value:a,type:r}=i,{ResponsiveThemeAm5:o,DarkThemeAm5:s,AnimatedThemeAm5:n,ColorSetAm5:l,ThemeAm5:d,esriChartColorSet:m}=await import("./FeatureMedia/chartCommon.js"),c=d.new(t);c.rule("ColorSet").set("colors",m),c.rule("ColorSet").set("reuse",!0);const h=[o.new(t),c];f(this.container)&&h.push(s.new(t)),this._canAnimateChart()&&h.push(n.new(t)),t.setThemes(h);const p=await this._getRendererColors(),u=await this._getSeriesColors(a.series),g=l.new(t,{}),M=u.get(a.series[0]),_=M?{lineSettings:{stroke:M}}:void 0,v=a.series.map((e,t)=>{const i=u.get(e)||p.get(e.fieldName)||g.getIndex(t);return{[w]:e.tooltip,[A]:e.value,columnSettings:{fill:i,stroke:i},..._}}).filter(e=>"pie-chart"!==r||null!=e.value&&e.value>0);await("pie-chart"===r?this._createPieChart(e,v):this._createXYChart(e,v))}_getDirection(){return h(this.container)?"rtl":"ltr"}async _customizeChartTooltip(e,t="horizontal"){const{colorAm5:i}=await import("./FeatureMedia/chartCommon.js");e.setAll({pointerOrientation:t}),e.get("background")?.setAll({stroke:i(I)}),e.label.setAll({direction:this._getDirection(),oversizedBehavior:"wrap",maxWidth:x})}async _createPieChart(e,t){const{TooltipAm5:i}=await import("./FeatureMedia/chartCommon.js"),{PieChartAm5:a,PieSeriesAm5:r}=await import("./FeatureMedia/pieChart.js"),{mediaInfo:o,root:s}=e,{title:n}=o,l=5,d=o?.altText||o?.title||"",m=s.container.children.push(a.new(s,{ariaLabel:d,focusable:!0,paddingBottom:l,paddingTop:l,paddingLeft:l,paddingRight:l})),c="{category}: {valuePercentTotal.formatNumber('0.00')}%\n ({value})",h=i.new(s,{labelText:c}),p=m.series.push(r.new(s,{name:n,valueField:A,categoryField:w,tooltip:h}));p.ticks.template.set("forceHidden",!0),p.labels.template.set("forceHidden",!0),p.slices.template.states.create("active",{shiftRadius:l}),await this._customizeChartTooltip(h),p.slices.template.setAll({ariaLabel:c,focusable:!0,templateField:"columnSettings"}),p.data.setAll(t),await p.appear(this._getChartSeriesAnimationMS()),await m.appear(this._getChartAnimationMS()),m.root.dom.classList.toggle(_.mediaChartRendered,!0)}_getMinSeriesValue(e){let t=0;return e.forEach(e=>t=Math.min(e.value,t)),t}async _createColumnChart(e,t,i){const{TooltipAm5:a,ScrollbarAm5:r}=await import("./FeatureMedia/chartCommon.js"),{CategoryAxisAm5:o,AxisRendererXAm5:s,ValueAxisAm5:n,AxisRendererYAm5:l,ColumnSeriesAm5:d}=await import("./FeatureMedia/xyChart.js"),{mediaInfo:m,root:c}=t,{value:p,title:u}=m;e.setAll({wheelX:"panX",wheelY:"zoomX"});const f=e.xAxes.push(o.new(c,{renderer:s.new(c,{inversed:h(this.container)}),categoryField:w}));f.get("renderer").labels.template.setAll({forceHidden:!0});const g=e.yAxes.push(n.new(c,{renderer:l.new(c,{inside:!1}),min:this._getMinSeriesValue(p.series)}));g.get("renderer").labels.template.setAll({direction:this._getDirection()});const M="{categoryX}",_=a.new(c,{labelText:M}),I=e.series.push(d.new(c,{name:u,xAxis:f,yAxis:g,valueYField:A,categoryXField:w,tooltip:_}));await this._customizeChartTooltip(_),I.columns.template.setAll({ariaLabel:M,focusable:!0,templateField:"columnSettings"}),p.series.length>v&&e.set("scrollbarX",r.new(c,{orientation:"horizontal"})),f.data.setAll(i),I.data.setAll(i),await I.appear(this._getChartSeriesAnimationMS()),await e.appear(this._getChartAnimationMS())}async _createBarChart(e,t,i){const{TooltipAm5:a,ScrollbarAm5:r}=await import("./FeatureMedia/chartCommon.js"),{CategoryAxisAm5:o,AxisRendererXAm5:s,ValueAxisAm5:n,AxisRendererYAm5:l,ColumnSeriesAm5:d}=await import("./FeatureMedia/xyChart.js"),{mediaInfo:m,root:c}=t,{value:p,title:u}=m;e.setAll({wheelX:"panY",wheelY:"zoomY"});const f=e.yAxes.push(o.new(c,{renderer:l.new(c,{inversed:!0}),categoryField:w}));f.get("renderer").labels.template.setAll({forceHidden:!0});const g=e.xAxes.push(n.new(c,{renderer:s.new(c,{inside:!1,inversed:h(this.container)}),min:this._getMinSeriesValue(p.series)}));g.get("renderer").labels.template.setAll({direction:this._getDirection()});const M="{categoryY}",_=a.new(c,{labelText:M}),I=e.series.push(d.new(c,{name:u,xAxis:g,yAxis:f,valueXField:A,categoryYField:w,tooltip:_}));await this._customizeChartTooltip(_,"vertical"),I.columns.template.setAll({ariaLabel:M,focusable:!0,templateField:"columnSettings"}),p.series.length>v&&e.set("scrollbarY",r.new(c,{orientation:"vertical"})),f.data.setAll(i),I.data.setAll(i),await I.appear(this._getChartSeriesAnimationMS()),await e.appear(this._getChartAnimationMS())}async _createLineChart(e,t,i){const{TooltipAm5:a,ScrollbarAm5:r}=await import("./FeatureMedia/chartCommon.js"),{CategoryAxisAm5:o,AxisRendererXAm5:s,ValueAxisAm5:n,AxisRendererYAm5:l,LineSeriesAm5:d}=await import("./FeatureMedia/xyChart.js"),{root:m,mediaInfo:c}=t,{value:p,title:u}=c;e.setAll({wheelX:"panX",wheelY:"zoomX"});const f=e.xAxes.push(o.new(m,{renderer:s.new(m,{inversed:h(this.container)}),categoryField:w}));f.get("renderer").labels.template.setAll({forceHidden:!0});const g=e.yAxes.push(n.new(m,{renderer:l.new(m,{inside:!1}),min:this._getMinSeriesValue(p.series)}));g.get("renderer").labels.template.setAll({direction:this._getDirection()});const M="{categoryX}",_=i[0]?.lineSettings?.stroke,I=a.new(m,{getFillFromSprite:!_,labelText:M});_&&I.get("background")?.setAll({fill:_});const C=e.series.push(d.new(m,{name:u,xAxis:f,yAxis:g,valueYField:A,categoryXField:w,tooltip:I}));C.strokes.template.setAll({templateField:"lineSettings"}),await this._customizeChartTooltip(I,"vertical"),p.series.length>v&&e.set("scrollbarX",r.new(m,{orientation:"horizontal"})),f.data.setAll(i),C.data.setAll(i),await C.appear(this._getChartSeriesAnimationMS()),await e.appear(this._getChartAnimationMS())}async _createXYChart(e,t){const{XYChartAm5:i,XYCursorAm5:a}=await import("./FeatureMedia/xyChart.js"),{root:r,mediaInfo:o}=e,{type:s}=o,n=o?.altText||o?.title||"",l=r.container.children.push(i.new(r,{ariaLabel:n,focusable:!0,panX:!0,panY:!0}));l.set("cursor",a.new(r,{})),"column-chart"===s&&await this._createColumnChart(l,e,t),"bar-chart"===s&&await this._createBarChart(l,e,t),"line-chart"===s&&await this._createLineChart(l,e,t),l.root.dom.classList.toggle(_.mediaChartRendered,!0)}_clearMediaRefreshTimer(){const{_refreshTimer:e}=this;e&&(clearTimeout(e),this._refreshTimer=null)}_updateMediaInfoTimestamp(e){const t=Date.now();this._refreshIntervalInfo={timestamp:t,sourceURL:e&&this._getImageSource(e,t)}}_setupMediaRefreshTimer(){this._clearMediaRefreshTimer();const{activeMediaInfo:e}=this.viewModel;"image"===e?.type&&e?.refreshInterval>0&&this._setRefreshTimeout(e)}_setRefreshTimeout(e){const{refreshInterval:t,value:i}=e,a=6e4*t;this._updateMediaInfoTimestamp(i.sourceURL);const r=setInterval(()=>{this._updateMediaInfoTimestamp(i.sourceURL)},a);this._refreshTimer=r}_getImageSource(e,t){const i=e.includes("?")?"&":"?",[a,r=""]=e.split("#");return`${a}${i}timestamp=${t}${r?"#":""}${r}`}};e([r()],T.prototype,"_refreshIntervalInfo",void 0),e([r()],T.prototype,"attributes",null),e([r()],T.prototype,"activeMediaInfoIndex",null),e([r()],T.prototype,"description",null),e([r()],T.prototype,"fieldInfoMap",null),e([r()],T.prototype,"layer",null),e([r()],T.prototype,"mediaInfos",null),e([r()],T.prototype,"popupTemplate",null),e([r()],T.prototype,"relatedInfos",null),e([r()],T.prototype,"title",null),e([r({type:l})],T.prototype,"viewModel",void 0),e([r(),p("esri/widgets/Feature/t9n/Feature")],T.prototype,"messages",void 0),T=e([o("esri.widgets.Feature.FeatureMedia")],T);export{T as default};
5
+ import{__decorate as e}from"tslib";import"../../intl.js";import{prefersReducedMotion as t}from"../../core/a11yUtils.js";import{watch as i,initial as a}from"../../core/reactiveUtils.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{getColorsFromRenderer as s}from"../../renderers/support/utils.js";import n from"../Widget.js";import l from"./FeatureMedia/FeatureMediaViewModel.js";import d from"./support/FeatureElementInfo.js";import{shouldOpenInNewTab as m}from"./support/featureUtils.js";import{loadCalciteComponents as c}from"../support/componentsUtils.js";import{isRTL as p}from"../support/widgetUtils.js";import{messageBundle as h}from"../support/decorators/messageBundle.js";import{tsx as u}from"../support/jsxFactory.js";import{isDarkMode as f}from"../../support/modeUtils.js";import{substitute as g}from"../../intl/substitute.js";const M="esri-feature-media",_={base:M,mediaContainer:`${M}__container`,mediaItemContainer:`${M}__item-container`,mediaItem:`${M}__item`,mediaItemText:`${M}__item-text`,mediaItemTitle:`${M}__item-title`,mediaItemCaption:`${M}__item-caption`,mediaNavigation:`${M}__item-navigation`,mediaPagination:`${M}__pagination`,mediaPaginationText:`${M}__pagination-text`,mediaChart:`${M}__chart`,mediaPaginationButton:`${M}__pagination-button`,mediaPaginationIcon:`${M}__pagination-icon`,mediaChartRendered:`${M}__chart--rendered`},v=15,w="category",A="value",I="rgba(50, 50, 50, 1)",y=250,C=500,x=200;let T=class extends n{constructor(e,t){super(e,t),this._refreshTimer=null,this._refreshIntervalInfo=null,this._featureElementInfo=null,this._chartRootMap=new WeakMap,this.view=null,this.viewModel=new l,this.messages=null,this._disposeChart=e=>{this._chartRootMap.get(e)?.dispose(),this._chartRootMap.delete(e)},this._createChart=async e=>{const{destroyed:t,viewModel:i}=this;if(t||!i||!e)return;const{createRoot:a}=await import("../support/chartUtilsAm5.js"),r=await a(e);this._chartRootMap.set(e,r),await this._renderChart({mediaInfo:i.activeMediaInfo,root:r})}}initialize(){this._featureElementInfo=new d,this.addHandles([i(()=>[this.viewModel?.activeMediaInfo,this.viewModel?.activeMediaInfoIndex],()=>this._setupMediaRefreshTimer(),a),i(()=>[this.viewModel?.description,this.viewModel?.title],()=>this._setupFeatureElementInfo(),a)])}loadDependencies(){return c({icon:()=>import("@esri/calcite-components/dist/components/calcite-icon")})}destroy(){this._clearMediaRefreshTimer(),this._featureElementInfo?.destroy()}get attributes(){return this.viewModel.attributes}set attributes(e){this.viewModel.attributes=e}get activeMediaInfoIndex(){return this.viewModel.activeMediaInfoIndex}set activeMediaInfoIndex(e){this.viewModel.activeMediaInfoIndex=e}get description(){return this.viewModel.description}set description(e){this.viewModel.description=e}get fieldInfoMap(){return this.viewModel.fieldInfoMap}set fieldInfoMap(e){this.viewModel.fieldInfoMap=e}get layer(){return this.viewModel.layer}set layer(e){this.viewModel.layer=e}get mediaInfos(){return this.viewModel.mediaInfos}set mediaInfos(e){this.viewModel.mediaInfos=e}get popupTemplate(){return this.viewModel.popupTemplate}set popupTemplate(e){this.viewModel.popupTemplate=e}get relatedInfos(){return this.viewModel.relatedInfos}set relatedInfos(e){this.viewModel.relatedInfos=e}get title(){return this.viewModel.title}set title(e){this.viewModel.title=e}render(){return u("div",{bind:this,class:_.base,onkeyup:this._handleMediaKeyup},this._featureElementInfo?.render(),this._renderMedia())}_renderMedia(){const{formattedMediaInfoCount:e,activeMediaInfoIndex:t}=this.viewModel,i=this._renderMediaText();return e?u("div",{class:_.mediaContainer,key:"media-element-container"},this._renderMediaInfo(),u("div",{class:_.mediaNavigation},i,e>1?u("div",{class:_.mediaPagination},this._renderMediaPageButton("previous"),u("span",{class:_.mediaPaginationText},g(this.messages.pageText,{index:t+1,total:e})),this._renderMediaPageButton("next")):null)):null}_renderMediaText(){const{activeMediaInfo:e}=this.viewModel;if(!e)return null;const t=e&&e.title?u("div",{class:_.mediaItemTitle,innerHTML:e.title,key:"media-title"}):null,i=e&&e.caption?u("div",{class:_.mediaItemCaption,innerHTML:e.caption,key:"media-caption"}):null;return t||i?u("div",{class:_.mediaItemText,key:"media-text"},t,i):null}_renderImageMediaInfo(e){if(!e.value)return null;const{_refreshIntervalInfo:t}=this,{activeMediaInfoIndex:i,formattedMediaInfoCount:a}=this.viewModel,{value:r,refreshInterval:o,altText:s,title:n,type:l}=e,{sourceURL:d,linkURL:c}=r,p=m(c??void 0)?"_blank":"_self",h="_blank"===p?"noreferrer":"",f=o?t:null,g=f?f.timestamp:0,M=f?f.sourceURL:d,_=u("img",{alt:s||n,key:`media-${l}-${i}-${a}-${g}`,src:M??void 0});return(c?u("a",{href:c,rel:h,target:p,title:n},_):null)??_}_renderChartMediaInfo(e){const{activeMediaInfoIndex:t,formattedMediaInfoCount:i}=this.viewModel;return u("div",{afterCreate:this._createChart,afterRemoved:this._disposeChart,bind:this,class:_.mediaChart,key:`media-${e.type}-${t}-${i}`})}_renderMediaInfoType(){const{activeMediaInfo:e}=this.viewModel;return e?"image"===e.type?this._renderImageMediaInfo(e):e.type.includes("chart")?this._renderChartMediaInfo(e):null:null}_renderMediaInfo(){const{activeMediaInfo:e}=this.viewModel;return e?u("div",{class:_.mediaItemContainer,key:"media-container"},u("div",{class:_.mediaItem,key:"media-item-container"},this._renderMediaInfoType())):null}_renderMediaPageButton(e){if(this.viewModel.formattedMediaInfoCount<2)return null;const t="previous"===e,i=t?this.messages.previous:this.messages.next,a=t?"chevron-left":"chevron-right",r=t?"media-previous":"media-next",o=t?this._previous:this._next;return u("button",{"aria-label":i,bind:this,class:_.mediaPaginationButton,key:r,onclick:o,tabIndex:0,title:i,type:"button"},u("calcite-icon",{class:_.mediaPaginationIcon,icon:a,scale:"s"}))}_setupFeatureElementInfo(){const{description:e,title:t}=this;this._featureElementInfo?.set({description:e,title:t})}_next(){this.viewModel.next()}_previous(){this.viewModel.previous()}_getRenderer(){if(!this.viewModel)return;const{isAggregate:e,layer:t}=this.viewModel;return e&&t?.featureReduction&&"renderer"in t.featureReduction?t.featureReduction.renderer:t?.renderer}async _getSeriesColors(e){const{colorAm5:t}=await import("./FeatureMedia/chartCommon.js"),i=new Map;return e.forEach(e=>{e.color&&i.set(e,t(e.color.toCss(!0)))}),i}async _getRendererColors(){const{colorAm5:e}=await import("./FeatureMedia/chartCommon.js"),t=new Map,i=this._getRenderer(),a="default";if(!i)return t;const r=await s(i);r.delete(a);return Array.from(r.values()).every(e=>1===e?.length)?(Array.from(r.keys()).forEach(i=>{const a=r.get(i)?.[0]?.toCss(!0);a&&t.set(i,e(a))}),t):t}_handleMediaKeyup(e){const{key:t}=e;"ArrowLeft"===t&&(e.stopPropagation(),this.viewModel.previous()),"ArrowRight"===t&&(e.stopPropagation(),this.viewModel.next())}_canAnimateChart(){return!!this.viewModel&&(!!this.viewModel.abilities.chartAnimation&&!t())}_getChartAnimationMS(){return this._canAnimateChart()?y:0}_getChartSeriesAnimationMS(){return this._canAnimateChart()?C:0}async _renderChart(e){const{root:t,mediaInfo:i}=e,{value:a,type:r}=i,{ResponsiveThemeAm5:o,DarkThemeAm5:s,AnimatedThemeAm5:n,ColorSetAm5:l,ThemeAm5:d,esriChartColorSet:m}=await import("./FeatureMedia/chartCommon.js"),c=d.new(t);c.rule("ColorSet").set("colors",m),c.rule("ColorSet").set("reuse",!0);const p=[o.new(t),c];f(this.container)&&p.push(s.new(t)),this._canAnimateChart()&&p.push(n.new(t)),t.setThemes(p);const h=await this._getRendererColors(),u=await this._getSeriesColors(a.series),g=l.new(t,{}),M=u.get(a.series[0]),_=M?{lineSettings:{stroke:M}}:void 0,v=a.series.map((e,t)=>{const i=u.get(e)||h.get(e.fieldName)||g.getIndex(t);return{[w]:e.tooltip,[A]:e.value,columnSettings:{fill:i,stroke:i},..._}}).filter(e=>"pie-chart"!==r||null!=e.value&&e.value>0);await("pie-chart"===r?this._createPieChart(e,v):this._createXYChart(e,v))}_getDirection(){return p(this.container)?"rtl":"ltr"}async _customizeChartTooltip(e,t="horizontal"){const{colorAm5:i}=await import("./FeatureMedia/chartCommon.js");e.setAll({pointerOrientation:t}),e.get("background")?.setAll({stroke:i(I)}),e.label.setAll({direction:this._getDirection(),oversizedBehavior:"wrap",maxWidth:x})}async _createPieChart(e,t){const{TooltipAm5:i}=await import("./FeatureMedia/chartCommon.js"),{PieChartAm5:a,PieSeriesAm5:r}=await import("./FeatureMedia/pieChart.js"),{mediaInfo:o,root:s}=e,{title:n}=o,l=5,d=o?.altText||o?.title||"",m=s.container.children.push(a.new(s,{ariaLabel:d,focusable:!0,paddingBottom:l,paddingTop:l,paddingLeft:l,paddingRight:l})),c="{category}: {valuePercentTotal.formatNumber('0.00')}%\n ({value})",p=i.new(s,{labelText:c}),h=m.series.push(r.new(s,{name:n,valueField:A,categoryField:w,tooltip:p}));h.ticks.template.set("forceHidden",!0),h.labels.template.set("forceHidden",!0),h.slices.template.states.create("active",{shiftRadius:l}),await this._customizeChartTooltip(p),h.slices.template.setAll({ariaLabel:c,focusable:!0,templateField:"columnSettings"}),h.data.setAll(t),await h.appear(this._getChartSeriesAnimationMS()),await m.appear(this._getChartAnimationMS()),m.root.dom.classList.toggle(_.mediaChartRendered,!0)}_getMinSeriesValue(e){let t=0;return e.forEach(e=>t=Math.min(e.value,t)),t}async _createColumnChart(e,t,i){const{TooltipAm5:a,ScrollbarAm5:r}=await import("./FeatureMedia/chartCommon.js"),{CategoryAxisAm5:o,AxisRendererXAm5:s,ValueAxisAm5:n,AxisRendererYAm5:l,ColumnSeriesAm5:d}=await import("./FeatureMedia/xyChart.js"),{mediaInfo:m,root:c}=t,{value:h,title:u}=m;e.setAll({wheelX:"panX",wheelY:"zoomX"});const f=e.xAxes.push(o.new(c,{renderer:s.new(c,{inversed:p(this.container)}),categoryField:w}));f.get("renderer").labels.template.setAll({forceHidden:!0});const g=e.yAxes.push(n.new(c,{renderer:l.new(c,{inside:!1}),min:this._getMinSeriesValue(h.series)}));g.get("renderer").labels.template.setAll({direction:this._getDirection()});const M="{categoryX}",_=a.new(c,{labelText:M}),I=e.series.push(d.new(c,{name:u,xAxis:f,yAxis:g,valueYField:A,categoryXField:w,tooltip:_}));await this._customizeChartTooltip(_),I.columns.template.setAll({ariaLabel:M,focusable:!0,templateField:"columnSettings"}),h.series.length>v&&e.set("scrollbarX",r.new(c,{orientation:"horizontal"})),f.data.setAll(i),I.data.setAll(i),await I.appear(this._getChartSeriesAnimationMS()),await e.appear(this._getChartAnimationMS())}async _createBarChart(e,t,i){const{TooltipAm5:a,ScrollbarAm5:r}=await import("./FeatureMedia/chartCommon.js"),{CategoryAxisAm5:o,AxisRendererXAm5:s,ValueAxisAm5:n,AxisRendererYAm5:l,ColumnSeriesAm5:d}=await import("./FeatureMedia/xyChart.js"),{mediaInfo:m,root:c}=t,{value:h,title:u}=m;e.setAll({wheelX:"panY",wheelY:"zoomY"});const f=e.yAxes.push(o.new(c,{renderer:l.new(c,{inversed:!0}),categoryField:w}));f.get("renderer").labels.template.setAll({forceHidden:!0});const g=e.xAxes.push(n.new(c,{renderer:s.new(c,{inside:!1,inversed:p(this.container)}),min:this._getMinSeriesValue(h.series)}));g.get("renderer").labels.template.setAll({direction:this._getDirection()});const M="{categoryY}",_=a.new(c,{labelText:M}),I=e.series.push(d.new(c,{name:u,xAxis:g,yAxis:f,valueXField:A,categoryYField:w,tooltip:_}));await this._customizeChartTooltip(_,"vertical"),I.columns.template.setAll({ariaLabel:M,focusable:!0,templateField:"columnSettings"}),h.series.length>v&&e.set("scrollbarY",r.new(c,{orientation:"vertical"})),f.data.setAll(i),I.data.setAll(i),await I.appear(this._getChartSeriesAnimationMS()),await e.appear(this._getChartAnimationMS())}async _createLineChart(e,t,i){const{TooltipAm5:a,ScrollbarAm5:r}=await import("./FeatureMedia/chartCommon.js"),{CategoryAxisAm5:o,AxisRendererXAm5:s,ValueAxisAm5:n,AxisRendererYAm5:l,LineSeriesAm5:d}=await import("./FeatureMedia/xyChart.js"),{root:m,mediaInfo:c}=t,{value:h,title:u}=c;e.setAll({wheelX:"panX",wheelY:"zoomX"});const f=e.xAxes.push(o.new(m,{renderer:s.new(m,{inversed:p(this.container)}),categoryField:w}));f.get("renderer").labels.template.setAll({forceHidden:!0});const g=e.yAxes.push(n.new(m,{renderer:l.new(m,{inside:!1}),min:this._getMinSeriesValue(h.series)}));g.get("renderer").labels.template.setAll({direction:this._getDirection()});const M="{categoryX}",_=i[0]?.lineSettings?.stroke,I=a.new(m,{getFillFromSprite:!_,labelText:M});_&&I.get("background")?.setAll({fill:_});const y=e.series.push(d.new(m,{name:u,xAxis:f,yAxis:g,valueYField:A,categoryXField:w,tooltip:I}));y.strokes.template.setAll({templateField:"lineSettings"}),await this._customizeChartTooltip(I,"vertical"),h.series.length>v&&e.set("scrollbarX",r.new(m,{orientation:"horizontal"})),f.data.setAll(i),y.data.setAll(i),await y.appear(this._getChartSeriesAnimationMS()),await e.appear(this._getChartAnimationMS())}async _createXYChart(e,t){const{XYChartAm5:i,XYCursorAm5:a}=await import("./FeatureMedia/xyChart.js"),{root:r,mediaInfo:o}=e,{type:s}=o,n=o?.altText||o?.title||"",l=r.container.children.push(i.new(r,{ariaLabel:n,focusable:!0,panX:!0,panY:!0}));l.set("cursor",a.new(r,{})),"column-chart"===s&&await this._createColumnChart(l,e,t),"bar-chart"===s&&await this._createBarChart(l,e,t),"line-chart"===s&&await this._createLineChart(l,e,t),l.root.dom.classList.toggle(_.mediaChartRendered,!0)}_clearMediaRefreshTimer(){const{_refreshTimer:e}=this;e&&(clearTimeout(e),this._refreshTimer=null)}_updateMediaInfoTimestamp(e){const t=Date.now();this._refreshIntervalInfo={timestamp:t,sourceURL:e&&this._getImageSource(e,t)}}_setupMediaRefreshTimer(){this._clearMediaRefreshTimer();const{activeMediaInfo:e}=this.viewModel;"image"===e?.type&&e?.refreshInterval>0&&this._setRefreshTimeout(e)}_setRefreshTimeout(e){const{refreshInterval:t,value:i}=e,a=6e4*t;this._updateMediaInfoTimestamp(i.sourceURL);const r=setInterval(()=>{this._updateMediaInfoTimestamp(i.sourceURL)},a);this._refreshTimer=r}_getImageSource(e,t){const i=e.includes("?")?"&":"?",[a,r=""]=e.split("#");return`${a}${i}timestamp=${t}${r?"#":""}${r}`}};e([r()],T.prototype,"_refreshIntervalInfo",void 0),e([r()],T.prototype,"attributes",null),e([r()],T.prototype,"activeMediaInfoIndex",null),e([r()],T.prototype,"description",null),e([r()],T.prototype,"fieldInfoMap",null),e([r()],T.prototype,"layer",null),e([r()],T.prototype,"mediaInfos",null),e([r()],T.prototype,"popupTemplate",null),e([r()],T.prototype,"relatedInfos",null),e([r()],T.prototype,"title",null),e([r({type:l})],T.prototype,"view",void 0),e([r({type:l})],T.prototype,"viewModel",void 0),e([r(),h("esri/widgets/Feature/t9n/Feature")],T.prototype,"messages",void 0),T=e([o("esri.widgets.Feature.FeatureMedia")],T);export{T as default};