@arcgis/core 4.34.0-next.66 → 4.34.0-next.67
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/WebDocument2D.js +1 -1
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/{09dd8613bc03e7a3a4cb.js → 0814676e4bac81f96140.js} +1 -1
- package/assets/esri/core/workers/chunks/{44031bef6d500167ef0b.js → 09dbb3e200ef8d514eb3.js} +1 -1
- package/assets/esri/core/workers/chunks/0b71100fa1e7ca706dbb.js +1 -0
- package/assets/esri/core/workers/chunks/{3167230555c63f943485.js → 0cbd5335cc92f5891bcf.js} +1 -1
- package/assets/esri/core/workers/chunks/{16fe21ca9b24eaee3069.js → 144bfd64daf103a06734.js} +1 -1
- package/assets/esri/core/workers/chunks/{c20aead85cdea91c4b74.js → 170ec7fb070c63230c81.js} +1 -1
- package/assets/esri/core/workers/chunks/{af1030e4c4437d4eb600.js → 1ada9e6cdd6792e3847a.js} +1 -1
- package/assets/esri/core/workers/chunks/1e86df439c564fe752e3.js +1 -0
- package/assets/esri/core/workers/chunks/{4459c8e495a37d4c4eb8.js → 25118304c9a914194e90.js} +1 -1
- package/assets/esri/core/workers/chunks/{d823277612f971a9c2f0.js → 3245663da75e168bf85c.js} +1 -1
- package/assets/esri/core/workers/chunks/37d7c249114994a7dfac.js +1 -0
- package/assets/esri/core/workers/chunks/{1c7b5ca80e80c314f78d.js → 39d69afc9da9db0c75ab.js} +1 -1
- package/assets/esri/core/workers/chunks/{dbcef57073075e9cfdfe.js → 489fa17e60f25d5f33ae.js} +1 -1
- package/assets/esri/core/workers/chunks/{19e5e011f929b6b940fe.js → 4bc091770bab38874848.js} +1 -1
- package/assets/esri/core/workers/chunks/{09f0c9f0b6aa58ae3c52.js → 4f22e5a7f81883e8e5b6.js} +1 -1
- package/assets/esri/core/workers/chunks/{7a17e78c76076ed4476f.js → 5185c63fecc5f493e142.js} +1 -1
- package/assets/esri/core/workers/chunks/{6fff219dfaa86167c326.js → 5303d77a3ab1b7ddeef3.js} +1 -1
- package/assets/esri/core/workers/chunks/{22ec2b0a853911692dc8.js → 5993427325d1add18ed9.js} +1 -1
- package/assets/esri/core/workers/chunks/{9e3f8c06b4e090a35710.js → 5b84eba4a28e25b6d5c0.js} +1 -1
- package/assets/esri/core/workers/chunks/{497214e9e82b936fc94e.js → 5ed381a268855bcad072.js} +1 -1
- package/assets/esri/core/workers/chunks/{33718ea851645d9078d1.js → 605acf18cbeb89e4f29f.js} +1 -1
- package/assets/esri/core/workers/chunks/{4d7fcec769369c576847.js → 6e59ba2afd444eb4be18.js} +1 -1
- package/assets/esri/core/workers/chunks/{a700f57af6856cb5313c.js → 70dc7ec6474f0801bc04.js} +1 -1
- package/assets/esri/core/workers/chunks/{60920d4856a011ace7e2.js → 80b0c88a76bd523a406a.js} +1 -1
- package/assets/esri/core/workers/chunks/{117eb1422e9795d37ea3.js → 837830e1cf712d4243a5.js} +1 -1
- package/assets/esri/core/workers/chunks/{ad7aa7d09bfceb12609e.js → 87fb5d755860057da164.js} +1 -1
- package/assets/esri/core/workers/chunks/{481aea82501d04667ba2.js → 8a104b35708a492bd614.js} +1 -1
- package/assets/esri/core/workers/chunks/{5cb238318a24b70d5ac3.js → 8bc8caa384b24af12411.js} +1 -1
- package/assets/esri/core/workers/chunks/{dcad3dcbd4ea2f5a6a04.js → 8e2558b14be70b273ce4.js} +1 -1
- package/assets/esri/core/workers/chunks/{8e40c409a9b0a2a768a9.js → 8f02349602b072186a1f.js} +1 -1
- package/assets/esri/core/workers/chunks/{fa0f94318173db2034de.js → 90491262b6d6a126c32f.js} +1 -1
- package/assets/esri/core/workers/chunks/{0952aeddddc16705b7a3.js → 99f133a152afb4f1b067.js} +1 -1
- package/assets/esri/core/workers/chunks/{8e3c09c3524654830b14.js → a634764dec5404f4a1d7.js} +1 -1
- package/assets/esri/core/workers/chunks/a895da7fd64ebad3d5a4.js +1 -0
- package/assets/esri/core/workers/chunks/{31e7358fe802abb3f8db.js → aa970a547c60c43d6c7f.js} +1 -1
- package/assets/esri/core/workers/chunks/{9a6d359ead62a8eadd3c.js → ab727ed4417b7dd94ce9.js} +1 -1
- package/assets/esri/core/workers/chunks/{707311e24b2f458d9209.js → ad3ebd4f05cc673140f3.js} +1 -1
- package/assets/esri/core/workers/chunks/{05016b0713ef760fc57d.js → b052d3ef5493eedb44a5.js} +1 -1
- package/assets/esri/core/workers/chunks/b335e96f6bcac6d2f0ee.js +1 -0
- package/assets/esri/core/workers/chunks/{dd1d9913b33d4e48baff.js → c35dad3d5ceaac6ad5a4.js} +1 -1
- package/assets/esri/core/workers/chunks/{e1b573840ec1f7c3afd3.js → c4b2678dd46fa1e22f7e.js} +1 -1
- package/assets/esri/core/workers/chunks/{bc931865a77fc48871d3.js → c94c797864a85342b105.js} +1 -1
- package/assets/esri/core/workers/chunks/{e97250ae8da4bd0d6bc9.js → cad03967e132a28512c2.js} +1 -1
- package/assets/esri/core/workers/chunks/{c7a386ac90e58eb71935.js → da1a5537e2f2ca6cc247.js} +1 -1
- package/assets/esri/core/workers/chunks/dd447dfc50ee7f511b84.js +1 -0
- package/assets/esri/core/workers/chunks/{0f9813e7d4e2b47b2c39.js → e47acdb1fbf797342716.js} +1 -1
- package/assets/esri/core/workers/chunks/{a16b471c3706ee37f9b6.js → e6f2ac738df16fb5e13a.js} +1 -1
- package/assets/esri/core/workers/chunks/{f5101f5f93f776a6456f.js → ed1272e7681e561d843f.js} +1 -1
- package/assets/esri/core/workers/chunks/{66ffefd46fe6175c2af4.js → efea3e82cec476d486e0.js} +1 -1
- package/assets/esri/core/workers/chunks/{ff2614d96ca5228e9685.js → f4d4c1f13522f20b00d1.js} +1 -1
- package/assets/esri/core/workers/chunks/{4be2bab8ff3bd14ffdfb.js → f9385d7fb5ff20f7b252.js} +1 -1
- package/assets/esri/core/workers/chunks/{b30de4936caa654d7817.js → fac020b6886ff2d75015.js} +1 -1
- package/assets/esri/core/workers/chunks/fe353a53968827bcd9cc.js +1 -0
- package/chunks/GlowComposition.glsl.js +5 -5
- package/chunks/RibbonLine.glsl.js +2 -2
- package/config.js +1 -1
- package/interfaces.d.ts +66 -193
- package/kernel.js +1 -1
- package/layers/GaussianSplatLayer.js +1 -1
- package/layers/Layer.js +1 -1
- package/layers/MapImageLayer.js +1 -1
- package/layers/OrientedImageryLayer.js +1 -1
- package/layers/VoxelLayer.js +1 -1
- package/layers/graphics/controllers/FeatureTileController3D.js +1 -1
- package/layers/graphics/sources/FeatureLayerSource.js +1 -1
- package/layers/mixins/ArcGISImageService.js +1 -1
- package/layers/mixins/ImageryTileMixin.js +1 -1
- package/layers/mixins/OperationalLayer.js +1 -1
- package/layers/mixins/TemporalLayer.js +1 -1
- package/layers/mixins/TemporalSceneLayer.js +1 -1
- package/layers/mixins/operationalLayers.js +1 -1
- package/layers/support/FeatureFilter.js +1 -1
- package/layers/support/TimeInfo.js +1 -1
- package/layers/support/TrackInfo.js +1 -1
- package/layers/support/layersCreator.js +1 -1
- package/package.json +2 -2
- package/portal/schemas/definitions.js +1 -1
- package/portal/support/portalLayers.js +1 -1
- package/rest/support/AttributeBinsQuery.js +1 -1
- package/rest/support/IdentifyParameters.js +1 -1
- package/rest/support/ImageGPSInfoParameters.js +1 -1
- package/rest/support/ImageHistogramParameters.js +1 -1
- package/rest/support/ImageIdentifyParameters.js +1 -1
- package/rest/support/ImageParameters.js +1 -1
- package/rest/support/ImageSampleParameters.js +1 -1
- package/rest/support/Query.js +1 -1
- package/rest/support/TopFeaturesQuery.js +1 -1
- package/support/revision.js +1 -1
- package/support/timeUtils.js +1 -1
- package/time/TimeExtent.js +1 -1
- package/time/TimeInterval.js +1 -1
- package/views/2d/analysis/ElevationProfileAnalysisView2D.js +1 -1
- package/views/2d/engine/webgl/Painter.js +1 -1
- package/views/2d/engine/webgl/effects/FeatureEffect.js +1 -1
- package/views/2d/engine/webgl/effects/post-processing/EffectManager.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/TestTechnique.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/TextureStatisticsTechnique.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/bloom/BloomTechnique.js +5 -0
- package/views/2d/engine/webgl/shaderGraph/techniques/blur/BlurTechnique.js +5 -0
- package/views/2d/engine/webgl/shaderGraph/techniques/colorize/ColorizeTechnique.js +5 -0
- package/views/2d/engine/webgl/shaderGraph/techniques/dotDensity/DotDensityTechnique.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/drop-shadow/DropShadowTechnique.js +5 -0
- package/views/2d/engine/webgl/shaderGraph/techniques/fill/ComplexFillTechnique.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/fill/ComplexOutlineFillTechnique.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/fill/FillTechnique.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/fill/GradientFillTechnique.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/fill/OutlineFillTechnique.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/fill/PatternFillTechnique.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/fill/PatternOutlineFillTechnique.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/grid/GridTechnique.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/heatmap/HeatmapTechnique.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/labels/LabelTechnique.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/line/GradientStrokeTechnique.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/line/LineTechnique.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/line/TexturedLineTechnique.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/magnifier/MagnifierTechnique.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/markers/MarkerTechnique.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/mesh/MeshWriterRegistry.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/opacity/OpacityTechnique.js +5 -0
- package/views/2d/engine/webgl/shaderGraph/techniques/overlay/OverlayTechnique.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/pieChart/PieChartTechnique.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/BlitShader.js +5 -0
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/BloomShader.js +5 -0
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/BlurShader.js +5 -0
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/ColorizeShader.js +5 -0
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/DropShadowShader.js +5 -0
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/PostProcessingShader.js +5 -0
- package/views/2d/engine/webgl/shaderGraph/techniques/text/TextTechnique.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/videoScreenRenderer/VideoScreenTechnique.js +1 -1
- package/views/2d/engine/webgl/shaders/sources/shaderRepository.js +1 -1
- package/views/2d/layers/MediaLayerView2D.js +1 -1
- package/views/2d/layers/TileLayerView2D.js +1 -1
- package/views/2d/layers/features/FeatureContainer.js +1 -1
- package/views/2d/layers/features/RenderState.js +1 -1
- package/views/2d/layers/features/sources/FeatureSourceQueryInfo.js +1 -1
- package/views/3d/analysis/ElevationProfileAnalysisView3D.js +1 -1
- package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementTool.js +5 -0
- package/views/3d/analysis/VolumeMeasurement/volumeMeasurementGeometryUtils.js +5 -0
- package/views/3d/analysis/VolumeMeasurementAnalysisView3D.js +1 -1
- package/views/3d/layers/FeatureLikeLayerView3D.js +1 -1
- package/views/3d/layers/graphics/Graphics3DGraphicsPipeline.js +1 -1
- package/views/3d/layers/graphics/QueryEngine.js +1 -1
- package/views/3d/layers/graphics/pipeline/Feature3DPipeline.js +1 -1
- package/views/3d/layers/graphics/pipeline/Feature3DPipelineWorker.js +1 -1
- package/views/3d/layers/graphics/pipeline/Feature3DPipelineWorkerHandle.js +1 -1
- package/views/3d/layers/support/FeatureTileFetcher3D.js +1 -1
- package/views/3d/layers/support/FeatureVisibilityFilter.js +1 -1
- package/views/3d/webgl-engine/effects/focusArea/FocusAreaColor.glsl.js +5 -0
- package/views/3d/webgl-engine/effects/focusArea/FocusAreaColorNode.js +1 -1
- package/views/3d/webgl-engine/effects/focusArea/FocusAreaColorTechnique.js +1 -1
- package/views/3d/webgl-engine/effects/focusArea/FocusAreaMask.glsl.js +5 -0
- package/views/3d/webgl-engine/effects/focusArea/FocusAreaMaskNode.js +1 -1
- package/views/3d/webgl-engine/effects/focusArea/FocusAreaMaskTechnique.js +1 -1
- package/views/3d/webgl-engine/effects/focusArea/FocusAreaOutlineItem.js +1 -1
- package/views/3d/webgl-engine/effects/glow/GlowComposition.glsl.js +1 -1
- package/views/3d/webgl-engine/effects/glow/GlowRenderNode.js +1 -1
- package/views/3d/webgl-engine/materials/renderers/MergedBuffer.js +1 -1
- package/views/3d/webgl-engine/materials/renderers/PerBufferData.js +1 -1
- package/views/3d/webgl-engine/materials/renderers/VaoWriter.js +5 -0
- package/views/VideoView.js +1 -1
- package/views/View.js +1 -1
- package/views/analysis/ElevationProfile/ElevationProfileController.js +1 -1
- package/views/analysis/ElevationProfile/ElevationProfileGenerationError.js +1 -1
- package/views/analysis/ElevationProfile/ElevationProfileResult.js +1 -1
- package/webdoc/support/timeProperties.js +1 -1
- package/webdoc/widgets/TimeSlider.js +1 -1
- package/webmap/InitialViewProperties.js +1 -1
- package/widgets/FeatureTable/support/FeatureStore.js +1 -1
- package/widgets/TimeSlider/TimeSliderViewModel.js +1 -1
- package/widgets/TimeSlider.js +1 -1
- package/TimeExtent.d.ts +0 -4
- package/TimeExtent.js +0 -5
- package/TimeInterval.d.ts +0 -4
- package/TimeInterval.js +0 -5
- package/assets/esri/core/workers/chunks/0b01c87db77246632ad9.js +0 -1
- package/assets/esri/core/workers/chunks/0cb2f7172190babb4139.js +0 -1
- package/assets/esri/core/workers/chunks/0e28cb5d8d89ae29cdd0.js +0 -1
- package/assets/esri/core/workers/chunks/2a938096a42613425c7b.js +0 -1
- package/assets/esri/core/workers/chunks/3bc50ee639a4d16c4f80.js +0 -1
- package/assets/esri/core/workers/chunks/8f60804c7ba445f25df8.js +0 -1
- package/assets/esri/core/workers/chunks/c696615cae5daefa2d98.js +0 -1
- package/chunks/TimeExtent.js +0 -5
- package/chunks/TimeInterval.js +0 -5
- package/views/2d/engine/webgl/effects/post-processing/Bloom.js +0 -5
- package/views/2d/engine/webgl/effects/post-processing/Blur.js +0 -5
- package/views/2d/engine/webgl/effects/post-processing/Colorize.js +0 -5
- package/views/2d/engine/webgl/effects/post-processing/DropShadow.js +0 -5
- package/views/2d/engine/webgl/effects/post-processing/Opacity.js +0 -5
- package/views/3d/webgl-engine/shaders/FocusAreaColor.glsl.js +0 -5
- package/views/3d/webgl-engine/shaders/FocusAreaMask.glsl.js +0 -5
package/views/View.js
CHANGED
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{__decorate as e}from"tslib";import t from"../Map.js";import{createTask as i}from"../core/asyncUtils.js";import r from"../core/Collection.js";import s from"../core/CollectionFlattener.js";import{referenceSetter as a}from"../core/collectionUtils.js";import o from"../core/Error.js";import{EventedMixin as n}from"../core/Evented.js";import l from"../core/Handles.js";import{makeHandle as p}from"../core/handleUtils.js";import has from"../core/has.js";import{isLoadable as h}from"../core/Loadable.js";import d from"../core/Logger.js";import{destroyMaybe as y,abortMaybe as u}from"../core/maybe.js";import{EsriPromise as m}from"../core/Promise.js";import{after as c}from"../core/promiseUtils.js";import{watch as g,sync as f,whenOnce as w,when as v,syncAndInitial as _}from"../core/reactiveUtils.js";import{property as V}from"../core/accessorSupport/decorators/property.js";import"../core/RandomLCG.js";import{subclass as M}from"../core/accessorSupport/decorators/subclass.js";import{owningCollectionProperty as R}from"../core/support/OwningCollection.js";import{UpdatingHandles as S}from"../core/support/UpdatingHandles.js";import T from"../geometry/Extent.js";import j from"../geometry/HeightModelInfo.js";import F from"../geometry/SpatialReference.js";import{equals as E}from"../geometry/support/spatialReferenceUtils.js";import{AnalysesCollection as k}from"../support/AnalysesCollection.js";import{GraphicsCollection as x}from"../support/GraphicsCollection.js";import{system as b}from"../time/constants.js";import{T as O}from"../chunks/TimeExtent.js";import{isTimeZoneValid as C}from"../time/timeZoneUtils.js";import L from"./BasemapView.js";import H from"./Magnifier.js";import P from"./SelectionManager.js";import Z from"./Theme.js";import{ToolViewManager as I}from"./ToolViewManager.js";import{makeDefaultHighlightOptions as W}from"./3d/support/DefaultHighlights.js";import q from"./input/Input.js";import{ViewEvents as D}from"./input/ViewEvents.js";import U from"./navigation/Navigation.js";import{DefaultsFromMap as z}from"./support/DefaultsFromMap.js";import A from"./support/HighlightOptions.js";import G from"./support/LayerViewManager.js";import N from"./support/RequiredFieldsOptions.js";var $;let B=class extends(n(m)){static{$=this}constructor(e){super(e),this._userSpatialReference=null,this.handles=new l,this.updatingHandles=new S,this.allLayerViews=new s({getCollections:()=>[this.basemapView?.baseLayerViews,this.basemapView?.groundLayerViews,this.groundView?.layerViews,this.layerViews,this.basemapView?.referenceLayerViews],getChildrenFunction:Q}),this.analyses=new k,this.basemapView=null,this.displayFilterEnabled=!0,this.fatalError=null,this.graphics=new x,this.groundView=null,this.typeSpecificPreconditionsReady=!0,this.layerViews=new r,this.magnifier=new H,this.padding={left:0,top:0,right:0,bottom:0},this.ready=!1,this._readyStateWaitingTask=null,this.supportsGround=!0,this.type=null,this.scale=null,this.updating=!1,this.initialExtentRequired=!0,this._lowPriorityCursorHandles=new r,this._highPriorityCursorHandles=new r,this.input=new q,this.navigation=new U,this.layerViewManager=null,this.analysisViewManager=null,this.isHeightModelInfoRequired=!1,this.width=null,this.height=null,this.resizing=!1,this.suspended=!1,this.viewEvents=new D(this),this.persistableViewModels=new r,this.requiredFieldsOptions=new N,this._isValid=!1,this._readyCycleForced=!1,this._lockedSpatialReference=null,this._userTimeZone=null,this._lockedTimeZone=null,this._userTimeExtent=null,this._lockedTimeExtent=null,this.theme=null,this.handles.add(g(()=>this.preconditionsReady,e=>{const t=this.ready;if(e?(this._lockedSpatialReference=this.spatialReference,this._lockedTimeZone=this.timeZone,this._lockedTimeExtent=this.timeExtent,$.views.add(this)):(this._lockedSpatialReference=null,$.views.remove(this)),this.notifyChange("spatialReference"),!e&&t)this.toolViewManager?.detach(),this.analysisViewManager?.detach(),this.layerViewManager?.clear(),this._teardown();else if(e&&!t){try{this._startup()}catch(i){return void queueMicrotask(()=>{this.fatalError=new o("view:startup-error","View._startup failed",i)})}this.analysisViewManager?.attach(),this.toolViewManager.attach()}},f))}initialize(){this.addResolvingPromise(Promise.all([this.loadAsyncDependencies(),this.validate()]).then(()=>(this._isValid=!0,w(()=>this.ready)))),this.basemapView=new L({view:this}),this.layerViewManager=new G({view:this,layerViewFilter:e=>this.layerViewFilter?.(e)??!0,layerViewImporter:{importLayerView:e=>this.importLayerView(e),hasLayerViewModule:e=>this.hasLayerViewModule(e)},supportsGround:this.supportsGround}),this.toolViewManager=new I({view:this}),this.selectionManager=new P({view:this}),this.addHandles([v(()=>"map-content-error"===this.readyState&&!this.spatialReference,()=>{d.getLogger(this).warn("#spatialReference","no spatial reference could be derived from the currently added map layers")}),g(()=>this.initialExtentRequired,e=>this.defaultsFromMap.required={...this.defaultsFromMap.required,extent:e},_),g(()=>this.ready,e=>{this.defaultsFromMap&&(this.defaultsFromMap.suspended=e,this.defaultsFromMap.userSpatialReference=e?this.spatialReference:this._userSpatialReference)},f),g(()=>this._userSpatialReference,e=>{this.defaultsFromMap&&(this.defaultsFromMap.userSpatialReference=e)},_)])}destroy(){this.destroyed||($.views.remove(this),this.viewEvents.destroy(),this.allLayerViews.destroy(),this.navigation&&(this.navigation.destroy(),this._set("navigation",null)),this.graphics=y(this.graphics),this.analyses=y(this.analyses),this.defaultsFromMap.destroy(),this._set("defaultsFromMap",null),this.analysisViewManager=y(this.analysisViewManager),this.toolViewManager=y(this.toolViewManager),this.layerViewManager=y(this.layerViewManager),this.selectionManager=y(this.selectionManager),this.basemapView=y(this.basemapView),this.groundView?.destroy(),this.layerViews?.forEach(e=>e.destroy()),this.layerViews.length=0,this.invalidate(),this.handles.destroy(),this.map=y(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 animation(){return this._get("animation")}set animation(e){this._set("animation",e)}get center(){return null}get defaultsFromMapSettings(){return{}}get defaultsFromMap(){return new z({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()}get highlights(){return this._get("highlights")??W()}set highlights(e){this._set("highlights",a(e,this._get("highlights"),r.ofType(A)))}get interacting(){return this.navigating}get navigating(){return!1}get preconditionsReady(){return!this.destroying&&!this.destroyed&&!(this.fatalError||!this._isValid||this._readyCycleForced||!this.map||h(this.map)&&!this.map.loaded||0===this.width||0===this.height||!this.spatialReference||!this._validateSpatialReference(this.spatialReference)||!this._lockedSpatialReference&&!this.defaultsFromMap?.ready||!this.typeSpecificPreconditionsReady)}get resolution(){return 0}set map(e){e!==this._get("map")&&(e?.destroyed&&(d.getLogger(this).warn("#map","The provided map is already destroyed",{map:e}),e=null),h(e)&&e.load().catch(()=>{}),this.constructed&&!this.destroyed&&(this.forceReadyCycle(),this._lockedSpatialReference=null),this._set("map",e))}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){const 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=i(e=>c(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=u(this._readyStateWaitingTask),this.removeHandles("ready-state-task"),this.ready?"ready":"loading"}get spatialReference(){const e=this._userSpatialReference||this._lockedSpatialReference||this.getDefaultSpatialReference()||null;if(e&&this.defaultsFromMap?.required?.heightModelInfo){const t=e.clone();return t.vcsWkid=this.defaultsFromMap.vcsWkid,t.latestVcsWkid=this.defaultsFromMap.latestVcsWkid,t}return e}set spatialReference(e){const t=!E(e,this._get("spatialReference"));this._set("_userSpatialReference",e),t&&(this._set("spatialReference",e),this._spatialReferenceChanged(e))}_spatialReferenceChanged(e){}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()??b}set timeZone(e){this._userTimeZone=e,C(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"){const i="high"===t?this._highPriorityCursorHandles:this._lowPriorityCursorHandles,r={cursor:e},s=p(()=>i.remove(r));return i.add(r),this.addHandles(s),s}get size(){return[this.width,this.height]}get effectiveTheme(){return this.theme??new Z}whenLayerView(e){return this.layerViewManager?.whenLayerView(e)??Promise.reject()}getDefaultSpatialReference(){return this.defaultsFromMap?.spatialReference}getDefaultHeightModelInfo(){return(this.map&&"heightModelInfo"in this.map?this.map.heightModelInfo:void 0)??this.defaultsFromMap?.heightModelInfo??null}getDefaultTimeZone(){return null}getDefaultTimeExtent(){return null}importLayerView(e){throw new o("view:importLayerView-missing","importLayerView() not implemented")}hasLayerViewModule(e){return!1}async validate(){}async loadAsyncDependencies(){}invalidate(){this._isValid=!1}getSpatialReferenceSupport(){return{constraints:null}}_validateSpatialReference(e){return null!=this.getSpatialReferenceSupport(e)}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||!1===this.preconditionsReady,()=>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}};e([V()],B.prototype,"_userSpatialReference",void 0),e([V()],B.prototype,"activeTool",null),e([V({readOnly:!0})],B.prototype,"allLayerViews",void 0),e([V(R(k,"analyses"))],B.prototype,"analyses",void 0),e([V()],B.prototype,"animation",null),e([V()],B.prototype,"basemapView",void 0),e([V()],B.prototype,"center",null),e([V()],B.prototype,"defaultsFromMapSettings",null),e([V()],B.prototype,"defaultsFromMap",null),e([V()],B.prototype,"displayFilterEnabled",void 0),e([V({type:T})],B.prototype,"extent",null),e([V()],B.prototype,"fatalError",void 0),e([V(R(x,"graphics"))],B.prototype,"graphics",void 0),e([V()],B.prototype,"groundView",void 0),e([V({readOnly:!0,type:j})],B.prototype,"heightModelInfo",null),e([V({type:r.ofType(A)})],B.prototype,"highlights",null),e([V({readOnly:!0})],B.prototype,"interacting",null),e([V({constructOnly:!0})],B.prototype,"layerViewFilter",void 0),e([V({readOnly:!0})],B.prototype,"navigating",null),e([V({readOnly:!0,dependsOn:["fatalError","_isValid","_readyCycleForced","map","map.loaded?","width","height","spatialReference","_lockedSpatialReference","defaultsFromMap.ready","typeSpecificPreconditionsReady"]})],B.prototype,"preconditionsReady",null),e([V({readOnly:!0})],B.prototype,"typeSpecificPreconditionsReady",void 0),e([V({type:r,readOnly:!0})],B.prototype,"layerViews",void 0),e([V()],B.prototype,"resolution",null),e([V({type:H})],B.prototype,"magnifier",void 0),e([V({value:null,type:t})],B.prototype,"map",null),e([V()],B.prototype,"padding",void 0),e([V({readOnly:!0})],B.prototype,"ready",void 0),e([V()],B.prototype,"_readyStateWaitingTask",void 0),e([V({readOnly:!0})],B.prototype,"readyState",null),e([V({type:F})],B.prototype,"spatialReference",null),e([V()],B.prototype,"stationary",null),e([V({readOnly:!0})],B.prototype,"supportsGround",void 0),e([V({type:O})],B.prototype,"timeExtent",null),e([V({type:String,nonNullable:!0})],B.prototype,"timeZone",null),e([V()],B.prototype,"tools",null),e([V()],B.prototype,"toolViewManager",void 0),e([V({readOnly:!0})],B.prototype,"type",void 0),e([V({type:Number})],B.prototype,"scale",void 0),e([V({readOnly:!0})],B.prototype,"updating",void 0),e([V({readOnly:!0})],B.prototype,"initialExtentRequired",void 0),e([V({readOnly:!0})],B.prototype,"initialExtent",null),e([V()],B.prototype,"cursor",null),e([V({readOnly:!0})],B.prototype,"input",void 0),e([V({type:U,nonNullable:!0})],B.prototype,"navigation",void 0),e([V()],B.prototype,"layerViewManager",void 0),e([V()],B.prototype,"analysisViewManager",void 0),e([V()],B.prototype,"selectionManager",void 0),e([V()],B.prototype,"width",void 0),e([V()],B.prototype,"height",void 0),e([V({readOnly:!0})],B.prototype,"resizing",void 0),e([V({value:null,readOnly:!0})],B.prototype,"size",null),e([V({readOnly:!0})],B.prototype,"suspended",void 0),e([V({readOnly:!0})],B.prototype,"viewEvents",void 0),e([V({readOnly:!0})],B.prototype,"persistableViewModels",void 0),e([V()],B.prototype,"_isValid",void 0),e([V()],B.prototype,"_readyCycleForced",void 0),e([V()],B.prototype,"_lockedSpatialReference",void 0),e([V()],B.prototype,"_userTimeZone",void 0),e([V()],B.prototype,"_lockedTimeZone",void 0),e([V()],B.prototype,"_userTimeExtent",void 0),e([V()],B.prototype,"_lockedTimeExtent",void 0),e([V({type:Z})],B.prototype,"theme",void 0),e([V({readOnly:!0,type:Z})],B.prototype,"effectiveTheme",null),B=$=e([M("esri.views.View")],B);const J=globalThis.$arcgis;J&&!J.views&&Object.defineProperty(J,"views",{configurable:!1,enumerable:!0,writable:!1,value:B.views});const K=B;function Q(e){return e.layerViews}export{K as default};
|
|
5
|
+
import{__decorate as e}from"tslib";import t from"../Map.js";import{createTask as i}from"../core/asyncUtils.js";import r from"../core/Collection.js";import s from"../core/CollectionFlattener.js";import{referenceSetter as a}from"../core/collectionUtils.js";import o from"../core/Error.js";import{EventedMixin as n}from"../core/Evented.js";import l from"../core/Handles.js";import{makeHandle as p}from"../core/handleUtils.js";import has from"../core/has.js";import{isLoadable as h}from"../core/Loadable.js";import d from"../core/Logger.js";import{destroyMaybe as y,abortMaybe as u}from"../core/maybe.js";import{EsriPromise as m}from"../core/Promise.js";import{after as c}from"../core/promiseUtils.js";import{watch as g,sync as f,whenOnce as w,when as v,syncAndInitial as _}from"../core/reactiveUtils.js";import{property as V}from"../core/accessorSupport/decorators/property.js";import"../core/RandomLCG.js";import{subclass as M}from"../core/accessorSupport/decorators/subclass.js";import{owningCollectionProperty as R}from"../core/support/OwningCollection.js";import{UpdatingHandles as S}from"../core/support/UpdatingHandles.js";import j from"../geometry/Extent.js";import T from"../geometry/HeightModelInfo.js";import F from"../geometry/SpatialReference.js";import{equals as E}from"../geometry/support/spatialReferenceUtils.js";import{AnalysesCollection as k}from"../support/AnalysesCollection.js";import{GraphicsCollection as x}from"../support/GraphicsCollection.js";import{system as b}from"../time/constants.js";import O from"../time/TimeExtent.js";import{isTimeZoneValid as C}from"../time/timeZoneUtils.js";import L from"./BasemapView.js";import H from"./Magnifier.js";import P from"./SelectionManager.js";import Z from"./Theme.js";import{ToolViewManager as I}from"./ToolViewManager.js";import{makeDefaultHighlightOptions as W}from"./3d/support/DefaultHighlights.js";import q from"./input/Input.js";import{ViewEvents as D}from"./input/ViewEvents.js";import U from"./navigation/Navigation.js";import{DefaultsFromMap as z}from"./support/DefaultsFromMap.js";import A from"./support/HighlightOptions.js";import G from"./support/LayerViewManager.js";import N from"./support/RequiredFieldsOptions.js";var $;let B=class extends(n(m)){static{$=this}constructor(e){super(e),this._userSpatialReference=null,this.handles=new l,this.updatingHandles=new S,this.allLayerViews=new s({getCollections:()=>[this.basemapView?.baseLayerViews,this.basemapView?.groundLayerViews,this.groundView?.layerViews,this.layerViews,this.basemapView?.referenceLayerViews],getChildrenFunction:Q}),this.analyses=new k,this.basemapView=null,this.displayFilterEnabled=!0,this.fatalError=null,this.graphics=new x,this.groundView=null,this.typeSpecificPreconditionsReady=!0,this.layerViews=new r,this.magnifier=new H,this.padding={left:0,top:0,right:0,bottom:0},this.ready=!1,this._readyStateWaitingTask=null,this.supportsGround=!0,this.type=null,this.scale=null,this.updating=!1,this.initialExtentRequired=!0,this._lowPriorityCursorHandles=new r,this._highPriorityCursorHandles=new r,this.input=new q,this.navigation=new U,this.layerViewManager=null,this.analysisViewManager=null,this.isHeightModelInfoRequired=!1,this.width=null,this.height=null,this.resizing=!1,this.suspended=!1,this.viewEvents=new D(this),this.persistableViewModels=new r,this.requiredFieldsOptions=new N,this._isValid=!1,this._readyCycleForced=!1,this._lockedSpatialReference=null,this._userTimeZone=null,this._lockedTimeZone=null,this._userTimeExtent=null,this._lockedTimeExtent=null,this.theme=null,this.handles.add(g(()=>this.preconditionsReady,e=>{const t=this.ready;if(e?(this._lockedSpatialReference=this.spatialReference,this._lockedTimeZone=this.timeZone,this._lockedTimeExtent=this.timeExtent,$.views.add(this)):(this._lockedSpatialReference=null,$.views.remove(this)),this.notifyChange("spatialReference"),!e&&t)this.toolViewManager?.detach(),this.analysisViewManager?.detach(),this.layerViewManager?.clear(),this._teardown();else if(e&&!t){try{this._startup()}catch(i){return void queueMicrotask(()=>{this.fatalError=new o("view:startup-error","View._startup failed",i)})}this.analysisViewManager?.attach(),this.toolViewManager.attach()}},f))}initialize(){this.addResolvingPromise(Promise.all([this.loadAsyncDependencies(),this.validate()]).then(()=>(this._isValid=!0,w(()=>this.ready)))),this.basemapView=new L({view:this}),this.layerViewManager=new G({view:this,layerViewFilter:e=>this.layerViewFilter?.(e)??!0,layerViewImporter:{importLayerView:e=>this.importLayerView(e),hasLayerViewModule:e=>this.hasLayerViewModule(e)},supportsGround:this.supportsGround}),this.toolViewManager=new I({view:this}),this.selectionManager=new P({view:this}),this.addHandles([v(()=>"map-content-error"===this.readyState&&!this.spatialReference,()=>{d.getLogger(this).warn("#spatialReference","no spatial reference could be derived from the currently added map layers")}),g(()=>this.initialExtentRequired,e=>this.defaultsFromMap.required={...this.defaultsFromMap.required,extent:e},_),g(()=>this.ready,e=>{this.defaultsFromMap&&(this.defaultsFromMap.suspended=e,this.defaultsFromMap.userSpatialReference=e?this.spatialReference:this._userSpatialReference)},f),g(()=>this._userSpatialReference,e=>{this.defaultsFromMap&&(this.defaultsFromMap.userSpatialReference=e)},_)])}destroy(){this.destroyed||($.views.remove(this),this.viewEvents.destroy(),this.allLayerViews.destroy(),this.navigation&&(this.navigation.destroy(),this._set("navigation",null)),this.graphics=y(this.graphics),this.analyses=y(this.analyses),this.defaultsFromMap.destroy(),this._set("defaultsFromMap",null),this.analysisViewManager=y(this.analysisViewManager),this.toolViewManager=y(this.toolViewManager),this.layerViewManager=y(this.layerViewManager),this.selectionManager=y(this.selectionManager),this.basemapView=y(this.basemapView),this.groundView?.destroy(),this.layerViews?.forEach(e=>e.destroy()),this.layerViews.length=0,this.invalidate(),this.handles.destroy(),this.map=y(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 animation(){return this._get("animation")}set animation(e){this._set("animation",e)}get center(){return null}get defaultsFromMapSettings(){return{}}get defaultsFromMap(){return new z({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()}get highlights(){return this._get("highlights")??W()}set highlights(e){this._set("highlights",a(e,this._get("highlights"),r.ofType(A)))}get interacting(){return this.navigating}get navigating(){return!1}get preconditionsReady(){return!this.destroying&&!this.destroyed&&!(this.fatalError||!this._isValid||this._readyCycleForced||!this.map||h(this.map)&&!this.map.loaded||0===this.width||0===this.height||!this.spatialReference||!this._validateSpatialReference(this.spatialReference)||!this._lockedSpatialReference&&!this.defaultsFromMap?.ready||!this.typeSpecificPreconditionsReady)}get resolution(){return 0}set map(e){e!==this._get("map")&&(e?.destroyed&&(d.getLogger(this).warn("#map","The provided map is already destroyed",{map:e}),e=null),h(e)&&e.load().catch(()=>{}),this.constructed&&!this.destroyed&&(this.forceReadyCycle(),this._lockedSpatialReference=null),this._set("map",e))}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){const 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=i(e=>c(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=u(this._readyStateWaitingTask),this.removeHandles("ready-state-task"),this.ready?"ready":"loading"}get spatialReference(){const e=this._userSpatialReference||this._lockedSpatialReference||this.getDefaultSpatialReference()||null;if(e&&this.defaultsFromMap?.required?.heightModelInfo){const t=e.clone();return t.vcsWkid=this.defaultsFromMap.vcsWkid,t.latestVcsWkid=this.defaultsFromMap.latestVcsWkid,t}return e}set spatialReference(e){const t=!E(e,this._get("spatialReference"));this._set("_userSpatialReference",e),t&&(this._set("spatialReference",e),this._spatialReferenceChanged(e))}_spatialReferenceChanged(e){}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()??b}set timeZone(e){this._userTimeZone=e,C(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"){const i="high"===t?this._highPriorityCursorHandles:this._lowPriorityCursorHandles,r={cursor:e},s=p(()=>i.remove(r));return i.add(r),this.addHandles(s),s}get size(){return[this.width,this.height]}get effectiveTheme(){return this.theme??new Z}whenLayerView(e){return this.layerViewManager?.whenLayerView(e)??Promise.reject()}getDefaultSpatialReference(){return this.defaultsFromMap?.spatialReference}getDefaultHeightModelInfo(){return(this.map&&"heightModelInfo"in this.map?this.map.heightModelInfo:void 0)??this.defaultsFromMap?.heightModelInfo??null}getDefaultTimeZone(){return null}getDefaultTimeExtent(){return null}importLayerView(e){throw new o("view:importLayerView-missing","importLayerView() not implemented")}hasLayerViewModule(e){return!1}async validate(){}async loadAsyncDependencies(){}invalidate(){this._isValid=!1}getSpatialReferenceSupport(){return{constraints:null}}_validateSpatialReference(e){return null!=this.getSpatialReferenceSupport(e)}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||!1===this.preconditionsReady,()=>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}};e([V()],B.prototype,"_userSpatialReference",void 0),e([V()],B.prototype,"activeTool",null),e([V({readOnly:!0})],B.prototype,"allLayerViews",void 0),e([V(R(k,"analyses"))],B.prototype,"analyses",void 0),e([V()],B.prototype,"animation",null),e([V()],B.prototype,"basemapView",void 0),e([V()],B.prototype,"center",null),e([V()],B.prototype,"defaultsFromMapSettings",null),e([V()],B.prototype,"defaultsFromMap",null),e([V()],B.prototype,"displayFilterEnabled",void 0),e([V({type:j})],B.prototype,"extent",null),e([V()],B.prototype,"fatalError",void 0),e([V(R(x,"graphics"))],B.prototype,"graphics",void 0),e([V()],B.prototype,"groundView",void 0),e([V({readOnly:!0,type:T})],B.prototype,"heightModelInfo",null),e([V({type:r.ofType(A)})],B.prototype,"highlights",null),e([V({readOnly:!0})],B.prototype,"interacting",null),e([V({constructOnly:!0})],B.prototype,"layerViewFilter",void 0),e([V({readOnly:!0})],B.prototype,"navigating",null),e([V({readOnly:!0,dependsOn:["fatalError","_isValid","_readyCycleForced","map","map.loaded?","width","height","spatialReference","_lockedSpatialReference","defaultsFromMap.ready","typeSpecificPreconditionsReady"]})],B.prototype,"preconditionsReady",null),e([V({readOnly:!0})],B.prototype,"typeSpecificPreconditionsReady",void 0),e([V({type:r,readOnly:!0})],B.prototype,"layerViews",void 0),e([V()],B.prototype,"resolution",null),e([V({type:H})],B.prototype,"magnifier",void 0),e([V({value:null,type:t})],B.prototype,"map",null),e([V()],B.prototype,"padding",void 0),e([V({readOnly:!0})],B.prototype,"ready",void 0),e([V()],B.prototype,"_readyStateWaitingTask",void 0),e([V({readOnly:!0})],B.prototype,"readyState",null),e([V({type:F})],B.prototype,"spatialReference",null),e([V()],B.prototype,"stationary",null),e([V({readOnly:!0})],B.prototype,"supportsGround",void 0),e([V({type:O})],B.prototype,"timeExtent",null),e([V({type:String,nonNullable:!0})],B.prototype,"timeZone",null),e([V()],B.prototype,"tools",null),e([V()],B.prototype,"toolViewManager",void 0),e([V({readOnly:!0})],B.prototype,"type",void 0),e([V({type:Number})],B.prototype,"scale",void 0),e([V({readOnly:!0})],B.prototype,"updating",void 0),e([V({readOnly:!0})],B.prototype,"initialExtentRequired",void 0),e([V({readOnly:!0})],B.prototype,"initialExtent",null),e([V()],B.prototype,"cursor",null),e([V({readOnly:!0})],B.prototype,"input",void 0),e([V({type:U,nonNullable:!0})],B.prototype,"navigation",void 0),e([V()],B.prototype,"layerViewManager",void 0),e([V()],B.prototype,"analysisViewManager",void 0),e([V()],B.prototype,"selectionManager",void 0),e([V()],B.prototype,"width",void 0),e([V()],B.prototype,"height",void 0),e([V({readOnly:!0})],B.prototype,"resizing",void 0),e([V({value:null,readOnly:!0})],B.prototype,"size",null),e([V({readOnly:!0})],B.prototype,"suspended",void 0),e([V({readOnly:!0})],B.prototype,"viewEvents",void 0),e([V({readOnly:!0})],B.prototype,"persistableViewModels",void 0),e([V()],B.prototype,"_isValid",void 0),e([V()],B.prototype,"_readyCycleForced",void 0),e([V()],B.prototype,"_lockedSpatialReference",void 0),e([V()],B.prototype,"_userTimeZone",void 0),e([V()],B.prototype,"_lockedTimeZone",void 0),e([V()],B.prototype,"_userTimeExtent",void 0),e([V()],B.prototype,"_lockedTimeExtent",void 0),e([V({type:Z})],B.prototype,"theme",void 0),e([V({readOnly:!0,type:Z})],B.prototype,"effectiveTheme",null),B=$=e([M("esri.views.View")],B);const J=globalThis.$arcgis;J&&!J.views&&Object.defineProperty(J,"views",{configurable:!1,enumerable:!0,writable:!1,value:B.views});const K=B;function Q(e){return e.layerViews}export{K as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{__decorate as t}from"tslib";import e from"../../../core/Accessor.js";import{min as o}from"../../../core/arrayUtils.js";import{createTask as i}from"../../../core/asyncUtils.js";import{makeHandle as s}from"../../../core/handleUtils.js";import{LRUCache as r}from"../../../core/LRUCache.js";import{mapCollection as a}from"../../../core/mapCollectionUtils.js";import{destroyMaybe as n,abortMaybe as l}from"../../../core/maybe.js";import{memoize as p}from"../../../core/memoize.js";import{throwIfAborted as u,throwIfAbortError as m}from"../../../core/promiseUtils.js";import{watch as c,syncAndInitial as h,on as _}from"../../../core/reactiveUtils.js";import{throttle as d}from"../../../core/throttle.js";import{adaptiveLengthUnit as f,adaptiveVerticalLengthUnit as
|
|
5
|
+
import{__decorate as t}from"tslib";import e from"../../../core/Accessor.js";import{min as o}from"../../../core/arrayUtils.js";import{createTask as i}from"../../../core/asyncUtils.js";import{makeHandle as s}from"../../../core/handleUtils.js";import{LRUCache as r}from"../../../core/LRUCache.js";import{mapCollection as a}from"../../../core/mapCollectionUtils.js";import{destroyMaybe as n,abortMaybe as l}from"../../../core/maybe.js";import{memoize as p}from"../../../core/memoize.js";import{throwIfAborted as u,throwIfAbortError as m}from"../../../core/promiseUtils.js";import{watch as c,syncAndInitial as h,on as _}from"../../../core/reactiveUtils.js";import{throttle as d}from"../../../core/throttle.js";import{adaptiveLengthUnit as f,adaptiveVerticalLengthUnit as v}from"../../../core/unitUtils.js";import{property as y}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import{subclass as g}from"../../../core/accessorSupport/decorators/subclass.js";import{ElevationQueryTileCache as C}from"../../../layers/support/ElevationQueryTileCache.js";import{hasGraphicFeatureExpressionInfo as P,getGraphicEffectiveElevationInfo as j}from"../../../support/elevationInfoUtils.js";import{getDefaultUnitForView as T}from"../../../support/getDefaultUnitForView.js";import{getConfig as U}from"./constants.js";import{ElevationProfileGenerationError as w}from"./ElevationProfileGenerationError.js";import{createProfileQueue as R,generateProfiles as M}from"./elevationProfileGenerationUtils.js";import{isValidInputPath as z,getInputGeometry as D,getInputGraphic as E}from"./elevationProfileGeometryUtils.js";import{getBoundsInMeters as b,mergeStatistics as I}from"./elevationProfileStatisticsUtils.js";let x=class extends e{constructor(t){super(t),this.error=null,this._getEffectiveUnitsMemoized=p((t,e)=>({distance:t,elevation:e})),this._updateTask=null,this._queue=null,this._currentTileCache=null,this._parametersPerComputation=new Map,this._getUpdateParametersMemoized=p((t,e,o)=>({stationary:t,activeComputations:e,generationParameters:o})),this._getGenerationParametersMemoized=p((t,e,o,i,s,r,a)=>z(e)&&null!=i?{view:t,geometry:e,elevationInfo:o,options:r,queue:i,cache:s,slicePlane:a}:null),this._getElevationInfoMemoized=p((t,e)=>({mode:t,offset:e})),this._getOptionsMemoized=p((t,e)=>{const{densificationMaxSamples:o,maxTotalSamples:i}=U();return{samplingDistance:t,densificationMaxSamples:Math.round(o/e),maxTotalSamples:i}}),this._updateThrottled=d(t=>this._update(t),U().updateThrottleMillis)}initialize(){this._computationsCollection=a(()=>this.analysis.profiles,t=>this.computationFactory.create({controller:this,profileLine:t,onInvalidate:t=>this._invalidateComputation(t)}),{recycleItems:!0}),this.addHandles([this._computationsCollection.on("change",()=>{this._parametersPerComputation.clear(),this._updateThrottled(this._updateParameters)}),c(()=>this._updateParameters,t=>this._updateThrottled(t),h),this._updateThrottled]);const t="3d"===this.view.type?this.view.resourceController:void 0;this._queue=R(t?.scheduler),t?.addUpdatingObject(this)}destroy(){this._abortUpdate(),this._parametersPerComputation.clear(),this._computationsCollection?.destroy(),this._queue=n(this._queue),this._currentTileCache=n(this._currentTileCache)}get effectiveUnits(){const t=b(this._activeComputations.map(t=>t.result.rawResult)),e=this.analysis.units,o=T(this.view),i=f(t.maxDistance,"meters",e.distance??o),s=v(t.maxElevation,"meters",e.elevation??o);return this._getEffectiveUnitsMemoized(i,s)}get progress(){let t=0,e=0;for(const o of this._activeComputations)t++,e+=o.progress;return t>0?e/t:0}get updating(){const{progress:t}=this;return t>0&&t<1||!!this._queue?.updating||this._updateThrottled.hasPendingUpdates()||null!=this._updateTask&&!this._updateTask.finished}get results(){return this._computations.map(t=>t.result)}get statistics(){return I(this._activeComputations.map(t=>t.result.statistics))}get hoveredPoints(){return this._computations.map(t=>t.hoveredPoint)}onElevationChange(t){const{view:e}=this;return"3d"===e?.type?_(()=>e.elevationProvider,"elevation-change",t,{onListenerAdd:t,onListenerRemove:t}):s()}get _tileCache(){this._currentTileCache=n(this._currentTileCache);const t=this.view;if("3d"===t?.type){const e=t.basemapTerrain?.elevationQueryCache;if(null!=e)return e}return null==this._currentTileCache&&(this._currentTileCache=new C(new r(20971520))),this._currentTileCache}get _computations(){return this._computationsCollection?.toArray()??[]}get _activeComputations(){return this._computations.filter(t=>t.profileLine.enabled&&t.available)}get _minDemResolution(){const t=this._minDemResolutions;return t.length>0?o(t):null}get _minDemResolutions(){const t=[];for(const{minDemResolution:e}of this._activeComputations)null!=e&&t.push(e);return t}get _updateParameters(){const{view:t}=this;return this._getUpdateParametersMemoized(t?.stationary??!0,this._activeComputations,this._generationParameters)}get _generationParameters(){const{view:t}=this;return null!=t&&t.ready?this._getGenerationParametersMemoized(t,this._inputGeometry,this._elevationInfo,this._queue,this._tileCache,this._options,"3d"===t.type?t.slice.plane:null):null}get _inputGeometry(){return D(this.analysis.input)}get _elevationInfo(){const t=E(this.analysis.input);if(!t)return null;const e=t?P(t)?null:j(t):null;return null!=e?this._getElevationInfoMemoized(e.mode,e.offset):null}get _options(){const t=this._activeComputations.length;let e=this._minDemResolution??U().defaultDemResolution;return e=parseFloat(e.toFixed(2)),this._getOptionsMemoized(e,t)}_update({stationary:t,activeComputations:e,generationParameters:o}){this._abortUpdate(),t&&(null!=o?this._updateTask=i(async t=>{this.error=null;const i=e.filter(t=>!this._isComputationValid(t,o)),s=M({...o,providers:i},{signal:t});try{for await(const e of s){u(t),this._clearInvalidResults(o);for(let t=0;t<i.length;t++)i[t].setResult(e[t])}for(const t of i)this._parametersPerComputation.set(t,o)}catch(r){m(r),this._abortUpdate(),this.error=r instanceof w?r:new w("unknown"),i.forEach(t=>{t.clearResult()})}}):this._clearResults())}_abortUpdate(){this._updateTask=l(this._updateTask)}_isComputationValid(t,e){return this._parametersPerComputation.has(t)&&this._parametersPerComputation.get(t)===e}_invalidateComputation(t){this._parametersPerComputation.delete(t),this._updateThrottled(this._updateParameters)}_clearInvalidResults(t){for(const e of this._computations)this._isComputationValid(e,t)||(e.clearResult(),this._parametersPerComputation.delete(e))}_clearResults(){for(const t of this._computations)t.clearResult(),this._parametersPerComputation.delete(t)}};t([y({constructOnly:!0})],x.prototype,"analysis",void 0),t([y({constructOnly:!0})],x.prototype,"analysisViewData",void 0),t([y({constructOnly:!0})],x.prototype,"computationFactory",void 0),t([y({constructOnly:!0})],x.prototype,"view",void 0),t([y()],x.prototype,"error",void 0),t([y({readOnly:!0})],x.prototype,"effectiveUnits",null),t([y()],x.prototype,"progress",null),t([y()],x.prototype,"updating",null),t([y()],x.prototype,"results",null),t([y()],x.prototype,"statistics",null),t([y()],x.prototype,"hoveredPoints",null),t([y()],x.prototype,"_queue",void 0),t([y()],x.prototype,"_tileCache",null),t([y()],x.prototype,"_computationsCollection",void 0),t([y()],x.prototype,"_computations",null),t([y()],x.prototype,"_activeComputations",null),t([y({readOnly:!0})],x.prototype,"_minDemResolution",null),t([y()],x.prototype,"_minDemResolutions",null),t([y()],x.prototype,"_updateParameters",null),t([y()],x.prototype,"_generationParameters",null),t([y()],x.prototype,"_inputGeometry",null),t([y()],x.prototype,"_elevationInfo",null),t([y()],x.prototype,"_options",null),x=t([g("esri.views.analysis.ElevationProfile.ElevationProfileController")],x);export{x as ElevationProfileController};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
|
|
5
|
+
import r from"../../../core/Error.js";class e extends r{constructor(r){super(`elevation-profile-analysis:${r}`,"Elevation profile generation error")}}export{e as ElevationProfileGenerationError};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{__decorate as t}from"tslib";import{Clonable as e}from"../../../core/Clonable.js";import{memoize as o}from"../../../core/memoize.js";import{property as r}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as s}from"../../../core/accessorSupport/decorators/subclass.js";import i from"../../../geometry/Point.js";import{binaryFindClosest as l}from"./elevationProfileGenerationUtils.js";import{convertSamples as n,convertStatistics as a}from"./elevationProfileUnitUtils.js";let p=class extends e{constructor(t){super(t),this._getSamplesMemoized=o((t,e)=>n(t,e)),this._getStatisticsMemoized=o((t,e)=>a(t,e)),this.rawResult=null}get available(){const{computation:t}=this;return t.profileLine.enabled&&t.available}get progress(){return null!=this.rawResult&&this.computation.profileLine.enabled?this.rawResult.progress:0}get samples(){return this._getSamplesMemoized(this.rawResult,this.computation.controller.
|
|
5
|
+
import{__decorate as t}from"tslib";import{Clonable as e}from"../../../core/Clonable.js";import{memoize as o}from"../../../core/memoize.js";import{property as r}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as s}from"../../../core/accessorSupport/decorators/subclass.js";import i from"../../../geometry/Point.js";import{binaryFindClosest as l}from"./elevationProfileGenerationUtils.js";import{convertSamples as n,convertStatistics as a}from"./elevationProfileUnitUtils.js";let p=class extends e{constructor(t){super(t),this._getSamplesMemoized=o((t,e)=>n(t,e)),this._getStatisticsMemoized=o((t,e)=>a(t,e)),this.rawResult=null}get available(){const{computation:t}=this;return t.profileLine.enabled&&t.available}get progress(){return null!=this.rawResult&&this.computation.profileLine.enabled?this.rawResult.progress:0}get samples(){return this._getSamplesMemoized(this.rawResult,this.computation.controller.effectiveUnits)}get statistics(){return this._getStatisticsMemoized(this.rawResult,this.computation.controller.effectiveUnits)}get hoveredPoint(){if(!this.computation.profileLine.enabled)return null;const t=this.computation.controller.analysisViewData.hoveredPosition;if(null==t)return null;const{rawResult:e,samples:o}=this;if(null==o||null==e)return null;const r=o.length;if(0===r)return null;const s=o[r-1].distance,n=l(o,t*s,t=>t.distance);if(null==n)return null;const{x:a,y:p,z:u}=n;return null==u?null:new i({x:a,y:p,z:u,spatialReference:e.spatialReference})}};t([r()],p.prototype,"available",null),t([r()],p.prototype,"progress",null),t([r()],p.prototype,"samples",null),t([r()],p.prototype,"statistics",null),t([r({constructOnly:!0})],p.prototype,"computation",void 0),t([r()],p.prototype,"rawResult",void 0),t([r()],p.prototype,"hoveredPoint",null),p=t([s("esri.views.analysis.ElevationProfile.ElevationProfileResult")],p);export{p as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import e from"../../core/Error.js";import{Integer as r,Null as t}from"../../core/accessorSupport/ensureType.js";import
|
|
5
|
+
import e from"../../core/Error.js";import{Integer as r,Null as t}from"../../core/accessorSupport/ensureType.js";import o from"../../time/TimeExtent.js";const m={type:o,json:{read:{source:"timeExtent",reader:e=>e?Array.isArray(e)?o.fromArray(e):o.fromJSON(e):null},write:{writer:(r,t,o,m)=>{r&&(r.isEmpty?m?.messages&&m.messages.push(new e("invalid-timeExtent","TimeExtent cannot be empty")):t[o]=r.toArray())},target:{timeExtent:{type:[[r,t]]}}}}};export{m as timeExtent};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{__decorate as t}from"tslib";import{JSONSupport as e}from"../../core/JSONSupport.js";import{clone as r}from"../../core/lang.js";import{setDeepValue as o}from"../../core/object.js";import{property as
|
|
5
|
+
import{__decorate as t}from"tslib";import{JSONSupport as e}from"../../core/JSONSupport.js";import{clone as r}from"../../core/lang.js";import{setDeepValue as o}from"../../core/object.js";import{property as p}from"../../core/accessorSupport/decorators/property.js";import{Integer as s,Null as i}from"../../core/accessorSupport/ensureType.js";import{reader as n}from"../../core/accessorSupport/decorators/reader.js";import{subclass as l}from"../../core/accessorSupport/decorators/subclass.js";import{writer as u}from"../../core/accessorSupport/decorators/writer.js";import{timeUnitKebabDictionary as m}from"../../portal/timeUnitKebabDictionary.js";import a from"../../time/TimeExtent.js";import c from"../../time/TimeInterval.js";var d;let T=d=class extends e{constructor(t){super(t),this.currentTimeExtent=null,this.fullTimeExtent=null,this.loop=!1,this.numStops=null,this.numThumbs=null,this.stopDelay=null,this.stopInterval=null,this.stops=null}readCurrentTimeExtent(t){return t?a.fromArray(t):void 0}writeCurrentTimeExtent(t,e,r){t&&o(r,t.toArray(),e)}readFullTimeExtent(t,e){const r=e.properties;if(!r)return;const o=null!=r.endTime?new Date(r.endTime):null,p=null!=r.startTime?new Date(r.startTime):null;return new a({start:p,end:o})}writeFullTimeExtent(t,e){if(!t)return;const r=e.properties=e.properties||{},o=t.end,p=t.start;o&&(r.endTime=null!=o?o.getTime():null),p&&(r.startTime=null!=p?p.getTime():null)}readStopInterval(t,e,r){return t?c.fromJSON({value:t.interval,unit:t.units},r):null}writeStopInterval(t,e,r,p){if(!t)return;const s=t.toJSON(p);o("properties.timeStopInterval",{interval:s.value,units:s.unit},e)}readStops(t){return t?.length?t.map(t=>new Date(t)):null}writeStops(t,e,r){t?.length&&o(r,t.map(t=>t.getTime()),e)}clone(){return new d(r({currentTimeExtent:this.currentTimeExtent,fullTimeExtent:this.fullTimeExtent,loop:this.loop,numStops:this.numStops,numThumbs:this.numThumbs,stopDelay:this.stopDelay,stopInterval:this.stopInterval,stops:this.stops}))}};t([p({type:a,json:{type:[[s,i]],read:{source:"properties.currentTimeExtent"},write:{target:"properties.currentTimeExtent"}}})],T.prototype,"currentTimeExtent",void 0),t([n("currentTimeExtent")],T.prototype,"readCurrentTimeExtent",null),t([u("currentTimeExtent")],T.prototype,"writeCurrentTimeExtent",null),t([p({type:a,json:{read:{source:["properties.endTime","properties.startTime"]},write:{target:{"properties.endTime":{type:Number},"properties.startTime":{type:Number}}}}})],T.prototype,"fullTimeExtent",void 0),t([n("fullTimeExtent")],T.prototype,"readFullTimeExtent",null),t([u("fullTimeExtent")],T.prototype,"writeFullTimeExtent",null),t([p({type:Boolean,nonNullable:!0,json:{default:!1,read:{source:"properties.loop"},write:{target:"properties.loop"}}})],T.prototype,"loop",void 0),t([p({type:s,json:{read:{source:"properties.numberOfStops"},write:{target:"properties.numberOfStops",overridePolicy(){const t=!!this.stopInterval,e=!!this.stops?.length,r=!(t||e);return{enabled:r,isRequired:r}}}}})],T.prototype,"numStops",void 0),t([p({type:[1,2],nonNullable:!0,json:{type:s,read:{source:"properties.thumbCount"},write:{target:"properties.thumbCount",isRequired:!0}}})],T.prototype,"numThumbs",void 0),t([p({type:Number,nonNullable:!0,json:{read:{source:"properties.thumbMovingRate"},write:{target:"properties.thumbMovingRate",isRequired:!0}}})],T.prototype,"stopDelay",void 0),t([p({type:c,json:{read:{source:"properties.timeStopInterval"},write:{target:{"properties.timeStopInterval.interval":{type:Number},"properties.timeStopInterval.units":{type:m.jsonValues.filter(t=>"esriTimeUnitsUnknown"!==t)}},overridePolicy(){const t=null!=this.numStops,e=!!this.stops?.length;return{enabled:!e,isRequired:!(t||e)}}}}})],T.prototype,"stopInterval",void 0),t([n("stopInterval")],T.prototype,"readStopInterval",null),t([u("stopInterval")],T.prototype,"writeStopInterval",null),t([p({type:[Date],json:{type:[s],read:{source:"properties.stops"},write:{target:"properties.stops",overridePolicy(){return{isRequired:null==this.numStops&&!this.stopInterval}}}}})],T.prototype,"stops",void 0),t([n("stops")],T.prototype,"readStops",null),t([u("stops")],T.prototype,"writeStops",null),T=d=t([l("esri.webdoc.widgets.TimeSlider")],T);const y=T;export{y as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{__decorate as o}from"tslib";import t from"../Viewpoint.js";import e from"../core/Accessor.js";import{ClonableMixin as r}from"../core/Clonable.js";import{property as i}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/Logger.js";import"../core/RandomLCG.js";import{subclass as p}from"../core/accessorSupport/decorators/subclass.js";import s from"../geometry/SpatialReference.js";import{system as n}from"../time/constants.js";import
|
|
5
|
+
import{__decorate as o}from"tslib";import t from"../Viewpoint.js";import e from"../core/Accessor.js";import{ClonableMixin as r}from"../core/Clonable.js";import{property as i}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/Logger.js";import"../core/RandomLCG.js";import{subclass as p}from"../core/accessorSupport/decorators/subclass.js";import s from"../geometry/SpatialReference.js";import{system as n}from"../time/constants.js";import m from"../time/TimeExtent.js";import c from"../webdoc/RangeInfo.js";import a from"./background/ColorBackground.js";let l=class extends(r(e)){constructor(o){super(o),this.background=null,this.rangeInfo=null,this.spatialReference=null,this.timeExtent=null,this.timeZone=n,this.viewpoint=null}};o([i({type:a})],l.prototype,"background",void 0),o([i({type:c})],l.prototype,"rangeInfo",void 0),o([i({type:s})],l.prototype,"spatialReference",void 0),o([i({type:m})],l.prototype,"timeExtent",void 0),o([i({nonNullable:!0})],l.prototype,"timeZone",void 0),o([i({type:t})],l.prototype,"viewpoint",void 0),l=o([p("esri.webmap.InitialViewProperties")],l);const f=l;export{f as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{__decorate as e}from"tslib";import t from"../../../Graphic.js";import r from"../../../core/Accessor.js";import{equals as s,isSome as i}from"../../../core/arrayUtils.js";import a from"../../../core/Collection.js";import o from"../../../core/Error.js";import{clone as n}from"../../../core/lang.js";import u from"../../../core/Logger.js";import p from"../../../core/ReactiveMap.js";import{watch as l,when as h}from"../../../core/reactiveUtils.js";import{property as d}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import{subclass as c}from"../../../core/accessorSupport/decorators/subclass.js";import{geometryTypes as y}from"../../../geometry/support/typeUtils.js";import{isSubtypeGroupLayer as m,isSubtypeSublayer as _}from"../../../layers/support/layerUtils.js";import f from"../../../rest/support/AttachmentQuery.js";import g from"../../../rest/support/RelationshipQuery.js";import{T as b}from"../../../chunks/TimeExtent.js";import{isIFeatureTableSupportedLayerWithAttachments as v,isIFeatureTableSupportedLayerWithAttachmentsEditing as O,isIFeatureTableSupportedLayerWithEditing as A,isIFeatureTableSupportedLayerWithRelationships as I,findRelatedLayer as j}from"./tableUtils.js";let C=class extends r{constructor(e){super(e),this._attachmentsOperationQueue=new a,this._defaultOutFields=["*"],this._editOperationQueue=new a,this._loaded=!1,this._loadError=!1,this._loading=!1,this._objectIdCache=new a,this._queryOperationQueue=new a,this.attachmentsEnabled=!1,this.count=0,this.failures=new a,this.filterGeometry=null,this.initialSize=null,this.layer=null,this.objectIds=null,this.outFields=null,this.pageCache=new p,this.pageSize=50,this.relationshipConfig=null,this.relatedRecordsEnabled=!1,this.returnGeometry=!1,this.returnZ=!1,this.returnM=!1,this.sortOrders=[],this.timeExtent=null,this.view=null,this.where=null}initialize(){this.addHandles([l(()=>[this.filterGeometry,this.layer,this.objectIds,this.outFields,this.pageSize,this.relationshipConfig,this.returnGeometry,this.returnM,this.returnZ,this.timeExtent,this.where],()=>this._reset()),l(()=>this.orderByFields,()=>this._clearCaches(),{equals:s}),h(()=>this.attachmentsEnabled,()=>this._reset()),h(()=>this.relatedRecordsEnabled,()=>this._reset())])}destroy(){this.layer=null,this.itemCache?.destroy(),this.failures?.destroy()}get _capabilities(){const{layer:e}=this;return e?.effectiveCapabilities??e?.capabilities}get _effectiveReturnZ(){return this.returnZ&&this.supportsZ}get _effectiveReturnM(){return this.returnM&&this.supportsM}get _layerWithAttachments(){const{layer:e}=this;return e&&this._capabilities&&this.attachmentsEnabled&&this.supportsAttachments&&v(e)?e:null}get _layerWithAttachmentsEditing(){const{_layerWithAttachments:e}=this;return e&&O(e)&&this.supportsEditing?e:null}get _layerWithEditing(){const e=this.layer;return A(e)&&this.supportsEditing?e:null}get _layerWithRelationships(){const e=this.layer;return I(e)&&this.supportsQueryRelated?e:null}get _relatedLayer(){return this.relationshipConfig?.relatedLayer}get _relatedLayerCapabilities(){const{_relatedLayer:e}=this;return e?.effectiveCapabilities??e?.capabilities}get _relatedLayerSupportsCacheHint(){return!!this._relatedLayerCapabilities?.queryRelated?.supportsCacheHint}get _relatedLayerSupportsQuery(){return!!this._relatedLayerCapabilities?.operations.supportsQuery}get _relatedLayerSupportsQueryRelated(){const{_relatedLayerCapabilities:e}=this;return!!e?.queryRelated?.supportsCount&&!!e?.queryRelated?.supportsPagination}get _sortedFieldNames(){return this.sortOrders.map(({fieldName:e})=>e)}get _subtypeCode(){return this.layer?.subtypeCode??null}get _subtypeField(){const{layer:e}=this;return m(e?.parent)?e.subtypeField:null}get _canUseRelatedLayer(){return!(!this._relatedLayerSupportsQuery||!this._relatedLayerSupportsQueryRelated)}get canAddRelatedFeature(){const{state:e,relationship:t,supportsAdd:r,supportsEditing:s}=this;if("loaded"!==e||!t||!r||!s)return!1;const{count:i}=this,{cardinality:a,role:o}=t,n=i>0;return("one-to-one"!==a||!n)&&("one-to-many"!==a||"origin"!==o||!n)}get effectiveOutFields(){const{layer:e,outFields:t}=this;if(!e||!t?.length)return this._defaultOutFields;const r=[];t.forEach(t=>{const s=e.fieldsIndex.normalizeFieldName(t);s&&r.push(s)});const{objectIdField:s}=e,i=e.fieldsIndex.normalizeFieldName(s)??s;return i&&!r.includes(i)&&r.unshift(i),r}get effectiveTimeExtent(){const{layer:e,timeExtent:t}=this;return t||e&&"timeExtent"in e&&e.timeExtent||null}get effectiveWhere(){const{layer:e,where:t}=this;return null!=t&&""!==t?t:_(e)&&e.parent?.definitionExpression?e.parent.definitionExpression:e?.definitionExpression||"1=1"}get isQuerying(){return this._queryOperationQueue.length>0}get isSyncing(){return this.isSyncingFeatureEdits||this.isSyncingAttachmentEdits}get isSyncingAttachmentEdits(){return this._attachmentsOperationQueue.length>0}get isSyncingFeatureEdits(){return this._editOperationQueue.length>0}get itemCache(){return new a({items:[...this.pageCache.values()].flat()})}get layerView(){const{layer:e,view:t}=this;if(!e||!t)return null;const r="sublayer"===e.type||_(e)?e.parent:e;return t.allLayerViews.find(e=>e.layer===r)}get orderByFields(){const{_sortedFieldNames:e,layer:t,sortOrders:r}=this,s=r.filter(({fieldName:t,direction:r},s)=>e.indexOf(t)===s&&null!=r).map(({fieldName:e,direction:t})=>`${e} ${t?.toUpperCase()}`);if(t&&!s.length&&!t.objectIdField&&t.fields?.length){const e=t.fields.find(e=>e.name);if(e){const r=t.fieldsIndex.normalizeFieldName(e.name);r&&s.push(`${r} ASC`)}}return s}get relationship(){const{relationshipConfig:e}=this;return null==e?.relationshipId?null:this.relationships?.find(t=>t.id===e.relationshipId)}get relationshipIds(){return this.relationships?.map(e=>e.id)??[]}get relationshipInfos(){const{_layerWithRelationships:e,relatedRecordsEnabled:t,relationships:r,view:s}=this,i=[];return t&&e?.loaded&&s?.map&&r?.length?(r.forEach(t=>{const r=j(e,s,t);r&&(r.load(),i.push({layer:e,relatedLayer:r,relationshipId:t.id}))}),i):i}get relationships(){return this._layerWithRelationships?.relationships}get state(){const{layer:e,_loaded:t,_loadError:r,_loading:s}=this;return!e||e.destroyed?"disabled":r||e.loadError?"error":"loaded"===e.loadStatus&&t?"loaded":s?"loading":"ready"}get supportsAdd(){return!!this._capabilities?.operations.supportsAdd}get supportsAddingAttachments(){return!(!this._layerWithAttachmentsEditing||!this.supportsAdd)}get supportsAttachments(){const{_capabilities:e}=this;return!(!e?.data?.supportsAttachment||!e?.operations.supportsQueryAttachments)}get supportsCacheHint(){return!!this._capabilities?.query?.supportsCacheHint}get supportsCacheHintQueryRelated(){return!!this._capabilities?.queryRelated?.supportsCacheHint}get supportsDelete(){return!!this._capabilities?.operations.supportsDelete}get supportsDeletingAttachments(){return!(!this._layerWithAttachmentsEditing||!this.supportsDelete)}get supportsEditing(){return!!this._capabilities?.operations.supportsEditing}get supportsM(){return!!this.layer?.hasM&&!!this._capabilities?.data?.supportsM}get supportsOrderBy(){return!!this._capabilities?.query?.supportsOrderBy}get supportsPagination(){return!!this._capabilities?.query?.supportsPagination}get supportsQuery(){return!!this._capabilities?.operations.supportsQuery}get supportsQueryRelated(){const{_capabilities:e}=this;return!!e?.queryRelated?.supportsCount&&!!e?.queryRelated?.supportsPagination}get supportsResizeAttachments(){const{_capabilities:e}=this;return!(!this.supportsAttachments||!e?.attachment?.supportsResize)}get supportsUpdate(){return!!this._capabilities?.operations.supportsUpdate}get supportsUpdateAttachments(){return!(!this._layerWithAttachmentsEditing||!this.supportsUpdate)}get supportsZ(){return!!this.layer?.hasZ&&!!this._capabilities?.data?.supportsZ}async addAttachment(e,t){const{_layerWithAttachmentsEditing:r}=this;if(!r||!this.supportsAddingAttachments)return{};const s=await this._queueAttachmentsOperation(e,()=>r.addAttachment(this._createBaseGraphic(r,e),t));return this._ensureArrayContent(s)}async deleteAttachments(e,t){const{_layerWithAttachmentsEditing:r}=this;if(!r||!this.supportsDeletingAttachments||!t.length)return[];const s=await this._queueAttachmentsOperation(e,()=>r.deleteAttachments(this._createBaseGraphic(r,e),t));return this._ensureArray(s)}async deleteRowsByObjectId(e){const{_layerWithEditing:t}=this;if(!this.supportsDelete||!t)throw new o("store:delete-error","Delete is not supported.");const r=e.map(e=>this.getItemByObjectId(e)?.feature).filter(i);return this._queueEditOperation(()=>t.applyEdits({deleteFeatures:r}))}async fetchItems(e){const{page:t}=e,{pageSize:r}=this,s=t*r,i=s+r,{layer:a,state:o}=this;return a&&"loaded"===o?this._query({layer:a,start:s,num:i,page:t,pageSize:r}):[]}async getAttachmentsByObjectId(e,t){const r=this.getItemByObjectId(e)?.attachments??[];if(!r.length&&t){return(await this._queryAttachments([e]))[e]??[]}return r}getItemByObjectId(e){for(const t of this.pageCache.values())for(const r of t)if(r.objectId===e)return r}getItemIndexByObjectId(e){const{pageCache:t,pageSize:r}=this,s=t.entries();let i=-1;for(const[a,o]of s)if(o.some((t,s)=>{const o=t.objectId===e;return o&&(i=a*r+s),o}),i>-1)break;return i}async load(){const{layer:e}=this;if(!this._loading&&!this._loaded&&e){this._reset(),this._loading=!0;try{await e.load(),e.parent&&m(e.parent)&&await e.parent.loadAll(),await e.when();const t=this.initialSize;this.initialSize=null,await this.refresh(t),this._loaded=!0,this._loading=!1}catch(t){throw this._reset(),this._loadError=!0,this._logError("store:load-error","An error occurred."),t}}}async query(e){const{state:t}=this;return this.supportsQuery&&"loaded"===t?this._query(e):[]}async refresh(e){this._clearCaches(),await this._syncCount(e),await this._syncObjectIdCache()}reset(){this._reset()}async updateAttachment(e,t,r){const{_layerWithAttachmentsEditing:s}=this;if(!s||!this.supportsUpdateAttachments)return{};const i=await this._queueAttachmentsOperation(e,()=>s.updateAttachment(this._createBaseGraphic(s,e),t,r));return this._ensureArrayContent(i)}async updateItem(e){const{_sortedFieldNames:t}=this,r=e.updates.map(({fieldName:e})=>e),s=await this._update(e);return!s.updateFeatureResults.find(e=>e.error)&&r.some(e=>t.includes(e))&&this._clearCaches(),s}async verifyFeaturesByObjectId(e){const{layer:t,state:r}=this;if(!t||"loaded"!==r)return[];const{objectIdField:s}=t,i=await this._verifyFeaturesByObjectId(e);return e.map(e=>i.some(t=>{const r=t.getObjectId()??t.attributes[s];return e===r}))}_clearCaches(){this.pageCache.clear(),this._objectIdCache.removeAll()}_createBaseGraphic(e,r){const s=new t({attributes:{[e.objectIdField]:r}});return this._subtypeField&&null!=this._subtypeCode&&(s.attributes[this._subtypeField]=this._subtypeCode),s}_ensureArray(e){return Array.isArray(e)?e:[e]}_ensureArrayContent(e){return Array.isArray(e)?e[0]:e}_getObjectIdsForPage(e,t){const r=this._objectIdCache.toArray();return r.length>=e+t?r.slice(e,e+t):r.slice(e)}_logError(e,t){u.getLogger(this).error(e,t)}_reset(){this._clearCaches(),this.failures.removeAll(),this._attachmentsOperationQueue.removeAll(),this._editOperationQueue.removeAll(),this._queryOperationQueue.removeAll(),this._loading=!1,this._loaded=!1,this._loadError=!1,this._set("count",0)}async _syncCount(e){null==e?await this._queryCount().then(e=>this._set("count",e)):this._set("count",e)}async _syncObjectIdCache(){if(this.supportsPagination)return;const e=await this._queryObjectIds();this._objectIdCache.removeAll(),this._objectIdCache.addMany(e)}async _verifyFeaturesByObjectId(e){const{layer:t}=this;if(!t||!this.supportsQuery)throw new o("store:query-error","Layer does not support query operation.");const{effectiveTimeExtent:r,effectiveWhere:s,orderByFields:i,supportsCacheHint:a,supportsOrderBy:n}=this,u=t.createQuery();u.where=s,u.timeExtent=r,u.returnGeometry=!1,u.objectIds=e.length?e:void 0,u.outFields=[t.objectIdField],n&&(u.orderByFields=i),a&&(u.cacheHint=!0);return(await t.queryFeatures(u)).features}async _update(e){const{objectId:r,updates:s}=e,{_layerWithEditing:i}=this;if(!this.supportsUpdate||!i)throw new o("store:update-error","Update is not supported.");const a=this.getItemByObjectId(r)?.feature;if(!a)throw new o("store:update-error","Feature with provided 'objectId' not found.");const u=n(a.attributes);s.forEach(({fieldName:e,value:t})=>u[e]=t);const p=new t({attributes:u}),l=i.applyEdits({updateFeatures:[p]}).then(e=>{const{updateFeatureResults:t}=e,r=t.find(e=>!!e.error);if(r)throw r.error;return t.length&&(a.attributes=u),e});return this._queueEditOperation(()=>l)}_prepareFeatureData(e){const{attachments:t,features:r,layer:s,relatedRecords:i}=e,a=s.objectIdField;return r.map(e=>{const r=e.getObjectId()??e.attributes[a],o=[];return e.layer||e.sourceLayer||(e.layer=s,e.sourceLayer=s),i.forEach((e,t)=>{o.push({relationshipId:t,count:e[r]??0})}),{objectId:r,feature:e,attachments:t[r]??null,relatedRecords:o}})}async _query(e){const{page:t,refresh:r}=e;!0===r&&await this.refresh();const s=this.pageCache.get(t);if(s)return s;const i=await this._queryPage(e);return this.pageCache.set(t,i),i}_queryAttachments(e){const{_layerWithAttachments:t,effectiveWhere:r}=this;return t?e.some(e=>"number"!=typeof e)?Promise.reject(new o("invalid-object-id","Only numeric object ids are valid to query attachments")):t.queryAttachments(new f({objectIds:e,where:r,returnMetadata:!0})):Promise.resolve({})}async _queryCount(){const{_relatedLayerSupportsCacheHint:e,layer:t,relationshipConfig:r,supportsCacheHint:s}=this;if(!t)return 0;if(r&&this._canUseRelatedLayer){const{objectId:t,relatedLayer:s,relationshipId:i}=r;return(await s.queryRelatedFeaturesCount(new g({cacheHint:e,relationshipId:i,objectIds:[t]})))[t]??0}const{effectiveTimeExtent:i,effectiveWhere:a,filterGeometry:o,objectIds:n}=this,u=t.createQuery();return u.geometry=o,u.returnGeometry=!1,u.where=a,u.timeExtent=i,u.objectIds=n?.length?n:void 0,s&&(u.cacheHint=!0),t.queryFeatureCount(u)}async _queryFeatures(e){const{relationshipConfig:t}=this;if(t&&this._canUseRelatedLayer)return this._queryRelatedFeatures(e,t);const{_effectiveReturnM:r,_effectiveReturnZ:s,effectiveOutFields:i,effectiveTimeExtent:a,effectiveWhere:o,filterGeometry:n,objectIds:u,orderByFields:p,pageSize:l,returnGeometry:h,supportsCacheHint:d,supportsOrderBy:c,supportsPagination:y}=this,{layer:m,start:_}=e,f=u?.length,g=m.createQuery();g.returnGeometry=h,g.outFields=i,g.returnM=r,g.returnZ=s,y?(g.start=_,g.num=l,g.where=o,g.timeExtent=a,g.objectIds=f?u:void 0):g.objectIds=f?u:this._getObjectIdsForPage(_,l??0),c&&(g.orderByFields=p),n&&(g.geometry=n),d&&(g.cacheHint=!0);return(await m.queryFeatures(g)).features}_queryObjectIds(){const{effectiveTimeExtent:e,effectiveWhere:t,filterGeometry:r,layer:s,objectIds:i,orderByFields:a,supportsCacheHint:o,supportsOrderBy:n}=this;if(!s)return Promise.resolve([]);const u=s.createQuery();return u.geometry=r,u.outFields=[s.objectIdField],u.returnGeometry=!1,u.where=t,u.timeExtent=e,u.objectIds=i?.length?i:void 0,n&&(u.orderByFields=a),o&&(u.cacheHint=!0),s.queryObjectIds(u)}async _queryPage(e){const{layer:t}=e;return this._queueQueryOperation(async()=>{const r=await this._queryFeatures(e),s=r.map(e=>e.getObjectId()??e.attributes[t.objectIdField]),i=await this._queryAttachments(s),a=await this._queryRelatedCounts(s);return this._prepareFeatureData({layer:t,features:r,attachments:i,relatedRecords:a})||[]})}async _queryRelatedCounts(e){const{_layerWithRelationships:t,relationshipIds:r,supportsCacheHintQueryRelated:s}=this,i=new Map;return t&&e?.length&&r.length?(await Promise.allSettled(r.map(async r=>{const a=await t.queryRelatedFeaturesCount(new g({cacheHint:s,relationshipId:r,objectIds:e}));i.set(r,a)})),i):i}async _queryRelatedFeatures(e,t){const{_defaultOutFields:r,_effectiveReturnM:s,_effectiveReturnZ:i,orderByFields:a,pageSize:o,returnGeometry:n,supportsCacheHint:u}=this,{layer:p,start:l}=e,{objectId:h,relatedLayer:d,relationshipId:c}=t,y=p.createQuery(),m=new g({cacheHint:u,num:o,objectIds:[h],orderByFields:a,outFields:r,relationshipId:c,returnGeometry:n,returnM:s,returnZ:i,start:l,where:y.where??void 0}),_=await d.queryRelatedFeatures(m);return _[h]?.features||[]}_queueAttachmentsOperation(e,t){return this._attachmentsOperationQueue.push(t),t().then(async r=>{this._attachmentsOperationQueue.remove(t);const s=this._ensureArray(r),i=s.some(e=>e.error),a=this.getItemByObjectId(e);if(a&&(!i||s.length>1)){const t=await this._queryAttachments([e]);a.attachments=t[e]}return r}).catch(async r=>{this._logError("store:attachment-error","An error occurred.");const s={error:r,retry:()=>{this.failures.remove(s),this._queueAttachmentsOperation(e,t)},cancel:()=>this.failures.remove(s)};throw this.failures.add(s),this._attachmentsOperationQueue.remove(t),r})}_queueEditOperation(e){return this._editOperationQueue.push(e),e().then(t=>(this._editOperationQueue.remove(e),t)).catch(t=>{this._logError("store:edit-error","An error occurred.");const r={error:t,retry:()=>{this.failures.remove(r),this._queueEditOperation(e)},cancel:()=>this.failures.remove(r)};throw this.failures.add(r),this._editOperationQueue.remove(e),t})}_queueQueryOperation(e){return this._queryOperationQueue.push(e),e().then(t=>this._queryOperationQueue.includes(e)?t:[]).catch(t=>{this._logError("store:query-error","An error occurred.");const r={error:t,retry:()=>{this.failures.remove(r),this._queueQueryOperation(e)},cancel:()=>this.failures.remove(r)};return this.failures.add(r),[]}).then(t=>(this._queryOperationQueue.remove(e),t))}};e([d()],C.prototype,"_attachmentsOperationQueue",void 0),e([d({readOnly:!0})],C.prototype,"_capabilities",null),e([d()],C.prototype,"_defaultOutFields",void 0),e([d()],C.prototype,"_editOperationQueue",void 0),e([d()],C.prototype,"_effectiveReturnZ",null),e([d()],C.prototype,"_effectiveReturnM",null),e([d({readOnly:!0})],C.prototype,"_layerWithAttachments",null),e([d({readOnly:!0})],C.prototype,"_layerWithAttachmentsEditing",null),e([d({readOnly:!0})],C.prototype,"_layerWithEditing",null),e([d({readOnly:!0})],C.prototype,"_layerWithRelationships",null),e([d()],C.prototype,"_loaded",void 0),e([d()],C.prototype,"_loadError",void 0),e([d()],C.prototype,"_loading",void 0),e([d()],C.prototype,"_objectIdCache",void 0),e([d()],C.prototype,"_queryOperationQueue",void 0),e([d({readOnly:!0})],C.prototype,"_relatedLayer",null),e([d({readOnly:!0})],C.prototype,"_relatedLayerCapabilities",null),e([d({readOnly:!0})],C.prototype,"_relatedLayerSupportsCacheHint",null),e([d()],C.prototype,"_relatedLayerSupportsQuery",null),e([d()],C.prototype,"_relatedLayerSupportsQueryRelated",null),e([d()],C.prototype,"_sortedFieldNames",null),e([d()],C.prototype,"_subtypeCode",null),e([d()],C.prototype,"_subtypeField",null),e([d()],C.prototype,"_canUseRelatedLayer",null),e([d()],C.prototype,"attachmentsEnabled",void 0),e([d()],C.prototype,"canAddRelatedFeature",null),e([d({readOnly:!0})],C.prototype,"count",void 0),e([d()],C.prototype,"effectiveOutFields",null),e([d()],C.prototype,"effectiveTimeExtent",null),e([d()],C.prototype,"effectiveWhere",null),e([d({readOnly:!0})],C.prototype,"failures",void 0),e([d({types:y})],C.prototype,"filterGeometry",void 0),e([d()],C.prototype,"initialSize",void 0),e([d({readOnly:!0})],C.prototype,"isQuerying",null),e([d({readOnly:!0})],C.prototype,"isSyncing",null),e([d({readOnly:!0})],C.prototype,"isSyncingAttachmentEdits",null),e([d({readOnly:!0})],C.prototype,"isSyncingFeatureEdits",null),e([d({readOnly:!0})],C.prototype,"itemCache",null),e([d()],C.prototype,"layer",void 0),e([d()],C.prototype,"layerView",null),e([d()],C.prototype,"objectIds",void 0),e([d()],C.prototype,"orderByFields",null),e([d()],C.prototype,"outFields",void 0),e([d({readOnly:!0})],C.prototype,"pageCache",void 0),e([d()],C.prototype,"pageSize",void 0),e([d()],C.prototype,"relationship",null),e([d()],C.prototype,"relationshipConfig",void 0),e([d()],C.prototype,"relationshipIds",null),e([d()],C.prototype,"relationshipInfos",null),e([d()],C.prototype,"relationships",null),e([d()],C.prototype,"relatedRecordsEnabled",void 0),e([d()],C.prototype,"returnGeometry",void 0),e([d()],C.prototype,"returnZ",void 0),e([d()],C.prototype,"returnM",void 0),e([d()],C.prototype,"sortOrders",void 0),e([d({readOnly:!0})],C.prototype,"state",null),e([d()],C.prototype,"supportsAdd",null),e([d()],C.prototype,"supportsAddingAttachments",null),e([d()],C.prototype,"supportsAttachments",null),e([d()],C.prototype,"supportsCacheHint",null),e([d()],C.prototype,"supportsCacheHintQueryRelated",null),e([d()],C.prototype,"supportsDelete",null),e([d()],C.prototype,"supportsDeletingAttachments",null),e([d()],C.prototype,"supportsEditing",null),e([d()],C.prototype,"supportsM",null),e([d()],C.prototype,"supportsOrderBy",null),e([d()],C.prototype,"supportsPagination",null),e([d()],C.prototype,"supportsQuery",null),e([d()],C.prototype,"supportsQueryRelated",null),e([d()],C.prototype,"supportsResizeAttachments",null),e([d()],C.prototype,"supportsUpdate",null),e([d()],C.prototype,"supportsUpdateAttachments",null),e([d()],C.prototype,"supportsZ",null),e([d({type:b})],C.prototype,"timeExtent",void 0),e([d()],C.prototype,"view",void 0),e([d()],C.prototype,"where",void 0),C=e([c("esri.widgets.FeatureTable.support.FeatureStore")],C);const w=C;export{w as default};
|
|
5
|
+
import{__decorate as e}from"tslib";import t from"../../../Graphic.js";import r from"../../../core/Accessor.js";import{equals as s,isSome as i}from"../../../core/arrayUtils.js";import a from"../../../core/Collection.js";import o from"../../../core/Error.js";import{clone as n}from"../../../core/lang.js";import u from"../../../core/Logger.js";import p from"../../../core/ReactiveMap.js";import{watch as l,when as h}from"../../../core/reactiveUtils.js";import{property as d}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import{subclass as c}from"../../../core/accessorSupport/decorators/subclass.js";import{geometryTypes as y}from"../../../geometry/support/typeUtils.js";import{isSubtypeGroupLayer as m,isSubtypeSublayer as _}from"../../../layers/support/layerUtils.js";import f from"../../../rest/support/AttachmentQuery.js";import g from"../../../rest/support/RelationshipQuery.js";import b from"../../../time/TimeExtent.js";import{isIFeatureTableSupportedLayerWithAttachments as v,isIFeatureTableSupportedLayerWithAttachmentsEditing as O,isIFeatureTableSupportedLayerWithEditing as A,isIFeatureTableSupportedLayerWithRelationships as I,findRelatedLayer as j}from"./tableUtils.js";let C=class extends r{constructor(e){super(e),this._attachmentsOperationQueue=new a,this._defaultOutFields=["*"],this._editOperationQueue=new a,this._loaded=!1,this._loadError=!1,this._loading=!1,this._objectIdCache=new a,this._queryOperationQueue=new a,this.attachmentsEnabled=!1,this.count=0,this.failures=new a,this.filterGeometry=null,this.initialSize=null,this.layer=null,this.objectIds=null,this.outFields=null,this.pageCache=new p,this.pageSize=50,this.relationshipConfig=null,this.relatedRecordsEnabled=!1,this.returnGeometry=!1,this.returnZ=!1,this.returnM=!1,this.sortOrders=[],this.timeExtent=null,this.view=null,this.where=null}initialize(){this.addHandles([l(()=>[this.filterGeometry,this.layer,this.objectIds,this.outFields,this.pageSize,this.relationshipConfig,this.returnGeometry,this.returnM,this.returnZ,this.timeExtent,this.where],()=>this._reset()),l(()=>this.orderByFields,()=>this._clearCaches(),{equals:s}),h(()=>this.attachmentsEnabled,()=>this._reset()),h(()=>this.relatedRecordsEnabled,()=>this._reset())])}destroy(){this.layer=null,this.itemCache?.destroy(),this.failures?.destroy()}get _capabilities(){const{layer:e}=this;return e?.effectiveCapabilities??e?.capabilities}get _effectiveReturnZ(){return this.returnZ&&this.supportsZ}get _effectiveReturnM(){return this.returnM&&this.supportsM}get _layerWithAttachments(){const{layer:e}=this;return e&&this._capabilities&&this.attachmentsEnabled&&this.supportsAttachments&&v(e)?e:null}get _layerWithAttachmentsEditing(){const{_layerWithAttachments:e}=this;return e&&O(e)&&this.supportsEditing?e:null}get _layerWithEditing(){const e=this.layer;return A(e)&&this.supportsEditing?e:null}get _layerWithRelationships(){const e=this.layer;return I(e)&&this.supportsQueryRelated?e:null}get _relatedLayer(){return this.relationshipConfig?.relatedLayer}get _relatedLayerCapabilities(){const{_relatedLayer:e}=this;return e?.effectiveCapabilities??e?.capabilities}get _relatedLayerSupportsCacheHint(){return!!this._relatedLayerCapabilities?.queryRelated?.supportsCacheHint}get _relatedLayerSupportsQuery(){return!!this._relatedLayerCapabilities?.operations.supportsQuery}get _relatedLayerSupportsQueryRelated(){const{_relatedLayerCapabilities:e}=this;return!!e?.queryRelated?.supportsCount&&!!e?.queryRelated?.supportsPagination}get _sortedFieldNames(){return this.sortOrders.map(({fieldName:e})=>e)}get _subtypeCode(){return this.layer?.subtypeCode??null}get _subtypeField(){const{layer:e}=this;return m(e?.parent)?e.subtypeField:null}get _canUseRelatedLayer(){return!(!this._relatedLayerSupportsQuery||!this._relatedLayerSupportsQueryRelated)}get canAddRelatedFeature(){const{state:e,relationship:t,supportsAdd:r,supportsEditing:s}=this;if("loaded"!==e||!t||!r||!s)return!1;const{count:i}=this,{cardinality:a,role:o}=t,n=i>0;return("one-to-one"!==a||!n)&&("one-to-many"!==a||"origin"!==o||!n)}get effectiveOutFields(){const{layer:e,outFields:t}=this;if(!e||!t?.length)return this._defaultOutFields;const r=[];t.forEach(t=>{const s=e.fieldsIndex.normalizeFieldName(t);s&&r.push(s)});const{objectIdField:s}=e,i=e.fieldsIndex.normalizeFieldName(s)??s;return i&&!r.includes(i)&&r.unshift(i),r}get effectiveTimeExtent(){const{layer:e,timeExtent:t}=this;return t||e&&"timeExtent"in e&&e.timeExtent||null}get effectiveWhere(){const{layer:e,where:t}=this;return null!=t&&""!==t?t:_(e)&&e.parent?.definitionExpression?e.parent.definitionExpression:e?.definitionExpression||"1=1"}get isQuerying(){return this._queryOperationQueue.length>0}get isSyncing(){return this.isSyncingFeatureEdits||this.isSyncingAttachmentEdits}get isSyncingAttachmentEdits(){return this._attachmentsOperationQueue.length>0}get isSyncingFeatureEdits(){return this._editOperationQueue.length>0}get itemCache(){return new a({items:[...this.pageCache.values()].flat()})}get layerView(){const{layer:e,view:t}=this;if(!e||!t)return null;const r="sublayer"===e.type||_(e)?e.parent:e;return t.allLayerViews.find(e=>e.layer===r)}get orderByFields(){const{_sortedFieldNames:e,layer:t,sortOrders:r}=this,s=r.filter(({fieldName:t,direction:r},s)=>e.indexOf(t)===s&&null!=r).map(({fieldName:e,direction:t})=>`${e} ${t?.toUpperCase()}`);if(t&&!s.length&&!t.objectIdField&&t.fields?.length){const e=t.fields.find(e=>e.name);if(e){const r=t.fieldsIndex.normalizeFieldName(e.name);r&&s.push(`${r} ASC`)}}return s}get relationship(){const{relationshipConfig:e}=this;return null==e?.relationshipId?null:this.relationships?.find(t=>t.id===e.relationshipId)}get relationshipIds(){return this.relationships?.map(e=>e.id)??[]}get relationshipInfos(){const{_layerWithRelationships:e,relatedRecordsEnabled:t,relationships:r,view:s}=this,i=[];return t&&e?.loaded&&s?.map&&r?.length?(r.forEach(t=>{const r=j(e,s,t);r&&(r.load(),i.push({layer:e,relatedLayer:r,relationshipId:t.id}))}),i):i}get relationships(){return this._layerWithRelationships?.relationships}get state(){const{layer:e,_loaded:t,_loadError:r,_loading:s}=this;return!e||e.destroyed?"disabled":r||e.loadError?"error":"loaded"===e.loadStatus&&t?"loaded":s?"loading":"ready"}get supportsAdd(){return!!this._capabilities?.operations.supportsAdd}get supportsAddingAttachments(){return!(!this._layerWithAttachmentsEditing||!this.supportsAdd)}get supportsAttachments(){const{_capabilities:e}=this;return!(!e?.data?.supportsAttachment||!e?.operations.supportsQueryAttachments)}get supportsCacheHint(){return!!this._capabilities?.query?.supportsCacheHint}get supportsCacheHintQueryRelated(){return!!this._capabilities?.queryRelated?.supportsCacheHint}get supportsDelete(){return!!this._capabilities?.operations.supportsDelete}get supportsDeletingAttachments(){return!(!this._layerWithAttachmentsEditing||!this.supportsDelete)}get supportsEditing(){return!!this._capabilities?.operations.supportsEditing}get supportsM(){return!!this.layer?.hasM&&!!this._capabilities?.data?.supportsM}get supportsOrderBy(){return!!this._capabilities?.query?.supportsOrderBy}get supportsPagination(){return!!this._capabilities?.query?.supportsPagination}get supportsQuery(){return!!this._capabilities?.operations.supportsQuery}get supportsQueryRelated(){const{_capabilities:e}=this;return!!e?.queryRelated?.supportsCount&&!!e?.queryRelated?.supportsPagination}get supportsResizeAttachments(){const{_capabilities:e}=this;return!(!this.supportsAttachments||!e?.attachment?.supportsResize)}get supportsUpdate(){return!!this._capabilities?.operations.supportsUpdate}get supportsUpdateAttachments(){return!(!this._layerWithAttachmentsEditing||!this.supportsUpdate)}get supportsZ(){return!!this.layer?.hasZ&&!!this._capabilities?.data?.supportsZ}async addAttachment(e,t){const{_layerWithAttachmentsEditing:r}=this;if(!r||!this.supportsAddingAttachments)return{};const s=await this._queueAttachmentsOperation(e,()=>r.addAttachment(this._createBaseGraphic(r,e),t));return this._ensureArrayContent(s)}async deleteAttachments(e,t){const{_layerWithAttachmentsEditing:r}=this;if(!r||!this.supportsDeletingAttachments||!t.length)return[];const s=await this._queueAttachmentsOperation(e,()=>r.deleteAttachments(this._createBaseGraphic(r,e),t));return this._ensureArray(s)}async deleteRowsByObjectId(e){const{_layerWithEditing:t}=this;if(!this.supportsDelete||!t)throw new o("store:delete-error","Delete is not supported.");const r=e.map(e=>this.getItemByObjectId(e)?.feature).filter(i);return this._queueEditOperation(()=>t.applyEdits({deleteFeatures:r}))}async fetchItems(e){const{page:t}=e,{pageSize:r}=this,s=t*r,i=s+r,{layer:a,state:o}=this;return a&&"loaded"===o?this._query({layer:a,start:s,num:i,page:t,pageSize:r}):[]}async getAttachmentsByObjectId(e,t){const r=this.getItemByObjectId(e)?.attachments??[];if(!r.length&&t){return(await this._queryAttachments([e]))[e]??[]}return r}getItemByObjectId(e){for(const t of this.pageCache.values())for(const r of t)if(r.objectId===e)return r}getItemIndexByObjectId(e){const{pageCache:t,pageSize:r}=this,s=t.entries();let i=-1;for(const[a,o]of s)if(o.some((t,s)=>{const o=t.objectId===e;return o&&(i=a*r+s),o}),i>-1)break;return i}async load(){const{layer:e}=this;if(!this._loading&&!this._loaded&&e){this._reset(),this._loading=!0;try{await e.load(),e.parent&&m(e.parent)&&await e.parent.loadAll(),await e.when();const t=this.initialSize;this.initialSize=null,await this.refresh(t),this._loaded=!0,this._loading=!1}catch(t){throw this._reset(),this._loadError=!0,this._logError("store:load-error","An error occurred."),t}}}async query(e){const{state:t}=this;return this.supportsQuery&&"loaded"===t?this._query(e):[]}async refresh(e){this._clearCaches(),await this._syncCount(e),await this._syncObjectIdCache()}reset(){this._reset()}async updateAttachment(e,t,r){const{_layerWithAttachmentsEditing:s}=this;if(!s||!this.supportsUpdateAttachments)return{};const i=await this._queueAttachmentsOperation(e,()=>s.updateAttachment(this._createBaseGraphic(s,e),t,r));return this._ensureArrayContent(i)}async updateItem(e){const{_sortedFieldNames:t}=this,r=e.updates.map(({fieldName:e})=>e),s=await this._update(e);return!s.updateFeatureResults.find(e=>e.error)&&r.some(e=>t.includes(e))&&this._clearCaches(),s}async verifyFeaturesByObjectId(e){const{layer:t,state:r}=this;if(!t||"loaded"!==r)return[];const{objectIdField:s}=t,i=await this._verifyFeaturesByObjectId(e);return e.map(e=>i.some(t=>{const r=t.getObjectId()??t.attributes[s];return e===r}))}_clearCaches(){this.pageCache.clear(),this._objectIdCache.removeAll()}_createBaseGraphic(e,r){const s=new t({attributes:{[e.objectIdField]:r}});return this._subtypeField&&null!=this._subtypeCode&&(s.attributes[this._subtypeField]=this._subtypeCode),s}_ensureArray(e){return Array.isArray(e)?e:[e]}_ensureArrayContent(e){return Array.isArray(e)?e[0]:e}_getObjectIdsForPage(e,t){const r=this._objectIdCache.toArray();return r.length>=e+t?r.slice(e,e+t):r.slice(e)}_logError(e,t){u.getLogger(this).error(e,t)}_reset(){this._clearCaches(),this.failures.removeAll(),this._attachmentsOperationQueue.removeAll(),this._editOperationQueue.removeAll(),this._queryOperationQueue.removeAll(),this._loading=!1,this._loaded=!1,this._loadError=!1,this._set("count",0)}async _syncCount(e){null==e?await this._queryCount().then(e=>this._set("count",e)):this._set("count",e)}async _syncObjectIdCache(){if(this.supportsPagination)return;const e=await this._queryObjectIds();this._objectIdCache.removeAll(),this._objectIdCache.addMany(e)}async _verifyFeaturesByObjectId(e){const{layer:t}=this;if(!t||!this.supportsQuery)throw new o("store:query-error","Layer does not support query operation.");const{effectiveTimeExtent:r,effectiveWhere:s,orderByFields:i,supportsCacheHint:a,supportsOrderBy:n}=this,u=t.createQuery();u.where=s,u.timeExtent=r,u.returnGeometry=!1,u.objectIds=e.length?e:void 0,u.outFields=[t.objectIdField],n&&(u.orderByFields=i),a&&(u.cacheHint=!0);return(await t.queryFeatures(u)).features}async _update(e){const{objectId:r,updates:s}=e,{_layerWithEditing:i}=this;if(!this.supportsUpdate||!i)throw new o("store:update-error","Update is not supported.");const a=this.getItemByObjectId(r)?.feature;if(!a)throw new o("store:update-error","Feature with provided 'objectId' not found.");const u=n(a.attributes);s.forEach(({fieldName:e,value:t})=>u[e]=t);const p=new t({attributes:u}),l=i.applyEdits({updateFeatures:[p]}).then(e=>{const{updateFeatureResults:t}=e,r=t.find(e=>!!e.error);if(r)throw r.error;return t.length&&(a.attributes=u),e});return this._queueEditOperation(()=>l)}_prepareFeatureData(e){const{attachments:t,features:r,layer:s,relatedRecords:i}=e,a=s.objectIdField;return r.map(e=>{const r=e.getObjectId()??e.attributes[a],o=[];return e.layer||e.sourceLayer||(e.layer=s,e.sourceLayer=s),i.forEach((e,t)=>{o.push({relationshipId:t,count:e[r]??0})}),{objectId:r,feature:e,attachments:t[r]??null,relatedRecords:o}})}async _query(e){const{page:t,refresh:r}=e;!0===r&&await this.refresh();const s=this.pageCache.get(t);if(s)return s;const i=await this._queryPage(e);return this.pageCache.set(t,i),i}_queryAttachments(e){const{_layerWithAttachments:t,effectiveWhere:r}=this;return t?e.some(e=>"number"!=typeof e)?Promise.reject(new o("invalid-object-id","Only numeric object ids are valid to query attachments")):t.queryAttachments(new f({objectIds:e,where:r,returnMetadata:!0})):Promise.resolve({})}async _queryCount(){const{_relatedLayerSupportsCacheHint:e,layer:t,relationshipConfig:r,supportsCacheHint:s}=this;if(!t)return 0;if(r&&this._canUseRelatedLayer){const{objectId:t,relatedLayer:s,relationshipId:i}=r;return(await s.queryRelatedFeaturesCount(new g({cacheHint:e,relationshipId:i,objectIds:[t]})))[t]??0}const{effectiveTimeExtent:i,effectiveWhere:a,filterGeometry:o,objectIds:n}=this,u=t.createQuery();return u.geometry=o,u.returnGeometry=!1,u.where=a,u.timeExtent=i,u.objectIds=n?.length?n:void 0,s&&(u.cacheHint=!0),t.queryFeatureCount(u)}async _queryFeatures(e){const{relationshipConfig:t}=this;if(t&&this._canUseRelatedLayer)return this._queryRelatedFeatures(e,t);const{_effectiveReturnM:r,_effectiveReturnZ:s,effectiveOutFields:i,effectiveTimeExtent:a,effectiveWhere:o,filterGeometry:n,objectIds:u,orderByFields:p,pageSize:l,returnGeometry:h,supportsCacheHint:d,supportsOrderBy:c,supportsPagination:y}=this,{layer:m,start:_}=e,f=u?.length,g=m.createQuery();g.returnGeometry=h,g.outFields=i,g.returnM=r,g.returnZ=s,y?(g.start=_,g.num=l,g.where=o,g.timeExtent=a,g.objectIds=f?u:void 0):g.objectIds=f?u:this._getObjectIdsForPage(_,l??0),c&&(g.orderByFields=p),n&&(g.geometry=n),d&&(g.cacheHint=!0);return(await m.queryFeatures(g)).features}_queryObjectIds(){const{effectiveTimeExtent:e,effectiveWhere:t,filterGeometry:r,layer:s,objectIds:i,orderByFields:a,supportsCacheHint:o,supportsOrderBy:n}=this;if(!s)return Promise.resolve([]);const u=s.createQuery();return u.geometry=r,u.outFields=[s.objectIdField],u.returnGeometry=!1,u.where=t,u.timeExtent=e,u.objectIds=i?.length?i:void 0,n&&(u.orderByFields=a),o&&(u.cacheHint=!0),s.queryObjectIds(u)}async _queryPage(e){const{layer:t}=e;return this._queueQueryOperation(async()=>{const r=await this._queryFeatures(e),s=r.map(e=>e.getObjectId()??e.attributes[t.objectIdField]),i=await this._queryAttachments(s),a=await this._queryRelatedCounts(s);return this._prepareFeatureData({layer:t,features:r,attachments:i,relatedRecords:a})||[]})}async _queryRelatedCounts(e){const{_layerWithRelationships:t,relationshipIds:r,supportsCacheHintQueryRelated:s}=this,i=new Map;return t&&e?.length&&r.length?(await Promise.allSettled(r.map(async r=>{const a=await t.queryRelatedFeaturesCount(new g({cacheHint:s,relationshipId:r,objectIds:e}));i.set(r,a)})),i):i}async _queryRelatedFeatures(e,t){const{_defaultOutFields:r,_effectiveReturnM:s,_effectiveReturnZ:i,orderByFields:a,pageSize:o,returnGeometry:n,supportsCacheHint:u}=this,{layer:p,start:l}=e,{objectId:h,relatedLayer:d,relationshipId:c}=t,y=p.createQuery(),m=new g({cacheHint:u,num:o,objectIds:[h],orderByFields:a,outFields:r,relationshipId:c,returnGeometry:n,returnM:s,returnZ:i,start:l,where:y.where??void 0}),_=await d.queryRelatedFeatures(m);return _[h]?.features||[]}_queueAttachmentsOperation(e,t){return this._attachmentsOperationQueue.push(t),t().then(async r=>{this._attachmentsOperationQueue.remove(t);const s=this._ensureArray(r),i=s.some(e=>e.error),a=this.getItemByObjectId(e);if(a&&(!i||s.length>1)){const t=await this._queryAttachments([e]);a.attachments=t[e]}return r}).catch(async r=>{this._logError("store:attachment-error","An error occurred.");const s={error:r,retry:()=>{this.failures.remove(s),this._queueAttachmentsOperation(e,t)},cancel:()=>this.failures.remove(s)};throw this.failures.add(s),this._attachmentsOperationQueue.remove(t),r})}_queueEditOperation(e){return this._editOperationQueue.push(e),e().then(t=>(this._editOperationQueue.remove(e),t)).catch(t=>{this._logError("store:edit-error","An error occurred.");const r={error:t,retry:()=>{this.failures.remove(r),this._queueEditOperation(e)},cancel:()=>this.failures.remove(r)};throw this.failures.add(r),this._editOperationQueue.remove(e),t})}_queueQueryOperation(e){return this._queryOperationQueue.push(e),e().then(t=>this._queryOperationQueue.includes(e)?t:[]).catch(t=>{this._logError("store:query-error","An error occurred.");const r={error:t,retry:()=>{this.failures.remove(r),this._queueQueryOperation(e)},cancel:()=>this.failures.remove(r)};return this.failures.add(r),[]}).then(t=>(this._queryOperationQueue.remove(e),t))}};e([d()],C.prototype,"_attachmentsOperationQueue",void 0),e([d({readOnly:!0})],C.prototype,"_capabilities",null),e([d()],C.prototype,"_defaultOutFields",void 0),e([d()],C.prototype,"_editOperationQueue",void 0),e([d()],C.prototype,"_effectiveReturnZ",null),e([d()],C.prototype,"_effectiveReturnM",null),e([d({readOnly:!0})],C.prototype,"_layerWithAttachments",null),e([d({readOnly:!0})],C.prototype,"_layerWithAttachmentsEditing",null),e([d({readOnly:!0})],C.prototype,"_layerWithEditing",null),e([d({readOnly:!0})],C.prototype,"_layerWithRelationships",null),e([d()],C.prototype,"_loaded",void 0),e([d()],C.prototype,"_loadError",void 0),e([d()],C.prototype,"_loading",void 0),e([d()],C.prototype,"_objectIdCache",void 0),e([d()],C.prototype,"_queryOperationQueue",void 0),e([d({readOnly:!0})],C.prototype,"_relatedLayer",null),e([d({readOnly:!0})],C.prototype,"_relatedLayerCapabilities",null),e([d({readOnly:!0})],C.prototype,"_relatedLayerSupportsCacheHint",null),e([d()],C.prototype,"_relatedLayerSupportsQuery",null),e([d()],C.prototype,"_relatedLayerSupportsQueryRelated",null),e([d()],C.prototype,"_sortedFieldNames",null),e([d()],C.prototype,"_subtypeCode",null),e([d()],C.prototype,"_subtypeField",null),e([d()],C.prototype,"_canUseRelatedLayer",null),e([d()],C.prototype,"attachmentsEnabled",void 0),e([d()],C.prototype,"canAddRelatedFeature",null),e([d({readOnly:!0})],C.prototype,"count",void 0),e([d()],C.prototype,"effectiveOutFields",null),e([d()],C.prototype,"effectiveTimeExtent",null),e([d()],C.prototype,"effectiveWhere",null),e([d({readOnly:!0})],C.prototype,"failures",void 0),e([d({types:y})],C.prototype,"filterGeometry",void 0),e([d()],C.prototype,"initialSize",void 0),e([d({readOnly:!0})],C.prototype,"isQuerying",null),e([d({readOnly:!0})],C.prototype,"isSyncing",null),e([d({readOnly:!0})],C.prototype,"isSyncingAttachmentEdits",null),e([d({readOnly:!0})],C.prototype,"isSyncingFeatureEdits",null),e([d({readOnly:!0})],C.prototype,"itemCache",null),e([d()],C.prototype,"layer",void 0),e([d()],C.prototype,"layerView",null),e([d()],C.prototype,"objectIds",void 0),e([d()],C.prototype,"orderByFields",null),e([d()],C.prototype,"outFields",void 0),e([d({readOnly:!0})],C.prototype,"pageCache",void 0),e([d()],C.prototype,"pageSize",void 0),e([d()],C.prototype,"relationship",null),e([d()],C.prototype,"relationshipConfig",void 0),e([d()],C.prototype,"relationshipIds",null),e([d()],C.prototype,"relationshipInfos",null),e([d()],C.prototype,"relationships",null),e([d()],C.prototype,"relatedRecordsEnabled",void 0),e([d()],C.prototype,"returnGeometry",void 0),e([d()],C.prototype,"returnZ",void 0),e([d()],C.prototype,"returnM",void 0),e([d()],C.prototype,"sortOrders",void 0),e([d({readOnly:!0})],C.prototype,"state",null),e([d()],C.prototype,"supportsAdd",null),e([d()],C.prototype,"supportsAddingAttachments",null),e([d()],C.prototype,"supportsAttachments",null),e([d()],C.prototype,"supportsCacheHint",null),e([d()],C.prototype,"supportsCacheHintQueryRelated",null),e([d()],C.prototype,"supportsDelete",null),e([d()],C.prototype,"supportsDeletingAttachments",null),e([d()],C.prototype,"supportsEditing",null),e([d()],C.prototype,"supportsM",null),e([d()],C.prototype,"supportsOrderBy",null),e([d()],C.prototype,"supportsPagination",null),e([d()],C.prototype,"supportsQuery",null),e([d()],C.prototype,"supportsQueryRelated",null),e([d()],C.prototype,"supportsResizeAttachments",null),e([d()],C.prototype,"supportsUpdate",null),e([d()],C.prototype,"supportsUpdateAttachments",null),e([d()],C.prototype,"supportsZ",null),e([d({type:b})],C.prototype,"timeExtent",void 0),e([d()],C.prototype,"view",void 0),e([d()],C.prototype,"where",void 0),C=e([c("esri.widgets.FeatureTable.support.FeatureStore")],C);const w=C;export{w as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{__decorate as t}from"tslib";import e from"../../core/Collection.js";import{EventedAccessor as i}from"../../core/Evented.js";import n from"../../core/Logger.js";import{after as s,isAbortError as r}from"../../core/promiseUtils.js";import{watch as o,initial as l,syncAndInitial as a,whenOnce as m}from"../../core/reactiveUtils.js";import{offsetDate as u}from"../../core/timeUtils.js";import{property as p}from"../../core/accessorSupport/decorators/property.js";import{ensureType as
|
|
5
|
+
import{__decorate as t}from"tslib";import e from"../../core/Collection.js";import{EventedAccessor as i}from"../../core/Evented.js";import n from"../../core/Logger.js";import{after as s,isAbortError as r}from"../../core/promiseUtils.js";import{watch as o,initial as l,syncAndInitial as a,whenOnce as m}from"../../core/reactiveUtils.js";import{offsetDate as u}from"../../core/timeUtils.js";import{property as p}from"../../core/accessorSupport/decorators/property.js";import{ensureType as d}from"../../core/accessorSupport/ensureType.js";import"../../core/has.js";import"../../core/RandomLCG.js";import{subclass as h}from"../../core/accessorSupport/decorators/subclass.js";import c from"../../time/TimeExtent.js";import f from"../../time/TimeInterval.js";import w from"../../webdoc/Widgets.js";import g from"../../webdoc/widgets/TimeSlider.js";const v=1e4;function T(t){return null!=t&&void 0!==t.count}function x(t){return null!=t&&void 0!==t.interval}function E(t){return null!=t&&void 0!==t.dates}let _=class extends i{constructor(t){super(t),this._animationController=null,this._isViewTimeExtentInitialized=!1,this._timerId=null,this.actions=new e,this.fullTimeExtent=null,this.loop=!1,this.mode="time-window",this.stops={count:10},this.timeExtent=null,this.view=null}initialize(){this.addHandles([o(()=>this.effectiveStops,()=>{this.timeExtent??=this._getDefaultTimeExtent()},l),o(()=>this.view,(t,e)=>{this._unregisterWidget(e),this._registerWidget(t)},a),o(()=>this.timeExtent,t=>{if(!this.view)return;const e=this.view.timeExtent;(t&&!t.isAllTime||e&&!e.isAllTime)&&(t&&e&&t.equals(e)||(this.view.timeExtent=t))},l),o(()=>this.view?.timeExtent,t=>{this._isViewTimeExtentInitialized?(t&&!t.isAllTime||this.timeExtent&&!this.timeExtent.isAllTime)&&(t&&this.timeExtent&&t.equals(this.timeExtent)||(this.timeExtent=t)):this._isViewTimeExtentInitialized=!0})])}destroy(){null!=this._timerId&&(clearInterval(this._timerId),this._timerId=null),this._unregisterWidget(this.view),this.view=null,this._animationController&&(this._animationController.abort(),this._animationController=null)}get effectiveStops(){const{fullTimeExtent:t,stops:e}=this;if(E(e)){const{dates:i}=e;if(!i?.length)return null;const n=i.sort((t,e)=>t.getTime()-e.getTime());if(!t)return n;const{start:s,end:r}=t;if(!s||!r)return n;return n.filter(t=>!(t.getTime()<s.getTime()||t.getTime()>r.getTime()))}if(T(e)){const i=e.timeExtent??t;return this._divideTimeExtentByCount(i,e.count)}if(x(e)){const i=e.timeExtent??t;return this._divideTimeExtentByInterval(i,e.interval)}return[]}set playRate(t){t<=0||t>36e5||("playing"===this.state&&this._startAnimation(),this._set("playRate",t))}get state(){return this.fullTimeExtent?this._animationController?"playing":"ready":"disabled"}get timeExtentValues(){const{mode:t,timeExtent:e}=this;if(!e||e.isAllTime||e.isEmpty)return null;const{start:i,end:n}=e;switch(t){case"cumulative-from-end":case"instant":return i?[i.getTime()]:null;case"cumulative-from-start":return n?[n.getTime()]:null;case"time-window":return i&&n?[i.getTime(),n.getTime()]:null}}next(){this._step({forward:!0,allowRestart:!1})}play(){this._startAnimation()}previous(){this._step({forward:!1,allowRestart:!1})}stop(){this._stopAnimation()}triggerAction(t){this.emit("trigger-action",{action:t})}updateWebDocument(t){const e=new g({currentTimeExtent:this.timeExtent,fullTimeExtent:this.fullTimeExtent,loop:this.loop,numStops:T(this.stops)?this.stops.count:null,numThumbs:"time-window"===this.mode?2:1,stopDelay:this.playRate,stopInterval:x(this.stops)?this.stops.interval:null,stops:E(this.stops)?this.stops.dates:null});t.widgets?t.widgets.timeSlider=e:t.widgets=new w({timeSlider:e})}valuesToTimeExtent(t){if(!t)return null;const e=t.sort((t,e)=>t-e).map(t=>new Date(t)),i=e.length>0?e[0]:null,n=e.length>1?e[1]:null;switch(this.mode){case"time-window":return new c({start:i,end:n});case"instant":return new c({start:i,end:i});case"cumulative-from-start":return new c({start:null,end:i});case"cumulative-from-end":return new c({start:i,end:null});default:return c.allTime}}async _animate(){try{const t=this.view,e=this._animationController?.signal;await Promise.all([s(this.playRate,null,e),t&&m(()=>!t.updating,e)])}catch(t){return r(t)||n.getLogger(this).error(t),void(this._animationController=null)}this._step({forward:!0,allowRestart:!1}),this._animationController&&this._animate()}_divideTimeExtentByCount(t,e=10){if(!t||!e)return[];const{start:i,end:n}=t;if(!i||!n)return[];if(e>v)return this._divideTimeExtentByCount(t);const s=[],r=i.getTime(),o=n.getTime()-r;for(let l=0;l<=e;l++)s.push(new Date(r+l/e*o));return s}_divideTimeExtentByInterval(t,e,i=v){if(!t||!e)return[];const{start:n,end:s}=t;if(!n||!s)return[];const r=s.getTime()-n.getTime(),o=e.toMilliseconds();if(o<=0||r/o>i)return this._divideTimeExtentByCount(t);const l=[],{value:a,unit:m}=e;let p=n;for(;p.getTime()<=s.getTime();)l.push(new Date(p)),p=u(p,a,m);return l}_getDefaultTimeExtent(){const{effectiveStops:t,mode:e}=this;if(!t||!e)return null;switch(e){case"time-window":return t.length>1?new c({start:t[0],end:t[1]}):null;case"cumulative-from-start":return t.length>0?new c({start:null,end:t[0]}):null;case"cumulative-from-end":return t.length>0?new c({start:t[0],end:null}):null;case"instant":return t.length>0?new c({start:t[0],end:t[0]}):null;default:return null}}_registerWidget(t){if(t){t.persistableViewModels.includes(this)||t.persistableViewModels.add(this)}}_startAnimation(){this._stopAnimation(),this._animationController=new AbortController,this._step({forward:!0,allowRestart:!0}),this._animate()}_step(t){const{forward:e,allowRestart:i}=t,{effectiveStops:n}=this;if(!this.timeExtentValues||!n)return;const s=n.map(t=>t.getTime()),r=this.timeExtentValues.map(t=>{const e=s.indexOf(t);if(-1!==e)return e;const i=s.reduce((e,i)=>Math.abs(i-t)<Math.abs(e-t)?i:e);return s.indexOf(i)}),o=r.map(t=>t+(e?1:-1)),l=o.some(t=>t<0||t>s.length-1),{loop:a,state:m}=this;if(l)if(a||i){const t=Math.min(...r),i=Math.max(...r),n=(e?r.map(e=>e-t):r.map(t=>t+(s.length-1-i))).map(t=>s[t]);this.timeExtent=this.valuesToTimeExtent(n)}else"playing"===m&&this.stop();else{const t=o.map(t=>s[t]);this.timeExtent=this.valuesToTimeExtent(t)}}_stopAnimation(){null!=this._animationController&&(this._animationController.abort(),this._animationController=null)}_unregisterWidget(t){null!=t&&t.persistableViewModels.remove(this)}};t([p()],_.prototype,"_animationController",void 0),t([p({type:e})],_.prototype,"actions",void 0),t([p({readOnly:!0})],_.prototype,"effectiveStops",null),t([p({type:c})],_.prototype,"fullTimeExtent",void 0),t([p({nonNullable:!0})],_.prototype,"loop",void 0),t([p({nonNullable:!0})],_.prototype,"mode",void 0),t([p({nonNullable:!0,value:1e3})],_.prototype,"playRate",null),t([p({readOnly:!0})],_.prototype,"state",null),t([p({cast:t=>t?(x(t)&&(t.interval=d(f,t.interval)),(x(t)||T(t))&&(t.timeExtent=d(c,t.timeExtent)),t):null})],_.prototype,"stops",void 0),t([p({type:c})],_.prototype,"timeExtent",void 0),t([p({readOnly:!0})],_.prototype,"timeExtentValues",null),t([p()],_.prototype,"view",void 0),t([p()],_.prototype,"next",null),t([p()],_.prototype,"play",null),t([p()],_.prototype,"previous",null),t([p()],_.prototype,"stop",null),t([p()],_.prototype,"updateWebDocument",null),_=t([h("esri.widgets.TimeSlider.TimeSliderViewModel")],_);const y=_;export{y as default};
|
package/widgets/TimeSlider.js
CHANGED
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{__decorate as t}from"tslib";import{equals as e}from"../core/arrayUtils.js";import{neverReached as i}from"../core/compilerUtils.js";import{watch as a,initial as s}from"../core/reactiveUtils.js";import{truncateDate as r,offsetDate as o}from"../core/timeUtils.js";import{property as n}from"../core/accessorSupport/decorators/property.js";import"../core/Logger.js";import{subclass as l}from"../core/accessorSupport/decorators/subclass.js";import{formatDate as m,convertDateFormatToIntlOptions as u}from"../intl/date.js";import{unknown as c,system as d}from"../time/constants.js";import{T as p}from"../chunks/TimeInterval.js";import h from"./Slider.js";import v from"./Widget.js";import{loadCalciteComponents as f}from"./support/componentsUtils.js";import{globalCss as y}from"./support/globalCss.js";import{onResize as g}from"./support/widgetUtils.js";import{messageBundle as b}from"./support/decorators/messageBundle.js";import{vmEvent as x}from"./support/decorators/vmEvent.js";import{tsx as w}from"./support/jsxFactory.js";import{getCalciteModeClass as E}from"../support/modeUtils.js";import{css as k}from"./TimeSlider/css.js";import j from"./TimeSlider/TimeSliderViewModel.js";const T=3,_=858,S=[{minor:{value:100,unit:"milliseconds"},major:{value:1,unit:"seconds"},format:{second:"numeric"}},{minor:{value:500,unit:"milliseconds"},major:{value:5,unit:"seconds"},format:{second:"numeric"}},{minor:{value:1,unit:"seconds"},major:{value:20,unit:"seconds"},format:{minute:"numeric",second:"numeric"}},{minor:{value:2,unit:"seconds"},major:{value:30,unit:"seconds"},format:{minute:"numeric",second:"numeric"}},{minor:{value:10,unit:"seconds"},major:{value:1,unit:"minutes"},format:{minute:"numeric"}},{minor:{value:15,unit:"seconds"},major:{value:5,unit:"minutes"},format:{hour:"numeric",minute:"numeric"}},{minor:{value:1,unit:"minutes"},major:{value:20,unit:"minutes"},format:{hour:"numeric",minute:"numeric"}},{minor:{value:5,unit:"minutes"},major:{value:2,unit:"hours"},format:{hour:"numeric",minute:"numeric"}},{minor:{value:15,unit:"minutes"},major:{value:6,unit:"hours"},format:{hour:"numeric",minute:"numeric"}},{minor:{value:1,unit:"hours"},major:{value:1,unit:"days"},format:{day:"numeric",month:"short"}},{minor:{value:6,unit:"hours"},major:{value:1,unit:"weeks"},format:{day:"numeric",month:"short"}},{minor:{value:1,unit:"days"},major:{value:1,unit:"months"},format:{month:"long"}},{minor:{value:2,unit:"days"},major:{value:1,unit:"months"},format:{month:"short"}},{minor:{value:3,unit:"days"},major:{value:1,unit:"months"},format:{month:"short"}},{minor:{value:4,unit:"days"},major:{value:3,unit:"months"},format:{month:"short",year:"numeric"}},{minor:{value:1,unit:"weeks"},major:{value:1,unit:"years"},format:{year:"numeric"}},{minor:{value:1,unit:"months"},major:{value:1,unit:"years"},format:{year:"numeric"}},{minor:{value:2,unit:"months"},major:{value:2,unit:"years"},format:{year:"numeric"}},{minor:{value:1,unit:"years"},major:{value:1,unit:"decades"},format:{year:"numeric"}},{minor:{value:2,unit:"years"},major:{value:5,unit:"decades"},format:{year:"numeric"}},{minor:{value:5,unit:"decades"},major:{value:10,unit:"centuries"},format:{era:"short",year:"numeric"}},{minor:{value:1,unit:"centuries"},major:{value:10,unit:"centuries"},format:{era:"short",year:"numeric"}},{minor:{value:2,unit:"centuries"},major:{value:20,unit:"centuries"},format:{era:"short",year:"numeric"}},{minor:{value:5,unit:"centuries"},major:{value:50,unit:"centuries"},format:{era:"short",year:"numeric"}},{minor:{value:10,unit:"centuries"},major:{value:100,unit:"centuries"},format:{era:"short",year:"numeric"}},{minor:{value:20,unit:"centuries"},major:{value:200,unit:"centuries"},format:{era:"short",year:"numeric"}},{minor:{value:50,unit:"centuries"},major:{value:500,unit:"centuries"},format:{era:"short",year:"numeric"}},{minor:{value:100,unit:"centuries"},major:{value:1e3,unit:"centuries"},format:{era:"short",year:"numeric"}},{minor:{value:200,unit:"centuries"},major:{value:1e3,unit:"centuries"},format:{era:"short",year:"numeric"}},{minor:{value:500,unit:"centuries"},major:{value:5e3,unit:"centuries"},format:{era:"short",year:"numeric"}},{minor:{value:1e3,unit:"centuries"},major:{value:1e4,unit:"centuries"},format:{era:"short",year:"numeric"}}];function M(t){return w("div",{class:k.warning},w("calcite-icon",{class:k.warningIcon,icon:"exclamation-mark-triangle"}),w("calcite-label",{alignment:"center",class:k.warningLabel,scale:"s"},t))}let F=class extends v{constructor(t,e){super(t,e),this._allLayouts=["auto","compact","wide"],this._ignoreNextSliderUpdate=!1,this._slider=new h({precision:0,visibleElements:{rangeLabels:!1},rangeLabelInputsEnabled:!1,thumbsConstrained:!1}),this._tickFormat=null,this.disabled=!1,this.labelFormatFunction=null,this.messages=null,this.tickConfigs=null,this.timeVisible=!1,this.viewModel=new j}initialize(){this.addHandles([a(()=>this._slider.values,t=>{if(this._ignoreNextSliderUpdate)return void(this._ignoreNextSliderUpdate=!1);const e=this.viewModel.valuesToTimeExtent(t);this.timeExtent?e?this.timeExtent.equals(e)||(this.timeExtent=e):this.timeExtent=null:e&&(this.timeExtent=e)}),a(()=>this.effectiveStops,()=>this._updateSliderSteps(),s)])}loadDependencies(){return f({action:()=>import("@esri/calcite-components/dist/components/calcite-action"),"action-menu":()=>import("@esri/calcite-components/dist/components/calcite-action-menu"),button:()=>import("@esri/calcite-components/dist/components/calcite-button"),icon:()=>import("@esri/calcite-components/dist/components/calcite-icon"),label:()=>import("@esri/calcite-components/dist/components/calcite-label")})}destroy(){this._slider.destroy(),this._tickFormat=null}get _dateFormat(){return this._getIntlOptions("short-date")}get _timeFormat(){return this._getIntlOptions("long-time")}get actions(){return this.viewModel.actions}set actions(t){this.viewModel.actions=t}get effectiveStops(){return this.viewModel.effectiveStops}get fullTimeExtent(){return this.viewModel.fullTimeExtent}set fullTimeExtent(t){this.viewModel.fullTimeExtent=t}get icon(){return"clock"}set icon(t){this._overrideIfSome("icon",t)}get interactive(){return!(this.disabled||"disabled"===this.viewModel.state||this.timeZone===c)}get label(){return this.messages?.widgetLabel??""}set label(t){this._overrideIfSome("label",t)}set layout(t){this._set("layout",this._allLayouts.includes(t)?t:"auto")}get loop(){return this.viewModel.loop}set loop(t){this.viewModel.loop=t}get mode(){return this.viewModel.mode}set mode(t){this.viewModel.mode=t}get playRate(){return this.viewModel.playRate}set playRate(t){this.viewModel.playRate=t}get stops(){return this.viewModel.stops}set stops(t){this.viewModel.stops=t}get tickFormats(){const{timeZone:t}=this;return S.map(({minor:e,major:i,format:a})=>({minor:new p(e),major:new p(i),format:{...a,timeZone:t}}))}get timeExtent(){return this.viewModel.timeExtent}set timeExtent(t){this.viewModel.timeExtent=t}get timeZone(){return this.viewModel.view?.timeZone??d}set timeZone(t){this._overrideIfSome("timeZone",t)}get view(){return this.viewModel.view}set view(t){this.viewModel.view=t}next(){return this.viewModel.next()}play(){return this.viewModel.play()}previous(){return this.viewModel.previous()}stop(){return this.viewModel.stop()}render(){const{_slider:t,actions:i,domNode:a,effectiveStops:s,fullTimeExtent:r,interactive:o,messages:n,mode:l,tickConfigs:u,timeExtent:c,timeVisible:d,viewModel:{state:p,timeExtentValues:h}}=this;if(r){const{start:e,end:i}=r;if(e&&i){const a=e.getTime(),s=i.getTime(),r=t.min!==a||t.max!==s;if(r&&(t.min=a,t.max=s),u)t.tickConfigs!==u&&(t.tickConfigs=u);else{const e=(s-a)/(t.trackElement?.offsetWidth||400),i=this.tickFormats.find(({minor:t})=>t.toMilliseconds()>T*e)??this.tickFormats.at(-1),o=i&&this._tickFormat!==i;if(o&&(this._tickFormat=i),r||o){const e={mode:"position",values:this._getTickPositions(i.minor),labelsVisible:!1,tickCreatedFunction:(t,e)=>{e?.classList.add(k.sliderMinorTick)}},a={mode:"position",values:this._getTickPositions(i.major),labelsVisible:!0,tickCreatedFunction:(t,e)=>{e?.classList.add(k.sliderMajorTick)},labelFormatFunction:t=>m(t,i.format)};t.tickConfigs=[e,a]}}}}const v=!this.fullTimeExtent?.start||!this.fullTimeExtent.end||!this.timeExtent||this.timeExtent.isAllTime||this.timeExtent.isEmpty||this.timeExtent.start&&(this.timeExtent.start<this.fullTimeExtent.start||this.timeExtent.start>this.fullTimeExtent.end)||this.timeExtent.end&&(this.timeExtent.end>this.fullTimeExtent.end||this.timeExtent.end<this.fullTimeExtent.start);if(v)switch(this._ignoreNextSliderUpdate=!0,l){case"time-window":t.values=[t.min,t.max];break;case"instant":case"cumulative-from-end":t.values=[t.min];break;case"cumulative-from-start":t.values=[t.max]}else h?e(t.values,h)||(t.values=h):t.values=null;t.disabled=!o;const f=v||!o||!s?.length,b="auto"===this.layout?a.clientWidth<_?"compact":"wide":this.layout,x=w("calcite-button",{appearance:"transparent",bind:this,class:k.play,disabled:f,iconStart:"playing"===p?"pause":"play",kind:"neutral",label:"playing"===p?n.control.stop:n.control.play,onclick:this._playOrStopClick,scale:"wide"===b?"l":"m",width:"full"}),j=this.labelFormatFunction?w("div",{afterCreate:this._createLabel,afterUpdate:this._createLabel,bind:this,class:k.timeExtentStartDate,"data-date":c?[c.start,c.end]:null,"data-layout":b,"data-type":"extent",key:k.timeExtentStartDate}):!c||c.isAllTime?M(n.noTimeExtent):c.isEmpty?M(n.emptyTimeExtent):[c?.start&&w("div",{class:k.timeExtentStartGroup,key:k.timeExtentStartGroup},w("calcite-label",{alignment:"center",class:k.timeExtentStartDate,key:k.timeExtentStartDate,scale:"s"},this._formatDate(c.start)),d?w("calcite-label",{alignment:"center",class:k.timeExtentStartTime,key:k.timeExtentStartTime,scale:"s"},this._formatTime(c.start)):null),c.start&&c.end&&c.start.getTime()!==c.end.getTime()&&w("div",{class:k.timeExtentSeparator,key:k.timeExtentSeparator}),c?.end&&(!c.start||c.start.getTime()!==c.end.getTime())&&w("div",{class:k.timeExtentEndGroup,key:k.timeExtentEndGroup},w("calcite-label",{alignment:"center",class:k.timeExtentEndDate,key:k.timeExtentEndDate,scale:"s"},this._formatDate(c.end)),d?w("calcite-label",{alignment:"center",class:k.timeExtentEndTime,key:k.timeExtentEndTime,scale:"s"},this._formatTime(c.end)):null)],S=w("div",{class:k.timeExtent},j),F=this.labelFormatFunction?w("div",{afterCreate:this._createLabel,afterUpdate:this._createLabel,bind:this,class:k.minDate,"data-date":r?.start,"data-layout":b,"data-type":"min",key:k.minDate}):r?.start&&[w("calcite-label",{class:k.minDate,key:k.minDate,scale:"s"},this._formatDate(r.start)),d&&w("calcite-label",{class:k.minTime,key:k.minTime,scale:"s"},this._formatTime(r.start))],D=w("div",{class:k.min},F),C=w("div",{class:k.slider},t.render()),L=this.labelFormatFunction?w("div",{afterCreate:this._createLabel,afterUpdate:this._createLabel,bind:this,class:k.maxDate,"data-date":r?.end,"data-layout":b,"data-type":"max",key:k.maxDate}):r?.end&&[w("calcite-label",{class:k.maxDate,key:k.maxDate,scale:"s"},this._formatDate(r.end)),d&&w("calcite-label",{class:k.maxTime,key:k.maxTime,scale:"s"},this._formatTime(r.end))],U=w("div",{class:k.max},L),Z=w("calcite-button",{appearance:"transparent",bind:this,class:k.previous,disabled:f||"playing"===p,iconStart:"reverse",kind:"neutral",label:n.pagination.previous,onclick:this._previousClick,scale:"wide"===b?"l":"m",width:"full"}),R=w("calcite-button",{appearance:"transparent",bind:this,class:k.next,disabled:f||"playing"===p,iconStart:"forward",kind:"neutral",label:n.pagination.next,onclick:this._nextClick,scale:"wide"===b?"l":"m",width:"full"}),I=i?.length>0,O=I&&w("calcite-action-menu",{class:k.actions,label:n.options},i.toArray().map(t=>w("calcite-action",{bind:this,icon:t.icon,id:t.id,onclick:()=>this.viewModel.triggerAction(t),text:t.title,textEnabled:!0})));return w("div",{afterCreate:t=>{this.addHandles(g(t,()=>this.scheduleRender()))},"aria-label":n.widgetLabel,class:this.classes(k.timeSlider,y.widget,`${k.timeSliderMode}${l}`,`${k.timeSliderLayout}${b}`,!o&&k.timeSliderDisabled,v&&k.timeSliderOutOfBounds,I&&k.hasActions,E())},"wide"===b&&w("div",{class:k.timeSliderRow},w("div",{class:k.playbackControls},[x,S,D,C,U,Z,R]),O),"compact"===b&&[w("div",{class:k.timeSliderRow,key:"time-slider-row-1"},[S,O]),w("div",{class:k.timeSliderRow,key:"time-slider-row-2"},[C]),w("div",{class:k.timeSliderRow,key:"time-slider-row-3"},[D,Z,x,R,U])])}updateWebDocument(t){this.viewModel?.updateWebDocument(t)}_createLabel(t){if(!this.labelFormatFunction)return;const e=t.getAttribute("data-type"),i=t.getAttribute("data-layout"),a=t["data-date"];this.labelFormatFunction(a,e,t,i)}_formatDate(t){return m(t,this._dateFormat)}_formatTime(t){return m(t,this._timeFormat)}_getIntlOptions(t){const{timeZone:e}=this;return{...u(t),timeZone:e}}_getTickPositions(t){const{fullTimeExtent:e}=this;if(!e?.start||!e.end)return[];const{start:i,end:a}=e,s=[],{value:n,unit:l}=t;let m=r(i,l,this.timeZone);for(;m.getTime()<=a.getTime();)m.getTime()>=i.getTime()&&s.push(m.getTime()),m=o(m,n,l,this.timeZone);return s}_updateSliderSteps(){this._slider.steps=this.effectiveStops&&this.effectiveStops.length>0?this.effectiveStops.map(t=>t.getTime()):null}_playOrStopClick(){switch(this.viewModel.state){case"ready":this.viewModel.play();break;case"playing":this.viewModel.stop();break;case"disabled":break;default:i(this.viewModel.state)}}_previousClick(){this.viewModel.previous()}_nextClick(){this.viewModel.next()}};t([n()],F.prototype,"_dateFormat",null),t([n()],F.prototype,"_timeFormat",null),t([n()],F.prototype,"actions",null),t([n()],F.prototype,"disabled",void 0),t([n()],F.prototype,"effectiveStops",null),t([n()],F.prototype,"fullTimeExtent",null),t([n()],F.prototype,"icon",null),t([n({readOnly:!0})],F.prototype,"interactive",null),t([n()],F.prototype,"label",null),t([n()],F.prototype,"labelFormatFunction",void 0),t([n({value:"auto"})],F.prototype,"layout",null),t([n()],F.prototype,"loop",null),t([n(),b("esri/widgets/TimeSlider/t9n/TimeSlider")],F.prototype,"messages",void 0),t([n()],F.prototype,"mode",null),t([n()],F.prototype,"playRate",null),t([n()],F.prototype,"stops",null),t([n()],F.prototype,"tickConfigs",void 0),t([n()],F.prototype,"tickFormats",null),t([n()],F.prototype,"timeExtent",null),t([n({nonNullable:!0})],F.prototype,"timeVisible",void 0),t([n()],F.prototype,"timeZone",null),t([n()],F.prototype,"view",null),t([n({type:j}),x("trigger-action")],F.prototype,"viewModel",void 0),F=t([l("esri.widgets.TimeSlider")],F);const D=F;export{D as default};
|
|
5
|
+
import{__decorate as t}from"tslib";import{equals as e}from"../core/arrayUtils.js";import{neverReached as i}from"../core/compilerUtils.js";import{watch as a,initial as s}from"../core/reactiveUtils.js";import{truncateDate as r,offsetDate as o}from"../core/timeUtils.js";import{property as n}from"../core/accessorSupport/decorators/property.js";import"../core/Logger.js";import{subclass as l}from"../core/accessorSupport/decorators/subclass.js";import{formatDate as m,convertDateFormatToIntlOptions as u}from"../intl/date.js";import{unknown as c,system as d}from"../time/constants.js";import p from"../time/TimeInterval.js";import h from"./Slider.js";import v from"./Widget.js";import{loadCalciteComponents as f}from"./support/componentsUtils.js";import{globalCss as y}from"./support/globalCss.js";import{onResize as g}from"./support/widgetUtils.js";import{messageBundle as b}from"./support/decorators/messageBundle.js";import{vmEvent as x}from"./support/decorators/vmEvent.js";import{tsx as w}from"./support/jsxFactory.js";import{getCalciteModeClass as E}from"../support/modeUtils.js";import{css as k}from"./TimeSlider/css.js";import j from"./TimeSlider/TimeSliderViewModel.js";const T=3,_=858,S=[{minor:{value:100,unit:"milliseconds"},major:{value:1,unit:"seconds"},format:{second:"numeric"}},{minor:{value:500,unit:"milliseconds"},major:{value:5,unit:"seconds"},format:{second:"numeric"}},{minor:{value:1,unit:"seconds"},major:{value:20,unit:"seconds"},format:{minute:"numeric",second:"numeric"}},{minor:{value:2,unit:"seconds"},major:{value:30,unit:"seconds"},format:{minute:"numeric",second:"numeric"}},{minor:{value:10,unit:"seconds"},major:{value:1,unit:"minutes"},format:{minute:"numeric"}},{minor:{value:15,unit:"seconds"},major:{value:5,unit:"minutes"},format:{hour:"numeric",minute:"numeric"}},{minor:{value:1,unit:"minutes"},major:{value:20,unit:"minutes"},format:{hour:"numeric",minute:"numeric"}},{minor:{value:5,unit:"minutes"},major:{value:2,unit:"hours"},format:{hour:"numeric",minute:"numeric"}},{minor:{value:15,unit:"minutes"},major:{value:6,unit:"hours"},format:{hour:"numeric",minute:"numeric"}},{minor:{value:1,unit:"hours"},major:{value:1,unit:"days"},format:{day:"numeric",month:"short"}},{minor:{value:6,unit:"hours"},major:{value:1,unit:"weeks"},format:{day:"numeric",month:"short"}},{minor:{value:1,unit:"days"},major:{value:1,unit:"months"},format:{month:"long"}},{minor:{value:2,unit:"days"},major:{value:1,unit:"months"},format:{month:"short"}},{minor:{value:3,unit:"days"},major:{value:1,unit:"months"},format:{month:"short"}},{minor:{value:4,unit:"days"},major:{value:3,unit:"months"},format:{month:"short",year:"numeric"}},{minor:{value:1,unit:"weeks"},major:{value:1,unit:"years"},format:{year:"numeric"}},{minor:{value:1,unit:"months"},major:{value:1,unit:"years"},format:{year:"numeric"}},{minor:{value:2,unit:"months"},major:{value:2,unit:"years"},format:{year:"numeric"}},{minor:{value:1,unit:"years"},major:{value:1,unit:"decades"},format:{year:"numeric"}},{minor:{value:2,unit:"years"},major:{value:5,unit:"decades"},format:{year:"numeric"}},{minor:{value:5,unit:"decades"},major:{value:10,unit:"centuries"},format:{era:"short",year:"numeric"}},{minor:{value:1,unit:"centuries"},major:{value:10,unit:"centuries"},format:{era:"short",year:"numeric"}},{minor:{value:2,unit:"centuries"},major:{value:20,unit:"centuries"},format:{era:"short",year:"numeric"}},{minor:{value:5,unit:"centuries"},major:{value:50,unit:"centuries"},format:{era:"short",year:"numeric"}},{minor:{value:10,unit:"centuries"},major:{value:100,unit:"centuries"},format:{era:"short",year:"numeric"}},{minor:{value:20,unit:"centuries"},major:{value:200,unit:"centuries"},format:{era:"short",year:"numeric"}},{minor:{value:50,unit:"centuries"},major:{value:500,unit:"centuries"},format:{era:"short",year:"numeric"}},{minor:{value:100,unit:"centuries"},major:{value:1e3,unit:"centuries"},format:{era:"short",year:"numeric"}},{minor:{value:200,unit:"centuries"},major:{value:1e3,unit:"centuries"},format:{era:"short",year:"numeric"}},{minor:{value:500,unit:"centuries"},major:{value:5e3,unit:"centuries"},format:{era:"short",year:"numeric"}},{minor:{value:1e3,unit:"centuries"},major:{value:1e4,unit:"centuries"},format:{era:"short",year:"numeric"}}];function M(t){return w("div",{class:k.warning},w("calcite-icon",{class:k.warningIcon,icon:"exclamation-mark-triangle"}),w("calcite-label",{alignment:"center",class:k.warningLabel,scale:"s"},t))}let F=class extends v{constructor(t,e){super(t,e),this._allLayouts=["auto","compact","wide"],this._ignoreNextSliderUpdate=!1,this._slider=new h({precision:0,visibleElements:{rangeLabels:!1},rangeLabelInputsEnabled:!1,thumbsConstrained:!1}),this._tickFormat=null,this.disabled=!1,this.labelFormatFunction=null,this.messages=null,this.tickConfigs=null,this.timeVisible=!1,this.viewModel=new j}initialize(){this.addHandles([a(()=>this._slider.values,t=>{if(this._ignoreNextSliderUpdate)return void(this._ignoreNextSliderUpdate=!1);const e=this.viewModel.valuesToTimeExtent(t);this.timeExtent?e?this.timeExtent.equals(e)||(this.timeExtent=e):this.timeExtent=null:e&&(this.timeExtent=e)}),a(()=>this.effectiveStops,()=>this._updateSliderSteps(),s)])}loadDependencies(){return f({action:()=>import("@esri/calcite-components/dist/components/calcite-action"),"action-menu":()=>import("@esri/calcite-components/dist/components/calcite-action-menu"),button:()=>import("@esri/calcite-components/dist/components/calcite-button"),icon:()=>import("@esri/calcite-components/dist/components/calcite-icon"),label:()=>import("@esri/calcite-components/dist/components/calcite-label")})}destroy(){this._slider.destroy(),this._tickFormat=null}get _dateFormat(){return this._getIntlOptions("short-date")}get _timeFormat(){return this._getIntlOptions("long-time")}get actions(){return this.viewModel.actions}set actions(t){this.viewModel.actions=t}get effectiveStops(){return this.viewModel.effectiveStops}get fullTimeExtent(){return this.viewModel.fullTimeExtent}set fullTimeExtent(t){this.viewModel.fullTimeExtent=t}get icon(){return"clock"}set icon(t){this._overrideIfSome("icon",t)}get interactive(){return!(this.disabled||"disabled"===this.viewModel.state||this.timeZone===c)}get label(){return this.messages?.widgetLabel??""}set label(t){this._overrideIfSome("label",t)}set layout(t){this._set("layout",this._allLayouts.includes(t)?t:"auto")}get loop(){return this.viewModel.loop}set loop(t){this.viewModel.loop=t}get mode(){return this.viewModel.mode}set mode(t){this.viewModel.mode=t}get playRate(){return this.viewModel.playRate}set playRate(t){this.viewModel.playRate=t}get stops(){return this.viewModel.stops}set stops(t){this.viewModel.stops=t}get tickFormats(){const{timeZone:t}=this;return S.map(({minor:e,major:i,format:a})=>({minor:new p(e),major:new p(i),format:{...a,timeZone:t}}))}get timeExtent(){return this.viewModel.timeExtent}set timeExtent(t){this.viewModel.timeExtent=t}get timeZone(){return this.viewModel.view?.timeZone??d}set timeZone(t){this._overrideIfSome("timeZone",t)}get view(){return this.viewModel.view}set view(t){this.viewModel.view=t}next(){return this.viewModel.next()}play(){return this.viewModel.play()}previous(){return this.viewModel.previous()}stop(){return this.viewModel.stop()}render(){const{_slider:t,actions:i,domNode:a,effectiveStops:s,fullTimeExtent:r,interactive:o,messages:n,mode:l,tickConfigs:u,timeExtent:c,timeVisible:d,viewModel:{state:p,timeExtentValues:h}}=this;if(r){const{start:e,end:i}=r;if(e&&i){const a=e.getTime(),s=i.getTime(),r=t.min!==a||t.max!==s;if(r&&(t.min=a,t.max=s),u)t.tickConfigs!==u&&(t.tickConfigs=u);else{const e=(s-a)/(t.trackElement?.offsetWidth||400),i=this.tickFormats.find(({minor:t})=>t.toMilliseconds()>T*e)??this.tickFormats.at(-1),o=i&&this._tickFormat!==i;if(o&&(this._tickFormat=i),r||o){const e={mode:"position",values:this._getTickPositions(i.minor),labelsVisible:!1,tickCreatedFunction:(t,e)=>{e?.classList.add(k.sliderMinorTick)}},a={mode:"position",values:this._getTickPositions(i.major),labelsVisible:!0,tickCreatedFunction:(t,e)=>{e?.classList.add(k.sliderMajorTick)},labelFormatFunction:t=>m(t,i.format)};t.tickConfigs=[e,a]}}}}const v=!this.fullTimeExtent?.start||!this.fullTimeExtent.end||!this.timeExtent||this.timeExtent.isAllTime||this.timeExtent.isEmpty||this.timeExtent.start&&(this.timeExtent.start<this.fullTimeExtent.start||this.timeExtent.start>this.fullTimeExtent.end)||this.timeExtent.end&&(this.timeExtent.end>this.fullTimeExtent.end||this.timeExtent.end<this.fullTimeExtent.start);if(v)switch(this._ignoreNextSliderUpdate=!0,l){case"time-window":t.values=[t.min,t.max];break;case"instant":case"cumulative-from-end":t.values=[t.min];break;case"cumulative-from-start":t.values=[t.max]}else h?e(t.values,h)||(t.values=h):t.values=null;t.disabled=!o;const f=v||!o||!s?.length,b="auto"===this.layout?a.clientWidth<_?"compact":"wide":this.layout,x=w("calcite-button",{appearance:"transparent",bind:this,class:k.play,disabled:f,iconStart:"playing"===p?"pause":"play",kind:"neutral",label:"playing"===p?n.control.stop:n.control.play,onclick:this._playOrStopClick,scale:"wide"===b?"l":"m",width:"full"}),j=this.labelFormatFunction?w("div",{afterCreate:this._createLabel,afterUpdate:this._createLabel,bind:this,class:k.timeExtentStartDate,"data-date":c?[c.start,c.end]:null,"data-layout":b,"data-type":"extent",key:k.timeExtentStartDate}):!c||c.isAllTime?M(n.noTimeExtent):c.isEmpty?M(n.emptyTimeExtent):[c?.start&&w("div",{class:k.timeExtentStartGroup,key:k.timeExtentStartGroup},w("calcite-label",{alignment:"center",class:k.timeExtentStartDate,key:k.timeExtentStartDate,scale:"s"},this._formatDate(c.start)),d?w("calcite-label",{alignment:"center",class:k.timeExtentStartTime,key:k.timeExtentStartTime,scale:"s"},this._formatTime(c.start)):null),c.start&&c.end&&c.start.getTime()!==c.end.getTime()&&w("div",{class:k.timeExtentSeparator,key:k.timeExtentSeparator}),c?.end&&(!c.start||c.start.getTime()!==c.end.getTime())&&w("div",{class:k.timeExtentEndGroup,key:k.timeExtentEndGroup},w("calcite-label",{alignment:"center",class:k.timeExtentEndDate,key:k.timeExtentEndDate,scale:"s"},this._formatDate(c.end)),d?w("calcite-label",{alignment:"center",class:k.timeExtentEndTime,key:k.timeExtentEndTime,scale:"s"},this._formatTime(c.end)):null)],S=w("div",{class:k.timeExtent},j),F=this.labelFormatFunction?w("div",{afterCreate:this._createLabel,afterUpdate:this._createLabel,bind:this,class:k.minDate,"data-date":r?.start,"data-layout":b,"data-type":"min",key:k.minDate}):r?.start&&[w("calcite-label",{class:k.minDate,key:k.minDate,scale:"s"},this._formatDate(r.start)),d&&w("calcite-label",{class:k.minTime,key:k.minTime,scale:"s"},this._formatTime(r.start))],D=w("div",{class:k.min},F),C=w("div",{class:k.slider},t.render()),L=this.labelFormatFunction?w("div",{afterCreate:this._createLabel,afterUpdate:this._createLabel,bind:this,class:k.maxDate,"data-date":r?.end,"data-layout":b,"data-type":"max",key:k.maxDate}):r?.end&&[w("calcite-label",{class:k.maxDate,key:k.maxDate,scale:"s"},this._formatDate(r.end)),d&&w("calcite-label",{class:k.maxTime,key:k.maxTime,scale:"s"},this._formatTime(r.end))],U=w("div",{class:k.max},L),Z=w("calcite-button",{appearance:"transparent",bind:this,class:k.previous,disabled:f||"playing"===p,iconStart:"reverse",kind:"neutral",label:n.pagination.previous,onclick:this._previousClick,scale:"wide"===b?"l":"m",width:"full"}),R=w("calcite-button",{appearance:"transparent",bind:this,class:k.next,disabled:f||"playing"===p,iconStart:"forward",kind:"neutral",label:n.pagination.next,onclick:this._nextClick,scale:"wide"===b?"l":"m",width:"full"}),I=i?.length>0,O=I&&w("calcite-action-menu",{class:k.actions,label:n.options},i.toArray().map(t=>w("calcite-action",{bind:this,icon:t.icon,id:t.id,onclick:()=>this.viewModel.triggerAction(t),text:t.title,textEnabled:!0})));return w("div",{afterCreate:t=>{this.addHandles(g(t,()=>this.scheduleRender()))},"aria-label":n.widgetLabel,class:this.classes(k.timeSlider,y.widget,`${k.timeSliderMode}${l}`,`${k.timeSliderLayout}${b}`,!o&&k.timeSliderDisabled,v&&k.timeSliderOutOfBounds,I&&k.hasActions,E())},"wide"===b&&w("div",{class:k.timeSliderRow},w("div",{class:k.playbackControls},[x,S,D,C,U,Z,R]),O),"compact"===b&&[w("div",{class:k.timeSliderRow,key:"time-slider-row-1"},[S,O]),w("div",{class:k.timeSliderRow,key:"time-slider-row-2"},[C]),w("div",{class:k.timeSliderRow,key:"time-slider-row-3"},[D,Z,x,R,U])])}updateWebDocument(t){this.viewModel?.updateWebDocument(t)}_createLabel(t){if(!this.labelFormatFunction)return;const e=t.getAttribute("data-type"),i=t.getAttribute("data-layout"),a=t["data-date"];this.labelFormatFunction(a,e,t,i)}_formatDate(t){return m(t,this._dateFormat)}_formatTime(t){return m(t,this._timeFormat)}_getIntlOptions(t){const{timeZone:e}=this;return{...u(t),timeZone:e}}_getTickPositions(t){const{fullTimeExtent:e}=this;if(!e?.start||!e.end)return[];const{start:i,end:a}=e,s=[],{value:n,unit:l}=t;let m=r(i,l,this.timeZone);for(;m.getTime()<=a.getTime();)m.getTime()>=i.getTime()&&s.push(m.getTime()),m=o(m,n,l,this.timeZone);return s}_updateSliderSteps(){this._slider.steps=this.effectiveStops&&this.effectiveStops.length>0?this.effectiveStops.map(t=>t.getTime()):null}_playOrStopClick(){switch(this.viewModel.state){case"ready":this.viewModel.play();break;case"playing":this.viewModel.stop();break;case"disabled":break;default:i(this.viewModel.state)}}_previousClick(){this.viewModel.previous()}_nextClick(){this.viewModel.next()}};t([n()],F.prototype,"_dateFormat",null),t([n()],F.prototype,"_timeFormat",null),t([n()],F.prototype,"actions",null),t([n()],F.prototype,"disabled",void 0),t([n()],F.prototype,"effectiveStops",null),t([n()],F.prototype,"fullTimeExtent",null),t([n()],F.prototype,"icon",null),t([n({readOnly:!0})],F.prototype,"interactive",null),t([n()],F.prototype,"label",null),t([n()],F.prototype,"labelFormatFunction",void 0),t([n({value:"auto"})],F.prototype,"layout",null),t([n()],F.prototype,"loop",null),t([n(),b("esri/widgets/TimeSlider/t9n/TimeSlider")],F.prototype,"messages",void 0),t([n()],F.prototype,"mode",null),t([n()],F.prototype,"playRate",null),t([n()],F.prototype,"stops",null),t([n()],F.prototype,"tickConfigs",void 0),t([n()],F.prototype,"tickFormats",null),t([n()],F.prototype,"timeExtent",null),t([n({nonNullable:!0})],F.prototype,"timeVisible",void 0),t([n()],F.prototype,"timeZone",null),t([n()],F.prototype,"view",null),t([n({type:j}),x("trigger-action")],F.prototype,"viewModel",void 0),F=t([l("esri.widgets.TimeSlider")],F);const D=F;export{D as default};
|
package/TimeExtent.d.ts
DELETED
package/TimeExtent.js
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
|
-
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
|
-
*/
|
|
5
|
-
import{deprecatedModule as e}from"./core/deprecate.js";import r from"./core/Logger.js";import{T as t}from"./chunks/TimeExtent.js";export{a as default}from"./chunks/TimeExtent.js";e(r.getLogger("esri.TimeExtent"),"esri.TimeExtent",{replacement:"esri.time.TimeExtent",version:"4.31",warnOnce:!0});
|
package/TimeInterval.d.ts
DELETED
package/TimeInterval.js
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
|
-
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
|
-
*/
|
|
5
|
-
import{deprecatedModule as e}from"./core/deprecate.js";import r from"./core/Logger.js";import{T as m}from"./chunks/TimeInterval.js";export{a as default}from"./chunks/TimeInterval.js";e(r.getLogger("esri.TimeInterval"),"esri.TimeInterval",{replacement:"esri.time.TimeInterval",version:"4.31",warnOnce:!0});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[6730,8256],{4146:(t,e,r)=>{r.d(e,{A:()=>M});var i=r(31635),n=r(78888),s=r(49186),o=r(65529),a=r(4902),l=r(92474),u=r(53966),c=r(74887),h=r(84952),p=r(10107),d=(r(44208),r(87811),r(40608)),f=r(5443),g=r(16930),y=r(92602),m=r(64272);let v=0,M=class extends((0,o.Zt)((0,a.sA)(l.x_))){constructor(){super(...arguments),this.attributionDataUrl=null,this.fullExtent=new f.A(-180,-90,180,90,g.A.WGS84),this.id=Date.now().toString(16)+"-layer-"+v++,this.legendEnabled=!0,this.listMode="show",this.opacity=1,this.parent=null,this.persistenceEnabled=!1,this.popupEnabled=!0,this.attributionVisible=!0,this.spatialReference=g.A.WGS84,this.title=null,this.type=null,this.url=null,this.visibilityTimeExtent=null,this.visible=!0}static async fromArcGISServerUrl(t){const e="string"==typeof t?{url:t}:t;return(await r.e(7982).then(r.bind(r,27982))).fromUrl(e)}static fromPortalItem(t){return async function(t){const e="portalItem"in t?t:{portalItem:t},{fromItem:i}=await r.e(5613).then(r.bind(r,45613));try{return await i(e)}catch(t){const r=e?.portalItem,i=r?.id||"unset",n=r?.portal?.url||y.A.portalUrl;throw u.A.getLogger("esri.layers.support.fromPortalItem").error("#fromPortalItem()","Failed to create layer from portal item (portal: '"+n+"', id: '"+i+"')",t),t}}(t)}initialize(){this.when().catch(t=>{(0,c.zf)(t)||u.A.getLogger(this).error("#load()",`Failed to load layer (title: '${this.title??"no title"}', id: '${this.id??"no id"}')`,{error:t})})}destroy(){const t=this.parent;if(t){const e=this;"layers"in t&&t.layers.includes(e)?t.layers.remove(e):"tables"in t&&t.tables.includes(e)?t.tables.remove(e):"baseLayers"in t&&t.baseLayers.includes(e)?t.baseLayers.remove(e):"groundLayers"in t&&t.groundLayers.includes(e)?t.groundLayers.remove(e):"referenceLayers"in t&&t.referenceLayers.includes(e)&&t.referenceLayers.remove(e),this._set("parent",null)}}get effectiveVisible(){let t=this.visible;const e=this.parent;return t&&e&&"effectiveVisible"in e&&(t&&=e.effectiveVisible),t}get hasAttributionData(){return null!=this.attributionDataUrl}get loaded(){return super.loaded}get parsedUrl(){return(0,h.An)(this.url)}createLayerView(t,e){return Promise.reject(new s.A("layer:create-layer-view","Layer does not support creating a layer view"))}async fetchAttributionData(){const t=this.attributionDataUrl;if(this.hasAttributionData&&t)return(await(0,n.A)(t,{query:{f:"json"},responseType:"json"})).data;throw new s.A("layer:no-attribution-data","Layer does not have attribution data")}};(0,i.Cg)([(0,p.MZ)({type:String})],M.prototype,"attributionDataUrl",void 0),(0,i.Cg)([(0,p.MZ)({readOnly:!0})],M.prototype,"effectiveVisible",null),(0,i.Cg)([(0,p.MZ)({type:f.A})],M.prototype,"fullExtent",void 0),(0,i.Cg)([(0,p.MZ)({readOnly:!0})],M.prototype,"hasAttributionData",null),(0,i.Cg)([(0,p.MZ)({type:String,clonable:!1})],M.prototype,"id",void 0),(0,i.Cg)([(0,p.MZ)({type:Boolean,nonNullable:!0})],M.prototype,"legendEnabled",void 0),(0,i.Cg)([(0,p.MZ)({type:["show","hide","hide-children"]})],M.prototype,"listMode",void 0),(0,i.Cg)([(0,p.MZ)({type:Number,range:{min:0,max:1},nonNullable:!0})],M.prototype,"opacity",void 0),(0,i.Cg)([(0,p.MZ)({clonable:!1})],M.prototype,"parent",void 0),(0,i.Cg)([(0,p.MZ)({readOnly:!0})],M.prototype,"parsedUrl",null),(0,i.Cg)([(0,p.MZ)({type:Boolean,readOnly:!0})],M.prototype,"persistenceEnabled",void 0),(0,i.Cg)([(0,p.MZ)({type:Boolean})],M.prototype,"popupEnabled",void 0),(0,i.Cg)([(0,p.MZ)({type:Boolean})],M.prototype,"attributionVisible",void 0),(0,i.Cg)([(0,p.MZ)({type:g.A})],M.prototype,"spatialReference",void 0),(0,i.Cg)([(0,p.MZ)({type:String})],M.prototype,"title",void 0),(0,i.Cg)([(0,p.MZ)({readOnly:!0,json:{read:!1}})],M.prototype,"type",void 0),(0,i.Cg)([(0,p.MZ)()],M.prototype,"url",void 0),(0,i.Cg)([(0,p.MZ)({type:m.T})],M.prototype,"visibilityTimeExtent",void 0),(0,i.Cg)([(0,p.MZ)({type:Boolean,nonNullable:!0})],M.prototype,"visible",void 0),M=(0,i.Cg)([(0,d.$)("esri.layers.Layer")],M)},4902:(t,e,r)=>{r.d(e,{PH:()=>a,sA:()=>o});var i=r(31635),n=r(40608);let s=0;const o=t=>{const e=t;let r=class extends e{constructor(...t){super(...t),Object.defineProperty(this,"uid",{writable:!1,configurable:!1,value:Date.now().toString(16)+"-object-"+s++})}};return r=(0,i.Cg)([(0,n.$)("esri.core.Identifiable")],r),r},a=t=>{const e=t;let r=class extends e{constructor(...t){super(...t),Object.defineProperty(this,"uid",{writable:!1,configurable:!1,value:s++})}};return r=(0,i.Cg)([(0,n.$)("esri.core.Identifiable.NumericIdentifiable")],r),r};o(class{})},8303:(t,e,r)=>{r.d(e,{A:()=>A});var i=r(31635),n=r(92602),s=r(70333),o=r(78888),a=r(60999),l=r(49186),u=r(53966),c=r(97768),h=r(74887),p=r(84952),d=r(10107),f=(r(44208),r(87811),r(36005)),g=r(40608),y=r(43937),m=r(77548),v=r(20655),M=r(80812),b=r(41318),w=r(10407);const A=t=>{const e=t;let A=class extends e{constructor(){super(...arguments),this.resourceReferences={portalItem:null,paths:[]},this.userHasEditingPrivileges=!0,this.userHasFullEditingPrivileges=!1,this.userHasUpdateItemPrivileges=!1}destroy(){this.portalItem=(0,c.pR)(this.portalItem),this.resourceReferences.portalItem=null,this.resourceReferences.paths.length=0}set portalItem(t){t!==this._get("portalItem")&&(this.removeOrigin("portal-item"),this._set("portalItem",t))}readPortalItem(t,e,r){if(e.itemId)return new M.default({id:e.itemId,portal:r?.portal})}writePortalItem(t,e){t?.id&&(e.itemId=t.id)}async loadFromPortal(t,e){if(this.portalItem?.id)try{const{load:i}=await r.e(1204).then(r.bind(r,41204));return(0,h.Te)(e),await i({instance:this,supportedTypes:t.supportedTypes,validateItem:t.validateItem,supportsData:t.supportsData,layerModuleTypeMap:t.layerModuleTypeMap,populateGroupLayer:t.populateGroupLayer},e)}catch(t){throw(0,h.zf)(t)||u.A.getLogger(this).warn(`Failed to load layer (${this.title}, ${this.id}) portal item (${this.portalItem.id})\n ${t}`),t}}async finishLoadEditablePortalLayer(t){this._set("userHasEditingPrivileges",await this._fetchUserHasEditingPrivileges(t).catch(t=>((0,h.QP)(t),!0)))}async setUserPrivileges(t,e){if(!n.A.userPrivilegesApplied)return this.finishLoadEditablePortalLayer(e);if(this.url)try{const{features:{edit:r,fullEdit:i},content:{updateItem:n}}=await this._fetchUserPrivileges(t,e);this._set("userHasEditingPrivileges",r),this._set("userHasFullEditingPrivileges",i),this._set("userHasUpdateItemPrivileges",n)}catch(t){(0,h.QP)(t)}}async _fetchUserPrivileges(t,e){let r=this.portalItem;if(!t||!r||!r.loaded||r.sourceUrl)return this._fetchFallbackUserPrivileges(e);const i=!s.id?.findCredential(this.url),n=t===r.id;if(n&&r.portal.user)return this._getUserPrivileges(r,i);let o,a;if(n)o=r.portal.url;else try{o=await(0,m.wI)(this.url,e)}catch(t){(0,h.QP)(t)}if(!o||!(0,p.b8)(o,r.portal.url))return this._fetchFallbackUserPrivileges(e);try{const t=null!=e?e.signal:null;a=await(s.id?.getCredential(`${o}/sharing`,{prompt:!1,signal:t}))}catch(t){(0,h.QP)(t)}const l=!0,u=!1,c=!1;if(!a)return{features:{edit:l,fullEdit:u},content:{updateItem:c}};try{if(n?await r.reload():(r=new M.default({id:t,portal:{url:o}}),await r.load(e)),r.portal.user)return this._getUserPrivileges(r,i)}catch(t){(0,h.QP)(t)}return{features:{edit:l,fullEdit:u},content:{updateItem:c}}}_getUserPrivileges(t,e){const r=(0,w.It)(t);return e&&(r.features.edit=!0),r}async _fetchFallbackUserPrivileges(t){let e=!0;try{e=await this._fetchUserHasEditingPrivileges(t)}catch(t){(0,h.QP)(t)}return{features:{edit:e,fullEdit:!1},content:{updateItem:!1}}}async _fetchUserHasEditingPrivileges(t){const e=this.url?s.id?.findCredential(this.url):null;if(!e)return!0;const r=x.credential===e?x.user:await this._fetchEditingUser(t);return x.credential=e,x.user=r,null==r?.privileges||r.privileges.includes("features:user:edit")}async _fetchEditingUser(t){const e=this.portalItem?.portal?.user;if(e)return e;const r=s.id?.findServerInfo(this.url??"");if(!r?.owningSystemUrl)return null;const i=`${r.owningSystemUrl}/sharing/rest`,n=v.A.getDefault();if(n&&n.loaded&&(0,p.S8)(n.restUrl)===(0,p.S8)(i))return n.user;const l=`${i}/community/self`,u=null!=t?t.signal:null,c=await(0,a.Ke)((0,o.A)(l,{authMode:"no-prompt",query:{f:"json"},signal:u}));return c.ok?b.A.fromJSON(c.value.data):null}read(t,e){e&&(e.layer=this),super.read(t,e)}write(t,e){const r=e?.portal,i=this.portalItem?.id&&(this.portalItem.portal||v.A.getDefault());return r&&i&&!(0,p.ut)(i.restUrl,r.restUrl)?(e.messages&&e.messages.push(new l.A("layer:cross-portal",`The layer '${this.title} (${this.id})' cannot be persisted because it refers to an item on a different portal than the one being saved to. To save, set layer.portalItem to null or save to the same portal as the item associated with the layer`,{layer:this})),null):super.write(t,{...e,layer:this})}};return(0,i.Cg)([(0,d.MZ)({type:M.default})],A.prototype,"portalItem",null),(0,i.Cg)([(0,f.w)("web-document","portalItem",["itemId"])],A.prototype,"readPortalItem",null),(0,i.Cg)([(0,y.K)("web-document","portalItem",{itemId:{type:String}})],A.prototype,"writePortalItem",null),(0,i.Cg)([(0,d.MZ)({clonable:!1})],A.prototype,"resourceReferences",void 0),(0,i.Cg)([(0,d.MZ)({type:Boolean,readOnly:!0})],A.prototype,"userHasEditingPrivileges",void 0),(0,i.Cg)([(0,d.MZ)({type:Boolean,readOnly:!0})],A.prototype,"userHasFullEditingPrivileges",void 0),(0,i.Cg)([(0,d.MZ)({type:Boolean,readOnly:!0})],A.prototype,"userHasUpdateItemPrivileges",void 0),A=(0,i.Cg)([(0,g.$)("esri.layers.mixins.PortalLayer")],A),A},x={credential:null,user:null}},36475:(t,e,r)=>{r.r(e),r.d(e,{default:()=>M});var i=r(31635),n=r(78888),s=r(49186),o=r(92071),a=r(74887),l=r(10107),u=(r(44208),r(53966),r(87811),r(40608)),c=r(5443),h=r(4146),p=r(52136),d=r(69208),f=r(16131),g=r(8303),y=r(10873),m=r(88546);let v=class extends((0,f.q)((0,g.A)((0,o.P)((0,d.d)((0,p.p)(h.A)))))){constructor(t){super(t),this.operationalLayerType="GaussianSplatLayer",this.type="gaussian-splat",this.rootTilesetJSON=null,this.fullExtent=new c.A(-180,-90,180,90,this.spatialReference)}async load(t){return this.addResolvingPromise(this._doLoad(t)),this}async _doLoad(t){const e=null!=t?t.signal:null;try{await this.loadFromPortal({supportedTypes:["3DTiles Service"],validateItem:t=>{throw new s.A("portal:invalid-layer-item-type","Invalid layer item, expected '${expectedType}' ",{expectedType:"3DTiles Service"})}},t)}catch(t){(0,a.QP)(t)}if(this.url){const t=(0,n.A)(this.url,{query:{...this.customParameters,token:this.apiKey},responseType:"json",signal:e}).then(t=>{this.rootTilesetJSON=t.data,this.fullExtent=(0,m.u)(this.rootTilesetJSON),this.spatialReference=this.fullExtent.spatialReference},t=>{(0,a.QP)(t)});await t}}set elevationInfo(t){this._set("elevationInfo",t)}};(0,i.Cg)([(0,l.MZ)({json:{read:!1}})],v.prototype,"id",void 0),(0,i.Cg)([(0,l.MZ)({type:["GaussianSplatLayer"],json:{read:!1}})],v.prototype,"operationalLayerType",void 0),(0,i.Cg)([(0,l.MZ)({json:{read:!1}})],v.prototype,"type",void 0),(0,i.Cg)([(0,l.MZ)({type:c.A})],v.prototype,"fullExtent",void 0),(0,i.Cg)([(0,l.MZ)(y.Yj)],v.prototype,"elevationInfo",null),v=(0,i.Cg)([(0,u.$)("esri.layers.GaussianSplatLayer")],v);const M=v},38954:(t,e,r)=>{r.d(e,{A:()=>f,B:()=>d,C:()=>c,D:()=>h,E:()=>L,F:()=>j,H:()=>$,a:()=>Z,b:()=>m,c:()=>o,d:()=>u,e:()=>_,f:()=>l,g:()=>y,h:()=>I,i:()=>a,j:()=>v,k:()=>b,l:()=>s,m:()=>S,n:()=>x,o:()=>O,q:()=>U,r:()=>A,s:()=>M,t:()=>E,u:()=>w,v:()=>C,w:()=>p,x:()=>R,y:()=>q,z:()=>g});var i=r(51850),n=r(34304);function s(t){const e=t[0],r=t[1],i=t[2];return Math.sqrt(e*e+r*r+i*i)}function o(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function a(t,e,r,i){return t[0]=e,t[1]=r,t[2]=i,t}function l(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t}function u(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t}function c(t,e,r){return t[0]=e[0]*r[0],t[1]=e[1]*r[1],t[2]=e[2]*r[2],t}function h(t,e,r){return t[0]=e[0]/r[0],t[1]=e[1]/r[1],t[2]=e[2]/r[2],t}function p(t,e){return t[0]=Math.abs(e[0]),t[1]=Math.abs(e[1]),t[2]=Math.abs(e[2]),t}function d(t,e){return t[0]=Math.sign(e[0]),t[1]=Math.sign(e[1]),t[2]=Math.sign(e[2]),t}function f(t,e,r){return t[0]=Math.min(e[0],r[0]),t[1]=Math.min(e[1],r[1]),t[2]=Math.min(e[2],r[2]),t}function g(t,e,r){return t[0]=Math.max(e[0],r[0]),t[1]=Math.max(e[1],r[1]),t[2]=Math.max(e[2],r[2]),t}function y(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t}function m(t,e,r,i){return t[0]=e[0]+r[0]*i,t[1]=e[1]+r[1]*i,t[2]=e[2]+r[2]*i,t}function v(t,e){const r=e[0]-t[0],i=e[1]-t[1],n=e[2]-t[2];return Math.sqrt(r*r+i*i+n*n)}function M(t,e){const r=e[0]-t[0],i=e[1]-t[1],n=e[2]-t[2];return r*r+i*i+n*n}function b(t){const e=t[0],r=t[1],i=t[2];return e*e+r*r+i*i}function w(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t}function A(t,e){return t[0]=1/e[0],t[1]=1/e[1],t[2]=1/e[2],t}function x(t,e){const r=e[0],i=e[1],n=e[2];let s=r*r+i*i+n*n;return s>0&&(s=1/Math.sqrt(s),t[0]=e[0]*s,t[1]=e[1]*s,t[2]=e[2]*s),t}function _(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function I(t,e,r){const i=e[0],n=e[1],s=e[2],o=r[0],a=r[1],l=r[2];return t[0]=n*l-s*a,t[1]=s*o-i*l,t[2]=i*a-n*o,t}function S(t,e,r,i){const n=e[0],s=e[1],o=e[2];return t[0]=n+i*(r[0]-n),t[1]=s+i*(r[1]-s),t[2]=o+i*(r[2]-o),t}function E(t,e,r){const i=e[0],n=e[1],s=e[2];return t[0]=r[0]*i+r[4]*n+r[8]*s+r[12],t[1]=r[1]*i+r[5]*n+r[9]*s+r[13],t[2]=r[2]*i+r[6]*n+r[10]*s+r[14],t}function O(t,e,r){const i=e[0],n=e[1],s=e[2];return t[0]=i*r[0]+n*r[3]+s*r[6],t[1]=i*r[1]+n*r[4]+s*r[7],t[2]=i*r[2]+n*r[5]+s*r[8],t}function C(t,e,r){const i=r[0],n=r[1],s=r[2],o=r[3],a=e[0],l=e[1],u=e[2],c=n*u-s*l,h=s*a-i*u,p=i*l-n*a,d=n*p-s*h,f=s*c-i*p,g=i*h-n*c,y=2*o;return t[0]=a+c*y+2*d,t[1]=l+h*y+2*f,t[2]=u+p*y+2*g,t}const P=(0,i.vt)(),T=(0,i.vt)();function U(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]}function L(t,e,r){const i=r[0]-e[0],n=r[1]-e[1],s=r[2]-e[2];let o=i*i+n*n+s*s;return o>0?(o=1/Math.sqrt(o),t[0]=i*o,t[1]=n*o,t[2]=s*o,t):(t[0]=0,t[1]=0,t[2]=0,t)}const Z=u,D=c,N=h,j=v,R=M,$=s,q=b;Object.freeze(Object.defineProperty({__proto__:null,abs:p,add:l,angle:function(t,e){x(P,t),x(T,e);const r=_(P,T);return r>1?0:r<-1?Math.PI:Math.acos(r)},bezier:function(t,e,r,i,n,s){const o=1-s,a=o*o,l=s*s,u=a*o,c=3*s*a,h=3*l*o,p=l*s;return t[0]=e[0]*u+r[0]*c+i[0]*h+n[0]*p,t[1]=e[1]*u+r[1]*c+i[1]*h+n[1]*p,t[2]=e[2]*u+r[2]*c+i[2]*h+n[2]*p,t},ceil:function(t,e){return t[0]=Math.ceil(e[0]),t[1]=Math.ceil(e[1]),t[2]=Math.ceil(e[2]),t},clamp:function(t,e=0,r=1){return t[0]=Math.min(Math.max(t[0],e),r),t[1]=Math.min(Math.max(t[1],e),r),t[2]=Math.min(Math.max(t[2],e),r),t},copy:o,cross:I,crossAndNormalize:function(t,e,r){const i=e[0],n=e[1],s=e[2],o=r[0],a=r[1],l=r[2],u=n*l-s*a,c=s*o-i*l,h=i*a-n*o,p=Math.sqrt(u*u+c*c+h*h);return t[0]=u/p,t[1]=c/p,t[2]=h/p,t},direction:L,dist:j,distance:v,div:N,divide:h,dot:_,equals:function(t,e){if(t===e)return!0;const r=t[0],i=t[1],s=t[2],o=e[0],a=e[1],l=e[2],u=(0,n.FD)();return Math.abs(r-o)<=u*Math.max(1,Math.abs(r),Math.abs(o))&&Math.abs(i-a)<=u*Math.max(1,Math.abs(i),Math.abs(a))&&Math.abs(s-l)<=u*Math.max(1,Math.abs(s),Math.abs(l))},exactEquals:U,floor:function(t,e){return t[0]=Math.floor(e[0]),t[1]=Math.floor(e[1]),t[2]=Math.floor(e[2]),t},hermite:function(t,e,r,i,n,s){const o=s*s,a=o*(2*s-3)+1,l=o*(s-2)+s,u=o*(s-1),c=o*(3-2*s);return t[0]=e[0]*a+r[0]*l+i[0]*u+n[0]*c,t[1]=e[1]*a+r[1]*l+i[1]*u+n[1]*c,t[2]=e[2]*a+r[2]*l+i[2]*u+n[2]*c,t},inverse:A,len:$,length:s,lerp:S,max:g,min:f,mul:D,multiply:c,negate:w,normalize:x,random:function(t,e=1){const r=n.Ov,i=2*r()*Math.PI,s=2*r()-1,o=Math.sqrt(1-s*s)*e;return t[0]=Math.cos(i)*o,t[1]=Math.sin(i)*o,t[2]=s*e,t},rotateX:function(t,e,r,i){const n=[],s=[];return n[0]=e[0]-r[0],n[1]=e[1]-r[1],n[2]=e[2]-r[2],s[0]=n[0],s[1]=n[1]*Math.cos(i)-n[2]*Math.sin(i),s[2]=n[1]*Math.sin(i)+n[2]*Math.cos(i),t[0]=s[0]+r[0],t[1]=s[1]+r[1],t[2]=s[2]+r[2],t},rotateY:function(t,e,r,i){const n=[],s=[];return n[0]=e[0]-r[0],n[1]=e[1]-r[1],n[2]=e[2]-r[2],s[0]=n[2]*Math.sin(i)+n[0]*Math.cos(i),s[1]=n[1],s[2]=n[2]*Math.cos(i)-n[0]*Math.sin(i),t[0]=s[0]+r[0],t[1]=s[1]+r[1],t[2]=s[2]+r[2],t},rotateZ:function(t,e,r,i){const n=[],s=[];return n[0]=e[0]-r[0],n[1]=e[1]-r[1],n[2]=e[2]-r[2],s[0]=n[0]*Math.cos(i)-n[1]*Math.sin(i),s[1]=n[0]*Math.sin(i)+n[1]*Math.cos(i),s[2]=n[2],t[0]=s[0]+r[0],t[1]=s[1]+r[1],t[2]=s[2]+r[2],t},round:function(t,e){return t[0]=Math.round(e[0]),t[1]=Math.round(e[1]),t[2]=Math.round(e[2]),t},scale:y,scaleAndAdd:m,set:a,sign:d,sqrDist:R,sqrLen:q,squaredDistance:M,squaredLength:b,str:function(t){return"vec3("+t[0]+", "+t[1]+", "+t[2]+")"},sub:Z,subtract:u,transformMat3:O,transformMat4:E,transformQuat:C},Symbol.toStringTag,{value:"Module"}))},52136:(t,e,r)=>{r.d(e,{p:()=>o});var i=r(31635),n=r(10107),s=(r(44208),r(53966),r(87811),r(40608));const o=t=>{const e=t;let r=class extends e{get apiKey(){return this._isOverridden("apiKey")?this._get("apiKey"):"portalItem"in this?this.portalItem?.apiKey:null}set apiKey(t){null!=t?this._override("apiKey",t):(this._clearOverride("apiKey"),this.clear("apiKey","user"))}};return(0,i.Cg)([(0,n.MZ)({type:String})],r.prototype,"apiKey",null),r=(0,i.Cg)([(0,s.$)("esri.layers.mixins.APIKeyMixin")],r),r}},64272:(t,e,r)=>{r.d(e,{T:()=>p});var i,n=r(31635),s=r(25482),o=r(88930),a=r(10107),l=(r(44208),r(53966),r(87811),r(36005)),u=r(40608),c=r(43937),h=r(98623);let p=class extends s.o{static{i=this}static get allTime(){return d}static get empty(){return f}static fromArray(t){return new i({start:null!=t[0]?new Date(t[0]):t[0],end:null!=t[1]?new Date(t[1]):t[1]})}constructor(t){super(t),this.end=null,this.start=null}readEnd(t,e){return null!=e.end?new Date(e.end):null}writeEnd(t,e){e.end=t?.getTime()??null}get isAllTime(){return this.equals(i.allTime)}get isEmpty(){return this.equals(i.empty)}readStart(t,e){return null!=e.start?new Date(e.start):null}writeStart(t,e){e.start=t?.getTime()??null}clone(){return new i({end:this.end,start:this.start})}equals(t){if(!t)return!1;const e=this.start?.getTime()??this.start,r=this.end?.getTime()??this.end,i=t.start?.getTime()??t.start,n=t.end?.getTime()??t.end;return e===i&&r===n}expandTo(t,e=h.qU){if(this.isEmpty||this.isAllTime)return this.clone();let r=this.start;r&&(r=(0,o.lL)(r,t,e));let n=this.end;if(n){const r=(0,o.lL)(n,t,e);n=n.getTime()===r.getTime()?r:(0,o.S1)(r,1,t,e)}return new i({start:r,end:n})}intersection(t){if(!t)return this.clone();if(this.isEmpty||t.isEmpty)return i.empty;if(this.isAllTime)return t.clone();if(t.isAllTime)return this.clone();const e=this.start?.getTime()??-1/0,r=this.end?.getTime()??1/0,n=t.start?.getTime()??-1/0,s=t.end?.getTime()??1/0;let o,a;return n>=e&&n<=r?o=n:e>=n&&e<=s&&(o=e),r>=n&&r<=s?a=r:s>=e&&s<=r&&(a=s),null==o||null==a||isNaN(o)||isNaN(a)?i.empty:new i({start:o===-1/0?null:new Date(o),end:a===1/0?null:new Date(a)})}offset(t,e,r=h.qU){if(this.isEmpty||this.isAllTime)return this.clone();const n=new i,{start:s,end:a}=this;return null!=s&&(n.start=(0,o.S1)(s,t,e,r)),null!=a&&(n.end=(0,o.S1)(a,t,e,r)),n}toArray(){return this.isEmpty?[void 0,void 0]:[this.start?.getTime()??null,this.end?.getTime()??null]}union(t){if(!t||t.isEmpty)return this.clone();if(this.isEmpty)return t.clone();if(this.isAllTime||t.isAllTime)return d.clone();const e=null!=this.start&&null!=t.start?new Date(Math.min(this.start.getTime(),t.start.getTime())):null,r=null!=this.end&&null!=t.end?new Date(Math.max(this.end.getTime(),t.end.getTime())):null;return new i({start:e,end:r})}};(0,n.Cg)([(0,a.MZ)({type:Date,json:{write:{allowNull:!0}}})],p.prototype,"end",void 0),(0,n.Cg)([(0,l.w)("end")],p.prototype,"readEnd",null),(0,n.Cg)([(0,c.K)("end")],p.prototype,"writeEnd",null),(0,n.Cg)([(0,a.MZ)({readOnly:!0,json:{read:!1}})],p.prototype,"isAllTime",null),(0,n.Cg)([(0,a.MZ)({readOnly:!0,json:{read:!1}})],p.prototype,"isEmpty",null),(0,n.Cg)([(0,a.MZ)({type:Date,json:{write:{allowNull:!0}}})],p.prototype,"start",void 0),(0,n.Cg)([(0,l.w)("start")],p.prototype,"readStart",null),(0,n.Cg)([(0,c.K)("start")],p.prototype,"writeStart",null),p=i=(0,n.Cg)([(0,u.$)("esri.time.TimeExtent")],p);const d=new p,f=new p({start:void 0,end:void 0})},69208:(t,e,r)=>{r.d(e,{d:()=>o});var i=r(31635),n=r(10107),s=(r(44208),r(53966),r(87811),r(40608));const o=t=>{const e=t;let r=class extends e{constructor(){super(...arguments),this.customParameters=null}};return(0,i.Cg)([(0,n.MZ)({type:Object,json:{write:{overridePolicy:t=>({enabled:!!(t&&Object.keys(t).length>0)})}}})],r.prototype,"customParameters",void 0),r=(0,i.Cg)([(0,s.$)("esri.layers.mixins.CustomParametersMixin")],r),r}},69540:(t,e,r)=>{r.d(e,{OU:()=>c,Pw:()=>h});var i=r(31635),n=r(65008),s=(r(44208),r(4718)),o=(r(53966),r(97768)),a=r(88620),l=r(40608);const u=Symbol("ClonableMixin"),c=t=>{var e;const r=t;let n=class extends r{constructor(){super(...arguments),this[e]=!0}static{e=u}clone(t){const e=(0,a.oY)(this);(0,o.Lw)(e,"unable to clone instance of non-accessor class");const r=e.metadata,i=e.store,n={},l=new Map;for(const e in r){const o=r[e],a=i?.originOf(e),u=o.clonable;if(o.readOnly||!1===u||7!==a&&0!==a&&5!==a&&4!==a)continue;const c=this[e];let h=null;if("function"==typeof u)h=u(c,t);else if("reference"===u)h=c;else if(h=(0,s.TU)(c,t),null!=c&&null==h)continue;0===a?l.set(e,h):n[e]=h}const u=new(0,Object.getPrototypeOf(this).constructor)(n);if(l.size){const t=(0,a.oY)(u)?.store;if(t)for(const[e,r]of l)t.set(e,r,0)}return u}};return n=(0,i.Cg)([(0,l.$)("esri.core.Clonable")],n),n},h=c(n.A)},78553:(t,e,r)=>{r.d(e,{D:()=>s,p:()=>n});var i=r(56507);function n(t){const e=(0,i.Vr)(100*(1-t));return Math.max(0,Math.min(e,100))}function s(t){const e=1-t/100;return Math.max(0,Math.min(e,1))}},88546:(t,e,r)=>{r.d(e,{u:()=>d});var i=r(34727),n=r(38954),s=r(51850),o=r(73941),a=r(5443),l=r(16930),u=r(9762);function c(t,e){if(!Array.isArray(t)||t.length<e)return!1;for(const e of t)if("number"!=typeof e)return!1;return!0}const h=7645211,p={xmin:-180,ymin:-90,zmin:-450,xmax:180,ymax:90,zmax:8850};function d(t){let e=new l.A({wkid:4326,vcsWkid:115700}),r=t.root?.boundingVolume,d=!1,f=t?.root?.transform;if((t.extensions?.ESRI_crs?.wkid||t.extensions?.ESRI_crs?.latestWkid||t.extensions?.ESRI_crs?.wkt)&&(t.root?.extensions?.ESRI_crs?.boundingVolume?.box||t.root?.extensions?.ESRI_crs?.boundingVolume?.sphere))e=new l.A(t.extensions?.ESRI_crs),r=t.root?.extensions?.ESRI_crs?.boundingVolume,f=t.root?.transform,d=!0;else if(!r)return new a.A(-180,-90,180,90,e);if(r.box){const t=r?.box;if(t[3]>h&&t[7]>h&&t[11]>h)return new a.A({...p,sr:e})}const g=(0,s.vt)();if(!d&&r.region&&c(r.region,6)){const t=r.region,n=(0,i.KJ)(t[0]),s=(0,i.KJ)(t[1]),o=t[4],l=(0,i.KJ)(t[2]),u=(0,i.KJ)(t[3]),c=t[5];return new a.A({xmin:n,ymin:s,zmin:o,xmax:l,ymax:u,zmax:c,spatialReference:e})}if(r.sphere&&c(r.sphere,4)){const t=r.sphere,i=(0,s.fA)(t[0],t[1],t[2]),h=t[3]/Math.sqrt(3),p=(0,s.vt)();(0,n.d)(p,i,(0,s.fA)(h,h,h));const y=(0,s.vt)();if((0,n.f)(y,i,(0,s.fA)(h,h,h)),f&&c(f,16)){const t=f;(0,n.t)(g,p,t),(0,n.c)(p,g),(0,n.t)(g,y,t),(0,n.c)(y,g)}d||((0,u.projectBuffer)(p,o.Ro,0,p,l.A.WGS84,0),(0,u.projectBuffer)(y,o.Ro,0,y,l.A.WGS84,0));const m=(0,s.vt)(),v=(0,s.vt)();return(0,n.A)(m,p,y),(0,n.z)(v,p,y),new a.A({xmin:m[0],ymin:m[1],zmin:m[2],xmax:v[0],ymax:v[1],zmax:v[2],spatialReference:e})}if(r.box&&c(r.box,12)){const t=r.box,i=(0,s.fA)(t[0],t[1],t[2]),h=(0,s.fA)(t[3],t[4],t[5]),p=(0,s.fA)(t[6],t[7],t[8]),g=(0,s.fA)(t[9],t[10],t[11]),y=[];for(let t=0;t<8;++t)y.push((0,s.vt)());if((0,n.f)(y[0],i,h),(0,n.f)(y[0],y[0],p),(0,n.f)(y[0],y[0],g),(0,n.a)(y[1],i,h),(0,n.f)(y[1],y[1],p),(0,n.f)(y[1],y[1],g),(0,n.f)(y[2],i,h),(0,n.a)(y[2],y[2],p),(0,n.f)(y[2],y[2],g),(0,n.a)(y[3],i,h),(0,n.a)(y[3],y[3],p),(0,n.f)(y[3],y[3],g),(0,n.f)(y[4],i,h),(0,n.f)(y[4],y[4],p),(0,n.a)(y[4],y[4],g),(0,n.a)(y[5],i,h),(0,n.f)(y[5],y[5],p),(0,n.a)(y[5],y[5],g),(0,n.f)(y[6],i,h),(0,n.a)(y[6],y[6],p),(0,n.a)(y[6],y[6],g),(0,n.a)(y[7],i,h),(0,n.a)(y[7],y[7],p),(0,n.a)(y[7],y[7],g),f&&c(f,16)){const t=f;for(let e=0;e<8;++e)(0,n.t)(y[e],y[e],t)}const m=(0,s.fA)(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE),v=(0,s.fA)(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE);for(let t=0;t<8;++t)d||(0,u.projectBuffer)(y[t],o.Ro,0,y[t],l.A.WGS84,0),(0,n.A)(v,v,y[t]),(0,n.z)(m,m,y[t]);return new a.A({xmin:v[0],ymin:v[1],zmin:v[2],xmax:m[0],ymax:m[1],zmax:m[2],spatialReference:e})}return new a.A(-180,-90,180,90,e)}},92071:(t,e,r)=>{r.d(e,{P:()=>v,L:()=>M});var i=r(31635),n=r(65008),s=r(76953),o=r(4718),a=r(35666);class l{constructor(){this._propertyOriginMap=new Map,this._originStores=new Array(a.AU),this._values=new Map,this.multipleOriginsSupported=!0}clone(t){const e=new l,r=this._originStores[0];r&&r.forEach((t,r)=>{e.set(r,(0,o.o8)(t),0)});for(let r=2;r<a.AU;r++){const i=this._originStores[r];i&&i.forEach((i,n)=>{t&&t.has(n)||e.set(n,(0,o.o8)(i),r)})}return e}get(t,e){const r=void 0===e?this._values:this._originStores[e];return r?r.get(t):void 0}keys(t){const e=null==t?this._values:this._originStores[t];return e?[...e.keys()]:[]}set(t,e,r=7){let i=this._originStores[r];if(i||(i=new Map,this._originStores[r]=i),i.set(t,e),!this._values.has(t)||this._propertyOriginMap.get(t)<=r){const i=this._values.get(t);return this._values.set(t,e),this._propertyOriginMap.set(t,r),i!==e}return!1}delete(t,e=7){const r=this._originStores[e];if(!r)return;const i=r.get(t);if(r.delete(t),this._values.has(t)&&this._propertyOriginMap.get(t)===e){this._values.delete(t);for(let r=e-1;r>=0;r--){const e=this._originStores[r];if(e&&e.has(t)){this._values.set(t,e.get(t)),this._propertyOriginMap.set(t,r);break}}}return i}has(t,e){const r=void 0===e?this._values:this._originStores[e];return!!r&&r.has(t)}revert(t,e){for(;e>0&&!this.has(t,e);)--e;const r=this._originStores[e],i=r?.get(t),n=this._values.get(t);return this._values.set(t,i),this._propertyOriginMap.set(t,e),n!==i}originOf(t){return this._propertyOriginMap.get(t)||0}isAtOrigin(t,e){return this.has(t,e)&&this.originOf(t)===e}isBelowOrigin(t,e){return!this.has(t)||this.originOf(t)<e}forEach(t){this._values.forEach(t)}}var u=r(45917),c=r(88620),h=r(40608);const p=t=>{const e=t;let r=class extends e{constructor(...t){super(...t);const e=(0,c.oY)(this),r=e.store,i=new l;e.store=i,(0,s.k)(e,r,i)}read(t,e){(0,u.L)(this,t,e)}getAtOrigin(t,e){const r=d(this),i=(0,a.aB)(e);if("string"==typeof t)return r.get(t,i);const n={};return t.forEach(t=>{n[t]=r.get(t,i)}),n}originOf(t){return(0,a.OL)(this.originIdOf(t))}originIdOf(t){return d(this).originOf(t)}revert(t,e){const r=d(this),i=(0,a.aB)(e),n=(0,c.oY)(this);let s;s="string"==typeof t?"*"===t?r.keys(i):[t]:t,s.forEach(t=>{n.invalidate(t),r.revert(t,i),n.commit(t)})}};return r=(0,i.Cg)([(0,h.$)("esri.core.ReadOnlyMultiOriginJSONSupport")],r),r};function d(t){return(0,c.oY)(t).store}p(n.A);var f=r(16649),g=r(49422);const y=t=>{const e=t;let r=class extends e{constructor(...t){super(...t)}clear(t,e="user"){(0,c.oY)(this).clearOrigin(t,(0,a.aB)(e))}write(t,e){return(0,g.M)(this,t=t||{},e),t}setAtOrigin(t,e,r){(0,c.oY)(this).setAtOrigin(t,e,(0,a.aB)(r))}removeOrigin(t){const e=m(this),r=(0,a.aB)(t),i=e.keys(r);for(const t of i)e.originOf(t)===r&&e.set(t,e.get(t,r),7)}updateOrigin(t,e){const r=m(this),i=(0,a.aB)(e),n=(0,f.Jt)(this,t);for(let e=i+1;e<a.AU;++e)r.delete(t,e);r.set(t,n,i)}toJSON(t){return this.write({},t)}};return r=(0,i.Cg)([(0,h.$)("esri.core.MultiOriginJSONSupport.WriteableMultiOriginJSONSupport")],r),r.prototype.toJSON.isDefaultToJSON=!0,r};function m(t){return(0,c.oY)(t).store}const v=t=>{const e=y(p(t));let r=class extends e{constructor(...t){super(...t)}};return r=(0,i.Cg)([(0,h.$)("esri.core.MultiOriginJSONSupport")],r),r},M=v(n.A)}}]);
|