@arcgis/core 4.34.0-next.65 → 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/Graphic.js +1 -1
- package/WebDocument2D.js +1 -1
- package/applications/SceneViewer/sceneViewerUtils.js +1 -1
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/0814676e4bac81f96140.js +1 -0
- package/assets/esri/core/workers/chunks/{6ab435423acb0ed0b1c7.js → 09dbb3e200ef8d514eb3.js} +2 -2
- package/assets/esri/core/workers/chunks/0b71100fa1e7ca706dbb.js +1 -0
- package/assets/esri/core/workers/chunks/0c4f07eb3f3dd5cd2c6c.js +1 -0
- package/assets/esri/core/workers/chunks/{3167230555c63f943485.js → 0cbd5335cc92f5891bcf.js} +1 -1
- package/assets/esri/core/workers/chunks/{79933271a76a1756584f.js → 12d30c2367652e2c688b.js} +1 -1
- package/assets/esri/core/workers/chunks/144bfd64daf103a06734.js +1 -0
- package/assets/esri/core/workers/chunks/{0b53bc76d38e85902748.js → 170ec7fb070c63230c81.js} +1 -1
- package/assets/esri/core/workers/chunks/18c7b1e1fbf7eb6c3c33.js +1 -0
- package/assets/esri/core/workers/chunks/1ada9e6cdd6792e3847a.js +1 -0
- 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/{426232091caf8608e5f1.js → 26b791291689434dde09.js} +1 -1
- package/assets/esri/core/workers/chunks/3212a476184be25d17f8.js +1 -0
- 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/{e72aee3f857aa473822c.js → 39d69afc9da9db0c75ab.js} +1 -1
- package/assets/esri/core/workers/chunks/4102ed32b8dbdc32cb3b.js +1 -0
- package/assets/esri/core/workers/chunks/{7c3a1958990de095d3a1.js → 48316d91c06928f69f61.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/4f0f6653b8e92c633d14.js +1 -0
- package/assets/esri/core/workers/chunks/{09f0c9f0b6aa58ae3c52.js → 4f22e5a7f81883e8e5b6.js} +1 -1
- package/assets/esri/core/workers/chunks/5185c63fecc5f493e142.js +1 -0
- package/assets/esri/core/workers/chunks/{6fff219dfaa86167c326.js → 5303d77a3ab1b7ddeef3.js} +1 -1
- package/assets/esri/core/workers/chunks/548818df658b607a364e.js +1 -0
- package/assets/esri/core/workers/chunks/{22ec2b0a853911692dc8.js → 5993427325d1add18ed9.js} +1 -1
- package/assets/esri/core/workers/chunks/{657b01a6df8dc46c5209.js → 5b84eba4a28e25b6d5c0.js} +1 -1
- package/assets/esri/core/workers/chunks/5c053d197935c65792ce.js +1 -0
- 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/66cb5b294d7f251c2cc8.js +1 -0
- package/assets/esri/core/workers/chunks/6a5b5b80917a5375b9f6.js +1 -0
- 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/7e95896ac41c7e2ca26a.js +1 -0
- package/assets/esri/core/workers/chunks/80b0c88a76bd523a406a.js +1 -0
- package/assets/esri/core/workers/chunks/{5d12862042b6bf9f9d54.js → 82cb5defb0593e3017ff.js} +1 -1
- package/assets/esri/core/workers/chunks/837830e1cf712d4243a5.js +1 -0
- package/assets/esri/core/workers/chunks/87fb5d755860057da164.js +1 -0
- package/assets/esri/core/workers/chunks/{a29fb90226bd08157bd1.js → 8a104b35708a492bd614.js} +1 -1
- package/assets/esri/core/workers/chunks/{5cb238318a24b70d5ac3.js → 8bc8caa384b24af12411.js} +1 -1
- package/assets/esri/core/workers/chunks/8e2558b14be70b273ce4.js +1 -0
- 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/99f133a152afb4f1b067.js +1 -0
- package/assets/esri/core/workers/chunks/9eb1bfcb9b05f2a36748.js +1 -0
- package/assets/esri/core/workers/chunks/{0a36df6fdab95785d1ce.js → a2963ffc9a8c90822d2d.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/aa970a547c60c43d6c7f.js +1 -0
- package/assets/esri/core/workers/chunks/ab727ed4417b7dd94ce9.js +1 -0
- package/assets/esri/core/workers/chunks/{d1e8220dcae1d01d3c35.js → ad3ebd4f05cc673140f3.js} +1 -1
- package/assets/esri/core/workers/chunks/{9f93513037a6e87433c4.js → adfb018f510e19a520fb.js} +1 -1
- package/assets/esri/core/workers/chunks/{a1bd4eecca1e3272bffb.js → aff553c3d6544e20f188.js} +1 -1
- package/assets/esri/core/workers/chunks/b052d3ef5493eedb44a5.js +1 -0
- package/assets/esri/core/workers/chunks/b335e96f6bcac6d2f0ee.js +1 -0
- package/assets/esri/core/workers/chunks/b482132638f3b351724c.js +1 -0
- package/assets/esri/core/workers/chunks/{e1b25b1ce3bd4f0f2cda.js → bc5fa33afec5354601a1.js} +1 -1
- 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/{904c116c6b093e0e970c.js → d1b361b8adf1c719a10a.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/e0fe6bb51ecc9b2faf69.js +1 -0
- package/assets/esri/core/workers/chunks/{0f9813e7d4e2b47b2c39.js → e47acdb1fbf797342716.js} +1 -1
- package/assets/esri/core/workers/chunks/e4e224983c3ee24fc51d.js +1 -0
- package/assets/esri/core/workers/chunks/{a16b471c3706ee37f9b6.js → e6f2ac738df16fb5e13a.js} +1 -1
- package/assets/esri/core/workers/chunks/ed1272e7681e561d843f.js +1 -0
- package/assets/esri/core/workers/chunks/ee391a41144855fc625d.js +1 -0
- package/assets/esri/core/workers/chunks/efea3e82cec476d486e0.js +1 -0
- package/assets/esri/core/workers/chunks/f054557e23978e174686.js +1 -0
- package/assets/esri/core/workers/chunks/{ff2614d96ca5228e9685.js → f4d4c1f13522f20b00d1.js} +1 -1
- package/assets/esri/core/workers/chunks/{897f9775f06ddbf6486f.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 +3 -3
- package/chunks/RibbonLine.glsl.js +2 -2
- package/config.js +1 -1
- package/core/AsyncUpdate.js +1 -1
- package/core/mapCollectionUtils.js +1 -1
- package/editing/sharedTemplates/executor/builders/pointAtPolygonCentroid.js +1 -1
- package/geometry/Polygon.js +1 -1
- package/geometry/support/centroid.js +1 -1
- package/geometry/support/geometryUtils.js +1 -1
- package/graphic/AggregateGraphicOrigin.js +1 -1
- package/graphic/BuildingGraphicOrigin.js +1 -1
- package/graphic/CSVGraphicOrigin.js +1 -1
- package/graphic/CatalogGraphicOrigin.js +1 -1
- package/graphic/FeatureGraphicOrigin.js +1 -1
- package/graphic/GeoJSONGraphicOrigin.js +1 -1
- package/graphic/GeoRSSGraphicOrigin.js +1 -1
- package/graphic/ImageryGraphicOrigin.js +1 -1
- package/graphic/ImageryTileGraphicOrigin.js +1 -1
- package/graphic/KMLGraphicOrigin.js +1 -1
- package/graphic/KnowledgeGraphGraphicOrigin.js +1 -1
- package/graphic/LinkChartGraphicOrigin.js +1 -1
- package/graphic/MapImageGraphicOrigin.js +1 -1
- package/graphic/MapNotesGraphicOrigin.js +1 -1
- package/graphic/OGCFeatureGraphicOrigin.js +1 -1
- package/graphic/OrientedImageryGraphicOrigin.js +1 -1
- package/graphic/ParquetGraphicOrigin.js +1 -1
- package/graphic/PointCloudGraphicOrigin.js +1 -1
- package/graphic/SceneGraphicOrigin.js +1 -1
- package/graphic/StreamGraphicOrigin.js +1 -1
- package/graphic/SubtypeGroupGraphicOrigin.js +1 -1
- package/graphic/TileGraphicOrigin.js +1 -1
- package/graphic/TrackGraphicOrigin.js +1 -1
- package/graphic/VectorTileGraphicOrigin.js +1 -1
- package/graphic/VoxelGraphicOrigin.js +1 -1
- package/graphic/WCSGraphicOrigin.js +1 -1
- package/graphic/WFSGraphicOrigin.js +1 -1
- package/graphic/getIdFieldsProvider.js +5 -0
- package/graphic/getSliceableContainer.js +5 -0
- package/graphic/graphicOrigins.d.ts +0 -2
- package/graphic/graphicOrigins.js +1 -1
- package/interfaces.d.ts +172 -244
- package/kernel.js +1 -1
- package/layers/GaussianSplatLayer.js +1 -1
- package/layers/IntegratedMesh3DTilesLayer.js +1 -1
- package/layers/IntegratedMeshLayer.js +1 -1
- package/layers/Layer.js +1 -1
- package/layers/LinkChartLayer.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/controllers/I3SOnDemandController.js +1 -1
- package/layers/graphics/sources/FeatureLayerSource.js +1 -1
- package/layers/knowledgeGraph/KnowledgeGraphLayerDataManager.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/orientedImagery/core/coverageUtils.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/layers/support/rasterDatasets/multidimensionalUtils.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/smartMapping/support/adapters/FeatureLayerBinningAdapter.js +1 -1
- package/support/revision.js +1 -1
- package/support/timeUtils.js +1 -1
- package/symbols/support/previewCIMSymbol.js +1 -1
- package/symbols/support/previewSymbol2D.js +1 -1
- package/symbols/support/renderUtils.js +1 -1
- package/symbols/support/svgUtils.js +1 -1
- package/symbols/support/symbolUtils.js +1 -1
- package/symbols/support/utils.js +1 -1
- package/time/TimeExtent.js +1 -1
- package/time/TimeInterval.js +1 -1
- package/views/2d/analysis/ElevationProfile/ElevationProfileInputVisualization2D.js +5 -0
- package/views/2d/analysis/ElevationProfile/ElevationProfileLineVisualization2D.js +5 -0
- package/views/2d/analysis/ElevationProfile/ElevationProfileVisualization2D.js +5 -0
- 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/ElevationProfile/ElevationProfileInputVisualization3D.js +5 -0
- package/views/3d/analysis/ElevationProfile/ElevationProfileLineVisualization3D.js +5 -0
- package/views/3d/analysis/ElevationProfile/ElevationProfileVisualization3D.js +5 -0
- package/views/3d/analysis/ElevationProfileAnalysisView3D.js +1 -1
- package/views/3d/analysis/LineOfSight/LineOfSightIntersectionResult.js +1 -1
- package/views/3d/analysis/LineOfSight/LineOfSightRayIntersector.js +1 -1
- package/views/3d/analysis/LineOfSight/LineOfSightTool.js +1 -1
- package/views/3d/analysis/Slice/SliceTool.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/environment/Fog.js +1 -1
- package/views/3d/layers/BuildingSceneLayerView3D.js +1 -1
- package/views/3d/layers/FeatureLikeLayerView3D.js +1 -1
- package/views/3d/layers/I3SMeshView3D.js +1 -1
- package/views/3d/layers/IntegratedMeshLayerView3D.js +1 -1
- package/views/3d/layers/SceneLayerView3D.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/graphicUtils.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/i3s/Intersector.js +1 -1
- package/views/3d/layers/support/FeatureTileFetcher3D.js +1 -1
- package/views/3d/layers/support/FeatureVisibilityFilter.js +1 -1
- package/views/3d/layers/support/SublayerPopupHighlightHelper3D.js +1 -1
- package/views/3d/layers/support/Tiles3DIntersectionHandler.js +1 -1
- package/views/3d/support/hitTest.js +1 -1
- package/views/3d/support/viewpointUtils.js +1 -1
- package/views/3d/terrain/Intersector.js +1 -1
- package/views/3d/webgl-engine/core/FBOCache.js +1 -1
- package/views/3d/webgl-engine/core/FBOCacheFormats.js +1 -1
- package/views/3d/webgl-engine/effects/debug/RenderNodeVisualizerNode.js +4 -4
- 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/GlowPresets.glsl.js +1 -1
- package/views/3d/webgl-engine/effects/glow/GlowRenderNode.js +1 -1
- package/views/3d/webgl-engine/effects/highlight/Highlight.js +1 -1
- package/views/3d/webgl-engine/lib/GaussianSplatRenderNode.js +1 -1
- package/views/3d/webgl-engine/lib/MainFramebuffer.js +1 -1
- package/views/3d/webgl-engine/lib/Renderer.js +1 -1
- package/views/3d/webgl-engine/lib/intersectorUtilsConversions.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/View2D.js +1 -1
- package/views/analysis/ElevationProfile/ElevationProfileController.js +1 -1
- package/views/analysis/ElevationProfile/ElevationProfileGenerationError.js +1 -1
- package/views/analysis/ElevationProfile/ElevationProfileHoveredPointVisualization.js +5 -0
- package/views/analysis/ElevationProfile/ElevationProfileHoveredPointsVisualization.js +5 -0
- package/views/analysis/ElevationProfile/ElevationProfileResult.js +1 -1
- package/views/analysis/ElevationProfile/ElevationProfileTool.js +1 -1
- package/views/analysis/ElevationProfile/constants.js +1 -1
- package/views/analysis/ElevationProfile/elevationProfileInputVisualizationUtils.js +5 -0
- package/views/draw/support/createUtils.js +1 -1
- package/views/layers/support/MapServiceLayerViewHelper.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/AreaMeasurement2D/AreaMeasurement2DTool.js +1 -1
- package/widgets/FeatureTable/support/FeatureStore.js +1 -1
- package/widgets/Legend/styles/card/CardView.js +1 -1
- package/widgets/Legend/styles/card/ColorRamp.js +1 -1
- package/widgets/Legend/styles/card/LegendElement.js +1 -1
- package/widgets/Legend/styles/card/UnivariateAboveAndBelowRamp.js +1 -1
- package/widgets/Legend/styles/card/UnivariateColorSizeRamp.js +1 -1
- package/widgets/Legend/styles/classic/ClassicView.js +1 -1
- package/widgets/Legend/styles/classic/LegendElement.js +1 -1
- package/widgets/Legend/styles/classic/UnivariateAboveAndBelowRamp.js +1 -1
- package/widgets/Legend/styles/classic/UnivariateColorSizeRamp.js +1 -1
- package/widgets/Legend/styles/support/relationshipUtils.js +1 -1
- package/widgets/Legend/styles/support/univariateUtils.js +1 -1
- package/widgets/Legend/support/ActiveLayerInfo.js +1 -1
- package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
- package/widgets/OrientedImageryViewer/navigation/NavigationManager.js +1 -1
- package/widgets/OrientedImageryViewer/navigation/queries.js +1 -1
- package/widgets/TimeSlider/TimeSliderViewModel.js +1 -1
- package/widgets/TimeSlider.js +1 -1
- package/widgets/UtilityNetworkTrace/support/GraphicHandler.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/0264905da9fa56166538.js +0 -1
- package/assets/esri/core/workers/chunks/070b29cba896f46537f9.js +0 -1
- 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/0cdf6b51f2a63f348530.js +0 -1
- package/assets/esri/core/workers/chunks/0d82cc6905b105b3568a.js +0 -1
- package/assets/esri/core/workers/chunks/0e28cb5d8d89ae29cdd0.js +0 -1
- package/assets/esri/core/workers/chunks/1143313f2f6f34deaad7.js +0 -1
- package/assets/esri/core/workers/chunks/14c6461ffd36319e1d74.js +0 -1
- package/assets/esri/core/workers/chunks/2394ac65d64e50399d76.js +0 -1
- package/assets/esri/core/workers/chunks/47febd4de836a33b51b1.js +0 -1
- package/assets/esri/core/workers/chunks/487afbf352d12c745430.js +0 -1
- package/assets/esri/core/workers/chunks/56b4dcd04c844eaacd60.js +0 -1
- package/assets/esri/core/workers/chunks/5d65987f2c1b5c56a799.js +0 -1
- package/assets/esri/core/workers/chunks/77e27f318b5863dd0f5c.js +0 -1
- package/assets/esri/core/workers/chunks/7b7f5028a488bb9c10f4.js +0 -1
- package/assets/esri/core/workers/chunks/808cfed7022e3846d5b2.js +0 -1
- package/assets/esri/core/workers/chunks/8bd5a0ff7dcf1067bf53.js +0 -1
- package/assets/esri/core/workers/chunks/99b20eef2893047fac10.js +0 -1
- package/assets/esri/core/workers/chunks/9f4e23bae621ff3ecea3.js +0 -1
- package/assets/esri/core/workers/chunks/a596d6ccb6103e594031.js +0 -1
- package/assets/esri/core/workers/chunks/a5e6359fadbd699b1c8e.js +0 -1
- package/assets/esri/core/workers/chunks/a7f3cdd9a249ef4572ce.js +0 -1
- package/assets/esri/core/workers/chunks/a80d769b0ed025f0df64.js +0 -1
- package/assets/esri/core/workers/chunks/af83dddddbfe25194527.js +0 -1
- package/assets/esri/core/workers/chunks/b057e6d593c1607cae61.js +0 -1
- package/assets/esri/core/workers/chunks/b1f1a26e7a2ef5b783ee.js +0 -1
- package/assets/esri/core/workers/chunks/b605dfdfed8ff8eda4f3.js +0 -1
- package/assets/esri/core/workers/chunks/c337c1a2dbc452780dd7.js +0 -1
- package/assets/esri/core/workers/chunks/c601bbdafdee5074b04f.js +0 -1
- package/assets/esri/core/workers/chunks/c696615cae5daefa2d98.js +0 -1
- package/assets/esri/core/workers/chunks/c8694a27e2cf28b010e8.js +0 -1
- package/assets/esri/core/workers/chunks/e6457ac25c0829ee039c.js +0 -1
- package/assets/esri/core/workers/chunks/eadac757f74470b89a36.js +0 -1
- package/assets/esri/core/workers/chunks/f4167fc895d4009df1c7.js +0 -1
- package/assets/esri/core/workers/chunks/f76774781865cb1411b0.js +0 -1
- package/assets/esri/core/workers/chunks/fd04df45cdcc6ff52554.js +0 -1
- package/chunks/TimeExtent.js +0 -5
- package/chunks/TimeInterval.js +0 -5
- package/graphic/IntegratedMesh3DTilesGraphicOrigin.d.ts +0 -4
- package/graphic/IntegratedMesh3DTilesGraphicOrigin.js +0 -5
- package/graphic/IntegratedMeshGraphicOrigin.d.ts +0 -4
- package/graphic/IntegratedMeshGraphicOrigin.js +0 -5
- package/graphic/isIntegratedMesh3DTilesGraphicOrigin.js +0 -5
- package/graphic/isIntegratedMeshGraphicOrigin.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/analysis/ElevationProfile/ElevationProfileHoveredPointVisualization.js +0 -5
- package/views/3d/analysis/ElevationProfile/ElevationProfileHoveredPointsVisualization.js +0 -5
- package/views/3d/analysis/ElevationProfile/ElevationProfileInputVisualization.js +0 -5
- package/views/3d/analysis/ElevationProfile/ElevationProfileLineVisualization.js +0 -5
- package/views/3d/analysis/ElevationProfile/ElevationProfileVisualization.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
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{__decorate as e}from"tslib";import t from"../../../core/Accessor.js";import has from"../../../core/has.js";import i from"../../../core/Logger.js";import{destroyMaybe as s}from"../../../core/maybe.js";import r from"../../../core/PooledArray.js";import{EsriPromiseMixin as a}from"../../../core/Promise.js";import{isAbortError as d}from"../../../core/promiseUtils.js";import{watch as o,sync as n,initial as l}from"../../../core/reactiveUtils.js";import{property as h}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/RandomLCG.js";import{subclass as u}from"../../../core/accessorSupport/decorators/subclass.js";import{q as _}from"../../../chunks/vec32.js";import{projectBoundingRect as c}from"../../../geometry/projection/projectBoundingRect.js";import{create as p}from"../../../geometry/support/aaBoundingRect.js";import{viewingModeFromString as g}from"../../../views/ViewingMode.js";import{I3SClientNodeLoader as m}from"../../../views/3d/layers/i3s/I3SClientNodeLoader.js";import{addCallback as y}from"../../../views/3d/layers/i3s/I3SFrameTask.js";import{I3SIndex as x}from"../../../views/3d/layers/i3s/I3SIndex.js";import f from"../../../views/3d/layers/i3s/I3SLodHandling.js";import N from"../../../views/3d/layers/i3s/I3SNodeLoader.js";import{I3SStreamDataController as b}from"../../../views/3d/layers/i3s/I3SStreamDataController.js";import{getVertexCrs as w,getIndexCrs as v,findIntersectingNodes as C}from"../../../views/3d/layers/i3s/I3SUtil.js";import L from"../../../views/3d/layers/i3s/I3SViewportQueries.js";import{maxDownloadSlots as D}from"../../../views/3d/support/downloadSlots.js";import{toBoundingRect as V}from"../../../views/3d/support/extentUtils.js";import{minQuality as A}from"../../../views/3d/support/MemoryController.js";import{PromiseQueue as I}from"../../../views/support/PromiseQueue.js";import{noBudget as S}from"../../../views/support/Scheduler.js";const M=100,F=2,O=1e4,P=1e-4,U=1.2,q=500,G=1.5;let Q=class extends(a(t)){get isMeshPyramid(){return"mesh-pyramids"===this.layer.profile||"MeshPyramid"===this.layer.store?.lodType}get isGraphics3D(){return"points"===this.layer.profile}get useMaximumNumberOfFeatures(){return!this.isMeshPyramid&&(null==this.layer.priority||"High"===this.layer.priority)}get indexStreamController(){const e=this.layerView.view.resourceController.createStreamDataRequester(2);return new b(e,this.layer.customParameters,this.layer.apiKey)}get dataStreamController(){const e=this.layerView.view.resourceController.createStreamDataRequester(3);return new b(e,this.layer.customParameters,this.layer.apiKey)}get crsVertex(){return w(this.layer)}get crsIndex(){return v(this.layer)}get layer(){return this.layerView.i3slayer}get running(){return this.updating}get rootNodeVisible(){if(this._index){const e=this._index.rootNode;if(e)return this._updateViewData(),this._index.isNodeVisible(e.index)}return!0}get index(){return this._index}get requiredAttributes(){return this._requiredAttributes}constructor(e){super(e),this.featureTarget=5e4,this.fixedFeatureTarget=!1,this.updating=!0,this.updatingProgress=1,this.leavesReached=!1,this.worker=null,this._featureLOD=1,this._stableFeatureLOD=!1,this._isIdle=!1,this._cameraDirty=!0,this._invisibleDirty=!1,this._idleStateCallbacks=null,this._newLoadingNodes=new r({deallocator:null}),this._modificationsNodeFilteringArray=new r,this._downloadingCount=0,this._loadingNodes=new Map,this._updatingNodes=new Map,this._progressMaxNumNodes=1,this._requiredAttributes=new Array,this._requiredAttributesDirty=!0,this._updatesDisabled=!1,this.disableIDBCache=!1,this._disableMemCache=!1,this._restartNodeLoading=!1,this._fields=null,this._attributeStorageInfo=null,this._idleQueue=new I,this._elevationUpdateNodes=new r({deallocator:null}),this._errorCount=0}initialize(){const{layerView:e,layer:t}=this;this._disableMemCache=!e.loadCachedGPUData||!e.addCachedGPUData,this._lodHandling=new f(e),this._defaultGeometrySchema=t.store.defaultGeometrySchema,this.disableIDBCache=!!has("disable-feature:idb-cache"),"fields"in t&&(this._fields=t.fields,this._attributeStorageInfo=t.attributeStorageInfo),this.addResolvingPromise(Promise.all([t.indexInfo,t.when(),e.when()]).then(([s])=>{if(this.destroyed||!e||e.destroyed||!s)return;const{view:r,clientGeometry:a}=e,{resourceController:d}=r;if(this._setClippingArea(r.clippingArea),this.addHandles([o(()=>r?.pointsOfInterest?.focus?.renderLocation,e=>this._pointOfInterestChanged(e),{initial:!0,equals:_}),o(()=>r.quality,()=>this._setCameraDirty(),n),o(()=>e.contentVisible,e=>{const t=e?()=>this._updateIdleState(!0):()=>this._updateViewData(),i=e?()=>this._updateIdleState(!1):()=>{};e&&null!=this._index&&this._index.invalidateAllElevationRanges(),this._idleStateCallbacks?(e||this.cancelNodeLoading(),this.restartNodeLoading(),this._idleStateCallbacks.idleBegin=t,this._idleStateCallbacks.idleEnd=i):this._idleStateCallbacks=d.scheduler.registerIdleStateCallbacks(t,i)},l),y(e.view.resourceController.scheduler,this),o(()=>[this.featureTarget,this.fixedFeatureTarget],()=>{this._setCameraDirty(),this._stableFeatureLOD=!1}),o(()=>r.state?.contentCamera,()=>this._setCameraDirty()),o(()=>t.elevationInfo,e=>this._elevationInfoChanged(e)),o(()=>e.lodFactor,()=>this._setCameraDirty()),o(()=>e.availableFields,()=>this._requiredFieldsChange()),o(()=>e.holeFilling,e=>null!=this._index&&(this._index.holeFilling=e))]),this._viewportQueries=new L(this.crsIndex,r.renderCoordsHelper,r.state.contentCamera,!r.state.fixedContentCamera||this.isGraphics3D,this._clippingArea,this.isMeshPyramid?r.basemapTerrain:r.elevationProvider,g(r.viewingMode),this.layer.elevationInfo,{progressiveLoadFactor:this._getProgressiveLoadFactor(),screenspaceErrorBias:this._lod,angleDependentLoD:this._lod<.5}),this._clientNodeLoader=new m(this.layer.uid,{indexSR:this.crsIndex,vertexSR:this.crsVertex,renderSR:r.renderCoordsHelper.spatialReference},r.resourceController.memoryController,this.worker),this._index=new x(g(r.viewingMode),t,s,this.indexStreamController,this._clientNodeLoader,this._viewportQueries,i.getLogger(this),e.holeFilling,t=>e.isNodeLoaded(t),t=>e.isNodeReloading(t),e=>this._shouldLoadNode(e),e=>this._enableFromGPUCache(e,1),e=>this._needsUpdate(e),()=>!this.indexStreamController.busy,t=>e.computeVisibilityObb?.(t)??null,e?.computeNodeFiltering?t=>e.computeNodeFiltering(t):void 0),this._index.updateElevationInfo(this.layer.elevationInfo,this.isMeshPyramid||this.isGraphics3D),this._index.imModificationsChanged(!!e.hasModifications),this._index.layerFilterChanged(!!e.hasGeometryFilter),null!=a){for(const e of a)this._addMesh(e.mesh,e.oid);this.addHandles(a.on("change",e=>{for(const t of e.removed)this._removeMesh(t.oid);for(const t of e.added)this._addMesh(t.mesh,t.oid)}))}this._startNodeLoading()}))}updateNodeModificationStatus(e){const t=this._index,i=this.layerView;null!=t&&i?.updateNodeModificationStatus&&(this._modificationsNodeFilteringArray.clear(),e.forAll(e=>{const i=t.getNode(e);null!=i&&this._modificationsNodeFilteringArray.push(i)}),i.updateNodeModificationStatus(this._modificationsNodeFilteringArray),this._invisibleDirty=!0)}destroy(){this.cancelNodeLoading(),this._idleStateCallbacks&&(this._isIdle=!1,this._idleStateCallbacks.remove(),this._idleStateCallbacks=null),this._nodeLoader=null,j.prune(),this._newLoadingNodes.prune(),this._modificationsNodeFilteringArray.prune(),this._elevationUpdateNodes.prune(),this._index=null,this._lodHandling=s(this._lodHandling),this._nodeLoader=null,this._clientNodeLoader=null,this._viewportQueries=null,this._set("worker",null)}get viewportQueries(){return this._viewportQueries}_getRequiredAttributes(){if(null==this._attributeStorageInfo||!this._fields||!this.layerView.availableFields)return[];const e=this._attributeStorageInfo,t=this._fields,i=this.layer.objectIdField;return this.layerView.availableFields.map(i=>{const s=T(e,i),r=T(t,i);return s>=0&&r>=0?{index:s,name:t[r].name,field:t[r],attributeStorageInfo:e[s]}:null}).filter(e=>null!=e&&e.name!==i)}_requiredFieldsChange(){const e=this._getRequiredAttributes();k(this._requiredAttributes,e)||(this._requiredAttributes=e,this._requiredAttributesDirty=!1,this.restartNodeLoading())}requestUpdate(){this._requiredAttributesDirty=!0,this.restartNodeLoading()}_setClippingArea(e){const t=p();V(e,t,this.layerView.view.renderSpatialReference)?this._clippingArea=t:this._clippingArea=null}_pointOfInterestChanged(e){null!=this._viewportQueries&&(this._viewportQueries.setPointOfInterest(e),null!=this._index&&(this._index.progressiveLoadPenalty=R.distancePenalty*this._viewportQueries.distCameraToPOI(),this._index.requestUpdate()))}updateClippingArea(e){this._setClippingArea(e),null!=this._viewportQueries&&null!=this._index&&(this._viewportQueries.updateClippingArea(this._clippingArea),this._index.invalidateVisibilityCache()),this._setCameraDirty()}_setCameraDirty(){this._cameraDirty=!0,this._lodHandling.setLodGlobalDirty(),this._evaluateUpdating()}_addMesh(e,t){if(null==this._index)return;const i=this._clientNodeLoader.createMeshNodeInfo(e,t),s=this._index.addClientNodeToIndex(i.id,i.mbs);this._clientNodeLoader.addMeshNode(s,i),this._evaluateUpdating(),this.notifyChange("rootNodeVisible")}_removeMesh(e){const t=this._clientNodeLoader.getMeshNodeIndex(e);if(null!=t){if(null==this._index)throw new Error("delayed removal of client side i3s node geometry not supported yet.");{const e=(e,t)=>{this.layerView.removeNode(t),this._clientNodeLoader.removeNode(e),this.layerView.deleteCachedNodeData&&null!=e&&this.layerView.deleteCachedNodeData(e),this.layerView.deleteCachedGPUData?.(this.layerView.loadCachedGPUData?.(t))},i=(e,t,i)=>{this._clientNodeLoader.updateNodeIndex(e,t,i),this.layerView.updateNodeIndex&&this.layerView.updateNodeIndex(t,i)};this._index.removeClientNodeFromIndex(t,e,i),this.notifyChange("rootNodeVisible")}}}updateElevationChanged(e,t){const i=this._index;if(null==i?.rootNode||null==t)return null;this.crsIndex.equals(t)||(c(e,t,E,this.crsIndex),e=E);const s=this._elevationUpdateNodes;return s.clear(),C(e,i.rootNode,i,e=>s.push(e.index)),s.length&&(s.forAll(e=>i.updateElevationChanged(e)),this._setCameraDirty()),s}removeAllGeometryObbs(){null!=this._index&&this._index.removeAllGeometryObbs()}getRenderMbs(e){return null!=this._viewportQueries?this._viewportQueries.getServiceMbsInRenderSR(e):null}_elevationInfoChanged(e){null!=this._index&&(this._index.updateElevationInfo(e,this.isMeshPyramid||this.isGraphics3D),this._setCameraDirty())}restartNodeLoading(){this._restartNodeLoading=!0,this.cancelNodeLoading(),this._evaluateUpdating()}schedule(e,t){return this._idleQueue.push(e,t)}reschedule(e,t){return this._idleQueue.unshift(e,t)}get _isIntegratedMesh(){return"integrated-mesh"===this.layer.type}get unloadedMemoryEstimate(){return null!=this._index&&this.layerView.contentVisible?this._index.unloadedMemoryEstimate*this._lodDropFactor:0}async _loadNodeData(e,t){return e.index<0?this._clientNodeLoader.loadNodeData(e.id,t):this._nodeLoader.loadNodeData(e,t)}async _loadAttributes(e,t,i){return(e.index<0?this._clientNodeLoader:this._nodeLoader).loadAttributes(e,t,i)}get indexDepth(){return null!=this._index?this._index.maxLevel:0}set disableMemCache(e){this.layerView.loadCachedGPUData&&this.layerView.addCachedGPUData?this._disableMemCache=e:this._disableMemCache=!0}runTask(e,t){return this.layerView.contentVisible?this.layerView.visible&&null!=this._index?(this._processWithErrorLogging(e,t),this._index.maxPriority):-1/0:(this._updateViewData(),this._evaluateUpdating(),-1/0)}_processWithErrorLogging(e,t){try{this._process(e,t)}catch(s){this._errorCount<50?i.getLogger(this).error(`Error during processing: ${s} at ${s.stack}`):50===this._errorCount&&i.getLogger(this).error("Too many errors for this layer. Further errors will not be displayed."),this._errorCount++}}_process(e,t){this._restartNodeLoading&&this._startNodeLoading(),null!=this._nodeLoader&&null!=this._index&&(this._updateViewData(),this._invisibleDirty&&this._removeInvisibleNodes(e)&&(this._invisibleDirty=!1),this._isIntegratedMesh&&(e.enabled=!1),e.run(()=>this._processIndex(e)),this._updateFeatureLOD(),e.run(()=>this._processCache(e)),this._isIntegratedMesh&&(e.enabled=!0),e.run(()=>this._processNodes(e,t)),this._idleQueue.runTask(e),e.run(()=>this._prefetchIndex()),t.numIndexLoading+=this._index.indexLoading,t.numNodesLoading+=this._downloadingCount,e.run(()=>this._lodHandling.lodGlobalHandling(e)),this._evaluateUpdating())}_processIndex(e){if(null==this._index)return!1;if(this._index.dirty){this._newLoadingNodes.clear(),this._index.update(Array.from(this._loadingNodes.keys()),e,e=>this.updateNodeModificationStatus(e)),this._disableMemCache||(this._newLoadingNodes.pushArray(this._index.updates.add.data,this._index.updates.add.length),this._newLoadingNodes.pushArray(this._index.updates.missing.data,this._index.updates.missing.length));const t=this._index.featureEstimate.leavesReached;this._index.isLoading||t===this._get("leavesReached")||this._set("leavesReached",t)}return this._index.load()}_prefetchIndex(){return!(null==this._index||this._loadingNodes.size>0||this._index.updates.add.length>0)&&this._index.prefetch()}_updateFeatureLOD(){if(!this.useMaximumNumberOfFeatures||null==this._index||null==this._viewportQueries)return;const e=!this._index.isLoading,t=this.featureTarget*this._baseLOD,i=this._index.featureEstimate;if(i.estimate=i.estimate||t/2,this._index.indexMissing>q){if(this._featureLOD<=P)return;this._featureLOD/=G,this._stableFeatureLOD=!1}else if(e&&i.estimate<t){if(i.leavesReached||this._featureLOD>=O||this._stableFeatureLOD)return;const e=Math.min(10,Math.max(t/i.estimate,1.001));this._featureLOD*=e;const s=this._lod,r=this._index.checkFeatureTarget(t,s);r!==s&&(this._featureLOD=r/this._baseLOD,this._stableFeatureLOD=!0)}else{if(!(i.estimate>t*U||e&&i.estimate>t))return;if(this._featureLOD<=P)return;this._featureLOD/=1+.25*(i.estimate/t-1),this._stableFeatureLOD=!1}this._featureLOD=Math.min(O,Math.max(P,this._featureLOD)),this._viewportQueries.updateScreenSpaceErrorBias(this._lod),this._index.requestUpdate()}_processCache(e){const t=this._index;if(null==t)return!1;for(;this._newLoadingNodes.length>0&&!e.done;){const i=this._newLoadingNodes.pop();for(let s=t.getParent(i);null!=s&&!this.layerView.isNodeLoaded(s.index);s=t.getParent(s.index))if(this._enableFromGPUCache(s,0)){e.madeProgress();break}}return e.hasProgressed}_processNodes(e,t){if(null==this._index)return!1;let i=(this._isIdle?M:F)-this._loadingNodes.size;const s=this._index.updates;for(s.cancel.forEach(this._cancelNode,this),s.cancel=[];s.remove.length>0&&!e.done;)this.layerView.removeNode(s.remove.pop()),e.madeProgress();for(;s.update.length>0&&!e.done;){const t=this._index.getNode(s.update.pop());null!=t&&(this._updateLoadedNode(t),e.madeProgress())}for(;s.add.length>0&&!e.done&&i>0;){--i;const r=this._index.getNode(s.add.back());if(null==r||2!==r.cacheState&&!this._hasNodeLoadToken(t))break;s.add.pop(),this._loadNode(r),e.madeProgress()}return e.hasProgressed}_cancelAllNodes(){this._loadingNodes.forEach(e=>e.abort()),this._loadingNodes.clear(),this._updatingNodes.forEach(e=>e.abort()),this._updatingNodes.clear()}_cancelNode(e){const t=this._loadingNodes.get(e);t&&(t.abort(),this._loadingNodes.delete(e))}_hasNodeLoadToken(e){return!(!this._isIdle&&e.numNodesLoading+this._loadingNodes.size>=F)&&(this._downloadingCount<D&&!this.dataStreamController.busy)}_evaluateUpdating(){let e=!1,t=0;if(this.layerView){if(this.layerView.contentVisible){const i=(this._index?.indexMissing??0)+3*(this._index?.updates.add.length??0)+2*this._loadingNodes.size;e=!!(i>0||this._updatingNodes.size>0||this._restartNodeLoading||this._cameraDirty||this._idleQueue.updating||this._lodHandling&&this._lodHandling.requiresLODGlobalHandling||null!=this._index&&this._index.isPrefetching),0===i&&(this._progressMaxNumNodes=1),this._progressMaxNumNodes=Math.max(i,this._progressMaxNumNodes),t=1-i/this._progressMaxNumNodes}else e=this._cameraDirty,t=e?0:1;this.updating=e,this.updatingProgress=t}}_updateViewData(){if(!this._cameraDirty||null==this._index||null==this._viewportQueries)return;const e=this.layerView.view,{contentCamera:t,fixedContentCamera:i}=e.state;this._viewportQueries.updateCamera(t,!i||this.isGraphics3D),this._viewportQueries.setPointOfInterest(e.pointsOfInterest.focus.renderLocation),this._viewportQueries.updateScreenSpaceErrorBias(this._lod),this._index.invalidateVisibilityCache(),this._index.progressiveLoadPenalty=R.distancePenalty*this._viewportQueries.distCameraToPOI(),this._index.requestUpdate(),this._stableFeatureLOD=!1,this._invisibleDirty=!0,this._cameraDirty=!1,this.notifyChange("rootNodeVisible")}_getProgressiveLoadFactor(){return this.layerView.view.quality<1?1:this.layerView.progressiveLoadFactor}get _lod(){return this._featureLOD*this._baseLOD}get _baseLOD(){const e=this.layerView.lodFactor;return this.fixedFeatureTarget?1:(e>0?e:1)*this.layerView.view.quality}get _lodDropFactor(){if(this.fixedFeatureTarget)return 1;return(Math.min(this.layerView.view.quality,.5)-A)/(.5-A)}isGeometryVisible(e){return!!this._index?.isGeometryVisible(e.index)}updateVisibility(e){this._index?.invalidateNodeVisibilityCache(e)}invalidateGeometryVisibility(e){this._index?.invalidateGeometryVisibility(e)}invalidateVisibilityObbs(){this._index?.invalidateVisibilityObbs()}modificationsChanged(){this._index?.imModificationsChanged(!!this.layerView.hasModifications),this._invisibleDirty=!0}_shouldLoadNode(e){return!(!this._lodHandling.shouldLoadNode(e)||this._shouldDropNode(e))&&!(null==this._index||!this._index.isGeometryVisible(e.index))}_shouldDropNode(e){if(null==this._viewportQueries)return!1;const t=this._lodDropFactor;if(t>=1||!this._lodHandling.hasNoVisibleChildren(e))return!1;return Math.abs(this._viewportQueries.calcCameraDistanceToCenter(e))-this._viewportQueries.minDistance>(this._viewportQueries.maxDistance-this._viewportQueries.minDistance)*t}_startNodeLoading(){this._restartNodeLoading=!1;const e=this._index;if(this._updatesDisabled||null==e||null==this._viewportQueries)return;this._updateViewData(),this._requiredAttributesDirty&&(this._requiredAttributes=this._getRequiredAttributes(),this._requiredAttributesDirty=!1);const t={textureEncodings:this.layerView.supportedTextureEncodings,textureUsageMask:this.layerView.rendererTextureUsage,loadFeatureData:this.useMaximumNumberOfFeatures};this._nodeLoader=new N(this.layer,this.dataStreamController,i.getLogger(this),this._defaultGeometrySchema,this._requiredAttributes,t),e.requestUpdate(),this._lodHandling.startNodeLoading((e,t)=>this._removeNodes(e,t,1),e,{maxLodLevel:this._viewportQueries.maxLodLevel}),this._evaluateUpdating()}isNodeLoading(){return null!=this._nodeLoader&&null!=this._index}cancelNodeLoading(){this.isNodeLoading()&&(this.indexStreamController.cancelAll(),this.dataStreamController.cancelAll(),this._idleQueue.cancelAll(),this._cancelAllNodes(),this._nodeLoader=null,this._evaluateUpdating())}_removeInvisibleNodes(e){const t=this._index;if(null==t||null==this._viewportQueries)return!1;j.clear(),this.layerView.getLoadedNodeIndices(j);const i=0===this._viewportQueries.maxDistance,s=i?()=>!1:e=>this._shouldDropNode(e);return j.filterInPlace(e=>{const i=t.getNode(e);return null==i||!t.isGeometryVisible(e)||s(i)}),j.length>0&&this._lodHandling.setLodGlobalDirty(),this._removeNodes(j,e,0),!(i&&this._lodDropFactor<1)&&(0===j.length||(j.clear(),!1))}markNodeToRemove(e){j.push(e)}removeMarkedNodes(){this._removeNodes(j,S,0)}_removeNodes(e,t,i){if(0!==e.length&&!t.done)for(null!=this._index&&this._index.requestUpdate();e.length>0&&!t.done;){const s=e.pop(),r=this._index;1===i&&this.layerView.nodeFadeoutEnabled&&null!=r&&r.isGeometryVisible(s)?this.layerView.fadeNode(s,1,!0):this.layerView.removeNode(s),t.madeProgress()}}_needsUpdate(e){if(e.resources.isEmpty||this._updatingNodes.has(e.index))return!1;const t=this.layerView.getLoadedAttributes(e.index);return null!=t&&t!==this._requiredAttributes}async _updateLoadedNode(e){const t=new AbortController;this._updatingNodes.set(e.index,t),this._evaluateUpdating();try{const i=this.layerView.getLoadedAttributes(e.index),s=k(i,this._requiredAttributes)?this.layerView.getAttributeData(e.index):await this._loadAttributes(e,this._requiredAttributes,t.signal);await this.schedule(()=>this.layerView.updateAttributes(e.index,{loadedAttributes:this._requiredAttributes,attributeData:s},t.signal),t.signal)}catch(i){if(!d(i))return this.layerView.updateAttributes(e.index,{loadedAttributes:this._requiredAttributes,attributeData:{}},t.signal)}this._updatingNodes.delete(e.index),this._evaluateUpdating()}_loadNode(e){if(this._loadingNodes.has(e.index))return void i.getLogger(this).error("already loading node "+e.index);const t=new AbortController;this._loadingNodes.set(e.index,t),this._evaluateUpdating(),this._loadAndAddNode(e,t.signal).then(i=>{i&&null!=this._index&&this._loadingNodes.get(e.index)===t&&(this._loadingNodes.delete(e.index),this._index.requestUpdate())}).catch(e=>{if(!d(e))throw e}).finally(()=>{this._loadingNodes.get(e.index)===t&&this._loadingNodes.delete(e.index),this._evaluateUpdating()})}_loadAndAddNode(e,t){return 1===e.cacheState?this._loadUncached(e,t).then(()=>!1):this._loadCached(e,t).then(t=>!t&&(e.cacheState=1,!0)).catch(t=>!d(t)&&(e.cacheState=1,!0))}_enableFromGPUCache(e,t){if(this._disableMemCache||null==this._index)return!1;if(0===t&&!this._index.useNodeAsHole(e.index))return!0;const i=this._loadCachedGPUData(e);return!!i&&(this.layerView.addCachedGPUData(e,i,t),this._nodeAdded(),!0)}_loadCachedGPUData(e){const t=this.layerView.loadCachedGPUData(e.index);return null!=t?.attributeInfo&&k(t.attributeInfo.loadedAttributes,this._requiredAttributes)?t:(this.layerView.deleteCachedGPUData(t),null)}_nodeAdded(){null!=this._index&&this._index.requestUpdate(),this._lodHandling.setLodGlobalDirty(),this._evaluateUpdating()}updateLoadStatus(e,t){const i=this._index;null!=i&&i.updateChildrenLoaded(e,t?1:-1)}async _loadCached(e,t){if(this._enableFromGPUCache(e,1))return!0;const i=this.layerView;if(this.disableIDBCache||!i.loadCachedNodeData||!i.addCachedNodeData)return!1;const s=(t,i)=>this._nodeLoader.loadTextures(e,t,i),r=(t,i)=>this._clientNodeLoader.loadTextures(e,t,i),a=e.index>=0?s:r,d=await this.schedule(()=>i.loadCachedNodeData(e,t,a),t);if(null==d)return!1;const o=this._requiredAttributes,n=await this.reschedule(()=>this._loadAttributes(e,o,t),t);return await this.reschedule(()=>i.addCachedNodeData(e,d,{loadedAttributes:o,attributeData:n},t),t),this._nodeAdded(),!0}_loadUncached(e,t){return this._downloadingCount++,this._loadNodeData(e,t).catch(e=>{throw this._downloadingCount--,e}).then(i=>(this._downloadingCount--,this.schedule(()=>this.layerView.addNode(e,i,t),t))).then(()=>{this._nodeAdded(),e.cacheState=2}).catch(t=>{if(!d(t))throw i.getLogger(this).error("#loadNodeData()",this.layer,`Failed to load node '${e.id}'`,t),e.failed=!0,null!=this._index&&this._index.requestUpdate(),t})}_updateIdleState(e){e!==this._isIdle&&(this._isIdle=e,this._evaluateUpdating(),e&&this._index&&null!=this._index&&this._index.resetFailedNodes())}get test(){}notifyLODUpdate(){this._lodHandling.setLodGlobalDirty(),this._evaluateUpdating(),null!=this._index&&this._index.requestUpdate()}geometryFilterChanged(e){const t=this._index;null!=t&&t.layerFilterChanged(e),this._setCameraDirty()}};e([h({readOnly:!0})],Q.prototype,"isMeshPyramid",null),e([h({readOnly:!0})],Q.prototype,"isGraphics3D",null),e([h({readOnly:!0})],Q.prototype,"useMaximumNumberOfFeatures",null),e([h({readOnly:!0})],Q.prototype,"indexStreamController",null),e([h({readOnly:!0})],Q.prototype,"dataStreamController",null),e([h({readOnly:!0})],Q.prototype,"crsVertex",null),e([h({readOnly:!0})],Q.prototype,"crsIndex",null),e([h()],Q.prototype,"featureTarget",void 0),e([h()],Q.prototype,"fixedFeatureTarget",void 0),e([h()],Q.prototype,"layerView",void 0),e([h()],Q.prototype,"layer",null),e([h()],Q.prototype,"updating",void 0),e([h({readOnly:!0})],Q.prototype,"running",null),e([h()],Q.prototype,"updatingProgress",void 0),e([h({readOnly:!0})],Q.prototype,"leavesReached",void 0),e([h({constructOnly:!0})],Q.prototype,"worker",void 0),e([h({readOnly:!0,dependsOn:[]})],Q.prototype,"rootNodeVisible",null),Q=e([u("esri.layers.graphics.controllers.I3SOnDemandController")],Q);const j=new r({deallocator:null});function k(e,t){return null!=e&&e.length===t.length&&e.every(e=>T(t,e.name)>=0)}function T(e,t){const i=t.toLowerCase();for(let s=0;s<e.length;s++)if(e[s].name.toLowerCase()===i)return s;return-1}const R={distancePenalty:10},E=p();export{Q as default};
|
|
5
|
+
import{__decorate as e}from"tslib";import t from"../../../core/Accessor.js";import has from"../../../core/has.js";import i from"../../../core/Logger.js";import{destroyMaybe as s}from"../../../core/maybe.js";import r from"../../../core/PooledArray.js";import{EsriPromiseMixin as a}from"../../../core/Promise.js";import{isAbortError as d}from"../../../core/promiseUtils.js";import{watch as n,sync as o,initial as l}from"../../../core/reactiveUtils.js";import{property as h}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/RandomLCG.js";import{subclass as u}from"../../../core/accessorSupport/decorators/subclass.js";import{q as _}from"../../../chunks/vec32.js";import{UpdatingHandles as c}from"../../../core/support/UpdatingHandles.js";import{projectBoundingRect as p}from"../../../geometry/projection/projectBoundingRect.js";import{create as g}from"../../../geometry/support/aaBoundingRect.js";import{viewingModeFromString as m}from"../../../views/ViewingMode.js";import{I3SClientNodeLoader as y}from"../../../views/3d/layers/i3s/I3SClientNodeLoader.js";import{addCallback as f}from"../../../views/3d/layers/i3s/I3SFrameTask.js";import{I3SIndex as x}from"../../../views/3d/layers/i3s/I3SIndex.js";import b from"../../../views/3d/layers/i3s/I3SLodHandling.js";import N from"../../../views/3d/layers/i3s/I3SNodeLoader.js";import{I3SStreamDataController as w}from"../../../views/3d/layers/i3s/I3SStreamDataController.js";import{getVertexCrs as v,getIndexCrs as C,findIntersectingNodes as L}from"../../../views/3d/layers/i3s/I3SUtil.js";import D from"../../../views/3d/layers/i3s/I3SViewportQueries.js";import{maxDownloadSlots as V}from"../../../views/3d/support/downloadSlots.js";import{toBoundingRect as A}from"../../../views/3d/support/extentUtils.js";import{minQuality as I}from"../../../views/3d/support/MemoryController.js";import{PromiseQueue as S}from"../../../views/support/PromiseQueue.js";import{noBudget as M}from"../../../views/support/Scheduler.js";const F=100,P=2,O=1e4,q=1e-4,R=1.2,G=500,U=1.5;let H=class extends(a(t)){get isMeshPyramid(){return"mesh-pyramids"===this.layer.profile||"MeshPyramid"===this.layer.store?.lodType}get isGraphics3D(){return"points"===this.layer.profile}get useMaximumNumberOfFeatures(){return!this.isMeshPyramid&&(null==this.layer.priority||"High"===this.layer.priority)}get indexStreamController(){const e=this.layerView.view.resourceController.createStreamDataRequester(2);return new w(e,this.layer.customParameters,this.layer.apiKey)}get dataStreamController(){const e=this.layerView.view.resourceController.createStreamDataRequester(3);return new w(e,this.layer.customParameters,this.layer.apiKey)}get crsVertex(){return v(this.layer)}get crsIndex(){return C(this.layer)}get layer(){return this.layerView.i3slayer}get updating(){return this.running||this._updatingHandles.updating}get rootNodeVisible(){if(this._index){const e=this._index.rootNode;if(e)return this._updateViewData(),this._index.isNodeVisible(e.index)}return!0}get index(){return this._index}get requiredAttributes(){return this._requiredAttributes}constructor(e){super(e),this.featureTarget=5e4,this.fixedFeatureTarget=!1,this._updatingHandles=new c,this.running=!0,this.updatingProgress=1,this.leavesReached=!1,this.worker=null,this._featureLOD=1,this._stableFeatureLOD=!1,this._isIdle=!1,this._cameraDirty=!0,this._invisibleDirty=!1,this._idleStateCallbacks=null,this._newLoadingNodes=new r({deallocator:null}),this._modificationsNodeFilteringArray=new r,this._downloadingCount=0,this._loadingNodes=new Map,this._updatingNodes=new Map,this._progressMaxNumNodes=1,this._requiredAttributes=new Array,this._requiredAttributesDirty=!0,this._updatesDisabled=!1,this.disableIDBCache=!1,this._disableMemCache=!1,this._restartNodeLoading=!1,this._fields=null,this._attributeStorageInfo=null,this._idleQueue=new S,this._elevationUpdateNodes=new r({deallocator:null}),this._errorCount=0}initialize(){const{layerView:e,layer:t}=this;this._disableMemCache=!e.loadCachedGPUData||!e.addCachedGPUData,this._lodHandling=new b(e),this._defaultGeometrySchema=t.store.defaultGeometrySchema,this.disableIDBCache=!!has("disable-feature:idb-cache"),"fields"in t&&(this._fields=t.fields,this._attributeStorageInfo=t.attributeStorageInfo),this.addResolvingPromise(Promise.all([t.indexInfo,t.when(),e.when()]).then(([s])=>{if(this.destroyed||!e||e.destroyed||!s)return;const{view:r,clientGeometry:a}=e,{resourceController:d}=r;if(this._setClippingArea(r.clippingArea),this.addHandles([this._updatingHandles.add(()=>r?.pointsOfInterest?.focus?.renderLocation,e=>this._pointOfInterestChanged(e),{initial:!0,equals:_}),n(()=>r.quality,()=>this._setCameraDirty(),o),this._updatingHandles.add(()=>e.contentVisible,e=>{const t=e?()=>this._updateIdleState(!0):()=>this._updateViewData(),i=e?()=>this._updateIdleState(!1):()=>{};e&&null!=this._index&&this._index.invalidateAllElevationRanges(),this._idleStateCallbacks?(e||this.cancelNodeLoading(),this.restartNodeLoading(),this._idleStateCallbacks.idleBegin=t,this._idleStateCallbacks.idleEnd=i):this._idleStateCallbacks=d.scheduler.registerIdleStateCallbacks(t,i)},l),f(e.view.resourceController.scheduler,this),this._updatingHandles.add(()=>[this.featureTarget,this.fixedFeatureTarget],()=>{this._setCameraDirty(),this._stableFeatureLOD=!1}),this._updatingHandles.add(()=>r.state?.contentCamera,()=>this._setCameraDirty()),this._updatingHandles.add(()=>t.elevationInfo,e=>this._elevationInfoChanged(e)),this._updatingHandles.add(()=>e.lodFactor,()=>this._setCameraDirty()),this._updatingHandles.add(()=>e.availableFields,()=>this._requiredFieldsChange()),this._updatingHandles.add(()=>e.availableFields,()=>console.log("available fields changed",(new Error).stack),{sync:!0}),this._updatingHandles.add(()=>e.holeFilling,e=>null!=this._index&&(this._index.holeFilling=e))]),this._viewportQueries=new D(this.crsIndex,r.renderCoordsHelper,r.state.contentCamera,!r.state.fixedContentCamera||this.isGraphics3D,this._clippingArea,this.isMeshPyramid?r.basemapTerrain:r.elevationProvider,m(r.viewingMode),this.layer.elevationInfo,{progressiveLoadFactor:this._getProgressiveLoadFactor(),screenspaceErrorBias:this._lod,angleDependentLoD:this._lod<.5}),this._clientNodeLoader=new y(this.layer.uid,{indexSR:this.crsIndex,vertexSR:this.crsVertex,renderSR:r.renderCoordsHelper.spatialReference},r.resourceController.memoryController,this.worker),this._index=new x(m(r.viewingMode),t,s,this.indexStreamController,this._clientNodeLoader,this._viewportQueries,i.getLogger(this),e.holeFilling,t=>e.isNodeLoaded(t),t=>e.isNodeReloading(t),e=>this._shouldLoadNode(e),e=>this._enableFromGPUCache(e,1),e=>this._needsUpdate(e),()=>!this.indexStreamController.busy,t=>e.computeVisibilityObb?.(t)??null,e?.computeNodeFiltering?t=>e.computeNodeFiltering(t):void 0),this._index.updateElevationInfo(this.layer.elevationInfo,this.isMeshPyramid||this.isGraphics3D),this._index.imModificationsChanged(!!e.hasModifications),this._index.layerFilterChanged(!!e.hasGeometryFilter),null!=a){for(const e of a)this._addMesh(e.mesh,e.oid);this.addHandles(a.on("change",e=>{for(const t of e.removed)this._removeMesh(t.oid);for(const t of e.added)this._addMesh(t.mesh,t.oid)}))}this._startNodeLoading()}))}updateNodeModificationStatus(e){const t=this._index,i=this.layerView;null!=t&&i?.updateNodeModificationStatus&&(this._modificationsNodeFilteringArray.clear(),e.forAll(e=>{const i=t.getNode(e);null!=i&&this._modificationsNodeFilteringArray.push(i)}),i.updateNodeModificationStatus(this._modificationsNodeFilteringArray),this._invisibleDirty=!0)}destroy(){this.cancelNodeLoading(),this._idleStateCallbacks&&(this._isIdle=!1,this._idleStateCallbacks.remove(),this._idleStateCallbacks=null),this._updatingHandles.destroy(),this._nodeLoader=null,Q.prune(),this._newLoadingNodes.prune(),this._modificationsNodeFilteringArray.prune(),this._elevationUpdateNodes.prune(),this._index=null,this._lodHandling=s(this._lodHandling),this._nodeLoader=null,this._clientNodeLoader=null,this._viewportQueries=null,this._set("worker",null)}get viewportQueries(){return this._viewportQueries}_getRequiredAttributes(){if(null==this._attributeStorageInfo||!this._fields||!this.layerView.availableFields)return[];const e=this._attributeStorageInfo,t=this._fields,i=this.layer.objectIdField;return this.layerView.availableFields.map(i=>{const s=k(e,i),r=k(t,i);return s>=0&&r>=0?{index:s,name:t[r].name,field:t[r],attributeStorageInfo:e[s]}:null}).filter(e=>null!=e&&e.name!==i)}_requiredFieldsChange(){const e=this._getRequiredAttributes();j(this._requiredAttributes,e)||(this._requiredAttributes=e,this._requiredAttributesDirty=!1,this.restartNodeLoading())}requestUpdate(){this._requiredAttributesDirty=!0,this.restartNodeLoading()}_setClippingArea(e){const t=g();A(e,t,this.layerView.view.renderSpatialReference)?this._clippingArea=t:this._clippingArea=null}_pointOfInterestChanged(e){null!=this._viewportQueries&&(this._viewportQueries.setPointOfInterest(e),null!=this._index&&(this._index.progressiveLoadPenalty=T.distancePenalty*this._viewportQueries.distCameraToPOI(),this._index.requestUpdate()))}updateClippingArea(e){this._setClippingArea(e),null!=this._viewportQueries&&null!=this._index&&(this._viewportQueries.updateClippingArea(this._clippingArea),this._index.invalidateVisibilityCache()),this._setCameraDirty()}_setCameraDirty(){this._cameraDirty=!0,this._lodHandling.setLodGlobalDirty(),this._evaluateRunning()}_addMesh(e,t){if(null==this._index)return;const i=this._clientNodeLoader.createMeshNodeInfo(e,t),s=this._index.addClientNodeToIndex(i.id,i.mbs);this._clientNodeLoader.addMeshNode(s,i),this._evaluateRunning(),this.notifyChange("rootNodeVisible")}_removeMesh(e){const t=this._clientNodeLoader.getMeshNodeIndex(e);if(null!=t){if(null==this._index)throw new Error("delayed removal of client side i3s node geometry not supported yet.");{const e=(e,t)=>{this.layerView.removeNode(t),this._clientNodeLoader.removeNode(e),this.layerView.deleteCachedNodeData&&null!=e&&this.layerView.deleteCachedNodeData(e),this.layerView.deleteCachedGPUData?.(this.layerView.loadCachedGPUData?.(t))},i=(e,t,i)=>{this._clientNodeLoader.updateNodeIndex(e,t,i),this.layerView.updateNodeIndex&&this.layerView.updateNodeIndex(t,i)};this._index.removeClientNodeFromIndex(t,e,i),this.notifyChange("rootNodeVisible")}}}updateElevationChanged(e,t){const i=this._index;if(null==i?.rootNode||null==t)return null;this.crsIndex.equals(t)||(p(e,t,E,this.crsIndex),e=E);const s=this._elevationUpdateNodes;return s.clear(),L(e,i.rootNode,i,e=>s.push(e.index)),s.length&&(s.forAll(e=>i.updateElevationChanged(e)),this._setCameraDirty()),s}removeAllGeometryObbs(){null!=this._index&&this._index.removeAllGeometryObbs()}getRenderMbs(e){return null!=this._viewportQueries?this._viewportQueries.getServiceMbsInRenderSR(e):null}_elevationInfoChanged(e){null!=this._index&&(this._index.updateElevationInfo(e,this.isMeshPyramid||this.isGraphics3D),this._setCameraDirty())}restartNodeLoading(){this._restartNodeLoading=!0,this.cancelNodeLoading(),this._evaluateRunning()}schedule(e,t){const i=this._idleQueue.push(e,t);return this._evaluateRunning(),i}reschedule(e,t){const i=this._idleQueue.unshift(e,t);return this._evaluateRunning(),i}get _isIntegratedMesh(){return"integrated-mesh"===this.layer.type}get unloadedMemoryEstimate(){return null!=this._index&&this.layerView.contentVisible?this._index.unloadedMemoryEstimate*this._lodDropFactor:0}async _loadNodeData(e,t){return e.index<0?this._clientNodeLoader.loadNodeData(e.id,t):this._nodeLoader.loadNodeData(e,t)}async _loadAttributes(e,t,i){return(e.index<0?this._clientNodeLoader:this._nodeLoader).loadAttributes(e,t,i)}get indexDepth(){return null!=this._index?this._index.maxLevel:0}set disableMemCache(e){this.layerView.loadCachedGPUData&&this.layerView.addCachedGPUData?this._disableMemCache=e:this._disableMemCache=!0}runTask(e,t){return this.layerView.contentVisible?this.layerView.visible&&null!=this._index?(this._processWithErrorLogging(e,t),this._index.maxPriority):-1/0:(this._updateViewData(),this._evaluateRunning(),-1/0)}_processWithErrorLogging(e,t){try{this._process(e,t)}catch(s){this._errorCount<50?i.getLogger(this).error(`Error during processing: ${s} at ${s.stack}`):50===this._errorCount&&i.getLogger(this).error("Too many errors for this layer. Further errors will not be displayed."),this._errorCount++}}_process(e,t){this._restartNodeLoading&&this._startNodeLoading(),null!=this._nodeLoader&&null!=this._index&&(this._updateViewData(),this._invisibleDirty&&this._removeInvisibleNodes(e)&&(this._invisibleDirty=!1),this._isIntegratedMesh&&(e.enabled=!1),e.run(()=>this._processIndex(e)),this._updateFeatureLOD(),e.run(()=>this._processCache(e)),this._isIntegratedMesh&&(e.enabled=!0),e.run(()=>this._processNodes(e,t)),this._idleQueue.runTask(e),e.run(()=>this._prefetchIndex()),t.numIndexLoading+=this._index.indexLoading,t.numNodesLoading+=this._downloadingCount,e.run(()=>this._lodHandling.lodGlobalHandling(e)),this._evaluateRunning())}_processIndex(e){if(null==this._index)return!1;if(this._index.dirty){this._newLoadingNodes.clear(),this._index.update(Array.from(this._loadingNodes.keys()),e,e=>this.updateNodeModificationStatus(e)),this._disableMemCache||(this._newLoadingNodes.pushArray(this._index.updates.add.data,this._index.updates.add.length),this._newLoadingNodes.pushArray(this._index.updates.missing.data,this._index.updates.missing.length));const t=this._index.featureEstimate.leavesReached;this._index.isLoading||t===this._get("leavesReached")||this._set("leavesReached",t)}return this._index.load()}_prefetchIndex(){return!(null==this._index||this._loadingNodes.size>0||this._index.updates.add.length>0)&&this._index.prefetch()}_updateFeatureLOD(){if(!this.useMaximumNumberOfFeatures||null==this._index||null==this._viewportQueries)return;const e=!this._index.isLoading,t=this.featureTarget*this._baseLOD,i=this._index.featureEstimate;if(i.estimate=i.estimate||t/2,this._index.indexMissing>G){if(this._featureLOD<=q)return;this._featureLOD/=U,this._stableFeatureLOD=!1}else if(e&&i.estimate<t){if(i.leavesReached||this._featureLOD>=O||this._stableFeatureLOD)return;const e=Math.min(10,Math.max(t/i.estimate,1.001));this._featureLOD*=e;const s=this._lod,r=this._index.checkFeatureTarget(t,s);r!==s&&(this._featureLOD=r/this._baseLOD,this._stableFeatureLOD=!0)}else{if(!(i.estimate>t*R||e&&i.estimate>t))return;if(this._featureLOD<=q)return;this._featureLOD/=1+.25*(i.estimate/t-1),this._stableFeatureLOD=!1}this._featureLOD=Math.min(O,Math.max(q,this._featureLOD)),this._viewportQueries.updateScreenSpaceErrorBias(this._lod),this._index.requestUpdate()}_processCache(e){const t=this._index;if(null==t)return!1;for(;this._newLoadingNodes.length>0&&!e.done;){const i=this._newLoadingNodes.pop();for(let s=t.getParent(i);null!=s&&!this.layerView.isNodeLoaded(s.index);s=t.getParent(s.index))if(this._enableFromGPUCache(s,0)){e.madeProgress();break}}return e.hasProgressed}_processNodes(e,t){if(null==this._index)return!1;let i=(this._isIdle?F:P)-this._loadingNodes.size;const s=this._index.updates;for(s.cancel.forEach(this._cancelNode,this),s.cancel=[];s.remove.length>0&&!e.done;)this.layerView.removeNode(s.remove.pop()),e.madeProgress();for(;s.update.length>0&&!e.done;){const t=this._index.getNode(s.update.pop());null!=t&&(this._updateLoadedNode(t),e.madeProgress())}for(;s.add.length>0&&!e.done&&i>0;){--i;const r=this._index.getNode(s.add.back());if(null==r||2!==r.cacheState&&!this._hasNodeLoadToken(t))break;s.add.pop(),this._loadNode(r),e.madeProgress()}return e.hasProgressed}_cancelAllNodes(){this._loadingNodes.forEach(e=>e.abort()),this._loadingNodes.clear(),this._updatingNodes.forEach(e=>e.abort()),this._updatingNodes.clear()}_cancelNode(e){const t=this._loadingNodes.get(e);t&&(t.abort(),this._loadingNodes.delete(e))}_hasNodeLoadToken(e){return!(!this._isIdle&&e.numNodesLoading+this._loadingNodes.size>=P)&&(this._downloadingCount<V&&!this.dataStreamController.busy)}_evaluateRunning(){let e=!1,t=0;if(this.layerView){if(this.layerView.contentVisible){const i=(this._index?.indexMissing??0)+3*(this._index?.updates.add.length??0)+2*this._loadingNodes.size;e=!!(i>0||this._updatingNodes.size>0||this._restartNodeLoading||this._cameraDirty||this._idleQueue.updating||this._lodHandling&&this._lodHandling.requiresLODGlobalHandling||null!=this._index&&this._index.isPrefetching),0===i&&(this._progressMaxNumNodes=1),this._progressMaxNumNodes=Math.max(i,this._progressMaxNumNodes),t=1-i/this._progressMaxNumNodes}else e=this._cameraDirty,t=e?0:1;this.running=e,this.updatingProgress=t}}_updateViewData(){if(!this._cameraDirty||null==this._index||null==this._viewportQueries)return;const e=this.layerView.view,{contentCamera:t,fixedContentCamera:i}=e.state;this._viewportQueries.updateCamera(t,!i||this.isGraphics3D),this._viewportQueries.setPointOfInterest(e.pointsOfInterest.focus.renderLocation),this._viewportQueries.updateScreenSpaceErrorBias(this._lod),this._index.invalidateVisibilityCache(),this._index.progressiveLoadPenalty=T.distancePenalty*this._viewportQueries.distCameraToPOI(),this._index.requestUpdate(),this._stableFeatureLOD=!1,this._invisibleDirty=!0,this._cameraDirty=!1,this.notifyChange("rootNodeVisible")}_getProgressiveLoadFactor(){return this.layerView.view.quality<1?1:this.layerView.progressiveLoadFactor}get _lod(){return this._featureLOD*this._baseLOD}get _baseLOD(){const e=this.layerView.lodFactor;return this.fixedFeatureTarget?1:(e>0?e:1)*this.layerView.view.quality}get _lodDropFactor(){if(this.fixedFeatureTarget)return 1;return(Math.min(this.layerView.view.quality,.5)-I)/(.5-I)}isGeometryVisible(e){return!!this._index?.isGeometryVisible(e.index)}updateVisibility(e){this._index?.invalidateNodeVisibilityCache(e)}invalidateGeometryVisibility(e){this._index?.invalidateGeometryVisibility(e)}invalidateVisibilityObbs(){this._index?.invalidateVisibilityObbs()}modificationsChanged(){this._index?.imModificationsChanged(!!this.layerView.hasModifications),this._invisibleDirty=!0}_shouldLoadNode(e){return!(!this._lodHandling.shouldLoadNode(e)||this._shouldDropNode(e))&&!(null==this._index||!this._index.isGeometryVisible(e.index))}_shouldDropNode(e){if(null==this._viewportQueries)return!1;const t=this._lodDropFactor;if(t>=1||!this._lodHandling.hasNoVisibleChildren(e))return!1;return Math.abs(this._viewportQueries.calcCameraDistanceToCenter(e))-this._viewportQueries.minDistance>(this._viewportQueries.maxDistance-this._viewportQueries.minDistance)*t}_startNodeLoading(){this._restartNodeLoading=!1;const e=this._index;if(this._updatesDisabled||null==e||null==this._viewportQueries)return;this._updateViewData(),this._requiredAttributesDirty&&(this._requiredAttributes=this._getRequiredAttributes(),this._requiredAttributesDirty=!1);const t={textureEncodings:this.layerView.supportedTextureEncodings,textureUsageMask:this.layerView.rendererTextureUsage,loadFeatureData:this.useMaximumNumberOfFeatures};this._nodeLoader=new N(this.layer,this.dataStreamController,i.getLogger(this),this._defaultGeometrySchema,this._requiredAttributes,t),e.requestUpdate(),this._lodHandling.startNodeLoading((e,t)=>this._removeNodes(e,t,1),e,{maxLodLevel:this._viewportQueries.maxLodLevel}),this._evaluateRunning()}isNodeLoading(){return null!=this._nodeLoader&&null!=this._index}cancelNodeLoading(){this.isNodeLoading()&&(this.indexStreamController.cancelAll(),this.dataStreamController.cancelAll(),this._idleQueue.cancelAll(),this._cancelAllNodes(),this._nodeLoader=null,this._evaluateRunning())}_removeInvisibleNodes(e){const t=this._index;if(null==t||null==this._viewportQueries)return!1;Q.clear(),this.layerView.getLoadedNodeIndices(Q);const i=0===this._viewportQueries.maxDistance,s=i?()=>!1:e=>this._shouldDropNode(e);return Q.filterInPlace(e=>{const i=t.getNode(e);return null==i||!t.isGeometryVisible(e)||s(i)}),Q.length>0&&this._lodHandling.setLodGlobalDirty(),this._removeNodes(Q,e,0),!(i&&this._lodDropFactor<1)&&(0===Q.length||(Q.clear(),!1))}markNodeToRemove(e){Q.push(e)}removeMarkedNodes(){this._removeNodes(Q,M,0)}_removeNodes(e,t,i){if(0!==e.length&&!t.done)for(null!=this._index&&this._index.requestUpdate();e.length>0&&!t.done;){const s=e.pop(),r=this._index;1===i&&this.layerView.nodeFadeoutEnabled&&null!=r&&r.isGeometryVisible(s)?this.layerView.fadeNode(s,1,!0):this.layerView.removeNode(s),t.madeProgress()}}_needsUpdate(e){if(e.resources.isEmpty||this._updatingNodes.has(e.index))return!1;const t=this.layerView.getLoadedAttributes(e.index);return null!=t&&t!==this._requiredAttributes}async _updateLoadedNode(e){const t=new AbortController;this._updatingNodes.set(e.index,t),this._evaluateRunning();try{const i=this.layerView.getLoadedAttributes(e.index),s=j(i,this._requiredAttributes)?this.layerView.getAttributeData(e.index):await this._loadAttributes(e,this._requiredAttributes,t.signal);await this.schedule(()=>this.layerView.updateAttributes(e.index,{loadedAttributes:this._requiredAttributes,attributeData:s},t.signal),t.signal)}catch(i){if(!d(i))return this.layerView.updateAttributes(e.index,{loadedAttributes:this._requiredAttributes,attributeData:{}},t.signal)}this._updatingNodes.delete(e.index),this._evaluateRunning()}_loadNode(e){if(this._loadingNodes.has(e.index))return void i.getLogger(this).error("already loading node "+e.index);const t=new AbortController;this._loadingNodes.set(e.index,t),this._evaluateRunning(),this._loadAndAddNode(e,t.signal).then(i=>{i&&null!=this._index&&this._loadingNodes.get(e.index)===t&&(this._loadingNodes.delete(e.index),this._index.requestUpdate())}).catch(e=>{if(!d(e))throw e}).finally(()=>{this._loadingNodes.get(e.index)===t&&this._loadingNodes.delete(e.index),this._evaluateRunning()})}_loadAndAddNode(e,t){return 1===e.cacheState?this._loadUncached(e,t).then(()=>!1):this._loadCached(e,t).then(t=>!t&&(e.cacheState=1,!0)).catch(t=>!d(t)&&(e.cacheState=1,!0))}_enableFromGPUCache(e,t){if(this._disableMemCache||null==this._index)return!1;if(0===t&&!this._index.useNodeAsHole(e.index))return!0;const i=this._loadCachedGPUData(e);return!!i&&(this.layerView.addCachedGPUData(e,i,t),this._nodeAdded(),!0)}_loadCachedGPUData(e){const t=this.layerView.loadCachedGPUData(e.index);return null!=t?.attributeInfo&&j(t.attributeInfo.loadedAttributes,this._requiredAttributes)?t:(this.layerView.deleteCachedGPUData(t),null)}_nodeAdded(){null!=this._index&&this._index.requestUpdate(),this._lodHandling.setLodGlobalDirty(),this._evaluateRunning()}updateLoadStatus(e,t){const i=this._index;null!=i&&i.updateChildrenLoaded(e,t?1:-1)}async _loadCached(e,t){if(this._enableFromGPUCache(e,1))return!0;const i=this.layerView;if(this.disableIDBCache||!i.loadCachedNodeData||!i.addCachedNodeData)return!1;const s=(t,i)=>this._nodeLoader.loadTextures(e,t,i),r=(t,i)=>this._clientNodeLoader.loadTextures(e,t,i),a=e.index>=0?s:r,d=await this.schedule(()=>i.loadCachedNodeData(e,t,a),t);if(null==d)return!1;const n=this._requiredAttributes,o=await this.reschedule(()=>this._loadAttributes(e,n,t),t);return await this.reschedule(()=>i.addCachedNodeData(e,d,{loadedAttributes:n,attributeData:o},t),t),this._nodeAdded(),!0}_loadUncached(e,t){return this._downloadingCount++,this._loadNodeData(e,t).catch(e=>{throw this._downloadingCount--,e}).then(i=>(this._downloadingCount--,this.schedule(()=>this.layerView.addNode(e,i,t),t))).then(()=>{this._nodeAdded(),e.cacheState=2}).catch(t=>{if(!d(t))throw i.getLogger(this).error("#loadNodeData()",this.layer,`Failed to load node '${e.id}'`,t),e.failed=!0,null!=this._index&&this._index.requestUpdate(),t})}_updateIdleState(e){e!==this._isIdle&&(this._isIdle=e,this._evaluateRunning(),e&&this._index&&null!=this._index&&this._index.resetFailedNodes())}get test(){}notifyLODUpdate(){this._lodHandling.setLodGlobalDirty(),this._evaluateRunning(),null!=this._index&&this._index.requestUpdate()}geometryFilterChanged(e){const t=this._index;null!=t&&t.layerFilterChanged(e),this._setCameraDirty()}};e([h({readOnly:!0})],H.prototype,"isMeshPyramid",null),e([h({readOnly:!0})],H.prototype,"isGraphics3D",null),e([h({readOnly:!0})],H.prototype,"useMaximumNumberOfFeatures",null),e([h({readOnly:!0})],H.prototype,"indexStreamController",null),e([h({readOnly:!0})],H.prototype,"dataStreamController",null),e([h({readOnly:!0})],H.prototype,"crsVertex",null),e([h({readOnly:!0})],H.prototype,"crsIndex",null),e([h()],H.prototype,"featureTarget",void 0),e([h()],H.prototype,"fixedFeatureTarget",void 0),e([h()],H.prototype,"layerView",void 0),e([h()],H.prototype,"layer",null),e([h()],H.prototype,"_updatingHandles",void 0),e([h()],H.prototype,"updating",null),e([h()],H.prototype,"running",void 0),e([h()],H.prototype,"updatingProgress",void 0),e([h({readOnly:!0})],H.prototype,"leavesReached",void 0),e([h({constructOnly:!0})],H.prototype,"worker",void 0),e([h({readOnly:!0,dependsOn:[]})],H.prototype,"rootNodeVisible",null),H=e([u("esri.layers.graphics.controllers.I3SOnDemandController")],H);const Q=new r({deallocator:null});function j(e,t){return null!=e&&e.length===t.length&&e.every(e=>k(t,e.name)>=0)}function k(e,t){const i=t.toLowerCase();for(let s=0;s<e.length;s++)if(e[s].name.toLowerCase()===i)return s;return-1}const T={distancePenalty:10},E=g();export{H 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"../../../config.js";import r from"../../../request.js";import{isSome as s,remove as a}from"../../../core/arrayUtils.js";import i from"../../../core/Error.js";import has from"../../../core/has.js";import{JSONMap as n}from"../../../core/jsonMap.js";import{Loadable as o}from"../../../core/Loadable.js";import u from"../../../core/Logger.js";import{setDeepValue as l}from"../../../core/object.js";import{debounce as c,after as d,throwIfAbortError as p}from"../../../core/promiseUtils.js";import{watch as y}from"../../../core/reactiveUtils.js";import{join as h}from"../../../core/urlUtils.js";import{generateBracedUUID as m}from"../../../core/uuid.js";import{property as f}from"../../../core/accessorSupport/decorators/property.js";import{subclass as g}from"../../../core/accessorSupport/decorators/subclass.js";import w from"../../../geometry/Extent.js";import q from"../../../geometry/SpatialReference.js";import S from"../../../geometry/support/MeshGeoreferencedVertexSpace.js";import{isRelativeVertexSpace as E}from"../../../geometry/support/meshVertexSpaceUtils.js";import{isOriginalExternal as O}from"../../../geometry/support/meshUtils/External.js";import{createFeatureEditResult as _,getFeatureJSON as b,getFeatureIds as R,getAttachmentEditsJSON as A,isProtectedOrPrivateVersionError as F,unpackEditResultData as I,createEditedFeatures as x}from"../applyEditsUtils.js";import{createDrawingInfo as v}from"./support/clientSideDefaults.js";import j from"./support/QueryTask.js";import{isHostedAgolService as T}from"../../support/arcgisLayerUrl.js";import{ensureLayerCredential as M}from"../../support/featureLayerUtils.js";import{getAssetMapTable as N}from"../../support/infoFor3D.js";import{executeQueryJSON as U}from"../../../rest/query/executeQueryJSON.js";import{unapplyEditsZUnitScaling as J}from"../../../rest/query/operations/editsZScale.js";import D from"../../../rest/support/Query.js";import{T as k}from"../../../chunks/TimeExtent.js";import{isSafeToEditVersion as C,isVersionInEditSession as L,isHistoricVersion as Q,currentSessionId as P}from"../../../versionManagement/support/versionManagementUtils.js";const V=new n({originalAndCurrentFeatures:"original-and-current-features",none:"none"}),$=new n({Started:"published",Publishing:"publishing",Stopped:"unavailable"});let G=class extends o{constructor(e){super(e),this.type="feature-layer",this.supportedSourceTypes=new Set(["Feature Layer","Oriented Imagery Layer","Table","Catalog Layer"]),this.refresh=c(async()=>{await this.load();const e=this.sourceJSON.editingInfo?.lastEditDate;if(null==e)return{dataChanged:!0,updates:{}};try{await this._fetchService(null)}catch{return{dataChanged:!0,updates:{}}}const t=e!==this.sourceJSON.editingInfo?.lastEditDate;return{dataChanged:t,updates:t?{editingInfo:this.sourceJSON.editingInfo,extent:this.sourceJSON.extent}:null}}),this._ongoingAssetUploads=new Map}load(e){const t=this.layer.sourceJSON,r=this._fetchService(t,{...e}).then(()=>this.layer.setUserPrivileges(this.sourceJSON.serviceItemId,e)).then(()=>this._ensureLatestMetadata(e));return this.addResolvingPromise(r),Promise.resolve(this)}initialize(){this.addHandles([y(()=>{const e=this.layer;return e&&"lastEditsEventDate"in e?e.lastEditsEventDate:null},e=>this._handleLastEditsEventChange(e))])}destroy(){this._removeEditInterceptor()}get queryTask(){const{capabilities:e,parsedUrl:t,gdbVersion:r,spatialReference:s,fieldsIndex:a,uniqueIdFields:i}=this.layer,n="infoFor3D"in this.layer?this.layer.infoFor3D:null,o="dynamicDataSource"in this.layer?this.layer.dynamicDataSource:null,u=has("featurelayer-pbf")&&e?.query.supportsFormatPBF&&null==n;return new j({dynamicDataSource:o,fieldsIndex:a,gdbVersion:r,infoFor3D:n,pbfSupported:u,queryAttachmentsSupported:e?.operations?.supportsQueryAttachments??!1,sourceSpatialReference:s,uniqueIdFields:i,url:t.path})}async addAttachment(e,t){await this.load();const{layer:s}=this;await M(s,"editing");const a=e.attributes[s.objectIdField],i=s.parsedUrl.path+"/"+a+"/addAttachment",n=this._getLayerRequestOptions(),o=this._getFormDataForAttachment(t,n.query);try{const e=await r(i,{body:o});return _(e.data.addAttachmentResult)}catch(u){throw this._createAttachmentErrorResult(a,u)}}async updateAttachment(e,t,s){await this.load();const{layer:a}=this;await M(a,"editing");const i=e.attributes[a.objectIdField],n=a.parsedUrl.path+"/"+i+"/updateAttachment",o=this._getLayerRequestOptions({query:{attachmentId:t}}),u=this._getFormDataForAttachment(s,o.query);try{const e=await r(n,{body:u});return _(e.data.updateAttachmentResult)}catch(l){throw this._createAttachmentErrorResult(i,l)}}async applyEdits(e,t){await this.load();const{layer:a}=this;await M(a,"editing");const n="infoFor3D"in a?a.infoFor3D:null,o=null!=n,u=o||(t?.globalIdUsed??!1),l=o?await this._uploadMeshesAndGetAssetMapEditsJSON(e):null,c=e.addFeatures?.map(e=>b(this.layer,e,n))??[],d=(await Promise.all(c)).filter(s),p=e.updateFeatures?.map(e=>b(this.layer,e,n))??[],y=(await Promise.all(p)).filter(s),h=R(this.layer,e.deleteFeatures,u);J(d,y,a.spatialReference);const m=await A(this.layer,e),f=a.capabilities.editing.supportsAsyncApplyEdits&&o,g=t?.gdbVersion||a.gdbVersion,w={gdbVersion:g,rollbackOnFailure:t?.rollbackOnFailureEnabled,useGlobalIds:u,returnEditMoment:t?.returnEditMoment,usePreviousEditMoment:t?.usePreviousEditMoment,async:f};await C(this.layer.url,g,!0);const q=L(this.layer.url,g||null);if(await Q(a.url,g,a.historicMoment))throw new i("feature-layer-source:historic-version","Editing a historic version is not allowed");t?.returnServiceEditsOption?(w.edits=JSON.stringify([{id:a.layerId,adds:d.length?d:null,updates:y.length?y:null,deletes:h.length?h:null,attachments:m,assetMaps:l}]),w.returnServiceEditsOption=V.toJSON(t?.returnServiceEditsOption),w.returnServiceEditsInSourceSR=t?.returnServiceEditsInSourceSR):(w.adds=d.length?JSON.stringify(d):null,w.updates=y.length?JSON.stringify(y):null,w.deletes=h.length?u?JSON.stringify(h):h.join(","):null,w.attachments=m&&JSON.stringify(m),w.assetMaps=null!=l?JSON.stringify(l):void 0);const S=this._getLayerRequestOptions({method:"post",query:w});q&&(S.authMode="immediate",S.query.returnEditMoment=!0,S.query.sessionId=P);const E=t?.returnServiceEditsOption?a.url:a.parsedUrl.path;let O;try{O=f?await this._asyncApplyEdits(E+"/applyEdits",S):await r(E+"/applyEdits",S)}catch(_){if(!F(_))throw _;S.authMode="immediate",O=f?await this._asyncApplyEdits(E+"/applyEdits",S):await r(E+"/applyEdits",S)}return this._createEditsResult(O)}async deleteAttachments(e,t){await this.load();const{layer:s}=this;await M(s,"editing");const a=e.attributes[s.objectIdField],i=s.parsedUrl.path+"/"+a+"/deleteAttachments";try{return(await r(i,this._getLayerRequestOptions({query:{attachmentIds:t.join(",")},method:"post"}))).data.deleteAttachmentResults.map(_)}catch(n){throw this._createAttachmentErrorResult(a,n)}}fetchRecomputedExtents(e={}){const t=e.signal;return this.load({signal:t}).then(async()=>{const t=this._getLayerRequestOptions({...e,query:{returnUpdates:!0}}),{layerId:s,url:a}=this.layer,{data:i}=await r(`${a}/${s}`,t),{id:n,extent:o,fullExtent:u,timeExtent:l}=i,c=o||u;return{id:n,fullExtent:c&&w.fromJSON(c),timeExtent:l&&k.fromJSON({start:l[0],end:l[1]})}})}async queryAttachments(e,t={}){await this.load();const r=this._getLayerRequestOptions(t);return this.queryTask.executeAttachmentQuery(e,r)}async queryFeatures(e,t){await this.load();const r=await this.queryTask.execute(e,{...t,query:this._createRequestQueryOptions(t)});if(e.outStatistics?.length&&r.features.length){const t=new Map;if(r.features.forEach(r=>{const s=r.attributes;e.outStatistics?.forEach(({outStatisticFieldName:e})=>{if(e){const r=e.toLowerCase();r&&r in s&&e!==r&&(s[e]=s[r],delete s[r],t.set(r,e))}})}),null!=r.fields)for(const e of r.fields){const r=t.get(e.name.toLowerCase());null!=r&&(e.name=r)}}return r}async queryFeaturesJSON(e,t){return await this.load(),this.queryTask.executeJSON(e,{...t,query:this._createRequestQueryOptions(t)})}async queryObjectIds(e,t){return await this.load(),this.queryTask.executeForIds(e,{...t,query:this._createRequestQueryOptions(t)})}async queryFeatureCount(e,t){return await this.load(),this.queryTask.executeForCount(e,{...t,query:this._createRequestQueryOptions(t)})}async queryExtent(e,t){return await this.load(),this.queryTask.executeForExtent(e,{...t,query:this._createRequestQueryOptions(t)})}async queryRelatedFeatures(e,t){return await this.load(),this.queryTask.executeRelationshipQuery(e,{...t,query:this._createRequestQueryOptions(t)})}async queryRelatedFeaturesCount(e,t){return await this.load(),this.queryTask.executeRelationshipQueryForCount(e,{...t,query:this._createRequestQueryOptions(t)})}async queryTopFeatures(e,t){return await this.load(),this.queryTask.executeTopFeaturesQuery(e,{...t,query:this._createRequestQueryOptions(t)})}async queryAttributeBins(e,t){return await this.load(),this.queryTask.executeAttributeBinsQuery(e,{...t,query:this._createRequestQueryOptions(t)})}async queryTopObjectIds(e,t){return await this.load(),this.queryTask.executeForTopIds(e,{...t,query:this._createRequestQueryOptions(t)})}async queryTopExtents(e,t){return await this.load(),this.queryTask.executeForTopExtents(e,{...t,query:this._createRequestQueryOptions(t)})}async queryTopCount(e,t){return await this.load(),this.queryTask.executeForTopCount(e,{...t,query:this._createRequestQueryOptions(t)})}async fetchPublishingStatus(){if(!T(this.layer.url))return"unavailable";const e=h(this.layer.url,"status"),t=await r(e,{query:{f:"json"}});return $.fromJSON(t.data.status)}async uploadAssets(e,t){const{uploadAssets:r}=await import("./support/uploadAssets.js");return r(e,{layer:this.layer,ongoingUploads:this._ongoingAssetUploads},t)}_handleLastEditsEventChange(e){const t=this.layer;if(null==e||!("capabilities"in t)||!("effectiveCapabilities"in t))return;if(!(!t.capabilities?.operations?.supportsEditing&&t.effectiveCapabilities?.operations?.supportsEditing))return;const r=t.url;if(null==r)return;"layerId"in t&&h(r,t.layerId.toString());this._getOrCreateEditInterceptor(r).before=t=>{const r=t.requestOptions.method??"auto";if("auto"===r||"head"===r){const r=t.requestOptions.query??{};r._ts=e.getTime(),t.requestOptions.query=r}}}_getOrCreateEditInterceptor(e){return null==this._editInterceptor&&(this._editInterceptor={urls:e},t.request.internalInterceptors.push(this._editInterceptor)),this._editInterceptor}_removeEditInterceptor(){null!=this._editInterceptor&&(a(t.request.internalInterceptors,this._editInterceptor),this._editInterceptor=null)}async _asyncApplyEdits(e,t){const s=(await r(e,t)).data.statusUrl;for(;;){const e=(await r(s,{query:{f:"json"},responseType:"json"})).data;switch(e.status){case"Completed":return r(e.resultUrl,{query:{f:"json"},responseType:"json"});case"CompletedWithErrors":throw new i("async-applyEdits-failed","asynchronous applyEdits call failed.");case"Failed ImportChanges":case"InProgress":case"Pending":case"ExportAttachments":case"ExportChanges":case"ExportingData":case"ExportingSnapshot":case"ImportAttachments":case"ProvisioningReplica":case"UnRegisteringReplica":break;default:throw new i("async-applyEdits-failed","asynchronous applyEdits call failed (undefined response status)")}await d(H)}}_createRequestQueryOptions(e){const t={...this.layer.customParameters,token:this.layer.apiKey,...e?.query};return this.layer.datesInUnknownTimezone&&(t.timeReferenceUnknownClient=!0),t}async _fetchService(e,t){if(!e){const s={};has("featurelayer-advanced-symbols")&&(s.returnAdvancedSymbols=!0),t?.cacheBust&&(s._ts=Date.now());const{data:a}=await r(this.layer.parsedUrl.path,this._getLayerRequestOptions({query:s,signal:t?.signal}));e=a}this.layer.applyPreferredHost(e),this.sourceJSON=await this._patchServiceJSON(e,t?.signal);const s=e.type;if(!this.supportedSourceTypes.has(s))throw new i("feature-layer-source:unsupported-type",`Source type "${s}" is not supported`)}async _patchServiceJSON(e,t){if("Table"!==e.type&&e.geometryType&&!e?.drawingInfo?.renderer&&!e.defaultSymbol){const t=v(e.geometryType).renderer;l("drawingInfo.renderer",t,e)}if("esriGeometryMultiPatch"===e.geometryType&&e.infoFor3D&&(e.geometryType="mesh"),null==e.extent)try{const{data:s}=await r(this.layer.url,this._getLayerRequestOptions({signal:t}));s.spatialReference&&(e.extent={xmin:0,ymin:0,xmax:0,ymax:0,spatialReference:s.spatialReference})}catch(s){p(s)}return e}async _ensureLatestMetadata(e){if(this.layer.userHasUpdateItemPrivileges&&this.sourceJSON.cacheMaxAge>0)return this._fetchService(null,{...e,cacheBust:!0})}async _uploadMeshesAndGetAssetMapEditsJSON(e){const{addAssetFeatures:t}=e;if(!t?.length)return null;if(await this._areAllAssetsAlreadyMapped(t))return null;const r=e.addFeatures.filter(e=>e.geometry);if(t.length!==r.length+e.updateFeatures.length)throw new i("feature-layer-source:unsupported-mesh-edits","Mixing attribute only edits with mesh geometry edits is not currently supported");const s=new Array,a=new Map;for(const i of t){const{geometry:e}=i,{vertexSpace:t}=e;if(E(t))s.push(e);else{const t=e.origin,{convertMeshVertexSpace:r}=await import("../../../geometry/support/meshUtils/convertMeshVertexSpace.js"),n=await r(e,new S({origin:[t.x,t.y,t.z??0]}));a.set(n,e),i.geometry=n,s.push(n)}}await this.uploadAssets(s);for(const[i,n]of a)n.addExternalSources(i.metadata.externalSources.items);return{adds:this._getAssetMapEditsJSON(t),updates:[],deletes:[]}}_getAssetMapEditsJSON(e){const t=new Array,r=this.layer.globalIdField,s=this.layer.parsedUrl;for(const a of e){const e=a.geometry,{metadata:i}=e,n=i.getExternalSourcesOnService(s),o=a.getAttribute(r);if(0===n.length){u.getLogger(this).error(`Skipping feature ${o}. The mesh it is associated with has not been uploaded to the service and cannot be mapped to it.`);continue}const{source:l}=n.find(O)??n[0];for(const r of l.assets)1===r.parts.length?t.push({globalId:m(),parentGlobalId:o,assetName:r.assetName,assetHash:r.parts[0].partHash,flags:[]}):u.getLogger(this).error(`Skipping asset ${r.assetName}. It does not have exactly one part, so we cannot map it to a feature.`)}return t}_createEditsResult(e){const t=e.data,{layerId:r}=this.layer,s=[];let a=null;if(Array.isArray(t))for(const n of t)s.push({id:n.id,editedFeatures:n.editedFeatures}),n.id===r&&(a={addResults:n.addResults??[],updateResults:n.updateResults??[],deleteResults:n.deleteResults??[],attachments:n.attachments,editMoment:n.editMoment});else a=t;const i=I(a);if(s.length>0){i.editedFeatureResults=[];for(const e of s){const{editedFeatures:t}=e,r=t?.spatialReference?new q(t.spatialReference):null;i.editedFeatureResults.push({layerId:e.id,editedFeatures:x(t,r)})}}return i}_createAttachmentErrorResult(e,t){const r=t.details.messages?.[0]||t.message,s=t.details.httpStatus||t.details.messageCode;return{objectId:e,globalId:null,error:new i("feature-layer-source:attachment-failure",r,{code:s})}}_getFormDataForAttachment(e,t){const r=e instanceof FormData?e:e&&e.elements?new FormData(e):null;if(r)for(const s in t){const e=t[s];null!=e&&(r.set?r.set(s,e):r.append(s,e))}return r}_getLayerRequestOptions(e={}){const{layer:t,layer:{parsedUrl:r,gdbVersion:s}}=this;return{...e,query:{gdbVersion:s,layer:"dynamicDataSource"in t&&t.dynamicDataSource?JSON.stringify({source:t.dynamicDataSource}):void 0,...r.query,f:"json",...this._createRequestQueryOptions(e)},responseType:"json"}}async _areAllAssetsAlreadyMapped(e){const{layer:t}=this,{globalIdField:r,parsedUrl:a}=t,i="infoFor3D"in t?t.infoFor3D:null;if(null==i||null==r)return!1;const n=N(i);if(null==n)return!1;const o=h(a.path,`../${n.id}`),u=new Array;for(const s of e){if(!(s.geometry.metadata.getExternalSourcesOnService(a).length>0))return!1;u.push(s)}const l=u.map(e=>e.getAttribute(r)).filter(s);if(0===l.length)return!1;const{assetMapFieldRoles:{parentGlobalId:c,assetHash:d}}=i,p=new D({where:`${c} IN (${l.map(e=>`'${e}'`)})`,outFields:[d,c],returnGeometry:!1}),y=await U(o,p),{features:m}=y;return 0!==m.length&&!u.some(e=>{const t=e.getAttribute(r);if(!t)return!0;const{metadata:s}=e.geometry,i=m.filter(e=>e.getAttribute(c)===t);if(0===i.length)return!0;const n=i.map(e=>e.getAttribute(d));return s.getExternalSourcesOnService(a).flatMap(({source:e})=>e.assets.flatMap(e=>e.parts.map(e=>e.partHash))).some(e=>n.every(t=>e!==t))})}};e([f()],G.prototype,"type",void 0),e([f({constructOnly:!0})],G.prototype,"layer",void 0),e([f({constructOnly:!0})],G.prototype,"supportedSourceTypes",void 0),e([f({readOnly:!0})],G.prototype,"queryTask",null),G=e([g("esri.layers.graphics.sources.FeatureLayerSource")],G);const H=1e3;export{G as default};
|
|
5
|
+
import{__decorate as e}from"tslib";import t from"../../../config.js";import r from"../../../request.js";import{isSome as s,remove as a}from"../../../core/arrayUtils.js";import i from"../../../core/Error.js";import has from"../../../core/has.js";import{JSONMap as n}from"../../../core/jsonMap.js";import{Loadable as o}from"../../../core/Loadable.js";import u from"../../../core/Logger.js";import{setDeepValue as l}from"../../../core/object.js";import{debounce as c,after as d,throwIfAbortError as p}from"../../../core/promiseUtils.js";import{watch as y}from"../../../core/reactiveUtils.js";import{join as h}from"../../../core/urlUtils.js";import{generateBracedUUID as m}from"../../../core/uuid.js";import{property as f}from"../../../core/accessorSupport/decorators/property.js";import{subclass as g}from"../../../core/accessorSupport/decorators/subclass.js";import w from"../../../geometry/Extent.js";import q from"../../../geometry/SpatialReference.js";import S from"../../../geometry/support/MeshGeoreferencedVertexSpace.js";import{isRelativeVertexSpace as E}from"../../../geometry/support/meshVertexSpaceUtils.js";import{isOriginalExternal as O}from"../../../geometry/support/meshUtils/External.js";import{createFeatureEditResult as _,getFeatureJSON as b,getFeatureIds as R,getAttachmentEditsJSON as A,isProtectedOrPrivateVersionError as F,unpackEditResultData as I,createEditedFeatures as x}from"../applyEditsUtils.js";import{createDrawingInfo as v}from"./support/clientSideDefaults.js";import j from"./support/QueryTask.js";import{isHostedAgolService as T}from"../../support/arcgisLayerUrl.js";import{ensureLayerCredential as M}from"../../support/featureLayerUtils.js";import{getAssetMapTable as N}from"../../support/infoFor3D.js";import{executeQueryJSON as U}from"../../../rest/query/executeQueryJSON.js";import{unapplyEditsZUnitScaling as J}from"../../../rest/query/operations/editsZScale.js";import D from"../../../rest/support/Query.js";import C from"../../../time/TimeExtent.js";import{isSafeToEditVersion as L,isVersionInEditSession as k,isHistoricVersion as Q,currentSessionId as P}from"../../../versionManagement/support/versionManagementUtils.js";const V=new n({originalAndCurrentFeatures:"original-and-current-features",none:"none"}),$=new n({Started:"published",Publishing:"publishing",Stopped:"unavailable"});let G=class extends o{constructor(e){super(e),this.type="feature-layer",this.supportedSourceTypes=new Set(["Feature Layer","Oriented Imagery Layer","Table","Catalog Layer"]),this.refresh=c(async()=>{await this.load();const e=this.sourceJSON.editingInfo?.lastEditDate;if(null==e)return{dataChanged:!0,updates:{}};try{await this._fetchService(null)}catch{return{dataChanged:!0,updates:{}}}const t=e!==this.sourceJSON.editingInfo?.lastEditDate;return{dataChanged:t,updates:t?{editingInfo:this.sourceJSON.editingInfo,extent:this.sourceJSON.extent}:null}}),this._ongoingAssetUploads=new Map}load(e){const t=this.layer.sourceJSON,r=this._fetchService(t,{...e}).then(()=>this.layer.setUserPrivileges(this.sourceJSON.serviceItemId,e)).then(()=>this._ensureLatestMetadata(e));return this.addResolvingPromise(r),Promise.resolve(this)}initialize(){this.addHandles([y(()=>{const e=this.layer;return e&&"lastEditsEventDate"in e?e.lastEditsEventDate:null},e=>this._handleLastEditsEventChange(e))])}destroy(){this._removeEditInterceptor()}get queryTask(){const{capabilities:e,parsedUrl:t,gdbVersion:r,spatialReference:s,fieldsIndex:a,uniqueIdFields:i}=this.layer,n="infoFor3D"in this.layer?this.layer.infoFor3D:null,o="dynamicDataSource"in this.layer?this.layer.dynamicDataSource:null,u=has("featurelayer-pbf")&&e?.query.supportsFormatPBF&&null==n;return new j({dynamicDataSource:o,fieldsIndex:a,gdbVersion:r,infoFor3D:n,pbfSupported:u,queryAttachmentsSupported:e?.operations?.supportsQueryAttachments??!1,sourceSpatialReference:s,uniqueIdFields:i,url:t.path})}async addAttachment(e,t){await this.load();const{layer:s}=this;await M(s,"editing");const a=e.attributes[s.objectIdField],i=s.parsedUrl.path+"/"+a+"/addAttachment",n=this._getLayerRequestOptions(),o=this._getFormDataForAttachment(t,n.query);try{const e=await r(i,{body:o});return _(e.data.addAttachmentResult)}catch(u){throw this._createAttachmentErrorResult(a,u)}}async updateAttachment(e,t,s){await this.load();const{layer:a}=this;await M(a,"editing");const i=e.attributes[a.objectIdField],n=a.parsedUrl.path+"/"+i+"/updateAttachment",o=this._getLayerRequestOptions({query:{attachmentId:t}}),u=this._getFormDataForAttachment(s,o.query);try{const e=await r(n,{body:u});return _(e.data.updateAttachmentResult)}catch(l){throw this._createAttachmentErrorResult(i,l)}}async applyEdits(e,t){await this.load();const{layer:a}=this;await M(a,"editing");const n="infoFor3D"in a?a.infoFor3D:null,o=null!=n,u=o||(t?.globalIdUsed??!1),l=o?await this._uploadMeshesAndGetAssetMapEditsJSON(e):null,c=e.addFeatures?.map(e=>b(this.layer,e,n))??[],d=(await Promise.all(c)).filter(s),p=e.updateFeatures?.map(e=>b(this.layer,e,n))??[],y=(await Promise.all(p)).filter(s),h=R(this.layer,e.deleteFeatures,u);J(d,y,a.spatialReference);const m=await A(this.layer,e),f=a.capabilities.editing.supportsAsyncApplyEdits&&o,g=t?.gdbVersion||a.gdbVersion,w={gdbVersion:g,rollbackOnFailure:t?.rollbackOnFailureEnabled,useGlobalIds:u,returnEditMoment:t?.returnEditMoment,usePreviousEditMoment:t?.usePreviousEditMoment,async:f};await L(this.layer.url,g,!0);const q=k(this.layer.url,g||null);if(await Q(a.url,g,a.historicMoment))throw new i("feature-layer-source:historic-version","Editing a historic version is not allowed");t?.returnServiceEditsOption?(w.edits=JSON.stringify([{id:a.layerId,adds:d.length?d:null,updates:y.length?y:null,deletes:h.length?h:null,attachments:m,assetMaps:l}]),w.returnServiceEditsOption=V.toJSON(t?.returnServiceEditsOption),w.returnServiceEditsInSourceSR=t?.returnServiceEditsInSourceSR):(w.adds=d.length?JSON.stringify(d):null,w.updates=y.length?JSON.stringify(y):null,w.deletes=h.length?u?JSON.stringify(h):h.join(","):null,w.attachments=m&&JSON.stringify(m),w.assetMaps=null!=l?JSON.stringify(l):void 0);const S=this._getLayerRequestOptions({method:"post",query:w});q&&(S.authMode="immediate",S.query.returnEditMoment=!0,S.query.sessionId=P);const E=t?.returnServiceEditsOption?a.url:a.parsedUrl.path;let O;try{O=f?await this._asyncApplyEdits(E+"/applyEdits",S):await r(E+"/applyEdits",S)}catch(_){if(!F(_))throw _;S.authMode="immediate",O=f?await this._asyncApplyEdits(E+"/applyEdits",S):await r(E+"/applyEdits",S)}return this._createEditsResult(O)}async deleteAttachments(e,t){await this.load();const{layer:s}=this;await M(s,"editing");const a=e.attributes[s.objectIdField],i=s.parsedUrl.path+"/"+a+"/deleteAttachments";try{return(await r(i,this._getLayerRequestOptions({query:{attachmentIds:t.join(",")},method:"post"}))).data.deleteAttachmentResults.map(_)}catch(n){throw this._createAttachmentErrorResult(a,n)}}fetchRecomputedExtents(e={}){const t=e.signal;return this.load({signal:t}).then(async()=>{const t=this._getLayerRequestOptions({...e,query:{returnUpdates:!0}}),{layerId:s,url:a}=this.layer,{data:i}=await r(`${a}/${s}`,t),{id:n,extent:o,fullExtent:u,timeExtent:l}=i,c=o||u;return{id:n,fullExtent:c&&w.fromJSON(c),timeExtent:l&&C.fromJSON({start:l[0],end:l[1]})}})}async queryAttachments(e,t={}){await this.load();const r=this._getLayerRequestOptions(t);return this.queryTask.executeAttachmentQuery(e,r)}async queryFeatures(e,t){await this.load();const r=await this.queryTask.execute(e,{...t,query:this._createRequestQueryOptions(t)});if(e.outStatistics?.length&&r.features.length){const t=new Map;if(r.features.forEach(r=>{const s=r.attributes;e.outStatistics?.forEach(({outStatisticFieldName:e})=>{if(e){const r=e.toLowerCase();r&&r in s&&e!==r&&(s[e]=s[r],delete s[r],t.set(r,e))}})}),null!=r.fields)for(const e of r.fields){const r=t.get(e.name.toLowerCase());null!=r&&(e.name=r)}}return r}async queryFeaturesJSON(e,t){return await this.load(),this.queryTask.executeJSON(e,{...t,query:this._createRequestQueryOptions(t)})}async queryObjectIds(e,t){return await this.load(),this.queryTask.executeForIds(e,{...t,query:this._createRequestQueryOptions(t)})}async queryFeatureCount(e,t){return await this.load(),this.queryTask.executeForCount(e,{...t,query:this._createRequestQueryOptions(t)})}async queryExtent(e,t){return await this.load(),this.queryTask.executeForExtent(e,{...t,query:this._createRequestQueryOptions(t)})}async queryRelatedFeatures(e,t){return await this.load(),this.queryTask.executeRelationshipQuery(e,{...t,query:this._createRequestQueryOptions(t)})}async queryRelatedFeaturesCount(e,t){return await this.load(),this.queryTask.executeRelationshipQueryForCount(e,{...t,query:this._createRequestQueryOptions(t)})}async queryTopFeatures(e,t){return await this.load(),this.queryTask.executeTopFeaturesQuery(e,{...t,query:this._createRequestQueryOptions(t)})}async queryAttributeBins(e,t){return await this.load(),this.queryTask.executeAttributeBinsQuery(e,{...t,query:this._createRequestQueryOptions(t)})}async queryTopObjectIds(e,t){return await this.load(),this.queryTask.executeForTopIds(e,{...t,query:this._createRequestQueryOptions(t)})}async queryTopExtents(e,t){return await this.load(),this.queryTask.executeForTopExtents(e,{...t,query:this._createRequestQueryOptions(t)})}async queryTopCount(e,t){return await this.load(),this.queryTask.executeForTopCount(e,{...t,query:this._createRequestQueryOptions(t)})}async fetchPublishingStatus(){if(!T(this.layer.url))return"unavailable";const e=h(this.layer.url,"status"),t=await r(e,{query:{f:"json"}});return $.fromJSON(t.data.status)}async uploadAssets(e,t){const{uploadAssets:r}=await import("./support/uploadAssets.js");return r(e,{layer:this.layer,ongoingUploads:this._ongoingAssetUploads},t)}_handleLastEditsEventChange(e){const t=this.layer;if(null==e||!("capabilities"in t)||!("effectiveCapabilities"in t))return;if(!(!t.capabilities?.operations?.supportsEditing&&t.effectiveCapabilities?.operations?.supportsEditing))return;const r=t.url;if(null==r)return;"layerId"in t&&h(r,t.layerId.toString());this._getOrCreateEditInterceptor(r).before=t=>{const r=t.requestOptions.method??"auto";if("auto"===r||"head"===r){const r=t.requestOptions.query??{};r._ts=e.getTime(),t.requestOptions.query=r}}}_getOrCreateEditInterceptor(e){return null==this._editInterceptor&&(this._editInterceptor={urls:e},t.request.internalInterceptors.push(this._editInterceptor)),this._editInterceptor}_removeEditInterceptor(){null!=this._editInterceptor&&(a(t.request.internalInterceptors,this._editInterceptor),this._editInterceptor=null)}async _asyncApplyEdits(e,t){const s=(await r(e,t)).data.statusUrl;for(;;){const e=(await r(s,{query:{f:"json"},responseType:"json"})).data;switch(e.status){case"Completed":return r(e.resultUrl,{query:{f:"json"},responseType:"json"});case"CompletedWithErrors":throw new i("async-applyEdits-failed","asynchronous applyEdits call failed.");case"Failed ImportChanges":case"InProgress":case"Pending":case"ExportAttachments":case"ExportChanges":case"ExportingData":case"ExportingSnapshot":case"ImportAttachments":case"ProvisioningReplica":case"UnRegisteringReplica":break;default:throw new i("async-applyEdits-failed","asynchronous applyEdits call failed (undefined response status)")}await d(H)}}_createRequestQueryOptions(e){const t={...this.layer.customParameters,token:this.layer.apiKey,...e?.query};return this.layer.datesInUnknownTimezone&&(t.timeReferenceUnknownClient=!0),t}async _fetchService(e,t){if(!e){const s={};has("featurelayer-advanced-symbols")&&(s.returnAdvancedSymbols=!0),t?.cacheBust&&(s._ts=Date.now());const{data:a}=await r(this.layer.parsedUrl.path,this._getLayerRequestOptions({query:s,signal:t?.signal}));e=a}this.layer.applyPreferredHost(e),this.sourceJSON=await this._patchServiceJSON(e,t?.signal);const s=e.type;if(!this.supportedSourceTypes.has(s))throw new i("feature-layer-source:unsupported-type",`Source type "${s}" is not supported`)}async _patchServiceJSON(e,t){if("Table"!==e.type&&e.geometryType&&!e?.drawingInfo?.renderer&&!e.defaultSymbol){const t=v(e.geometryType).renderer;l("drawingInfo.renderer",t,e)}if("esriGeometryMultiPatch"===e.geometryType&&e.infoFor3D&&(e.geometryType="mesh"),null==e.extent)try{const{data:s}=await r(this.layer.url,this._getLayerRequestOptions({signal:t}));s.spatialReference&&(e.extent={xmin:0,ymin:0,xmax:0,ymax:0,spatialReference:s.spatialReference})}catch(s){p(s)}return e}async _ensureLatestMetadata(e){if(this.layer.userHasUpdateItemPrivileges&&this.sourceJSON.cacheMaxAge>0)return this._fetchService(null,{...e,cacheBust:!0})}async _uploadMeshesAndGetAssetMapEditsJSON(e){const{addAssetFeatures:t}=e;if(!t?.length)return null;if(await this._areAllAssetsAlreadyMapped(t))return null;const r=e.addFeatures.filter(e=>e.geometry);if(t.length!==r.length+e.updateFeatures.length)throw new i("feature-layer-source:unsupported-mesh-edits","Mixing attribute only edits with mesh geometry edits is not currently supported");const s=new Array,a=new Map;for(const i of t){const{geometry:e}=i,{vertexSpace:t}=e;if(E(t))s.push(e);else{const t=e.origin,{convertMeshVertexSpace:r}=await import("../../../geometry/support/meshUtils/convertMeshVertexSpace.js"),n=await r(e,new S({origin:[t.x,t.y,t.z??0]}));a.set(n,e),i.geometry=n,s.push(n)}}await this.uploadAssets(s);for(const[i,n]of a)n.addExternalSources(i.metadata.externalSources.items);return{adds:this._getAssetMapEditsJSON(t),updates:[],deletes:[]}}_getAssetMapEditsJSON(e){const t=new Array,r=this.layer.globalIdField,s=this.layer.parsedUrl;for(const a of e){const e=a.geometry,{metadata:i}=e,n=i.getExternalSourcesOnService(s),o=a.getAttribute(r);if(0===n.length){u.getLogger(this).error(`Skipping feature ${o}. The mesh it is associated with has not been uploaded to the service and cannot be mapped to it.`);continue}const{source:l}=n.find(O)??n[0];for(const r of l.assets)1===r.parts.length?t.push({globalId:m(),parentGlobalId:o,assetName:r.assetName,assetHash:r.parts[0].partHash,flags:[]}):u.getLogger(this).error(`Skipping asset ${r.assetName}. It does not have exactly one part, so we cannot map it to a feature.`)}return t}_createEditsResult(e){const t=e.data,{layerId:r}=this.layer,s=[];let a=null;if(Array.isArray(t))for(const n of t)s.push({id:n.id,editedFeatures:n.editedFeatures}),n.id===r&&(a={addResults:n.addResults??[],updateResults:n.updateResults??[],deleteResults:n.deleteResults??[],attachments:n.attachments,editMoment:n.editMoment});else a=t;const i=I(a);if(s.length>0){i.editedFeatureResults=[];for(const e of s){const{editedFeatures:t}=e,r=t?.spatialReference?new q(t.spatialReference):null;i.editedFeatureResults.push({layerId:e.id,editedFeatures:x(t,r)})}}return i}_createAttachmentErrorResult(e,t){const r=t.details.messages?.[0]||t.message,s=t.details.httpStatus||t.details.messageCode;return{objectId:e,globalId:null,error:new i("feature-layer-source:attachment-failure",r,{code:s})}}_getFormDataForAttachment(e,t){const r=e instanceof FormData?e:e&&e.elements?new FormData(e):null;if(r)for(const s in t){const e=t[s];null!=e&&(r.set?r.set(s,e):r.append(s,e))}return r}_getLayerRequestOptions(e={}){const{layer:t,layer:{parsedUrl:r,gdbVersion:s}}=this;return{...e,query:{gdbVersion:s,layer:"dynamicDataSource"in t&&t.dynamicDataSource?JSON.stringify({source:t.dynamicDataSource}):void 0,...r.query,f:"json",...this._createRequestQueryOptions(e)},responseType:"json"}}async _areAllAssetsAlreadyMapped(e){const{layer:t}=this,{globalIdField:r,parsedUrl:a}=t,i="infoFor3D"in t?t.infoFor3D:null;if(null==i||null==r)return!1;const n=N(i);if(null==n)return!1;const o=h(a.path,`../${n.id}`),u=new Array;for(const s of e){if(!(s.geometry.metadata.getExternalSourcesOnService(a).length>0))return!1;u.push(s)}const l=u.map(e=>e.getAttribute(r)).filter(s);if(0===l.length)return!1;const{assetMapFieldRoles:{parentGlobalId:c,assetHash:d}}=i,p=new D({where:`${c} IN (${l.map(e=>`'${e}'`)})`,outFields:[d,c],returnGeometry:!1}),y=await U(o,p),{features:m}=y;return 0!==m.length&&!u.some(e=>{const t=e.getAttribute(r);if(!t)return!0;const{metadata:s}=e.geometry,i=m.filter(e=>e.getAttribute(c)===t);if(0===i.length)return!0;const n=i.map(e=>e.getAttribute(d));return s.getExternalSourcesOnService(a).flatMap(({source:e})=>e.assets.flatMap(e=>e.parts.map(e=>e.partHash))).some(e=>n.every(t=>e!==t))})}};e([f()],G.prototype,"type",void 0),e([f({constructOnly:!0})],G.prototype,"layer",void 0),e([f({constructOnly:!0})],G.prototype,"supportedSourceTypes",void 0),e([f({readOnly:!0})],G.prototype,"queryTask",null),G=e([g("esri.layers.graphics.sources.FeatureLayerSource")],G);const H=1e3;export{G as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{__decorate as e}from"tslib";import t from"../../core/Accessor.js";import i from"../../core/Error.js";import n from"../../core/Logger.js";import{getOrCreateMapValue as o}from"../../core/MapUtils.js";import{createAbortError as s}from"../../core/promiseUtils.js";import{parseWhereClause as a}from"../../core/sql.js";import{property as r}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/RandomLCG.js";import{subclass as p}from"../../core/accessorSupport/decorators/subclass.js";import d from"../../geometry/Extent.js";import l from"../../geometry/Polygon.js";import{initializeProjection as m,project as h}from"../../geometry/projectionUtils.js";import{wgs84 as c}from"../../geometry/support/spatialReferenceUtils.js";import{systemOidFieldName as y,systemOriginIdFieldName as u,systemDestinationIdFieldName as f,systemIsSpatialFieldName as g,systemLayoutGeometryFieldName as b}from"./constants.js";import w from"./SessionMemoryStorage.js";import{utilsExtentToInBoundsRings as T}from"./supportUtils.js";import{executeQueryStreaming as I}from"../../rest/knowledgeGraphService.js";import M from"../../rest/knowledgeGraph/GraphQueryStreaming.js";import D from"../../rest/support/Query.js";let E=class extends t{constructor(e){super(e),this._processingCacheUpdatesLookup=new Map,this.knowledgeGraph=null,this.inclusionModeDefinition={generateAllSublayers:!0,namedTypeDefinitions:new Map},this.entityTypeNames=new Set,this.relationshipTypeNames=new Set,this.geographicLookup=new Map,this.sublayerCaches=new Map,this.nodeConnectionsLookup=new Map,this.relationshipConnectionsLookup=new Map,this.memberIdTypeLookup=new Map;const t=new Map;e.knowledgeGraph.dataModel.entityTypes?.forEach(i=>{i.name&&(t.set(i.name,"entity"),this._processingCacheUpdatesLookup.set(i.name,[]),e.inclusionModeDefinition&&!e.inclusionModeDefinition?.generateAllSublayers||this.entityTypeNames.add(i.name),i.properties?.forEach(e=>{e.geometryType&&"esriGeometryNull"!==e.geometryType&&this.geographicLookup.set(i.name,{name:e.name??"",geometryType:e.geometryType})}))}),e.knowledgeGraph.dataModel.relationshipTypes?.forEach(i=>{i.name&&(t.set(i.name,"relationship"),this._processingCacheUpdatesLookup.set(i.name,[]),e.inclusionModeDefinition&&!e.inclusionModeDefinition?.generateAllSublayers||this.relationshipTypeNames.add(i.name),i.properties?.forEach(e=>{e.geometryType&&"esriGeometryNull"!==e.geometryType&&this.geographicLookup.set(i.name,{name:e.name??"",geometryType:e.geometryType})}))}),e.inclusionModeDefinition?.namedTypeDefinitions.forEach((i,s)=>{if("entity"===t.get(s))this.entityTypeNames.add(s);else{if("relationship"!==t.get(s))return n.getLogger(this).warn(`A named type, ${s}, was in the inclusion list that wasn't in the data model and will be removed`),void e.inclusionModeDefinition?.namedTypeDefinitions.delete(s);this.relationshipTypeNames.add(s)}const a=new Map;i.members?.forEach(e=>{o(this.memberIdTypeLookup,e.id,()=>new Set).add(s);const t=this.getById(e.id);t&&a.set(e.id,t)}),this.sublayerCaches.set(s,a)})}addToLayer(e){e.forEach(({typeName:e,id:t})=>{if(!this.inclusionModeDefinition)throw new i("knowledge-graph:layer-data-manager","You cannot add to a layer's exclusion list if it was not created with an exclusion list originally");if(this.inclusionModeDefinition.namedTypeDefinitions.has(e)){if(this.inclusionModeDefinition.namedTypeDefinitions.has(e)){const i=this.inclusionModeDefinition.namedTypeDefinitions.get(e);i.members||(i.members=new Map),i.members.set(t,{id:t}),o(this.memberIdTypeLookup,t,()=>new Set).add(e)}}else{const i=new Map;i.set(t,{id:t}),this.inclusionModeDefinition.namedTypeDefinitions.set(e,{useAllData:!1,members:i}),o(this.memberIdTypeLookup,t,()=>new Set).add(e)}})}getById(e){return w.getInstance().readFromStoreById(e)}async getData(e,t,i){if(t.objectType.name&&this.inclusionModeDefinition?.namedTypeDefinitions&&this.inclusionModeDefinition.namedTypeDefinitions.size>0&&!this.inclusionModeDefinition.namedTypeDefinitions.has(t.objectType.name))return[];let n;if(n=e||new D({where:"1=1",outFields:["*"]}),"link-chart"===t.parentCompositeLayer.type){const e=t.parentCompositeLayer,i=this._processingCacheUpdatesLookup.get(t.objectType.name??""),o=n.outFields;o&&1===o.length&&o[0]===y&&"1=1"===n.where||await Promise.all(i??[]);const s=this.sublayerCaches.has(t.objectType.name??"")?Array.from(this.sublayerCaches.get(t.objectType.name)?.values()):[],a=[];return s.forEach(i=>{if(this.relationshipTypeNames.has(t.objectType.name)){i.geometry=e.relationshipLinkChartDiagramLookup.get(i.attributes[t.objectIdField]);const n=this.memberIdTypeLookup.get(i.attributes[u]),o=this.memberIdTypeLookup.get(i.attributes[f]),s=this._isEndEntitySpatial(n,i,u),a=this._isEndEntitySpatial(o,i,f);i.attributes[g]=Number(s&&a)}else{i.geometry=e.entityLinkChartDiagramLookup.get(i.attributes[t.objectIdField]);const n=this.geographicLookup.get(t.objectType.name);n&&i.attributes[n.name]?i.attributes[g]=1:i.attributes[g]=0}i.attributes[b]=i.geometry,a.push(i)}),a}return this.retrieveDataFromService(n,t,i)}async getConnectedRecordIds(e,t,i){const n=[];let o="";const s=this._getNamedTypeIdMapFromNodeIds(e);if(t&&0!==t?.length){for(const e of t)o=o+e+"|";o=o.slice(0,-1)}const a={},r=[];for(const[l,m]of s){const e=`${l}_ids`;a[e]=m,t&&0!==t?.length?r.push(`MATCH (n:${l}) WHERE id(n) IN $${e} WITH n MATCH (n)-[r:${o}]-(m) RETURN id(r), type(r), id(m), labels(m)[0]`):r.push(`MATCH (n:${l}) WHERE id(n) IN $${e} WITH n MATCH (n)-[r]-(m) RETURN id(r), type(r), id(m), labels(m)[0]`)}if(!r.length)return n;const p=r.join(" UNION "),d=(await I(this.knowledgeGraph,new M({openCypherQuery:p,bindParameters:a}),{signal:i?.signal})).resultRowsStream.getReader();for(;;){const{done:e,value:t}=await d.read();if(e)break;for(let i=0;i<t.length;i++){const e=t[i];n.push({id:e[0],typeName:e[1]}),n.push({id:e[2],typeName:e[3]})}}return n}async getRelationshipsBetweenNodes(e,t,i){const n=this._getNamedTypeIdMapFromNodeIds(e);if(0===n.size)return[];const o={relationshipExclusionIds:t,possibleConnectionEntityIds:e},s=[];for(const[d,l]of n.entries()){const e=`${d}_ids`;o[e]=l,s.push(`MATCH (n:${d}) WHERE id(n) IN $${e} WITH n MATCH (n)-[r]->(m) WHERE id(m) IN $possibleConnectionEntityIds AND NOT id(r) IN $relationshipExclusionIds RETURN id(r), type(r)`)}const a=s.join(" UNION "),r=[],p=(await I(this.knowledgeGraph,new M({openCypherQuery:a,bindParameters:o}),{signal:i?.signal})).resultRowsStream.getReader();for(;;){const{done:e,value:t}=await p.read();if(e)break;for(let i=0;i<t.length;i++){const e=t[i];r.push({id:e[0],typeName:e[1]})}}return r}async getRelationshipsFromNodes(e,t,i,n){const o=this._getNamedTypeIdMapFromNodeIds(e);if(0===o.size||0===t.length)return[];const s={relationshipExclusionIds:i,possibleConnectionEntityIds:t},a=[];for(const[m,h]of o.entries()){const e=`${m}_ids`;s[e]=h,a.push(`MATCH (n:${m}) WHERE id(n) IN $${e} WITH n MATCH (n)-[r]-(m) WHERE id(m) IN $possibleConnectionEntityIds AND NOT id(r) IN $relationshipExclusionIds RETURN id(r), type(r)`)}const r=a.join(" UNION "),p=new Map,d=(await I(this.knowledgeGraph,new M({openCypherQuery:r,bindParameters:s}),{signal:n?.signal})).resultRowsStream.getReader();for(;;){const{done:e,value:t}=await d.read();if(e)break;for(let i=0;i<t.length;i++){const e=t[i];let n=p.get(e[1]);n||(n=new Set,p.set(e[1],n)),n.add(e[0])}}const l=[];for(const[m,h]of p)for(const e of h)l.push({id:e,typeName:m});return l}async refreshCacheContent(e,t,n,a=!0,r){const p=w.getInstance(),d=[],l=new Map,m=new Map;this.knowledgeGraph.dataModel.entityTypes?.forEach(e=>{e.name&&m.set(e.name,e)}),this.knowledgeGraph.dataModel.relationshipTypes?.forEach(e=>{e.name&&m.set(e.name,e)}),e||this.inclusionModeDefinition?e?e.forEach(e=>{if(this.memberIdTypeLookup.has(e))for(const t of this.memberIdTypeLookup.get(e))l.has(t)?l.get(t)?.push(e):l.set(t,[e])}):this.inclusionModeDefinition?.namedTypeDefinitions?.forEach((e,t)=>{e.useAllData?l.set(t,null):e.members&&e.members.forEach(e=>{l.has(t)&&null!==l.get(t)?l.get(t)?.push(e.id):l.set(t,[e.id])})}):(this.knowledgeGraph.dataModel.entityTypes?.forEach(e=>{e.name&&l.set(e.name,null)}),this.knowledgeGraph.dataModel.entityTypes?.forEach(e=>{e.name&&l.set(e.name,null)}));for(const[s,h]of l){const e=new Set(h),l=new Promise((d,l)=>{const c=async()=>{const d=new Set,l=[];let c,u="",f=!1;if(t||m.get(s)?.properties?.forEach(e=>{e.name&&d.add(e.name)}),n&&this.geographicLookup.has(s)){const e=this.geographicLookup.get(s)?.name;e&&d.add(e)}if(this.entityTypeNames.has(s))u=`MATCH (n:${s}) ${h?"WHERE id(n) IN $ids ":""}return ID(n)`,d.forEach(e=>{u+=`, n.${e}`,l.push(e)});else{if(!this.relationshipTypeNames.has(s))throw new i("knowledge-graph:layer-data-manager",`The graph type of ${s} could not be determined. Was this type set in the KG data model and inclusion definition?`);f=!0,u=`MATCH ()-[n:${s}]->() ${h?"WHERE id(n) IN $ids ":""}return ID(n), id(startNode(n)), id(endNode(n))`,d.forEach(e=>{u+=`, n.${e}`,l.push(e)})}c=new M(h?{openCypherQuery:u,bindParameters:{ids:h}}:{openCypherQuery:u});const g=(await I(this.knowledgeGraph,c,{signal:r?.signal})).resultRowsStream.getReader();for(;;){const{done:t,value:i}=await g.read();if(t)break;const n=[];for(let s=0;s<i.length;s++){const t=i[s];let a=0,r=0;const p={properties:{}};for(p.id=t[a],a++,r++,f&&(p.originId=t[a],a++,r++,p.destinationId=t[a],a++,r++,o(this.nodeConnectionsLookup,p.originId,()=>new Set).add(p.id),o(this.nodeConnectionsLookup,p.destinationId,()=>new Set).add(p.id),o(this.relationshipConnectionsLookup,p.id,()=>[p.originId,p.destinationId]));a<t.length;a++)p.properties[l[a-r]]=t[a];e.delete(p.id),n.push(p)}const r=p.writeToStore(n,y,this.geographicLookup.get(s)?.name);this.sublayerCaches.has(s)||this.sublayerCaches.set(s,new Map),a&&!this.inclusionModeDefinition?.namedTypeDefinitions.has(s)&&this.inclusionModeDefinition?.namedTypeDefinitions.set(s,{useAllData:!1,members:new Map}),a&&!this.inclusionModeDefinition?.namedTypeDefinitions.get(s).members&&(this.inclusionModeDefinition.namedTypeDefinitions.get(s).members=new Map);const d=this.sublayerCaches.get(s);r.forEach(e=>{d?.set(e.attributes[y],e),a&&!this.inclusionModeDefinition?.namedTypeDefinitions.get(s).members.has(e.attributes[y])&&(this.inclusionModeDefinition?.namedTypeDefinitions.get(s).members.set(e.attributes[y],{id:e.attributes[y]}),o(this.memberIdTypeLookup,e.attributes[y],()=>new Set).add(s))})}const b=this.inclusionModeDefinition?.namedTypeDefinitions.get(s);if(b)for(const t of e)b.members?.delete(t)};c().then(()=>{d(null)}).catch(e=>{"AbortError"===e.name?d(null):l(e)})});d.push(l),this._processingCacheUpdatesLookup.get(s)?.push(l)}if(await Promise.all(d),r?.signal?.aborted)throw s()}removeFromLayer(e){const t=new Set,i=new Set(e.map(e=>e.id));for(const n of e)t.add(n.typeName),1===this.memberIdTypeLookup.get(n.id)?.size?this.memberIdTypeLookup.delete(n.id):this.memberIdTypeLookup.get(n.id)?.delete(n.typeName),this.inclusionModeDefinition?.namedTypeDefinitions.forEach((e,t)=>{t===n.typeName&&e.members?.has(n.id)&&e.members.delete(n.id)});t.forEach(e=>{this.sublayerCaches.get(e)?.forEach((t,n)=>{i.has(n)&&this.sublayerCaches.get(e)?.delete(n)})})}async retrieveDataFromService(e,t,n){const o=w.getInstance(),s=new Set,r=[];let p,u="",f=[];const g="relationship"===t.graphType,b=this.inclusionModeDefinition?.namedTypeDefinitions?.get(t.objectType.name)?.useAllData,D=t.parentCompositeLayer.sublayerIdsCache.get(t.objectType.name);let E=!b&&D?Array.from(D).sort():null;if(this.inclusionModeDefinition?.namedTypeDefinitions?.get(t.objectType.name)?.useAllData)this.inclusionModeDefinition?.namedTypeDefinitions?.get(t.objectType.name)?.useAllData&&null!=e.objectIds&&(E=e.objectIds);else if(null!=e.objectIds&&E&&E.length>0){const t=e.objectIds;e.objectIds=E.filter(e=>t.includes(e))}else if(null!=e.objectIds)E=e.objectIds;else{if(this.inclusionModeDefinition?.namedTypeDefinitions.has(t.objectType.name)&&(!this.inclusionModeDefinition.namedTypeDefinitions.get(t.objectType.name)?.members||this.inclusionModeDefinition.namedTypeDefinitions.get(t.objectType.name)?.members?.size<1))return e.objectIds=[],[];e.objectIds=E}if(null!=e.outFields){const i=e.outFields;i.includes("*")?t.fields.forEach(e=>{s.add(e.name)}):i.forEach(e=>{e!==y&&e!==t.geometryFieldName&&s.add(e)})}if(null!=e.geometry){const n=e.geometry;let o;const y=t.parentCompositeLayer.dataManager.knowledgeGraph.serviceDefinition,f=y?.spatialReference,b=y?.serviceCapabilities?.geometryCapabilities;let w=b?.geometryMaxBoundingRectangleSizeX,I=b?.geometryMaxBoundingRectangleSizeY;if("point"===n.type){let e=n;e.spatialReference?.isWGS84||(await m(e.spatialReference,c),e=h(e,c)),o=new d({spatialReference:c,xmin:e.x-1e-4,ymin:e.y-1e-4,xmax:e.x+1e-4,ymax:e.y+1e-4})}else n?.extent?.spatialReference&&!n.spatialReference?.isWGS84?(await m(n.extent.spatialReference,c),o=h(n.extent,c)):o=n.extent;if(w&&I&&f){if(4326!==f.wkid){const e=new d({spatialReference:f,xmax:w,ymax:I}),t=h(e,c);w=t.xmax,I=t.ymax}if(o.xmax-o.xmin>w)throw new i("knowledge-graph:layer-data-manager",`Extent x bounds should be within ${w}° latitude, limit exceeded`);if(o.ymax-o.ymin>I)throw new i("knowledge-graph:layer-data-manager",`Extent y bounds should be within ${I}° longitude, limit exceeded`)}if(null!=e.where&&"1=1"!==e.where){const i=await a(e.where.toUpperCase(),t.fieldsIndex);t.fields.forEach(e=>{i.fieldNames.includes(e.name)&&s.add(e.name)})}u=g?`Match ()-[n:${t.objectType.name}]->() WHERE esri.graph.ST_Intersects($param_filter_geom, n.${t.geometryFieldName}) return ID(n), id(startNode(r)), id(endNode(r))`:`Match (n:${t.objectType.name}) WHERE esri.graph.ST_Intersects($param_filter_geom, n.${t.geometryFieldName}) return ID(n)`,t.geometryFieldName&&s.add(t.geometryFieldName),s.forEach(e=>{u+=`, n.${e}`,r.push(e)}),p=new M({openCypherQuery:u,bindParameters:{param_filter_geom:new l({rings:T(o)})}})}else{let i="";if(null!=e.where&&"1=1"!==e.where){const n=await a(e.where,t.fieldsIndex);t.fields.forEach(e=>{n.fieldNames.includes(e.name)&&s.add(e.name)});const o=new Set(["column-reference","string","number","binary-expression"]),r=new Set(["=","<","<=","<>",">",">=","AND","OR","LIKE"]);let p=!1;const d=e=>{if("column-reference"===e.type)return`n.${e.column}`;if("string"===e.type)return`'${e.value}'`;if("number"===e.type)return`${e.value}`;if("binary-expression"===e.type&&o.has(e.left.type)&&o.has(e.right.type)&&r.has(e.operator))return`${d(e.left)} ${e.operator} ${d(e.right)}`;if("binary-expression"===e.type&&"LIKE"===e.operator){let t="";if("function"===e.left.type&&"column-reference"===e.left.args.value[0].type)t+=`lower(n.${e.left.args.value[0].column})`;else{if("column-reference"!==e.left.type)return p=!0,"";t+=`lower(n.${e.left.column})`}if(t+=" CONTAINS (","string"!==e.right.type)return p=!0,"";{let i=e.right.value;i.startsWith("%")&&(i=i.slice(1)),i.endsWith("%")&&(i=i.slice(0,-1)),t+=`'${i.toLowerCase()}')`}return t}return p=!0,""};i=d(n.parseTree),p&&(i="")}let n="";n=g?`Match ()-[n:${t.objectType.name}]->()`:`Match (n:${t.objectType.name})`;let o=!1;E&&(o=!0,n+=" WHERE ID(n) IN $ids"),i&&(n+=o?" AND":" WHERE",n+=` ${i}`),n+=" return ID(n)",g&&(n+=", id(startNode(n)), id(endNode(n))"),e.returnGeometry&&t.geometryFieldName&&s.add(t.geometryFieldName),s.forEach(e=>{n+=`, n.${e}`,r.push(e)}),p=new M(E?{openCypherQuery:n,bindParameters:{ids:E}}:{openCypherQuery:n})}const N=(await I(t.parentCompositeLayer.dataManager.knowledgeGraph,p,n)).resultRowsStream.getReader();for(;;){const{done:e,value:i}=await N.read();if(e)break;const n=[];for(let t=0;t<i.length;t++){const e=i[t];let o=0,s=0;const a={properties:{}};for(a.id=e[o],o++,s++,g&&(a.originId=e[o],o++,s++,a.destinationId=e[o],o++,s++);o<e.length;o++)a.properties[r[o-s]]=e[o];n.push(a)}f=f.concat(o.writeToStore(n,y,t.parentCompositeLayer.dataManager.geographicLookup.get(t.objectType.name)?.name))}return f}_isEndEntitySpatial(e,t,i){for(const n of e??[])if(this.entityTypeNames.has(n)){const e=this.geographicLookup.get(n),o=e&&this.sublayerCaches.get(n)?.get(t.attributes[i]);if(e&&o?.attributes[e.name])return!0}return!1}_getNamedTypeIdMapFromNodeIds(e){const t=new Map;return e.forEach(e=>{if(this.memberIdTypeLookup.has(e))for(const i of this.memberIdTypeLookup.get(e)){if(!this.entityTypeNames.has(i))return;t.has(i)?t.get(i)?.push(e):t.set(i,[e])}}),t}};e([r()],E.prototype,"knowledgeGraph",void 0),e([r()],E.prototype,"inclusionModeDefinition",void 0),e([r()],E.prototype,"entityTypeNames",void 0),e([r()],E.prototype,"relationshipTypeNames",void 0),e([r()],E.prototype,"geographicLookup",void 0),e([r()],E.prototype,"sublayerCaches",void 0),e([r()],E.prototype,"nodeConnectionsLookup",void 0),e([r()],E.prototype,"relationshipConnectionsLookup",void 0),e([r()],E.prototype,"memberIdTypeLookup",void 0),E=e([p("esri.layers.knowledgeGraph.KnowledgeGraphLayerDataManager")],E);export{E as KnowledgeGraphLayerDataManager};
|
|
5
|
+
import{__decorate as e}from"tslib";import t from"../../core/Accessor.js";import i from"../../core/Error.js";import n from"../../core/Logger.js";import{getOrCreateMapValue as o}from"../../core/MapUtils.js";import{createAbortError as s}from"../../core/promiseUtils.js";import{parseWhereClause as a}from"../../core/sql.js";import{property as r}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/RandomLCG.js";import{subclass as p}from"../../core/accessorSupport/decorators/subclass.js";import d from"../../geometry/Extent.js";import l from"../../geometry/Polygon.js";import{initializeProjection as m,project as h}from"../../geometry/projectionUtils.js";import{wgs84 as c}from"../../geometry/support/spatialReferenceUtils.js";import{systemOidFieldName as y,systemOriginIdFieldName as u,systemDestinationIdFieldName as f,systemIsSpatialFieldName as g,systemLayoutGeometryFieldName as b}from"./constants.js";import w from"./SessionMemoryStorage.js";import{utilsExtentToInBoundsRings as T}from"./supportUtils.js";import{executeQueryStreaming as I}from"../../rest/knowledgeGraphService.js";import M from"../../rest/knowledgeGraph/GraphQueryStreaming.js";import D from"../../rest/support/Query.js";let E=class extends t{constructor(e){super(e),this._processingCacheUpdatesLookup=new Map,this.knowledgeGraph=null,this.inclusionModeDefinition={generateAllSublayers:!0,namedTypeDefinitions:new Map},this.entityTypeNames=new Set,this.relationshipTypeNames=new Set,this.geographicLookup=new Map,this.sublayerCaches=new Map,this.nodeConnectionsLookup=new Map,this.relationshipConnectionsLookup=new Map,this.memberIdTypeLookup=new Map;const t=new Map;e.knowledgeGraph.dataModel.entityTypes?.forEach(i=>{i.name&&(t.set(i.name,"entity"),this._processingCacheUpdatesLookup.set(i.name,[]),e.inclusionModeDefinition&&!e.inclusionModeDefinition?.generateAllSublayers||this.entityTypeNames.add(i.name),i.properties?.forEach(e=>{e.geometryType&&"esriGeometryNull"!==e.geometryType&&this.geographicLookup.set(i.name,{name:e.name??"",geometryType:e.geometryType})}))}),e.knowledgeGraph.dataModel.relationshipTypes?.forEach(i=>{i.name&&(t.set(i.name,"relationship"),this._processingCacheUpdatesLookup.set(i.name,[]),e.inclusionModeDefinition&&!e.inclusionModeDefinition?.generateAllSublayers||this.relationshipTypeNames.add(i.name),i.properties?.forEach(e=>{e.geometryType&&"esriGeometryNull"!==e.geometryType&&this.geographicLookup.set(i.name,{name:e.name??"",geometryType:e.geometryType})}))}),e.inclusionModeDefinition?.namedTypeDefinitions.forEach((i,s)=>{if("entity"===t.get(s))this.entityTypeNames.add(s);else{if("relationship"!==t.get(s))return n.getLogger(this).warn(`A named type, ${s}, was in the inclusion list that wasn't in the data model and will be removed`),void e.inclusionModeDefinition?.namedTypeDefinitions.delete(s);this.relationshipTypeNames.add(s)}const a=new Map;i.members?.forEach(e=>{o(this.memberIdTypeLookup,e.id,()=>new Set).add(s)}),this.sublayerCaches.set(s,a)})}addToLayer(e){e.forEach(({typeName:e,id:t})=>{if(!this.inclusionModeDefinition)throw new i("knowledge-graph:layer-data-manager","You cannot add to a layer's exclusion list if it was not created with an exclusion list originally");if(this.inclusionModeDefinition.namedTypeDefinitions.has(e)){if(this.inclusionModeDefinition.namedTypeDefinitions.has(e)){const i=this.inclusionModeDefinition.namedTypeDefinitions.get(e);i.members||(i.members=new Map),i.members.set(t,{id:t}),o(this.memberIdTypeLookup,t,()=>new Set).add(e)}}else{const i=new Map;i.set(t,{id:t}),this.inclusionModeDefinition.namedTypeDefinitions.set(e,{useAllData:!1,members:i}),o(this.memberIdTypeLookup,t,()=>new Set).add(e)}})}getById(e){return w.getInstance().readFromStoreById(e)}async getData(e,t,i){if(t.objectType.name&&this.inclusionModeDefinition?.namedTypeDefinitions&&this.inclusionModeDefinition.namedTypeDefinitions.size>0&&!this.inclusionModeDefinition.namedTypeDefinitions.has(t.objectType.name))return[];let n;if(n=e||new D({where:"1=1",outFields:["*"]}),"link-chart"===t.parentCompositeLayer.type){const e=t.parentCompositeLayer,i=this._processingCacheUpdatesLookup.get(t.objectType.name??""),o=n.outFields;o&&1===o.length&&o[0]===y&&"1=1"===n.where||await Promise.all(i??[]);const s=this.sublayerCaches.has(t.objectType.name??"")?Array.from(this.sublayerCaches.get(t.objectType.name)?.values()):[],a=[];return s.forEach(i=>{if(this.relationshipTypeNames.has(t.objectType.name)){i.geometry=e.relationshipLinkChartDiagramLookup.get(i.attributes[t.objectIdField]);const n=this.memberIdTypeLookup.get(i.attributes[u]),o=this.memberIdTypeLookup.get(i.attributes[f]),s=this._isEndEntitySpatial(n,i,u),a=this._isEndEntitySpatial(o,i,f);i.attributes[g]=Number(s&&a)}else{i.geometry=e.entityLinkChartDiagramLookup.get(i.attributes[t.objectIdField]);const n=this.geographicLookup.get(t.objectType.name);n&&i.attributes[n.name]?i.attributes[g]=1:i.attributes[g]=0}i.attributes[b]=i.geometry,a.push(i)}),a}return this.retrieveDataFromService(n,t,i)}async getConnectedRecordIds(e,t,i){const n=[];let o="";const s=this._getNamedTypeIdMapFromNodeIds(e);if(t&&0!==t?.length){for(const e of t)o=o+e+"|";o=o.slice(0,-1)}const a={},r=[];for(const[l,m]of s){const e=`${l}_ids`;a[e]=m,t&&0!==t?.length?r.push(`MATCH (n:${l}) WHERE id(n) IN $${e} WITH n MATCH (n)-[r:${o}]-(m) RETURN id(r), type(r), id(m), labels(m)[0]`):r.push(`MATCH (n:${l}) WHERE id(n) IN $${e} WITH n MATCH (n)-[r]-(m) RETURN id(r), type(r), id(m), labels(m)[0]`)}if(!r.length)return n;const p=r.join(" UNION "),d=(await I(this.knowledgeGraph,new M({openCypherQuery:p,bindParameters:a}),{signal:i?.signal})).resultRowsStream.getReader();for(;;){const{done:e,value:t}=await d.read();if(e)break;for(let i=0;i<t.length;i++){const e=t[i];n.push({id:e[0],typeName:e[1]}),n.push({id:e[2],typeName:e[3]})}}return n}async getRelationshipsBetweenNodes(e,t,i){const n=this._getNamedTypeIdMapFromNodeIds(e);if(0===n.size)return[];const o={relationshipExclusionIds:t,possibleConnectionEntityIds:e},s=[];for(const[d,l]of n.entries()){const e=`${d}_ids`;o[e]=l,s.push(`MATCH (n:${d}) WHERE id(n) IN $${e} WITH n MATCH (n)-[r]->(m) WHERE id(m) IN $possibleConnectionEntityIds AND NOT id(r) IN $relationshipExclusionIds RETURN id(r), type(r)`)}const a=s.join(" UNION "),r=[],p=(await I(this.knowledgeGraph,new M({openCypherQuery:a,bindParameters:o}),{signal:i?.signal})).resultRowsStream.getReader();for(;;){const{done:e,value:t}=await p.read();if(e)break;for(let i=0;i<t.length;i++){const e=t[i];r.push({id:e[0],typeName:e[1]})}}return r}async getRelationshipsFromNodes(e,t,i,n){const o=this._getNamedTypeIdMapFromNodeIds(e);if(0===o.size||0===t.length)return[];const s={relationshipExclusionIds:i,possibleConnectionEntityIds:t},a=[];for(const[m,h]of o.entries()){const e=`${m}_ids`;s[e]=h,a.push(`MATCH (n:${m}) WHERE id(n) IN $${e} WITH n MATCH (n)-[r]-(m) WHERE id(m) IN $possibleConnectionEntityIds AND NOT id(r) IN $relationshipExclusionIds RETURN id(r), type(r)`)}const r=a.join(" UNION "),p=new Map,d=(await I(this.knowledgeGraph,new M({openCypherQuery:r,bindParameters:s}),{signal:n?.signal})).resultRowsStream.getReader();for(;;){const{done:e,value:t}=await d.read();if(e)break;for(let i=0;i<t.length;i++){const e=t[i];let n=p.get(e[1]);n||(n=new Set,p.set(e[1],n)),n.add(e[0])}}const l=[];for(const[m,h]of p)for(const e of h)l.push({id:e,typeName:m});return l}async refreshCacheContent(e,t,n,a=!0,r){const p=w.getInstance(),d=[],l=new Map,m=new Map;this.knowledgeGraph.dataModel.entityTypes?.forEach(e=>{e.name&&m.set(e.name,e)}),this.knowledgeGraph.dataModel.relationshipTypes?.forEach(e=>{e.name&&m.set(e.name,e)}),e||this.inclusionModeDefinition?e?e.forEach(e=>{if(this.memberIdTypeLookup.has(e))for(const t of this.memberIdTypeLookup.get(e))l.has(t)?l.get(t)?.push(e):l.set(t,[e])}):this.inclusionModeDefinition?.namedTypeDefinitions?.forEach((e,t)=>{e.useAllData?l.set(t,null):e.members&&e.members.forEach(e=>{l.has(t)&&null!==l.get(t)?l.get(t)?.push(e.id):l.set(t,[e.id])})}):(this.knowledgeGraph.dataModel.entityTypes?.forEach(e=>{e.name&&l.set(e.name,null)}),this.knowledgeGraph.dataModel.entityTypes?.forEach(e=>{e.name&&l.set(e.name,null)}));for(const[s,h]of l){const e=new Set(h),l=new Promise((d,l)=>{const c=async()=>{const d=new Set,l=[];let c,u="",f=!1;if(t||m.get(s)?.properties?.forEach(e=>{e.name&&d.add(e.name)}),n&&this.geographicLookup.has(s)){const e=this.geographicLookup.get(s)?.name;e&&d.add(e)}if(this.entityTypeNames.has(s))u=`MATCH (n:${s}) ${h?"WHERE id(n) IN $ids ":""}return ID(n)`,d.forEach(e=>{u+=`, n.${e}`,l.push(e)});else{if(!this.relationshipTypeNames.has(s))throw new i("knowledge-graph:layer-data-manager",`The graph type of ${s} could not be determined. Was this type set in the KG data model and inclusion definition?`);f=!0,u=`MATCH ()-[n:${s}]->() ${h?"WHERE id(n) IN $ids ":""}return ID(n), id(startNode(n)), id(endNode(n))`,d.forEach(e=>{u+=`, n.${e}`,l.push(e)})}c=new M(h?{openCypherQuery:u,bindParameters:{ids:h}}:{openCypherQuery:u});const g=(await I(this.knowledgeGraph,c,{signal:r?.signal})).resultRowsStream.getReader();for(;;){const{done:t,value:i}=await g.read();if(t)break;const n=[];for(let s=0;s<i.length;s++){const t=i[s];let a=0,r=0;const p={properties:{}};for(p.id=t[a],a++,r++,f&&(p.originId=t[a],a++,r++,p.destinationId=t[a],a++,r++,o(this.nodeConnectionsLookup,p.originId,()=>new Set).add(p.id),o(this.nodeConnectionsLookup,p.destinationId,()=>new Set).add(p.id),o(this.relationshipConnectionsLookup,p.id,()=>[p.originId,p.destinationId]));a<t.length;a++)p.properties[l[a-r]]=t[a];e.delete(p.id),n.push(p)}const r=p.writeToStore(n,y,this.geographicLookup.get(s)?.name);this.sublayerCaches.has(s)||this.sublayerCaches.set(s,new Map),a&&!this.inclusionModeDefinition?.namedTypeDefinitions.has(s)&&this.inclusionModeDefinition?.namedTypeDefinitions.set(s,{useAllData:!1,members:new Map}),a&&!this.inclusionModeDefinition?.namedTypeDefinitions.get(s).members&&(this.inclusionModeDefinition.namedTypeDefinitions.get(s).members=new Map);const d=this.sublayerCaches.get(s);r.forEach(e=>{d?.set(e.attributes[y],e),a&&!this.inclusionModeDefinition?.namedTypeDefinitions.get(s).members.has(e.attributes[y])&&(this.inclusionModeDefinition?.namedTypeDefinitions.get(s).members.set(e.attributes[y],{id:e.attributes[y]}),o(this.memberIdTypeLookup,e.attributes[y],()=>new Set).add(s))})}const b=this.inclusionModeDefinition?.namedTypeDefinitions.get(s);if(b)for(const t of e)b.members?.delete(t)};c().then(()=>{d(null)}).catch(e=>{"AbortError"===e.name?d(null):l(e)})});d.push(l),this._processingCacheUpdatesLookup.get(s)?.push(l)}if(await Promise.all(d),r?.signal?.aborted)throw s()}removeFromLayer(e){const t=new Set,i=new Set(e.map(e=>e.id));for(const n of e)t.add(n.typeName),1===this.memberIdTypeLookup.get(n.id)?.size?this.memberIdTypeLookup.delete(n.id):this.memberIdTypeLookup.get(n.id)?.delete(n.typeName),this.inclusionModeDefinition?.namedTypeDefinitions.forEach((e,t)=>{t===n.typeName&&e.members?.has(n.id)&&e.members.delete(n.id)});t.forEach(e=>{this.sublayerCaches.get(e)?.forEach((t,n)=>{i.has(n)&&this.sublayerCaches.get(e)?.delete(n)})})}async retrieveDataFromService(e,t,n){const o=w.getInstance(),s=new Set,r=[];let p,u="",f=[];const g="relationship"===t.graphType,b=this.inclusionModeDefinition?.namedTypeDefinitions?.get(t.objectType.name)?.useAllData,D=t.parentCompositeLayer.sublayerIdsCache.get(t.objectType.name);let E=!b&&D?Array.from(D).sort():null;if(this.inclusionModeDefinition?.namedTypeDefinitions?.get(t.objectType.name)?.useAllData)this.inclusionModeDefinition?.namedTypeDefinitions?.get(t.objectType.name)?.useAllData&&null!=e.objectIds&&(E=e.objectIds);else if(null!=e.objectIds&&E&&E.length>0){const t=e.objectIds;e.objectIds=E.filter(e=>t.includes(e))}else if(null!=e.objectIds)E=e.objectIds;else{if(this.inclusionModeDefinition?.namedTypeDefinitions.has(t.objectType.name)&&(!this.inclusionModeDefinition.namedTypeDefinitions.get(t.objectType.name)?.members||this.inclusionModeDefinition.namedTypeDefinitions.get(t.objectType.name)?.members?.size<1))return e.objectIds=[],[];e.objectIds=E}if(null!=e.outFields){const i=e.outFields;i.includes("*")?t.fields.forEach(e=>{s.add(e.name)}):i.forEach(e=>{e!==y&&e!==t.geometryFieldName&&s.add(e)})}if(null!=e.geometry){const n=e.geometry;let o;const y=t.parentCompositeLayer.dataManager.knowledgeGraph.serviceDefinition,f=y?.spatialReference,b=y?.serviceCapabilities?.geometryCapabilities;let w=b?.geometryMaxBoundingRectangleSizeX,I=b?.geometryMaxBoundingRectangleSizeY;if("point"===n.type){let e=n;e.spatialReference?.isWGS84||(await m(e.spatialReference,c),e=h(e,c)),o=new d({spatialReference:c,xmin:e.x-1e-4,ymin:e.y-1e-4,xmax:e.x+1e-4,ymax:e.y+1e-4})}else n?.extent?.spatialReference&&!n.spatialReference?.isWGS84?(await m(n.extent.spatialReference,c),o=h(n.extent,c)):o=n.extent;if(w&&I&&f){if(4326!==f.wkid){const e=new d({spatialReference:f,xmax:w,ymax:I}),t=h(e,c);w=t.xmax,I=t.ymax}if(o.xmax-o.xmin>w)throw new i("knowledge-graph:layer-data-manager",`Extent x bounds should be within ${w}° latitude, limit exceeded`);if(o.ymax-o.ymin>I)throw new i("knowledge-graph:layer-data-manager",`Extent y bounds should be within ${I}° longitude, limit exceeded`)}if(null!=e.where&&"1=1"!==e.where){const i=await a(e.where.toUpperCase(),t.fieldsIndex);t.fields.forEach(e=>{i.fieldNames.includes(e.name)&&s.add(e.name)})}u=g?`Match ()-[n:${t.objectType.name}]->() WHERE esri.graph.ST_Intersects($param_filter_geom, n.${t.geometryFieldName}) return ID(n), id(startNode(r)), id(endNode(r))`:`Match (n:${t.objectType.name}) WHERE esri.graph.ST_Intersects($param_filter_geom, n.${t.geometryFieldName}) return ID(n)`,t.geometryFieldName&&s.add(t.geometryFieldName),s.forEach(e=>{u+=`, n.${e}`,r.push(e)}),p=new M({openCypherQuery:u,bindParameters:{param_filter_geom:new l({rings:T(o)})}})}else{let i="";if(null!=e.where&&"1=1"!==e.where){const n=await a(e.where,t.fieldsIndex);t.fields.forEach(e=>{n.fieldNames.includes(e.name)&&s.add(e.name)});const o=new Set(["column-reference","string","number","binary-expression"]),r=new Set(["=","<","<=","<>",">",">=","AND","OR","LIKE"]);let p=!1;const d=e=>{if("column-reference"===e.type)return`n.${e.column}`;if("string"===e.type)return`'${e.value}'`;if("number"===e.type)return`${e.value}`;if("binary-expression"===e.type&&o.has(e.left.type)&&o.has(e.right.type)&&r.has(e.operator))return`${d(e.left)} ${e.operator} ${d(e.right)}`;if("binary-expression"===e.type&&"LIKE"===e.operator){let t="";if("function"===e.left.type&&"column-reference"===e.left.args.value[0].type)t+=`lower(n.${e.left.args.value[0].column})`;else{if("column-reference"!==e.left.type)return p=!0,"";t+=`lower(n.${e.left.column})`}if(t+=" CONTAINS (","string"!==e.right.type)return p=!0,"";{let i=e.right.value;i.startsWith("%")&&(i=i.slice(1)),i.endsWith("%")&&(i=i.slice(0,-1)),t+=`'${i.toLowerCase()}')`}return t}return p=!0,""};i=d(n.parseTree),p&&(i="")}let n="";n=g?`Match ()-[n:${t.objectType.name}]->()`:`Match (n:${t.objectType.name})`;let o=!1;E&&(o=!0,n+=" WHERE ID(n) IN $ids"),i&&(n+=o?" AND":" WHERE",n+=` ${i}`),n+=" return ID(n)",g&&(n+=", id(startNode(n)), id(endNode(n))"),e.returnGeometry&&t.geometryFieldName&&s.add(t.geometryFieldName),s.forEach(e=>{n+=`, n.${e}`,r.push(e)}),p=new M(E?{openCypherQuery:n,bindParameters:{ids:E}}:{openCypherQuery:n})}const N=(await I(t.parentCompositeLayer.dataManager.knowledgeGraph,p,n)).resultRowsStream.getReader();for(;;){const{done:e,value:i}=await N.read();if(e)break;const n=[];for(let t=0;t<i.length;t++){const e=i[t];let o=0,s=0;const a={properties:{}};for(a.id=e[o],o++,s++,g&&(a.originId=e[o],o++,s++,a.destinationId=e[o],o++,s++);o<e.length;o++)a.properties[r[o-s]]=e[o];n.push(a)}f=f.concat(o.writeToStore(n,y,t.parentCompositeLayer.dataManager.geographicLookup.get(t.objectType.name)?.name))}return f}_isEndEntitySpatial(e,t,i){for(const n of e??[])if(this.entityTypeNames.has(n)){const e=this.geographicLookup.get(n),o=e&&this.sublayerCaches.get(n)?.get(t.attributes[i]);if(e&&o?.attributes[e.name])return!0}return!1}_getNamedTypeIdMapFromNodeIds(e){const t=new Map;return e.forEach(e=>{if(this.memberIdTypeLookup.has(e))for(const i of this.memberIdTypeLookup.get(e)){if(!this.entityTypeNames.has(i))return;t.has(i)?t.get(i)?.push(e):t.set(i,[e])}}),t}};e([r()],E.prototype,"knowledgeGraph",void 0),e([r()],E.prototype,"inclusionModeDefinition",void 0),e([r()],E.prototype,"entityTypeNames",void 0),e([r()],E.prototype,"relationshipTypeNames",void 0),e([r()],E.prototype,"geographicLookup",void 0),e([r()],E.prototype,"sublayerCaches",void 0),e([r()],E.prototype,"nodeConnectionsLookup",void 0),e([r()],E.prototype,"relationshipConnectionsLookup",void 0),e([r()],E.prototype,"memberIdTypeLookup",void 0),E=e([p("esri.layers.knowledgeGraph.KnowledgeGraphLayerDataManager")],E);export{E as KnowledgeGraphLayerDataManager};
|
|
@@ -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 i from"../../request.js";import{deprecatedFunction as r}from"../../core/deprecate.js";import s from"../../core/Error.js";import{clone as n}from"../../core/lang.js";import a from"../../core/Logger.js";import{watch as o}from"../../core/reactiveUtils.js";import{urlToObject as l}from"../../core/urlUtils.js";import{property as u}from"../../core/accessorSupport/decorators/property.js";import{Integer as p,ensureRange as m,ensureClass as c,ensureNumber as h}from"../../core/accessorSupport/ensureType.js";import{reader as d}from"../../core/accessorSupport/decorators/reader.js";import{subclass as f}from"../../core/accessorSupport/decorators/subclass.js";import{writer as g}from"../../core/accessorSupport/decorators/writer.js";import y from"../../geometry/Extent.js";import R from"../../geometry/Polygon.js";import I from"../../geometry/SpatialReference.js";import{srToRESTValue as v}from"../../geometry/support/spatialReferenceUtils.js";import{opacity as w,url as b}from"../support/commonProperties.js";import S from"../support/DimensionalDefinition.js";import{ExportImageServiceParameters as x}from"../support/ExportImageServiceParameters.js";import _ from"../support/Field.js";import F from"../support/FieldsIndex.js";import{createBitmap as D}from"../support/imageBitmapUtils.js";import{isSupportedRendererType as O}from"../support/imageryRendererUtils.js";import T from"../support/MosaicRule.js";import C from"../support/MultidimensionalSubset.js";import M from"../support/PixelBlock.js";import{interpolationKebab as P,noDataInterpretationKebab as N,pixelTypeKebabDict as q}from"../support/rasterEnums.js";import{getServicePixelValueField as j,getItemPixelValueField as E,getRawServicePixelValueField as A,getProcessedServicePixelValueField as V,getMagnitudeField as Q,getDirectionField as J,getMultidimensionalFields as U,getRasterAttributeTableFields as B,commonRasterFieldNames as L,addMultidimensionalFieldValues as z,rasterFieldPrefix as H}from"../support/rasterFieldUtils.js";import G from"../support/RasterFunction.js";import k from"../support/RasterInfo.js";import{intersectMultimensionalSubset as W,getEffectiveMultidimensionalDefinition as $,getSubsetVariablesFromMdInfo as X,getDefaultMultidimensionalDefinition as K}from"../support/rasterDatasets/multidimensionalUtils.js";import{decode as Y,getFormat as Z}from"../support/rasterFormats/RasterCodec.js";import{highlightPixels as ee}from"../support/rasterFunctions/pixelUtils.js";import{uvComponentToVector as te}from"../support/rasterFunctions/vectorFieldUtils.js";import{createDefaultRenderer as ie,getSupportedRendererTypes as re,matchPresetRenderer as se,getDefaultBandCombination as ne,normalizeRendererJSON as ae}from"../../renderers/support/rasterRendererHelper.js";import oe from"../../renderers/support/RasterSymbolizer.js";import{websceneRasterRendererTypes as le,rasterRendererTypes as ue,read as pe}from"../../renderers/support/rasterTypeUtils.js";import{calculateVolume as me,computeAngles as ce,computePixelSpaceLocations as he,computeHistograms as de,computeStatisticsHistograms as fe,measureHeight as ge,measureAreaAndPerimeter as ye,measureDistanceAndAngle as Re,measurePointOrCentroid as Ie,measureLengthFromImage as ve,measureAreaFromImage as we,getImageSpatialReferenceQueryParameter as be,getSamples as Se,identify as xe,imageToMap as _e,imageToMapMultiray as Fe,mapToImage as De,findImages as Oe,getImageUrl as Te,queryBoundary as Ce,queryGPSInfo as Me}from"../../rest/imageService.js";import{fetchServiceRasterInfo as Pe,generateRasterInfo as Ne,patchServiceInfo as qe}from"../../rest/imageService/fetchRasterInfo.js";import{getCatalogItemRasterInfo as je}from"../../rest/imageService/getCatalogItemRasterInfo.js";import{executeForCount as Ee}from"../../rest/query/executeForCount.js";import{executeForIds as Ae}from"../../rest/query/executeForIds.js";import{executeQueryJSON as Ve}from"../../rest/query/executeQueryJSON.js";import Qe from"../../rest/support/FeatureSet.js";import Je from"../../rest/support/ImageIdentifyParameters.js";import Ue from"../../rest/support/Query.js";const Be=new Set(["png","png8","png24","png32","jpg","bmp","gif","jpgpng","lerc","tiff"]),Le=m(h,{min:0,max:255});function ze(e){const t=JSON.stringify(e),i=t.includes('"rasterFunctionDefinition":{'),r=i?t.match(/"type":"(.*?FunctionArguments")/gi):t.match(/"rasterFunction":"(.*?")/gi),s=r?.map(e=>i?e.slice(8,-18):e.slice(18,-1));return s?s.join("/"):null}const He=m=>{const h=m;let He=class extends h{constructor(){super(...arguments),this._functionRasterInfos={},this._serviceSupportsMosaicRule=null,this.adjustAspectRatio=null,this.bandIds=void 0,this.capabilities=null,this.compressionQuality=void 0,this.compressionTolerance=.01,this.copyright=null,this.defaultMosaicRule=null,this.definitionExpression=null,this.exportImageServiceParameters=null,this.rasterInfo=null,this.fields=null,this.fullExtent=null,this.hasMultidimensions=!1,this.imageMaxHeight=4100,this.imageMaxWidth=4100,this.interpolation=void 0,this.minScale=0,this.maxScale=0,this.multidimensionalInfo=null,this.multidimensionalSubset=null,this.noData=null,this.noDataInterpretation=void 0,this.objectIdField=null,this.geometryType="polygon",this.typeIdField=null,this.types=[],this.pixelFilter=null,this.raster=void 0,this.sourceType=null,this.viewId=void 0,this.symbolizer=null,this.rasterFunctionInfos=null,this.serviceDataType=null,this.spatialReference=null,this.pixelType=null,this.serviceRasterInfo=null,this.sourceJSON=null,this.url=null,this.version=void 0}initialize(){this._set("exportImageServiceParameters",new x({layer:this}))}readServiceSupportsMosaicRule(e,t){return this._isMosaicRuleSupported(t)}get _rasterFunctionNamesIndex(){const e=new Map;return!this.rasterFunctionInfos||null!=this.rasterFunctionInfos&&this.rasterFunctionInfos.length<1||null!=this.rasterFunctionInfos&&this.rasterFunctionInfos.forEach(t=>{e.set(t.name.toLowerCase().replaceAll(/ /gi,"_"),t.name)}),e}readBandIds(e,t){if(Array.isArray(e)&&e.length>0&&e.every(e=>"number"==typeof e))return e}readCapabilities(e,t){return this._readCapabilities(t)}writeCompressionQuality(e,t,i){null!=e&&"lerc"!==this.format&&(t[i]=e)}writeCompressionTolerance(e,t,i){"lerc"===this.format&&null!=e&&(t[i]=e)}readDefaultMosaicRule(e,t){return this._serviceSupportsMosaicRule?T.fromJSON(t):null}get fieldsIndex(){return this.fields?new F(this.fields):null}set format(e){e&&Be.has(e.toLowerCase())&&this._set("format",e.toLowerCase())}readFormat(e,t){return"esriImageServiceDataTypeVector-UV"===t.serviceDataType||"esriImageServiceDataTypeVector-MagDir"===t.serviceDataType||null!=this.pixelFilter?"lerc":"jpgpng"}readMinScale(e,t){return null!=t.minLOD&&null!=t.maxLOD?e:0}readMaxScale(e,t){return null!=t.minLOD&&null!=t.maxLOD?e:0}set mosaicRule(e){let t=e;t?.mosaicMethod&&(t=T.fromJSON({...t.toJSON(),mosaicMethod:t.mosaicMethod,mosaicOperation:t.mosaicOperation})),this._set("mosaicRule",t)}readMosaicRule(e,t){const i=e||t.mosaicRule;return i?T.fromJSON(i):this._isMosaicRuleSupported(t)?T.fromJSON(t):null}writeMosaicRule(e,t,i){const{mosaicRule:r}=this;this._isValidCustomizedMosaicRule(r)&&(t[i]=r.toJSON())}writeNoData(e,t,i){null!=e&&"number"==typeof e&&(t[i]=Le(e))}readObjectIdField(e,t){if(!e){const i=t.fields.find(e=>"esriFieldTypeOID"===e.type||"oid"===e.type);e=i?.name}return e}get parsedUrl(){return l(this.url)}readSourceType(e,t){return this._isMosaicDataset(t)?"mosaic-dataset":"raster-dataset"}get renderer(){const{activePresetRendererName:e,presetRenderers:t}=this;if(e){const i=t?.find(({name:t})=>t===e);return i?.renderer.clone()}return this.internalRenderer}set renderer(e){this.activePresetRendererName=null,this.internalRenderer=e}set internalRenderer(e){this.loaded&&(e=this._configRenderer(e)),this._set("internalRenderer",e)}readRenderer(e,t,i){const r=t?.layerDefinition?.drawingInfo?.renderer,s=pe(r,i);return null==s?null:("vector-field"===s.type&&t.symbolTileSize&&!r.symbolTileSize&&(s.symbolTileSize=t.symbolTileSize),O(s)||a.getLogger(this).warn("ArcGISImageService","Imagery layer doesn't support given renderer type."),s)}writeRenderer(e,t,i){t.layerDefinition=t.layerDefinition||{},t.layerDefinition.drawingInfo=t.layerDefinition.drawingInfo||{},t.layerDefinition.drawingInfo.renderer=e.toJSON(),"vector-field"===e.type&&(t.symbolTileSize=e.symbolTileSize)}get rasterFields(){const e=this.fields?.map(e=>e.clone())??[];e.push(j()),"mosaic-dataset"===this.sourceType&&this.fields?.length&&e.push(E()),this.version>=10.4&&null!=this.rasterFunctionInfos&&this.rasterFunctionInfos.some(({name:e})=>"none"===e.toLowerCase())&&e.push(A()),null!=this.rasterFunctionInfos&&this.rasterFunctionInfos.filter(({name:e})=>"none"!==e.toLowerCase()).forEach(({name:t})=>e.push(V(t)));const{rasterInfo:t}=this;if(this._isVectorDataSet()){const i=t?.multidimensionalInfo?.variables[0].unit?.trim(),r=Q(i),s=J();e.push(r,s)}if(t?.multidimensionalInfo&&"raster-dataset"===this.sourceType){const i=U(t.multidimensionalInfo);e.push(...i)}const i=t?.attributeTable;if(null!=i){const t=B(i);e.push(...t)}return e}set rasterFunction(e){let t=e;t?.rasterFunction&&(t=G.fromJSON({...t.toJSON(),rasterFunction:t.rasterFunction,rasterFunctionArguments:t.rasterFunctionArguments})),this._set("rasterFunction",t)}readRasterFunction(e,t){const i=t.rasterFunctionInfos;return t.renderingRule||i?.length&&"None"!==i[0].name?this._isRFTJson(t.renderingRule)?G.fromJSON({rasterFunctionDefinition:t.renderingRule}):G.fromJSON(t.renderingRule||{rasterFunctionInfos:t.rasterFunctionInfos}):null}readSpatialReference(e,t){const i=e||t.extent.spatialReference;return i?I.fromJSON(i):null}writePixelType(e,t,i){null!=this.serviceRasterInfo&&this.pixelType===this.serviceRasterInfo.pixelType||(t[i]=q.toJSON(e))}readVersion(e,t){let i=t.currentVersion;return i||(i=t.hasOwnProperty("fields")||t.hasOwnProperty("timeInfo")?10:9.3),i}applyFilter(e){let t=e;return this.pixelFilter&&(t=this._clonePixelData(e),this.pixelFilter(t)),t}async applyRenderer(e,t){let i=e,{renderer:r,symbolizer:s,pixelFilter:n}=this;const{isRawData:a}=e;if(a&&"lerc"!==this.format&&(r??=ie(this.rasterInfo,{bandIds:this.bandIds,variableName:this.rasterFunction?null:this.mosaicRule?.multidimensionalDefinition?.[0].variableName}),s||(this.symbolizer=new oe({rendererJSON:r.toJSON(),rasterInfo:this.rasterInfo}),s=this.symbolizer)),(a||!this._isPicture())&&r&&s&&!n){await this._updateSymbolizer(s,r);const{bandIds:n}=this;i=await this._symbolize({pixelData:e,bandIds:n,symbolizer:s},t)}return i}async highlightPixels(e,t){const i=e.highlightOptions.map(e=>{const t={...e},{bandId:i}=t;if(null==i)t.bandId=0;else{const e=this.bandIds?.length?this.bandIds.indexOf(i):i;if(e<0||e>2)return;t.bandId=e}return t}).filter(e=>null!=e),r=this._rasterJobHandler;r?await r.highlightPixels({...e,highlightOptions:i},t):ee(e.pixelBlock,e.renderedPixelBlock,i)}destroy(){this._shutdownJobHandler()}async calculateVolume(e,t){if(!(await this._fetchCapabilities(t?.signal)).operations.supportsCalculateVolume)throw new s("imagery-layer:compute-pixel-space-locations","this operation is not supported on the input image service");return e=n(e),this.mosaicRule&&null==e.mosaicRule&&(e.mosaicRule=this.mosaicRule),me(this.url,e,this._getRequestOptions(t))}async computeAngles(e,t){if(!(await this._fetchCapabilities(t?.signal)).operations.supportsComputeAngles)throw new s("imagery-layer:compute-angles","this operation is not supported on the input image service");return ce(this.url,e,this._getRequestOptions(t))}async computePixelSpaceLocations(e,t){if(!(await this._fetchCapabilities(t?.signal)).operations.supportsComputePixelLocation)throw new s("imagery-layer:compute-pixel-space-locations","this operation is not supported on the input image service");return he(this.url,e,this._getRequestOptions(t))}async computeHistograms(e,t){if(!(await this._fetchCapabilities(t?.signal)).operations.supportsComputeHistograms)throw new s("imagery-layer:compute-histograms","this operation is not supported on the input image service");return e=n(e),this._applyMosaicAndRenderingRules(e),de(this.url,e,this._getRequestOptions(t))}async computeStatisticsHistograms(e,t){if(!(await this._fetchCapabilities(t?.signal)).operations.supportsComputeStatisticsHistograms)throw new s("imagery-layer:compute-statistics-histograms","this operation is not supported on the input image service");return e=n(e),this._applyMosaicAndRenderingRules(e),fe(this.url,e,this._getRequestOptions(t))}async measureHeight(e,t){const i=await this._fetchCapabilities(t?.signal);if(!("base-and-top"===e.operationType?i.mensuration.supportsHeightFromBaseAndTop:"base-and-top-shadow"===e.operationType?i.mensuration.supportsHeightFromBaseAndTopShadow:i.mensuration.supportsHeightFromTopAndTopShadow))throw new s("imagery-layer:measure-height","this operation is not supported on the input image service");return e=n(e),this._applyMosaicRule(e),ge(this.url,e,this._getRequestOptions(t))}async measureAreaAndPerimeter(e,t){const i=await this._fetchCapabilities(t?.signal);if(!(i.mensuration.supportsAreaAndPerimeter&&(!e.is3D||i.mensuration.supports3D)))throw new s("imagery-layer:measure-area-and-perimeter","this operation is not supported on the input image service");return e=n(e),this._applyMosaicRule(e),ye(this.url,e,this._getRequestOptions(t))}async measureDistanceAndAngle(e,t){const i=await this._fetchCapabilities(t?.signal);if(!(i.mensuration.supportsDistanceAndAngle&&(!e.is3D||i.mensuration.supports3D)))throw new s("imagery-layer:measure-distance-and-angle","this operation is not supported on the input image service");return e=n(e),this._applyMosaicRule(e),Re(this.url,e,this._getRequestOptions(t))}async measurePointOrCentroid(e,t){const i=await this._fetchCapabilities(t?.signal);if(!(i.mensuration.supportsPointOrCentroid&&(!e.is3D||i.mensuration.supports3D)))throw new s("imagery-layer:measure-point-or-centroid","this operation is not supported on the input image service");return e=n(e),this._applyMosaicRule(e),Ie(this.url,e,this._getRequestOptions(t))}async measureLengthFromImage(e,t){if(!(await this._fetchCapabilities(t?.signal)).operations.supportsMeasureFromImage)throw new s("imagery-layer:measure-length-from-image","this operation is not supported on the input image service");if("polyline"!==e.geometry.type)throw new s("imagery-layer:measure-length-from-image","this input geometry must be a polyline");return ve(this.url,e,this._getRequestOptions(t))}async measureAreaFromImage(e,t){if(!(await this._fetchCapabilities(t?.signal)).operations.supportsMeasureFromImage)throw new s("imagery-layer:measure-area-from-image","this operation is not supported on the input image service");if("polygon"!==e.geometry.type)throw new s("imagery-layer:measure-area-from-image","this input geometry must be a polygon");return we(this.url,e,this._getRequestOptions(t))}getField(e){const{fieldsIndex:t}=this;return null!=t?t.get(e):void 0}getFieldDomain(e,t){const i=this.getField(e);return i?i.domain:null}fetchImage(e,t,i,n={}){if(r(a.getLogger(this),"`ImageryLayer.fetchImage` is deprecated in favor of 'ImageryLayer.fetchPixels'.",{replacement:"ImageryLayer.fetchPixels",version:"4.33",warnOnce:!0}),null==e||null==t||null==i)throw new s("imagery-layer:fetch-image","Insufficient parameters for requesting an image. A valid extent, width and height values are required.");return this.internalFetchImage(e,t,i,n)}async internalFetchImage(e,t,i,r={}){await this._updateCurrentRasterInfo();const{exportImageServiceParameters:s}=this;let n=!1;r.requestRawData&&(await this._initJobHandler(),s.requestRawData||"lerc"===this.format||(n=!0,s.requestRawData=!0));const a=this.getExportImageServiceParameters(e,t,i,r.timeExtent);if(n&&(s.requestRawData=!1),null==a){if(r.requestAsImageElement&&this._canRequestImageElement(this.format)){const e=document.createElement("canvas");if(e.width=t,e.height=i,r.returnImageBitmap){return{imageBitmap:await D(e,`${Ge(this.parsedUrl)}/exportImage`,r.signal)}}return{imageOrCanvasElement:e}}const{bandIds:s,rasterInfo:n}=this,a=(s?.length||n.bandCount)??0,o=t*i,l=n.pixelType,u=[];for(let e=0;e<a;e++)u.push(M.createEmptyBand(l,o));return{pixelData:{pixelBlock:new M({width:t,height:i,pixels:u,mask:new Uint8Array(o),pixelType:l}),extent:e}}}const o=!!r.requestAsImageElement&&!this.pixelFilter,l=o&&!!r.returnImageBitmap,u={imageServiceParameters:a,imageProps:{extent:e,width:t,height:i,format:this.format},requestAsImageElement:o,returnImageBitmap:l,signal:r.signal};return this._requestArrayBuffer(u)}async fetchPixels(e,t,i,r={}){await this._initJobHandler(),r.applyRendering&&this._updateCurrentRasterInfo();const s=r.applyRendering?void 0:new x({layer:this,requestRawData:!0,interpolation:r.interpolation??"nearest",bandIds:r.bandIds??[]}),n=this.getExportImageServiceParameters(e,t,i,r.timeExtent,s);if(null==n)return{extent:e,pixelBlock:null};delete n.pixelType,delete n.bandIds,delete n.compressionQuality;const a={imageServiceParameters:n,imageProps:{extent:e,width:t,height:i,format:this.format},requestAsImageElement:!1,returnImageBitmap:!1,signal:r.signal},{pixelData:o}=await this._requestArrayBuffer(a);return o??{extent:e,pixelBlock:null}}fetchKeyProperties(e){return i(Ge(this.parsedUrl)+"/keyProperties",{query:this._getQueryParams({renderingRule:this.version>=10.3?e?.rasterFunction:null})}).then(e=>e.data)}fetchRasterAttributeTable(e){return this.version<10.1?Promise.reject(new s("#fetchRasterAttributeTable()","Failed to get rasterAttributeTable")):i(Ge(this.parsedUrl)+"/rasterAttributeTable",{query:this._getQueryParams({renderingRule:this.version>=10.3?e?.rasterFunction:null})}).then(e=>Qe.fromJSON(e.data))}getCatalogItemRasterInfo(e,t){const i={...t,query:this._getQueryParams()};return je(Ge(this.parsedUrl),e,i)}async getCatalogItemICSInfo(e,t){const{data:r}=await i(Ge(this.parsedUrl)+"/"+e+"/info/ics",{query:this._getQueryParams(),...t}),s=r?.ics;if(!s)return;let n=null;try{n=(await i(Ge(this.parsedUrl)+"/"+e+"/info",{query:this._getQueryParams(),...t})).data.extent}catch{}if(!n?.spatialReference)return{ics:s,icsToPixelTransform:null,icsExtent:null,northDirection:null};const a=this.version>=10.7?i(Ge(this.parsedUrl)+"/"+e+"/info/icstopixel",{query:this._getQueryParams(),...t}).then(e=>e.data).catch(()=>({})):{},o=n.spatialReference,l={geometries:JSON.stringify({geometryType:"esriGeometryEnvelope",geometries:[n]}),inSR:v(o),outSR:"0:"+e},u=i(Ge(this.parsedUrl)+"/project",{query:this._getQueryParams(l),...t}).then(e=>e.data).catch(()=>({})),p=5,m=(n.xmin+n.xmax)/2,c=(n.ymax-n.ymin)/(p+1),h=n.ymin+c,d=[];for(let i=0;i<p;i++)d.push({x:m,y:h+c*i});const f={geometries:JSON.stringify({geometryType:"esriGeometryPoint",geometries:d}),inSR:v(o),outSR:"0:"+e},g=i(Ge(this.parsedUrl)+"/project",{query:this._getQueryParams(f),...t}).then(e=>e.data).catch(()=>({})),R=await Promise.all([a,u,g]);let w=R[0].ipxf;if(null==w){const e=s.geodataXform?.xf_0;"topup"===e?.name?.toLowerCase()&&6===e?.coefficients?.length&&(w={affine:{name:"ics [sensor: Frame] to pixel (column, row) transformation",coefficients:e.coefficients,cellsizeRatio:0,type:"GeometricXform"}})}const b=y.fromJSON(R[1]?.geometries?.[0]);b&&(b.spatialReference=new I({wkid:0,imageCoordinateSystem:s}));const S=R[2].geometries?R[2].geometries.filter(e=>null!=e?.x&&null!=e.y&&"NaN"!==e.x&&"NaN"!==e.y):[],x=S.length;if(x<3)return{ics:s,icsToPixelTransform:w,icsExtent:b,northDirection:null};let _=0,F=0,D=0,O=0;for(let i=0;i<x;i++)_+=S[i].x,F+=S[i].y,D+=S[i].x*S[i].x,O+=S[i].x*S[i].y;const T=(x*O-_*F)/(x*D-_*_);let C=0;const M=S[p-1].x>S[0].x,P=S[p-1].y>S[0].y;return T===1/0?C=P?90:270:0===T?C=M?0:180:T>0?C=M?180*Math.atan(T)/Math.PI:180*Math.atan(T)/Math.PI+180:T<0&&(C=P?180+180*Math.atan(T)/Math.PI:360+180*Math.atan(T)/Math.PI),{ics:s,icsToPixelTransform:w,icsExtent:b,northDirection:C}}async generateRasterInfo(e,t){e=c(G,e);const i={...t,query:this._getQueryParams()};if(!e||"none"===e.functionName?.toLowerCase()||this._isVectorFieldResampleFunction(e))return this.serviceRasterInfo??Pe(Ge(this.parsedUrl),this.sourceJSON,i);const r=ze(e);if(!r)throw new s("imagery-layer:generate-raster-info","the rendering rule is not supported");if(this._functionRasterInfos[r])return this._functionRasterInfos[r];const n=Ne(Ge(this.parsedUrl),e,i);this._functionRasterInfos[r]=n;try{return await n}catch(a){throw this._functionRasterInfos[r]=null,a}}getExportImageServiceParameters(e,t,i,r,s){e=e.clone().shiftCentralMeridian();const n=be(e.spatialReference,Ge(this.parsedUrl));s??=this.exportImageServiceParameters;const a=s.toJSON(),{bandIds:o,noData:l}=a;let{renderingRule:u}=a;const p=this.rasterFunction?.rasterFunctionDefinition,m=this.renderer?.type,c=!m||"raster-stretch"===m||"raster-colormap"===m||"unique-value"===m||"class-breaks"===m||"raster-shaded-relief"===m;if(o?.length&&this._hasRasterFunction(this.rasterFunction)&&!p&&c){const e={rasterFunction:"ExtractBand",rasterFunctionArguments:{BandIds:o}};if("Stretch"===u.rasterFunction)e.rasterFunctionArguments.Raster=u.rasterFunctionArguments.Raster,u.rasterFunctionArguments.Raster=e;else if("Colormap"===u.rasterFunction){const t=u.rasterFunctionArguments.Raster;"Stretch"===t?.rasterFunction?(e.rasterFunctionArguments.Raster=t.rasterFunctionArguments.Raster,t.rasterFunctionArguments.Raster=e):(e.rasterFunctionArguments.Raster=t,u.rasterFunctionArguments.Raster=e)}else e.rasterFunctionArguments.Raster=u,u=e;a.bandIds=void 0}else a.bandIds=o?.join(",");Array.isArray(l)&&l.length>0&&(a.noData=l.join(","));const h=this._processMultidimensionalIntersection(null,r,s.mosaicRule);if(h.isOutSide)return null;a.mosaicRule=null!=h.mosaicRule?JSON.stringify(h.mosaicRule):null,r=h.timeExtent,a.renderingRule=this._getRenderingRuleString(G.fromJSON(u));const d={};if(null!=r){const{start:e,end:t}=r.toJSON();e&&t&&e===t?d.time=""+e:null==e&&null==t||(d.time=`${e??"null"},${t??"null"}`)}return{bbox:e.xmin+","+e.ymin+","+e.xmax+","+e.ymax,bboxSR:n,imageSR:n,size:t+","+i,...a,...d}}async getSamples(e,t){const i=await this._fetchCapabilities(t?.signal);if(!i?.operations.supportsGetSamples)throw new s("imagery-layer:get-samples","getSamples operation is not supported on the input image service");e=n(e);const{raster:r}=this;return r&&null==e.raster&&(e.raster=r),Se(this.url,e,this._getRequestOptions(t))}async identify(e,t){if(!(await this._fetchCapabilities(t?.signal)).operations.supportsIdentify)throw new s("imagery-layer:identify","identify operation is not supported on the input image service");e=n(e),this.version<10.91&&"extent"===e.geometry?.type&&(e.geometry=R.fromExtent(e.geometry));const i=this._processMultidimensionalIntersection(e.geometry,e.timeExtent,e.mosaicRule||this.mosaicRule);if(i.isOutSide)throw new s("imagery-layer:identify","the request cannot be fulfilled when falling outside of the multidimensional subset");e.timeExtent=i.timeExtent,e.mosaicRule=i.mosaicRule;const{raster:r,rasterFunction:a}=this;return a&&null==e.rasterFunction&&(e.rasterFunction=a),r&&null==e.raster&&(e.raster=r),xe(this.url,e,this._getRequestOptions(t))}async imageToMap(e,t){if(!(await this._fetchCapabilities(t?.signal)).operations.supportsImageToMap)throw new s("imagery-layer:image-to-map","imageToMap operation is not supported on the input image service");return _e(Ge(this.parsedUrl),e,this._getRequestOptions(t))}async imageToMapMultiray(e,t){if(!(await this._fetchCapabilities(t?.signal)).operations.supportsImageToMapMultiray)throw new s("imagery-layer:image-to-map-multiray","imageToMapMultiray operation is not supported on the input image service");return Fe(Ge(this.parsedUrl),e,this._getRequestOptions(t))}async mapToImage(e,t){if(!(await this._fetchCapabilities(t?.signal)).operations.supportsMapToImage)throw new s("imagery-layer:map-to-image","mapToImage operation is not supported on the input image service");return De(Ge(this.parsedUrl),e,this._getRequestOptions(t))}async findImages(e,t){if(!(await this._fetchCapabilities(t?.signal)).operations.supportsFindImages)throw new s("imagery-layer:find-images","findImages operation is not supported on the input image service");return Oe(Ge(this.parsedUrl),e,this._getRequestOptions(t))}async getImageUrl(e,t){if(!(await this._fetchCapabilities(t?.signal)).operations.supportsGetImageUrl)throw new s("imagery-layer:get-image-url","getImageUrl operation is not supported on the input image service");return Te(Ge(this.parsedUrl),e,this._getRequestOptions(t))}createQuery(){return new Ue({outFields:["*"],returnGeometry:!0,where:this.definitionExpression||"1=1"})}async queryBoundary(e,t){if(!(await this._fetchCapabilities(t?.signal)).operations.supportsQueryBoundary)throw new s("imagery-layer:query-boundary","queryBoundary operation is not supported on the input image service");return e=e??{outSpatialReference:this.spatialReference},Ce(Ge(this.parsedUrl),e,this._getRequestOptions(t))}async queryRasters(e,t){({query:e,requestOptions:t}=await this._prepareForQuery(e,t));const i=await Ve(this.url,e,t),r=this.graphicOrigin;return i.features.forEach(e=>{e.layer=this,e.origin=r}),i}async queryObjectIds(e,t){return({query:e,requestOptions:t}=await this._prepareForQuery(e,t)),Ae(this.url,e,t)}async queryGPSInfo(e,t){if(!(await this._fetchCapabilities(t?.signal)).operations.supportsQueryGPSInfo)throw new s("imagery-layer:query-gps-info","queryGPSInfo operation is not supported on the input image service");return e=e??{where:"1=1"},Me(Ge(this.parsedUrl),e,this._getRequestOptions(t))}async queryRasterCount(e,t){return({query:e,requestOptions:t}=await this._prepareForQuery(e,t)),Ee(this.url,e,t)}async queryVisibleRasters(e,t){if(!e)throw new s("imagery-layer: query-visible-rasters","missing query parameter");await this.load();const{pixelSize:i,returnDomainValues:r,returnTopmostRaster:n,showNoDataRecords:a}=t||{pixelSize:null,returnDomainValues:!1,returnTopmostRaster:!1,showNoDataRecords:!1};let o=!1,l=null,u=null;const p=L.servicePixelValue.toLowerCase(),m=this._rasterFunctionNamesIndex;if(null!=e.outFields&&(o=e.outFields.some(e=>!e.toLowerCase().startsWith(p)),this.version>=10.4)){const t=e.outFields.filter(e=>e.toLowerCase().startsWith(p)&&e.length>p.length).map(e=>{const t=e.slice(p.length+1);return[this._updateRenderingRulesFunctionName(t,m),t]});l=t.map(e=>new G({functionName:e[0]})),u=t.map(e=>e[1]);const{rasterFunction:i}=this;0===l.length?i?.functionName?(l.push(i),u.push(i.functionName)):l=null:i?.functionName&&!l.some(e=>e.functionName===i.functionName)&&(l.push(i),u.push(i.functionName))}const c=null==e.outSpatialReference||e.outSpatialReference.equals(this.spatialReference),{multidimensionalSubset:h}=this;let d=e.timeExtent||this.timeExtent;if(h){const{isOutside:t,intersection:i}=W(h,{geometry:e.geometry,timeExtent:e.timeExtent,multidimensionalDefinition:this.exportImageServiceParameters.mosaicRule?.multidimensionalDefinition});if(t)throw new s("imagery-layer:query-visible-rasters","the request cannot be fulfilled when falling outside of the multidimensional subset");null!=i?.timeExtent&&(d=i.timeExtent)}const f=this._combineMosaicRuleWithTimeExtent(this.exportImageServiceParameters.mosaicRule,d);let g=e.geometry;this.version<10.91&&"extent"===g?.type&&(g=R.fromExtent(g));const y=this._getQueryParams({geometry:g,timeExtent:d,mosaicRule:f,rasterFunction:this.version<10.4?this.rasterFunction:null,rasterFunctions:l,pixelSize:i,returnCatalogItems:o,returnGeometry:c,raster:this.raster,maxItemCount:n?1:null});delete y.f;const I=new Je(y);try{await this._generateRasterInfo(this.rasterFunction);const i=await xe(this.url,I,{signal:t?.signal,query:{...this.customParameters}}),s=e.outFields,n=null!=i.value&&i.value.toLowerCase().includes("nodata"),l=o&&!c&&i?.catalogItems?.features.length&&(a||!n),p=this.multidimensionalInfo&&"raster-dataset"===this.sourceType?$({rasterInfo:this.rasterInfo,multidimensionalDefinition:f?.multidimensionalDefinition,timeExtent:d,multidimensionalSubset:this.multidimensionalSubset}):null;if(!l)return this._processVisibleRastersResponse(i,{returnDomainValues:r,templateRRFunctionNames:u,showNoDataRecords:a,templateFields:s,effectiveMultidimensionalDefinition:p});const m=this.objectIdField||"ObjectId",h=i.catalogItems?.features??[],g=h.map(e=>e.attributes?.[m]),y=new Ue({objectIds:g,returnGeometry:!0,outSpatialReference:e.outSpatialReference,outFields:[m]}),R=await this.queryRasters(y);return R?.features?.length&&R.features.forEach(t=>{h.forEach(i=>{i.attributes[m]===t.attributes[m]&&t.geometry&&(i.geometry=t.geometry.clone(),null!=e.outSpatialReference&&(i.geometry.spatialReference=e.outSpatialReference))})}),this._processVisibleRastersResponse(i,{returnDomainValues:r,templateRRFunctionNames:u,showNoDataRecords:a,templateFields:s,effectiveMultidimensionalDefinition:p})}catch{throw new s("imagery-layer:query-visible-rasters","encountered error when querying visible rasters")}}async fetchVariableStatisticsHistograms(e,t){const r=i(Ge(this.parsedUrl)+"/statistics",{query:this._getQueryParams({variable:e}),signal:t}).then(e=>e.data?.statistics),s=i(Ge(this.parsedUrl)+"/histograms",{query:this._getQueryParams({variable:e}),signal:t}).then(e=>e.data?.histograms),n=await Promise.all([r,s]);return n[0]&&n[0].forEach(e=>{e.avg=e.mean,e.stddev=e.standardDeviation}),{statistics:n[0]||null,histograms:n[1]||null}}getMultidimensionalSubsetVariables(e){const t=e??this.serviceRasterInfo.multidimensionalInfo;return X(this.multidimensionalSubset,t)}async _fetchService(e){await this._fetchServiceInfo(e),this.rasterInfo||(this.rasterInfo=this.serviceRasterInfo);const t=this.sourceJSON,i=null!=this.serviceRasterInfo?Promise.resolve(this.serviceRasterInfo):Pe(Ge(this.parsedUrl),t,{signal:e,query:this._getQueryParams()}).then(e=>(this._set("serviceRasterInfo",e),this._set("multidimensionalInfo",e.multidimensionalInfo),qe(e,t),e)),r=this._hasRasterFunction(this.rasterFunction)?this._generateRasterInfo(this.rasterFunction,{signal:e}):null,s=this._getRasterFunctionInfos();return Promise.all([i,r,s]).then(e=>{e[1]?this._set("rasterInfo",e[1]):this._set("rasterInfo",e[0]),e[2]&&this._set("rasterFunctionInfos",e[2]),this.internalRenderer&&!this._isSupportedRenderer(this.internalRenderer)&&(this._set("internalRenderer",null),a.getLogger(this).warn("ArcGISImageService","Switching to the default renderer. Renderer applied is not valid for this Imagery Layer")),this._set("internalRenderer",this._configRenderer(this.renderer)),this.addHandles([o(()=>this.rasterFunction,e=>{(this.renderer||this.symbolizer||this.popupEnabled&&this.popupTemplate)&&this._generateRasterInfo(e).then(e=>{e&&(this.rasterInfo=e)})})]);const{serviceRasterInfo:t}=this;null!=t.multidimensionalInfo&&this._updateMultidimensionalDefinition(t)})}_combineMosaicRuleWithTimeExtent(e,t){const i=this.timeInfo,{multidimensionalInfo:r}=this.serviceRasterInfo;if(null==e||null==r||null==t||null==i?.startField)return e;const{startField:s}=i,n=r.variables.some(e=>e.dimensions.some(e=>e.name===s))?s:"StdTime";if(e=e.clone(),"mosaic-dataset"===this.sourceType)return e.multidimensionalDefinition=e.multidimensionalDefinition?.filter(e=>e.dimensionName!==n),this._cleanupMultidimensionalDefinition(e);e.multidimensionalDefinition=e.multidimensionalDefinition||[];const a=e.multidimensionalDefinition.filter(e=>e.dimensionName===n),o=null!=t.start?t.start.getTime():null,l=null!=t.end?t.end.getTime():null,u=null==o||null==l||o===l,p=u?[o||l]:[[o,l]],m=this.version>=10.8;if(a.length)a.forEach(e=>{e.dimensionName===n&&(m?(e.dimensionName=null,e.isSlice=!1,e.values=[]):(e.isSlice=u,e.values=p))});else if(!m){const t=e.multidimensionalDefinition.filter(e=>null!=e.variableName&&null==e.dimensionName);t.length?t.forEach(e=>{e.dimensionName=n,e.isSlice=u,e.values=p}):e.multidimensionalDefinition.push(new S({variableName:"",dimensionName:n,isSlice:u,values:p}))}return this._cleanupMultidimensionalDefinition(e)}_cleanupMultidimensionalDefinition(e){return null==e?null:(e.multidimensionalDefinition&&(e.multidimensionalDefinition=e.multidimensionalDefinition.filter(e=>!(!e.variableName&&!e.dimensionName)),0===e.multidimensionalDefinition.length&&(e.multidimensionalDefinition=null)),"mosaic-dataset"!==this.sourceType&&null==e.multidimensionalDefinition?null:e)}async _prepareForQuery(e,t){if(!(await this._fetchCapabilities(t?.signal)).operations.supportsQuery)throw new s("imagery-layer:query-rasters","query operation is not supported on the input image service");return e=null!=e?c(Ue,e):this.createQuery(),t=this._getRequestOptions(t),this.raster&&(t.query={...t.query,raster:this.raster}),{query:e,requestOptions:t}}_isSupportedRenderer(e){const{rasterInfo:t,rasterFunction:i}=this;return"unique-value"===e.type&&this._hasRasterFunction(i)&&1===t?.bandCount&&["u8","s8"].includes(t.pixelType)||null!=t&&null!=e&&re(t).includes(e.type)}async _fetchCapabilities(e){return this.capabilities||await this._fetchServiceInfo(e),this.capabilities}async _fetchServiceInfo(e){let t=this.sourceJSON;if(!t){const{data:r,ssl:s}=await i(Ge(this.parsedUrl),{query:this._getQueryParams(),signal:e});t=r,this.sourceJSON=t,s&&(this.url=this.url.replace(/^http:/i,"https:"))}if(t.capabilities?.toLowerCase().split(",").map(e=>e.trim()).indexOf("tilesonly")>-1)throw new s("imagery-layer:fetch-service-info","use ImageryTileLayer to open tiles-only image services");this.read(t,{origin:"service",url:this.parsedUrl})}_isMosaicDataset(e){return e.serviceSourceType?"esriImageServiceSourceTypeMosaicDataset"===e.serviceSourceType:e.fields?.length>0}_isMosaicRuleSupported(e){if(!e)return!1;const t=this._isMosaicDataset(e),i=e.currentVersion>=10.71&&e.hasMultidimensions&&!(e.fields?.length>1);return t||i}_isVectorFieldResampleFunction(e){if(null==e)return!1;const{functionName:t,functionArguments:i}=e,r="resample"===t?.toLowerCase(),s=i?.ResampleType||i?.resampleType;return r&&(7===s||10===s)}_isPicture(){return!this.format||this.format.includes("jpg")||this.format.includes("png")}_configRenderer(e){const t=this._isPicture(),{rasterInfo:i}=this;if(!t&&!this.pixelFilter||this._isVectorDataSet()){const t=this.mosaicRule?.multidimensionalDefinition?.[0].variableName,r=se({variableName:t,rasterFunctionName:this.rasterFunction?.functionName,presetRenderers:this.presetRenderers});if(!this.bandIds&&i.bandCount>=3){const e=r?.bandIds??ne(i);!e||3===i.bandCount&&0===e[0]&&1===e[1]&&2===e[2]||(this.bandIds=e)}e||(e=r?.renderer??ie(i,{bandIds:this.bandIds,variableName:this.rasterFunction?null:t}));const s=ae(e.toJSON());this.symbolizer?(this.symbolizer.rendererJSON=s,this.symbolizer.rasterInfo=i):this.symbolizer=new oe({rendererJSON:s,rasterInfo:i}),this.symbolizer.bind().success||(this.symbolizer=null)}return e}_clonePixelData(e){return null==e?e:{extent:e.extent&&e.extent.clone(),pixelBlock:null!=e.pixelBlock?e.pixelBlock.clone():null}}_getQueryParams(e){null!=e?.renderingRule&&"string"!=typeof e.renderingRule&&(e.renderingRule=this._getRenderingRuleString(e.renderingRule));const{raster:t,viewId:i}=this;return{raster:t,viewId:i,f:"json",...e,...this.customParameters}}_getRequestOptions(e){return{...e,query:{...e?.query,...this.customParameters}}}_decodePixelBlock(e,t,i){return this._rasterJobHandler?this._rasterJobHandler.decode({data:e,options:t}):Y(e,t,i)}async _getRasterFunctionInfos(e){const t=this.sourceJSON.rasterFunctionInfos;if(this.loaded)return t;if(t&&this.version>=10.3){if(1===t.length&&"none"===t[0].name.toLowerCase())return t;const r=await i(Ge(this.parsedUrl)+"/rasterFunctionInfos",{query:this._getQueryParams(),signal:e});return r.data?.rasterFunctionInfos}return null}_canRequestImageElement(e){return!this.pixelFilter&&(!e||e.includes("png"))}async _requestArrayBuffer(e){const{imageProps:t,requestAsImageElement:r,returnImageBitmap:n,signal:a}=e;if(r&&this._canRequestImageElement(t.format)){const r=`${Ge(this.parsedUrl)}/exportImage`,{data:s}=await i(r,{responseType:n?"blob":"image",query:this._getQueryParams({f:"image",...this.refreshParameters,...e.imageServiceParameters}),signal:a});if(s instanceof Blob){return{imageBitmap:await D(s,r,a),params:t}}return{imageOrCanvasElement:s,params:t}}const o=this._initJobHandler(),l=i(Ge(this.parsedUrl)+"/exportImage",{responseType:"array-buffer",query:this._getQueryParams({f:"image",...e.imageServiceParameters}),signal:a}),u=(await Promise.all([l,o]))[0].data,p=t.format||"jpgpng";let m=p;if("bsq"!==m&&"bip"!==m&&(m=Z(u)),!m)throw new s("imagery-layer:fetch-image","unsupported format signature "+String.fromCharCode.apply(null,new Uint8Array(u)));const c={signal:a},h="gif"===p||"bmp"===p||p.includes("png")&&("png"===m||"jpg"===m)?Y(u,{useCanvas:!0,...t},c):this._decodePixelBlock(u,{width:t.width,height:t.height,planes:null,pixelType:null,noDataValue:null,format:p},c);return{pixelData:{pixelBlock:await h,extent:t.extent},params:t}}_generateRasterInfo(e,t){return this.generateRasterInfo(e,t).catch(()=>null)}_isValidCustomizedMosaicRule(e){return e&&JSON.stringify(e.toJSON())!==JSON.stringify(this.defaultMosaicRule?.toJSON())}_updateMultidimensionalDefinition(e){if(this._isValidCustomizedMosaicRule(this.mosaicRule))return;let t=K(e,{multidimensionalSubset:this.multidimensionalSubset});if(null!=t&&t.length>0){this.mosaicRule=this.mosaicRule||new T;const e=this.mosaicRule.multidimensionalDefinition;!this.sourceJSON.defaultVariableName&&this.rasterFunction&&"none"!==this.rasterFunction.functionName?.toLowerCase()&&t.forEach(e=>e.variableName=""),t=t.filter(({variableName:e,dimensionName:t})=>e&&"*"!==e||t),!e?.length&&t.length&&(this.mosaicRule.multidimensionalDefinition=t)}}_processVisibleRastersResponse(e,i){i=i||{};const r=e.value,{templateRRFunctionNames:s,showNoDataRecords:n,returnDomainValues:a,templateFields:o}=i,l=e.processedValues;let u=e.catalogItems?.features,p=e.properties?.Values?.map(e=>e.replaceAll(/ /gi,", "))||[];const m=this.objectIdField||"ObjectId",c="string"==typeof r&&r.toLowerCase().includes("nodata"),h=[];if(r&&!u&&(!c||n)){const e={};e[m]=0;p=[r],u=[new t({geometry:this.fullExtent,attributes:e})],this.multidimensionalInfo&&"raster-dataset"===this.sourceType&&z(this.rasterFields,e,i.effectiveMultidimensionalDefinition)}if(!u)return[];this._updateResponseFieldNames(u,o),c&&!n&&(u=[]);const{itemPixelValue:d,servicePixelValue:f}=L,g=this.rasterFields.some(e=>e.name===d),y=this.graphicOrigin;for(let t=0;t<u.length;t++){const e=u[t];if(null!=r){const i=p[t],a=this.rasterFunction&&l&&l.length>0&&s&&s.length>0&&s.includes(this.rasterFunction.functionName)?l[s.indexOf(this.rasterFunction.functionName)]:r;if("nodata"===i.toLowerCase()&&!n)continue;g&&(e.attributes[d]=i),e.attributes[f]=a,this._updateFeatureWithMagDirValues(e,i);const o=this.fields&&this.fields.length>0;let u=this.rasterFunction&&null!=this.serviceRasterInfo.attributeTable?o?i:r:a;this.rasterFunction||(u=o?i:r),this._updateFeatureWithRasterAttributeTableValues(e,u)}if(e.sourceLayer=e.layer=this,e.origin=y,a&&this._updateFeatureWithDomainValues(e),s&&l&&s.length===l.length)for(let t=0;t<s.length;t++){const i=`${L.servicePixelValue}.${s[t]}`;e.attributes[i]=l[t]}h.push(u[t])}return h}_processMultidimensionalIntersection(e,t,i){const{multidimensionalSubset:r}=this;if(!r)return{isOutSide:!1,timeExtent:t,mosaicRule:i=this._combineMosaicRuleWithTimeExtent(i,t)};if(r){const{isOutside:i,intersection:s}=W(r,{geometry:e,timeExtent:t});if(i)return{isOutSide:!0,timeExtent:null,mosaicRule:null};null!=s?.timeExtent&&(t=s.timeExtent)}if(i=this._combineMosaicRuleWithTimeExtent(i,t),i?.multidimensionalDefinition){const{isOutside:e}=W(r,{multidimensionalDefinition:i.multidimensionalDefinition});if(e)return{isOutSide:!0,timeExtent:null,mosaicRule:null}}return{isOutSide:!1,timeExtent:t,mosaicRule:i}}_updateFeatureWithRasterAttributeTableValues(e,t){const i=this.rasterInfo.attributeTable||this.serviceRasterInfo.attributeTable;if(null==i)return;const{features:r,fields:s}=i,n=s.map(e=>e.name).find(e=>"value"===e.toLowerCase());if(!n)return;const a=r.filter(e=>e.attributes[n]===(null!=t?parseInt(t,10):null));a&&a[0]&&s.forEach(t=>{const i=H+t.name;e.attributes[i]=a[0].attributes[t.name]})}_updateFeatureWithMagDirValues(e,t){if(!this._isVectorDataSet())return;const i=t.split(/,\s*/).map(e=>parseFloat(e)),r=i.map(e=>[e]),s=i.map(e=>({minValue:e,maxValue:e,noDataValue:null})),n=new M({height:1,width:1,pixelType:"f32",pixels:r,statistics:s});null!=this.pixelFilter&&this.pixelFilter({pixelBlock:n,extent:new y(0,0,0,0,this.spatialReference)});const a="esriImageServiceDataTypeVector-MagDir"===this.serviceDataType?[n.pixels[0][0],n.pixels[1][0]]:te([n.pixels[0][0],n.pixels[1][0]]);e.attributes[L.magnitude]=a[0],e.attributes[L.direction]=a[1]}_updateFeatureWithDomainValues(e){const t=this.fields&&this.fields.filter(e=>e.domain&&"coded-value"===e.domain.type);null!=t&&t.forEach(t=>{const i=e.attributes[t.name];if(null!=i){const r=t.domain.codedValues.find(e=>e.code===i);r&&(e.attributes[t.name]=r.name)}})}_updateResponseFieldNames(e,t){if(!t||t.length<1)return;const i=this.fieldsIndex;null!=i&&e.forEach(e=>{if(e?.attributes)for(const r of t){const t=i.get(r)?.name;t&&t!==r&&(e.attributes[r]=e.attributes[t],delete e.attributes[t])}})}_getRenderingRuleString(e){if(e){let t=e.toJSON();return t=t.rasterFunctionDefinition??t,(t.thumbnail||t.thumbnailEx)&&(t.thumbnail=t.thumbnailEx=null),JSON.stringify(t)}return null}_hasRasterFunction(e){return null!=e?.functionName&&"none"!==e.functionName.toLowerCase()}_updateRenderingRulesFunctionName(e,t){if(!e||e.length<1)return;if("Raw"===e)return e.replace("Raw","None");const i=e.toLowerCase().replaceAll(/ /gi,"_");return t.has(i)?t.get(i):e}_isRFTJson(e){return e?.name&&e.arguments&&e.function&&e.hasOwnProperty("functionType")}_isVectorDataSet(){return"esriImageServiceDataTypeVector-UV"===this.serviceDataType||"esriImageServiceDataTypeVector-MagDir"===this.serviceDataType}_applyMosaicAndRenderingRules(e){const{raster:t,mosaicRule:i,rasterFunction:r}=this;r&&null==e.rasterFunction&&(e.rasterFunction=r),i&&null==e.mosaicRule&&(e.mosaicRule=i),t&&null==e.raster&&(e.raster=t)}async _updateCurrentRasterInfo(e){if(this.renderer||this.symbolizer){const t=await this._generateRasterInfo(this.rasterFunction,{signal:e});t&&(this.rasterInfo=t)}}_applyMosaicRule(e){const{raster:t,mosaicRule:i}=this;i&&null==e.mosaicRule&&(e.mosaicRule=i),t&&null==e.raster&&(e.raster=t)}_readCapabilities(e){const t=e.capabilities?e.capabilities.toLowerCase().split(",").map(e=>e.trim()):["image","catalog"],{currentVersion:i,maxRecordCount:r}=e,s=t.includes("image"),n="esriImageServiceDataTypeElevation"===e.serviceDataType,a=!(!e.spatialReference&&!e.extent?.spatialReference),o=t.includes("edit"),l=t.includes("mensuration")&&a,u=null==e.mensurationCapabilities?[]:e.mensurationCapabilities.toLowerCase().split(",").map(e=>e.trim()),p=l&&u.includes("basic"),m=this._isMosaicDataset(e)&&t.includes("catalog"),c=t.includes("download"),h=i>=10.7&&n||i>=11.4&&(n||l&&u.includes("3d")),d=m&&e.fields&&e.fields.length>0,f=d&&e.supportsAdvancedQueries?e.advancedQueryCapabilities:void 0;return{data:{supportsAttachment:!1},operations:{supportsComputeHistograms:s,supportsExportImage:s,supportsIdentify:s,supportsImageToMap:i>=11.2&&m,supportsImageToMapMultiray:i>=11.2&&m,supportsMapToImage:i>=11.2&&m,supportsFindImages:i>=11.2&&m,supportsGetImageUrl:i>=11.3&&c,supportsMeasure:l,supportsMeasureFromImage:i>=11.2,supportsDownload:c,supportsQuery:d,supportsGetSamples:i>=10.2&&s,supportsProject:i>=10.3&&s,supportsComputeStatisticsHistograms:i>=10.4&&s,supportsQueryBoundary:i>=10.6&&s,supportsCalculateVolume:h,supportsComputePixelLocation:i>=10.7&&m,supportsComputeAngles:i>=10.91,supportsQueryGPSInfo:i>=11.2&&m,supportsAdd:o,supportsDelete:o,supportsEditing:o,supportsUpdate:o,supportsCalculate:!1,supportsTruncate:!1,supportsValidateSql:!1,supportsChangeTracking:!1,supportsQueryAttachments:!1,supportsResizeAttachments:!1,supportsSync:!1,supportsExceedsLimitStatistics:!1,supportsQueryAnalytics:!1,supportsQueryBins:!1,supportsQueryTopFeatures:!1,supportsAsyncConvert3D:!1},query:{maxRecordCount:r,maxRecordCountFactor:void 0,maxUniqueIDCount:void 0,supportsStatistics:!!f?.supportsStatistics,supportsOrderBy:!!f?.supportsOrderBy,supportsDistinct:!!f?.supportsDistinct,supportsPagination:!!f?.supportsPagination,supportsPaginationOnAggregatedQueries:!!f?.supportsPaginationOnAggregatedQueries,supportsStandardizedQueriesOnly:!!f?.useStandardizedQueries,supportsPercentileStatistics:!!f?.supportsPercentileStatistics,supportsCentroid:!!f?.supportsReturningGeometryCentroid,supportsCentroidOnDegeneratedQuantizedGeometry:!1,supportsCurrentUser:!1,supportsDegeneratedQuantizedGeometry:!1,supportsDistance:!!f?.supportsQueryWithDistance,supportsExtent:!!f?.supportsReturningQueryExtent,supportsGeometryProperties:!!f?.supportsReturningGeometryProperties,supportsHavingClause:!!f?.supportsHavingClause,supportsQuantization:!1,supportsQuantizationEditMode:!1,supportsQueryGeometry:!1,supportsResultType:!1,supportsReturnMesh:!1,supportsMaxRecordCountFactor:!1,supportsSqlExpression:f?.supportsSqlExpression??!!f,supportsTopFeaturesQuery:!1,supportsQueryByAnonymous:!1,supportsQueryByOthers:!1,supportsHistoricMoment:!1,supportsFormatPBF:!1,supportsDisjointSpatialRelationship:!1,supportsCacheHint:!1,supportsSpatialAggregationStatistics:!1,supportedSpatialAggregationStatistics:{envelope:!1,centroid:!1,convexHull:!1},supportsDefaultSpatialReference:!!f?.supportsDefaultSR,supportsFullTextSearch:!1,supportsCompactGeometry:!1,standardMaxRecordCount:void 0,tileMaxRecordCount:void 0,supportsTrueCurve:!1},mensuration:{supportsDistanceAndAngle:p,supportsAreaAndPerimeter:p,supportsPointOrCentroid:p,supportsHeightFromBaseAndTop:l&&u.includes("base-top height"),supportsHeightFromBaseAndTopShadow:l&&u.includes("base-top shadow height"),supportsHeightFromTopAndTopShadow:l&&u.includes("top-top shadow height"),supports3D:l&&u.includes("3d")}}}};function Ge(e){return e?.path??""}return e([u({clonable:!1})],He.prototype,"_functionRasterInfos",void 0),e([u({readOnly:!0})],He.prototype,"_serviceSupportsMosaicRule",void 0),e([d("_serviceSupportsMosaicRule",["currentVersion","fields"])],He.prototype,"readServiceSupportsMosaicRule",null),e([u({readOnly:!0})],He.prototype,"_rasterFunctionNamesIndex",null),e([u()],He.prototype,"adjustAspectRatio",void 0),e([u({type:[p],json:{write:!0}})],He.prototype,"bandIds",void 0),e([d("bandIds")],He.prototype,"readBandIds",null),e([u({readOnly:!0,json:{read:!1}})],He.prototype,"capabilities",void 0),e([d("service","capabilities",["capabilities","currentVersion","serviceDataType"])],He.prototype,"readCapabilities",null),e([u({type:Number})],He.prototype,"compressionQuality",void 0),e([g("compressionQuality")],He.prototype,"writeCompressionQuality",null),e([u({type:Number})],He.prototype,"compressionTolerance",void 0),e([g("compressionTolerance")],He.prototype,"writeCompressionTolerance",null),e([u({json:{read:{source:"copyrightText"}}})],He.prototype,"copyright",void 0),e([u({readOnly:!0,dependsOn:["_serviceSupportsMosaicRule"]})],He.prototype,"defaultMosaicRule",void 0),e([d("defaultMosaicRule",["defaultMosaicMethod"])],He.prototype,"readDefaultMosaicRule",null),e([u({type:String,json:{name:"layerDefinition.definitionExpression",write:{enabled:!0,allowNull:!0}}})],He.prototype,"definitionExpression",void 0),e([u({readOnly:!0,constructOnly:!0})],He.prototype,"exportImageServiceParameters",void 0),e([u()],He.prototype,"rasterInfo",void 0),e([u({readOnly:!0,type:[_]})],He.prototype,"fields",void 0),e([u({readOnly:!0})],He.prototype,"fieldsIndex",null),e([u({type:["png","png8","png24","png32","jpg","bmp","gif","jpgpng","lerc","tiff","bip","bsq"],json:{write:!0}})],He.prototype,"format",null),e([d("service","format",["serviceDataType"])],He.prototype,"readFormat",null),e([u({type:y})],He.prototype,"fullExtent",void 0),e([u({readOnly:!0})],He.prototype,"hasMultidimensions",void 0),e([u({json:{read:{source:"maxImageHeight"}}})],He.prototype,"imageMaxHeight",void 0),e([u({json:{read:{source:"maxImageWidth"}}})],He.prototype,"imageMaxWidth",void 0),e([u({type:String,json:{type:P.jsonValues,read:P.read,write:P.write}})],He.prototype,"interpolation",void 0),e([u()],He.prototype,"minScale",void 0),e([d("service","minScale")],He.prototype,"readMinScale",null),e([u()],He.prototype,"maxScale",void 0),e([d("service","maxScale")],He.prototype,"readMaxScale",null),e([u({type:T})],He.prototype,"mosaicRule",null),e([d("mosaicRule",["mosaicRule","defaultMosaicMethod"])],He.prototype,"readMosaicRule",null),e([g("mosaicRule")],He.prototype,"writeMosaicRule",null),e([u()],He.prototype,"multidimensionalInfo",void 0),e([u({type:C,json:{write:!0}})],He.prototype,"multidimensionalSubset",void 0),e([u({json:{type:p}})],He.prototype,"noData",void 0),e([g("noData")],He.prototype,"writeNoData",null),e([u({type:String,json:{type:N.jsonValues,read:N.read,write:N.write}})],He.prototype,"noDataInterpretation",void 0),e([u({type:String,readOnly:!0,json:{read:{source:["fields"]}}})],He.prototype,"objectIdField",void 0),e([d("objectIdField")],He.prototype,"readObjectIdField",null),e([u({readOnly:!0})],He.prototype,"geometryType",void 0),e([u({})],He.prototype,"typeIdField",void 0),e([u({})],He.prototype,"types",void 0),e([u({readOnly:!0})],He.prototype,"parsedUrl",null),e([u({type:Function})],He.prototype,"pixelFilter",void 0),e([u()],He.prototype,"raster",void 0),e([u({readOnly:!0})],He.prototype,"sourceType",void 0),e([d("sourceType",["serviceSourceType","fields"])],He.prototype,"readSourceType",null),e([u()],He.prototype,"viewId",void 0),e([u()],He.prototype,"renderer",null),e([u({types:ue,json:{name:"layerDefinition.drawingInfo.renderer",origins:{"web-scene":{types:le,name:"layerDefinition.drawingInfo.renderer",write:{overridePolicy:e=>({enabled:e&&"vector-field"!==e.type})}}}}})],He.prototype,"internalRenderer",null),e([d("internalRenderer")],He.prototype,"readRenderer",null),e([g("internalRenderer")],He.prototype,"writeRenderer",null),e([u({clonable:!1})],He.prototype,"symbolizer",void 0),e([u(w)],He.prototype,"opacity",void 0),e([u({readOnly:!0})],He.prototype,"rasterFields",null),e([u({constructOnly:!0})],He.prototype,"rasterFunctionInfos",void 0),e([u({type:G,json:{name:"renderingRule"}})],He.prototype,"rasterFunction",null),e([d("rasterFunction",["renderingRule","rasterFunctionInfos"])],He.prototype,"readRasterFunction",null),e([u({readOnly:!0})],He.prototype,"serviceDataType",void 0),e([u({readOnly:!0,type:I})],He.prototype,"spatialReference",void 0),e([d("spatialReference",["spatialReference","extent"])],He.prototype,"readSpatialReference",null),e([u({type:q.apiValues,json:{read:q.read,type:q.jsonValues}})],He.prototype,"pixelType",void 0),e([g("pixelType")],He.prototype,"writePixelType",null),e([u({constructOnly:!0,type:k})],He.prototype,"serviceRasterInfo",void 0),e([u()],He.prototype,"sourceJSON",void 0),e([u(b)],He.prototype,"url",void 0),e([u({readOnly:!0})],He.prototype,"version",void 0),e([d("version",["currentVersion","fields","timeInfo"])],He.prototype,"readVersion",null),He=e([f("esri.layers.mixins.ArcGISImageService")],He),He};export{He as ArcGISImageService};
|
|
5
|
+
import{__decorate as e}from"tslib";import t from"../../Graphic.js";import i from"../../request.js";import{deprecatedFunction as r}from"../../core/deprecate.js";import s from"../../core/Error.js";import{clone as n}from"../../core/lang.js";import a from"../../core/Logger.js";import{watch as o}from"../../core/reactiveUtils.js";import{urlToObject as l}from"../../core/urlUtils.js";import{property as u}from"../../core/accessorSupport/decorators/property.js";import{Integer as p,ensureRange as m,ensureClass as c,ensureNumber as h}from"../../core/accessorSupport/ensureType.js";import{reader as d}from"../../core/accessorSupport/decorators/reader.js";import{subclass as f}from"../../core/accessorSupport/decorators/subclass.js";import{writer as g}from"../../core/accessorSupport/decorators/writer.js";import y from"../../geometry/Extent.js";import R from"../../geometry/Polygon.js";import I from"../../geometry/SpatialReference.js";import{srToRESTValue as v}from"../../geometry/support/spatialReferenceUtils.js";import{opacity as w,url as b}from"../support/commonProperties.js";import S from"../support/DimensionalDefinition.js";import{ExportImageServiceParameters as x}from"../support/ExportImageServiceParameters.js";import _ from"../support/Field.js";import F from"../support/FieldsIndex.js";import{createBitmap as D}from"../support/imageBitmapUtils.js";import{isSupportedRendererType as O}from"../support/imageryRendererUtils.js";import T from"../support/MosaicRule.js";import C from"../support/MultidimensionalSubset.js";import M from"../support/PixelBlock.js";import{interpolationKebab as P,noDataInterpretationKebab as N,pixelTypeKebabDict as q}from"../support/rasterEnums.js";import{getServicePixelValueField as j,getItemPixelValueField as E,getRawServicePixelValueField as A,getProcessedServicePixelValueField as V,getMagnitudeField as Q,getDirectionField as J,getMultidimensionalFields as U,getRasterAttributeTableFields as B,commonRasterFieldNames as L,addMultidimensionalFieldValues as z,rasterFieldPrefix as H}from"../support/rasterFieldUtils.js";import G from"../support/RasterFunction.js";import k from"../support/RasterInfo.js";import{intersectMultimensionalSubset as W,getEffectiveMultidimensionalDefinition as $,getSubsetVariablesFromMdInfo as X,getDefaultMultidimensionalDefinition as K}from"../support/rasterDatasets/multidimensionalUtils.js";import{decode as Y,getFormat as Z}from"../support/rasterFormats/RasterCodec.js";import{highlightPixels as ee}from"../support/rasterFunctions/pixelUtils.js";import{uvComponentToVector as te}from"../support/rasterFunctions/vectorFieldUtils.js";import{createDefaultRenderer as ie,getSupportedRendererTypes as re,matchPresetRenderer as se,getDefaultBandCombination as ne,normalizeRendererJSON as ae}from"../../renderers/support/rasterRendererHelper.js";import oe from"../../renderers/support/RasterSymbolizer.js";import{websceneRasterRendererTypes as le,rasterRendererTypes as ue,read as pe}from"../../renderers/support/rasterTypeUtils.js";import{calculateVolume as me,computeAngles as ce,computePixelSpaceLocations as he,computeHistograms as de,computeStatisticsHistograms as fe,measureHeight as ge,measureAreaAndPerimeter as ye,measureDistanceAndAngle as Re,measurePointOrCentroid as Ie,measureLengthFromImage as ve,measureAreaFromImage as we,getImageSpatialReferenceQueryParameter as be,getSamples as Se,identify as xe,imageToMap as _e,imageToMapMultiray as Fe,mapToImage as De,findImages as Oe,getImageUrl as Te,queryBoundary as Ce,queryGPSInfo as Me}from"../../rest/imageService.js";import{fetchServiceRasterInfo as Pe,generateRasterInfo as Ne,patchServiceInfo as qe}from"../../rest/imageService/fetchRasterInfo.js";import{getCatalogItemRasterInfo as je}from"../../rest/imageService/getCatalogItemRasterInfo.js";import{executeForCount as Ee}from"../../rest/query/executeForCount.js";import{executeForIds as Ae}from"../../rest/query/executeForIds.js";import{executeQueryJSON as Ve}from"../../rest/query/executeQueryJSON.js";import Qe from"../../rest/support/FeatureSet.js";import Je from"../../rest/support/ImageIdentifyParameters.js";import Ue from"../../rest/support/Query.js";const Be=new Set(["png","png8","png24","png32","jpg","bmp","gif","jpgpng","lerc","tiff"]),Le=m(h,{min:0,max:255});function ze(e){const t=JSON.stringify(e),i=t.includes('"rasterFunctionDefinition":{'),r=i?t.match(/"type":"(.*?FunctionArguments")/gi):t.match(/"rasterFunction":"(.*?")/gi),s=r?.map(e=>i?e.slice(8,-18):e.slice(18,-1));return s?s.join("/"):null}const He=m=>{const h=m;let He=class extends h{constructor(){super(...arguments),this._functionRasterInfos={},this._serviceSupportsMosaicRule=null,this.adjustAspectRatio=null,this.bandIds=void 0,this.capabilities=null,this.compressionQuality=void 0,this.compressionTolerance=.01,this.copyright=null,this.defaultMosaicRule=null,this.definitionExpression=null,this.exportImageServiceParameters=null,this.rasterInfo=null,this.fields=null,this.fullExtent=null,this.hasMultidimensions=!1,this.imageMaxHeight=4100,this.imageMaxWidth=4100,this.interpolation=void 0,this.minScale=0,this.maxScale=0,this.multidimensionalInfo=null,this.multidimensionalSubset=null,this.noData=null,this.noDataInterpretation=void 0,this.objectIdField=null,this.geometryType="polygon",this.typeIdField=null,this.types=[],this.pixelFilter=null,this.raster=void 0,this.sourceType=null,this.viewId=void 0,this.symbolizer=null,this.rasterFunctionInfos=null,this.serviceDataType=null,this.spatialReference=null,this.pixelType=null,this.serviceRasterInfo=null,this.sourceJSON=null,this.url=null,this.version=void 0}initialize(){this._set("exportImageServiceParameters",new x({layer:this}))}readServiceSupportsMosaicRule(e,t){return this._isMosaicRuleSupported(t)}get _rasterFunctionNamesIndex(){const e=new Map;return!this.rasterFunctionInfos||null!=this.rasterFunctionInfos&&this.rasterFunctionInfos.length<1||null!=this.rasterFunctionInfos&&this.rasterFunctionInfos.forEach(t=>{e.set(t.name.toLowerCase().replaceAll(/ /gi,"_"),t.name)}),e}readBandIds(e,t){if(Array.isArray(e)&&e.length>0&&e.every(e=>"number"==typeof e))return e}readCapabilities(e,t){return this._readCapabilities(t)}writeCompressionQuality(e,t,i){null!=e&&"lerc"!==this.format&&(t[i]=e)}writeCompressionTolerance(e,t,i){"lerc"===this.format&&null!=e&&(t[i]=e)}readDefaultMosaicRule(e,t){return this._serviceSupportsMosaicRule?T.fromJSON(t):null}get fieldsIndex(){return this.fields?new F(this.fields):null}set format(e){e&&Be.has(e.toLowerCase())&&this._set("format",e.toLowerCase())}readFormat(e,t){return"esriImageServiceDataTypeVector-UV"===t.serviceDataType||"esriImageServiceDataTypeVector-MagDir"===t.serviceDataType||null!=this.pixelFilter?"lerc":"jpgpng"}readMinScale(e,t){return null!=t.minLOD&&null!=t.maxLOD?e:0}readMaxScale(e,t){return null!=t.minLOD&&null!=t.maxLOD?e:0}set mosaicRule(e){let t=e;t?.mosaicMethod&&(t=T.fromJSON({...t.toJSON(),mosaicMethod:t.mosaicMethod,mosaicOperation:t.mosaicOperation})),this._set("mosaicRule",t)}readMosaicRule(e,t){const i=e||t.mosaicRule;return i?T.fromJSON(i):this._isMosaicRuleSupported(t)?T.fromJSON(t):null}writeMosaicRule(e,t,i){const{mosaicRule:r}=this;this._isValidCustomizedMosaicRule(r)&&(t[i]=r.toJSON())}writeNoData(e,t,i){null!=e&&"number"==typeof e&&(t[i]=Le(e))}readObjectIdField(e,t){if(!e){const i=t.fields.find(e=>"esriFieldTypeOID"===e.type||"oid"===e.type);e=i?.name}return e}get parsedUrl(){return l(this.url)}readSourceType(e,t){return this._isMosaicDataset(t)?"mosaic-dataset":"raster-dataset"}get renderer(){const{activePresetRendererName:e,presetRenderers:t}=this;if(e){const i=t?.find(({name:t})=>t===e);return i?.renderer.clone()}return this.internalRenderer}set renderer(e){this.activePresetRendererName=null,this.internalRenderer=e}set internalRenderer(e){this.loaded&&(e=this._configRenderer(e)),this._set("internalRenderer",e)}readRenderer(e,t,i){const r=t?.layerDefinition?.drawingInfo?.renderer,s=pe(r,i);return null==s?null:("vector-field"===s.type&&t.symbolTileSize&&!r.symbolTileSize&&(s.symbolTileSize=t.symbolTileSize),O(s)||a.getLogger(this).warn("ArcGISImageService","Imagery layer doesn't support given renderer type."),s)}writeRenderer(e,t,i){t.layerDefinition=t.layerDefinition||{},t.layerDefinition.drawingInfo=t.layerDefinition.drawingInfo||{},t.layerDefinition.drawingInfo.renderer=e.toJSON(),"vector-field"===e.type&&(t.symbolTileSize=e.symbolTileSize)}get rasterFields(){const e=this.fields?.map(e=>e.clone())??[];e.push(j()),"mosaic-dataset"===this.sourceType&&this.fields?.length&&e.push(E()),this.version>=10.4&&null!=this.rasterFunctionInfos&&this.rasterFunctionInfos.some(({name:e})=>"none"===e.toLowerCase())&&e.push(A()),null!=this.rasterFunctionInfos&&this.rasterFunctionInfos.filter(({name:e})=>"none"!==e.toLowerCase()).forEach(({name:t})=>e.push(V(t)));const{rasterInfo:t}=this;if(this._isVectorDataSet()){const i=t?.multidimensionalInfo?.variables[0].unit?.trim(),r=Q(i),s=J();e.push(r,s)}if(t?.multidimensionalInfo&&"raster-dataset"===this.sourceType){const i=U(t.multidimensionalInfo);e.push(...i)}const i=t?.attributeTable;if(null!=i){const t=B(i);e.push(...t)}return e}set rasterFunction(e){let t=e;t?.rasterFunction&&(t=G.fromJSON({...t.toJSON(),rasterFunction:t.rasterFunction,rasterFunctionArguments:t.rasterFunctionArguments})),this._set("rasterFunction",t)}readRasterFunction(e,t){const i=t.rasterFunctionInfos;return t.renderingRule||i?.length&&"None"!==i[0].name?this._isRFTJson(t.renderingRule)?G.fromJSON({rasterFunctionDefinition:t.renderingRule}):G.fromJSON(t.renderingRule||{rasterFunctionInfos:t.rasterFunctionInfos}):null}readSpatialReference(e,t){const i=e||t.extent.spatialReference;return i?I.fromJSON(i):null}writePixelType(e,t,i){null!=this.serviceRasterInfo&&this.pixelType===this.serviceRasterInfo.pixelType||(t[i]=q.toJSON(e))}readVersion(e,t){let i=t.currentVersion;return i||(i=t.hasOwnProperty("fields")||t.hasOwnProperty("timeInfo")?10:9.3),i}applyFilter(e){let t=e;return this.pixelFilter&&(t=this._clonePixelData(e),this.pixelFilter(t)),t}async applyRenderer(e,t){let i=e,{renderer:r,symbolizer:s,pixelFilter:n}=this;const{isRawData:a}=e;if(a&&"lerc"!==this.format&&(r??=ie(this.rasterInfo,{bandIds:this.bandIds,variableName:this.rasterFunction?null:this.mosaicRule?.multidimensionalDefinition?.[0].variableName}),s||(this.symbolizer=new oe({rendererJSON:r.toJSON(),rasterInfo:this.rasterInfo}),s=this.symbolizer)),(a||!this._isPicture())&&r&&s&&!n){await this._updateSymbolizer(s,r);const{bandIds:n}=this;i=await this._symbolize({pixelData:e,bandIds:n,symbolizer:s},t)}return i}async highlightPixels(e,t){const i=e.highlightOptions.map(e=>{const t={...e},{bandId:i}=t;if(null==i)t.bandId=0;else{const e=this.bandIds?.length?this.bandIds.indexOf(i):i;if(e<0||e>2)return;t.bandId=e}return t}).filter(e=>null!=e),r=this._rasterJobHandler;r?await r.highlightPixels({...e,highlightOptions:i},t):ee(e.pixelBlock,e.renderedPixelBlock,i)}destroy(){this._shutdownJobHandler()}async calculateVolume(e,t){if(!(await this._fetchCapabilities(t?.signal)).operations.supportsCalculateVolume)throw new s("imagery-layer:compute-pixel-space-locations","this operation is not supported on the input image service");return e=n(e),this.mosaicRule&&null==e.mosaicRule&&(e.mosaicRule=this.mosaicRule),me(this.url,e,this._getRequestOptions(t))}async computeAngles(e,t){if(!(await this._fetchCapabilities(t?.signal)).operations.supportsComputeAngles)throw new s("imagery-layer:compute-angles","this operation is not supported on the input image service");return ce(this.url,e,this._getRequestOptions(t))}async computePixelSpaceLocations(e,t){if(!(await this._fetchCapabilities(t?.signal)).operations.supportsComputePixelLocation)throw new s("imagery-layer:compute-pixel-space-locations","this operation is not supported on the input image service");return he(this.url,e,this._getRequestOptions(t))}async computeHistograms(e,t){if(!(await this._fetchCapabilities(t?.signal)).operations.supportsComputeHistograms)throw new s("imagery-layer:compute-histograms","this operation is not supported on the input image service");return e=n(e),this._applyMosaicAndRenderingRules(e),de(this.url,e,this._getRequestOptions(t))}async computeStatisticsHistograms(e,t){if(!(await this._fetchCapabilities(t?.signal)).operations.supportsComputeStatisticsHistograms)throw new s("imagery-layer:compute-statistics-histograms","this operation is not supported on the input image service");return e=n(e),this._applyMosaicAndRenderingRules(e),fe(this.url,e,this._getRequestOptions(t))}async measureHeight(e,t){const i=await this._fetchCapabilities(t?.signal);if(!("base-and-top"===e.operationType?i.mensuration.supportsHeightFromBaseAndTop:"base-and-top-shadow"===e.operationType?i.mensuration.supportsHeightFromBaseAndTopShadow:i.mensuration.supportsHeightFromTopAndTopShadow))throw new s("imagery-layer:measure-height","this operation is not supported on the input image service");return e=n(e),this._applyMosaicRule(e),ge(this.url,e,this._getRequestOptions(t))}async measureAreaAndPerimeter(e,t){const i=await this._fetchCapabilities(t?.signal);if(!(i.mensuration.supportsAreaAndPerimeter&&(!e.is3D||i.mensuration.supports3D)))throw new s("imagery-layer:measure-area-and-perimeter","this operation is not supported on the input image service");return e=n(e),this._applyMosaicRule(e),ye(this.url,e,this._getRequestOptions(t))}async measureDistanceAndAngle(e,t){const i=await this._fetchCapabilities(t?.signal);if(!(i.mensuration.supportsDistanceAndAngle&&(!e.is3D||i.mensuration.supports3D)))throw new s("imagery-layer:measure-distance-and-angle","this operation is not supported on the input image service");return e=n(e),this._applyMosaicRule(e),Re(this.url,e,this._getRequestOptions(t))}async measurePointOrCentroid(e,t){const i=await this._fetchCapabilities(t?.signal);if(!(i.mensuration.supportsPointOrCentroid&&(!e.is3D||i.mensuration.supports3D)))throw new s("imagery-layer:measure-point-or-centroid","this operation is not supported on the input image service");return e=n(e),this._applyMosaicRule(e),Ie(this.url,e,this._getRequestOptions(t))}async measureLengthFromImage(e,t){if(!(await this._fetchCapabilities(t?.signal)).operations.supportsMeasureFromImage)throw new s("imagery-layer:measure-length-from-image","this operation is not supported on the input image service");if("polyline"!==e.geometry.type)throw new s("imagery-layer:measure-length-from-image","this input geometry must be a polyline");return ve(this.url,e,this._getRequestOptions(t))}async measureAreaFromImage(e,t){if(!(await this._fetchCapabilities(t?.signal)).operations.supportsMeasureFromImage)throw new s("imagery-layer:measure-area-from-image","this operation is not supported on the input image service");if("polygon"!==e.geometry.type)throw new s("imagery-layer:measure-area-from-image","this input geometry must be a polygon");return we(this.url,e,this._getRequestOptions(t))}getField(e){const{fieldsIndex:t}=this;return null!=t?t.get(e):void 0}getFieldDomain(e,t){const i=this.getField(e);return i?i.domain:null}fetchImage(e,t,i,n={}){if(r(a.getLogger(this),"`ImageryLayer.fetchImage` is deprecated in favor of 'ImageryLayer.fetchPixels'.",{replacement:"ImageryLayer.fetchPixels",version:"4.33",warnOnce:!0}),null==e||null==t||null==i)throw new s("imagery-layer:fetch-image","Insufficient parameters for requesting an image. A valid extent, width and height values are required.");return this.internalFetchImage(e,t,i,n)}async internalFetchImage(e,t,i,r={}){await this._updateCurrentRasterInfo();const{exportImageServiceParameters:s}=this;let n=!1;r.requestRawData&&(await this._initJobHandler(),s.requestRawData||"lerc"===this.format||(n=!0,s.requestRawData=!0));const a=this.getExportImageServiceParameters(e,t,i,r.timeExtent);if(n&&(s.requestRawData=!1),null==a){if(r.requestAsImageElement&&this._canRequestImageElement(this.format)){const e=document.createElement("canvas");if(e.width=t,e.height=i,r.returnImageBitmap){return{imageBitmap:await D(e,`${Ge(this.parsedUrl)}/exportImage`,r.signal)}}return{imageOrCanvasElement:e}}const{bandIds:s,rasterInfo:n}=this,a=(s?.length||n.bandCount)??0,o=t*i,l=n.pixelType,u=[];for(let e=0;e<a;e++)u.push(M.createEmptyBand(l,o));return{pixelData:{pixelBlock:new M({width:t,height:i,pixels:u,mask:new Uint8Array(o),pixelType:l}),extent:e}}}const o=!!r.requestAsImageElement&&!this.pixelFilter,l=o&&!!r.returnImageBitmap,u={imageServiceParameters:a,imageProps:{extent:e,width:t,height:i,format:this.format},requestAsImageElement:o,returnImageBitmap:l,signal:r.signal};return this._requestArrayBuffer(u)}async fetchPixels(e,t,i,r={}){await this._initJobHandler(),r.applyRendering&&this._updateCurrentRasterInfo();const s=r.applyRendering?void 0:new x({layer:this,requestRawData:!0,interpolation:r.interpolation??"nearest",bandIds:r.bandIds??[]}),n=this.getExportImageServiceParameters(e,t,i,r.timeExtent,s);if(null==n)return{extent:e,pixelBlock:null};delete n.pixelType,r.bandIds||delete n.bandIds,delete n.compressionQuality;const a={imageServiceParameters:n,imageProps:{extent:e,width:t,height:i,format:this.format},requestAsImageElement:!1,returnImageBitmap:!1,signal:r.signal},{pixelData:o}=await this._requestArrayBuffer(a);return o??{extent:e,pixelBlock:null}}fetchKeyProperties(e){return i(Ge(this.parsedUrl)+"/keyProperties",{query:this._getQueryParams({renderingRule:this.version>=10.3?e?.rasterFunction:null})}).then(e=>e.data)}fetchRasterAttributeTable(e){return this.version<10.1?Promise.reject(new s("#fetchRasterAttributeTable()","Failed to get rasterAttributeTable")):i(Ge(this.parsedUrl)+"/rasterAttributeTable",{query:this._getQueryParams({renderingRule:this.version>=10.3?e?.rasterFunction:null})}).then(e=>Qe.fromJSON(e.data))}getCatalogItemRasterInfo(e,t){const i={...t,query:this._getQueryParams()};return je(Ge(this.parsedUrl),e,i)}async getCatalogItemICSInfo(e,t){const{data:r}=await i(Ge(this.parsedUrl)+"/"+e+"/info/ics",{query:this._getQueryParams(),...t}),s=r?.ics;if(!s)return;let n=null;try{n=(await i(Ge(this.parsedUrl)+"/"+e+"/info",{query:this._getQueryParams(),...t})).data.extent}catch{}if(!n?.spatialReference)return{ics:s,icsToPixelTransform:null,icsExtent:null,northDirection:null};const a=this.version>=10.7?i(Ge(this.parsedUrl)+"/"+e+"/info/icstopixel",{query:this._getQueryParams(),...t}).then(e=>e.data).catch(()=>({})):{},o=n.spatialReference,l={geometries:JSON.stringify({geometryType:"esriGeometryEnvelope",geometries:[n]}),inSR:v(o),outSR:"0:"+e},u=i(Ge(this.parsedUrl)+"/project",{query:this._getQueryParams(l),...t}).then(e=>e.data).catch(()=>({})),p=5,m=(n.xmin+n.xmax)/2,c=(n.ymax-n.ymin)/(p+1),h=n.ymin+c,d=[];for(let i=0;i<p;i++)d.push({x:m,y:h+c*i});const f={geometries:JSON.stringify({geometryType:"esriGeometryPoint",geometries:d}),inSR:v(o),outSR:"0:"+e},g=i(Ge(this.parsedUrl)+"/project",{query:this._getQueryParams(f),...t}).then(e=>e.data).catch(()=>({})),R=await Promise.all([a,u,g]);let w=R[0].ipxf;if(null==w){const e=s.geodataXform?.xf_0;"topup"===e?.name?.toLowerCase()&&6===e?.coefficients?.length&&(w={affine:{name:"ics [sensor: Frame] to pixel (column, row) transformation",coefficients:e.coefficients,cellsizeRatio:0,type:"GeometricXform"}})}const b=y.fromJSON(R[1]?.geometries?.[0]);b&&(b.spatialReference=new I({wkid:0,imageCoordinateSystem:s}));const S=R[2].geometries?R[2].geometries.filter(e=>null!=e?.x&&null!=e.y&&"NaN"!==e.x&&"NaN"!==e.y):[],x=S.length;if(x<3)return{ics:s,icsToPixelTransform:w,icsExtent:b,northDirection:null};let _=0,F=0,D=0,O=0;for(let i=0;i<x;i++)_+=S[i].x,F+=S[i].y,D+=S[i].x*S[i].x,O+=S[i].x*S[i].y;const T=(x*O-_*F)/(x*D-_*_);let C=0;const M=S[p-1].x>S[0].x,P=S[p-1].y>S[0].y;return T===1/0?C=P?90:270:0===T?C=M?0:180:T>0?C=M?180*Math.atan(T)/Math.PI:180*Math.atan(T)/Math.PI+180:T<0&&(C=P?180+180*Math.atan(T)/Math.PI:360+180*Math.atan(T)/Math.PI),{ics:s,icsToPixelTransform:w,icsExtent:b,northDirection:C}}async generateRasterInfo(e,t){e=c(G,e);const i={...t,query:this._getQueryParams()};if(!e||"none"===e.functionName?.toLowerCase()||this._isVectorFieldResampleFunction(e))return this.serviceRasterInfo??Pe(Ge(this.parsedUrl),this.sourceJSON,i);const r=ze(e);if(!r)throw new s("imagery-layer:generate-raster-info","the rendering rule is not supported");if(this._functionRasterInfos[r])return this._functionRasterInfos[r];const n=Ne(Ge(this.parsedUrl),e,i);this._functionRasterInfos[r]=n;try{return await n}catch(a){throw this._functionRasterInfos[r]=null,a}}getExportImageServiceParameters(e,t,i,r,s){e=e.clone().shiftCentralMeridian();const n=be(e.spatialReference,Ge(this.parsedUrl));s??=this.exportImageServiceParameters;const a=s.toJSON(),{bandIds:o,noData:l}=a;let{renderingRule:u}=a;const p=this.rasterFunction?.rasterFunctionDefinition,m=this.renderer?.type,c=!m||"raster-stretch"===m||"raster-colormap"===m||"unique-value"===m||"class-breaks"===m||"raster-shaded-relief"===m;if(o?.length&&this._hasRasterFunction(this.rasterFunction)&&!p&&c){const e={rasterFunction:"ExtractBand",rasterFunctionArguments:{BandIds:o}};if("Stretch"===u.rasterFunction)e.rasterFunctionArguments.Raster=u.rasterFunctionArguments.Raster,u.rasterFunctionArguments.Raster=e;else if("Colormap"===u.rasterFunction){const t=u.rasterFunctionArguments.Raster;"Stretch"===t?.rasterFunction?(e.rasterFunctionArguments.Raster=t.rasterFunctionArguments.Raster,t.rasterFunctionArguments.Raster=e):(e.rasterFunctionArguments.Raster=t,u.rasterFunctionArguments.Raster=e)}else e.rasterFunctionArguments.Raster=u,u=e;a.bandIds=void 0}else a.bandIds=o?.join(",");Array.isArray(l)&&l.length>0&&(a.noData=l.join(","));const h=this._processMultidimensionalIntersection(null,r,s.mosaicRule);if(h.isOutSide)return null;a.mosaicRule=null!=h.mosaicRule?JSON.stringify(h.mosaicRule):null,r=h.timeExtent,a.renderingRule=this._getRenderingRuleString(G.fromJSON(u));const d={};if(null!=r){const{start:e,end:t}=r.toJSON();e&&t&&e===t?d.time=""+e:null==e&&null==t||(d.time=`${e??"null"},${t??"null"}`)}return{bbox:e.xmin+","+e.ymin+","+e.xmax+","+e.ymax,bboxSR:n,imageSR:n,size:t+","+i,...a,...d}}async getSamples(e,t){const i=await this._fetchCapabilities(t?.signal);if(!i?.operations.supportsGetSamples)throw new s("imagery-layer:get-samples","getSamples operation is not supported on the input image service");e=n(e);const{raster:r}=this;return r&&null==e.raster&&(e.raster=r),Se(this.url,e,this._getRequestOptions(t))}async identify(e,t){if(!(await this._fetchCapabilities(t?.signal)).operations.supportsIdentify)throw new s("imagery-layer:identify","identify operation is not supported on the input image service");e=n(e),this.version<10.91&&"extent"===e.geometry?.type&&(e.geometry=R.fromExtent(e.geometry));const i=this._processMultidimensionalIntersection(e.geometry,e.timeExtent,e.mosaicRule||this.mosaicRule);if(i.isOutSide)throw new s("imagery-layer:identify","the request cannot be fulfilled when falling outside of the multidimensional subset");e.timeExtent=i.timeExtent,e.mosaicRule=i.mosaicRule;const{raster:r,rasterFunction:a}=this;return a&&null==e.rasterFunction&&(e.rasterFunction=a),r&&null==e.raster&&(e.raster=r),xe(this.url,e,this._getRequestOptions(t))}async imageToMap(e,t){if(!(await this._fetchCapabilities(t?.signal)).operations.supportsImageToMap)throw new s("imagery-layer:image-to-map","imageToMap operation is not supported on the input image service");return _e(Ge(this.parsedUrl),e,this._getRequestOptions(t))}async imageToMapMultiray(e,t){if(!(await this._fetchCapabilities(t?.signal)).operations.supportsImageToMapMultiray)throw new s("imagery-layer:image-to-map-multiray","imageToMapMultiray operation is not supported on the input image service");return Fe(Ge(this.parsedUrl),e,this._getRequestOptions(t))}async mapToImage(e,t){if(!(await this._fetchCapabilities(t?.signal)).operations.supportsMapToImage)throw new s("imagery-layer:map-to-image","mapToImage operation is not supported on the input image service");return De(Ge(this.parsedUrl),e,this._getRequestOptions(t))}async findImages(e,t){if(!(await this._fetchCapabilities(t?.signal)).operations.supportsFindImages)throw new s("imagery-layer:find-images","findImages operation is not supported on the input image service");return Oe(Ge(this.parsedUrl),e,this._getRequestOptions(t))}async getImageUrl(e,t){if(!(await this._fetchCapabilities(t?.signal)).operations.supportsGetImageUrl)throw new s("imagery-layer:get-image-url","getImageUrl operation is not supported on the input image service");return Te(Ge(this.parsedUrl),e,this._getRequestOptions(t))}createQuery(){return new Ue({outFields:["*"],returnGeometry:!0,where:this.definitionExpression||"1=1"})}async queryBoundary(e,t){if(!(await this._fetchCapabilities(t?.signal)).operations.supportsQueryBoundary)throw new s("imagery-layer:query-boundary","queryBoundary operation is not supported on the input image service");return e=e??{outSpatialReference:this.spatialReference},Ce(Ge(this.parsedUrl),e,this._getRequestOptions(t))}async queryRasters(e,t){({query:e,requestOptions:t}=await this._prepareForQuery(e,t));const i=await Ve(this.url,e,t),r=this.graphicOrigin;return i.features.forEach(e=>{e.layer=this,e.origin=r}),i}async queryObjectIds(e,t){return({query:e,requestOptions:t}=await this._prepareForQuery(e,t)),Ae(this.url,e,t)}async queryGPSInfo(e,t){if(!(await this._fetchCapabilities(t?.signal)).operations.supportsQueryGPSInfo)throw new s("imagery-layer:query-gps-info","queryGPSInfo operation is not supported on the input image service");return e=e??{where:"1=1"},Me(Ge(this.parsedUrl),e,this._getRequestOptions(t))}async queryRasterCount(e,t){return({query:e,requestOptions:t}=await this._prepareForQuery(e,t)),Ee(this.url,e,t)}async queryVisibleRasters(e,t){if(!e)throw new s("imagery-layer: query-visible-rasters","missing query parameter");await this.load();const{pixelSize:i,returnDomainValues:r,returnTopmostRaster:n,showNoDataRecords:a}=t||{pixelSize:null,returnDomainValues:!1,returnTopmostRaster:!1,showNoDataRecords:!1};let o=!1,l=null,u=null;const p=L.servicePixelValue.toLowerCase(),m=this._rasterFunctionNamesIndex;if(null!=e.outFields&&(o=e.outFields.some(e=>!e.toLowerCase().startsWith(p)),this.version>=10.4)){const t=e.outFields.filter(e=>e.toLowerCase().startsWith(p)&&e.length>p.length).map(e=>{const t=e.slice(p.length+1);return[this._updateRenderingRulesFunctionName(t,m),t]});l=t.map(e=>new G({functionName:e[0]})),u=t.map(e=>e[1]);const{rasterFunction:i}=this;0===l.length?i?.functionName?(l.push(i),u.push(i.functionName)):l=null:i?.functionName&&!l.some(e=>e.functionName===i.functionName)&&(l.push(i),u.push(i.functionName))}const c=null==e.outSpatialReference||e.outSpatialReference.equals(this.spatialReference),{multidimensionalSubset:h}=this;let d=e.timeExtent||this.timeExtent;if(h){const{isOutside:t,intersection:i}=W(h,{geometry:e.geometry,timeExtent:e.timeExtent,multidimensionalDefinition:this.exportImageServiceParameters.mosaicRule?.multidimensionalDefinition});if(t)throw new s("imagery-layer:query-visible-rasters","the request cannot be fulfilled when falling outside of the multidimensional subset");null!=i?.timeExtent&&(d=i.timeExtent)}const f=this._combineMosaicRuleWithTimeExtent(this.exportImageServiceParameters.mosaicRule,d);let g=e.geometry;this.version<10.91&&"extent"===g?.type&&(g=R.fromExtent(g));const y=this._getQueryParams({geometry:g,timeExtent:d,mosaicRule:f,rasterFunction:this.version<10.4?this.rasterFunction:null,rasterFunctions:l,pixelSize:i,returnCatalogItems:o,returnGeometry:c,raster:this.raster,maxItemCount:n?1:null});delete y.f;const I=new Je(y);try{await this._generateRasterInfo(this.rasterFunction);const i=await xe(this.url,I,{signal:t?.signal,query:{...this.customParameters}}),s=e.outFields,n=null!=i.value&&i.value.toLowerCase().includes("nodata"),l=o&&!c&&i?.catalogItems?.features.length&&(a||!n),p=this.multidimensionalInfo&&"raster-dataset"===this.sourceType?$({rasterInfo:this.rasterInfo,multidimensionalDefinition:f?.multidimensionalDefinition,timeExtent:d,multidimensionalSubset:this.multidimensionalSubset}):null;if(!l)return this._processVisibleRastersResponse(i,{returnDomainValues:r,templateRRFunctionNames:u,showNoDataRecords:a,templateFields:s,effectiveMultidimensionalDefinition:p});const m=this.objectIdField||"ObjectId",h=i.catalogItems?.features??[],g=h.map(e=>e.attributes?.[m]),y=new Ue({objectIds:g,returnGeometry:!0,outSpatialReference:e.outSpatialReference,outFields:[m]}),R=await this.queryRasters(y);return R?.features?.length&&R.features.forEach(t=>{h.forEach(i=>{i.attributes[m]===t.attributes[m]&&t.geometry&&(i.geometry=t.geometry.clone(),null!=e.outSpatialReference&&(i.geometry.spatialReference=e.outSpatialReference))})}),this._processVisibleRastersResponse(i,{returnDomainValues:r,templateRRFunctionNames:u,showNoDataRecords:a,templateFields:s,effectiveMultidimensionalDefinition:p})}catch{throw new s("imagery-layer:query-visible-rasters","encountered error when querying visible rasters")}}async fetchVariableStatisticsHistograms(e,t){const r=i(Ge(this.parsedUrl)+"/statistics",{query:this._getQueryParams({variable:e}),signal:t}).then(e=>e.data?.statistics),s=i(Ge(this.parsedUrl)+"/histograms",{query:this._getQueryParams({variable:e}),signal:t}).then(e=>e.data?.histograms),n=await Promise.all([r,s]);return n[0]&&n[0].forEach(e=>{e.avg=e.mean,e.stddev=e.standardDeviation}),{statistics:n[0]||null,histograms:n[1]||null}}getMultidimensionalSubsetVariables(e){const t=e??this.serviceRasterInfo.multidimensionalInfo;return X(this.multidimensionalSubset,t)}async _fetchService(e){await this._fetchServiceInfo(e),this.rasterInfo||(this.rasterInfo=this.serviceRasterInfo);const t=this.sourceJSON,i=null!=this.serviceRasterInfo?Promise.resolve(this.serviceRasterInfo):Pe(Ge(this.parsedUrl),t,{signal:e,query:this._getQueryParams()}).then(e=>(this._set("serviceRasterInfo",e),this._set("multidimensionalInfo",e.multidimensionalInfo),qe(e,t),e)),r=this._hasRasterFunction(this.rasterFunction)?this._generateRasterInfo(this.rasterFunction,{signal:e}):null,s=this._getRasterFunctionInfos();return Promise.all([i,r,s]).then(e=>{e[1]?this._set("rasterInfo",e[1]):this._set("rasterInfo",e[0]),e[2]&&this._set("rasterFunctionInfos",e[2]),this.internalRenderer&&!this._isSupportedRenderer(this.internalRenderer)&&(this._set("internalRenderer",null),a.getLogger(this).warn("ArcGISImageService","Switching to the default renderer. Renderer applied is not valid for this Imagery Layer")),this._set("internalRenderer",this._configRenderer(this.renderer)),this.addHandles([o(()=>this.rasterFunction,e=>{(this.renderer||this.symbolizer||this.popupEnabled&&this.popupTemplate)&&this._generateRasterInfo(e).then(e=>{e&&(this.rasterInfo=e)})})]);const{serviceRasterInfo:t}=this;null!=t.multidimensionalInfo&&this._updateMultidimensionalDefinition(t)})}_combineMosaicRuleWithTimeExtent(e,t){const i=this.timeInfo,{multidimensionalInfo:r}=this.serviceRasterInfo;if(null==e||null==r||null==t||null==i?.startField)return e;const{startField:s}=i,n=r.variables.some(e=>e.dimensions.some(e=>e.name===s))?s:"StdTime";if(e=e.clone(),"mosaic-dataset"===this.sourceType)return e.multidimensionalDefinition=e.multidimensionalDefinition?.filter(e=>e.dimensionName!==n),this._cleanupMultidimensionalDefinition(e);e.multidimensionalDefinition=e.multidimensionalDefinition||[];const a=e.multidimensionalDefinition.filter(e=>e.dimensionName===n),o=null!=t.start?t.start.getTime():null,l=null!=t.end?t.end.getTime():null,u=null==o||null==l||o===l,p=u?[o||l]:[[o,l]],m=this.version>=10.8;if(a.length)a.forEach(e=>{e.dimensionName===n&&(m?(e.dimensionName=null,e.isSlice=!1,e.values=[]):(e.isSlice=u,e.values=p))});else if(!m){const t=e.multidimensionalDefinition.filter(e=>null!=e.variableName&&null==e.dimensionName);t.length?t.forEach(e=>{e.dimensionName=n,e.isSlice=u,e.values=p}):e.multidimensionalDefinition.push(new S({variableName:"",dimensionName:n,isSlice:u,values:p}))}return this._cleanupMultidimensionalDefinition(e)}_cleanupMultidimensionalDefinition(e){return null==e?null:(e.multidimensionalDefinition&&(e.multidimensionalDefinition=e.multidimensionalDefinition.filter(e=>!(!e.variableName&&!e.dimensionName)),0===e.multidimensionalDefinition.length&&(e.multidimensionalDefinition=null)),"mosaic-dataset"!==this.sourceType&&null==e.multidimensionalDefinition?null:e)}async _prepareForQuery(e,t){if(!(await this._fetchCapabilities(t?.signal)).operations.supportsQuery)throw new s("imagery-layer:query-rasters","query operation is not supported on the input image service");return e=null!=e?c(Ue,e):this.createQuery(),t=this._getRequestOptions(t),this.raster&&(t.query={...t.query,raster:this.raster}),{query:e,requestOptions:t}}_isSupportedRenderer(e){const{rasterInfo:t,rasterFunction:i}=this;return"unique-value"===e.type&&this._hasRasterFunction(i)&&1===t?.bandCount&&["u8","s8"].includes(t.pixelType)||null!=t&&null!=e&&re(t).includes(e.type)}async _fetchCapabilities(e){return this.capabilities||await this._fetchServiceInfo(e),this.capabilities}async _fetchServiceInfo(e){let t=this.sourceJSON;if(!t){const{data:r,ssl:s}=await i(Ge(this.parsedUrl),{query:this._getQueryParams(),signal:e});t=r,this.sourceJSON=t,s&&(this.url=this.url.replace(/^http:/i,"https:"))}if(t.capabilities?.toLowerCase().split(",").map(e=>e.trim()).indexOf("tilesonly")>-1)throw new s("imagery-layer:fetch-service-info","use ImageryTileLayer to open tiles-only image services");this.read(t,{origin:"service",url:this.parsedUrl})}_isMosaicDataset(e){return e.serviceSourceType?"esriImageServiceSourceTypeMosaicDataset"===e.serviceSourceType:e.fields?.length>0}_isMosaicRuleSupported(e){if(!e)return!1;const t=this._isMosaicDataset(e),i=e.currentVersion>=10.71&&e.hasMultidimensions&&!(e.fields?.length>1);return t||i}_isVectorFieldResampleFunction(e){if(null==e)return!1;const{functionName:t,functionArguments:i}=e,r="resample"===t?.toLowerCase(),s=i?.ResampleType||i?.resampleType;return r&&(7===s||10===s)}_isPicture(){return!this.format||this.format.includes("jpg")||this.format.includes("png")}_configRenderer(e){const t=this._isPicture(),{rasterInfo:i}=this;if(!t&&!this.pixelFilter||this._isVectorDataSet()){const t=this.mosaicRule?.multidimensionalDefinition?.[0].variableName,r=se({variableName:t,rasterFunctionName:this.rasterFunction?.functionName,presetRenderers:this.presetRenderers});if(!this.bandIds&&i.bandCount>=3){const e=r?.bandIds??ne(i);!e||3===i.bandCount&&0===e[0]&&1===e[1]&&2===e[2]||(this.bandIds=e)}e||(e=r?.renderer??ie(i,{bandIds:this.bandIds,variableName:this.rasterFunction?null:t}));const s=ae(e.toJSON());this.symbolizer?(this.symbolizer.rendererJSON=s,this.symbolizer.rasterInfo=i):this.symbolizer=new oe({rendererJSON:s,rasterInfo:i}),this.symbolizer.bind().success||(this.symbolizer=null)}return e}_clonePixelData(e){return null==e?e:{extent:e.extent&&e.extent.clone(),pixelBlock:null!=e.pixelBlock?e.pixelBlock.clone():null}}_getQueryParams(e){null!=e?.renderingRule&&"string"!=typeof e.renderingRule&&(e.renderingRule=this._getRenderingRuleString(e.renderingRule));const{raster:t,viewId:i}=this;return{raster:t,viewId:i,f:"json",...e,...this.customParameters}}_getRequestOptions(e){return{...e,query:{...e?.query,...this.customParameters}}}_decodePixelBlock(e,t,i){return this._rasterJobHandler?this._rasterJobHandler.decode({data:e,options:t}):Y(e,t,i)}async _getRasterFunctionInfos(e){const t=this.sourceJSON.rasterFunctionInfos;if(this.loaded)return t;if(t&&this.version>=10.3){if(1===t.length&&"none"===t[0].name.toLowerCase())return t;const r=await i(Ge(this.parsedUrl)+"/rasterFunctionInfos",{query:this._getQueryParams(),signal:e});return r.data?.rasterFunctionInfos}return null}_canRequestImageElement(e){return!this.pixelFilter&&(!e||e.includes("png"))}async _requestArrayBuffer(e){const{imageProps:t,requestAsImageElement:r,returnImageBitmap:n,signal:a}=e;if(r&&this._canRequestImageElement(t.format)){const r=`${Ge(this.parsedUrl)}/exportImage`,{data:s}=await i(r,{responseType:n?"blob":"image",query:this._getQueryParams({f:"image",...this.refreshParameters,...e.imageServiceParameters}),signal:a});if(s instanceof Blob){return{imageBitmap:await D(s,r,a),params:t}}return{imageOrCanvasElement:s,params:t}}const o=this._initJobHandler(),l=i(Ge(this.parsedUrl)+"/exportImage",{responseType:"array-buffer",query:this._getQueryParams({f:"image",...e.imageServiceParameters}),signal:a}),u=(await Promise.all([l,o]))[0].data,p=t.format||"jpgpng";let m=p;if("bsq"!==m&&"bip"!==m&&(m=Z(u)),!m)throw new s("imagery-layer:fetch-image","unsupported format signature "+String.fromCharCode.apply(null,new Uint8Array(u)));const c={signal:a},h="gif"===p||"bmp"===p||p.includes("png")&&("png"===m||"jpg"===m)?Y(u,{useCanvas:!0,...t},c):this._decodePixelBlock(u,{width:t.width,height:t.height,planes:null,pixelType:null,noDataValue:null,format:p},c);return{pixelData:{pixelBlock:await h,extent:t.extent},params:t}}_generateRasterInfo(e,t){return this.generateRasterInfo(e,t).catch(()=>null)}_isValidCustomizedMosaicRule(e){return e&&JSON.stringify(e.toJSON())!==JSON.stringify(this.defaultMosaicRule?.toJSON())}_updateMultidimensionalDefinition(e){if(this._isValidCustomizedMosaicRule(this.mosaicRule))return;let t=K(e,{multidimensionalSubset:this.multidimensionalSubset});if(null!=t&&t.length>0){this.mosaicRule=this.mosaicRule||new T;const e=this.mosaicRule.multidimensionalDefinition;!this.sourceJSON.defaultVariableName&&this.rasterFunction&&"none"!==this.rasterFunction.functionName?.toLowerCase()&&t.forEach(e=>e.variableName=""),t=t.filter(({variableName:e,dimensionName:t})=>e&&"*"!==e||t),!e?.length&&t.length&&(this.mosaicRule.multidimensionalDefinition=t)}}_processVisibleRastersResponse(e,i){i=i||{};const r=e.value,{templateRRFunctionNames:s,showNoDataRecords:n,returnDomainValues:a,templateFields:o}=i,l=e.processedValues;let u=e.catalogItems?.features,p=e.properties?.Values?.map(e=>e.replaceAll(/ /gi,", "))||[];const m=this.objectIdField||"ObjectId",c="string"==typeof r&&r.toLowerCase().includes("nodata"),h=[];if(r&&!u&&(!c||n)){const e={};e[m]=0;p=[r],u=[new t({geometry:this.fullExtent,attributes:e})],this.multidimensionalInfo&&"raster-dataset"===this.sourceType&&z(this.rasterFields,e,i.effectiveMultidimensionalDefinition)}if(!u)return[];this._updateResponseFieldNames(u,o),c&&!n&&(u=[]);const{itemPixelValue:d,servicePixelValue:f}=L,g=this.rasterFields.some(e=>e.name===d),y=this.graphicOrigin;for(let t=0;t<u.length;t++){const e=u[t];if(null!=r){const i=p[t],a=this.rasterFunction&&l&&l.length>0&&s&&s.length>0&&s.includes(this.rasterFunction.functionName)?l[s.indexOf(this.rasterFunction.functionName)]:r;if("nodata"===i.toLowerCase()&&!n)continue;g&&(e.attributes[d]=i),e.attributes[f]=a,this._updateFeatureWithMagDirValues(e,i);const o=this.fields&&this.fields.length>0;let u=this.rasterFunction&&null!=this.serviceRasterInfo.attributeTable?o?i:r:a;this.rasterFunction||(u=o?i:r),this._updateFeatureWithRasterAttributeTableValues(e,u)}if(e.sourceLayer=e.layer=this,e.origin=y,a&&this._updateFeatureWithDomainValues(e),s&&l&&s.length===l.length)for(let t=0;t<s.length;t++){const i=`${L.servicePixelValue}.${s[t]}`;e.attributes[i]=l[t]}h.push(u[t])}return h}_processMultidimensionalIntersection(e,t,i){const{multidimensionalSubset:r}=this;if(!r)return{isOutSide:!1,timeExtent:t,mosaicRule:i=this._combineMosaicRuleWithTimeExtent(i,t)};if(r){const{isOutside:i,intersection:s}=W(r,{geometry:e,timeExtent:t});if(i)return{isOutSide:!0,timeExtent:null,mosaicRule:null};null!=s?.timeExtent&&(t=s.timeExtent)}if(i=this._combineMosaicRuleWithTimeExtent(i,t),i?.multidimensionalDefinition){const{isOutside:e}=W(r,{multidimensionalDefinition:i.multidimensionalDefinition});if(e)return{isOutSide:!0,timeExtent:null,mosaicRule:null}}return{isOutSide:!1,timeExtent:t,mosaicRule:i}}_updateFeatureWithRasterAttributeTableValues(e,t){const i=this.rasterInfo.attributeTable||this.serviceRasterInfo.attributeTable;if(null==i)return;const{features:r,fields:s}=i,n=s.map(e=>e.name).find(e=>"value"===e.toLowerCase());if(!n)return;const a=r.filter(e=>e.attributes[n]===(null!=t?parseInt(t,10):null));a&&a[0]&&s.forEach(t=>{const i=H+t.name;e.attributes[i]=a[0].attributes[t.name]})}_updateFeatureWithMagDirValues(e,t){if(!this._isVectorDataSet())return;const i=t.split(/,\s*/).map(e=>parseFloat(e)),r=i.map(e=>[e]),s=i.map(e=>({minValue:e,maxValue:e,noDataValue:null})),n=new M({height:1,width:1,pixelType:"f32",pixels:r,statistics:s});null!=this.pixelFilter&&this.pixelFilter({pixelBlock:n,extent:new y(0,0,0,0,this.spatialReference)});const a="esriImageServiceDataTypeVector-MagDir"===this.serviceDataType?[n.pixels[0][0],n.pixels[1][0]]:te([n.pixels[0][0],n.pixels[1][0]]);e.attributes[L.magnitude]=a[0],e.attributes[L.direction]=a[1]}_updateFeatureWithDomainValues(e){const t=this.fields&&this.fields.filter(e=>e.domain&&"coded-value"===e.domain.type);null!=t&&t.forEach(t=>{const i=e.attributes[t.name];if(null!=i){const r=t.domain.codedValues.find(e=>e.code===i);r&&(e.attributes[t.name]=r.name)}})}_updateResponseFieldNames(e,t){if(!t||t.length<1)return;const i=this.fieldsIndex;null!=i&&e.forEach(e=>{if(e?.attributes)for(const r of t){const t=i.get(r)?.name;t&&t!==r&&(e.attributes[r]=e.attributes[t],delete e.attributes[t])}})}_getRenderingRuleString(e){if(e){let t=e.toJSON();return t=t.rasterFunctionDefinition??t,(t.thumbnail||t.thumbnailEx)&&(t.thumbnail=t.thumbnailEx=null),JSON.stringify(t)}return null}_hasRasterFunction(e){return null!=e?.functionName&&"none"!==e.functionName.toLowerCase()}_updateRenderingRulesFunctionName(e,t){if(!e||e.length<1)return;if("Raw"===e)return e.replace("Raw","None");const i=e.toLowerCase().replaceAll(/ /gi,"_");return t.has(i)?t.get(i):e}_isRFTJson(e){return e?.name&&e.arguments&&e.function&&e.hasOwnProperty("functionType")}_isVectorDataSet(){return"esriImageServiceDataTypeVector-UV"===this.serviceDataType||"esriImageServiceDataTypeVector-MagDir"===this.serviceDataType}_applyMosaicAndRenderingRules(e){const{raster:t,mosaicRule:i,rasterFunction:r}=this;r&&null==e.rasterFunction&&(e.rasterFunction=r),i&&null==e.mosaicRule&&(e.mosaicRule=i),t&&null==e.raster&&(e.raster=t)}async _updateCurrentRasterInfo(e){if(this.renderer||this.symbolizer){const t=await this._generateRasterInfo(this.rasterFunction,{signal:e});t&&(this.rasterInfo=t)}}_applyMosaicRule(e){const{raster:t,mosaicRule:i}=this;i&&null==e.mosaicRule&&(e.mosaicRule=i),t&&null==e.raster&&(e.raster=t)}_readCapabilities(e){const t=e.capabilities?e.capabilities.toLowerCase().split(",").map(e=>e.trim()):["image","catalog"],{currentVersion:i,maxRecordCount:r}=e,s=t.includes("image"),n="esriImageServiceDataTypeElevation"===e.serviceDataType,a=!(!e.spatialReference&&!e.extent?.spatialReference),o=t.includes("edit"),l=t.includes("mensuration")&&a,u=null==e.mensurationCapabilities?[]:e.mensurationCapabilities.toLowerCase().split(",").map(e=>e.trim()),p=l&&u.includes("basic"),m=this._isMosaicDataset(e)&&t.includes("catalog"),c=t.includes("download"),h=i>=10.7&&n||i>=11.4&&(n||l&&u.includes("3d")),d=m&&e.fields&&e.fields.length>0,f=d&&e.supportsAdvancedQueries?e.advancedQueryCapabilities:void 0;return{data:{supportsAttachment:!1},operations:{supportsComputeHistograms:s,supportsExportImage:s,supportsIdentify:s,supportsImageToMap:i>=11.2&&m,supportsImageToMapMultiray:i>=11.2&&m,supportsMapToImage:i>=11.2&&m,supportsFindImages:i>=11.2&&m,supportsGetImageUrl:i>=11.3&&c,supportsMeasure:l,supportsMeasureFromImage:i>=11.2,supportsDownload:c,supportsQuery:d,supportsGetSamples:i>=10.2&&s,supportsProject:i>=10.3&&s,supportsComputeStatisticsHistograms:i>=10.4&&s,supportsQueryBoundary:i>=10.6&&s,supportsCalculateVolume:h,supportsComputePixelLocation:i>=10.7&&m,supportsComputeAngles:i>=10.91,supportsQueryGPSInfo:i>=11.2&&m,supportsAdd:o,supportsDelete:o,supportsEditing:o,supportsUpdate:o,supportsCalculate:!1,supportsTruncate:!1,supportsValidateSql:!1,supportsChangeTracking:!1,supportsQueryAttachments:!1,supportsResizeAttachments:!1,supportsSync:!1,supportsExceedsLimitStatistics:!1,supportsQueryAnalytics:!1,supportsQueryBins:!1,supportsQueryTopFeatures:!1,supportsAsyncConvert3D:!1},query:{maxRecordCount:r,maxRecordCountFactor:void 0,maxUniqueIDCount:void 0,supportsStatistics:!!f?.supportsStatistics,supportsOrderBy:!!f?.supportsOrderBy,supportsDistinct:!!f?.supportsDistinct,supportsPagination:!!f?.supportsPagination,supportsPaginationOnAggregatedQueries:!!f?.supportsPaginationOnAggregatedQueries,supportsStandardizedQueriesOnly:!!f?.useStandardizedQueries,supportsPercentileStatistics:!!f?.supportsPercentileStatistics,supportsCentroid:!!f?.supportsReturningGeometryCentroid,supportsCentroidOnDegeneratedQuantizedGeometry:!1,supportsCurrentUser:!1,supportsDegeneratedQuantizedGeometry:!1,supportsDistance:!!f?.supportsQueryWithDistance,supportsExtent:!!f?.supportsReturningQueryExtent,supportsGeometryProperties:!!f?.supportsReturningGeometryProperties,supportsHavingClause:!!f?.supportsHavingClause,supportsQuantization:!1,supportsQuantizationEditMode:!1,supportsQueryGeometry:!1,supportsResultType:!1,supportsReturnMesh:!1,supportsMaxRecordCountFactor:!1,supportsSqlExpression:f?.supportsSqlExpression??!!f,supportsTopFeaturesQuery:!1,supportsQueryByAnonymous:!1,supportsQueryByOthers:!1,supportsHistoricMoment:!1,supportsFormatPBF:!1,supportsDisjointSpatialRelationship:!1,supportsCacheHint:!1,supportsSpatialAggregationStatistics:!1,supportedSpatialAggregationStatistics:{envelope:!1,centroid:!1,convexHull:!1},supportsDefaultSpatialReference:!!f?.supportsDefaultSR,supportsFullTextSearch:!1,supportsCompactGeometry:!1,standardMaxRecordCount:void 0,tileMaxRecordCount:void 0,supportsTrueCurve:!1},mensuration:{supportsDistanceAndAngle:p,supportsAreaAndPerimeter:p,supportsPointOrCentroid:p,supportsHeightFromBaseAndTop:l&&u.includes("base-top height"),supportsHeightFromBaseAndTopShadow:l&&u.includes("base-top shadow height"),supportsHeightFromTopAndTopShadow:l&&u.includes("top-top shadow height"),supports3D:l&&u.includes("3d")}}}};function Ge(e){return e?.path??""}return e([u({clonable:!1})],He.prototype,"_functionRasterInfos",void 0),e([u({readOnly:!0})],He.prototype,"_serviceSupportsMosaicRule",void 0),e([d("_serviceSupportsMosaicRule",["currentVersion","fields"])],He.prototype,"readServiceSupportsMosaicRule",null),e([u({readOnly:!0})],He.prototype,"_rasterFunctionNamesIndex",null),e([u()],He.prototype,"adjustAspectRatio",void 0),e([u({type:[p],json:{write:!0}})],He.prototype,"bandIds",void 0),e([d("bandIds")],He.prototype,"readBandIds",null),e([u({readOnly:!0,json:{read:!1}})],He.prototype,"capabilities",void 0),e([d("service","capabilities",["capabilities","currentVersion","serviceDataType"])],He.prototype,"readCapabilities",null),e([u({type:Number})],He.prototype,"compressionQuality",void 0),e([g("compressionQuality")],He.prototype,"writeCompressionQuality",null),e([u({type:Number})],He.prototype,"compressionTolerance",void 0),e([g("compressionTolerance")],He.prototype,"writeCompressionTolerance",null),e([u({json:{read:{source:"copyrightText"}}})],He.prototype,"copyright",void 0),e([u({readOnly:!0,dependsOn:["_serviceSupportsMosaicRule"]})],He.prototype,"defaultMosaicRule",void 0),e([d("defaultMosaicRule",["defaultMosaicMethod"])],He.prototype,"readDefaultMosaicRule",null),e([u({type:String,json:{name:"layerDefinition.definitionExpression",write:{enabled:!0,allowNull:!0}}})],He.prototype,"definitionExpression",void 0),e([u({readOnly:!0,constructOnly:!0})],He.prototype,"exportImageServiceParameters",void 0),e([u()],He.prototype,"rasterInfo",void 0),e([u({readOnly:!0,type:[_]})],He.prototype,"fields",void 0),e([u({readOnly:!0})],He.prototype,"fieldsIndex",null),e([u({type:["png","png8","png24","png32","jpg","bmp","gif","jpgpng","lerc","tiff","bip","bsq"],json:{write:!0}})],He.prototype,"format",null),e([d("service","format",["serviceDataType"])],He.prototype,"readFormat",null),e([u({type:y})],He.prototype,"fullExtent",void 0),e([u({readOnly:!0})],He.prototype,"hasMultidimensions",void 0),e([u({json:{read:{source:"maxImageHeight"}}})],He.prototype,"imageMaxHeight",void 0),e([u({json:{read:{source:"maxImageWidth"}}})],He.prototype,"imageMaxWidth",void 0),e([u({type:String,json:{type:P.jsonValues,read:P.read,write:P.write}})],He.prototype,"interpolation",void 0),e([u()],He.prototype,"minScale",void 0),e([d("service","minScale")],He.prototype,"readMinScale",null),e([u()],He.prototype,"maxScale",void 0),e([d("service","maxScale")],He.prototype,"readMaxScale",null),e([u({type:T})],He.prototype,"mosaicRule",null),e([d("mosaicRule",["mosaicRule","defaultMosaicMethod"])],He.prototype,"readMosaicRule",null),e([g("mosaicRule")],He.prototype,"writeMosaicRule",null),e([u()],He.prototype,"multidimensionalInfo",void 0),e([u({type:C,json:{write:!0}})],He.prototype,"multidimensionalSubset",void 0),e([u({json:{type:p}})],He.prototype,"noData",void 0),e([g("noData")],He.prototype,"writeNoData",null),e([u({type:String,json:{type:N.jsonValues,read:N.read,write:N.write}})],He.prototype,"noDataInterpretation",void 0),e([u({type:String,readOnly:!0,json:{read:{source:["fields"]}}})],He.prototype,"objectIdField",void 0),e([d("objectIdField")],He.prototype,"readObjectIdField",null),e([u({readOnly:!0})],He.prototype,"geometryType",void 0),e([u({})],He.prototype,"typeIdField",void 0),e([u({})],He.prototype,"types",void 0),e([u({readOnly:!0})],He.prototype,"parsedUrl",null),e([u({type:Function})],He.prototype,"pixelFilter",void 0),e([u()],He.prototype,"raster",void 0),e([u({readOnly:!0})],He.prototype,"sourceType",void 0),e([d("sourceType",["serviceSourceType","fields"])],He.prototype,"readSourceType",null),e([u()],He.prototype,"viewId",void 0),e([u()],He.prototype,"renderer",null),e([u({types:ue,json:{name:"layerDefinition.drawingInfo.renderer",origins:{"web-scene":{types:le,name:"layerDefinition.drawingInfo.renderer",write:{overridePolicy:e=>({enabled:e&&"vector-field"!==e.type})}}}}})],He.prototype,"internalRenderer",null),e([d("internalRenderer")],He.prototype,"readRenderer",null),e([g("internalRenderer")],He.prototype,"writeRenderer",null),e([u({clonable:!1})],He.prototype,"symbolizer",void 0),e([u(w)],He.prototype,"opacity",void 0),e([u({readOnly:!0})],He.prototype,"rasterFields",null),e([u({constructOnly:!0})],He.prototype,"rasterFunctionInfos",void 0),e([u({type:G,json:{name:"renderingRule"}})],He.prototype,"rasterFunction",null),e([d("rasterFunction",["renderingRule","rasterFunctionInfos"])],He.prototype,"readRasterFunction",null),e([u({readOnly:!0})],He.prototype,"serviceDataType",void 0),e([u({readOnly:!0,type:I})],He.prototype,"spatialReference",void 0),e([d("spatialReference",["spatialReference","extent"])],He.prototype,"readSpatialReference",null),e([u({type:q.apiValues,json:{read:q.read,type:q.jsonValues}})],He.prototype,"pixelType",void 0),e([g("pixelType")],He.prototype,"writePixelType",null),e([u({constructOnly:!0,type:k})],He.prototype,"serviceRasterInfo",void 0),e([u()],He.prototype,"sourceJSON",void 0),e([u(b)],He.prototype,"url",void 0),e([u({readOnly:!0})],He.prototype,"version",void 0),e([d("version",["currentVersion","fields","timeInfo"])],He.prototype,"readVersion",null),He=e([f("esri.layers.mixins.ArcGISImageService")],He),He};export{He as ArcGISImageService};
|