@arcgis/core 5.2.0-next.157 → 5.2.0-next.158
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.
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/{820c8aaf3632edb0150c.js → 0a5a9885ee6f5b5f99f0.js} +1 -1
- package/assets/esri/core/workers/chunks/{7bcedf479b07a4b4a234.js → 1419bf346978b81b08cc.js} +1 -1
- package/assets/esri/core/workers/chunks/2cb209bc51a19487692d.js +2 -0
- package/assets/esri/core/workers/chunks/2e66c969bf4209c957b5.js +2 -0
- package/assets/esri/core/workers/chunks/31640b41e0ecdff892fa.js +2 -0
- package/assets/esri/core/workers/chunks/{2ef5237e4c876d6a4ee0.js → 340256866f524cb069f6.js} +1 -1
- package/assets/esri/core/workers/chunks/{6079d27f4ab319fb8f0c.js → 377595b23379b0c8fe95.js} +1 -1
- package/assets/esri/core/workers/chunks/{c5ed67fdf261cbb1624b.js → 4be559c53fe5ac0d0d2e.js} +1 -1
- package/assets/esri/core/workers/chunks/4e6656a5f29e31902fca.js +2 -0
- package/assets/esri/core/workers/chunks/{67ebc5a3d46b254b725c.js → 612345f17f5eeb99ea8f.js} +1 -1
- package/assets/esri/core/workers/chunks/{44918ff37818a7d36d76.js → 6a0ec102962d2c7b4368.js} +1 -1
- package/assets/esri/core/workers/chunks/6a2562cc00727155fc01.js +1 -0
- package/assets/esri/core/workers/chunks/784d6c6949284ed6e10b.js +1 -0
- package/assets/esri/core/workers/chunks/{590e6c70206122e4cc3c.js → 844eedda8f749972f707.js} +2 -2
- package/assets/esri/core/workers/chunks/{d2347d6aa1c57fd57029.js → 8ff23ac0abeea0073b47.js} +1 -1
- package/assets/esri/core/workers/chunks/{ec8b7476eac4718eb0ac.js → a504a5e06cb89a620799.js} +1 -1
- package/assets/esri/core/workers/chunks/a53823cf03dbdce1aecd.js +1 -0
- package/assets/esri/core/workers/chunks/{a556dd4e9e6d35e33a2c.js → a546ec82ba149e12f7bf.js} +1 -1
- package/assets/esri/core/workers/chunks/{4a640548032355e57acd.js → ab6506a3c16f8717fc00.js} +1 -1
- package/assets/esri/core/workers/chunks/{d65383f4058dc813f40d.js → ade5fdcd08dcbac74740.js} +1 -1
- package/assets/esri/core/workers/chunks/ba38231193919e093917.js +1 -0
- package/assets/esri/core/workers/chunks/{3f776d9fd2ab68b21fca.js → bbd44ac63d2a317d8ed9.js} +1 -1
- package/assets/esri/core/workers/chunks/{35e5762642d1a3a2e375.js → be308db5b61a7246edfe.js} +1 -1
- package/assets/esri/core/workers/chunks/{10445313d0d57b34511b.js → d53cc574a21031436c45.js} +1 -1
- package/assets/esri/core/workers/chunks/dc51dcaa4e2f9a90f5bd.js +2 -0
- package/assets/esri/core/workers/chunks/f63686735e4e52f5b54e.js +1 -0
- package/assets/esri/core/workers/chunks/{b573df59391ca41ee5a7.js → fc73737b41e086f0ce0b.js} +1 -1
- package/assets/esri/core/workers/chunks/{3914d96147642a9d4b01.js → ffbcb816b611049a6276.js} +1 -1
- package/assets/esri/themes/base/widgets/_Weather.scss +1 -0
- package/assets/esri/themes/dark/main.css +1 -1
- package/assets/esri/themes/light/main.css +1 -1
- package/assets/esri/themes/light/view.css +1 -1
- package/config.js +1 -1
- package/form/elements.d.ts +46 -8
- package/form/elements.js +1 -1
- package/kernel.js +1 -1
- package/layers/GeoJSONLayer.d.ts +1 -1
- package/layers/support/layerOriginUtils.js +1 -1
- package/package.json +3 -3
- package/popup/FeaturesModel.js +1 -1
- package/time/TimeExtent.d.ts +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/vectorTiles/VTLTechniqueBackground.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/vectorTiles/VTLTechniqueFill.js +1 -1
- package/views/3d/analysis/Dimension/LengthDimensionSubTool.js +1 -1
- package/views/3d/analysis/LineOfSight/LineOfSightTool.js +1 -1
- package/views/3d/analysis/Viewshed/ViewshedTool.js +1 -1
- package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementTool.js +1 -1
- package/views/3d/interactive/measurementTools/areaMeasurement3D/AreaMeasurement3DTool.js +1 -1
- package/views/3d/interactive/measurementTools/directLineMeasurement3D/DirectLineMeasurement3DTool.js +1 -1
- package/views/3d/layers/support/MediaLayerInteraction.js +1 -1
- package/views/View.js +1 -1
- package/views/analysis/ElevationProfile/ElevationProfileTool.js +1 -1
- package/views/interactive/snapping/SnappingManagerPool.js +1 -1
- package/views/interactive/snapping/allLayerSnapping.js +1 -1
- package/widgets/AreaMeasurement2D/AreaMeasurement2DViewModel.d.ts +2 -1
- package/widgets/BasemapToggle/BasemapToggleViewModel.d.ts +2 -0
- package/widgets/DistanceMeasurement2D/DistanceMeasurement2DViewModel.d.ts +2 -1
- package/widgets/Expand/ExpandViewModel.d.ts +2 -0
- package/widgets/FeatureTable/support/FeatureStore.js +1 -1
- package/widgets/Fullscreen/FullscreenViewModel.d.ts +3 -1
- package/widgets/Home/HomeViewModel.d.ts +2 -0
- package/widgets/ScaleRangeSlider/ScaleRanges.d.ts +3 -0
- package/widgets/ScaleRangeSlider/types.d.ts +3 -3
- package/widgets/Sketch/SketchViewModel.js +1 -1
- package/widgets/Swipe/SwipeViewModel.d.ts +2 -0
- package/widgets/Swipe/types.d.ts +9 -2
- package/widgets/TimeSlider/TimeSliderViewModel.d.ts +9 -5
- package/widgets/TimeSlider/types.d.ts +7 -0
- package/widgets/TimeSlider.d.ts +2 -3
- package/widgets/TimeSlider.js +1 -1
- package/widgets/Track/TrackViewModel.d.ts +4 -0
- package/widgets/Track/types.d.ts +1 -0
- package/widgets/support/Selector3D/selectorUtils.js +1 -1
- package/assets/esri/core/workers/chunks/1b946714ca4a1a7359d4.js +0 -2
- package/assets/esri/core/workers/chunks/22b01fe31bbf0bdc48db.js +0 -1
- package/assets/esri/core/workers/chunks/27c2da2e779def2ee08b.js +0 -1
- package/assets/esri/core/workers/chunks/2a1ec30f9ad305763f81.js +0 -2
- package/assets/esri/core/workers/chunks/34570e6bbf559f18c1a5.js +0 -1
- package/assets/esri/core/workers/chunks/5566f14afb63065e438f.js +0 -1
- package/assets/esri/core/workers/chunks/68d8ae42ab71d01a70a5.js +0 -2
- package/assets/esri/core/workers/chunks/8cb716f110d164030309.js +0 -1
- package/assets/esri/core/workers/chunks/8dc1c3042267618fd710.js +0 -2
- package/assets/esri/core/workers/chunks/96c50a0dda0f1503ef92.js +0 -2
- /package/assets/esri/core/workers/chunks/{1b946714ca4a1a7359d4.js.LICENSE.txt → 2cb209bc51a19487692d.js.LICENSE.txt} +0 -0
- /package/assets/esri/core/workers/chunks/{8dc1c3042267618fd710.js.LICENSE.txt → 2e66c969bf4209c957b5.js.LICENSE.txt} +0 -0
- /package/assets/esri/core/workers/chunks/{96c50a0dda0f1503ef92.js.LICENSE.txt → 31640b41e0ecdff892fa.js.LICENSE.txt} +0 -0
- /package/assets/esri/core/workers/chunks/{2a1ec30f9ad305763f81.js.LICENSE.txt → 4e6656a5f29e31902fca.js.LICENSE.txt} +0 -0
- /package/assets/esri/core/workers/chunks/{590e6c70206122e4cc3c.js.LICENSE.txt → 844eedda8f749972f707.js.LICENSE.txt} +0 -0
- /package/assets/esri/core/workers/chunks/{68d8ae42ab71d01a70a5.js.LICENSE.txt → dc51dcaa4e2f9a90f5bd.js.LICENSE.txt} +0 -0
package/views/3d/interactive/measurementTools/directLineMeasurement3D/DirectLineMeasurement3DTool.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import"../../../../../core/has.js";import{destroyMaybe as t}from"../../../../../core/maybe.js";import{memoize as n}from"../../../../../core/memoize.js";import{when as r,syncAndInitial as i,watch as a}from"../../../../../core/reactiveUtils.js";import{property as o,subclass as s}from"../../../../../core/accessorSupport/decorators.js";import{UpdatingHandles as c}from"../../../../../core/support/UpdatingHandles.js";import l from"../../../../../geometry/Point.js";import{clonePoint as u}from"../../../../../layers/graphics/hydratedFeatures.js";import{isPrimaryPointerAction as d}from"../../../analysis/support/measurementUtils.js";import{SnappingVisualizer3D as f}from"../../SnappingVisualizer3D.js";import{screenToMap3D as p,hideManipulatorWhileDragging as m}from"../../editingTools/dragEventPipeline3D.js";import{DirectLineMeasurement3DView as h}from"./DirectLineMeasurement3DView.js";import{getElevationAtPoint as g}from"../../../support/ElevationProvider.js";import{AnalysisToolBase as _}from"../../../../interactive/AnalysisToolBase.js";import{createCoordinateHelper as v}from"../../../../interactive/coordinateHelper.js";import{createManipulatorDragEventPipeline as y,resetProperties as b}from"../../../../interactive/dragEventPipeline.js";import{EditGeometry as x}from"../../../../interactive/editGeometry/EditGeometry.js";import{EditGeometryOperations as S}from"../../../../interactive/editGeometry/EditGeometryOperations.js";import{SnappingContext as C}from"../../../../interactive/snapping/SnappingContext.js";import{createSnapDragEventPipelineStep as w}from"../../../../interactive/snapping/SnappingDragPipelineStep.js";import{
|
|
2
|
+
import{__decorate as e}from"tslib";import"../../../../../core/has.js";import{destroyMaybe as t}from"../../../../../core/maybe.js";import{memoize as n}from"../../../../../core/memoize.js";import{when as r,syncAndInitial as i,watch as a}from"../../../../../core/reactiveUtils.js";import{property as o,subclass as s}from"../../../../../core/accessorSupport/decorators.js";import{UpdatingHandles as c}from"../../../../../core/support/UpdatingHandles.js";import l from"../../../../../geometry/Point.js";import{clonePoint as u}from"../../../../../layers/graphics/hydratedFeatures.js";import{isPrimaryPointerAction as d}from"../../../analysis/support/measurementUtils.js";import{SnappingVisualizer3D as f}from"../../SnappingVisualizer3D.js";import{screenToMap3D as p,hideManipulatorWhileDragging as m}from"../../editingTools/dragEventPipeline3D.js";import{DirectLineMeasurement3DView as h}from"./DirectLineMeasurement3DView.js";import{getElevationAtPoint as g}from"../../../support/ElevationProvider.js";import{AnalysisToolBase as _}from"../../../../interactive/AnalysisToolBase.js";import{createCoordinateHelper as v}from"../../../../interactive/coordinateHelper.js";import{createManipulatorDragEventPipeline as y,resetProperties as b}from"../../../../interactive/dragEventPipeline.js";import{EditGeometry as x}from"../../../../interactive/editGeometry/EditGeometry.js";import{EditGeometryOperations as S}from"../../../../interactive/editGeometry/EditGeometryOperations.js";import{SnappingContext as C}from"../../../../interactive/snapping/SnappingContext.js";import{createSnapDragEventPipelineStep as w}from"../../../../interactive/snapping/SnappingDragPipelineStep.js";import{acquireForFeaturePlacement as T}from"../../../../interactive/snapping/SnappingManagerPool.js";import{setupSnappingToggleHandles as E}from"../../../../interactive/snapping/snappingUtils.js";import{createScreenPointFromEvent as D}from"../../../../support/screenUtils.js";let O=class extends _{constructor(e){super(e),this._updatingHandles=new c,this._snappingManagerResult=null,this._emulatedDrag=null,this.lineState=`initial`,this.removeIncompleteOnCancel=!1,this.startPointSurfaceLocation=null,this.endPointSurfaceLocation=null,this.cursorPointSurfaceLocation=null,this.startManipulator=null,this.endManipulator=null,this.cursorManipulator=null,this._getSnappingContext=n(e=>new C({elevationInfo:{mode:`absolute-height`,offset:0},pointer:e,editGeometryOperations:new S(new x(`point`,v(!0,!1,this.view.spatialReference)),this.view.state.viewingMode),visualizer:new f}))}initialize(){let{view:e,analysis:t,analysisViewData:n,visible:o}=this;this.measurementView=new h({toolState:this,view:e,analysis:t,analysisViewData:n,visible:o});let{start:s,end:c,cursor:d}=this.measurementView.createManipulators(),f=(e,t,n)=>{let r=y(e,(e,r,i,a)=>{let o=m(e),s=this._ensureSnappingManager(),c=this._getSnappingContext(a),d=this._updatingHandles,{lineState:f}=this;i=i.next(o).next(b(this,[n,t])).next(n=>{if(t!==`cursorPoint`){let n=this.analysis[t];n!=null&&(e.location=n)}return n});let h=p(this.view),g=r.next(o).next(e=>{let r=h(e);return!r&&(this.lineState===`drawing`||this.lineState===`initial`)&&(this[t]=null,this[n]=null),r});if(a!==`touch`||f===`editing`){let{snappingStep:e,cancelSnapping:t}=w({snappingManager:s,snappingContext:c,updatingHandles:d});i.next(t),g=g.next(...e)}g.next(e=>e.action===`start`?null:e).next(r=>{let i=u(r.mapEnd,new l);this[t]=i,e.location=i,this[n]=this._surfaceLocation(i,r.surfaceType)})});return t===`cursorPoint`?[r]:[r,e.events.on(`grab-changed`,()=>{let e=s.grabbing||c.grabbing;this.lineState=e?`editing`:`measured`}),this._updatingHandles.add(()=>this.analysis[t],t=>{t&&(e.location=t)})]};this.startManipulator=s,this.endManipulator=c,this.cursorManipulator=d,this.manipulators.add(s),this.manipulators.add(c),this.manipulators.add(d),this.addHandles([...f(s,`startPoint`,`startPointSurfaceLocation`),...f(c,`endPoint`,`endPointSurfaceLocation`),...f(d,`cursorPoint`,`cursorPointSurfaceLocation`),r(()=>this.state===`measured`,()=>{this.finishToolCreation(),this.active&&(this.view.activeTool=null)},i),a(()=>({startPointAvailable:this.startPoint!=null,endPointAvailable:this.endPoint!=null}),({startPointAvailable:e,endPointAvailable:t})=>{this.startManipulator.available=e,this.endManipulator.available=t},i)]),E(this)}destroy(){this._updatingHandles=t(this._updatingHandles),this.measurementView=t(this.measurementView)}get _snappingManager(){return this._snappingManagerResult?.snappingManager}_ensureSnappingManager(){if(this._snappingManagerResult==null){let e=T(this.view);this._snappingManagerResult=e,this.addHandles(e)}return this._snappingManagerResult.snappingManager}get state(){let{analysis:e}=this;if(e.startPoint==null&&e.endPoint==null)return`ready`;let{lineState:t}=this;return this.validMeasurement&&t!==`editing`&&t!==`drawing`?`measured`:`measuring`}get cursor(){return this.active&&(this.state===`ready`||this.lineState!==`measured`)?`crosshair`:null}get startPoint(){return this.analysis.startPoint}set startPoint(e){this.analysis.startPoint=e}get endPoint(){return this.analysis.endPoint}set endPoint(e){this.analysis.endPoint=e}get cursorPoint(){return this.measurementView.cursorPoint}set cursorPoint(e){this.measurementView.cursorPoint=e}get snappingOptions(){return this._snappingManager?.options}get validMeasurement(){return this.analysis.startPoint!=null&&this.analysis.endPoint!=null}get updating(){return this._updatingHandles.updating||!!this._snappingManager?.updating}resetCreated(){super.resetCreated(),this.lineState=`initial`,this.cursorPoint=null,this.state===`measured`&&this.finishToolCreation()}onShow(){this.measurementView.show()}onHide(){this.measurementView.hide()}onDeactivate(){this._emulatedDrag?.cancel(),this._emulatedDrag=null}onInputEvent(e){switch(e.type){case`immediate-click`:this._handleImmediateClick(e);break;case`pointer-move`:this._handlePointerMove(e)}}_handlePointerMove(e){if(!this.active||this.view.navigating)return;let{pointerType:t}=e;if(t!==`mouse`)return;let n=D(e),{lineState:r,cursorManipulator:i,endManipulator:a}=this,o=!1;this.cursorPoint??(this._emulatedDrag?.cancel(),this._emulatedDrag=k(i,t,n),o=!0),r===`initial`&&(this._emulatedDrag?.update(n),o=!0),r===`drawing`&&(a.events.emit(`drag`,{action:`update`,start:n,screenPoint:n}),o=!0),o&&e.stopPropagation()}_handleImmediateClick(e){if(!this.active||!d(e))return;let t=D(e),{pointerType:n}=e,{cursorManipulator:r,startManipulator:i,endManipulator:a,lineState:o}=this,s=!1;switch(this.cursorPoint??(this._emulatedDrag?.cancel(),this._emulatedDrag=k(r,n,t)),o){case`initial`:if(this._emulatedDrag?.update(t),this.cursorPoint!=null){this._emulatedDrag?.end(t),this._emulatedDrag=null,this.analysis.valid&&(this.analysis.clear(),this._set(`created`,!1));let{cursorPoint:e}=this;this.startPoint=e,this.startPointSurfaceLocation=this.cursorPointSurfaceLocation,i.location=e,i.interactive=!1,a.interactive=!1,this.lineState=`drawing`,this._emulatedDrag=k(a,n,t),s=!0}break;case`drawing`:this._emulatedDrag?.update(t),this.endPoint!=null&&(this._emulatedDrag?.end(t),this._emulatedDrag=null,i.interactive=!0,a.interactive=!0,this.lineState=`measured`,s=!0)}s&&e.stopPropagation()}_surfaceLocation(e,t){return t===0?`on-the-surface`:(e.z??0)>=this._getElevation(e)?`above-the-surface`:`below-the-surface`}_getElevation(e){return this.view.groundView?.ready?g(this.view.elevationProvider,e)??0:0}get test(){}};e([o()],O.prototype,`_snappingManagerResult`,void 0),e([o()],O.prototype,`_snappingManager`,null),e([o({readOnly:!0})],O.prototype,`state`,null),e([o()],O.prototype,`lineState`,void 0),e([o({readOnly:!0})],O.prototype,`cursor`,null),e([o()],O.prototype,`startPoint`,null),e([o()],O.prototype,`endPoint`,null),e([o()],O.prototype,`cursorPoint`,null),e([o({constructOnly:!0})],O.prototype,`analysis`,void 0),e([o({constructOnly:!0})],O.prototype,`analysisViewData`,void 0),e([o()],O.prototype,`measurementView`,void 0),e([o()],O.prototype,`removeIncompleteOnCancel`,void 0),e([o({constructOnly:!0})],O.prototype,`view`,void 0),e([o({readOnly:!0})],O.prototype,`validMeasurement`,null),e([o({value:null})],O.prototype,`startPointSurfaceLocation`,void 0),e([o({value:null})],O.prototype,`endPointSurfaceLocation`,void 0),e([o({value:null})],O.prototype,`cursorPointSurfaceLocation`,void 0),e([o()],O.prototype,`updating`,null),O=e([s(`esri.views.3d.interactive.measurementTools.directLineMeasurement3D.DirectLineMeasurement3DTool`)],O);function k(e,t,n){return e.events.emit(`drag`,{action:`start`,pointerType:t,start:n,screenPoint:n}),{update:t=>e.events.emit(`drag`,{action:`update`,start:t,screenPoint:t}),end:t=>e.events.emit(`drag`,{action:`end`,start:t,screenPoint:t}),cancel:()=>e.events.emit(`drag`,{action:`cancel`})}}const A=O;export{A as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import t from"../../../../core/Accessor.js";import{destroyHandle as n,makeHandle as r}from"../../../../core/handleUtils.js";import{deg2rad as i}from"../../../../core/mathUtils.js";import{abortMaybe as a,destroyMaybe as o}from"../../../../core/maybe.js";import{debounce as s}from"../../../../core/promiseUtils.js";import{initial as c,watch as l,syncAndInitial as u}from"../../../../core/reactiveUtils.js";import{getMetersPerUnitForSR as d}from"../../../../core/units.js";import{property as f,subclass as p}from"../../../../core/accessorSupport/decorators.js";import{fromRotation as m}from"../../../../core/libs/gl-matrix-2/math/mat2d.js";import{create as h}from"../../../../core/libs/gl-matrix-2/factories/mat2df64.js";import{set as g,transformMat2d as _}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{create as v}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{UpdatingHandles as y}from"../../../../core/support/UpdatingHandles.js";import{ControlPointOperations as b}from"../../interactive/editingTools/media/ControlPointOperations.js";import{ViewEventPriorities as x}from"../../../input/InputManager.js";import{KeyBindings as S,mediaKeys as C}from"../../../interactive/keybindings.js";import{
|
|
2
|
+
import{__decorate as e}from"tslib";import t from"../../../../core/Accessor.js";import{destroyHandle as n,makeHandle as r}from"../../../../core/handleUtils.js";import{deg2rad as i}from"../../../../core/mathUtils.js";import{abortMaybe as a,destroyMaybe as o}from"../../../../core/maybe.js";import{debounce as s}from"../../../../core/promiseUtils.js";import{initial as c,watch as l,syncAndInitial as u}from"../../../../core/reactiveUtils.js";import{getMetersPerUnitForSR as d}from"../../../../core/units.js";import{property as f,subclass as p}from"../../../../core/accessorSupport/decorators.js";import{fromRotation as m}from"../../../../core/libs/gl-matrix-2/math/mat2d.js";import{create as h}from"../../../../core/libs/gl-matrix-2/factories/mat2df64.js";import{set as g,transformMat2d as _}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{create as v}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{UpdatingHandles as y}from"../../../../core/support/UpdatingHandles.js";import{ControlPointOperations as b}from"../../interactive/editingTools/media/ControlPointOperations.js";import{ViewEventPriorities as x}from"../../../input/InputManager.js";import{KeyBindings as S,mediaKeys as C}from"../../../interactive/keybindings.js";import{acquireForFeaturePlacement as w}from"../../../interactive/snapping/SnappingManagerPool.js";const T=Symbol(),E=Symbol();let D=class extends t{get editSourcePoints(){return!!this.options?.reshapeOptions.editSourcePoints!==this._isEditSourcePointsToggled}get updating(){return this._updatingHandles.updating}get _preferredInteractionTool(){return this.options?.tool??`transform`}get _toolType(){switch(this._preferredInteractionTool){case`transform`:return`transform-3d`;case`reshape`:return`reshape-3d`}}get _validatedSelectedElement(){let e=this.selectedElement;if(!e)return null;let{layer:{source:t}}=this;return t?`hasElement`in t?t.hasElement(e)?e:null:t===e?e:null:null}constructor(e){super(e),this.enabled=!1,this._isEditSourcePointsToggled=!1,this._updatingHandles=new y,this._isOpacityToggled=!1,this._factor=1,this._tool=null,this._object=null,this._createToolAbortController=null,this._onPointerMove=s(async e=>{let t=await this._updatingHandles.addPromise(this._findElementAtScreenPoint(e));this.destroyed||(this.removeHandles(E),t&&t!==this.selectedElement&&this.addHandles(this.view.acquireCursor(`pointer`,`high`),E))}),this._tmpMat2=h(),this._tmpVec2=v()}destroy(){this._createToolAbortController=a(this._createToolAbortController)}initialize(){this.addHandles([n(this._updatingHandles),this._updatingHandles.add(()=>this.enabled,e=>this._enableDisable(e),c),this._updatingHandles.add(()=>this._preferredInteractionTool,e=>this._preferredInteractionToolChanged(e))])}_enableDisable(e){if(!e){this.removeHandles(T);return}this._dynamicImports();let{view:t}=this,n=new S;n.add(C.undo,()=>{this._object?.operations?.undo(),this._object?.emit(`modified-externally`)}),n.add(C.redo,()=>{this._object?.operations?.redo(),this._object?.emit(`modified-externally`)}),n.addToggle(C.preserveAspectRatio,e=>{this._tool?.type===`transform-3d`&&(this._tool.preserveAspectRatio=e.type===`key-down`)}),n.addToggle(C.editSourcePoints,e=>{this._tool?.type===`reshape-3d`&&(this._isEditSourcePointsToggled=e.type===`key-down`)}),n.addToggle(C.rotateIncrements,e=>{this._tool?.type===`transform-3d`&&(this._tool.snapRotation=e.type===`key-down`)}),n.add(C.toggleOpacity,()=>{let e=this._object?.element;e&&(e.opacity*=this._isOpacityToggled?2:.5,this._isOpacityToggled=!this._isOpacityToggled)}),n.add(C.moveUp,()=>this._move(0,this._factor)),n.add(C.moveDown,()=>this._move(0,-this._factor)),n.add(C.moveRight,()=>this._move(this._factor,0)),n.add(C.moveLeft,()=>this._move(-this._factor,0)),n.addToggle(C.factorModifier,e=>this._factor=e.type===`key-down`?10:1),this._isOpacityToggled=!1,this.addHandles([n.register(t,x.TOOL),r(()=>{this._isOpacityToggled&&this.selectedElement&&(this.selectedElement.opacity*=2,this._isOpacityToggled=!1)}),t.on(`immediate-click`,e=>this._onClick(e),x.TOOL),t.on(`pointer-move`,e=>this._onPointerMove(e).catch(()=>{}),x.TOOL),this._updatingHandles.add(()=>this._validatedSelectedElement,(e,t)=>{t&&e!==t&&this._isOpacityToggled&&(t.opacity*=2,this._isOpacityToggled=!1),this._selectedElementChanged(e)},c),r(()=>{this.removeHandles(E),this._removeTool()})],T)}async _onClick(e){await this._updatingHandles.addPromise(e.defer(async()=>{let t=await this._findElementAtScreenPoint(e);this.destroyed||(t&&e.stopPropagation(),this.selectedElement=t,this.selectedElement&&this.removeHandles(E))}))}async _selectedElementChanged(e){if(!e?.georeference){this._removeTool();return}this._object?.element!==e&&await this._updatingHandles.addPromise(this._recreateTool())}async _recreateTool(){this._createToolAbortController=a(this._createToolAbortController),this._removeTool();let e=this._validatedSelectedElement;if(!e)return;let t=new AbortController;this._createToolAbortController=t;let{ManipulatedObject3DMediaElement:n,ExtentTransformTool:i,ReshapeTool3D:s}=await this._dynamicImports();if(t.signal.aborted)return;let{view:c,layer:d,_toolType:f}=this;switch(this._object=new n({view:c,layer:d,element:e,tool:this._preferredInteractionTool}),f){case`transform-3d`:this._tool=new i({view:c,object:this._object}),c.inputManager.isModifierKeyDown(C.rotateIncrements.key)&&(this._tool.snapRotation=!0),c.inputManager.isModifierKeyDown(C.preserveAspectRatio.key)&&(this._tool.preserveAspectRatio=!0);break;case`reshape-3d`:{let e=w(c),{snappingManager:t}=e;this._tool=new s({view:c,object:this._object,enableMidpoints:!1,enableZShape:!1,snappingManager:t,enableMoveObject:!1,autoHideManipulators:!0,enableDeleteVertices:!1,toolOptions:{tooltips:{enabled:!0,inputEnabled:!0,visibleElements:{area:!1}}}}),this.addHandles([e,l(()=>({editSourcePoints:this.editSourcePoints,operations:this._object?.operations}),e=>{e.operations instanceof b&&(e.operations.editSourcePoints=e.editSourcePoints)},u)],this._tool)}}this.addHandles([r(()=>{this._object=o(this._object),this._tool&&=(c.tools.remove(this._tool),null)})],this._tool),c.addAndActivateTool(this._tool)}_preferredInteractionToolChanged(e){let{_tool:t}=this;if(!t)return;if(this._toolType!==t.type){this._updatingHandles.consumePromise(this._recreateTool());return}let{_object:n}=this;if(n){n.tool=e;return}}async _dynamicImports(){let[{ManipulatedObject3DMediaElement:e},{ExtentTransformTool:t,ReshapeTool3D:n}]=await Promise.all([import(`../../interactive/editingTools/ManipulatedObject3DMediaElement.js`),import(`../../interactive/editingTools.js`)]);return{ManipulatedObject3DMediaElement:e,ExtentTransformTool:t,ReshapeTool3D:n}}async _findElementAtScreenPoint(e){let t=(await this.view.hitTest(e,{include:[this.layer]})).results[0];return t?.type===`media`?t.element:null}_removeTool(){this._tool&&this.removeHandles(this._tool)}_move(e,t){let{view:n,_object:r}=this,a=r?.operations;if(!a)return;let o=n.overlayPixelSizeInMapUnits(n.pointsOfInterest.focus.location)*d(n.spatialReference)/d(a.data.spatialReference),{_tmpMat2:s,_tmpVec2:c}=this,l=m(s,i(360-this.view.camera.heading)),u=g(c,o*e,o*t);_(u,u,l),a.move(u[0],u[1],0),r.emit(`modified-externally`)}};e([f({constructOnly:!0})],D.prototype,`view`,void 0),e([f({constructOnly:!0})],D.prototype,`layer`,void 0),e([f()],D.prototype,`selectedElement`,void 0),e([f()],D.prototype,`enabled`,void 0),e([f()],D.prototype,`options`,void 0),e([f()],D.prototype,`editSourcePoints`,null),e([f()],D.prototype,`_isEditSourcePointsToggled`,void 0),e([f()],D.prototype,`updating`,null),e([f()],D.prototype,`_preferredInteractionTool`,null),e([f()],D.prototype,`_validatedSelectedElement`,null),D=e([p(`esri.views.3d.layers.support.MediaLayerInteraction`)],D);export{D as MediaLayerInteraction};
|
package/views/View.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import t from"../Map.js";import{createTask as n}from"../core/asyncUtils.js";import r from"../core/Collection.js";import i from"../core/CollectionFlattener.js";import{referenceSetter as a}from"../core/collectionUtils.js";import o from"../core/Error.js";import{EventedMixin as s}from"../core/Evented.js";import c from"../core/Handles.js";import{makeHandle as l}from"../core/handleUtils.js";import has from"../core/has.js";import{isLoadable as u}from"../core/Loadable.js";import d from"../core/Logger.js";import{destroyMaybe as f,abortMaybe as ee}from"../core/maybe.js";import{EsriPromise as te}from"../core/Promise.js";import{after as p}from"../core/promiseUtils.js";import m from"../core/ReactiveSet.js";import{watch as h,sync as g,whenOnce as _,when as v,syncAndInitial as y}from"../core/reactiveUtils.js";import{property as b,subclass as x}from"../core/accessorSupport/decorators.js";import{owningCollectionProperty as S}from"../core/support/OwningCollection.js";import{UpdatingHandles as C}from"../core/support/UpdatingHandles.js";import ne from"../geometry/Extent.js";import w from"../geometry/HeightModelInfo.js";import T from"../geometry/SpatialReference.js";import{equals as E}from"../geometry/support/spatialReferenceUtils.js";import{AnalysesCollection as D}from"../support/AnalysesCollection.js";import{GraphicsCollection as O}from"../support/GraphicsCollection.js";import{system as k}from"../time/constants.js";import A from"../time/TimeExtent.js";import{isTimeZoneValid as j}from"../time/timeZoneUtils.js";import M from"./BasemapView.js";import N from"./Magnifier.js";import P from"./SelectionManager.js";import F from"./Theme.js";import{ToolViewManager as I}from"./ToolViewManager.js";import{GlyphMosaic as L}from"./2d/engine/webgl/GlyphMosaic.js";import{makeDefaultHighlightOptions as R}from"./3d/support/DefaultHighlights.js";import z from"./input/Input.js";import{ViewEvents as B}from"./input/ViewEvents.js";import V from"./interactive/options/ViewOptions.js";import H from"./navigation/Navigation.js";import{deduplicateAttributionItems as U}from"./support/attributionUtils.js";import{DefaultsFromMap as W}from"./support/DefaultsFromMap.js";import{defaultHighlightName as G}from"./support/HighlightDefaults.js";import K from"./support/HighlightOptions.js";import q from"./support/LayerViewManager.js";import J from"./support/RequiredFieldsOptions.js";import{checkWebAssemblyRequirements as Y}from"./support/WebAssemblyRequirements.js";import{checkWebGLRequirements as X}from"./support/WebGLRequirements.js";var Z;let Q=class extends s(te){static{Z=this}constructor(e){super(e),this._userSpatialReference=null,this.handles=new c,this.updatingHandles=new C,this.allLayerViews=new i({getCollections:()=>this.layerviewCollections,getChildrenFunction:re}),this.animationsEnabled=!0,this.focusRegionVisible=!1,this.focusRegionShortcutEnabled=!1,this.attributionVisible=!0,this.basemapView=null,this.dependencies={popup:void 0},this.displayFilterEnabled=!0,this.fatalError=null,this.graphics=new O,this.typeSpecificPreconditionsReady=!0,this.layerViews=new r,this.magnifier=new N,this.options=new V,this.padding={left:0,top:0,right:0,bottom:0},this.ready=!1,this._readyStateWaitingTask=null,this.type=null,this.scale=null,this.updating=!1,this.initialExtentRequired=!0,this._lowPriorityCursorHandles=new r,this._highPriorityCursorHandles=new r,this.input=new z,this.navigation=new H,this.layerViewManager=null,this.analysisViewManager=null,this.isHeightModelInfoRequired=!1,this.width=null,this.height=null,this.resizing=!1,this.suspended=!1,this.viewEvents=new B(this),this.requiredFieldsOptions=new J,this._isValid=!1,this._readyCycleForced=!1,this._lockedSpatialReference=null,this._userTimeZone=null,this._lockedTimeZone=null,this._userTimeExtent=null,this._lockedTimeExtent=null,this._glyphMosaic=null,this.theme=null,this.registeredComponents=new m,this.handles.add(h(()=>this.preconditionsReady,e=>{let t=this.ready;if(e?(this._lockedSpatialReference=this.spatialReference,this._lockedTimeZone=this.timeZone,this._lockedTimeExtent=this.timeExtent,Z.views.add(this)):(this._lockedSpatialReference=null,Z.views.remove(this)),this.notifyChange(`spatialReference`),!e&&t)this.toolViewManager?.detach(),this.analysisViewManager?.detach(),this.layerViewManager?.clear(),this._glyphMosaic?.dispose(),this._teardown();else if(e&&!t){try{this._startup()}catch(e){queueMicrotask(()=>{this.fatalError=new o(`view:startup-error`,`View._startup failed`,e)});return}this._glyphMosaic=new L(1024,1024,!0),this.analysisViewManager?.attach(),this.toolViewManager.attach()}},g)),this.analyses=new D}initialize(){this.addResolvingPromise(Promise.all([this.loadAsyncDependencies(),this.validate()]).then(()=>(this._isValid=!0,_(()=>this.ready)))),this.basemapView=new M({view:this}),this.layerViewManager=new q({view:this,layerViewFilter:e=>this.layerViewFilter?.(e)??!0,layerViewImporter:{importLayerView:e=>this.importLayerView(e),hasLayerViewModule:e=>this.hasLayerViewModule(e)},layerviewMapping:this._layerToLayerviewMapping}),this.toolViewManager=new I({view:this}),this.selectionManager=new P({view:this}),this.addHandles([v(()=>this.readyState===`map-content-error`&&!this.spatialReference,()=>{d.getLogger(this).warn(`#spatialReference`,`no spatial reference could be derived from the currently added map layers`)}),h(()=>this.initialExtentRequired,e=>this.defaultsFromMap.required={...this.defaultsFromMap.required,extent:e},y),h(()=>this.ready,e=>{this.defaultsFromMap&&(this.defaultsFromMap.viewReady=e)},g),h(()=>this.defaultsFromMapInputSpatialReference(),e=>{this.defaultsFromMap&&(this.defaultsFromMap.inputSpatialReference=e)},y),h(()=>this.defaultsFromMapInputHeightModelInfo(),e=>{this.defaultsFromMap&&(this.defaultsFromMap.inputHeightModelInfo=e)},y)])}get _layerToLayerviewMapping(){return Z._layerToLayerview}static{this._layerToLayerview=[[`view.map.basemap.baseLayers`,`view.basemapView.baseLayerViews`],[`view.map.basemap.groundLayers`,`view.basemapView.groundLayerViews`],[`view.map.basemap.referenceLayers`,`view.basemapView.referenceLayerViews`],[`view.map.layers`,`view.layerViews`]]}destroy(){this.destroyed||(Z.views.remove(this),this.viewEvents.destroy(),this.allLayerViews.destroy(),this.navigation&&(this.navigation.destroy(),this._set(`navigation`,null)),this.graphics=f(this.graphics),this.analyses=f(this.analyses),this.defaultsFromMap.destroy(),this._set(`defaultsFromMap`,null),this.analysisViewManager=f(this.analysisViewManager),this.toolViewManager=f(this.toolViewManager),this.layerViewManager=f(this.layerViewManager),this.selectionManager=f(this.selectionManager),this.basemapView=f(this.basemapView),this.layerViews.destroyAll(),this.invalidate(),this.handles.destroy(),this.map=f(this.map),this.updatingHandles.destroy())}_startup(){this._set(`ready`,!0)}_teardown(){this._set(`ready`,!1)}whenReady(){return Promise.resolve(this)}toMap(){return d.getLogger(this).error(`#toMap()`,`Not implemented on this instance of View`),null}get activeTool(){return this.toolViewManager?.activeTool}set activeTool(e){this.toolViewManager&&(this.toolViewManager.activeTool=e)}get layerviewCollections(){return[this.basemapView?.baseLayerViews,this.basemapView?.groundLayerViews,this.layerViews,this.basemapView?.referenceLayerViews]}get analyses(){return this._get(`analyses`)}set analyses(e){this._set(`analyses`,e)}get animation(){return this._get(`animation`)}set animation(e){this._set(`animation`,e)}get focusRegion(){return null}get attributionItems(){return this.suspended?[]:U(this._get(`attributionItems`),this.getAttributionItems())}get center(){return null}get defaultsFromMapSettings(){return{}}get defaultsFromMap(){return new W({required:{tileInfo:!1,heightModelInfo:!1,extent:!1},map:()=>this.map,getSpatialReferenceSupport:(e,t)=>this.getSpatialReferenceSupport(e,t),...this.defaultsFromMapSettings})}get extent(){return this._get(`extent`)}set extent(e){this._set(`extent`,e)}get heightModelInfo(){return this.getDefaultHeightModelInfo()}glyphMosaic(){return this._glyphMosaic}get highlights(){return this._get(`highlights`)??R()}set highlights(e){this._set(`highlights`,a(e,this._get(`highlights`),r.ofType(K)))}get defaultHighlight(){return this.highlights.find(({name:e})=>e===G)}get interacting(){return this.navigating}get navigating(){return!1}get preconditionsReady(){if(this.destroying||this.destroyed)return!1;let{map:e,spatialReference:t}=this;return!!(!this.fatalError&&this._isValid&&!this._readyCycleForced&&e&&(!u(e)||e.loaded)&&this.width!==0&&this.height!==0&&t&&this._validateSpatialReference(t)&&(this._lockedSpatialReference||this.defaultsFromMap?.ready)&&this.typeSpecificPreconditionsReady)}get resolution(){return 0}set map(e){let t=this._get(`map`);e!==t&&(e?.destroyed&&(d.getLogger(this).warn(`#map`,`The provided map is already destroyed`,{map:e}),e=null),u(e)&&e.load().catch(()=>{}),this.constructed&&!this.destroyed&&(this.forceReadyCycle(),this._lockedSpatialReference=null),this._set(`map`,e))}get canZoomIn(){return!!this.ready}get canZoomOut(){return!!this.ready}get readyState(){if(this.destroyed)return this._get(`readyState`);if(!this.map)return`missing-map`;if(`container`in this&&!this.container)return`missing-container`;if(this.fatalError)return`rendering-error`;if((this.defaultsFromMap?.ready??!1)&&!this.spatialReference){let e=!(`loaded`in this.map)||this.map.loaded,t=this.map.ground.loaded,r=this.map.basemap?.loaded??!0;return e&&r&&t&&!this.map?.allLayers.length?`empty-map`:(this._readyStateWaitingTask||(this._readyStateWaitingTask=n(e=>p(has(`view-readyState-waiting-delay`),null,e)),this.addHandles(this._readyStateWaitingTask),this.addHandles(this._readyStateWaitingTask,`ready-state-task`)),this._readyStateWaitingTask?.finished?`map-content-error`:`loading`)}return this._readyStateWaitingTask=ee(this._readyStateWaitingTask),this.removeHandles(`ready-state-task`),this.ready?`ready`:`loading`}get spatialReference(){let{_userSpatialReference:e}=this;if(e&&e.vcsWkid!==null)return e;let t=e??this._lockedSpatialReference??this.getWebDocumentSpatialReference()??this.defaultsFromMap?.spatialReference??null,n=this.defaultsFromMap?.combinedHorizontalAndVerticalSpatialReference;return n?.equals(t)?n:t}set spatialReference(e){let t=!E(e,this._get(`spatialReference`));this._set(`_userSpatialReference`,e),t&&(this._set(`spatialReference`,e),this._spatialReferenceChanged(this.spatialReference))}_spatialReferenceChanged(e){}getWebDocumentSpatialReference(){return null}defaultsFromMapInputSpatialReference(){return this._userSpatialReference??this.getWebDocumentSpatialReference()??(this.ready?this._lockedSpatialReference:null)}defaultsFromMapInputHeightModelInfo(){return this.map?.heightModelInfo??null}get stationary(){return!this.animation&&!this.navigating&&!this.resizing}get timeExtent(){return this._userTimeExtent??this._lockedTimeExtent??this.getDefaultTimeExtent()??null}set timeExtent(e){this._userTimeExtent=e}get timeZone(){return this._userTimeZone??this._lockedTimeZone??this.getDefaultTimeZone()??k}set timeZone(e){this._userTimeZone=e,j(e)||d.getLogger(this).warn(`#timeZone`,`the parsed value '${e}' may not be a valid IANA time zone`)}get tools(){return this.toolViewManager?.tools}get initialExtent(){return this.defaultsFromMap?.extent}get cursor(){return this.toolViewManager?.cursor??this._highPriorityCursorHandles.at(-1)?.cursor??this._lowPriorityCursorHandles.at(-1)?.cursor??`default`}acquireCursor(e,t=`low`){let n=t===`high`?this._highPriorityCursorHandles:this._lowPriorityCursorHandles,r={cursor:e},i=l(()=>n.remove(r));return n.add(r),this.addHandles(i),i}get size(){return[this.width,this.height]}get effectiveTheme(){return this.theme??new F}registerComponent(e){this.registeredComponents.add(e)}unregisterComponent(e){this.registeredComponents.delete(e)}whenLayerView(e){return this.layerViewManager?.whenLayerView(e)??Promise.reject()}getAttributionItems(){return this.allLayerViews.items.flatMap(e=>e.attributionItems)}getDefaultHeightModelInfo(){return(this.map&&`heightModelInfo`in this.map?this.map.heightModelInfo:void 0)??this.defaultsFromMap?.heightModelInfo??null}getDefaultTimeZone(){return null}getDefaultTimeExtent(){return null}getSurface(){return null}importLayerView(e){throw new o(`view:importLayerView-missing`,`importLayerView() not implemented`)}hasLayerViewModule(e){return!1}async validate(){let e=X(this.type);if(e)throw this._displayWebGLError(),d.getLogger(this).warn(`#validate()`,e.message),e;let t=await Y();if(t)throw d.getLogger(this).warn(`#validate()`,t.message),t}async loadAsyncDependencies(){}invalidate(){this._isValid=!1}getSpatialReferenceSupport(){return{constraints:null}}_validateSpatialReference(e){return this.getSpatialReferenceSupport(e)!=null}when(e,t){return this.isResolved()&&!this.ready&&d.getLogger(this).warn(`#when()`,`Calling view.when() while the view is no longer ready but was already resolved once will resolve immediately. Use reactiveUtils.whenOnce(() => view.ready).then(...) instead.`),super.when(e,t)}forceReadyCycle(){this.ready&&(v(()=>this.destroyed||this.preconditionsReady===!1,()=>this._readyCycleForced=!1,{once:!0}),this._readyCycleForced=!0)}on(e,t){return super.on(e,t)}addAndActivateTool(e){this.toolViewManager.tools.add(e),this.activeTool=e}tryFatalErrorRecovery(){this.fatalError=null}static{this.views=new r}_displayWebGLError(){let e=document.createElement(`div`);e.setAttribute(`style`,`display: flex; flex-direction: column; gap: 8px; padding: 20px; height: 100%; justify-content: center; color: black; background: white; font-family: sans-serif;`);let t=document.createElement(`div`);t.innerHTML=`Unable to display map. WebGL2 support is required.`,t.setAttribute(`style`,`font-size: 24px; font-weight: bold;`);let n=document.createElement(`div`);n.innerHTML=`Ensure that your browser and hardware meet the minimum requirements.`,n.setAttribute(`style`,`font-size: 18px;`);let r=document.createElement(`a`);r.innerHTML=`https://esriurl.com/webgl-faq`,r.target=`_blank`,r.setAttribute(`style`,`font-size: 18px;`),r.href=`https://esriurl.com/webgl-faq`,e.appendChild(t),e.appendChild(n),e.appendChild(r);let i=this.getSurface();i&&i.appendChild(e)}};e([b()],Q.prototype,`_userSpatialReference`,void 0),e([b()],Q.prototype,`activeTool`,null),e([b({readOnly:!0})],Q.prototype,`allLayerViews`,void 0),e([b({readOnly:!0})],Q.prototype,`layerviewCollections`,null),e([b(S(D,`analyses`))],Q.prototype,`analyses`,null),e([b()],Q.prototype,`animation`,null),e([b()],Q.prototype,`animationsEnabled`,void 0),e([b()],Q.prototype,`focusRegionVisible`,void 0),e([b()],Q.prototype,`focusRegionShortcutEnabled`,void 0),e([b()],Q.prototype,`focusRegion`,null),e([b({readOnly:!0})],Q.prototype,`attributionItems`,null),e([b()],Q.prototype,`attributionVisible`,void 0),e([b()],Q.prototype,`basemapView`,void 0),e([b()],Q.prototype,`center`,null),e([b()],Q.prototype,`defaultsFromMapSettings`,null),e([b()],Q.prototype,`defaultsFromMap`,null),e([b()],Q.prototype,`dependencies`,void 0),e([b()],Q.prototype,`displayFilterEnabled`,void 0),e([b({type:ne})],Q.prototype,`extent`,null),e([b()],Q.prototype,`fatalError`,void 0),e([b(S(O,`graphics`))],Q.prototype,`graphics`,void 0),e([b({readOnly:!0,type:w})],Q.prototype,`heightModelInfo`,null),e([b({type:r.ofType(K)})],Q.prototype,`highlights`,null),e([b({readOnly:!0})],Q.prototype,`interacting`,null),e([b({constructOnly:!0})],Q.prototype,`layerViewFilter`,void 0),e([b({readOnly:!0})],Q.prototype,`navigating`,null),e([b({readOnly:!0})],Q.prototype,`preconditionsReady`,null),e([b({readOnly:!0})],Q.prototype,`typeSpecificPreconditionsReady`,void 0),e([b({type:r,readOnly:!0})],Q.prototype,`layerViews`,void 0),e([b()],Q.prototype,`resolution`,null),e([b({type:N})],Q.prototype,`magnifier`,void 0),e([b({nonNullable:!0,type:V})],Q.prototype,`options`,void 0),e([b({value:null,type:t})],Q.prototype,`map`,null),e([b()],Q.prototype,`padding`,void 0),e([b({readOnly:!0})],Q.prototype,`ready`,void 0),e([b({readOnly:!0})],Q.prototype,`canZoomIn`,null),e([b({readOnly:!0})],Q.prototype,`canZoomOut`,null),e([b()],Q.prototype,`_readyStateWaitingTask`,void 0),e([b({readOnly:!0})],Q.prototype,`readyState`,null),e([b({type:T})],Q.prototype,`spatialReference`,null),e([b()],Q.prototype,`stationary`,null),e([b({type:A})],Q.prototype,`timeExtent`,null),e([b({type:String,nonNullable:!0})],Q.prototype,`timeZone`,null),e([b()],Q.prototype,`tools`,null),e([b()],Q.prototype,`toolViewManager`,void 0),e([b({readOnly:!0})],Q.prototype,`type`,void 0),e([b({type:Number})],Q.prototype,`scale`,void 0),e([b({readOnly:!0})],Q.prototype,`updating`,void 0),e([b({readOnly:!0})],Q.prototype,`initialExtentRequired`,void 0),e([b({readOnly:!0})],Q.prototype,`initialExtent`,null),e([b()],Q.prototype,`cursor`,null),e([b({readOnly:!0})],Q.prototype,`input`,void 0),e([b({type:H,nonNullable:!0})],Q.prototype,`navigation`,void 0),e([b()],Q.prototype,`layerViewManager`,void 0),e([b()],Q.prototype,`analysisViewManager`,void 0),e([b()],Q.prototype,`selectionManager`,void 0),e([b()],Q.prototype,`width`,void 0),e([b()],Q.prototype,`height`,void 0),e([b({readOnly:!0})],Q.prototype,`resizing`,void 0),e([b({value:null,readOnly:!0})],Q.prototype,`size`,null),e([b({readOnly:!0})],Q.prototype,`suspended`,void 0),e([b({readOnly:!0})],Q.prototype,`viewEvents`,void 0),e([b()],Q.prototype,`_isValid`,void 0),e([b()],Q.prototype,`_readyCycleForced`,void 0),e([b()],Q.prototype,`_lockedSpatialReference`,void 0),e([b()],Q.prototype,`_userTimeZone`,void 0),e([b()],Q.prototype,`_lockedTimeZone`,void 0),e([b()],Q.prototype,`_userTimeExtent`,void 0),e([b()],Q.prototype,`_lockedTimeExtent`,void 0),e([b({type:F})],Q.prototype,`theme`,void 0),e([b({readOnly:!0,type:F})],Q.prototype,`effectiveTheme`,null),e([b({readOnly:!0})],Q.prototype,`registeredComponents`,void 0),Q=Z=e([x(`esri.views.View`)],Q);const $=globalThis.$arcgis;$&&!$.views&&Object.defineProperty($,"views",{configurable:!1,enumerable:!0,writable:!1,value:Q.views});function re(e){return e.layerViews}export{Q as default};
|
|
2
|
+
import{__decorate as e}from"tslib";import t from"../Map.js";import{createTask as n}from"../core/asyncUtils.js";import r from"../core/Collection.js";import i from"../core/CollectionFlattener.js";import{referenceSetter as a}from"../core/collectionUtils.js";import o from"../core/Error.js";import{EventedMixin as s}from"../core/Evented.js";import c from"../core/Handles.js";import{makeHandle as l}from"../core/handleUtils.js";import has from"../core/has.js";import{isLoadable as u}from"../core/Loadable.js";import d from"../core/Logger.js";import{destroyMaybe as f,abortMaybe as ee}from"../core/maybe.js";import{EsriPromise as te}from"../core/Promise.js";import{after as p}from"../core/promiseUtils.js";import m from"../core/ReactiveSet.js";import{watch as h,sync as g,whenOnce as _,when as v,syncAndInitial as y}from"../core/reactiveUtils.js";import{property as b,subclass as x}from"../core/accessorSupport/decorators.js";import{owningCollectionProperty as S}from"../core/support/OwningCollection.js";import{UpdatingHandles as C}from"../core/support/UpdatingHandles.js";import ne from"../geometry/Extent.js";import w from"../geometry/HeightModelInfo.js";import T from"../geometry/SpatialReference.js";import{equals as E}from"../geometry/support/spatialReferenceUtils.js";import{AnalysesCollection as D}from"../support/AnalysesCollection.js";import{GraphicsCollection as O}from"../support/GraphicsCollection.js";import{system as k}from"../time/constants.js";import A from"../time/TimeExtent.js";import{isTimeZoneValid as j}from"../time/timeZoneUtils.js";import M from"./BasemapView.js";import N from"./Magnifier.js";import P from"./SelectionManager.js";import F from"./Theme.js";import{ToolViewManager as I}from"./ToolViewManager.js";import{GlyphMosaic as L}from"./2d/engine/webgl/GlyphMosaic.js";import{makeDefaultHighlightOptions as R}from"./3d/support/DefaultHighlights.js";import z from"./input/Input.js";import{ViewEvents as B}from"./input/ViewEvents.js";import V from"./interactive/options/ViewOptions.js";import H from"./navigation/Navigation.js";import{deduplicateAttributionItems as U}from"./support/attributionUtils.js";import{DefaultsFromMap as W}from"./support/DefaultsFromMap.js";import{defaultHighlightName as G}from"./support/HighlightDefaults.js";import K from"./support/HighlightOptions.js";import q from"./support/LayerViewManager.js";import J from"./support/RequiredFieldsOptions.js";import{checkWebAssemblyRequirements as Y}from"./support/WebAssemblyRequirements.js";import{checkWebGLRequirements as X}from"./support/WebGLRequirements.js";var Z;let Q=class extends s(te){static{Z=this}constructor(e){super(e),this._userSpatialReference=null,this.handles=new c,this.updatingHandles=new C,this.allLayerViews=new i({getCollections:()=>this.layerviewCollections,getChildrenFunction:re}),this.animationsEnabled=!0,this.focusRegionVisible=!1,this.focusRegionShortcutEnabled=!1,this.attributionVisible=!0,this.basemapView=null,this.dependencies={popup:void 0},this.displayFilterEnabled=!0,this.fatalError=null,this.graphics=new O,this.typeSpecificPreconditionsReady=!0,this.layerViews=new r,this.magnifier=new N,this.options=new V,this.padding={left:0,top:0,right:0,bottom:0},this.ready=!1,this._readyStateWaitingTask=null,this.type=null,this.scale=null,this.updating=!1,this.initialExtentRequired=!0,this._lowPriorityCursorHandles=new r,this._highPriorityCursorHandles=new r,this.input=new z,this.navigation=new H,this.layerViewManager=null,this.analysisViewManager=null,this.isHeightModelInfoRequired=!1,this.width=null,this.height=null,this.resizing=!1,this.suspended=!1,this.viewEvents=new B(this),this.requiredFieldsOptions=new J,this._isValid=!1,this._readyCycleForced=!1,this._lockedSpatialReference=null,this._userTimeZone=null,this._lockedTimeZone=null,this._userTimeExtent=null,this._lockedTimeExtent=null,this._glyphMosaic=null,this.theme=null,this.registeredComponents=new m,this.handles.add(h(()=>this.preconditionsReady,e=>{let t=this.ready;if(e?(this._lockedSpatialReference=this.spatialReference,this._lockedTimeZone=this.timeZone,this._lockedTimeExtent=this.timeExtent,Z.views.add(this)):(this._lockedSpatialReference=null,Z.views.remove(this)),this.notifyChange(`spatialReference`),!e&&t)this.toolViewManager?.detach(),this.analysisViewManager?.detach(),this.layerViewManager?.clear(),this._glyphMosaic?.dispose(),this._teardown();else if(e&&!t){try{this._startup()}catch(e){queueMicrotask(()=>{this.fatalError=new o(`view:startup-error`,`View._startup failed`,e)});return}this._glyphMosaic=new L(1024,1024,!0),this.analysisViewManager?.attach(),this.toolViewManager.attach()}},g)),this.analyses=new D}initialize(){this.addResolvingPromise(Promise.all([this.loadAsyncDependencies(),this.validate()]).then(()=>(this._isValid=!0,_(()=>this.ready)))),this.basemapView=new M({view:this}),this.layerViewManager=new q({view:this,layerViewFilter:e=>this.layerViewFilter?.(e)??!0,layerViewImporter:{importLayerView:e=>this.importLayerView(e),hasLayerViewModule:e=>this.hasLayerViewModule(e)},layerviewMapping:this._layerToLayerviewMapping}),this.toolViewManager=new I({view:this}),this.selectionManager=new P({view:this}),this.addHandles([v(()=>this.readyState===`map-content-error`&&!this.spatialReference,()=>{d.getLogger(this).warn(`#spatialReference`,`no spatial reference could be derived from the currently added map layers`)}),h(()=>[this.defaultsFromMap,this.initialExtentRequired],([e,t])=>{e&&(e.required={...e.required,extent:t})},y),h(()=>[this.defaultsFromMap,this.ready],([e,t])=>{e&&(e.viewReady=t)},g),h(()=>[this.defaultsFromMap,this.defaultsFromMapInputSpatialReference()],([e,t])=>{e&&(e.inputSpatialReference=t)},y),h(()=>[this.defaultsFromMap,this.defaultsFromMapInputHeightModelInfo()],([e,t])=>{e&&(e.inputHeightModelInfo=t)},y)])}get _layerToLayerviewMapping(){return Z._layerToLayerview}static{this._layerToLayerview=[[`view.map.basemap.baseLayers`,`view.basemapView.baseLayerViews`],[`view.map.basemap.groundLayers`,`view.basemapView.groundLayerViews`],[`view.map.basemap.referenceLayers`,`view.basemapView.referenceLayerViews`],[`view.map.layers`,`view.layerViews`]]}destroy(){this.destroyed||(Z.views.remove(this),this.viewEvents.destroy(),this.allLayerViews.destroy(),this.navigation&&(this.navigation.destroy(),this._set(`navigation`,null)),this.graphics=f(this.graphics),this.analyses=f(this.analyses),this.defaultsFromMap.destroy(),this._set(`defaultsFromMap`,null),this.analysisViewManager=f(this.analysisViewManager),this.toolViewManager=f(this.toolViewManager),this.layerViewManager=f(this.layerViewManager),this.selectionManager=f(this.selectionManager),this.basemapView=f(this.basemapView),this.layerViews.destroyAll(),this.invalidate(),this.handles.destroy(),this.map=f(this.map),this.updatingHandles.destroy())}_startup(){this._set(`ready`,!0)}_teardown(){this._set(`ready`,!1)}whenReady(){return Promise.resolve(this)}toMap(){return d.getLogger(this).error(`#toMap()`,`Not implemented on this instance of View`),null}get activeTool(){return this.toolViewManager?.activeTool}set activeTool(e){this.toolViewManager&&(this.toolViewManager.activeTool=e)}get layerviewCollections(){return[this.basemapView?.baseLayerViews,this.basemapView?.groundLayerViews,this.layerViews,this.basemapView?.referenceLayerViews]}get analyses(){return this._get(`analyses`)}set analyses(e){this._set(`analyses`,e)}get animation(){return this._get(`animation`)}set animation(e){this._set(`animation`,e)}get focusRegion(){return null}get attributionItems(){return this.suspended?[]:U(this._get(`attributionItems`),this.getAttributionItems())}get center(){return null}get defaultsFromMapSettings(){return{}}get defaultsFromMap(){return new W({required:{tileInfo:!1,heightModelInfo:!1,extent:!1},map:()=>this.map,getSpatialReferenceSupport:(e,t)=>this.getSpatialReferenceSupport(e,t),...this.defaultsFromMapSettings})}get extent(){return this._get(`extent`)}set extent(e){this._set(`extent`,e)}get heightModelInfo(){return this.getDefaultHeightModelInfo()}glyphMosaic(){return this._glyphMosaic}get highlights(){return this._get(`highlights`)??R()}set highlights(e){this._set(`highlights`,a(e,this._get(`highlights`),r.ofType(K)))}get defaultHighlight(){return this.highlights.find(({name:e})=>e===G)}get interacting(){return this.navigating}get navigating(){return!1}get preconditionsReady(){if(this.destroying||this.destroyed)return!1;let{map:e,spatialReference:t}=this;return!!(!this.fatalError&&this._isValid&&!this._readyCycleForced&&e&&(!u(e)||e.loaded)&&this.width!==0&&this.height!==0&&t&&this._validateSpatialReference(t)&&(this._lockedSpatialReference||this.defaultsFromMap?.ready)&&this.typeSpecificPreconditionsReady)}get resolution(){return 0}set map(e){let t=this._get(`map`);e!==t&&(e?.destroyed&&(d.getLogger(this).warn(`#map`,`The provided map is already destroyed`,{map:e}),e=null),u(e)&&e.load().catch(()=>{}),this.constructed&&!this.destroyed&&(this.forceReadyCycle(),this._lockedSpatialReference=null),this._set(`map`,e))}get canZoomIn(){return!!this.ready}get canZoomOut(){return!!this.ready}get readyState(){if(this.destroyed)return this._get(`readyState`);if(!this.map)return`missing-map`;if(`container`in this&&!this.container)return`missing-container`;if(this.fatalError)return`rendering-error`;if((this.defaultsFromMap?.ready??!1)&&!this.spatialReference){let e=!(`loaded`in this.map)||this.map.loaded,t=this.map.ground.loaded,r=this.map.basemap?.loaded??!0;return e&&r&&t&&!this.map?.allLayers.length?`empty-map`:(this._readyStateWaitingTask||(this._readyStateWaitingTask=n(e=>p(has(`view-readyState-waiting-delay`),null,e)),this.addHandles(this._readyStateWaitingTask),this.addHandles(this._readyStateWaitingTask,`ready-state-task`)),this._readyStateWaitingTask?.finished?`map-content-error`:`loading`)}return this._readyStateWaitingTask=ee(this._readyStateWaitingTask),this.removeHandles(`ready-state-task`),this.ready?`ready`:`loading`}get spatialReference(){let{_userSpatialReference:e}=this;if(e&&e.vcsWkid!==null)return e;let t=e??this._lockedSpatialReference??this.getWebDocumentSpatialReference()??this.defaultsFromMap?.spatialReference??null,n=this.defaultsFromMap?.combinedHorizontalAndVerticalSpatialReference;return n?.equals(t)?n:t}set spatialReference(e){let t=!E(e,this._get(`spatialReference`));this._set(`_userSpatialReference`,e),t&&(this._set(`spatialReference`,e),this._spatialReferenceChanged(this.spatialReference))}_spatialReferenceChanged(e){}getWebDocumentSpatialReference(){return null}defaultsFromMapInputSpatialReference(){return this._userSpatialReference??this.getWebDocumentSpatialReference()??(this.ready?this._lockedSpatialReference:null)}defaultsFromMapInputHeightModelInfo(){return this.map?.heightModelInfo??null}get stationary(){return!this.animation&&!this.navigating&&!this.resizing}get timeExtent(){return this._userTimeExtent??this._lockedTimeExtent??this.getDefaultTimeExtent()??null}set timeExtent(e){this._userTimeExtent=e}get timeZone(){return this._userTimeZone??this._lockedTimeZone??this.getDefaultTimeZone()??k}set timeZone(e){this._userTimeZone=e,j(e)||d.getLogger(this).warn(`#timeZone`,`the parsed value '${e}' may not be a valid IANA time zone`)}get tools(){return this.toolViewManager?.tools}get initialExtent(){return this.defaultsFromMap?.extent}get cursor(){return this.toolViewManager?.cursor??this._highPriorityCursorHandles.at(-1)?.cursor??this._lowPriorityCursorHandles.at(-1)?.cursor??`default`}acquireCursor(e,t=`low`){let n=t===`high`?this._highPriorityCursorHandles:this._lowPriorityCursorHandles,r={cursor:e},i=l(()=>n.remove(r));return n.add(r),this.addHandles(i),i}get size(){return[this.width,this.height]}get effectiveTheme(){return this.theme??new F}registerComponent(e){this.registeredComponents.add(e)}unregisterComponent(e){this.registeredComponents.delete(e)}whenLayerView(e){return this.layerViewManager?.whenLayerView(e)??Promise.reject()}getAttributionItems(){return this.allLayerViews.items.flatMap(e=>e.attributionItems)}getDefaultHeightModelInfo(){return(this.map&&`heightModelInfo`in this.map?this.map.heightModelInfo:void 0)??this.defaultsFromMap?.heightModelInfo??null}getDefaultTimeZone(){return null}getDefaultTimeExtent(){return null}getSurface(){return null}importLayerView(e){throw new o(`view:importLayerView-missing`,`importLayerView() not implemented`)}hasLayerViewModule(e){return!1}async validate(){let e=X(this.type);if(e)throw this._displayWebGLError(),d.getLogger(this).warn(`#validate()`,e.message),e;let t=await Y();if(t)throw d.getLogger(this).warn(`#validate()`,t.message),t}async loadAsyncDependencies(){}invalidate(){this._isValid=!1}getSpatialReferenceSupport(){return{constraints:null}}_validateSpatialReference(e){return this.getSpatialReferenceSupport(e)!=null}when(e,t){return this.isResolved()&&!this.ready&&d.getLogger(this).warn(`#when()`,`Calling view.when() while the view is no longer ready but was already resolved once will resolve immediately. Use reactiveUtils.whenOnce(() => view.ready).then(...) instead.`),super.when(e,t)}forceReadyCycle(){this.ready&&(v(()=>this.destroyed||this.preconditionsReady===!1,()=>this._readyCycleForced=!1,{once:!0}),this._readyCycleForced=!0)}on(e,t){return super.on(e,t)}addAndActivateTool(e){this.toolViewManager.tools.add(e),this.activeTool=e}tryFatalErrorRecovery(){this.fatalError=null}static{this.views=new r}_displayWebGLError(){let e=document.createElement(`div`);e.setAttribute(`style`,`display: flex; flex-direction: column; gap: 8px; padding: 20px; height: 100%; justify-content: center; color: black; background: white; font-family: sans-serif;`);let t=document.createElement(`div`);t.innerHTML=`Unable to display map. WebGL2 support is required.`,t.setAttribute(`style`,`font-size: 24px; font-weight: bold;`);let n=document.createElement(`div`);n.innerHTML=`Ensure that your browser and hardware meet the minimum requirements.`,n.setAttribute(`style`,`font-size: 18px;`);let r=document.createElement(`a`);r.innerHTML=`https://esriurl.com/webgl-faq`,r.target=`_blank`,r.setAttribute(`style`,`font-size: 18px;`),r.href=`https://esriurl.com/webgl-faq`,e.appendChild(t),e.appendChild(n),e.appendChild(r);let i=this.getSurface();i&&i.appendChild(e)}};e([b()],Q.prototype,`_userSpatialReference`,void 0),e([b()],Q.prototype,`activeTool`,null),e([b({readOnly:!0})],Q.prototype,`allLayerViews`,void 0),e([b({readOnly:!0})],Q.prototype,`layerviewCollections`,null),e([b(S(D,`analyses`))],Q.prototype,`analyses`,null),e([b()],Q.prototype,`animation`,null),e([b()],Q.prototype,`animationsEnabled`,void 0),e([b()],Q.prototype,`focusRegionVisible`,void 0),e([b()],Q.prototype,`focusRegionShortcutEnabled`,void 0),e([b()],Q.prototype,`focusRegion`,null),e([b({readOnly:!0})],Q.prototype,`attributionItems`,null),e([b()],Q.prototype,`attributionVisible`,void 0),e([b()],Q.prototype,`basemapView`,void 0),e([b()],Q.prototype,`center`,null),e([b()],Q.prototype,`defaultsFromMapSettings`,null),e([b()],Q.prototype,`defaultsFromMap`,null),e([b()],Q.prototype,`dependencies`,void 0),e([b()],Q.prototype,`displayFilterEnabled`,void 0),e([b({type:ne})],Q.prototype,`extent`,null),e([b()],Q.prototype,`fatalError`,void 0),e([b(S(O,`graphics`))],Q.prototype,`graphics`,void 0),e([b({readOnly:!0,type:w})],Q.prototype,`heightModelInfo`,null),e([b({type:r.ofType(K)})],Q.prototype,`highlights`,null),e([b({readOnly:!0})],Q.prototype,`interacting`,null),e([b({constructOnly:!0})],Q.prototype,`layerViewFilter`,void 0),e([b({readOnly:!0})],Q.prototype,`navigating`,null),e([b({readOnly:!0})],Q.prototype,`preconditionsReady`,null),e([b({readOnly:!0})],Q.prototype,`typeSpecificPreconditionsReady`,void 0),e([b({type:r,readOnly:!0})],Q.prototype,`layerViews`,void 0),e([b()],Q.prototype,`resolution`,null),e([b({type:N})],Q.prototype,`magnifier`,void 0),e([b({nonNullable:!0,type:V})],Q.prototype,`options`,void 0),e([b({value:null,type:t})],Q.prototype,`map`,null),e([b()],Q.prototype,`padding`,void 0),e([b({readOnly:!0})],Q.prototype,`ready`,void 0),e([b({readOnly:!0})],Q.prototype,`canZoomIn`,null),e([b({readOnly:!0})],Q.prototype,`canZoomOut`,null),e([b()],Q.prototype,`_readyStateWaitingTask`,void 0),e([b({readOnly:!0})],Q.prototype,`readyState`,null),e([b({type:T})],Q.prototype,`spatialReference`,null),e([b()],Q.prototype,`stationary`,null),e([b({type:A})],Q.prototype,`timeExtent`,null),e([b({type:String,nonNullable:!0})],Q.prototype,`timeZone`,null),e([b()],Q.prototype,`tools`,null),e([b()],Q.prototype,`toolViewManager`,void 0),e([b({readOnly:!0})],Q.prototype,`type`,void 0),e([b({type:Number})],Q.prototype,`scale`,void 0),e([b({readOnly:!0})],Q.prototype,`updating`,void 0),e([b({readOnly:!0})],Q.prototype,`initialExtentRequired`,void 0),e([b({readOnly:!0})],Q.prototype,`initialExtent`,null),e([b()],Q.prototype,`cursor`,null),e([b({readOnly:!0})],Q.prototype,`input`,void 0),e([b({type:H,nonNullable:!0})],Q.prototype,`navigation`,void 0),e([b()],Q.prototype,`layerViewManager`,void 0),e([b()],Q.prototype,`analysisViewManager`,void 0),e([b()],Q.prototype,`selectionManager`,void 0),e([b()],Q.prototype,`width`,void 0),e([b()],Q.prototype,`height`,void 0),e([b({readOnly:!0})],Q.prototype,`resizing`,void 0),e([b({value:null,readOnly:!0})],Q.prototype,`size`,null),e([b({readOnly:!0})],Q.prototype,`suspended`,void 0),e([b({readOnly:!0})],Q.prototype,`viewEvents`,void 0),e([b()],Q.prototype,`_isValid`,void 0),e([b()],Q.prototype,`_readyCycleForced`,void 0),e([b()],Q.prototype,`_lockedSpatialReference`,void 0),e([b()],Q.prototype,`_userTimeZone`,void 0),e([b()],Q.prototype,`_lockedTimeZone`,void 0),e([b()],Q.prototype,`_userTimeExtent`,void 0),e([b()],Q.prototype,`_lockedTimeExtent`,void 0),e([b({type:F})],Q.prototype,`theme`,void 0),e([b({readOnly:!0,type:F})],Q.prototype,`effectiveTheme`,null),e([b({readOnly:!0})],Q.prototype,`registeredComponents`,void 0),Q=Z=e([x(`esri.views.View`)],Q);const $=globalThis.$arcgis;$&&!$.views&&Object.defineProperty($,"views",{configurable:!1,enumerable:!0,writable:!1,value:Q.views});function re(e){return e.layerViews}export{Q as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/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{
|
|
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/5.2/LICENSE.txt */
|
|
2
|
-
import{makeHandle as e}from"../../../core/handleUtils.js";import{nextTick as t}from"../../../core/nextTick.js";import{
|
|
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/5.2/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"
|
|
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
|
|
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
|
|
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,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/5.2/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();if(!this.editingEnabled){this._logWarning(`store:editing-disabled`,`Editing is disabled.`);return}this.autoSaveEnabled&&this._logWarning(`store:pending-edit`,`Edit will be cached, but 'autoSaveEnabled' is true.`,!0),this._stashPendingEdits(t,e)}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));return}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();if(!this.editingEnabled){this._logWarning(`store:editing-disabled`,`Editing is disabled.`);return}this.autoSaveEnabled&&this._logWarning(`store:pending-edit`,`Edit will be cached, but 'autoSaveEnabled' is true.`,!0),this._stashPendingEdits(t,e)}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));return}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. */
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type Accessor from "../../core/Accessor.js";
|
|
2
2
|
import type { ScaleRange } from "../../layers/types.js";
|
|
3
3
|
|
|
4
|
+
/** @deprecated since 5.2. Use the [arcgis-slider-scale-range](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-slider-scale-range/) component directly instead. */
|
|
4
5
|
export interface ScaleRangesProperties {}
|
|
5
6
|
|
|
6
7
|
/** Lists the recommended scales for each named scale range. */
|
|
@@ -56,9 +57,11 @@ export interface NamedScaleRange extends ScaleRange {
|
|
|
56
57
|
* The ScaleRanges class represents the ranges of scales for the
|
|
57
58
|
* [ScaleRangeSlider](https://developers.arcgis.com/javascript/latest/references/core/widgets/ScaleRangeSlider/) widget.
|
|
58
59
|
*
|
|
60
|
+
* @deprecated since 5.2. Use the [arcgis-slider-scale-range](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-slider-scale-range/) component directly instead.
|
|
59
61
|
* @since 4.13
|
|
60
62
|
* @see [ScaleRangeSlider](https://developers.arcgis.com/javascript/latest/references/core/widgets/ScaleRangeSlider/)
|
|
61
63
|
* @see [ScaleRangeSliderViewModel](https://developers.arcgis.com/javascript/latest/references/core/widgets/ScaleRangeSlider/ScaleRangeSliderViewModel/)
|
|
64
|
+
* @see [Scale Range Slider component](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-slider-scale-range/)
|
|
62
65
|
*/
|
|
63
66
|
export default class ScaleRanges extends Accessor {
|
|
64
67
|
/** The recommended scales at each of the named scale ranges. */
|
|
@@ -77,19 +77,19 @@
|
|
|
77
77
|
* | `VI` | U.S. Virgin Islands|
|
|
78
78
|
* | `ZA` | South Africa|
|
|
79
79
|
*
|
|
80
|
-
* @deprecated since 5.2. Use the [Scale Range Slider](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-slider-scale-range/)
|
|
80
|
+
* @deprecated since 5.2. Use the [Scale Range Slider component SupportedRegion](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-slider-scale-range/spriteSheetsUtils/#SupportedRegion) instead.
|
|
81
81
|
* @since 5.0
|
|
82
82
|
*/
|
|
83
83
|
export type SupportedRegion = LowerCaseRegion | UpperCaseRegion;
|
|
84
84
|
|
|
85
85
|
/**
|
|
86
|
-
* @deprecated since 5.2. Use the [Scale Range Slider](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-slider-scale-range/)
|
|
86
|
+
* @deprecated since 5.2. Use the [Scale Range Slider component LowerCaseRegion](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-slider-scale-range/spriteSheetsUtils/#LowerCaseRegion) instead.
|
|
87
87
|
* @since 5.0
|
|
88
88
|
*/
|
|
89
89
|
export type LowerCaseRegion = "ae" | "ar" | "at" | "au" | "be" | "bg" | "bo" | "br" | "ca" | "ch" | "ci" | "cl" | "cn" | "co" | "cr" | "cz" | "de" | "dk" | "ee" | "eg" | "es" | "fi" | "fr" | "gb" | "gl" | "gr" | "gt" | "hk" | "id" | "ie" | "il" | "in" | "iq" | "is" | "it" | "jp" | "ke" | "kr" | "kw" | "li" | "lt" | "lu" | "lv" | "ma" | "mg" | "ml" | "mo" | "mx" | "my" | "ni" | "nl" | "no" | "nz" | "pe" | "pl" | "pr" | "pt" | "ro" | "ru" | "rw" | "se" | "sg" | "sk" | "sr" | "sv" | "th" | "tn" | "tw" | "us" | "ve" | "vi" | "za";
|
|
90
90
|
|
|
91
91
|
/**
|
|
92
|
-
* @deprecated since 5.2. Use the [Scale Range Slider](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-slider-scale-range/)
|
|
92
|
+
* @deprecated since 5.2. Use the [Scale Range Slider component UpperCaseRegion](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-slider-scale-range/spriteSheetsUtils/#UpperCaseRegion) instead.
|
|
93
93
|
* @since 5.0
|
|
94
94
|
*/
|
|
95
95
|
export type UpperCaseRegion = Uppercase<LowerCaseRegion>;
|