@arcgis/core 6.0.0-next.16 → 6.0.0-next.17

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 (133) hide show
  1. package/assets/esri/core/workers/RemoteClient.js +1 -1
  2. package/assets/esri/core/workers/chunks/164c8eeefa8232b2b191.js +2 -0
  3. package/assets/esri/core/workers/chunks/1967b9c96045a5802d08.js +1 -0
  4. package/assets/esri/core/workers/chunks/{261fea092ee7d27608a0.js → 20a2124cbe43e5527c40.js} +1 -1
  5. package/assets/esri/core/workers/chunks/2853606099602f73d379.js +1 -0
  6. package/assets/esri/core/workers/chunks/2981e904ab62f3ed80d0.js +2 -0
  7. package/assets/esri/core/workers/chunks/32cc59e126df8c96a0cf.js +2 -0
  8. package/assets/esri/core/workers/chunks/{36cbd614454581aaf334.js → 34e0a8a3a2beea50f4f5.js} +1 -1
  9. package/assets/esri/core/workers/chunks/{3baa4a9c52f41bfd6abb.js → 3e30b96a8c75bd5b9ae2.js} +1 -1
  10. package/assets/esri/core/workers/chunks/{c79934cd6883307203f8.js → 42753cf4965a94bc91ca.js} +1 -1
  11. package/assets/esri/core/workers/chunks/{b564ec4e03478f5659db.js → 4c240ca50f70bf30813f.js} +1 -1
  12. package/assets/esri/core/workers/chunks/{70d3055f15d8b0cf4074.js → 532e9cda8ac3601d8892.js} +1 -1
  13. package/assets/esri/core/workers/chunks/{953ba13299e7aa92c1a0.js → 564565246dae080f5e6c.js} +1 -1
  14. package/assets/esri/core/workers/chunks/{2145a512d269d64036b0.js → 58c3ae6030def2ed5f31.js} +1 -1
  15. package/assets/esri/core/workers/chunks/5a19a9c3e01d3d415188.js +1 -0
  16. package/assets/esri/core/workers/chunks/5a830bc35adbedd33783.js +1 -0
  17. package/assets/esri/core/workers/chunks/{9f06ec95bdf0d0b52b41.js → 5b91e2dffdc84c006539.js} +1 -1
  18. package/assets/esri/core/workers/chunks/{5acb422fe3cf693d9d4f.js → 603fdbbe9534c614928f.js} +1 -1
  19. package/assets/esri/core/workers/chunks/{c5a9e77977e867a75ff2.js → 60f92eb03c6e17ab4747.js} +1 -1
  20. package/assets/esri/core/workers/chunks/{67ebc5a3d46b254b725c.js → 612345f17f5eeb99ea8f.js} +1 -1
  21. package/assets/esri/core/workers/chunks/{1b077c92345ffb5916c2.js → 65c98f3449044fa4fd79.js} +1 -1
  22. package/assets/esri/core/workers/chunks/{2bd4ee083ca4ad221f8b.js → 65cb5e39c467a35621ca.js} +1 -1
  23. package/assets/esri/core/workers/chunks/67a35155b8b4d36f171e.js +1 -0
  24. package/assets/esri/core/workers/chunks/{f9c5aa0bbf23e780fecc.js → 6ad309154fe84210d23c.js} +1 -1
  25. package/assets/esri/core/workers/chunks/784d6c6949284ed6e10b.js +1 -0
  26. package/assets/esri/core/workers/chunks/{e2190361247f35b02b32.js → 7b5cd150a4d0139850be.js} +1 -1
  27. package/assets/esri/core/workers/chunks/{9b051745d24d1f43480b.js → 7d2cbc767c336d15e4d5.js} +1 -1
  28. package/assets/esri/core/workers/chunks/{590e6c70206122e4cc3c.js → 844eedda8f749972f707.js} +2 -2
  29. package/assets/esri/core/workers/chunks/9503eedfdda55fc5adab.js +1 -0
  30. package/assets/esri/core/workers/chunks/999c23da883eb11cb29e.js +1 -0
  31. package/assets/esri/core/workers/chunks/9b6929faf649e81265fb.js +1 -0
  32. package/assets/esri/core/workers/chunks/a35c69a4751d28c39907.js +1 -0
  33. package/assets/esri/core/workers/chunks/{ec8b7476eac4718eb0ac.js → a504a5e06cb89a620799.js} +1 -1
  34. package/assets/esri/core/workers/chunks/a596779eaeec7310671d.js +1 -0
  35. package/assets/esri/core/workers/chunks/{d5d0fe8e198ff5a902ee.js → a5c8f9f5be4ef5063b42.js} +1 -1
  36. package/assets/esri/core/workers/chunks/{a7bd5ba4d7d97411fd33.js → ab1660f5f8a5268c2fac.js} +1 -1
  37. package/assets/esri/core/workers/chunks/{4bbe1f28f5f16a6bef05.js → ae0563d573baf91e01f7.js} +1 -1
  38. package/assets/esri/core/workers/chunks/b686cd74975da09b9c91.js +2 -0
  39. package/assets/esri/core/workers/chunks/{aa36c3a9bbaa086e3757.js → b8fd7c3b36981261378b.js} +1 -1
  40. package/assets/esri/core/workers/chunks/bd046399e05e759e0bc2.js +1 -0
  41. package/assets/esri/core/workers/chunks/bd46a04a9ee4ea9e6ef1.js +2 -0
  42. package/assets/esri/core/workers/chunks/bfb39590c548188f5052.js +1 -0
  43. package/assets/esri/core/workers/chunks/{bf35927979fc5e7e0478.js → dd0310184fe4832755a8.js} +1 -1
  44. package/assets/esri/core/workers/chunks/dfa5f1311806473e473f.js +1 -0
  45. package/assets/esri/core/workers/chunks/{634523cc7757da9020e4.js → fb70ab267a08e24b710f.js} +1 -1
  46. package/assets/esri/core/workers/chunks/fc139f251dc0523074e7.js +1 -0
  47. package/assets/esri/themes/base/widgets/_Weather.scss +1 -0
  48. package/assets/esri/themes/dark/main.css +1 -1
  49. package/assets/esri/themes/light/main.css +1 -1
  50. package/assets/esri/themes/light/view.css +1 -1
  51. package/chunks/lerc-wasm.js +1 -1
  52. package/config.js +1 -1
  53. package/core/sql/WhereGrammar.js +2 -2
  54. package/editing/sharedTemplates/executor/builders/equallySpaced.js +1 -1
  55. package/kernel.js +1 -1
  56. package/layers/ElevationLayer.js +1 -1
  57. package/layers/GeoJSONLayer.d.ts +1 -1
  58. package/layers/effects/parser.js +3 -3
  59. package/layers/raster/datasets/ImageServerRaster.js +1 -1
  60. package/layers/raster/formats/ElevationCodec.js +2 -0
  61. package/layers/raster/formats/Lerc.js +1 -1
  62. package/layers/support/LercWorker.js +1 -1
  63. package/layers/support/TileInfo.d.ts +1 -1
  64. package/layers/support/TileInfo.js +1 -1
  65. package/layers/support/layerOriginUtils.js +1 -1
  66. package/package.json +4 -4
  67. package/popup/FeaturesModel.js +1 -1
  68. package/smartMapping/support/adapters/FeatureLayerAdapter.js +1 -1
  69. package/smartMapping/support/adapters/FeatureLayerBinningAdapter.js +1 -1
  70. package/smartMapping/support/adapters/InMemoryLayerAdapter.js +1 -1
  71. package/smartMapping/support/adapters/OGCFeatureLayerAdapter.js +1 -1
  72. package/smartMapping/support/adapters/SceneLayerAdapter.js +1 -1
  73. package/smartMapping/support/adapters/support/utils.js +1 -1
  74. package/time/TimeExtent.d.ts +1 -1
  75. package/views/3d/analysis/Dimension/LengthDimensionSubTool.js +1 -1
  76. package/views/3d/analysis/LineOfSight/LineOfSightTool.js +1 -1
  77. package/views/3d/analysis/Viewshed/ViewshedTool.js +1 -1
  78. package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementTool.js +1 -1
  79. package/views/3d/interactive/measurementTools/areaMeasurement3D/AreaMeasurement3DTool.js +1 -1
  80. package/views/3d/interactive/measurementTools/directLineMeasurement3D/DirectLineMeasurement3DTool.js +1 -1
  81. package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
  82. package/views/3d/layers/support/MediaLayerInteraction.js +1 -1
  83. package/views/3d/state/utils/navigationUtils.js +1 -1
  84. package/views/3d/webgl-engine/materials/renderers/MergedRenderer.js +1 -1
  85. package/views/View.js +1 -1
  86. package/views/analysis/ElevationProfile/ElevationProfileTool.js +1 -1
  87. package/views/interactive/snapping/SnappingManagerPool.js +1 -1
  88. package/views/interactive/snapping/allLayerSnapping.js +1 -1
  89. package/widgets/AreaMeasurement2D/AreaMeasurement2DViewModel.d.ts +2 -1
  90. package/widgets/BasemapToggle/BasemapToggleViewModel.d.ts +2 -0
  91. package/widgets/DistanceMeasurement2D/DistanceMeasurement2DViewModel.d.ts +2 -1
  92. package/widgets/ElevationProfile/components/Statistics.js +1 -1
  93. package/widgets/Expand/ExpandViewModel.d.ts +2 -0
  94. package/widgets/FeatureTable/support/FeatureStore.js +1 -1
  95. package/widgets/Fullscreen/FullscreenViewModel.d.ts +3 -1
  96. package/widgets/Home/HomeViewModel.d.ts +2 -0
  97. package/widgets/OrientedImageryViewer.js +1 -1
  98. package/widgets/Sketch/SketchViewModel.js +1 -1
  99. package/widgets/Swipe/SwipeViewModel.d.ts +2 -0
  100. package/widgets/Swipe/types.d.ts +9 -2
  101. package/widgets/TimeSlider/TimeSliderViewModel.d.ts +9 -5
  102. package/widgets/TimeSlider/types.d.ts +7 -0
  103. package/widgets/TimeSlider.d.ts +2 -3
  104. package/widgets/TimeSlider.js +1 -1
  105. package/widgets/Track/TrackViewModel.d.ts +4 -0
  106. package/widgets/Track/types.d.ts +1 -0
  107. package/widgets/support/Selector3D/selectorUtils.js +1 -1
  108. package/assets/esri/core/workers/chunks/0050916e462e3c9e0627.js +0 -1
  109. package/assets/esri/core/workers/chunks/23c43f09c4a4749516e1.js +0 -1
  110. package/assets/esri/core/workers/chunks/34cbaf844730ac2d92c2.js +0 -2
  111. package/assets/esri/core/workers/chunks/3c301a689c7853c9fa67.js +0 -2
  112. package/assets/esri/core/workers/chunks/3f946c13ad97fbed867b.js +0 -1
  113. package/assets/esri/core/workers/chunks/604f0f4150fb79ee54c8.js +0 -1
  114. package/assets/esri/core/workers/chunks/6299be5e7e26bf3c6859.js +0 -1
  115. package/assets/esri/core/workers/chunks/6a8dd8b18b0b825b0c1b.js +0 -1
  116. package/assets/esri/core/workers/chunks/745a153d0cd34faa124e.js +0 -1
  117. package/assets/esri/core/workers/chunks/7572c2bc5062e66f6330.js +0 -1
  118. package/assets/esri/core/workers/chunks/76ab353d80d786777161.js +0 -2
  119. package/assets/esri/core/workers/chunks/7b5f3c79e0605c32b267.js +0 -1
  120. package/assets/esri/core/workers/chunks/8483c50ed8f280fd74bb.js +0 -1
  121. package/assets/esri/core/workers/chunks/8cb716f110d164030309.js +0 -1
  122. package/assets/esri/core/workers/chunks/91dd65cf877c8f2e01a7.js +0 -1
  123. package/assets/esri/core/workers/chunks/b49df4ebd4be1181b0f9.js +0 -2
  124. package/assets/esri/core/workers/chunks/b557824bc1fa163d72a3.js +0 -2
  125. package/assets/esri/core/workers/chunks/d311ff96a5a2791d8cfc.js +0 -1
  126. package/assets/esri/core/workers/chunks/f9ff27cfcf0538ac5e26.js +0 -1
  127. package/assets/esri/core/workers/chunks/fc44227c1756f65b95df.js +0 -1
  128. /package/assets/esri/core/workers/chunks/{b557824bc1fa163d72a3.js.LICENSE.txt → 164c8eeefa8232b2b191.js.LICENSE.txt} +0 -0
  129. /package/assets/esri/core/workers/chunks/{b49df4ebd4be1181b0f9.js.LICENSE.txt → 2981e904ab62f3ed80d0.js.LICENSE.txt} +0 -0
  130. /package/assets/esri/core/workers/chunks/{34cbaf844730ac2d92c2.js.LICENSE.txt → 32cc59e126df8c96a0cf.js.LICENSE.txt} +0 -0
  131. /package/assets/esri/core/workers/chunks/{590e6c70206122e4cc3c.js.LICENSE.txt → 844eedda8f749972f707.js.LICENSE.txt} +0 -0
  132. /package/assets/esri/core/workers/chunks/{3c301a689c7853c9fa67.js.LICENSE.txt → b686cd74975da09b9c91.js.LICENSE.txt} +0 -0
  133. /package/assets/esri/core/workers/chunks/{76ab353d80d786777161.js.LICENSE.txt → bd46a04a9ee4ea9e6ef1.js.LICENSE.txt} +0 -0
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import t from"../../../Graphic.js";import n from"../../../core/Accessor.js";import{createTask as r}from"../../../core/asyncUtils.js";import i from"../../../core/Collection.js";import{makeHandle as a}from"../../../core/handleUtils.js";import{destroyMaybe as o}from"../../../core/maybe.js";import{ignoreAbortErrors as s,isAborted as c,throwIfAborted as l}from"../../../core/promiseUtils.js";import{pausable as u,sync as d,watch as f,syncAndInitial as p}from"../../../core/reactiveUtils.js";import{property as m,subclass as h}from"../../../core/accessorSupport/decorators.js";import{UpdatingHandles as g}from"../../../core/support/UpdatingHandles.js";import _ from"../../../layers/GraphicsLayer.js";import v from"../../../symbols/CIMSymbol.js";import y from"../../../symbols/SimpleLineSymbol.js";import b from"../../../symbols/support/ElevationInfo.js";import{ExclusiveOperationManager as x}from"../ExclusiveOperationManager.js";import{isPolyline as S,isValidInputGraphic as C,isInternalGraphic as w}from"./elevationProfileGeometryUtils.js";import{ViewEventPriorities as T}from"../../input/InputManager.js";import{isCancelEvent as E}from"../../interactive/interactiveToolUtils.js";import{makeAllLayerSnappingOptions as D}from"../../interactive/snapping/allLayerSnapping.js";import O from"../../../widgets/Sketch/SketchViewModel.js";let k=class extends n{constructor(e){super(e),this._sketchViewModels=new i,this._updatingHandles=new g,this._operationManager=new x}initialize(){let{view:e}=this;this._allLayerSnappingOptions=D(this.view,{selfEnabled:!0,excludeInternal:!0}),this._graphicsLayer=new _({listMode:`hide`,internal:!0}),this._externalGeometryChangeHandle=u(()=>this._analysis.geometry,()=>this._ensureUpdatedSketchGraphic(),d),this.addHandles([f(()=>({map:e.map,internalGraphicsLayer:this._graphicsLayer,state:this.state,geometryVisualizationVisible:this._analysis.viewOptions.geometryVisualizationVisible,visible:this.analysisViewData.visible}),({map:e,internalGraphicsLayer:t,state:n,geometryVisualizationVisible:r,visible:i})=>{j(e,t);let a=this.sketchGraphic;switch(a&&(a.visible=i),n){case`idle`:case`reshaping-disabled`:a&&!r&&(a.visible=!1),this._operationManager.stop(),this._ensureUpdatedSketchGraphic();break;case`reshaping`:s(this._startReshape());break;case`awaiting-sketch`:this.analysisViewData.interactive=!0}},p),f(()=>this._analysis.elevationInfo,e=>{this._graphicsLayer.elevationInfo=e},p),this._allLayerSnappingOptions,this._externalGeometryChangeHandle])}destroy(){this._operationManager.destroy(),this._sketchViewModels.drain(e=>o(e));let e=this._graphicsLayer;this.view.map?.remove(e),e.destroy()}get sketchGraphic(){return this._get(`sketchGraphic`)}set sketchGraphic(e){e!==this._get(`sketchGraphic`)&&(this._set(`sketchGraphic`,e),this._updateAnalysisFromSketchGraphic())}get state(){let{visible:e,interactive:t}=this.analysisViewData;if(!e)return`idle`;switch(this._operationManager.currentOperationType){case`place`:return this._sketching?`sketching`:`awaiting-sketch`;case`pick-feature`:return`picking`;default:return this._analysis.geometry?t?`reshaping`:`reshaping-disabled`:`idle`}}get updating(){return this._sketchViewModels.some(e=>e.updating)||this._updatingHandles.updating}get _sketching(){return this._sketchViewModels.some(e=>e.createGraphic===this.sketchGraphic)}get _analysis(){return this.analysisViewData.analysis}get _lineSymbol(){return A(this.view.type)}place(e){return this._operationManager.start(`place`,async t=>{let n=this._createSketchViewModel(),r=this._analysis.clone();this._ensureUpdatedSketchGraphic();let i=this.sketchGraphic,o=this._analysis.elevationInfo,l=a(()=>{this.sketchGraphic===i&&(this._graphicsLayer.elevationInfo=o)}),u=n.on(`create`,e=>{switch(e.state){case`start`:this._graphicsLayer.removeAll(),this.sketchGraphic=e.graphic,this._analysis.elevationInfo=this._graphicsLayer.elevationInfo;break;case`active`:this._updateAnalysisFromSketchGraphic();break;case`complete`:this.sketchGraphic&&(this._updateAnalysisFromSketchGraphic(),this._addSketchGraphic(this.sketchGraphic)),t.stop();break;case`cancel`:t.stop()}});t.handles.push(u,a(()=>{if(u.remove(),n.destroy(),this._sketchViewModels.remove(n),this._updateAnalysisFromSketchGraphic(),!this._analysis.valid)return this._clear(),t.reject();if(c(e)||r.equals(this._analysis))return t.reject();t.resolve({})}),l),this._graphicsLayer.elevationInfo=M,await this._updatingHandles.addPromise(s(n.create(`polyline`)))},e)}async pickFeature(e){return this._operationManager.start(`pick-feature`,async e=>{let{view:t}=this;t.closePopup();let n=null;e.handles.push(t.on(`immediate-click`,i=>{i.defer(async()=>{n?.abort(),n=r(async n=>{let{results:r}=await t.hitTest(i);l(n);let a=null;for(let e of r)if(e.type===`graphic`&&C(e.graphic)&&!w(e.graphic)){a=e.graphic;break}a&&(i.preventDefault(),i.stopPropagation(),this._externalGeometryChangeHandle.pause(),this.sketchGraphic=null,this._analysis.setGeometryFromFeature(a),this._externalGeometryChangeHandle.resume(),e.resolve({feature:a}),e.stop())}),await n.promise})},T.TOOL),t.on(`key-down`,t=>{E(t)&&(e.reject(),e.stop())},T.TOOL),t.acquireCursor(`crosshair`,`high`),a(()=>{n?.abort(),e.reject()})),t.focus()},e)}_startReshape(){let e=this._createSketchViewModel();return this._sketchViewModels.add(e),this._operationManager.start(`reshape`,async t=>{let n=()=>{let t=this._ensureUpdatedSketchGraphic();return t?this._updatingHandles.addPromise(e.update(t,{tool:`reshape`})):Promise.resolve()};if(!this._ensureUpdatedSketchGraphic())return;let r=e.on(`update`,e=>{this._updateAnalysisFromSketchGraphic(),e.state===`complete`&&(this.state===`reshaping`?s(n()):t.resolve())});t.handles.push(r,a(()=>{r.remove(),this._sketchViewModels.remove(e),e.destroy(),t.resolve()})),await n()})}_createSketchViewModel(){return new O({layer:this._graphicsLayer,view:this.view,defaultCreateOptions:{mode:`click`,hasZ:!0},updateOnGraphicClick:!1,defaultUpdateOptions:{enableMoveAllGraphics:!1,enableRotation:!1,enableScaling:!1,enableZ:!1,highlightOptions:{enabled:!1},multipleSelectionEnabled:!1,reshapeOptions:{shapeOperation:`none`},toggleToolOnClick:!1,tool:`reshape`},polylineSymbol:this._lineSymbol,activeLineSymbol:this._lineSymbol,snappingOptions:this._allLayerSnappingOptions.options})}_ensureUpdatedSketchGraphic(){let{geometry:e}=this._analysis;if(!e)return this.sketchGraphic=null,this._graphicsLayer.removeAll(),null;let n=this.sketchGraphic??=new t({symbol:this._lineSymbol,geometry:e});return n.geometry=e,this._addSketchGraphic(n),n}_addSketchGraphic(e){let{graphics:t}=this._graphicsLayer;t.includes(e)||t.add(e),t.length!==1&&t.removeMany(t.filter(t=>t!==e))}_clear(){this.sketchGraphic=null,this._analysis.clear()}_updateAnalysisFromSketchGraphic(){this._externalGeometryChangeHandle.pause();let e=this.sketchGraphic?.geometry;S(e)||(e=null);let t=this._analysis;t.geometry!==e&&(t.geometry=e),this._externalGeometryChangeHandle.resume()}};e([m({constructOnly:!0})],k.prototype,`analysisViewData`,void 0),e([m({constructOnly:!0})],k.prototype,`view`,void 0),e([m()],k.prototype,`sketchGraphic`,null),e([m({nonNullable:!0})],k.prototype,`state`,null),e([m()],k.prototype,`updating`,null),e([m()],k.prototype,`_sketching`,null),e([m()],k.prototype,`_analysis`,null),e([m()],k.prototype,`_lineSymbol`,null),k=e([h(`esri.views.analysis.ElevationProfile.ElevationProfileTool`)],k);function A(e){if(e===`2d`){let e={type:`CIMSolidStroke`,enable:!0,capStyle:`Butt`,joinStyle:`Round`,width:1.5};return new v({data:{type:`CIMSymbolReference`,symbol:{type:`CIMLineSymbol`,symbolLayers:[{...e,effects:[{type:`CIMGeometricEffectDashes`,dashTemplate:[5,4],lineDashEnding:`FullGap`,controlPointEnding:`NoConstraint`}],color:[0,0,0,255]},{...e,color:[255,255,255,255]}]}}})}return new y({color:[0,0,0,0]})}function j(e,t){t&&(t.removeFromParent(),e?.add(t))}const M=new b({mode:`on-the-ground`,offset:0});export{k as ElevationProfileTool};
2
+ import{__decorate as e}from"tslib";import t from"../../../Graphic.js";import n from"../../../core/Accessor.js";import{createTask as r}from"../../../core/asyncUtils.js";import i from"../../../core/Collection.js";import{makeHandle as a}from"../../../core/handleUtils.js";import{destroyMaybe as o}from"../../../core/maybe.js";import{ignoreAbortErrors as s,isAborted as c,throwIfAborted as l}from"../../../core/promiseUtils.js";import{pausable as u,sync as d,watch as f,syncAndInitial as p}from"../../../core/reactiveUtils.js";import{property as m,subclass as h}from"../../../core/accessorSupport/decorators.js";import{UpdatingHandles as g}from"../../../core/support/UpdatingHandles.js";import _ from"../../../layers/GraphicsLayer.js";import v from"../../../symbols/CIMSymbol.js";import y from"../../../symbols/SimpleLineSymbol.js";import b from"../../../symbols/support/ElevationInfo.js";import{ExclusiveOperationManager as x}from"../ExclusiveOperationManager.js";import{isPolyline as S,isValidInputGraphic as C,isInternalGraphic as w}from"./elevationProfileGeometryUtils.js";import{ViewEventPriorities as T}from"../../input/InputManager.js";import{isCancelEvent as E}from"../../interactive/interactiveToolUtils.js";import{makeGeometryAnalysisSnappingOptions as D}from"../../interactive/snapping/allLayerSnapping.js";import O from"../../../widgets/Sketch/SketchViewModel.js";let k=class extends n{constructor(e){super(e),this._sketchViewModels=new i,this._updatingHandles=new g,this._operationManager=new x}initialize(){let{view:e}=this;this._allLayerSnappingOptions=D(e),this._graphicsLayer=new _({listMode:`hide`,internal:!0}),this._externalGeometryChangeHandle=u(()=>this._analysis.geometry,()=>this._ensureUpdatedSketchGraphic(),d),this.addHandles([f(()=>({map:e.map,internalGraphicsLayer:this._graphicsLayer,state:this.state,geometryVisualizationVisible:this._analysis.viewOptions.geometryVisualizationVisible,visible:this.analysisViewData.visible}),({map:e,internalGraphicsLayer:t,state:n,geometryVisualizationVisible:r,visible:i})=>{j(e,t);let a=this.sketchGraphic;switch(a&&(a.visible=i),n){case`idle`:case`reshaping-disabled`:a&&!r&&(a.visible=!1),this._operationManager.stop(),this._ensureUpdatedSketchGraphic();break;case`reshaping`:s(this._startReshape());break;case`awaiting-sketch`:this.analysisViewData.interactive=!0}},p),f(()=>this._analysis.elevationInfo,e=>{this._graphicsLayer.elevationInfo=e},p),this._allLayerSnappingOptions,this._externalGeometryChangeHandle])}destroy(){this._operationManager.destroy(),this._sketchViewModels.drain(e=>o(e));let e=this._graphicsLayer;this.view.map?.remove(e),e.destroy()}get sketchGraphic(){return this._get(`sketchGraphic`)}set sketchGraphic(e){e!==this._get(`sketchGraphic`)&&(this._set(`sketchGraphic`,e),this._updateAnalysisFromSketchGraphic())}get state(){let{visible:e,interactive:t}=this.analysisViewData;if(!e)return`idle`;switch(this._operationManager.currentOperationType){case`place`:return this._sketching?`sketching`:`awaiting-sketch`;case`pick-feature`:return`picking`;default:return this._analysis.geometry?t?`reshaping`:`reshaping-disabled`:`idle`}}get updating(){return this._sketchViewModels.some(e=>e.updating)||this._updatingHandles.updating}get _sketching(){return this._sketchViewModels.some(e=>e.createGraphic===this.sketchGraphic)}get _analysis(){return this.analysisViewData.analysis}get _lineSymbol(){return A(this.view.type)}place(e){return this._operationManager.start(`place`,async t=>{let n=this._createSketchViewModel(),r=this._analysis.clone();this._ensureUpdatedSketchGraphic();let i=this.sketchGraphic,o=this._analysis.elevationInfo,l=a(()=>{this.sketchGraphic===i&&(this._graphicsLayer.elevationInfo=o)}),u=n.on(`create`,e=>{switch(e.state){case`start`:this._graphicsLayer.removeAll(),this.sketchGraphic=e.graphic,this._analysis.elevationInfo=this._graphicsLayer.elevationInfo;break;case`active`:this._updateAnalysisFromSketchGraphic();break;case`complete`:this.sketchGraphic&&(this._updateAnalysisFromSketchGraphic(),this._addSketchGraphic(this.sketchGraphic)),t.stop();break;case`cancel`:t.stop()}});t.handles.push(u,a(()=>{if(u.remove(),n.destroy(),this._sketchViewModels.remove(n),this._updateAnalysisFromSketchGraphic(),!this._analysis.valid)return this._clear(),t.reject();if(c(e)||r.equals(this._analysis))return t.reject();t.resolve({})}),l),this._graphicsLayer.elevationInfo=M,await this._updatingHandles.addPromise(s(n.create(`polyline`)))},e)}async pickFeature(e){return this._operationManager.start(`pick-feature`,async e=>{let{view:t}=this;t.closePopup();let n=null;e.handles.push(t.on(`immediate-click`,i=>{i.defer(async()=>{n?.abort(),n=r(async n=>{let{results:r}=await t.hitTest(i);l(n);let a=null;for(let e of r)if(e.type===`graphic`&&C(e.graphic)&&!w(e.graphic)){a=e.graphic;break}a&&(i.preventDefault(),i.stopPropagation(),this._externalGeometryChangeHandle.pause(),this.sketchGraphic=null,this._analysis.setGeometryFromFeature(a),this._externalGeometryChangeHandle.resume(),e.resolve({feature:a}),e.stop())}),await n.promise})},T.TOOL),t.on(`key-down`,t=>{E(t)&&(e.reject(),e.stop())},T.TOOL),t.acquireCursor(`crosshair`,`high`),a(()=>{n?.abort(),e.reject()})),t.focus()},e)}_startReshape(){let e=this._createSketchViewModel();return this._sketchViewModels.add(e),this._operationManager.start(`reshape`,async t=>{let n=()=>{let t=this._ensureUpdatedSketchGraphic();return t?this._updatingHandles.addPromise(e.update(t,{tool:`reshape`})):Promise.resolve()};if(!this._ensureUpdatedSketchGraphic())return;let r=e.on(`update`,e=>{this._updateAnalysisFromSketchGraphic(),e.state===`complete`&&(this.state===`reshaping`?s(n()):t.resolve())});t.handles.push(r,a(()=>{r.remove(),this._sketchViewModels.remove(e),e.destroy(),t.resolve()})),await n()})}_createSketchViewModel(){return new O({layer:this._graphicsLayer,view:this.view,defaultCreateOptions:{mode:`click`,hasZ:!0},updateOnGraphicClick:!1,defaultUpdateOptions:{enableMoveAllGraphics:!1,enableRotation:!1,enableScaling:!1,enableZ:!1,highlightOptions:{enabled:!1},multipleSelectionEnabled:!1,reshapeOptions:{shapeOperation:`none`},toggleToolOnClick:!1,tool:`reshape`},polylineSymbol:this._lineSymbol,activeLineSymbol:this._lineSymbol,snappingOptions:this._allLayerSnappingOptions.options})}_ensureUpdatedSketchGraphic(){let{geometry:e}=this._analysis;if(!e)return this.sketchGraphic=null,this._graphicsLayer.removeAll(),null;let n=this.sketchGraphic??=new t({symbol:this._lineSymbol,geometry:e});return n.geometry=e,this._addSketchGraphic(n),n}_addSketchGraphic(e){let{graphics:t}=this._graphicsLayer;t.includes(e)||t.add(e),t.length!==1&&t.removeMany(t.filter(t=>t!==e))}_clear(){this.sketchGraphic=null,this._analysis.clear()}_updateAnalysisFromSketchGraphic(){this._externalGeometryChangeHandle.pause();let e=this.sketchGraphic?.geometry;S(e)||(e=null);let t=this._analysis;t.geometry!==e&&(t.geometry=e),this._externalGeometryChangeHandle.resume()}};e([m({constructOnly:!0})],k.prototype,`analysisViewData`,void 0),e([m({constructOnly:!0})],k.prototype,`view`,void 0),e([m()],k.prototype,`sketchGraphic`,null),e([m({nonNullable:!0})],k.prototype,`state`,null),e([m()],k.prototype,`updating`,null),e([m()],k.prototype,`_sketching`,null),e([m()],k.prototype,`_analysis`,null),e([m()],k.prototype,`_lineSymbol`,null),k=e([h(`esri.views.analysis.ElevationProfile.ElevationProfileTool`)],k);function A(e){if(e===`2d`){let e={type:`CIMSolidStroke`,enable:!0,capStyle:`Butt`,joinStyle:`Round`,width:1.5};return new v({data:{type:`CIMSymbolReference`,symbol:{type:`CIMLineSymbol`,symbolLayers:[{...e,effects:[{type:`CIMGeometricEffectDashes`,dashTemplate:[5,4],lineDashEnding:`FullGap`,controlPointEnding:`NoConstraint`}],color:[0,0,0,255]},{...e,color:[255,255,255,255]}]}}})}return new y({color:[0,0,0,0]})}function j(e,t){t&&(t.removeFromParent(),e?.add(t))}const M=new b({mode:`on-the-ground`,offset:0});export{k as ElevationProfileTool};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{makeHandle as e}from"../../../core/handleUtils.js";import{nextTick as t}from"../../../core/nextTick.js";import{watch as n,syncAndInitial as r}from"../../../core/reactiveUtils.js";import{makeAllLayerSnappingOptions as i}from"./allLayerSnapping.js";import{SnappingManager as a}from"./SnappingManager.js";import o from"./SnappingOptions.js";const s=new Map;function c(t){if(!s.has(t)){let e=i(t,{distance:10,excludeInternal:!0}),c=new o,l=n(()=>{let n=t.options.snapping,r=e.options,i=n.featureSources;return{...r.toJSON(),...n.toJSON({origin:`service`}),featureSources:n.originOf(`featureSources`)===`defaults`?r.featureSources:i}},e=>c.set(e),r),u=new a({view:t,options:c});s.set(t,{referenceCount:0,snappingManager:u,remove:()=>{l.remove(),e.remove(),u.destroy()}})}let c=s.get(t);c.referenceCount++;let u=e(()=>l(t,c));return{snappingManager:c.snappingManager,...u}}function l(e,n){n.referenceCount--,!(n.referenceCount>0)&&t(()=>{n.referenceCount===0&&(n.remove(),s.delete(e))})}export{c as acquire};
2
+ import{makeHandle as e}from"../../../core/handleUtils.js";import{nextTick as t}from"../../../core/nextTick.js";import{makeAllLayerSnappingOptions as n,makePointPlacementSnappingOptions as r}from"./allLayerSnapping.js";import{SnappingManager as i}from"./SnappingManager.js";const a=new Map,o=new Map;function s(e){return l(e,a,r)}function c(e){return l(e,o,n)}function l(t,n,r){if(!n.has(t)){let e=r(t),a=new i({view:t,options:e.options});n.set(t,{referenceCount:0,snappingManager:a,remove:()=>{e.remove(),a.destroy()}})}let a=n.get(t);return a.referenceCount++,{snappingManager:a.snappingManager,...e(()=>u(t,n,a))}}function u(e,n,r){r.referenceCount--,!(r.referenceCount>0)&&t(()=>{r.referenceCount===0&&(r.remove(),n.delete(e))})}export{s as acquireForFeaturePlacement,c as acquireForViewOptions};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import e from"../../../core/Collection.js";import{makeHandle as t,destroyHandle as n}from"../../../core/handleUtils.js";import{mapCollection as r}from"../../../core/mapCollectionUtils.js";import{watch as i,syncAndInitial as a}from"../../../core/reactiveUtils.js";import o from"./FeatureSnappingLayerSource.js";import{defaults as s}from"./Settings.js";import c from"./SnappingOptions.js";const l=e.ofType(o);function u(e,u){let d=u?.excludeInternal?()=>e.map?.allLayers.filter(e=>!(`internal`in e)||!e.internal):()=>e.map?.allLayers,f=r(d,e=>new o({layer:e}),{recycleItems:!0,createCollection:()=>new l}),p=new c({enabled:!0,selfEnabled:u?.selfEnabled??!1,featureEnabled:!0,featureSources:f,distance:u?.distance??s.distance,touchSensitivityMultiplier:u?.touchSensitivityMultiplier??s.touchSensitivityMultiplier}),m=new c,h=i(()=>{let t=e.options.snapping;return{...p.toJSON(),...t.toJSON({origin:`service`}),featureSources:t.originOf(`featureSources`)===`defaults`?f:t.featureSources}},e=>m.set(e),a);return{...t(()=>{h.remove(),n(f).remove()}),options:m}}export{u as makeAllLayerSnappingOptions};
2
+ import e from"../../../core/Collection.js";import{makeHandle as t,destroyHandle as n}from"../../../core/handleUtils.js";import{mapCollection as r}from"../../../core/mapCollectionUtils.js";import{watch as i,syncAndInitial as a}from"../../../core/reactiveUtils.js";import o from"../options/SnappingOptions.js";import s from"./FeatureSnappingLayerSource.js";const c=e.ofType(s);function l(e){return f(e)}function u(e){return f(e,{enabled:!0})}function d(e){return f(e,{enabled:!0,selfEnabled:!1,distance:10})}function f(e,l){let u=r(()=>e.map?.allLayers.filter(e=>!(`internal`in e)||!e.internal),e=>new s({layer:e}),{recycleItems:!0,createCollection:()=>new c}),d=l?new o(l):null,f=new o,p=i(()=>{let t=e.options.snapping,n=t.featureSources;return{...d?.toJSON(),...d?t.toJSON({origin:`service`}):t.toJSON(),featureSources:t.originOf(`featureSources`)===`defaults`?u:n}},e=>f.set(e),a);return{...t(()=>{p.remove(),n(u).remove()}),options:f}}export{l as makeAllLayerSnappingOptions,u as makeGeometryAnalysisSnappingOptions,d as makePointPlacementSnappingOptions};
@@ -5,6 +5,7 @@ import type { SystemOrAreaUnit } from "../../core/units.js";
5
5
  import type { AreaMeasurement, AreaMeasurementLabel, MeasurementState } from "../types.js";
6
6
  import type { SnappingOptionsProperties } from "../../views/interactive/snapping/SnappingOptions.js";
7
7
 
8
+ /** @deprecated since 5.2. Use the [Area Measurement 2D component](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-area-measurement-2d/) directly or [AreaMeasurementAnalysis](https://developers.arcgis.com/javascript/latest/references/core/analysis/AreaMeasurementAnalysis/) instead. */
8
9
  export interface AreaMeasurement2DViewModelProperties extends Partial<Pick<AreaMeasurement2DViewModel, "view">> {
9
10
  /**
10
11
  * The [SnappingOptions](https://developers.arcgis.com/javascript/latest/references/core/views/interactive/snapping/SnappingOptions/) for sketching.
@@ -47,7 +48,7 @@ export interface AreaMeasurement2DViewModelProperties extends Partial<Pick<AreaM
47
48
  }
48
49
 
49
50
  /**
50
- * Provides the logic for the [AreaMeasurement2D](https://developers.arcgis.com/javascript/latest/references/core/widgets/AreaMeasurement2D/) widget and [component](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-area-measurement-2d/).
51
+ * Provides the logic for the [AreaMeasurement2D](https://developers.arcgis.com/javascript/latest/references/core/widgets/AreaMeasurement2D/) widget.
51
52
  *
52
53
  * @deprecated since version 5.2. Use the [Area Measurement 2D component](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-area-measurement-2d/) directly or [AreaMeasurementAnalysis](https://developers.arcgis.com/javascript/latest/references/core/analysis/AreaMeasurementAnalysis/) instead.
53
54
  * @since 4.10
@@ -3,6 +3,7 @@ import type Accessor from "../../core/Accessor.js";
3
3
  import type { BasemapProperties } from "../../Basemap.js";
4
4
  import type { MapViewOrSceneView } from "../../views/MapViewOrSceneView.js";
5
5
 
6
+ /** @deprecated since 5.2. Use the Basemap Toggle component's [`nextBasemap`](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-basemap-toggle/#nextBasemap) and [`view`](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-basemap-toggle/#view) properties instead. */
6
7
  export interface BasemapToggleViewModelProperties extends Partial<Pick<BasemapToggleViewModel, "view">> {
7
8
  /**
8
9
  * The next basemap for toggling. One of the following values may be set to this property:
@@ -13,6 +14,7 @@ export interface BasemapToggleViewModelProperties extends Partial<Pick<BasemapTo
13
14
  nextBasemap?: BasemapProperties | string | null;
14
15
  }
15
16
 
17
+ /** @deprecated since 5.2. Use the Basemap Toggle component's [`state`](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-basemap-toggle/#state) property instead. */
16
18
  export type BasemapToggleViewModelState = "ready" | "incompatible-next-basemap" | "loading" | "disabled";
17
19
 
18
20
  /**
@@ -5,6 +5,7 @@ import type { SystemOrLengthUnit } from "../../core/units.js";
5
5
  import type { LinearMeasurement, MeasurementState } from "../types.js";
6
6
  import type { SnappingOptionsProperties } from "../../views/interactive/snapping/SnappingOptions.js";
7
7
 
8
+ /** @deprecated since 5.2. Use the [Distance Measurement 2D component](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-distance-measurement-2d/) directly or [DistanceMeasurementAnalysis](https://developers.arcgis.com/javascript/latest/references/core/analysis/DistanceMeasurementAnalysis/) instead. */
8
9
  export interface DistanceMeasurement2DViewModelProperties extends Partial<Pick<DistanceMeasurement2DViewModel, "view">> {
9
10
  /**
10
11
  * The [SnappingOptions](https://developers.arcgis.com/javascript/latest/references/core/views/interactive/snapping/SnappingOptions/) for sketching.
@@ -47,7 +48,7 @@ export interface DistanceMeasurement2DViewModelProperties extends Partial<Pick<D
47
48
  }
48
49
 
49
50
  /**
50
- * Provides the logic for the [DistanceMeasurement2D](https://developers.arcgis.com/javascript/latest/references/core/widgets/DistanceMeasurement2D/) widget and [component](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-distance-measurement-2d/).
51
+ * Provides the logic for the [DistanceMeasurement2D](https://developers.arcgis.com/javascript/latest/references/core/widgets/DistanceMeasurement2D/) widget.
51
52
  *
52
53
  * @deprecated since version 5.2. Use the [Distance Measurement 2D component](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-distance-measurement-2d/) directly or [DistanceMeasurementAnalysis](https://developers.arcgis.com/javascript/latest/references/core/analysis/DistanceMeasurementAnalysis/) instead.
53
54
  * @since 4.10
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import{throttle as t}from"../../../core/throttle.js";import{formatDecimal as n,formatAngleDegrees as r}from"../../../core/unitFormatUtils.js";import{property as i,subclass as a}from"../../../core/accessorSupport/decorators.js";import o from"../../Widget.js";import{statisticsCss as s}from"../css.js";import{notAvailable as c,getConfig as l}from"../support/constants.js";import{loadCalciteComponents as u}from"../../support/componentsUtils.js";import{messageBundle as d,tsx as f}from"../../support/widget.js";let p=class extends o{constructor(e,n){super(e,n),this._updateLayout=e=>{let t=e.parentElement,n=e.style.display;t?.removeChild(e),document.body.appendChild(e),e.style.display=`block`;let r=80;for(let t of e.childNodes)t instanceof HTMLElement&&(r=Math.max(r,t.offsetWidth));document.body.removeChild(e),t?.appendChild(e),e.style.display=n,e.style.setProperty(`--max-width`,`${r}px`)},this._updateLayoutThrottled=t(this._updateLayout,100)}loadDependencies(){return u({icon:()=>import(`@esri/calcite-components/dist/components/calcite-icon`)})}initialize(){this.addHandles(this._updateLayoutThrottled)}render(){return f(`div`,{afterCreate:this._updateLayout,afterUpdate:this._updateLayoutThrottled,bind:this,class:s.base},this._renderStatistics())}_renderStatistics(){let e=this._messages?.statistics;return e?[this._renderDistanceStatistic(`maxDistance`,e.maxDistance),this._renderElevationStatistic(`elevationGain`,e.gain),this._renderElevationStatistic(`elevationLoss`,e.loss),this._renderElevationStatistic(`minElevation`,e.minElevation),this._renderElevationStatistic(`maxElevation`,e.maxElevation),this._renderElevationStatistic(`avgElevation`,e.avgElevation),this._renderSlopeStatistic(`maxPositiveSlope`,`maxNegativeSlope`,e.maxSlope),this._renderSlopeStatistic(`avgPositiveSlope`,`avgNegativeSlope`,e.avgSlope)]:[]}_renderDistanceStatistic(e,t){let r=l().formatPrecision,i=this._renderValue(e,e=>{let t=this.effectiveUnits.distance;return n(this._messagesUnits,e,t,r)});return this._renderStatistic(t,i)}_renderElevationStatistic(e,t){let r=l().formatPrecision,i=this._renderValue(e,e=>{let t=this.effectiveUnits.elevation;return n(this._messagesUnits,e,t,r)});return this._renderStatistic(t,i)}_renderSlopeStatistic(e,t,n){let i=l().formatPrecision,a=f(`div`,{class:s.slopeValue,key:`slope-up`},f(`calcite-icon`,{icon:`arrow-up`,scale:`s`}),this._renderValue(e,e=>r(e,`degrees`,`geographic`,`geographic`,i)),f(`calcite-icon`,{icon:`arrow-down`,scale:`s`}),this._renderValue(t,e=>r(e,`degrees`,`geographic`,`geographic`,i)));return this._renderStatistic(n,a)}_renderStatistic(e,t){return f(`div`,{class:s.statistic},f(`label`,{class:s.statisticLabel},e),f(`div`,{class:s.statisticValue},t))}_renderValue(e,t){let n=this.line,r=(n.progress===1?n.statistics:null)?.[e];return r==null?c:t(r)}};e([i()],p.prototype,`effectiveUnits`,void 0),e([i()],p.prototype,`line`,void 0),e([i(),d(`esri/widgets/ElevationProfile/t9n/ElevationProfile`)],p.prototype,`_messages`,void 0),e([i(),d(`esri/core/t9n/Units`)],p.prototype,`_messagesUnits`,void 0),p=e([a(`esri.widgets.ElevationProfile.components.Statistics`)],p);export{p as Statistics};
2
+ import{__decorate as e}from"tslib";import{throttle as t}from"../../../core/throttle.js";import{formatDecimal as n,formatAngleDegrees as r}from"../../../core/unitFormatUtils.js";import{property as i,subclass as a}from"../../../core/accessorSupport/decorators.js";import o from"../../Widget.js";import{statisticsCss as s}from"../css.js";import{getConfig as c,notAvailable as l}from"../support/constants.js";import{loadCalciteComponents as u}from"../../support/componentsUtils.js";import{messageBundle as d,tsx as f}from"../../support/widget.js";let p=class extends o{constructor(e,n){super(e,n),this._updateLayout=e=>{let t=e.parentElement,n=e.style.display;t?.removeChild(e),document.body.appendChild(e),e.style.display=`block`;let r=80;for(let t of e.childNodes)t instanceof HTMLElement&&(r=Math.max(r,t.offsetWidth));document.body.removeChild(e),t?.appendChild(e),e.style.display=n,e.style.setProperty(`--max-width`,`${r}px`)},this._updateLayoutThrottled=t(this._updateLayout,100)}loadDependencies(){return u({icon:()=>import(`@esri/calcite-components/dist/components/calcite-icon`)})}initialize(){this.addHandles(this._updateLayoutThrottled)}render(){return f(`div`,{afterCreate:this._updateLayout,afterUpdate:this._updateLayoutThrottled,bind:this,class:s.base},this._renderStatistics())}_renderStatistics(){let e=this._messages?.statistics;return e?[this._renderDistanceStatistic(`maxDistance`,e.maxDistance),this._renderElevationStatistic(`elevationGain`,e.gain),this._renderElevationStatistic(`elevationLoss`,e.loss),this._renderElevationStatistic(`minElevation`,e.minElevation),this._renderElevationStatistic(`maxElevation`,e.maxElevation),this._renderElevationStatistic(`avgElevation`,e.avgElevation),this._renderSlopeStatistic(`maxPositiveSlope`,`maxNegativeSlope`,e.maxSlope),this._renderSlopeStatistic(`avgPositiveSlope`,`avgNegativeSlope`,e.avgSlope)]:[]}_renderDistanceStatistic(e,t){let r=c().formatPrecision,i=this._renderValue(e,e=>{let t=this.effectiveUnits.distance;return n(this._messagesUnits,e,t,r)});return this._renderStatistic(t,i)}_renderElevationStatistic(e,t){let r=c().formatPrecision,i=this._renderValue(e,e=>{let t=this.effectiveUnits.elevation;return n(this._messagesUnits,e,t,r)});return this._renderStatistic(t,i)}_renderSlopeStatistic(e,t,n){let i=c().formatPrecision,a=f(`div`,{class:s.slopeValue,key:`slope-up`},f(`calcite-icon`,{icon:`arrow-up`,scale:`s`}),this._renderValue(e,e=>r(e,`degrees`,`geographic`,`geographic`,i)),f(`calcite-icon`,{icon:`arrow-down`,scale:`s`}),this._renderValue(t,e=>r(e,`degrees`,`geographic`,`geographic`,i)));return this._renderStatistic(n,a)}_renderStatistic(e,t){return f(`div`,{class:s.statistic},f(`label`,{class:s.statisticLabel},e),f(`div`,{class:s.statisticValue},t))}_renderValue(e,t){let n=this.line,r=(n.progress===1?n.statistics:null)?.[e];return r==null?l:t(r)}};e([i()],p.prototype,`effectiveUnits`,void 0),e([i()],p.prototype,`line`,void 0),e([i(),d(`esri/widgets/ElevationProfile/t9n/ElevationProfile`)],p.prototype,`_messages`,void 0),e([i(),d(`esri/core/t9n/Units`)],p.prototype,`_messagesUnits`,void 0),p=e([a(`esri.widgets.ElevationProfile.components.Statistics`)],p);export{p as Statistics};
@@ -1,8 +1,10 @@
1
1
  import type Accessor from "../../core/Accessor.js";
2
2
  import type { MapViewOrSceneView } from "../../views/MapViewOrSceneView.js";
3
3
 
4
+ /** @deprecated since 5.2. Use the [Expand component](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-expand/) instead. */
4
5
  export interface ExpandViewModelProperties extends Partial<Pick<ExpandViewModel, "autoCollapse" | "expanded" | "group" | "view">> {}
5
6
 
7
+ /** @deprecated since 5.2. Use the Expand component's [`state`](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-expand/#state) property instead. */
6
8
  export type ExpandViewModelState = "ready" | "disabled";
7
9
 
8
10
  /**
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import t from"../../../Graphic.js";import n from"../../../core/Accessor.js";import{equals as r,isSome as i}from"../../../core/arrayUtils.js";import{createTask as a}from"../../../core/asyncUtils.js";import o from"../../../core/Collection.js";import s from"../../../core/Error.js";import{clone as c}from"../../../core/lang.js";import l from"../../../core/Logger.js";import{getOrCreateMapValue as u}from"../../../core/MapUtils.js";import{removeMaybe as d,abortMaybe as f}from"../../../core/maybe.js";import{debounce as p,ignoreAbortErrors as m,throwIfAborted as h}from"../../../core/promiseUtils.js";import g from"../../../core/ReactiveMap.js";import{watch as _,when as v,syncAndInitial as y,sync as b}from"../../../core/reactiveUtils.js";import{property as x,subclass as S}from"../../../core/accessorSupport/decorators.js";import{isInEffectiveScaleRange as C}from"../../../geometry/support/scaleUtils.js";import{geometryTypes as w}from"../../../geometry/support/typeUtils.js";import{isFeatureLayer as T,isSubtypeGroupLayer as E,isSubtypeSublayer as D}from"../../../layers/support/layerUtils.js";import{combineTimeExtent as O}from"../../../layers/support/timeSupport.js";import k from"../../../rest/support/AttachmentQuery.js";import A from"../../../rest/support/RelationshipQuery.js";import j from"../../../time/TimeExtent.js";import M from"../../../views/SelectionManager.js";import{temporaryHighlightName as N}from"../../../views/support/HighlightDefaults.js";import{highlightsSupported as P}from"../../../views/support/layerViewUtils.js";import{isSelectableLayerWithObjectIds as F,isSelectableLayer as I}from"../../../views/support/selectionUtils.js";import{isIFeatureTableSupportedLayerWithAttachments as L,isIFeatureTableSupportedLayerWithAttachmentsEditing as R,isIFeatureTableSupportedLayerWithEditing as z,isIFeatureTableSupportedLayerWithRelationships as B,isPageIndexValid as V,findRelatedLayer as H}from"./tableUtils.js";import{ContingentValuesManager as U}from"../../support/ContingentValuesManager.js";let W=class extends n{constructor(e){super(e),this._attachmentsOperationQueue=new o,this._contingentValuesManager=new U,this._defaultOutFields=[`*`],this._editOperationQueue=new o,this.featureTitleMap=new g,this._loaded=!1,this._loadController=null,this._loadDebounced=p(()=>this._load()),this._loadError=!1,this._objectIdCache=new o,this._pendingEditsCache=new g,this._queryOperationInfos=new g,this._refreshDebounced=p(()=>this._refresh()),this._size=0,this._temporaryHighlight=null,this._temporaryHighlightAbortController=null,this.attachmentsEnabled=!1,this.autoSaveEnabled=!0,this.defaultSelectionManager=new M,this.editingEnabled=!1,this.failures=new o,this.filterByViewExtent=!1,this.filterByLayerScaleRange=!1,this.filterGeometry=null,this.highlightEnabled=!0,this.initialSize=null,this.layer=null,this.maxSize=null,this.objectIds=null,this.outFields=null,this.pageCache=new g,this.pageSize=50,this.paginationEnabled=!1,this.relationshipConfig=null,this.relatedRecordsEnabled=!1,this.returnGeometry=!1,this.returnZ=!1,this.returnM=!1,this.selectionManager=null,this.sortOrders=[],this.syncViewSelection=!1,this.temporaryHighlightId=void 0,this.timeExtent=null,this.timeZone=null,this.view=null,this.viewTimeEnabled=!1,this.where=null}initialize(){this.addHandles([_(()=>[this.effectiveTimeExtent,this.effectiveWhere,this.filterGeometry,this.layer,this.objectIds,this.outFields,this.pageSize,this.relationshipConfig,this.returnGeometry,this.returnM,this.returnZ,this.visibleAtCurrentScale],()=>this._reset()),_(()=>this.orderByFields,()=>this._clearCaches(),{equals:r}),v(()=>this.attachmentsEnabled,()=>this._reset()),v(()=>this.relatedRecordsEnabled,()=>this._reset()),_(()=>this._layerWithContingentValues,e=>{let t=this._contingentValuesManager;e&&!t.layers.includes(e)&&t.layers.add(e)}),_(()=>[this.view?.extent,this.view?.stationary,this.filterByViewExtent],([e,t,n])=>{n&&(e?t&&(this.filterGeometry=e):this.filterGeometry=null)},y),_(()=>this.maxSize,(e,t)=>{t===0&&this._reset()}),_(()=>[this.layer,this.view],()=>this.syncSelectionSources(),y),_(()=>this.highlightEnabled,e=>this.defaultSelectionManager.highlightEnabled=e,y),_(()=>this.temporaryHighlightId,e=>{this._temporaryHighlight=d(this._temporaryHighlight?.handle),this._temporaryHighlightAbortController?.abort(),this._temporaryHighlightAbortController=new AbortController;let t=this._syncTemporaryHighlight(e,this._temporaryHighlightAbortController.signal);m(this.view?.addUpdatingPromise(t)??t)},b)])}destroy(){this.layer=null,this.itemCache.destroy(),this.failures.destroy(),this.defaultSelectionManager.destroy(),this._temporaryHighlight=d(this._temporaryHighlight?.handle),this._temporaryHighlightAbortController=f(this._temporaryHighlightAbortController)}get _capabilities(){let{layer:e}=this;return e?.effectiveCapabilities??e?.capabilities}get _canSavePendingEdits(){return this.supportsEditing&&this.hasPendingEdits&&!this.hasInvalidPendingEdits}get _effectiveReturnZ(){return this.returnZ&&this.supportsZ}get _effectiveReturnM(){return this.returnM&&this.supportsM}get _layerWithAttachments(){let{layer:e}=this;return!e||!this._capabilities||!this.attachmentsEnabled||!this.supportsAttachments||!L(e)?null:e}get _layerWithAttachmentsEditing(){let{_layerWithAttachments:e}=this;return!e||!R(e)||!this.supportsEditing?null:e}get _layerWithContingentValues(){let{layer:e}=this;return T(e)||E(e)?e:null}get _layerWithEditing(){let e=this.layer;return z(e)&&this.supportsEditing?e:null}get _layerWithRelationships(){let e=this.layer;return B(e)&&this.supportsQueryRelated?e:null}get _pendingEditsAreInvalid(){let e=this._pendingEditsCache,t=this._layerWithContingentValues;if(!t)return!1;for(let n of e.keys()){let r=e.get(n),i=this._getFeatureWithPendingEdits(n,r);for(let e of r.changes.keys())if(this._contingentValuesManager.getViolationForField(t,i,e))return!0}return!1}get _relatedLayer(){return this.relationshipConfig?.relatedLayer}get _relatedLayerCapabilities(){let{_relatedLayer:e}=this;return e?.effectiveCapabilities??e?.capabilities}get _relatedLayerSupportsCacheHint(){return!!this._relatedLayerCapabilities?.queryRelated?.supportsCacheHint}get _relatedLayerSupportsQuery(){return!!this._relatedLayerCapabilities?.operations.supportsQuery}get _relatedLayerSupportsQueryRelated(){let{_relatedLayerCapabilities:e}=this;return!!e?.queryRelated?.supportsCount&&!!e?.queryRelated?.supportsPagination}get _sortedFieldNames(){return this.sortOrders.map(({fieldName:e})=>e)}get _subtypeCode(){return this.layer?.subtypeCode??null}get _subtypeField(){let{layer:e}=this;return E(e?.parent)?e.subtypeField:null}get _canUseRelatedLayer(){return!!(this._relatedLayerSupportsQuery&&this._relatedLayerSupportsQueryRelated)}get cachedPageCount(){return this.pageCache.size}get canAddRelatedFeature(){let{state:e,relationship:t,supportsAdd:n,supportsEditing:r}=this;if(e!==`loaded`||!t||!n||!r)return!1;let{cardinality:i,role:a}=t,o=this.size>0;return!(i===`one-to-one`&&o||i===`one-to-many`&&a===`origin`&&o)}get effectiveFilterByLayerScaleRange(){return!!(this.view&&this.filterByLayerScaleRange)}get effectiveOutFields(){let{layer:e,outFields:t}=this;if(!e||!t?.length)return this._defaultOutFields;let n=[];t.forEach(t=>{let r=e.fieldsIndex.normalizeFieldName(t);r&&n.push(r)});let{objectIdField:r}=e,i=e.fieldsIndex.normalizeFieldName(r)??r;return i&&!n.includes(i)&&n.unshift(i),n}get effectiveSelectionManager(){let{layer:e,view:t}=this;return e&&this.syncViewSelection&&F(e)&&t?.selectionManager?.sources.includes(e)?t.selectionManager:this.selectionManager??this.defaultSelectionManager}get effectiveSize(){let{_size:e,maxSize:t}=this;return t==null?e:Math.min(t,e)}get effectiveTimeExtent(){let{layer:e,timeExtent:t,view:n,viewTimeEnabled:r}=this;return t||!e?t??void 0:!n||!r?e.timeExtent??void 0:O({datesInUnknownTimezone:e.datesInUnknownTimezone??void 0,timeExtent:e.timeExtent,timeInfo:e.timeInfo,timeOffset:e.timeOffset,useViewTime:e.useViewTime},n.timeExtent,this._get(`effectiveTimeExtent`))??void 0}get effectiveWhere(){let{layer:e,where:t}=this;return t!=null&&t!==``?t:D(e)&&e.parent?.definitionExpression?e.parent.definitionExpression:e?.definitionExpression||`1=1`}get fieldsWithContingentValues(){return this._contingentValuesManager.getFieldsWithContingentValues(this.layer)}get hasContingentValues(){return this.fieldsWithContingentValues.size>0}get hasInvalidPendingEdits(){return this.hasPendingEdits&&this._pendingEditsAreInvalid}get hasPendingEdits(){return this.pendingEditsCount>0}get highlightableLayerView(){let e=this.layerView;return P(e)?e:null}get isQuerying(){return this._queryOperationInfos.size>0}get isSyncing(){return this.isSyncingFeatureEdits||this.isSyncingAttachmentEdits}get isSyncingAttachmentEdits(){return this._attachmentsOperationQueue.length>0}get isSyncingFeatureEdits(){return this._editOperationQueue.length>0}get itemCache(){return new o({items:[...this.pageCache.values()].flat()})}get layerView(){let{layer:e,view:t}=this;if(!e||!t)return null;let n=e.type===`sublayer`||D(e)?e.parent:e;return t.allLayerViews.find(e=>e.layer===n)}get orderByFields(){let{_sortedFieldNames:e,layer:t,sortOrders:n}=this,r=n.filter(({fieldName:t,direction:n},r)=>e.indexOf(t)===r&&n!=null).map(({fieldName:e,direction:t})=>`${e} ${t?.toUpperCase()}`);if(t&&!r.length&&!t.objectIdField&&t.fields?.length){let e=t.fields.find(e=>e.name);if(e){let n=t.fieldsIndex.normalizeFieldName(e.name);n&&r.push(`${n} ASC`)}}return r}get pageCount(){let{effectiveSize:e,pageSize:t}=this;return e===0||t===0?1:Math.ceil(e/t)}get pageIndex(){return this._get(`pageIndex`)||0}set pageIndex(e){let{pageCount:t}=this;V(e,t)&&this._set(`pageIndex`,e)}get pendingEditsCount(){let e=0;return this._pendingEditsCache.forEach(t=>e+=t.changes.size),e}get relationship(){let{relationshipConfig:e}=this;return e?.relationshipId==null?null:this.relationships?.find(t=>t.id===e.relationshipId)}get relationshipIds(){return this.relationships?.map(e=>e.id)??[]}get relationshipInfos(){let{_layerWithRelationships:e,relatedRecordsEnabled:t,relationships:n,view:r}=this,i=[];return t&&e?.loaded&&r?.map&&n?.length&&n.forEach(t=>{let n=H(e,r,t);n&&(n.load().catch(()=>{}),i.push({layer:e,relatedLayer:n,relationshipId:t.id}))}),i}get relationships(){return this._layerWithRelationships?.relationships}get size(){return this._size}get state(){let{layer:e,_loaded:t,_loadError:n}=this;return!e||e.destroyed?`disabled`:n||e.loadError?`error`:this._loadController?`loading`:e.loadStatus===`loaded`&&t?`loaded`:`ready`}get supportsAdd(){return!!this._capabilities?.operations.supportsAdd}get supportsAddAttachments(){return!!(this._layerWithAttachmentsEditing&&(this.supportsAdd||this.supportsUpdate))}get supportsAttachments(){let{_capabilities:e}=this;return!!(e?.data?.supportsAttachment&&e?.operations.supportsQueryAttachments)}get supportsCacheHint(){return!!this._capabilities?.query?.supportsCacheHint}get supportsCacheHintQueryRelated(){return!!this._capabilities?.queryRelated?.supportsCacheHint}get supportsDelete(){return!!this._capabilities?.operations.supportsDelete}get supportsEditing(){return!!this._capabilities?.operations.supportsEditing}get supportsM(){return!!this.layer?.hasM&&!!this._capabilities?.data?.supportsM}get supportsOrderBy(){return!!this._capabilities?.query?.supportsOrderBy}get supportsPagination(){return!!this._capabilities?.query?.supportsPagination}get supportsQuery(){return!!this._capabilities?.operations.supportsQuery}get supportsQueryRelated(){let{_capabilities:e}=this;return!!e?.queryRelated?.supportsCount&&!!e?.queryRelated?.supportsPagination}get supportsResizeAttachments(){let{_capabilities:e}=this;return!!(this.supportsAttachments&&e?.attachment?.supportsResize)}get supportsUpdate(){return!!this._capabilities?.operations.supportsUpdate}get supportsUpdateAttachments(){return!!(this._layerWithAttachmentsEditing&&(this.supportsAdd||this.supportsUpdate))}get supportsZ(){return!!this.layer?.hasZ&&!!this._capabilities?.data?.supportsZ}get visibleAtCurrentScale(){let{layer:e}=this;return!e||!this.effectiveFilterByLayerScaleRange?!1:C(e.effectiveScaleRange,this.view?.scale)}async addAttachment(e,t){let{_layerWithAttachmentsEditing:n}=this;if(!n||!this.supportsAddAttachments)return{};let r=await this._queueAttachmentsOperation(e,()=>n.addAttachment(this._createBaseGraphic(n,e),t));return this._ensureArrayContent(r)}addPendingEdits(e){let t=this._ensureLayerAndUpdateSupport();this.editingEnabled?(this.autoSaveEnabled&&this._logWarning(`store:pending-edit`,`Edit will be cached, but 'autoSaveEnabled' is true.`,!0),this._stashPendingEdits(t,e)):this._logWarning(`store:editing-disabled`,`Editing is disabled.`)}async deleteAttachments(e,t){let{_layerWithAttachmentsEditing:n}=this;if(!n||!this.supportsUpdateAttachments||!t.length)return[];let r=await this._queueAttachmentsOperation(e,()=>n.deleteAttachments(this._createBaseGraphic(n,e),t));return this._ensureArray(r)}async deleteRowsByObjectId(e){let{_layerWithEditing:t}=this;if(!this.supportsDelete||!t)throw new s(`store:delete-error`,`Delete is not supported.`);let n=e.map(e=>this.getItemByObjectId(e)?.feature).filter(i),r=this._queueEditOperation(()=>t.applyEdits({deleteFeatures:n}));return e.forEach(e=>{this.featureTitleMap.delete(e),this._discardPendingEdit({objectId:e})}),r}discardPendingEdits(e){if(e?.length)e.forEach(e=>this._discardPendingEdit(e));else{for(let[e,t]of this._pendingEditsCache){let n=this.getItemByObjectId(e);n&&(n.feature=t.originalFeature)}this._pendingEditsCache.clear(),this._clearOptionsAndViolations()}}itemHasInvalidPendingEdits(e,t){if(!this.hasInvalidPendingEdits)return!1;let n=this._layerWithContingentValues,r=this._pendingEditsCache.get(e);if(!n||!r)return!1;let i=this._getFeatureWithPendingEdits(e,r),a=this._contingentValuesManager;return t?!!a.getViolationForField(n,i,t):!!a.getAllViolations(n,i)}itemHasPendingEdits(e,t){let n=this._pendingEditsCache.get(e);return n?!t||n.changes.has(t):!1}async getAttachmentsByObjectId(e,t){let n=this.getItemByObjectId(e)?.attachments??[];return!n.length&&t?(await this._queryAttachments([e]))[e]??[]:n}getCachedFeaturesByPageIndex(e){return this.pageCache.get(e)}getFieldValueOptions(e){return this._contingentValuesManager.getFieldValueOptions(e)}async getFeatureTitle(e,n=!1){let{layer:r}=this,i=this.featureTitleMap.get(e),a=`${e}`;if(!r)return i||a;if(i&&!n)return i;if(!(`getFeatureTitle`in r)||!r.getFeatureTitle)return a;let o=this.getItemByObjectId(e)?.feature;o||=new t({attributes:{[r.objectIdField]:e},origin:r.graphicOrigin});let s=await r.getFeatureTitle(o,{fetchMissingFields:!0,removeHTML:!0});return s?(this.featureTitleMap.set(e,s),s):a}getItemByObjectId(e){for(let t of this.pageCache.values())for(let n of t)if(n.objectId===e)return n}getItemIndexByObjectId(e){let{pageCache:t,pageSize:n}=this,r=t.entries(),i=-1;for(let[t,a]of r)if(a.some((r,a)=>{let o=r.objectId===e;return o&&(i=t*n+a),o}),i>-1)break;return i}async load(){await m(this._loadDebounced())}async queryPage(e){let{layer:t,state:n}=this;if(!t||n!==`loaded`||!this.supportsQuery||this.size===0||this.maxSize===0)return[];let{pageIndex:r}=e;if(!V(r,this.pageCount))return[];let i=e.pageSize??this.pageSize,a=r*i,o=a+i;return await m(this._query({layer:t,start:a,num:o,pageIndex:r,pageSize:i}))??[]}async refresh(){await m(this._refreshDebounced())}reset(){this._reset()}async savePendingEdits(){let e=this._ensureLayerAndUpdateSupport();if(!this.editingEnabled){this._logWarning(`store:editing-disabled`,`Editing is disabled.`);return}if(this.autoSaveEnabled&&this._logWarning(`store:pending-edit`,`Edit will be cached, but 'autoSaveEnabled' is true.`,!0),!this._canSavePendingEdits){this._logError(`store:update-error`,`An error occurred. Unable to save pending edits.`);return}let t=[];for(let[e]of this._pendingEditsCache){let n=this.getItemByObjectId(e);n?.feature&&t.push(n.feature)}(await this._update(e,t,!0)).updateFeatureResults.find(e=>e.error)&&this.discardPendingEdits(),this._clearOptionsAndViolations()}syncSelectionSources(){let{defaultSelectionManager:e,layer:t,view:n}=this;e.view=n,e.sources.removeAll(),I(t)&&(e.sources.items=[t])}async updateAttachment(e,t,n){let{_layerWithAttachmentsEditing:r}=this;if(!r||!this.supportsUpdateAttachments)return{};let i=await this._queueAttachmentsOperation(e,()=>r.updateAttachment(this._createBaseGraphic(r,e),t,n));return this._ensureArrayContent(i)}async updateItem(e){let t=this._ensureLayerAndUpdateSupport();if(!this.editingEnabled){this._logWarning(`store:editing-disabled`,`Editing is disabled.`);return}if(this.hasContingentValues){let t=e.updates.some(e=>this.fieldsWithContingentValues.has(e.fieldName)),n=this.itemHasPendingEdits(e.objectId);if(n||t){let t=this._layerWithContingentValues,r=this.getItemByObjectId(e.objectId)?.feature?.clone();if(r){let i=this._contingentValuesManager.getAllViolations(t,r);if(e.updates.forEach(({fieldName:e,value:n})=>{let i=t.getField(e);i&&(r.attributes[i.name]=n)}),this._contingentValuesManager.validateContingencyConstraints(t,r).length||i.length||n){this._stashPendingEdits(t,[e]),this._contingentValuesManager.resetOptionsForLayer(t);return}}}}if(!this.autoSaveEnabled){this._stashPendingEdits(t,[e]);return}let{_sortedFieldNames:n}=this,r=e.updates.map(({fieldName:e})=>e),i=this._prepareEditsForUpdate([e]);!(await this._update(t,i)).updateFeatureResults.find(e=>e.error)&&r.some(e=>n.includes(e))&&this._clearCaches()}async verifyFeaturesByObjectId(e){let{layer:t,state:n}=this;if(!t||n!==`loaded`)return[];let{objectIdField:r}=t,i=await this._queryFeaturesByObjectId(e);return e.map(e=>i.some(t=>e===(t.getObjectId()??t.attributes[r])))}async _load(){let{layer:e}=this;if(this._reset(),!e)return;let t=new AbortController;this._loadController=t;try{if(await e.load(),e.parent&&E(e.parent)&&await e.parent.loadAll(),await e.when(),t.signal.aborted)return;let n=this.initialSize;if(this.initialSize=null,this.effectiveFilterByLayerScaleRange&&(this.visibleAtCurrentScale||(n=0)),await m(this._refresh(t,n)),t.signal.aborted){this._loadController=null;return}this._loaded=!0,this._loadController=null}catch(e){throw this._reset(),this._loadError=!0,this._logError(`store:load-error`,`An error occurred.`),e}}async _refresh(e,t){this._clearCaches();let n=e?.signal,r=await this._getSize(n,t),i=await this._queryAllObjectIds(n);n?.aborted||(this._size=r,this._objectIdCache.removeAll(),i?.length&&this._objectIdCache.addMany(i),this._syncPendingEdits())}async _queryAllObjectIds(e){return this.supportsPagination?void 0:await this._queryObjectIds(e)}_clearCaches(){this.pageCache.clear(),this._objectIdCache.removeAll()}_createBaseGraphic(e,n){let r=new t({attributes:{[e.objectIdField]:n}});return this._subtypeField&&this._subtypeCode!=null&&(r.attributes[this._subtypeField]=this._subtypeCode),r}_ensureArray(e){return Array.isArray(e)?e:[e]}_ensureArrayContent(e){return Array.isArray(e)?e[0]:e}_getObjectIdsForFeatures(e,t){return e.map(e=>e.getObjectId()??e.attributes[t.objectIdField])}_getObjectIdsForPage(e,t){let n=this._objectIdCache.toArray();return n.length>=e+t?n.slice(e,e+t):n.slice(e)}_logError(e,t){l.getLogger(this).error(e,t)}_logWarning(e,t,n=!1){n?l.getLogger(this).warnOnce(e,t):l.getLogger(this).warn(e,t)}_reset(){this._clearCaches(),this._pendingEditsCache.clear(),this.failures.removeAll(),this._attachmentsOperationQueue.removeAll(),this._editOperationQueue.removeAll(),this.featureTitleMap.clear(),this._loadController=f(this._loadController),this._queryOperationInfos.forEach(e=>e.controller.abort()),this._queryOperationInfos.clear(),this._temporaryHighlight=d(this._temporaryHighlight?.handle),this._temporaryHighlightAbortController=f(this._temporaryHighlightAbortController),this._loaded=!1,this._loadError=!1,this._size=0}async _getSize(e,t){return this.maxSize===0?0:t??await this._queryCount(e)}async _queryFeaturesByObjectId(e){let{layer:t}=this;if(!t||!this.supportsQuery)throw new s(`store:query-error`,`Layer does not support query operation.`);let{effectiveTimeExtent:n,effectiveWhere:r,orderByFields:i,supportsCacheHint:a,supportsOrderBy:o}=this,c=t.createQuery();return c.where=r,c.timeExtent=n,c.returnGeometry=!1,c.objectIds=e.length?e:void 0,c.outFields=[t.objectIdField],o&&(c.orderByFields=i),a&&(c.cacheHint=!0),(await t.queryFeatures(c)).features}async _syncTemporaryHighlight(e,t){let{highlightEnabled:n,highlightableLayerView:r}=this;r&&n&&e!=null&&(h(t),this._temporaryHighlight={id:e,handle:r.highlight(e,{name:N})})}_ensureLayerAndUpdateSupport(){let e=this._layerWithEditing;if(!e||!this.supportsUpdate)throw new s(`store:update-error`,`Update is not supported.`);return e}_stashPendingEdits(e,t){t.forEach(({objectId:t,updates:n})=>{let r=this.getItemByObjectId(t)?.feature;if(!r)throw new s(`store:update-error`,`Feature with provided 'objectId' not found.`);let i=r.clone(),a=u(this._pendingEditsCache,t,()=>({originalFeature:i,changes:new g}));n.forEach(({fieldName:t,value:n})=>{let i=e.getField(t);i?(a.changes.set(i.name,n),r.attributes[i.name]=n):this._logWarning(`store:pending-edit-unknown-field`,`The provided field does not belong to this layer.`)}),a.changes.size>0&&this._pendingEditsCache.set(t,a)})}_syncPendingEdits(){for(let[e,t]of this._pendingEditsCache){let n=this.getItemByObjectId(e)?.feature;if(n){let e=n.clone();for(let[e,r]of t.changes)n.attributes[e]=r;t.originalFeature=e}}}_getFeatureWithPendingEdits(e,t){let n=this.getItemByObjectId(e)?.feature;if(!n){n=t.originalFeature.clone();for(let[e,r]of t.changes)n.attributes[e]=r}return n}_discardPendingEdit({objectId:e,fieldName:t}){let n=this._pendingEditsCache.get(e);if(!n){this._logWarning(`store:pending-edit-not-found`,`Could not find a pending edit with the given information`);return}let r=this.getItemByObjectId(e);t?(r&&(r.feature.attributes[t]=n.originalFeature.attributes[t]),n.changes.delete(t),n.changes.size===0&&this._pendingEditsCache.delete(e)):(r&&(r.feature=n.originalFeature),this._pendingEditsCache.delete(e))}_clearOptionsAndViolations(){let{_layerWithContingentValues:e,_contingentValuesManager:t}=this;e&&(t.resetOptionsForLayer(e),t.resetViolationsForLayer(e))}_prepareEditsForUpdate(e){let n=[];return e.forEach(({objectId:e,updates:r})=>{let i=this.getItemByObjectId(e)?.feature;if(!i)return;let a=c(i.attributes);r.forEach(({fieldName:e,value:t})=>a[e]=t),n.push(new t({attributes:a,sourceLayer:i.sourceLayer}))}),n}_update(e,t,n=!1){let r=e.applyEdits({updateFeatures:t}).then(n=>{let{updateFeatureResults:r}=n,i=r.find(e=>!!e.error);if(i)throw i.error;return t.forEach(t=>{let n=t.getObjectId()??t.attributes[e.objectIdField],r=this.getItemByObjectId(n)?.feature;r&&(r.attributes=t.attributes),this.featureTitleMap.has(n)&&this.getFeatureTitle(n,!0)}),n});return this._queueEditOperation(()=>r,n)}_createFeatureStoreItems(e){let{attachments:t,features:n,layer:r,relatedRecords:i}=e,a=r.objectIdField;return n.map(e=>{let n=e.getObjectId()??e.attributes[a],o=[];!e.layer&&!e.sourceLayer&&(e.layer=r,e.sourceLayer=r);let s=this._pendingEditsCache.get(n);if(s){let t=e.clone(),n=s.changes;for(let[t,r]of n)e.attributes[t]=r;s.originalFeature=t}return i.forEach((e,t)=>{o.push({relationshipId:t,count:e[n]??0})}),{objectId:n,feature:e,attachments:t[n]??null,relatedRecords:o}})}async _query(e){let{pageIndex:t,refresh:n}=e;n===!0&&await this._refresh();let r=this.pageCache.get(t);if(r)return r;let i=this._queryOperationInfos.get(t);if(i)return i.task.promise;let a=new AbortController,o=await this._queryPage(e,a);return a.signal.aborted||this.pageCache.set(t,o),o}_queryAttachments(e,t){let{_layerWithAttachments:n,effectiveWhere:r}=this;return n?e.some(e=>typeof e!=`number`)?Promise.reject(new s(`invalid-object-id`,`Only numeric object ids are valid to query attachments`)):n.queryAttachments(new k({objectIds:e,where:r,returnMetadata:!0}),{signal:t}):Promise.resolve({})}async _queryCount(e){let{_relatedLayerSupportsCacheHint:t,layer:n,relationshipConfig:r,supportsCacheHint:i}=this;if(!n)return 0;if(r&&this._canUseRelatedLayer){let{objectId:n,relatedLayer:i,relationshipId:a}=r;return(await i.queryRelatedFeaturesCount(new A({cacheHint:t,relationshipId:a,objectIds:[n]}),{signal:e}))[n]??0}let{effectiveTimeExtent:a,effectiveWhere:o,filterGeometry:s,objectIds:c}=this,l=n.createQuery();return l.geometry=s,l.returnGeometry=!1,l.where=o,l.timeExtent=a,l.objectIds=c?.length?c:void 0,i&&(l.cacheHint=!0),n.queryFeatureCount(l,{signal:e})}async _queryFeatures(e,t){let{relationshipConfig:n}=this;if(n&&this._canUseRelatedLayer)return this._queryRelatedFeatures(e,n);let{_effectiveReturnM:r,_effectiveReturnZ:i,effectiveOutFields:a,effectiveTimeExtent:o,effectiveWhere:s,filterGeometry:c,objectIds:l,orderByFields:u,pageSize:d,returnGeometry:f,supportsCacheHint:p,supportsOrderBy:m,supportsPagination:h}=this,{layer:g,start:_}=e,v=l?.length,y=g.createQuery();return y.returnGeometry=f,y.outFields=a,y.returnM=r,y.returnZ=i,h?(y.start=_,y.num=d,y.where=s,y.timeExtent=o,y.objectIds=v?l:void 0):y.objectIds=v?l:this._getObjectIdsForPage(_,d??0),m&&(y.orderByFields=u),c&&(y.geometry=c),p&&(y.cacheHint=!0),(await g.queryFeatures(y,{signal:t})).features}_queryObjectIds(e){let{effectiveTimeExtent:t,effectiveWhere:n,filterGeometry:r,layer:i,objectIds:a,orderByFields:o,supportsCacheHint:s,supportsOrderBy:c}=this;if(!i)return Promise.resolve([]);let l=i.createQuery();return l.geometry=r,l.outFields=[i.objectIdField],l.returnGeometry=!1,l.where=n,l.timeExtent=t,l.objectIds=a?.length?a:void 0,c&&(l.orderByFields=o),s&&(l.cacheHint=!0),i.queryObjectIds(l,{signal:e})}async _queryPage(e,t){return this._queueQueryOperation(e.pageIndex,{controller:t,task:a(async()=>this._queryPageData(e,t))})}async _queryPageData(e,t){let{layer:n}=e,{signal:r}=t,i=await this._queryFeatures(e,r);if(r.aborted)return[];let a=this._getObjectIdsForFeatures(i,n),[o,s]=await Promise.all([this._queryAttachments(a,r),this._queryRelatedCounts(a,r)]);return t.signal.aborted?[]:this._createFeatureStoreItems({layer:n,features:i,attachments:o,relatedRecords:s})||[]}async _queryRelatedCounts(e,t){let{_layerWithRelationships:n,relationshipIds:r,supportsCacheHintQueryRelated:i}=this,a=new Map;return n&&e?.length&&r.length&&await Promise.allSettled(r.map(async r=>{let o=await n.queryRelatedFeaturesCount(new A({cacheHint:i,relationshipId:r,objectIds:e}),{signal:t});a.set(r,o)})),a}async _queryRelatedFeatures(e,t){let{_defaultOutFields:n,_effectiveReturnM:r,_effectiveReturnZ:i,orderByFields:a,pageSize:o,returnGeometry:s,supportsCacheHint:c}=this,{layer:l,start:u}=e,{objectId:d,relatedLayer:f,relationshipId:p}=t,m=l.createQuery(),h=new A({cacheHint:c,num:o,objectIds:[d],orderByFields:a,outFields:n,relationshipId:p,returnGeometry:s,returnM:r,returnZ:i,start:u,where:m.where??void 0});return(await f.queryRelatedFeatures(h))[d]?.features||[]}_queueAttachmentsOperation(e,t){return this._attachmentsOperationQueue.push(t),t().then(async n=>{this._attachmentsOperationQueue.remove(t);let r=this._ensureArray(n),i=r.some(e=>e.error),a=this.getItemByObjectId(e);return a&&(!i||r.length>1)&&(a.attachments=(await this._queryAttachments([e]))[e]),n}).catch(async n=>{this._logError(`store:attachment-error`,`An error occurred.`);let r={error:n,retry:()=>{this.failures.remove(r),this._queueAttachmentsOperation(e,t)},cancel:()=>this.failures.remove(r)};throw this.failures.add(r),this._attachmentsOperationQueue.remove(t),n})}_queueEditOperation(e,t=!1){return this._editOperationQueue.push(e),e().then(n=>(this._editOperationQueue.remove(e),t&&this._pendingEditsCache.clear(),n)).catch(t=>{this._logError(`store:edit-error`,`An error occurred.`);let n={error:t,retry:()=>{this.failures.remove(n),this._queueEditOperation(e)},cancel:()=>this.failures.remove(n)};throw this.failures.add(n),this._editOperationQueue.remove(e),t})}async _queueQueryOperation(e,t){this._queryOperationInfos.set(e,t);let n=await t.task.promise;return this._queryOperationInfos.delete(e),n}};e([x()],W.prototype,`_attachmentsOperationQueue`,void 0),e([x({readOnly:!0})],W.prototype,`_capabilities`,null),e([x()],W.prototype,`_canSavePendingEdits`,null),e([x()],W.prototype,`_contingentValuesManager`,void 0),e([x()],W.prototype,`_defaultOutFields`,void 0),e([x()],W.prototype,`_editOperationQueue`,void 0),e([x()],W.prototype,`_effectiveReturnZ`,null),e([x()],W.prototype,`_effectiveReturnM`,null),e([x()],W.prototype,`featureTitleMap`,void 0),e([x({readOnly:!0})],W.prototype,`_layerWithAttachments`,null),e([x({readOnly:!0})],W.prototype,`_layerWithAttachmentsEditing`,null),e([x()],W.prototype,`_layerWithContingentValues`,null),e([x({readOnly:!0})],W.prototype,`_layerWithEditing`,null),e([x({readOnly:!0})],W.prototype,`_layerWithRelationships`,null),e([x()],W.prototype,`_loaded`,void 0),e([x()],W.prototype,`_loadController`,void 0),e([x()],W.prototype,`_loadError`,void 0),e([x()],W.prototype,`_objectIdCache`,void 0),e([x()],W.prototype,`_pendingEditsCache`,void 0),e([x()],W.prototype,`_pendingEditsAreInvalid`,null),e([x()],W.prototype,`_queryOperationInfos`,void 0),e([x({readOnly:!0})],W.prototype,`_relatedLayer`,null),e([x({readOnly:!0})],W.prototype,`_relatedLayerCapabilities`,null),e([x({readOnly:!0})],W.prototype,`_relatedLayerSupportsCacheHint`,null),e([x()],W.prototype,`_relatedLayerSupportsQuery`,null),e([x()],W.prototype,`_relatedLayerSupportsQueryRelated`,null),e([x()],W.prototype,`_size`,void 0),e([x()],W.prototype,`_sortedFieldNames`,null),e([x()],W.prototype,`_subtypeCode`,null),e([x()],W.prototype,`_subtypeField`,null),e([x()],W.prototype,`_canUseRelatedLayer`,null),e([x()],W.prototype,`attachmentsEnabled`,void 0),e([x()],W.prototype,`autoSaveEnabled`,void 0),e([x()],W.prototype,`cachedPageCount`,null),e([x()],W.prototype,`canAddRelatedFeature`,null),e([x()],W.prototype,`defaultSelectionManager`,void 0),e([x()],W.prototype,`editingEnabled`,void 0),e([x()],W.prototype,`effectiveFilterByLayerScaleRange`,null),e([x()],W.prototype,`effectiveOutFields`,null),e([x()],W.prototype,`effectiveSelectionManager`,null),e([x()],W.prototype,`effectiveSize`,null),e([x()],W.prototype,`effectiveTimeExtent`,null),e([x()],W.prototype,`effectiveWhere`,null),e([x({readOnly:!0})],W.prototype,`failures`,void 0),e([x()],W.prototype,`fieldsWithContingentValues`,null),e([x()],W.prototype,`filterByViewExtent`,void 0),e([x()],W.prototype,`filterByLayerScaleRange`,void 0),e([x({types:w})],W.prototype,`filterGeometry`,void 0),e([x()],W.prototype,`hasContingentValues`,null),e([x()],W.prototype,`hasInvalidPendingEdits`,null),e([x()],W.prototype,`hasPendingEdits`,null),e([x()],W.prototype,`highlightEnabled`,void 0),e([x()],W.prototype,`highlightableLayerView`,null),e([x()],W.prototype,`initialSize`,void 0),e([x({readOnly:!0})],W.prototype,`isQuerying`,null),e([x({readOnly:!0})],W.prototype,`isSyncing`,null),e([x({readOnly:!0})],W.prototype,`isSyncingAttachmentEdits`,null),e([x({readOnly:!0})],W.prototype,`isSyncingFeatureEdits`,null),e([x({readOnly:!0})],W.prototype,`itemCache`,null),e([x()],W.prototype,`layer`,void 0),e([x()],W.prototype,`layerView`,null),e([x()],W.prototype,`maxSize`,void 0),e([x()],W.prototype,`objectIds`,void 0),e([x()],W.prototype,`orderByFields`,null),e([x()],W.prototype,`outFields`,void 0),e([x({readOnly:!0})],W.prototype,`pageCache`,void 0),e([x()],W.prototype,`pageCount`,null),e([x()],W.prototype,`pageIndex`,null),e([x()],W.prototype,`pageSize`,void 0),e([x()],W.prototype,`paginationEnabled`,void 0),e([x()],W.prototype,`pendingEditsCount`,null),e([x()],W.prototype,`relationship`,null),e([x()],W.prototype,`relationshipConfig`,void 0),e([x()],W.prototype,`relationshipIds`,null),e([x()],W.prototype,`relationshipInfos`,null),e([x()],W.prototype,`relationships`,null),e([x()],W.prototype,`relatedRecordsEnabled`,void 0),e([x()],W.prototype,`returnGeometry`,void 0),e([x()],W.prototype,`returnZ`,void 0),e([x()],W.prototype,`returnM`,void 0),e([x()],W.prototype,`selectionManager`,void 0),e([x({readOnly:!0})],W.prototype,`size`,null),e([x()],W.prototype,`sortOrders`,void 0),e([x({readOnly:!0})],W.prototype,`state`,null),e([x()],W.prototype,`supportsAdd`,null),e([x()],W.prototype,`supportsAddAttachments`,null),e([x()],W.prototype,`supportsAttachments`,null),e([x()],W.prototype,`supportsCacheHint`,null),e([x()],W.prototype,`supportsCacheHintQueryRelated`,null),e([x()],W.prototype,`supportsDelete`,null),e([x()],W.prototype,`supportsEditing`,null),e([x()],W.prototype,`supportsM`,null),e([x()],W.prototype,`supportsOrderBy`,null),e([x()],W.prototype,`supportsPagination`,null),e([x()],W.prototype,`supportsQuery`,null),e([x()],W.prototype,`supportsQueryRelated`,null),e([x()],W.prototype,`supportsResizeAttachments`,null),e([x()],W.prototype,`supportsUpdate`,null),e([x()],W.prototype,`supportsUpdateAttachments`,null),e([x()],W.prototype,`supportsZ`,null),e([x()],W.prototype,`syncViewSelection`,void 0),e([x()],W.prototype,`temporaryHighlightId`,void 0),e([x({type:j})],W.prototype,`timeExtent`,void 0),e([x()],W.prototype,`timeZone`,void 0),e([x()],W.prototype,`view`,void 0),e([x()],W.prototype,`viewTimeEnabled`,void 0),e([x()],W.prototype,`visibleAtCurrentScale`,null),e([x()],W.prototype,`where`,void 0),W=e([S(`esri.widgets.FeatureTable.support.FeatureStore`)],W);const G=W;export{G as default};
2
+ import{__decorate as e}from"tslib";import t from"../../../Graphic.js";import n from"../../../core/Accessor.js";import{equals as r,isSome as i}from"../../../core/arrayUtils.js";import{createTask as a}from"../../../core/asyncUtils.js";import o from"../../../core/Collection.js";import s from"../../../core/Error.js";import{clone as c}from"../../../core/lang.js";import l from"../../../core/Logger.js";import{getOrCreateMapValue as u}from"../../../core/MapUtils.js";import{removeMaybe as d,abortMaybe as f}from"../../../core/maybe.js";import{debounce as p,ignoreAbortErrors as m,throwIfAborted as h}from"../../../core/promiseUtils.js";import g from"../../../core/ReactiveMap.js";import{watch as _,when as v,syncAndInitial as y,sync as b}from"../../../core/reactiveUtils.js";import{property as x,subclass as S}from"../../../core/accessorSupport/decorators.js";import{isInEffectiveScaleRange as C}from"../../../geometry/support/scaleUtils.js";import{geometryTypes as w}from"../../../geometry/support/typeUtils.js";import{isFeatureLayer as T,isSubtypeGroupLayer as E,isSubtypeSublayer as D}from"../../../layers/support/layerUtils.js";import{combineTimeExtent as O}from"../../../layers/support/timeSupport.js";import k from"../../../rest/support/AttachmentQuery.js";import A from"../../../rest/support/RelationshipQuery.js";import j from"../../../time/TimeExtent.js";import M from"../../../views/SelectionManager.js";import{temporaryHighlightName as N}from"../../../views/support/HighlightDefaults.js";import{highlightsSupported as P}from"../../../views/support/layerViewUtils.js";import{isSelectableLayerWithObjectIds as F,isSelectableLayer as I}from"../../../views/support/selectionUtils.js";import{isIFeatureTableSupportedLayerWithAttachments as L,isIFeatureTableSupportedLayerWithAttachmentsEditing as R,isIFeatureTableSupportedLayerWithEditing as z,isIFeatureTableSupportedLayerWithRelationships as B,isPageIndexValid as V,findRelatedLayer as H}from"./tableUtils.js";import{ContingentValuesManager as U}from"../../support/ContingentValuesManager.js";let W=class extends n{constructor(e){super(e),this._attachmentsOperationQueue=new o,this._contingentValuesManager=new U,this._defaultOutFields=[`*`],this._editOperationQueue=new o,this.featureTitleMap=new g,this._loaded=!1,this._loadController=null,this._loadDebounced=p(()=>this._load()),this._loadError=!1,this._objectIdCache=new o,this._pendingEditsCache=new g,this._queryOperationInfos=new g,this._refreshDebounced=p(()=>this._refresh()),this._size=0,this._temporaryHighlight=null,this._temporaryHighlightAbortController=null,this.attachmentsEnabled=!1,this.autoSaveEnabled=!0,this.defaultSelectionManager=new M,this.editingEnabled=!1,this.failures=new o,this.filterByViewExtent=!1,this.filterByLayerScaleRange=!1,this.filterGeometry=null,this.highlightEnabled=!0,this.initialSize=null,this.layer=null,this.maxSize=null,this.objectIds=null,this.outFields=null,this.pageCache=new g,this.pageSize=50,this.paginationEnabled=!1,this.relationshipConfig=null,this.relatedRecordsEnabled=!1,this.returnGeometry=!1,this.returnZ=!1,this.returnM=!1,this.selectionManager=null,this.sortOrders=[],this.syncViewSelection=!1,this.temporaryHighlightId=void 0,this.timeExtent=null,this.timeZone=null,this.view=null,this.viewTimeEnabled=!1,this.where=null}initialize(){this.addHandles([_(()=>[this.effectiveWhere,this.filterGeometry,this.layer,this.objectIds,this.outFields,this.pageSize,this.relationshipConfig,this.returnGeometry,this.returnM,this.returnZ,this.visibleAtCurrentScale],()=>this._reset()),_(()=>this.orderByFields,()=>this._clearCaches(),{equals:r}),v(()=>this.attachmentsEnabled,()=>this._reset()),v(()=>this.relatedRecordsEnabled,()=>this._reset()),_(()=>this._layerWithContingentValues,e=>{let t=this._contingentValuesManager;e&&!t.layers.includes(e)&&t.layers.add(e)}),_(()=>[this.view?.extent,this.view?.stationary,this.filterByViewExtent],([e,t,n])=>{n&&(e?t&&(this.filterGeometry=e):this.filterGeometry=null)},y),_(()=>this.maxSize,(e,t)=>{t===0&&this._reset()}),_(()=>[this.layer,this.view],()=>this.syncSelectionSources(),y),_(()=>this.highlightEnabled,e=>this.defaultSelectionManager.highlightEnabled=e,y),_(()=>this.temporaryHighlightId,e=>{this._temporaryHighlight=d(this._temporaryHighlight?.handle),this._temporaryHighlightAbortController?.abort(),this._temporaryHighlightAbortController=new AbortController;let t=this._syncTemporaryHighlight(e,this._temporaryHighlightAbortController.signal);m(this.view?.addUpdatingPromise(t)??t)},b)])}destroy(){this.layer=null,this.itemCache.destroy(),this.failures.destroy(),this.defaultSelectionManager.destroy(),this._temporaryHighlight=d(this._temporaryHighlight?.handle),this._temporaryHighlightAbortController=f(this._temporaryHighlightAbortController)}get _capabilities(){let{layer:e}=this;return e?.effectiveCapabilities??e?.capabilities}get _canSavePendingEdits(){return this.supportsEditing&&this.hasPendingEdits&&!this.hasInvalidPendingEdits}get _effectiveReturnZ(){return this.returnZ&&this.supportsZ}get _effectiveReturnM(){return this.returnM&&this.supportsM}get _layerWithAttachments(){let{layer:e}=this;return!e||!this._capabilities||!this.attachmentsEnabled||!this.supportsAttachments||!L(e)?null:e}get _layerWithAttachmentsEditing(){let{_layerWithAttachments:e}=this;return!e||!R(e)||!this.supportsEditing?null:e}get _layerWithContingentValues(){let{layer:e}=this;return T(e)||E(e)?e:null}get _layerWithEditing(){let e=this.layer;return z(e)&&this.supportsEditing?e:null}get _layerWithRelationships(){let e=this.layer;return B(e)&&this.supportsQueryRelated?e:null}get _pendingEditsAreInvalid(){let e=this._pendingEditsCache,t=this._layerWithContingentValues;if(!t)return!1;for(let n of e.keys()){let r=e.get(n),i=this._getFeatureWithPendingEdits(n,r);for(let e of r.changes.keys())if(this._contingentValuesManager.getViolationForField(t,i,e))return!0}return!1}get _relatedLayer(){return this.relationshipConfig?.relatedLayer}get _relatedLayerCapabilities(){let{_relatedLayer:e}=this;return e?.effectiveCapabilities??e?.capabilities}get _relatedLayerSupportsCacheHint(){return!!this._relatedLayerCapabilities?.queryRelated?.supportsCacheHint}get _relatedLayerSupportsQuery(){return!!this._relatedLayerCapabilities?.operations.supportsQuery}get _relatedLayerSupportsQueryRelated(){let{_relatedLayerCapabilities:e}=this;return!!e?.queryRelated?.supportsCount&&!!e?.queryRelated?.supportsPagination}get _sortedFieldNames(){return this.sortOrders.map(({fieldName:e})=>e)}get _subtypeCode(){return this.layer?.subtypeCode??null}get _subtypeField(){let{layer:e}=this;return E(e?.parent)?e.subtypeField:null}get _canUseRelatedLayer(){return!!(this._relatedLayerSupportsQuery&&this._relatedLayerSupportsQueryRelated)}get cachedPageCount(){return this.pageCache.size}get canAddRelatedFeature(){let{state:e,relationship:t,supportsAdd:n,supportsEditing:r}=this;if(e!==`loaded`||!t||!n||!r)return!1;let{cardinality:i,role:a}=t,o=this.size>0;return!(i===`one-to-one`&&o||i===`one-to-many`&&a===`origin`&&o)}get effectiveFilterByLayerScaleRange(){return!!(this.view&&this.filterByLayerScaleRange)}get effectiveOutFields(){let{layer:e,outFields:t}=this;if(!e||!t?.length)return this._defaultOutFields;let n=[];t.forEach(t=>{let r=e.fieldsIndex.normalizeFieldName(t);r&&n.push(r)});let{objectIdField:r}=e,i=e.fieldsIndex.normalizeFieldName(r)??r;return i&&!n.includes(i)&&n.unshift(i),n}get effectiveSelectionManager(){let{layer:e,view:t}=this;return e&&this.syncViewSelection&&F(e)&&t?.selectionManager?.sources.includes(e)?t.selectionManager:this.selectionManager??this.defaultSelectionManager}get effectiveSize(){let{_size:e,maxSize:t}=this;return t==null?e:Math.min(t,e)}get effectiveTimeExtent(){let{layer:e,timeExtent:t,view:n,viewTimeEnabled:r}=this;return t||!e?t??void 0:!n||!r?e.timeExtent??void 0:O({datesInUnknownTimezone:e.datesInUnknownTimezone??void 0,timeExtent:e.timeExtent,timeInfo:e.timeInfo,timeOffset:e.timeOffset,useViewTime:e.useViewTime},n.timeExtent,this._get(`effectiveTimeExtent`))??void 0}get effectiveWhere(){let{layer:e,where:t}=this;return t!=null&&t!==``?t:D(e)&&e.parent?.definitionExpression?e.parent.definitionExpression:e?.definitionExpression||`1=1`}get fieldsWithContingentValues(){return this._contingentValuesManager.getFieldsWithContingentValues(this.layer)}get hasContingentValues(){return this.fieldsWithContingentValues.size>0}get hasInvalidPendingEdits(){return this.hasPendingEdits&&this._pendingEditsAreInvalid}get hasPendingEdits(){return this.pendingEditsCount>0}get highlightableLayerView(){let e=this.layerView;return P(e)?e:null}get isQuerying(){return this._queryOperationInfos.size>0}get isSyncing(){return this.isSyncingFeatureEdits||this.isSyncingAttachmentEdits}get isSyncingAttachmentEdits(){return this._attachmentsOperationQueue.length>0}get isSyncingFeatureEdits(){return this._editOperationQueue.length>0}get itemCache(){return new o({items:[...this.pageCache.values()].flat()})}get layerView(){let{layer:e,view:t}=this;if(!e||!t)return null;let n=e.type===`sublayer`||D(e)?e.parent:e;return t.allLayerViews.find(e=>e.layer===n)}get orderByFields(){let{_sortedFieldNames:e,layer:t,sortOrders:n}=this,r=n.filter(({fieldName:t,direction:n},r)=>e.indexOf(t)===r&&n!=null).map(({fieldName:e,direction:t})=>`${e} ${t?.toUpperCase()}`);if(t&&!r.length&&!t.objectIdField&&t.fields?.length){let e=t.fields.find(e=>e.name);if(e){let n=t.fieldsIndex.normalizeFieldName(e.name);n&&r.push(`${n} ASC`)}}return r}get pageCount(){let{effectiveSize:e,pageSize:t}=this;return e===0||t===0?1:Math.ceil(e/t)}get pageIndex(){return this._get(`pageIndex`)||0}set pageIndex(e){let{pageCount:t}=this;V(e,t)&&this._set(`pageIndex`,e)}get pendingEditsCount(){let e=0;return this._pendingEditsCache.forEach(t=>e+=t.changes.size),e}get relationship(){let{relationshipConfig:e}=this;return e?.relationshipId==null?null:this.relationships?.find(t=>t.id===e.relationshipId)}get relationshipIds(){return this.relationships?.map(e=>e.id)??[]}get relationshipInfos(){let{_layerWithRelationships:e,relatedRecordsEnabled:t,relationships:n,view:r}=this,i=[];return t&&e?.loaded&&r?.map&&n?.length&&n.forEach(t=>{let n=H(e,r,t);n&&(n.load().catch(()=>{}),i.push({layer:e,relatedLayer:n,relationshipId:t.id}))}),i}get relationships(){return this._layerWithRelationships?.relationships}get size(){return this._size}get state(){let{layer:e,_loaded:t,_loadError:n}=this;return!e||e.destroyed?`disabled`:n||e.loadError?`error`:this._loadController?`loading`:e.loadStatus===`loaded`&&t?`loaded`:`ready`}get supportsAdd(){return!!this._capabilities?.operations.supportsAdd}get supportsAddAttachments(){return!!(this._layerWithAttachmentsEditing&&(this.supportsAdd||this.supportsUpdate))}get supportsAttachments(){let{_capabilities:e}=this;return!!(e?.data?.supportsAttachment&&e?.operations.supportsQueryAttachments)}get supportsCacheHint(){return!!this._capabilities?.query?.supportsCacheHint}get supportsCacheHintQueryRelated(){return!!this._capabilities?.queryRelated?.supportsCacheHint}get supportsDelete(){return!!this._capabilities?.operations.supportsDelete}get supportsEditing(){return!!this._capabilities?.operations.supportsEditing}get supportsM(){return!!this.layer?.hasM&&!!this._capabilities?.data?.supportsM}get supportsOrderBy(){return!!this._capabilities?.query?.supportsOrderBy}get supportsPagination(){return!!this._capabilities?.query?.supportsPagination}get supportsQuery(){return!!this._capabilities?.operations.supportsQuery}get supportsQueryRelated(){let{_capabilities:e}=this;return!!e?.queryRelated?.supportsCount&&!!e?.queryRelated?.supportsPagination}get supportsResizeAttachments(){let{_capabilities:e}=this;return!!(this.supportsAttachments&&e?.attachment?.supportsResize)}get supportsUpdate(){return!!this._capabilities?.operations.supportsUpdate}get supportsUpdateAttachments(){return!!(this._layerWithAttachmentsEditing&&(this.supportsAdd||this.supportsUpdate))}get supportsZ(){return!!this.layer?.hasZ&&!!this._capabilities?.data?.supportsZ}get visibleAtCurrentScale(){let{layer:e}=this;return!e||!this.effectiveFilterByLayerScaleRange?!1:C(e.effectiveScaleRange,this.view?.scale)}async addAttachment(e,t){let{_layerWithAttachmentsEditing:n}=this;if(!n||!this.supportsAddAttachments)return{};let r=await this._queueAttachmentsOperation(e,()=>n.addAttachment(this._createBaseGraphic(n,e),t));return this._ensureArrayContent(r)}addPendingEdits(e){let t=this._ensureLayerAndUpdateSupport();this.editingEnabled?(this.autoSaveEnabled&&this._logWarning(`store:pending-edit`,`Edit will be cached, but 'autoSaveEnabled' is true.`,!0),this._stashPendingEdits(t,e)):this._logWarning(`store:editing-disabled`,`Editing is disabled.`)}async deleteAttachments(e,t){let{_layerWithAttachmentsEditing:n}=this;if(!n||!this.supportsUpdateAttachments||!t.length)return[];let r=await this._queueAttachmentsOperation(e,()=>n.deleteAttachments(this._createBaseGraphic(n,e),t));return this._ensureArray(r)}async deleteRowsByObjectId(e){let{_layerWithEditing:t}=this;if(!this.supportsDelete||!t)throw new s(`store:delete-error`,`Delete is not supported.`);let n=e.map(e=>this.getItemByObjectId(e)?.feature).filter(i),r=this._queueEditOperation(()=>t.applyEdits({deleteFeatures:n}));return e.forEach(e=>{this.featureTitleMap.delete(e),this._discardPendingEdit({objectId:e})}),r}discardPendingEdits(e){if(e?.length)e.forEach(e=>this._discardPendingEdit(e));else{for(let[e,t]of this._pendingEditsCache){let n=this.getItemByObjectId(e);n&&(n.feature=t.originalFeature)}this._pendingEditsCache.clear(),this._clearOptionsAndViolations()}}itemHasInvalidPendingEdits(e,t){if(!this.hasInvalidPendingEdits)return!1;let n=this._layerWithContingentValues,r=this._pendingEditsCache.get(e);if(!n||!r)return!1;let i=this._getFeatureWithPendingEdits(e,r),a=this._contingentValuesManager;return t?!!a.getViolationForField(n,i,t):!!a.getAllViolations(n,i)}itemHasPendingEdits(e,t){let n=this._pendingEditsCache.get(e);return n?!t||n.changes.has(t):!1}async getAttachmentsByObjectId(e,t){let n=this.getItemByObjectId(e)?.attachments??[];return!n.length&&t?(await this._queryAttachments([e]))[e]??[]:n}getCachedFeaturesByPageIndex(e){return this.pageCache.get(e)}getFieldValueOptions(e){return this._contingentValuesManager.getFieldValueOptions(e)}async getFeatureTitle(e,n=!1){let{layer:r}=this,i=this.featureTitleMap.get(e),a=`${e}`;if(!r)return i||a;if(i&&!n)return i;if(!(`getFeatureTitle`in r)||!r.getFeatureTitle)return a;let o=this.getItemByObjectId(e)?.feature;o||=new t({attributes:{[r.objectIdField]:e},origin:r.graphicOrigin});let s=await r.getFeatureTitle(o,{fetchMissingFields:!0,removeHTML:!0});return s?(this.featureTitleMap.set(e,s),s):a}getItemByObjectId(e){for(let t of this.pageCache.values())for(let n of t)if(n.objectId===e)return n}getItemIndexByObjectId(e){let{pageCache:t,pageSize:n}=this,r=t.entries(),i=-1;for(let[t,a]of r)if(a.some((r,a)=>{let o=r.objectId===e;return o&&(i=t*n+a),o}),i>-1)break;return i}async load(){await m(this._loadDebounced())}async queryPage(e){let{layer:t,state:n}=this;if(!t||n!==`loaded`||!this.supportsQuery||this.size===0||this.maxSize===0)return[];let{pageIndex:r}=e;if(!V(r,this.pageCount))return[];let i=e.pageSize??this.pageSize,a=r*i,o=a+i;return await m(this._query({layer:t,start:a,num:o,pageIndex:r,pageSize:i}))??[]}async refresh(){await m(this._refreshDebounced())}reset(){this._reset()}async savePendingEdits(){let e=this._ensureLayerAndUpdateSupport();if(!this.editingEnabled){this._logWarning(`store:editing-disabled`,`Editing is disabled.`);return}if(this.autoSaveEnabled&&this._logWarning(`store:pending-edit`,`Edit will be cached, but 'autoSaveEnabled' is true.`,!0),!this._canSavePendingEdits){this._logError(`store:update-error`,`An error occurred. Unable to save pending edits.`);return}let t=[];for(let[e]of this._pendingEditsCache){let n=this.getItemByObjectId(e);n?.feature&&t.push(n.feature)}(await this._update(e,t,!0)).updateFeatureResults.find(e=>e.error)&&this.discardPendingEdits(),this._clearOptionsAndViolations()}syncSelectionSources(){let{defaultSelectionManager:e,layer:t,view:n}=this;e.view=n,e.sources.removeAll(),I(t)&&(e.sources.items=[t])}async updateAttachment(e,t,n){let{_layerWithAttachmentsEditing:r}=this;if(!r||!this.supportsUpdateAttachments)return{};let i=await this._queueAttachmentsOperation(e,()=>r.updateAttachment(this._createBaseGraphic(r,e),t,n));return this._ensureArrayContent(i)}async updateItem(e){let t=this._ensureLayerAndUpdateSupport();if(!this.editingEnabled){this._logWarning(`store:editing-disabled`,`Editing is disabled.`);return}if(this.hasContingentValues){let t=e.updates.some(e=>this.fieldsWithContingentValues.has(e.fieldName)),n=this.itemHasPendingEdits(e.objectId);if(n||t){let t=this._layerWithContingentValues,r=this.getItemByObjectId(e.objectId)?.feature?.clone();if(r){let i=this._contingentValuesManager.getAllViolations(t,r);if(e.updates.forEach(({fieldName:e,value:n})=>{let i=t.getField(e);i&&(r.attributes[i.name]=n)}),this._contingentValuesManager.validateContingencyConstraints(t,r).length||i.length||n){this._stashPendingEdits(t,[e]),this._contingentValuesManager.resetOptionsForLayer(t);return}}}}if(!this.autoSaveEnabled){this._stashPendingEdits(t,[e]);return}let{_sortedFieldNames:n}=this,r=e.updates.map(({fieldName:e})=>e),i=this._prepareEditsForUpdate([e]);!(await this._update(t,i)).updateFeatureResults.find(e=>e.error)&&r.some(e=>n.includes(e))&&this._clearCaches()}async verifyFeaturesByObjectId(e){let{layer:t,state:n}=this;if(!t||n!==`loaded`)return[];let{objectIdField:r}=t,i=await this._queryFeaturesByObjectId(e);return e.map(e=>i.some(t=>e===(t.getObjectId()??t.attributes[r])))}async _load(){let{layer:e}=this;if(this._reset(),!e)return;let t=new AbortController;this._loadController=t;try{if(await e.load(),e.parent&&E(e.parent)&&await e.parent.loadAll(),await e.when(),t.signal.aborted)return;let n=this.initialSize;if(this.initialSize=null,this.effectiveFilterByLayerScaleRange&&(this.visibleAtCurrentScale||(n=0)),await m(this._refresh(t,n)),t.signal.aborted){this._loadController=null;return}this._loaded=!0,this._loadController=null}catch(e){throw this._reset(),this._loadError=!0,this._logError(`store:load-error`,`An error occurred.`),e}}async _refresh(e,t){this._clearCaches();let n=e?.signal,r=await this._getSize(n,t),i=await this._queryAllObjectIds(n);n?.aborted||(this._size=r,this._objectIdCache.removeAll(),i?.length&&this._objectIdCache.addMany(i),this._syncPendingEdits())}async _queryAllObjectIds(e){return this.supportsPagination?void 0:await this._queryObjectIds(e)}_clearCaches(){this.pageCache.clear(),this._objectIdCache.removeAll()}_createBaseGraphic(e,n){let r=new t({attributes:{[e.objectIdField]:n}});return this._subtypeField&&this._subtypeCode!=null&&(r.attributes[this._subtypeField]=this._subtypeCode),r}_ensureArray(e){return Array.isArray(e)?e:[e]}_ensureArrayContent(e){return Array.isArray(e)?e[0]:e}_getObjectIdsForFeatures(e,t){return e.map(e=>e.getObjectId()??e.attributes[t.objectIdField])}_getObjectIdsForPage(e,t){let n=this._objectIdCache.toArray();return n.length>=e+t?n.slice(e,e+t):n.slice(e)}_logError(e,t){l.getLogger(this).error(e,t)}_logWarning(e,t,n=!1){n?l.getLogger(this).warnOnce(e,t):l.getLogger(this).warn(e,t)}_reset(){this._clearCaches(),this._pendingEditsCache.clear(),this.failures.removeAll(),this._attachmentsOperationQueue.removeAll(),this._editOperationQueue.removeAll(),this.featureTitleMap.clear(),this._loadController=f(this._loadController),this._queryOperationInfos.forEach(e=>e.controller.abort()),this._queryOperationInfos.clear(),this._temporaryHighlight=d(this._temporaryHighlight?.handle),this._temporaryHighlightAbortController=f(this._temporaryHighlightAbortController),this._loaded=!1,this._loadError=!1,this._size=0}async _getSize(e,t){return this.maxSize===0?0:t??await this._queryCount(e)}async _queryFeaturesByObjectId(e){let{layer:t}=this;if(!t||!this.supportsQuery)throw new s(`store:query-error`,`Layer does not support query operation.`);let{effectiveTimeExtent:n,effectiveWhere:r,orderByFields:i,supportsCacheHint:a,supportsOrderBy:o}=this,c=t.createQuery();return c.where=r,c.timeExtent=n,c.returnGeometry=!1,c.objectIds=e.length?e:void 0,c.outFields=[t.objectIdField],o&&(c.orderByFields=i),a&&(c.cacheHint=!0),(await t.queryFeatures(c)).features}async _syncTemporaryHighlight(e,t){let{highlightEnabled:n,highlightableLayerView:r}=this;r&&n&&e!=null&&(h(t),this._temporaryHighlight={id:e,handle:r.highlight(e,{name:N})})}_ensureLayerAndUpdateSupport(){let e=this._layerWithEditing;if(!e||!this.supportsUpdate)throw new s(`store:update-error`,`Update is not supported.`);return e}_stashPendingEdits(e,t){t.forEach(({objectId:t,updates:n})=>{let r=this.getItemByObjectId(t)?.feature;if(!r)throw new s(`store:update-error`,`Feature with provided 'objectId' not found.`);let i=r.clone(),a=u(this._pendingEditsCache,t,()=>({originalFeature:i,changes:new g}));n.forEach(({fieldName:t,value:n})=>{let i=e.getField(t);i?(a.changes.set(i.name,n),r.attributes[i.name]=n):this._logWarning(`store:pending-edit-unknown-field`,`The provided field does not belong to this layer.`)}),a.changes.size>0&&this._pendingEditsCache.set(t,a)})}_syncPendingEdits(){for(let[e,t]of this._pendingEditsCache){let n=this.getItemByObjectId(e)?.feature;if(n){let e=n.clone();for(let[e,r]of t.changes)n.attributes[e]=r;t.originalFeature=e}}}_getFeatureWithPendingEdits(e,t){let n=this.getItemByObjectId(e)?.feature;if(!n){n=t.originalFeature.clone();for(let[e,r]of t.changes)n.attributes[e]=r}return n}_discardPendingEdit({objectId:e,fieldName:t}){let n=this._pendingEditsCache.get(e);if(!n){this._logWarning(`store:pending-edit-not-found`,`Could not find a pending edit with the given information`);return}let r=this.getItemByObjectId(e);t?(r&&(r.feature.attributes[t]=n.originalFeature.attributes[t]),n.changes.delete(t),n.changes.size===0&&this._pendingEditsCache.delete(e)):(r&&(r.feature=n.originalFeature),this._pendingEditsCache.delete(e))}_clearOptionsAndViolations(){let{_layerWithContingentValues:e,_contingentValuesManager:t}=this;e&&(t.resetOptionsForLayer(e),t.resetViolationsForLayer(e))}_prepareEditsForUpdate(e){let n=[];return e.forEach(({objectId:e,updates:r})=>{let i=this.getItemByObjectId(e)?.feature;if(!i)return;let a=c(i.attributes);r.forEach(({fieldName:e,value:t})=>a[e]=t),n.push(new t({attributes:a,sourceLayer:i.sourceLayer}))}),n}_update(e,t,n=!1){let r=e.applyEdits({updateFeatures:t}).then(n=>{let{updateFeatureResults:r}=n,i=r.find(e=>!!e.error);if(i)throw i.error;return t.forEach(t=>{let n=t.getObjectId()??t.attributes[e.objectIdField],r=this.getItemByObjectId(n)?.feature;r&&(r.attributes=t.attributes),this.featureTitleMap.has(n)&&this.getFeatureTitle(n,!0)}),n});return this._queueEditOperation(()=>r,n)}_createFeatureStoreItems(e){let{attachments:t,features:n,layer:r,relatedRecords:i}=e,a=r.objectIdField;return n.map(e=>{let n=e.getObjectId()??e.attributes[a],o=[];!e.layer&&!e.sourceLayer&&(e.layer=r,e.sourceLayer=r);let s=this._pendingEditsCache.get(n);if(s){let t=e.clone(),n=s.changes;for(let[t,r]of n)e.attributes[t]=r;s.originalFeature=t}return i.forEach((e,t)=>{o.push({relationshipId:t,count:e[n]??0})}),{objectId:n,feature:e,attachments:t[n]??null,relatedRecords:o}})}async _query(e){let{pageIndex:t,refresh:n}=e;n===!0&&await this._refresh();let r=this.pageCache.get(t);if(r)return r;let i=this._queryOperationInfos.get(t);if(i)return i.task.promise;let a=new AbortController,o=await this._queryPage(e,a);return a.signal.aborted||this.pageCache.set(t,o),o}_queryAttachments(e,t){let{_layerWithAttachments:n,effectiveWhere:r}=this;return n?e.some(e=>typeof e!=`number`)?Promise.reject(new s(`invalid-object-id`,`Only numeric object ids are valid to query attachments`)):n.queryAttachments(new k({objectIds:e,where:r,returnMetadata:!0}),{signal:t}):Promise.resolve({})}async _queryCount(e){let{_relatedLayerSupportsCacheHint:t,layer:n,relationshipConfig:r,supportsCacheHint:i}=this;if(!n)return 0;if(r&&this._canUseRelatedLayer){let{objectId:n,relatedLayer:i,relationshipId:a}=r;return(await i.queryRelatedFeaturesCount(new A({cacheHint:t,relationshipId:a,objectIds:[n]}),{signal:e}))[n]??0}let{effectiveTimeExtent:a,effectiveWhere:o,filterGeometry:s,objectIds:c}=this,l=n.createQuery();return l.geometry=s,l.returnGeometry=!1,l.where=o,l.timeExtent=a,l.objectIds=c?.length?c:void 0,i&&(l.cacheHint=!0),n.queryFeatureCount(l,{signal:e})}async _queryFeatures(e,t){let{relationshipConfig:n}=this;if(n&&this._canUseRelatedLayer)return this._queryRelatedFeatures(e,n);let{_effectiveReturnM:r,_effectiveReturnZ:i,effectiveOutFields:a,effectiveTimeExtent:o,effectiveWhere:s,filterGeometry:c,objectIds:l,orderByFields:u,pageSize:d,returnGeometry:f,supportsCacheHint:p,supportsOrderBy:m,supportsPagination:h}=this,{layer:g,start:_}=e,v=l?.length,y=g.createQuery();return y.returnGeometry=f,y.outFields=a,y.returnM=r,y.returnZ=i,h?(y.start=_,y.num=d,y.where=s,y.timeExtent=o,y.objectIds=v?l:void 0):y.objectIds=v?l:this._getObjectIdsForPage(_,d??0),m&&(y.orderByFields=u),c&&(y.geometry=c),p&&(y.cacheHint=!0),(await g.queryFeatures(y,{signal:t})).features}_queryObjectIds(e){let{effectiveTimeExtent:t,effectiveWhere:n,filterGeometry:r,layer:i,objectIds:a,orderByFields:o,supportsCacheHint:s,supportsOrderBy:c}=this;if(!i)return Promise.resolve([]);let l=i.createQuery();return l.geometry=r,l.outFields=[i.objectIdField],l.returnGeometry=!1,l.where=n,l.timeExtent=t,l.objectIds=a?.length?a:void 0,c&&(l.orderByFields=o),s&&(l.cacheHint=!0),i.queryObjectIds(l,{signal:e})}async _queryPage(e,t){return this._queueQueryOperation(e.pageIndex,{controller:t,task:a(async()=>this._queryPageData(e,t))})}async _queryPageData(e,t){let{layer:n}=e,{signal:r}=t,i=await this._queryFeatures(e,r);if(r.aborted)return[];let a=this._getObjectIdsForFeatures(i,n),[o,s]=await Promise.all([this._queryAttachments(a,r),this._queryRelatedCounts(a,r)]);return t.signal.aborted?[]:this._createFeatureStoreItems({layer:n,features:i,attachments:o,relatedRecords:s})||[]}async _queryRelatedCounts(e,t){let{_layerWithRelationships:n,relationshipIds:r,supportsCacheHintQueryRelated:i}=this,a=new Map;return n&&e?.length&&r.length&&await Promise.allSettled(r.map(async r=>{let o=await n.queryRelatedFeaturesCount(new A({cacheHint:i,relationshipId:r,objectIds:e}),{signal:t});a.set(r,o)})),a}async _queryRelatedFeatures(e,t){let{_defaultOutFields:n,_effectiveReturnM:r,_effectiveReturnZ:i,orderByFields:a,pageSize:o,returnGeometry:s,supportsCacheHint:c}=this,{layer:l,start:u}=e,{objectId:d,relatedLayer:f,relationshipId:p}=t,m=l.createQuery(),h=new A({cacheHint:c,num:o,objectIds:[d],orderByFields:a,outFields:n,relationshipId:p,returnGeometry:s,returnM:r,returnZ:i,start:u,where:m.where??void 0});return(await f.queryRelatedFeatures(h))[d]?.features||[]}_queueAttachmentsOperation(e,t){return this._attachmentsOperationQueue.push(t),t().then(async n=>{this._attachmentsOperationQueue.remove(t);let r=this._ensureArray(n),i=r.some(e=>e.error),a=this.getItemByObjectId(e);return a&&(!i||r.length>1)&&(a.attachments=(await this._queryAttachments([e]))[e]),n}).catch(async n=>{this._logError(`store:attachment-error`,`An error occurred.`);let r={error:n,retry:()=>{this.failures.remove(r),this._queueAttachmentsOperation(e,t)},cancel:()=>this.failures.remove(r)};throw this.failures.add(r),this._attachmentsOperationQueue.remove(t),n})}_queueEditOperation(e,t=!1){return this._editOperationQueue.push(e),e().then(n=>(this._editOperationQueue.remove(e),t&&this._pendingEditsCache.clear(),n)).catch(t=>{this._logError(`store:edit-error`,`An error occurred.`);let n={error:t,retry:()=>{this.failures.remove(n),this._queueEditOperation(e)},cancel:()=>this.failures.remove(n)};throw this.failures.add(n),this._editOperationQueue.remove(e),t})}async _queueQueryOperation(e,t){this._queryOperationInfos.set(e,t);let n=await t.task.promise;return this._queryOperationInfos.delete(e),n}};e([x()],W.prototype,`_attachmentsOperationQueue`,void 0),e([x({readOnly:!0})],W.prototype,`_capabilities`,null),e([x()],W.prototype,`_canSavePendingEdits`,null),e([x()],W.prototype,`_contingentValuesManager`,void 0),e([x()],W.prototype,`_defaultOutFields`,void 0),e([x()],W.prototype,`_editOperationQueue`,void 0),e([x()],W.prototype,`_effectiveReturnZ`,null),e([x()],W.prototype,`_effectiveReturnM`,null),e([x()],W.prototype,`featureTitleMap`,void 0),e([x({readOnly:!0})],W.prototype,`_layerWithAttachments`,null),e([x({readOnly:!0})],W.prototype,`_layerWithAttachmentsEditing`,null),e([x()],W.prototype,`_layerWithContingentValues`,null),e([x({readOnly:!0})],W.prototype,`_layerWithEditing`,null),e([x({readOnly:!0})],W.prototype,`_layerWithRelationships`,null),e([x()],W.prototype,`_loaded`,void 0),e([x()],W.prototype,`_loadController`,void 0),e([x()],W.prototype,`_loadError`,void 0),e([x()],W.prototype,`_objectIdCache`,void 0),e([x()],W.prototype,`_pendingEditsCache`,void 0),e([x()],W.prototype,`_pendingEditsAreInvalid`,null),e([x()],W.prototype,`_queryOperationInfos`,void 0),e([x({readOnly:!0})],W.prototype,`_relatedLayer`,null),e([x({readOnly:!0})],W.prototype,`_relatedLayerCapabilities`,null),e([x({readOnly:!0})],W.prototype,`_relatedLayerSupportsCacheHint`,null),e([x()],W.prototype,`_relatedLayerSupportsQuery`,null),e([x()],W.prototype,`_relatedLayerSupportsQueryRelated`,null),e([x()],W.prototype,`_size`,void 0),e([x()],W.prototype,`_sortedFieldNames`,null),e([x()],W.prototype,`_subtypeCode`,null),e([x()],W.prototype,`_subtypeField`,null),e([x()],W.prototype,`_canUseRelatedLayer`,null),e([x()],W.prototype,`attachmentsEnabled`,void 0),e([x()],W.prototype,`autoSaveEnabled`,void 0),e([x()],W.prototype,`cachedPageCount`,null),e([x()],W.prototype,`canAddRelatedFeature`,null),e([x()],W.prototype,`defaultSelectionManager`,void 0),e([x()],W.prototype,`editingEnabled`,void 0),e([x()],W.prototype,`effectiveFilterByLayerScaleRange`,null),e([x()],W.prototype,`effectiveOutFields`,null),e([x()],W.prototype,`effectiveSelectionManager`,null),e([x()],W.prototype,`effectiveSize`,null),e([x()],W.prototype,`effectiveTimeExtent`,null),e([x()],W.prototype,`effectiveWhere`,null),e([x({readOnly:!0})],W.prototype,`failures`,void 0),e([x()],W.prototype,`fieldsWithContingentValues`,null),e([x()],W.prototype,`filterByViewExtent`,void 0),e([x()],W.prototype,`filterByLayerScaleRange`,void 0),e([x({types:w})],W.prototype,`filterGeometry`,void 0),e([x()],W.prototype,`hasContingentValues`,null),e([x()],W.prototype,`hasInvalidPendingEdits`,null),e([x()],W.prototype,`hasPendingEdits`,null),e([x()],W.prototype,`highlightEnabled`,void 0),e([x()],W.prototype,`highlightableLayerView`,null),e([x()],W.prototype,`initialSize`,void 0),e([x({readOnly:!0})],W.prototype,`isQuerying`,null),e([x({readOnly:!0})],W.prototype,`isSyncing`,null),e([x({readOnly:!0})],W.prototype,`isSyncingAttachmentEdits`,null),e([x({readOnly:!0})],W.prototype,`isSyncingFeatureEdits`,null),e([x({readOnly:!0})],W.prototype,`itemCache`,null),e([x()],W.prototype,`layer`,void 0),e([x()],W.prototype,`layerView`,null),e([x()],W.prototype,`maxSize`,void 0),e([x()],W.prototype,`objectIds`,void 0),e([x()],W.prototype,`orderByFields`,null),e([x()],W.prototype,`outFields`,void 0),e([x({readOnly:!0})],W.prototype,`pageCache`,void 0),e([x()],W.prototype,`pageCount`,null),e([x()],W.prototype,`pageIndex`,null),e([x()],W.prototype,`pageSize`,void 0),e([x()],W.prototype,`paginationEnabled`,void 0),e([x()],W.prototype,`pendingEditsCount`,null),e([x()],W.prototype,`relationship`,null),e([x()],W.prototype,`relationshipConfig`,void 0),e([x()],W.prototype,`relationshipIds`,null),e([x()],W.prototype,`relationshipInfos`,null),e([x()],W.prototype,`relationships`,null),e([x()],W.prototype,`relatedRecordsEnabled`,void 0),e([x()],W.prototype,`returnGeometry`,void 0),e([x()],W.prototype,`returnZ`,void 0),e([x()],W.prototype,`returnM`,void 0),e([x()],W.prototype,`selectionManager`,void 0),e([x({readOnly:!0})],W.prototype,`size`,null),e([x()],W.prototype,`sortOrders`,void 0),e([x({readOnly:!0})],W.prototype,`state`,null),e([x()],W.prototype,`supportsAdd`,null),e([x()],W.prototype,`supportsAddAttachments`,null),e([x()],W.prototype,`supportsAttachments`,null),e([x()],W.prototype,`supportsCacheHint`,null),e([x()],W.prototype,`supportsCacheHintQueryRelated`,null),e([x()],W.prototype,`supportsDelete`,null),e([x()],W.prototype,`supportsEditing`,null),e([x()],W.prototype,`supportsM`,null),e([x()],W.prototype,`supportsOrderBy`,null),e([x()],W.prototype,`supportsPagination`,null),e([x()],W.prototype,`supportsQuery`,null),e([x()],W.prototype,`supportsQueryRelated`,null),e([x()],W.prototype,`supportsResizeAttachments`,null),e([x()],W.prototype,`supportsUpdate`,null),e([x()],W.prototype,`supportsUpdateAttachments`,null),e([x()],W.prototype,`supportsZ`,null),e([x()],W.prototype,`syncViewSelection`,void 0),e([x()],W.prototype,`temporaryHighlightId`,void 0),e([x({type:j})],W.prototype,`timeExtent`,void 0),e([x()],W.prototype,`timeZone`,void 0),e([x()],W.prototype,`view`,void 0),e([x()],W.prototype,`viewTimeEnabled`,void 0),e([x()],W.prototype,`visibleAtCurrentScale`,null),e([x()],W.prototype,`where`,void 0),W=e([S(`esri.widgets.FeatureTable.support.FeatureStore`)],W);const G=W;export{G as default};
@@ -1,17 +1,19 @@
1
1
  import type Accessor from "../../core/Accessor.js";
2
2
  import type { MapViewOrSceneView } from "../../views/MapViewOrSceneView.js";
3
3
 
4
+ /** @deprecated since 5.2. Use the [Fullscreen component](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-fullscreen/) instead. */
4
5
  export interface FullscreenViewModelProperties extends Partial<Pick<FullscreenViewModel, "view">> {
5
6
  /** The [HTMLElement](https://developer.mozilla.org/docs/Web/API/HTMLElement) to present in fullscreen mode. */
6
7
  element?: HTMLElement | null;
7
8
  }
8
9
 
10
+ /** @deprecated since 5.2. Use the Fullscreen component's [`state`](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-fullscreen/#state) property instead. The component uses `"unsupported"` where this type uses `"feature-unsupported"`. */
9
11
  export type FullscreenViewModelState = "active" | "disabled" | "feature-unsupported" | "ready";
10
12
 
11
13
  /**
12
14
  * Provides the logic for the [Fullscreen](https://developers.arcgis.com/javascript/latest/references/core/widgets/Fullscreen/) widget.
13
15
  *
14
- * @deprecated since version 4.33. Use the JavaScript [Fullscreen API](https://developer.mozilla.org/docs/Web/API/Fullscreen_API) directly instead.
16
+ * @deprecated since version 4.33. Use the JavaScript [Fullscreen API](https://developer.mozilla.org/docs/Web/API/Fullscreen_API) directly or the [Fullscreen component](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-fullscreen/) for map UI instead.
15
17
  * @since 4.6
16
18
  * @see [Fullscreen](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-fullscreen/) component
17
19
  * @see [Fullscreen](https://developers.arcgis.com/javascript/latest/references/core/widgets/Fullscreen/) widget - _Deprecated since 4.32. Use the [Fullscreen component](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-fullscreen/) instead._
@@ -4,6 +4,7 @@ import type { MapViewOrSceneView } from "../../views/MapViewOrSceneView.js";
4
4
  import type { GoTo, GoToProperties } from "../support/GoTo.js";
5
5
  import type { ViewpointProperties } from "../../Viewpoint.js";
6
6
 
7
+ /** @deprecated since 5.2. Use the [Home component](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-home/) instead. */
7
8
  export interface HomeViewModelProperties extends GoToProperties, Partial<Pick<HomeViewModel, "view">> {
8
9
  /**
9
10
  * The [Viewpoint](https://developers.arcgis.com/javascript/latest/references/core/Viewpoint/), or point of view, to zoom to when
@@ -26,6 +27,7 @@ export interface HomeViewModelProperties extends GoToProperties, Partial<Pick<Ho
26
27
  viewpoint?: ViewpointProperties | null;
27
28
  }
28
29
 
30
+ /** @deprecated since 5.2. Use the Home component's [`state`](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-home/#state) property instead. */
29
31
  export type HomeViewModelState = "disabled" | "going-home" | "ready";
30
32
 
31
33
  /** @deprecated since 5.0. Use the [Home component](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-home/) directly instead. */