@arcgis/core 4.33.0-next.20250209 → 4.33.0-next.20250211
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/AttributeBinsGraphic.js +1 -1
- package/Graphic.js +1 -1
- package/Ground.js +1 -1
- package/WebMap.js +1 -1
- package/WebScene.js +1 -1
- package/arcade/ArcadeModuleResolver.js +1 -1
- package/arcade/featureset/actions/Adapted.js +1 -1
- package/arcade/featureset/support/FeatureSet.js +1 -1
- package/arcade/featureset/support/Guid.js +1 -1
- package/arcade/featureset/support/cache.js +1 -1
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/{d31f7598629f7cc50233.js → 004853abf357f865b4fa.js} +1 -1
- package/assets/esri/core/workers/chunks/00e374e3b4781c4f9a3e.js +1 -0
- package/assets/esri/core/workers/chunks/{746c964cf07e4306f21f.js → 03f51ea011ffbcfb7c7d.js} +1 -1
- package/assets/esri/core/workers/chunks/{ad3e692681b50bd1acc2.js → 03fac4c79641603d8cba.js} +1 -1
- package/assets/esri/core/workers/chunks/{0167cf867d8e46c818b0.js → 09260bbe1fd6ce5a53e6.js} +1 -1
- package/assets/esri/core/workers/chunks/{d1718ad93e3271b0525e.js → 0e4350fda5328862f2fb.js} +1 -1
- package/assets/esri/core/workers/chunks/12199e8abf377ffc27cd.js +1 -0
- package/assets/esri/core/workers/chunks/1a286d43daa3b811c30d.js +1 -0
- package/assets/esri/core/workers/chunks/{e5e3b6d00d27b5bb354f.js → 1d282700e76285a1684c.js} +1 -1
- package/assets/esri/core/workers/chunks/2130e0c8d2410c87f880.js +1 -0
- package/assets/esri/core/workers/chunks/2530e5d1f438db8a7b5c.js +1 -0
- package/assets/esri/core/workers/chunks/{dfaf1da323906ee60549.js → 2876419a32537e24b7da.js} +1 -1
- package/assets/esri/core/workers/chunks/2b733e8043659466e194.js +1 -0
- package/assets/esri/core/workers/chunks/311c85bd94d5fb28e272.js +1 -0
- package/assets/esri/core/workers/chunks/33c6fd524711efd8ef13.js +1 -0
- package/assets/esri/core/workers/chunks/{594d923400fd74881833.js → 35392bf8f21005ad6170.js} +1 -1
- package/assets/esri/core/workers/chunks/{de1f3c4b8000c2d73013.js → 39dca492cc5f089e1609.js} +1 -1
- package/assets/esri/core/workers/chunks/{5b85f9da022742f602e2.js → 3c8e5b5fb52611e30ed6.js} +1 -1
- package/assets/esri/core/workers/chunks/491effb2c681493cc3a6.js +1 -0
- package/assets/esri/core/workers/chunks/{e93dea6b112ce8e2779b.js → 4b47549614d53ce1e384.js} +1 -1
- package/assets/esri/core/workers/chunks/{369a2b8484a8807bde38.js → 4be5e453fe54f5631659.js} +1 -1
- package/assets/esri/core/workers/chunks/{2971266a49226e769360.js → 5e5045add6567588b90a.js} +1 -1
- package/assets/esri/core/workers/chunks/{5721557a1d8eab23a55b.js → 5eceedac9b2b4d1ef133.js} +1 -1
- package/assets/esri/core/workers/chunks/6a9a1cd8134a903dd05a.js +1 -0
- package/assets/esri/core/workers/chunks/6c9bb00f33649ab59dab.js +314 -0
- package/assets/esri/core/workers/chunks/7485588bd24217669578.js +1 -0
- package/assets/esri/core/workers/chunks/74e0116ae84def626c87.js +1 -0
- package/assets/esri/core/workers/chunks/{c4374b6bc5c8dc6435c7.js → 7c81e08fc8a67dcd9dad.js} +1 -1
- package/assets/esri/core/workers/chunks/{433576983754f690bcc7.js → 7e3b374f906441cd7fb0.js} +1 -1
- package/assets/esri/core/workers/chunks/{8c32cee395da0a7b9a8e.js → 80d3aa3f27ad5b2b969b.js} +1 -1
- package/assets/esri/core/workers/chunks/{de4384b5833a60e88e31.js → 84c1c3336011a1b79669.js} +1 -1
- package/assets/esri/core/workers/chunks/{9d61590c4d21c7421925.js → 88a34690480d3658bad8.js} +1 -1
- package/assets/esri/core/workers/chunks/8939479cd433cc53f6c1.js +1 -0
- package/assets/esri/core/workers/chunks/{28dd172faa85080511c5.js → 8a2f3ce46eeac853b3a9.js} +1 -1
- package/assets/esri/core/workers/chunks/8b6580329e1e35ea4190.js +1 -0
- package/assets/esri/core/workers/chunks/8bfeef7cffe1e65c9dab.js +1 -0
- package/assets/esri/core/workers/chunks/{b44cf0e4c2f93408cabc.js → 9205115bdb5bc03d0c02.js} +1 -1
- package/assets/esri/core/workers/chunks/92d76d59113b4139befe.js +1 -0
- package/assets/esri/core/workers/chunks/9421ae38fdf986b9b107.js +1 -0
- package/assets/esri/core/workers/chunks/99c136b800e5fc7e04f4.js +1 -0
- package/assets/esri/core/workers/chunks/{d339dee99c4820b63f39.js → 9b74635d80d029498da1.js} +1 -1
- package/assets/esri/core/workers/chunks/{c2336d1f5b2b7bf6e7a7.js → 9bd6a4bf8150a6f618ea.js} +1 -1
- package/assets/esri/core/workers/chunks/9e7895e8201127ffe0a8.js +1 -0
- package/assets/esri/core/workers/chunks/{15e08e8a8a72b177d74c.js → a38cb1fff519bad8abe3.js} +1 -1
- package/assets/esri/core/workers/chunks/{7b367bb0ed9c218ca595.js → a52690a27f8732739c02.js} +1 -1
- package/assets/esri/core/workers/chunks/{cdd8983cf3a301805680.js → a52c282609a7e9c8ca9e.js} +1 -1
- package/assets/esri/core/workers/chunks/a56b3dffd9f38973f350.js +1 -0
- package/assets/esri/core/workers/chunks/a9274c9132e7a2691abb.js +1 -0
- package/assets/esri/core/workers/chunks/b253cf42e53f957b4b4e.js +1 -0
- package/assets/esri/core/workers/chunks/b50176897ffadc53573e.js +1 -0
- package/assets/esri/core/workers/chunks/{c26ffbff1115e76bcb0f.js → baee20c14763bef80b09.js} +1 -1
- package/assets/esri/core/workers/chunks/c3dc355d0f8d89b9b7b8.js +1 -0
- package/assets/esri/core/workers/chunks/c77ade444aa2f3f2b599.js +1 -0
- package/assets/esri/core/workers/chunks/c7927c2d5414f19defd5.js +1 -0
- package/assets/esri/core/workers/chunks/ca6180e572e69540c183.js +1 -0
- package/assets/esri/core/workers/chunks/{16f82e9d98371431b46d.js → cc085918c63da416e59d.js} +1 -1
- package/assets/esri/core/workers/chunks/{8e90c5fee4ad7c7275dc.js → cccd215b0a4890551957.js} +1 -1
- package/assets/esri/core/workers/chunks/ce88224af357957dd83a.js +1 -0
- package/assets/esri/core/workers/chunks/{07c5f3fc475c57f5a7a7.js → cf00df122df3db3b0c23.js} +1 -1
- package/assets/esri/core/workers/chunks/d074c916b414432a7b6a.js +1 -0
- package/assets/esri/core/workers/chunks/d342c56558f164e9e786.js +1 -0
- package/assets/esri/core/workers/chunks/{3c591f76e7d6204b7780.js → d3f7ff03ab5b40062d89.js} +1 -1
- package/assets/esri/core/workers/chunks/e03e237e7e6ffc8b7f0d.js +1 -0
- package/assets/esri/core/workers/chunks/{0b62871b89dcb4c70457.js → e21941260bae30061c2c.js} +1 -1
- package/assets/esri/core/workers/chunks/e6633f0326a44477f630.js +1 -0
- package/assets/esri/core/workers/chunks/e71b780d1e6a32f303b7.js +1 -0
- package/assets/esri/core/workers/chunks/eac28b0f6fccfabcc3ca.js +1 -0
- package/assets/esri/core/workers/chunks/{01c3507d78398baaf61b.js → eb0ce7937813d1be1284.js} +1 -1
- package/assets/esri/core/workers/chunks/{f198f4ba7d3d52882d98.js → efded84870064c3d8210.js} +1 -1
- package/assets/esri/core/workers/chunks/{c8a0089e080140db9076.js → f285ed5425b31123d2bc.js} +1 -1
- package/assets/esri/core/workers/chunks/f4ba823c8acd60c7c82d.js +1 -0
- package/core/Accessor.js +1 -1
- package/core/Collection.js +1 -1
- package/core/Logger.js +1 -1
- package/core/ObjectPool.js +1 -1
- package/core/RandomLCG.js +1 -1
- package/core/XHRAdapter.js +1 -1
- package/core/accessorSupport/watch.js +1 -1
- package/core/pbf.js +1 -1
- package/core/sql/UnknownTimeZone.js +1 -1
- package/core/workers/RemoteClient.js +1 -1
- package/geometry/SpatialReference.js +1 -1
- package/geometry/support/MeshGeoreferencedVertexSpace.js +1 -1
- package/geometry/support/MeshTexture.js +1 -1
- package/geometry/support/MeshTransform.js +1 -1
- package/geometry/support/buffer/BufferPool.js +1 -1
- package/geometry/support/buffer/BufferView.js +1 -1
- package/geometry/support/buffer/internals/Mat3.js +1 -1
- package/geometry/support/buffer/internals/Mat4.js +1 -1
- package/geometry/support/buffer/internals/Scalar.js +1 -1
- package/geometry/support/buffer/internals/Vec2.js +1 -1
- package/geometry/support/buffer/internals/Vec3.js +1 -1
- package/geometry/support/buffer/internals/Vec4.js +1 -1
- package/geometry/support/meshUtils/exporters/gltf/glb.js +1 -1
- package/identity/OAuthInfo.js +1 -1
- package/interfaces.d.ts +7 -1
- package/layers/mixins/EditBusLayer.js +1 -1
- package/layers/mixins/PublishableLayer.js +1 -1
- package/layers/support/AggregateField.js +1 -1
- package/layers/support/CodedValueDomain.js +1 -1
- package/layers/support/Field.js +1 -1
- package/layers/support/ImageElement.js +1 -1
- package/layers/support/InheritedDomain.js +1 -1
- package/layers/support/LOD.js +1 -1
- package/layers/support/LabelClass.js +1 -1
- package/layers/support/LabelExpressionInfo.js +1 -1
- package/layers/support/OrderByInfo.js +1 -1
- package/layers/support/PurgeOptions.js +1 -1
- package/layers/support/RangeDomain.js +1 -1
- package/layers/support/Sublayer.js +1 -1
- package/layers/support/TileInfo.js +1 -1
- package/layers/support/TilemapCache.js +1 -1
- package/layers/support/VideoElement.js +1 -1
- package/layers/support/source/DataLayerSource.js +1 -1
- package/package.json +1 -1
- package/portal/Portal.js +1 -1
- package/rest/support/AttachmentQuery.js +1 -1
- package/rest/support/ClosestFacilityParameters.js +1 -1
- package/rest/support/DirectionLine.js +1 -1
- package/rest/support/DirectionPoint.js +1 -1
- package/rest/support/JobInfo.js +1 -1
- package/rest/support/NetworkFeatureSet.js +1 -1
- package/rest/support/PointBarrier.js +1 -1
- package/rest/support/PolygonBarrier.js +1 -1
- package/rest/support/PolylineBarrier.js +1 -1
- package/rest/support/Query.js +1 -1
- package/rest/support/RelationshipQuery.js +1 -1
- package/rest/support/RouteInfo.js +1 -1
- package/rest/support/RouteParameters.js +1 -1
- package/rest/support/ServiceAreaParameters.js +1 -1
- package/rest/support/Stop.js +1 -1
- package/rest/support/TopFeaturesQuery.js +1 -1
- package/support/revision.js +1 -1
- package/symbols/ExtrudeSymbol3DLayer.js +1 -1
- package/symbols/FillSymbol3DLayer.js +1 -1
- package/symbols/IconSymbol3DLayer.js +1 -1
- package/symbols/LineSymbol3DLayer.js +1 -1
- package/symbols/ObjectSymbol3DLayer.js +1 -1
- package/symbols/PathSymbol3DLayer.js +1 -1
- package/symbols/TextSymbol3DLayer.js +1 -1
- package/symbols/WaterSymbol3DLayer.js +1 -1
- package/symbols/cim/OverrideHelper.js +1 -1
- package/symbols/cim/effects/EffectAddControlPoints.js +1 -1
- package/symbols/cim/effects/EffectArrow.js +1 -1
- package/symbols/cim/effects/EffectBuffer.js +1 -1
- package/symbols/cim/effects/EffectControlMeasureLine.js +1 -1
- package/symbols/cim/effects/EffectCut.js +1 -1
- package/symbols/cim/effects/EffectDashes.js +1 -1
- package/symbols/cim/effects/EffectDonut.js +1 -1
- package/symbols/cim/effects/EffectJog.js +1 -1
- package/symbols/cim/effects/EffectMove.js +1 -1
- package/symbols/cim/effects/EffectOffset.js +1 -1
- package/symbols/cim/effects/EffectReverse.js +1 -1
- package/symbols/cim/effects/EffectRotate.js +1 -1
- package/symbols/cim/effects/EffectScale.js +1 -1
- package/symbols/cim/effects/EffectWave.js +1 -1
- package/symbols/cim/placements/PlacementAlongLineSameSize.js +1 -1
- package/symbols/cim/placements/PlacementAtExtremities.js +1 -1
- package/symbols/cim/placements/PlacementAtRatioPositions.js +1 -1
- package/symbols/cim/placements/PlacementInsidePolygon.js +1 -1
- package/symbols/cim/placements/PlacementOnLine.js +1 -1
- package/symbols/cim/placements/PlacementOnVertices.js +1 -1
- package/symbols/cim/placements/PlacementPolygonCenter.js +1 -1
- package/symbols/support/ElevationInfo.js +1 -1
- package/time/TimeExtent.js +1 -1
- package/views/2d/engine/vectorTiles/buckets/SymbolBucket.js +1 -1
- package/views/2d/engine/vectorTiles/expression/expression.js +1 -1
- package/views/2d/engine/vectorTiles/shaders/VTLBackgroundMaterial.js +1 -1
- package/views/2d/engine/vectorTiles/shaders/VTLCircleMaterial.js +1 -1
- package/views/2d/engine/vectorTiles/shaders/VTLFillMaterial.js +1 -1
- package/views/2d/engine/vectorTiles/shaders/VTLLineMaterial.js +1 -1
- package/views/2d/engine/vectorTiles/shaders/VTLMaterial.js +1 -1
- package/views/2d/engine/vectorTiles/shaders/VTLSymbolMaterial.js +1 -1
- package/views/2d/engine/vectorTiles/style/StyleDefinition.js +1 -1
- package/views/2d/engine/webgl/DisplayEntity.js +1 -1
- package/views/2d/engine/webgl/DisplayRecord.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/GraphShaderModule.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/graph/ShaderGraphNode.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/graph/glsl.js +1 -1
- package/views/2d/layers/features/FeatureStoreQueryAdapter.js +1 -1
- package/views/2d/tiling/TileCoverage.js +1 -1
- package/views/2d/tiling/TileKey.js +1 -1
- package/views/3d/analysis/Slice/SliceTool.js +1 -1
- package/views/3d/environment/SceneViewEnvironment.js +1 -1
- package/views/3d/layers/graphics/Graphics3DCore.js +1 -1
- package/views/3d/layers/graphics/Graphics3DIconSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DLineCalloutSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DLineSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DPolygonFillSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DWaterSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/pipeline/featureSet/TiledFeatureStore.js +1 -1
- package/views/3d/layers/graphics/pipeline/rendering/DirectRenderer.js +1 -1
- package/views/3d/layers/graphics/pipeline/rendering/FeaturePipelineRenderManager.js +1 -1
- package/views/3d/layers/graphics/pipeline/rendering/LodRenderer.js +1 -1
- package/views/3d/layers/graphics/pipeline/rendering/RenderCommandEncoder.js +1 -1
- package/views/3d/layers/graphics/pipeline/symbolization/TestObjectSymbol.js +1 -1
- package/views/3d/state/Frustum.js +1 -1
- package/views/3d/support/DisplayQualityProfile.js +1 -1
- package/views/3d/terrain/TerrainSurface.js +1 -1
- package/views/3d/terrain/TextureFader.js +1 -1
- package/views/3d/terrain/TilingScheme.js +1 -1
- package/views/3d/webgl-engine/collections/Component/ComponentIntersectionData.js +1 -1
- package/views/3d/webgl-engine/lib/DepthRange.js +1 -1
- package/views/3d/webgl-engine/lib/Octree.js +1 -1
- package/views/3d/webgl-engine/lib/edgeRendering/edgeBufferWriters.js +1 -1
- package/views/SceneView.js +1 -1
- package/views/View.js +1 -1
- package/views/View2D.js +1 -1
- package/views/draw/DrawAction.js +1 -1
- package/views/draw/drawSurfaces.js +1 -1
- package/views/input/BrowserEventSource.js +1 -1
- package/views/interactive/editGeometry/operations/UndoGroup.js +1 -1
- package/views/interactive/snapping/featureSources/sceneLayerSource/SceneLayerSnappingSourceWorker.js +1 -1
- package/views/support/imageReprojection.js +1 -1
- package/views/webgl/FramebufferObject.js +1 -1
- package/views/webgl/ShaderBuilder.js +1 -1
- package/views/webgl/Texture.js +1 -1
- package/webscene/Environment.js +1 -1
- package/webscene/SunLighting.js +1 -1
- package/webscene/VirtualLighting.js +1 -1
- package/widgets/BuildingExplorer/BuildingDisciplinesTree/BuildingDisciplinesNode.js +1 -1
- package/widgets/BuildingExplorer/BuildingDisciplinesTree/BuildingDisciplinesTree.js +1 -1
- package/widgets/Editor/UpdateRecordWorkflow.js +1 -1
- package/widgets/Feature/FeatureViewModel.js +1 -1
- package/widgets/LayerList/LayerListItem.js +1 -1
- package/widgets/OrientedImageryViewer/components/SketchTools.js +1 -1
- package/widgets/ScaleRangeSlider/ScaleRanges.js +1 -1
- package/widgets/Search/SearchViewModel.js +1 -1
- package/widgets/Sketch/support/ResponsiveToolbar/OverflowGroup.js +1 -1
- package/widgets/Sketch/support/ResponsiveToolbar/SplitButton.js +1 -1
- package/widgets/Widget.js +1 -1
- package/widgets/support/forms/expressions/FormExpressionArcadeExecutor.js +1 -1
- package/assets/esri/core/workers/chunks/00e0c53d89e074399f04.js +0 -1
- package/assets/esri/core/workers/chunks/12d6baeffd55a98a7c75.js +0 -1
- package/assets/esri/core/workers/chunks/207c040b0e42358a5389.js +0 -1
- package/assets/esri/core/workers/chunks/21c12edc0632eb911e73.js +0 -1
- package/assets/esri/core/workers/chunks/24c94f97a76646d415ae.js +0 -1
- package/assets/esri/core/workers/chunks/2611adb4f328f95ee508.js +0 -1
- package/assets/esri/core/workers/chunks/26a2bd432e7a1b3870c3.js +0 -1
- package/assets/esri/core/workers/chunks/2def7db73a776e759dae.js +0 -1
- package/assets/esri/core/workers/chunks/2ff63a71213f618377d6.js +0 -1
- package/assets/esri/core/workers/chunks/44abd2cd17aae3299ede.js +0 -1
- package/assets/esri/core/workers/chunks/4b56c0c109e10d7409b8.js +0 -1
- package/assets/esri/core/workers/chunks/5660f13d78e9e4240034.js +0 -1
- package/assets/esri/core/workers/chunks/568bcf809fcfd4d9c713.js +0 -1
- package/assets/esri/core/workers/chunks/5e889a675cbaff03ad5a.js +0 -1
- package/assets/esri/core/workers/chunks/61795bde00f2e16d04f1.js +0 -1
- package/assets/esri/core/workers/chunks/62a1d60ad4bf6469c4dd.js +0 -1
- package/assets/esri/core/workers/chunks/6ea02ff25f051c08e6c3.js +0 -1
- package/assets/esri/core/workers/chunks/7bf08823f861628144a1.js +0 -1
- package/assets/esri/core/workers/chunks/86149b4a5a148744c7d1.js +0 -1
- package/assets/esri/core/workers/chunks/9b2fab133786e5d47631.js +0 -1
- package/assets/esri/core/workers/chunks/9bfb091cec7eed6c8111.js +0 -1
- package/assets/esri/core/workers/chunks/a2409d4921c02614169a.js +0 -1
- package/assets/esri/core/workers/chunks/b1baf39daf5725404be5.js +0 -1
- package/assets/esri/core/workers/chunks/b43d88b6e7dc4ab13599.js +0 -1
- package/assets/esri/core/workers/chunks/b9d9a1dc3c5d799e2685.js +0 -1
- package/assets/esri/core/workers/chunks/c1970657a287ec96001e.js +0 -1
- package/assets/esri/core/workers/chunks/cc75bbfd779f409943a3.js +0 -1
- package/assets/esri/core/workers/chunks/d35efcbe439500bf18bc.js +0 -1
- package/assets/esri/core/workers/chunks/d599ba865da87b487b1b.js +0 -1
- package/assets/esri/core/workers/chunks/da1157e288dbc6ba842a.js +0 -1
- package/assets/esri/core/workers/chunks/ddc30044f61a2c2df3fe.js +0 -1
- package/assets/esri/core/workers/chunks/e37e5d2e233d7f6ccd52.js +0 -314
- package/assets/esri/core/workers/chunks/f14b318bab5efcf43419.js +0 -1
- package/assets/esri/core/workers/chunks/f29715459ecd46180829.js +0 -1
- package/assets/esri/core/workers/chunks/f4e48bbdbc9da10ec71a.js +0 -1
- package/assets/esri/core/workers/chunks/f62f657f9fef28f492e0.js +0 -1
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../../chunks/tslib.es6.js";import r from"../../PopupTemplate.js";import t from"../../request.js";import i from"../../core/Collection.js";import o from"../../core/Error.js";import has from"../../core/has.js";import s from"../../core/Identifiable.js";import{clone as a}from"../../core/lang.js";import l from"../../core/Loadable.js";import n from"../../core/Logger.js";import{MultiOriginJSONMixin as p}from"../../core/MultiOriginJSONSupport.js";import{sqlAnd as u}from"../../core/sql.js";import{objectToQuery as y}from"../../core/urlUtils.js";import{property as d}from"../../core/accessorSupport/decorators/property.js";import{cast as c}from"../../core/accessorSupport/decorators/cast.js";import{reader as f}from"../../core/accessorSupport/decorators/reader.js";import{subclass as h}from"../../core/accessorSupport/decorators/subclass.js";import{writer as m}from"../../core/accessorSupport/decorators/writer.js";import{ensureInteger as b,ensureType as g,Integer as S,ensureClass as I}from"../../core/accessorSupport/ensureType.js";import{OriginId as w,nameToId as v}from"../../core/accessorSupport/PropertyOrigin.js";import{getProperties as j}from"../../core/accessorSupport/utils.js";import F from"../../geometry/Extent.js";import L from"../../geometry/SpatialReference.js";import{featureGeometryTypeKebabDictionary as O}from"../../geometry/support/typeUtils.js";import D from"../graphics/sources/support/QueryTask.js";import{readOrderByInfos as x}from"../mixins/OrderedLayer.js";import{getFeatureType as E}from"./featureLayerUtils.js";import P from"./FeatureType.js";import q from"./Field.js";import T from"./FieldsIndex.js";import{fixRendererFields as _}from"./fieldUtils.js";import A from"./LabelClass.js";import{validateLabelingInfo as R}from"./labelingInfo.js";import C from"./LayerFloorInfo.js";import M from"./OrderByInfo.js";import V from"./Relationship.js";import{getFeatureLayerCapabilities as N}from"./serviceCapabilitiesUtils.js";import{DataLayerSource as k}from"./source/DataLayerSource.js";import{MapLayerSource as B}from"./source/MapLayerSource.js";import{rendererTypes as U,webSceneRendererTypes as Q}from"../../renderers/support/typeUtils.js";import{parseUrl as J}from"../../rest/utils.js";import $ from"../../rest/support/AttachmentQuery.js";import K from"../../rest/support/Query.js";import{createPopupTemplate as G}from"../../support/popupUtils.js";import{isSymbol3D as z}from"../../symbols/support/typeUtils.js";var H;function W(e){return"esriSMS"===e?.type}function X(e,r,t){const i=this.originIdOf(r)>=v(t.origin);return{ignoreOrigin:!0,allowNull:i,enabled:!!t&&("map-image"===t.layer?.type&&(t.writeSublayerStructure||i))}}function Y(e,r,t){return{enabled:!!t&&("tile"===t.layer?.type&&(t.origin&&this.originIdOf(r)>=v(t.origin)||this._isOverridden(r)))}}function Z(e,r,t){return{ignoreOrigin:!0,enabled:t&&t.writeSublayerStructure||!1}}function ee(e,r,t){return{ignoreOrigin:!0,enabled:!!t?.writeSublayerStructure&&this.originIdOf(r)>w.SERVICE}}function re(e,r,t){return{ignoreOrigin:!0,enabled:!!t&&(t.writeSublayerStructure||this.originIdOf(r)>=v(t.origin))}}let te=0;const ie=new Set(["layer","parent","loaded","loadStatus","loadError","loadWarnings"]);let oe=H=class extends(p(s.IdentifiableMixin(l))){constructor(e){super(e),this.capabilities=void 0,this.maxScaleRange={minScale:0,maxScale:0},this.fields=null,this.fullExtent=null,this.geometryType=null,this.globalIdField=null,this.isTable=!1,this.legendEnabled=!0,this.objectIdField=null,this.parent=null,this.popupEnabled=!0,this.popupTemplate=null,this.relationships=null,this.sourceJSON=null,this.spatialReference=null,this.title=null,this.typeIdField=null,this.type="sublayer",this.types=null,this._lastParsedUrl=null}async load(e){return this.addResolvingPromise((async()=>{const{layer:r,url:i}=this;if(!r&&!i)throw new o("sublayer:missing-layer","Sublayer can't be loaded without being part of a layer",{sublayer:this});const s=r?await r.fetchSublayerInfo(this,e):(await t(i,{responseType:"json",query:{f:"json"},...e})).data;s&&(this.sourceJSON=s,this.read({layerDefinition:s},{origin:"service",layer:r,url:J(i)}))})()),this}readCapabilities(e,r){r=r.layerDefinition||r;const{attachment:t,operations:{supportsQuery:i,supportsQueryAttachments:o},query:{supportsFormatPBF:s,supportsOrderBy:a,supportsPagination:l},data:{supportsAttachment:n},queryRelated:p}=N(r,this.url);return{attachment:{supportsOrderByFields:t?.supportsOrderByFields??!1,supportsResize:t?.supportsResize??!1},exportMap:{supportsModification:!!r.canModifyLayer},operations:{supportsQuery:i,supportsQueryAttachments:o},data:{supportsAttachment:n},query:{supportsFormatPBF:s,supportsOrderBy:a,supportsPagination:l},queryRelated:p}}get defaultPopupTemplate(){return this.createPopupTemplate()}set definitionExpression(e){this._setAndNotifyLayer("definitionExpression",e)}get effectiveScaleRange(){const{minScale:e,maxScale:r}=this;return{minScale:e,maxScale:r}}readMaxScaleRange(e,r){return{minScale:(r=r.layerDefinition||r).minScale??0,maxScale:r.maxScale??0}}get fieldsIndex(){return new T(this.fields||[])}set floorInfo(e){this._setAndNotifyLayer("floorInfo",e)}readGlobalIdFieldFromService(e,r){if((r=r.layerDefinition||r).globalIdField)return r.globalIdField;if(r.fields)for(const t of r.fields)if("esriFieldTypeGlobalID"===t.type)return t.name}get id(){const e=this._get("id");return e??te++}set id(e){this._get("id")!==e&&(!1!==this.layer?.capabilities?.exportMap?.supportsDynamicLayers?this._set("id",e):this._logLockedError("id","capability not available 'layer.capabilities.exportMap.supportsDynamicLayers'"))}readIsTable(e,r){return"Table"===r.type}set labelingInfo(e){this._setAndNotifyLayer("labelingInfo",e)}writeLabelingInfo(e,r,t,i){e&&e.length&&(r.layerDefinition={drawingInfo:{labelingInfo:e.map((e=>e.write({},i)))}})}set labelsVisible(e){this._setAndNotifyLayer("labelsVisible",e)}set layer(e){this._set("layer",e),this.sublayers?.forEach((r=>r.layer=e))}set listMode(e){this._set("listMode",e)}set minScale(e){this._setAndNotifyLayer("minScale",e)}readMinScale(e,r){return r.minScale||r.layerDefinition?.minScale||0}set maxScale(e){this._setAndNotifyLayer("maxScale",e)}readMaxScale(e,r){return r.maxScale||r.layerDefinition?.maxScale||0}readObjectIdFieldFromService(e,r){if((r=r.layerDefinition||r).objectIdField)return r.objectIdField;const t=r.fields?.find((e=>"esriFieldTypeOID"===e.type));return t?.name}set opacity(e){this._setAndNotifyLayer("opacity",e)}readOpacity(e,r){const{layerDefinition:t}=r;return 1-.01*(t?.transparency??t?.drawingInfo?.transparency??0)}writeOpacity(e,r,t,i){r.layerDefinition={drawingInfo:{transparency:100-100*e}}}set orderBy(e){this._setAndNotifyLayer("orderBy",e)}writeParent(e,r){this.parent&&this.parent!==this.layer?r.parentLayerId=b(this.parent.id):r.parentLayerId=-1}get queryTask(){if(!this.layer)return null;const{capabilities:e,fieldsIndex:r,layer:t,url:i}=this,{spatialReference:o}=t,s="gdbVersion"in t?t.gdbVersion:void 0,a=has("featurelayer-pbf")&&e?.query.supportsFormatPBF;return new D({fieldsIndex:r,gdbVersion:s,pbfSupported:a,queryAttachmentsSupported:e?.operations?.supportsQueryAttachments??!1,sourceSpatialReference:o,url:i})}set renderer(e){if(_(e,this.fieldsIndex),e)for(const r of e.symbols)if(z(r)){n.getLogger(this).warn("Sublayer renderer should use 2D symbols");break}this._setAndNotifyLayer("renderer",e)}get source(){return this._get("source")||new B({mapLayerId:this.id})}set source(e){this._setAndNotifyLayer("source",e)}set sublayers(e){this._handleSublayersChange(e,this._get("sublayers")),this._set("sublayers",e)}castSublayers(e){return g(i.ofType(H),e)}writeSublayers(e,r,t){this.sublayers?.length&&(r[t]=this.sublayers.map((e=>e.id)).toArray().reverse())}readTitle(e,r){return r.layerDefinition?.name??r.name}readTypeIdField(e,r){let t=(r=r.layerDefinition||r).typeIdField;if(t&&r.fields){t=t.toLowerCase();const e=r.fields.find((e=>e.name.toLowerCase()===t));e&&(t=e.name)}return t}get url(){const e=this.layer?.parsedUrl??this._lastParsedUrl,r=this.source;if(!e)return null;if(this._lastParsedUrl=e,"map-layer"===r?.type)return`${e.path}/${r.mapLayerId}`;const t={layer:JSON.stringify({source:this.source})};return`${e.path}/dynamicLayer?${y(t)}`}set url(e){this._overrideIfSome("url",e)}set visible(e){this._setAndNotifyLayer("visible",e)}writeVisible(e,r,t,i){r[t]=this.getAtOrigin("defaultVisibility","service")||e}clone(){const{store:e}=j(this),r=new H;return j(r).store=e.clone(ie),this.commitProperty("url"),r._lastParsedUrl=this._lastParsedUrl,r}createPopupTemplate(e){return G(this,e)}createQuery(){return new K({returnGeometry:!0,where:this.definitionExpression||"1=1"})}async createFeatureLayer(){if(this.hasOwnProperty("sublayers"))return null;const e=(await import("../FeatureLayer.js")).default,{layer:r,url:t}=this;let i;if(t&&this.originIdOf("url")>w.SERVICE)i=new e({url:t});else{if(!r?.parsedUrl)throw new o("createFeatureLayer:missing-information","Cannot create a FeatureLayer without a url or a parent layer");{const t=r.parsedUrl;i=new e({url:t.path}),t&&this.source&&("map-layer"===this.source.type?i.layerId=this.source.mapLayerId:i.dynamicDataSource=this.source)}}return null!=r?.refreshInterval&&(i.refreshInterval=r.refreshInterval),this.definitionExpression&&(i.definitionExpression=this.definitionExpression),this.floorInfo&&(i.floorInfo=a(this.floorInfo)),this.originIdOf("labelingInfo")>w.SERVICE&&(i.labelingInfo=a(this.labelingInfo)),this.originIdOf("labelsVisible")>w.DEFAULTS&&(i.labelsVisible=this.labelsVisible),this.originIdOf("legendEnabled")>w.DEFAULTS&&(i.legendEnabled=this.legendEnabled),this.originIdOf("visible")>w.DEFAULTS&&(i.visible=this.visible),this.originIdOf("minScale")>w.DEFAULTS&&(i.minScale=this.minScale),this.originIdOf("maxScale")>w.DEFAULTS&&(i.maxScale=this.maxScale),this.originIdOf("opacity")>w.DEFAULTS&&(i.opacity=this.opacity),this.originIdOf("popupTemplate")>w.DEFAULTS&&(i.popupTemplate=a(this.popupTemplate)),this.originIdOf("renderer")>w.SERVICE&&(i.renderer=a(this.renderer)),"data-layer"===this.source?.type&&(i.dynamicDataSource=this.source.clone()),this.originIdOf("title")>w.DEFAULTS&&(i.title=this.title),"map-image"===r?.type&&r.originIdOf("customParameters")>w.DEFAULTS&&(i.customParameters=r.customParameters),"tile"===r?.type&&r.originIdOf("customParameters")>w.DEFAULTS&&(i.customParameters=r.customParameters),i}getField(e){return this.fieldsIndex.get(e)}getFeatureType(e){return E(this.types,this.typeIdField,e)}getFieldDomain(e,r){const t=r?.feature,i=this.getFeatureType(t);if(i){const r=i.domains&&i.domains[e];if(r&&"inherited"!==r.type)return r}return this._getLayerDomain(e)}async queryAttachments(e,r){await this.load(),e=$.from(e);const t=this.capabilities;if(!t?.data?.supportsAttachment)throw new o("queryAttachments:not-supported","this layer doesn't support attachments");const{attachmentTypes:i,objectIds:s,globalIds:a,num:l,size:n,start:p,where:u}=e;if(!t?.operations?.supportsQueryAttachments){if(i?.length>0||a?.length>0||n?.length>0||l||p||u)throw new o("queryAttachments:option-not-supported","when 'capabilities.operations.supportsQueryAttachments' is false, only objectIds is supported",e)}if(!(s?.length||a?.length||u))throw new o("queryAttachments:invalid-query","'objectIds', 'globalIds', or 'where' are required to perform attachment query",e);return!t?.attachment?.supportsOrderByFields&&e.orderByFields?.length&&((e=e.clone()).orderByFields=null),this.queryTask.executeAttachmentQuery(e,r)}async queryFeatureCount(e=this.createQuery(),r){if(await this.load(),!this.capabilities.operations.supportsQuery)throw new o("queryFeatureCount:not-supported","this layer doesn't support queries.");if(!this.url)throw new o("queryFeatureCount:not-supported","this layer has no url.");const t=this.layer?.apiKey;return await this.queryTask.executeForCount(e,{...r,query:{...this.layer?.customParameters,token:t}})}async queryFeatures(e=this.createQuery(),r){if(await this.load(),!this.capabilities.operations.supportsQuery)throw new o("queryFeatures:not-supported","this layer doesn't support queries.");if(!this.url)throw new o("queryFeatures:not-supported","this layer has no url.");const t=await this.queryTask.execute(e,{...r,query:{...this.layer?.customParameters,token:this.layer?.apiKey}});if(t?.features)for(const i of t.features)i.sourceLayer=this;return t}async queryObjectIds(e=this.createQuery(),r){if(await this.load(),!this.capabilities.operations.supportsQuery)throw new o("queryObjectIds:not-supported","this layer doesn't support queries.");if(!this.url)throw new o("queryObjectIds:not-supported","this layer has no url.");const t=this.layer?.apiKey;return await this.queryTask.executeForIds(e,{...r,query:{...this.layer?.customParameters,token:t}})}async queryRelatedFeatures(e,r){if(await this.load(),!this.capabilities.operations.supportsQuery)throw new o("queryRelatedFeatures:not-supported","this layer doesn't support queries.");if(!this.url)throw new o("queryRelatedFeatures:not-supported","this layer has no url.");const t=this.layer?.apiKey;return await this.queryTask.executeRelationshipQuery(e,{...r,query:{...this.layer?.customParameters,token:t}})}async queryRelatedFeaturesCount(e,r){if(await this.load(),!this.capabilities.operations.supportsQuery)throw new o("queryRelatedFeaturesCount:not-supported","this layer doesn't support queries.");if(!this.capabilities.queryRelated.supportsCount)throw new o("queryRelatedFeaturesCount:not-supported","this layer doesn't support query related counts.");if(!this.url)throw new o("queryRelatedFeaturesCount:not-supported","this layer has no url.");const t=this.layer?.apiKey;return await this.queryTask.executeRelationshipQueryForCount(e,{...r,query:{...this.layer?.customParameters,token:t}})}toExportImageJSON(e){const r={id:this.id,source:this.source?.toJSON()||{mapLayerId:this.id,type:"mapLayer"}},t=u(e,this.definitionExpression);null!=t&&(r.definitionExpression=t);const i=["renderer","labelingInfo","opacity","labelsVisible"].reduce(((e,r)=>(e[r]=this.originIdOf(r),e)),{}),o=Object.keys(i).some((e=>i[e]>w.SERVICE));if(o){const e=r.drawingInfo={};if(i.renderer>w.SERVICE&&(e.renderer=this.renderer?this.renderer.toJSON():null),i.labelsVisible>w.SERVICE&&(e.showLabels=this.labelsVisible),this.labelsVisible&&i.labelingInfo>w.SERVICE)if(this.labelingInfo){!this.loaded&&this.labelingInfo?.some((e=>!e.labelPlacement))&&n.getLogger(this).warnOnce(`A Sublayer (title: ${this.title}, id: ${this.id}) has an undefined 'labelPlacement' and so labels cannot be displayed. Either define a valid 'labelPlacement' or call Sublayer.load() to use a default value based on geometry type.`,{sublayer:this});let r=this.labelingInfo;null!=this.geometryType&&(r=R(this.labelingInfo,O.toJSON(this.geometryType))),e.showLabels=!0,e.labelingInfo=r.filter((e=>e.labelPlacement)).map((e=>e.toJSON({origin:"service",layer:this.layer})))}else e.showLabels=!1;i.opacity>w.SERVICE&&(e.transparency=100-100*this.opacity),this._assignDefaultSymbolColors(e.renderer)}return(this.layer?.capabilities?.exportMap?.supportsSublayerOrderBy??!1)&&this.originIdOf("orderBy")>w.SERVICE&&(r.orderBy=this.orderBy?.map((e=>e.toJSON()))??null),r}_assignDefaultSymbolColors(e){this._forEachSimpleMarkerSymbols(e,(e=>{e.color||"esriSMSX"!==e.style&&"esriSMSCross"!==e.style||(e.outline?.color?e.color=e.outline.color:e.color=[0,0,0,0])}))}_forEachSimpleMarkerSymbols(e,r){if(e){const t=("uniqueValueInfos"in e?e.uniqueValueInfos:"classBreakInfos"in e?e.classBreakInfos:null)??[];for(const e of t)W(e.symbol)&&r(e.symbol);"symbol"in e&&W(e.symbol)&&r(e.symbol),"defaultSymbol"in e&&W(e.defaultSymbol)&&r(e.defaultSymbol)}}_setAndNotifyLayer(e,r){const t=this.layer,i=this._get(e);let o,s;switch(e){case"definitionExpression":case"floorInfo":o="supportsSublayerDefinitionExpression";break;case"minScale":case"maxScale":case"visible":o="supportsSublayerVisibility";break;case"labelingInfo":case"labelsVisible":case"opacity":case"renderer":case"source":o="supportsDynamicLayers",s="supportsModification";break;case"orderBy":o="supportsSublayerOrderBy",s="supportsModification"}const a=j(this).getDefaultOrigin();if("service"!==a){if(o&&!1===this.layer?.capabilities?.exportMap?.[o])return void this._logLockedError(e,`capability not available 'layer.capabilities.exportMap.${o}'`);if(s&&!1===this.capabilities?.exportMap[s])return void this._logLockedError(e,`capability not available 'capabilities.exportMap.${s}'`)}"source"!==e||"not-loaded"===this.loadStatus?(this._set(e,r),"service"!==a&&i!==r&&t&&t.emit&&t.emit("sublayer-update",{propertyName:e,target:this})):this._logLockedError(e,"'source' can't be changed after calling sublayer.load()")}_handleSublayersChange(e,r){r&&(r.forEach((e=>{e.parent=null,e.layer=null})),this.removeAllHandles()),e&&(e.forEach((e=>{e.parent=this,e.layer=this.layer})),this.addHandles([e.on("after-add",(({item:e})=>{e.parent=this,e.layer=this.layer})),e.on("after-remove",(({item:e})=>{e.parent=null,e.layer=null})),e.on("before-changes",(e=>{(this.layer?.capabilities?.exportMap?.supportsSublayersChanges??1)||(n.getLogger(this).error(new o("sublayer:sublayers-non-modifiable","Sublayer can't be added, moved, or removed from the layer's sublayers",{sublayer:this,layer:this.layer})),e.preventDefault())}))]))}_logLockedError(e,r){const{layer:t,declaredClass:i}=this;n.getLogger(i).error(new o("sublayer:locked",`Property '${String(e)}' can't be changed on Sublayer from the layer '${t?.id}'`,{reason:r,sublayer:this,layer:t}))}_getLayerDomain(e){return this.fieldsIndex.get(e)?.domain??null}};oe.test={isMapImageLayerOverridePolicy:e=>e===ee||e===Z||e===X,isTileImageLayerOverridePolicy:e=>e===Y},e([d({readOnly:!0})],oe.prototype,"capabilities",void 0),e([f("service","capabilities",["layerDefinition.canModifyLayer","layerDefinition.capabilities"])],oe.prototype,"readCapabilities",null),e([d()],oe.prototype,"defaultPopupTemplate",null),e([d({type:String,value:null,json:{name:"layerDefinition.definitionExpression",write:{allowNull:!0,overridePolicy:X}}})],oe.prototype,"definitionExpression",null),e([d({readOnly:!0})],oe.prototype,"effectiveScaleRange",null),e([f("service","maxScaleRange",["minScale","maxScale"])],oe.prototype,"readMaxScaleRange",null),e([d({type:[q],json:{origins:{service:{read:{source:"layerDefinition.fields"}}}}})],oe.prototype,"fields",void 0),e([d({readOnly:!0})],oe.prototype,"fieldsIndex",null),e([d({type:C,value:null,json:{name:"layerDefinition.floorInfo",read:{source:"layerDefinition.floorInfo"},write:{target:"layerDefinition.floorInfo",overridePolicy:X},origins:{"web-scene":{read:!1,write:!1}}}})],oe.prototype,"floorInfo",null),e([d({type:F,json:{read:{source:"layerDefinition.extent"}}})],oe.prototype,"fullExtent",void 0),e([d({type:O.apiValues,json:{origins:{service:{name:"layerDefinition.geometryType",read:{reader:O.read}}}}})],oe.prototype,"geometryType",void 0),e([d({type:String})],oe.prototype,"globalIdField",void 0),e([f("service","globalIdField",["layerDefinition.globalIdField","layerDefinition.fields"])],oe.prototype,"readGlobalIdFieldFromService",null),e([d({type:S,json:{write:{ignoreOrigin:!0}}})],oe.prototype,"id",null),e([d({readOnly:!0})],oe.prototype,"isTable",void 0),e([f("service","isTable",["type"])],oe.prototype,"readIsTable",null),e([d({value:null,type:[A],json:{read:{source:"layerDefinition.drawingInfo.labelingInfo"},write:{target:"layerDefinition.drawingInfo.labelingInfo",overridePolicy:ee}}})],oe.prototype,"labelingInfo",null),e([m("labelingInfo")],oe.prototype,"writeLabelingInfo",null),e([d({type:Boolean,value:!0,json:{read:{source:"layerDefinition.drawingInfo.showLabels"},write:{target:"layerDefinition.drawingInfo.showLabels",overridePolicy:Z}}})],oe.prototype,"labelsVisible",null),e([d({value:null})],oe.prototype,"layer",null),e([d({type:String,json:{write:{overridePolicy:Y}}})],oe.prototype,"layerItemId",void 0),e([d({type:Boolean,value:!0,json:{origins:{service:{read:{enabled:!1}}},read:{source:"showLegend"},write:{target:"showLegend",overridePolicy:re}}})],oe.prototype,"legendEnabled",void 0),e([d({type:["show","hide","hide-children"],value:"show",json:{read:!1,write:!1,origins:{"web-scene":{read:!0,write:!0}}}})],oe.prototype,"listMode",null),e([d({type:Number,value:0,json:{write:{overridePolicy:Z}}})],oe.prototype,"minScale",null),e([f("minScale",["minScale","layerDefinition.minScale"])],oe.prototype,"readMinScale",null),e([d({type:Number,value:0,json:{write:{overridePolicy:Z}}})],oe.prototype,"maxScale",null),e([f("maxScale",["maxScale","layerDefinition.maxScale"])],oe.prototype,"readMaxScale",null),e([d()],oe.prototype,"objectIdField",void 0),e([f("service","objectIdField",["layerDefinition.objectIdField","layerDefinition.fields"])],oe.prototype,"readObjectIdFieldFromService",null),e([d({type:Number,value:1,json:{write:{target:"layerDefinition.drawingInfo.transparency",overridePolicy:Z}}})],oe.prototype,"opacity",null),e([f("opacity",["layerDefinition.drawingInfo.transparency","layerDefinition.transparency"])],oe.prototype,"readOpacity",null),e([m("opacity")],oe.prototype,"writeOpacity",null),e([d({value:null,type:[M],json:{name:"layerDefinition.orderBy",read:{reader:x}}})],oe.prototype,"orderBy",null),e([d({json:{type:S,write:{target:"parentLayerId",writerEnsuresNonNull:!0,overridePolicy:Z}}})],oe.prototype,"parent",void 0),e([m("parent")],oe.prototype,"writeParent",null),e([d({type:Boolean,value:!0,json:{read:{source:"disablePopup",reader:(e,r)=>!r.disablePopup},write:{target:"disablePopup",overridePolicy:re,writer(e,r,t){r[t]=!e}}}})],oe.prototype,"popupEnabled",void 0),e([d({type:r,json:{read:{source:"popupInfo"},write:{target:"popupInfo",overridePolicy:re}}})],oe.prototype,"popupTemplate",void 0),e([d({readOnly:!0})],oe.prototype,"queryTask",null),e([d({type:[V],readOnly:!0,json:{origins:{service:{read:{source:"layerDefinition.relationships"}}}}})],oe.prototype,"relationships",void 0),e([d({types:U,value:null,json:{name:"layerDefinition.drawingInfo.renderer",write:{overridePolicy:ee},origins:{"web-scene":{types:Q,name:"layerDefinition.drawingInfo.renderer",write:{overridePolicy:ee}}}}})],oe.prototype,"renderer",null),e([d({types:{key:"type",base:null,typeMap:{"data-layer":k,"map-layer":B}},cast(e){if(e){if("mapLayerId"in e)return I(B,e);if("dataSource"in e)return I(k,e)}return e},json:{name:"layerDefinition.source",write:{overridePolicy:Z}}})],oe.prototype,"source",null),e([d()],oe.prototype,"sourceJSON",void 0),e([d({type:L,json:{origins:{service:{read:{source:"layerDefinition.extent.spatialReference"}}}}})],oe.prototype,"spatialReference",void 0),e([d({value:null,json:{type:[S],write:{target:"subLayerIds",allowNull:!0,overridePolicy:Z}}})],oe.prototype,"sublayers",null),e([c("sublayers")],oe.prototype,"castSublayers",null),e([m("sublayers")],oe.prototype,"writeSublayers",null),e([d({type:String,json:{name:"name",write:{overridePolicy:re}}})],oe.prototype,"title",void 0),e([f("service","title",["name","layerDefinition.name"])],oe.prototype,"readTitle",null),e([d({type:String})],oe.prototype,"typeIdField",void 0),e([d({json:{read:!1},readOnly:!0,value:"sublayer"})],oe.prototype,"type",void 0),e([f("typeIdField",["layerDefinition.typeIdField"])],oe.prototype,"readTypeIdField",null),e([d({type:[P],json:{origins:{service:{read:{source:"layerDefinition.types"}}}}})],oe.prototype,"types",void 0),e([d({type:String,json:{name:"layerUrl",write:{overridePolicy:Y}}})],oe.prototype,"url",null),e([d({type:Boolean,value:!0,json:{read:{source:"defaultVisibility"},write:{target:"defaultVisibility",overridePolicy:Z}}})],oe.prototype,"visible",null),e([m("visible")],oe.prototype,"writeVisible",null),oe=H=e([h("esri.layers.support.Sublayer")],oe);const se=oe;export{se as default};
|
|
5
|
+
import{_ as e}from"../../chunks/tslib.es6.js";import r from"../../PopupTemplate.js";import t from"../../request.js";import i from"../../core/Collection.js";import o from"../../core/Error.js";import has from"../../core/has.js";import s from"../../core/Identifiable.js";import{clone as a}from"../../core/lang.js";import l from"../../core/Loadable.js";import n from"../../core/Logger.js";import{MultiOriginJSONMixin as p}from"../../core/MultiOriginJSONSupport.js";import{sqlAnd as u}from"../../core/sql.js";import{objectToQuery as y}from"../../core/urlUtils.js";import{property as d}from"../../core/accessorSupport/decorators/property.js";import{cast as c}from"../../core/accessorSupport/decorators/cast.js";import{reader as f}from"../../core/accessorSupport/decorators/reader.js";import{subclass as h}from"../../core/accessorSupport/decorators/subclass.js";import{writer as m}from"../../core/accessorSupport/decorators/writer.js";import{ensureInteger as b,ensureType as g,Integer as S,ensureClass as I}from"../../core/accessorSupport/ensureType.js";import{OriginId as w,nameToId as v}from"../../core/accessorSupport/PropertyOrigin.js";import{getProperties as j}from"../../core/accessorSupport/utils.js";import F from"../../geometry/Extent.js";import L from"../../geometry/SpatialReference.js";import{featureGeometryTypeKebabDictionary as O}from"../../geometry/support/typeUtils.js";import D from"../graphics/sources/support/QueryTask.js";import{readOrderByInfos as x}from"../mixins/OrderedLayer.js";import{getFeatureType as E}from"./featureLayerUtils.js";import P from"./FeatureType.js";import q from"./Field.js";import T from"./FieldsIndex.js";import{fixRendererFields as _}from"./fieldUtils.js";import A from"./LabelClass.js";import{validateLabelingInfo as R}from"./labelingInfo.js";import C from"./LayerFloorInfo.js";import M from"./OrderByInfo.js";import V from"./Relationship.js";import{getFeatureLayerCapabilities as N}from"./serviceCapabilitiesUtils.js";import{DataLayerSource as k}from"./source/DataLayerSource.js";import{MapLayerSource as B}from"./source/MapLayerSource.js";import{rendererTypes as U,webSceneRendererTypes as Q}from"../../renderers/support/typeUtils.js";import{parseUrl as J}from"../../rest/utils.js";import $ from"../../rest/support/AttachmentQuery.js";import K from"../../rest/support/Query.js";import{createPopupTemplate as G}from"../../support/popupUtils.js";import{isSymbol3D as z}from"../../symbols/support/typeUtils.js";var H;function W(e){return"esriSMS"===e?.type}function X(e,r,t){const i=this.originIdOf(r)>=v(t.origin);return{ignoreOrigin:!0,allowNull:i,enabled:!!t&&("map-image"===t.layer?.type&&(t.writeSublayerStructure||i))}}function Y(e,r,t){return{enabled:!!t&&("tile"===t.layer?.type&&(t.origin&&this.originIdOf(r)>=v(t.origin)||this._isOverridden(r)))}}function Z(e,r,t){return{ignoreOrigin:!0,enabled:t&&t.writeSublayerStructure||!1}}function ee(e,r,t){return{ignoreOrigin:!0,enabled:!!t?.writeSublayerStructure&&this.originIdOf(r)>w.SERVICE}}function re(e,r,t){return{ignoreOrigin:!0,enabled:!!t&&(t.writeSublayerStructure||this.originIdOf(r)>=v(t.origin))}}let te=0;const ie=new Set(["layer","parent","loaded","loadStatus","loadError","loadWarnings"]);let oe=class extends(p(s.IdentifiableMixin(l))){static{H=this}constructor(e){super(e),this.capabilities=void 0,this.maxScaleRange={minScale:0,maxScale:0},this.fields=null,this.fullExtent=null,this.geometryType=null,this.globalIdField=null,this.isTable=!1,this.legendEnabled=!0,this.objectIdField=null,this.parent=null,this.popupEnabled=!0,this.popupTemplate=null,this.relationships=null,this.sourceJSON=null,this.spatialReference=null,this.title=null,this.typeIdField=null,this.type="sublayer",this.types=null,this._lastParsedUrl=null}async load(e){return this.addResolvingPromise((async()=>{const{layer:r,url:i}=this;if(!r&&!i)throw new o("sublayer:missing-layer","Sublayer can't be loaded without being part of a layer",{sublayer:this});const s=r?await r.fetchSublayerInfo(this,e):(await t(i,{responseType:"json",query:{f:"json"},...e})).data;s&&(this.sourceJSON=s,this.read({layerDefinition:s},{origin:"service",layer:r,url:J(i)}))})()),this}readCapabilities(e,r){r=r.layerDefinition||r;const{attachment:t,operations:{supportsQuery:i,supportsQueryAttachments:o},query:{supportsFormatPBF:s,supportsOrderBy:a,supportsPagination:l},data:{supportsAttachment:n},queryRelated:p}=N(r,this.url);return{attachment:{supportsOrderByFields:t?.supportsOrderByFields??!1,supportsResize:t?.supportsResize??!1},exportMap:{supportsModification:!!r.canModifyLayer},operations:{supportsQuery:i,supportsQueryAttachments:o},data:{supportsAttachment:n},query:{supportsFormatPBF:s,supportsOrderBy:a,supportsPagination:l},queryRelated:p}}get defaultPopupTemplate(){return this.createPopupTemplate()}set definitionExpression(e){this._setAndNotifyLayer("definitionExpression",e)}get effectiveScaleRange(){const{minScale:e,maxScale:r}=this;return{minScale:e,maxScale:r}}readMaxScaleRange(e,r){return{minScale:(r=r.layerDefinition||r).minScale??0,maxScale:r.maxScale??0}}get fieldsIndex(){return new T(this.fields||[])}set floorInfo(e){this._setAndNotifyLayer("floorInfo",e)}readGlobalIdFieldFromService(e,r){if((r=r.layerDefinition||r).globalIdField)return r.globalIdField;if(r.fields)for(const t of r.fields)if("esriFieldTypeGlobalID"===t.type)return t.name}get id(){const e=this._get("id");return e??te++}set id(e){this._get("id")!==e&&(!1!==this.layer?.capabilities?.exportMap?.supportsDynamicLayers?this._set("id",e):this._logLockedError("id","capability not available 'layer.capabilities.exportMap.supportsDynamicLayers'"))}readIsTable(e,r){return"Table"===r.type}set labelingInfo(e){this._setAndNotifyLayer("labelingInfo",e)}writeLabelingInfo(e,r,t,i){e&&e.length&&(r.layerDefinition={drawingInfo:{labelingInfo:e.map((e=>e.write({},i)))}})}set labelsVisible(e){this._setAndNotifyLayer("labelsVisible",e)}set layer(e){this._set("layer",e),this.sublayers?.forEach((r=>r.layer=e))}set listMode(e){this._set("listMode",e)}set minScale(e){this._setAndNotifyLayer("minScale",e)}readMinScale(e,r){return r.minScale||r.layerDefinition?.minScale||0}set maxScale(e){this._setAndNotifyLayer("maxScale",e)}readMaxScale(e,r){return r.maxScale||r.layerDefinition?.maxScale||0}readObjectIdFieldFromService(e,r){if((r=r.layerDefinition||r).objectIdField)return r.objectIdField;const t=r.fields?.find((e=>"esriFieldTypeOID"===e.type));return t?.name}set opacity(e){this._setAndNotifyLayer("opacity",e)}readOpacity(e,r){const{layerDefinition:t}=r;return 1-.01*(t?.transparency??t?.drawingInfo?.transparency??0)}writeOpacity(e,r,t,i){r.layerDefinition={drawingInfo:{transparency:100-100*e}}}set orderBy(e){this._setAndNotifyLayer("orderBy",e)}writeParent(e,r){this.parent&&this.parent!==this.layer?r.parentLayerId=b(this.parent.id):r.parentLayerId=-1}get queryTask(){if(!this.layer)return null;const{capabilities:e,fieldsIndex:r,layer:t,url:i}=this,{spatialReference:o}=t,s="gdbVersion"in t?t.gdbVersion:void 0,a=has("featurelayer-pbf")&&e?.query.supportsFormatPBF;return new D({fieldsIndex:r,gdbVersion:s,pbfSupported:a,queryAttachmentsSupported:e?.operations?.supportsQueryAttachments??!1,sourceSpatialReference:o,url:i})}set renderer(e){if(_(e,this.fieldsIndex),e)for(const r of e.symbols)if(z(r)){n.getLogger(this).warn("Sublayer renderer should use 2D symbols");break}this._setAndNotifyLayer("renderer",e)}get source(){return this._get("source")||new B({mapLayerId:this.id})}set source(e){this._setAndNotifyLayer("source",e)}set sublayers(e){this._handleSublayersChange(e,this._get("sublayers")),this._set("sublayers",e)}castSublayers(e){return g(i.ofType(H),e)}writeSublayers(e,r,t){this.sublayers?.length&&(r[t]=this.sublayers.map((e=>e.id)).toArray().reverse())}readTitle(e,r){return r.layerDefinition?.name??r.name}readTypeIdField(e,r){let t=(r=r.layerDefinition||r).typeIdField;if(t&&r.fields){t=t.toLowerCase();const e=r.fields.find((e=>e.name.toLowerCase()===t));e&&(t=e.name)}return t}get url(){const e=this.layer?.parsedUrl??this._lastParsedUrl,r=this.source;if(!e)return null;if(this._lastParsedUrl=e,"map-layer"===r?.type)return`${e.path}/${r.mapLayerId}`;const t={layer:JSON.stringify({source:this.source})};return`${e.path}/dynamicLayer?${y(t)}`}set url(e){this._overrideIfSome("url",e)}set visible(e){this._setAndNotifyLayer("visible",e)}writeVisible(e,r,t,i){r[t]=this.getAtOrigin("defaultVisibility","service")||e}clone(){const{store:e}=j(this),r=new H;return j(r).store=e.clone(ie),this.commitProperty("url"),r._lastParsedUrl=this._lastParsedUrl,r}createPopupTemplate(e){return G(this,e)}createQuery(){return new K({returnGeometry:!0,where:this.definitionExpression||"1=1"})}async createFeatureLayer(){if(this.hasOwnProperty("sublayers"))return null;const e=(await import("../FeatureLayer.js")).default,{layer:r,url:t}=this;let i;if(t&&this.originIdOf("url")>w.SERVICE)i=new e({url:t});else{if(!r?.parsedUrl)throw new o("createFeatureLayer:missing-information","Cannot create a FeatureLayer without a url or a parent layer");{const t=r.parsedUrl;i=new e({url:t.path}),t&&this.source&&("map-layer"===this.source.type?i.layerId=this.source.mapLayerId:i.dynamicDataSource=this.source)}}return null!=r?.refreshInterval&&(i.refreshInterval=r.refreshInterval),this.definitionExpression&&(i.definitionExpression=this.definitionExpression),this.floorInfo&&(i.floorInfo=a(this.floorInfo)),this.originIdOf("labelingInfo")>w.SERVICE&&(i.labelingInfo=a(this.labelingInfo)),this.originIdOf("labelsVisible")>w.DEFAULTS&&(i.labelsVisible=this.labelsVisible),this.originIdOf("legendEnabled")>w.DEFAULTS&&(i.legendEnabled=this.legendEnabled),this.originIdOf("visible")>w.DEFAULTS&&(i.visible=this.visible),this.originIdOf("minScale")>w.DEFAULTS&&(i.minScale=this.minScale),this.originIdOf("maxScale")>w.DEFAULTS&&(i.maxScale=this.maxScale),this.originIdOf("opacity")>w.DEFAULTS&&(i.opacity=this.opacity),this.originIdOf("popupTemplate")>w.DEFAULTS&&(i.popupTemplate=a(this.popupTemplate)),this.originIdOf("renderer")>w.SERVICE&&(i.renderer=a(this.renderer)),"data-layer"===this.source?.type&&(i.dynamicDataSource=this.source.clone()),this.originIdOf("title")>w.DEFAULTS&&(i.title=this.title),"map-image"===r?.type&&r.originIdOf("customParameters")>w.DEFAULTS&&(i.customParameters=r.customParameters),"tile"===r?.type&&r.originIdOf("customParameters")>w.DEFAULTS&&(i.customParameters=r.customParameters),i}getField(e){return this.fieldsIndex.get(e)}getFeatureType(e){return E(this.types,this.typeIdField,e)}getFieldDomain(e,r){const t=r?.feature,i=this.getFeatureType(t);if(i){const r=i.domains&&i.domains[e];if(r&&"inherited"!==r.type)return r}return this._getLayerDomain(e)}async queryAttachments(e,r){await this.load(),e=$.from(e);const t=this.capabilities;if(!t?.data?.supportsAttachment)throw new o("queryAttachments:not-supported","this layer doesn't support attachments");const{attachmentTypes:i,objectIds:s,globalIds:a,num:l,size:n,start:p,where:u}=e;if(!t?.operations?.supportsQueryAttachments){if(i?.length>0||a?.length>0||n?.length>0||l||p||u)throw new o("queryAttachments:option-not-supported","when 'capabilities.operations.supportsQueryAttachments' is false, only objectIds is supported",e)}if(!(s?.length||a?.length||u))throw new o("queryAttachments:invalid-query","'objectIds', 'globalIds', or 'where' are required to perform attachment query",e);return!t?.attachment?.supportsOrderByFields&&e.orderByFields?.length&&((e=e.clone()).orderByFields=null),this.queryTask.executeAttachmentQuery(e,r)}async queryFeatureCount(e=this.createQuery(),r){if(await this.load(),!this.capabilities.operations.supportsQuery)throw new o("queryFeatureCount:not-supported","this layer doesn't support queries.");if(!this.url)throw new o("queryFeatureCount:not-supported","this layer has no url.");const t=this.layer?.apiKey;return await this.queryTask.executeForCount(e,{...r,query:{...this.layer?.customParameters,token:t}})}async queryFeatures(e=this.createQuery(),r){if(await this.load(),!this.capabilities.operations.supportsQuery)throw new o("queryFeatures:not-supported","this layer doesn't support queries.");if(!this.url)throw new o("queryFeatures:not-supported","this layer has no url.");const t=await this.queryTask.execute(e,{...r,query:{...this.layer?.customParameters,token:this.layer?.apiKey}});if(t?.features)for(const i of t.features)i.sourceLayer=this;return t}async queryObjectIds(e=this.createQuery(),r){if(await this.load(),!this.capabilities.operations.supportsQuery)throw new o("queryObjectIds:not-supported","this layer doesn't support queries.");if(!this.url)throw new o("queryObjectIds:not-supported","this layer has no url.");const t=this.layer?.apiKey;return await this.queryTask.executeForIds(e,{...r,query:{...this.layer?.customParameters,token:t}})}async queryRelatedFeatures(e,r){if(await this.load(),!this.capabilities.operations.supportsQuery)throw new o("queryRelatedFeatures:not-supported","this layer doesn't support queries.");if(!this.url)throw new o("queryRelatedFeatures:not-supported","this layer has no url.");const t=this.layer?.apiKey;return await this.queryTask.executeRelationshipQuery(e,{...r,query:{...this.layer?.customParameters,token:t}})}async queryRelatedFeaturesCount(e,r){if(await this.load(),!this.capabilities.operations.supportsQuery)throw new o("queryRelatedFeaturesCount:not-supported","this layer doesn't support queries.");if(!this.capabilities.queryRelated.supportsCount)throw new o("queryRelatedFeaturesCount:not-supported","this layer doesn't support query related counts.");if(!this.url)throw new o("queryRelatedFeaturesCount:not-supported","this layer has no url.");const t=this.layer?.apiKey;return await this.queryTask.executeRelationshipQueryForCount(e,{...r,query:{...this.layer?.customParameters,token:t}})}toExportImageJSON(e){const r={id:this.id,source:this.source?.toJSON()||{mapLayerId:this.id,type:"mapLayer"}},t=u(e,this.definitionExpression);null!=t&&(r.definitionExpression=t);const i=["renderer","labelingInfo","opacity","labelsVisible"].reduce(((e,r)=>(e[r]=this.originIdOf(r),e)),{}),o=Object.keys(i).some((e=>i[e]>w.SERVICE));if(o){const e=r.drawingInfo={};if(i.renderer>w.SERVICE&&(e.renderer=this.renderer?this.renderer.toJSON():null),i.labelsVisible>w.SERVICE&&(e.showLabels=this.labelsVisible),this.labelsVisible&&i.labelingInfo>w.SERVICE)if(this.labelingInfo){!this.loaded&&this.labelingInfo?.some((e=>!e.labelPlacement))&&n.getLogger(this).warnOnce(`A Sublayer (title: ${this.title}, id: ${this.id}) has an undefined 'labelPlacement' and so labels cannot be displayed. Either define a valid 'labelPlacement' or call Sublayer.load() to use a default value based on geometry type.`,{sublayer:this});let r=this.labelingInfo;null!=this.geometryType&&(r=R(this.labelingInfo,O.toJSON(this.geometryType))),e.showLabels=!0,e.labelingInfo=r.filter((e=>e.labelPlacement)).map((e=>e.toJSON({origin:"service",layer:this.layer})))}else e.showLabels=!1;i.opacity>w.SERVICE&&(e.transparency=100-100*this.opacity),this._assignDefaultSymbolColors(e.renderer)}return(this.layer?.capabilities?.exportMap?.supportsSublayerOrderBy??!1)&&this.originIdOf("orderBy")>w.SERVICE&&(r.orderBy=this.orderBy?.map((e=>e.toJSON()))??null),r}_assignDefaultSymbolColors(e){this._forEachSimpleMarkerSymbols(e,(e=>{e.color||"esriSMSX"!==e.style&&"esriSMSCross"!==e.style||(e.outline?.color?e.color=e.outline.color:e.color=[0,0,0,0])}))}_forEachSimpleMarkerSymbols(e,r){if(e){const t=("uniqueValueInfos"in e?e.uniqueValueInfos:"classBreakInfos"in e?e.classBreakInfos:null)??[];for(const e of t)W(e.symbol)&&r(e.symbol);"symbol"in e&&W(e.symbol)&&r(e.symbol),"defaultSymbol"in e&&W(e.defaultSymbol)&&r(e.defaultSymbol)}}_setAndNotifyLayer(e,r){const t=this.layer,i=this._get(e);let o,s;switch(e){case"definitionExpression":case"floorInfo":o="supportsSublayerDefinitionExpression";break;case"minScale":case"maxScale":case"visible":o="supportsSublayerVisibility";break;case"labelingInfo":case"labelsVisible":case"opacity":case"renderer":case"source":o="supportsDynamicLayers",s="supportsModification";break;case"orderBy":o="supportsSublayerOrderBy",s="supportsModification"}const a=j(this).getDefaultOrigin();if("service"!==a){if(o&&!1===this.layer?.capabilities?.exportMap?.[o])return void this._logLockedError(e,`capability not available 'layer.capabilities.exportMap.${o}'`);if(s&&!1===this.capabilities?.exportMap[s])return void this._logLockedError(e,`capability not available 'capabilities.exportMap.${s}'`)}"source"!==e||"not-loaded"===this.loadStatus?(this._set(e,r),"service"!==a&&i!==r&&t&&t.emit&&t.emit("sublayer-update",{propertyName:e,target:this})):this._logLockedError(e,"'source' can't be changed after calling sublayer.load()")}_handleSublayersChange(e,r){r&&(r.forEach((e=>{e.parent=null,e.layer=null})),this.removeAllHandles()),e&&(e.forEach((e=>{e.parent=this,e.layer=this.layer})),this.addHandles([e.on("after-add",(({item:e})=>{e.parent=this,e.layer=this.layer})),e.on("after-remove",(({item:e})=>{e.parent=null,e.layer=null})),e.on("before-changes",(e=>{(this.layer?.capabilities?.exportMap?.supportsSublayersChanges??1)||(n.getLogger(this).error(new o("sublayer:sublayers-non-modifiable","Sublayer can't be added, moved, or removed from the layer's sublayers",{sublayer:this,layer:this.layer})),e.preventDefault())}))]))}_logLockedError(e,r){const{layer:t,declaredClass:i}=this;n.getLogger(i).error(new o("sublayer:locked",`Property '${String(e)}' can't be changed on Sublayer from the layer '${t?.id}'`,{reason:r,sublayer:this,layer:t}))}_getLayerDomain(e){return this.fieldsIndex.get(e)?.domain??null}static{this.test={isMapImageLayerOverridePolicy:e=>e===ee||e===Z||e===X,isTileImageLayerOverridePolicy:e=>e===Y}}};e([d({readOnly:!0})],oe.prototype,"capabilities",void 0),e([f("service","capabilities",["layerDefinition.canModifyLayer","layerDefinition.capabilities"])],oe.prototype,"readCapabilities",null),e([d()],oe.prototype,"defaultPopupTemplate",null),e([d({type:String,value:null,json:{name:"layerDefinition.definitionExpression",write:{allowNull:!0,overridePolicy:X}}})],oe.prototype,"definitionExpression",null),e([d({readOnly:!0})],oe.prototype,"effectiveScaleRange",null),e([f("service","maxScaleRange",["minScale","maxScale"])],oe.prototype,"readMaxScaleRange",null),e([d({type:[q],json:{origins:{service:{read:{source:"layerDefinition.fields"}}}}})],oe.prototype,"fields",void 0),e([d({readOnly:!0})],oe.prototype,"fieldsIndex",null),e([d({type:C,value:null,json:{name:"layerDefinition.floorInfo",read:{source:"layerDefinition.floorInfo"},write:{target:"layerDefinition.floorInfo",overridePolicy:X},origins:{"web-scene":{read:!1,write:!1}}}})],oe.prototype,"floorInfo",null),e([d({type:F,json:{read:{source:"layerDefinition.extent"}}})],oe.prototype,"fullExtent",void 0),e([d({type:O.apiValues,json:{origins:{service:{name:"layerDefinition.geometryType",read:{reader:O.read}}}}})],oe.prototype,"geometryType",void 0),e([d({type:String})],oe.prototype,"globalIdField",void 0),e([f("service","globalIdField",["layerDefinition.globalIdField","layerDefinition.fields"])],oe.prototype,"readGlobalIdFieldFromService",null),e([d({type:S,json:{write:{ignoreOrigin:!0}}})],oe.prototype,"id",null),e([d({readOnly:!0})],oe.prototype,"isTable",void 0),e([f("service","isTable",["type"])],oe.prototype,"readIsTable",null),e([d({value:null,type:[A],json:{read:{source:"layerDefinition.drawingInfo.labelingInfo"},write:{target:"layerDefinition.drawingInfo.labelingInfo",overridePolicy:ee}}})],oe.prototype,"labelingInfo",null),e([m("labelingInfo")],oe.prototype,"writeLabelingInfo",null),e([d({type:Boolean,value:!0,json:{read:{source:"layerDefinition.drawingInfo.showLabels"},write:{target:"layerDefinition.drawingInfo.showLabels",overridePolicy:Z}}})],oe.prototype,"labelsVisible",null),e([d({value:null})],oe.prototype,"layer",null),e([d({type:String,json:{write:{overridePolicy:Y}}})],oe.prototype,"layerItemId",void 0),e([d({type:Boolean,value:!0,json:{origins:{service:{read:{enabled:!1}}},read:{source:"showLegend"},write:{target:"showLegend",overridePolicy:re}}})],oe.prototype,"legendEnabled",void 0),e([d({type:["show","hide","hide-children"],value:"show",json:{read:!1,write:!1,origins:{"web-scene":{read:!0,write:!0}}}})],oe.prototype,"listMode",null),e([d({type:Number,value:0,json:{write:{overridePolicy:Z}}})],oe.prototype,"minScale",null),e([f("minScale",["minScale","layerDefinition.minScale"])],oe.prototype,"readMinScale",null),e([d({type:Number,value:0,json:{write:{overridePolicy:Z}}})],oe.prototype,"maxScale",null),e([f("maxScale",["maxScale","layerDefinition.maxScale"])],oe.prototype,"readMaxScale",null),e([d()],oe.prototype,"objectIdField",void 0),e([f("service","objectIdField",["layerDefinition.objectIdField","layerDefinition.fields"])],oe.prototype,"readObjectIdFieldFromService",null),e([d({type:Number,value:1,json:{write:{target:"layerDefinition.drawingInfo.transparency",overridePolicy:Z}}})],oe.prototype,"opacity",null),e([f("opacity",["layerDefinition.drawingInfo.transparency","layerDefinition.transparency"])],oe.prototype,"readOpacity",null),e([m("opacity")],oe.prototype,"writeOpacity",null),e([d({value:null,type:[M],json:{name:"layerDefinition.orderBy",read:{reader:x}}})],oe.prototype,"orderBy",null),e([d({json:{type:S,write:{target:"parentLayerId",writerEnsuresNonNull:!0,overridePolicy:Z}}})],oe.prototype,"parent",void 0),e([m("parent")],oe.prototype,"writeParent",null),e([d({type:Boolean,value:!0,json:{read:{source:"disablePopup",reader:(e,r)=>!r.disablePopup},write:{target:"disablePopup",overridePolicy:re,writer(e,r,t){r[t]=!e}}}})],oe.prototype,"popupEnabled",void 0),e([d({type:r,json:{read:{source:"popupInfo"},write:{target:"popupInfo",overridePolicy:re}}})],oe.prototype,"popupTemplate",void 0),e([d({readOnly:!0})],oe.prototype,"queryTask",null),e([d({type:[V],readOnly:!0,json:{origins:{service:{read:{source:"layerDefinition.relationships"}}}}})],oe.prototype,"relationships",void 0),e([d({types:U,value:null,json:{name:"layerDefinition.drawingInfo.renderer",write:{overridePolicy:ee},origins:{"web-scene":{types:Q,name:"layerDefinition.drawingInfo.renderer",write:{overridePolicy:ee}}}}})],oe.prototype,"renderer",null),e([d({types:{key:"type",base:null,typeMap:{"data-layer":k,"map-layer":B}},cast(e){if(e){if("mapLayerId"in e)return I(B,e);if("dataSource"in e)return I(k,e)}return e},json:{name:"layerDefinition.source",write:{overridePolicy:Z}}})],oe.prototype,"source",null),e([d()],oe.prototype,"sourceJSON",void 0),e([d({type:L,json:{origins:{service:{read:{source:"layerDefinition.extent.spatialReference"}}}}})],oe.prototype,"spatialReference",void 0),e([d({value:null,json:{type:[S],write:{target:"subLayerIds",allowNull:!0,overridePolicy:Z}}})],oe.prototype,"sublayers",null),e([c("sublayers")],oe.prototype,"castSublayers",null),e([m("sublayers")],oe.prototype,"writeSublayers",null),e([d({type:String,json:{name:"name",write:{overridePolicy:re}}})],oe.prototype,"title",void 0),e([f("service","title",["name","layerDefinition.name"])],oe.prototype,"readTitle",null),e([d({type:String})],oe.prototype,"typeIdField",void 0),e([d({json:{read:!1},readOnly:!0,value:"sublayer"})],oe.prototype,"type",void 0),e([f("typeIdField",["layerDefinition.typeIdField"])],oe.prototype,"readTypeIdField",null),e([d({type:[P],json:{origins:{service:{read:{source:"layerDefinition.types"}}}}})],oe.prototype,"types",void 0),e([d({type:String,json:{name:"layerUrl",write:{overridePolicy:Y}}})],oe.prototype,"url",null),e([d({type:Boolean,value:!0,json:{read:{source:"defaultVisibility"},write:{target:"defaultVisibility",overridePolicy:Z}}})],oe.prototype,"visible",null),e([m("visible")],oe.prototype,"writeVisible",null),oe=H=e([h("esri.layers.support.Sublayer")],oe);const se=oe;export{se 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.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../../chunks/tslib.es6.js";import{JSONMap as t}from"../../core/jsonMap.js";import o from"../../core/JSONSupport.js";import{getMetersPerUnitForSR as s}from"../../core/unitUtils.js";import{property as r}from"../../core/accessorSupport/decorators/property.js";import{Integer as i}from"../../core/accessorSupport/ensureType.js";import"../../core/has.js";import"../../core/RandomLCG.js";import{reader as l}from"../../core/accessorSupport/decorators/reader.js";import{subclass as n}from"../../core/accessorSupport/decorators/subclass.js";import{writer as p}from"../../core/accessorSupport/decorators/writer.js";import a from"../../geometry/Point.js";import c from"../../geometry/SpatialReference.js";import{create as u}from"../../geometry/support/aaBoundingRect.js";import{isValid as f,getInfo as h,isGeographic as m,equals as d}from"../../geometry/support/spatialReferenceUtils.js";import{project as g}from"../../geometry/support/webMercatorUtils.js";import y from"./LOD.js";import{TileKey as v}from"./TileKey.js";var w;const x=new t({PNG:"png",PNG8:"png8",PNG24:"png24",PNG32:"png32",JPEG:"jpg",JPG:"jpg",DIB:"dib",TIFF:"tiff",EMF:"emf",PS:"ps",PDF:"pdf",GIF:"gif",SVG:"svg",SVGZ:"svgz",Mixed:"mixed",MIXED:"mixed",LERC:"lerc",LERC2D:"lerc2d",RAW:"raw",pbf:"pbf"});let j=
|
|
5
|
+
import{_ as e}from"../../chunks/tslib.es6.js";import{JSONMap as t}from"../../core/jsonMap.js";import o from"../../core/JSONSupport.js";import{getMetersPerUnitForSR as s}from"../../core/unitUtils.js";import{property as r}from"../../core/accessorSupport/decorators/property.js";import{Integer as i}from"../../core/accessorSupport/ensureType.js";import"../../core/has.js";import"../../core/RandomLCG.js";import{reader as l}from"../../core/accessorSupport/decorators/reader.js";import{subclass as n}from"../../core/accessorSupport/decorators/subclass.js";import{writer as p}from"../../core/accessorSupport/decorators/writer.js";import a from"../../geometry/Point.js";import c from"../../geometry/SpatialReference.js";import{create as u}from"../../geometry/support/aaBoundingRect.js";import{isValid as f,getInfo as h,isGeographic as m,equals as d}from"../../geometry/support/spatialReferenceUtils.js";import{project as g}from"../../geometry/support/webMercatorUtils.js";import y from"./LOD.js";import{TileKey as v}from"./TileKey.js";var w;const x=new t({PNG:"png",PNG8:"png8",PNG24:"png24",PNG32:"png32",JPEG:"jpg",JPG:"jpg",DIB:"dib",TIFF:"tiff",EMF:"emf",PS:"ps",PDF:"pdf",GIF:"gif",SVG:"svg",SVGZ:"svgz",Mixed:"mixed",MIXED:"mixed",LERC:"lerc",LERC2D:"lerc2d",RAW:"raw",pbf:"pbf"});let j=class extends o{static{w=this}static create(e={}){const{resolutionFactor:t=1,scales:o,size:r=256,spatialReference:i=c.WebMercator,numLODs:l=24}=e;if(!f(i)){const e=[];if(o)for(let t=0;t<o.length;t++){const s=o[t];e.push(new y({level:t,scale:s,resolution:s}))}else{let t=5e-4;for(let o=l-1;o>=0;o--)e.unshift(new y({level:o,scale:t,resolution:t})),t*=2}return new w({dpi:96,lods:e,origin:new a(0,0,i),size:[r,r],spatialReference:i})}const n=h(i),p=e.origin?new a({x:e.origin.x,y:e.origin.y,spatialReference:i}):new a(n?{x:n.origin[0],y:n.origin[1],spatialReference:i}:{x:0,y:0,spatialReference:i}),u=96,d=1/(s(i)*39.37*u),g=[];if(o)for(let s=0;s<o.length;s++){const e=o[s],t=e*d;g.push(new y({level:s,scale:e,resolution:t}))}else{let e=m(i)?512/r*591657527.5917094:256/r*591657527.591555;const o=Math.ceil(l/t);g.push(new y({level:0,scale:e,resolution:e*d}));for(let s=1;s<o;s++){const o=e/2**t,r=o*d;g.push(new y({level:s,scale:o,resolution:r})),e=o}}return new w({dpi:u,lods:g,origin:p,size:[r,r],spatialReference:i})}constructor(e){super(e),this.dpi=96,this.format=null,this.origin=null,this.size=null,this.spatialReference=null}get isWrappable(){const{spatialReference:e,origin:t}=this;if(e&&t){const o=h(e);return e.isWrappable&&!!o&&Math.abs(o.origin[0]-t.x)<=o.dx}return!1}readOrigin(e,t){return a.fromJSON({spatialReference:t.spatialReference,...e})}set lods(e){let t=0,o=0;const s=[],r=this._levelToLOD={};e&&(t=-1/0,o=1/0,e.forEach((e=>{s.push(e.scale),t=e.scale>t?e.scale:t,o=e.scale<o?e.scale:o,r[e.level]=e}))),this._set("scales",s),this._set("lods",e),this._initializeUpsampleLevels()}readSize(e,t){return[t.cols,t.rows]}writeSize(e,t){t.cols=e[0],t.rows=e[1]}zoomToScale(e){const t=this.scales;if(e<=0)return t[0];if(e>=t.length-1)return t[t.length-1];const o=Math.floor(e),s=o+1;return t[o]/(t[o]/t[s])**(e-o)}scaleToZoom(e){const t=this.scales,o=t.length-1;let s=0;for(;s<o;s++){const o=t[s],r=t[s+1];if(o<=e)return s;if(r===e)return s+1;if(o>e&&r<e)return s+Math.log(o/e)/Math.log(o/r)}return s}tileAt(e,t,o,s){const r=this.lodAt(e);if(!r)return null;let i,l;if("number"==typeof t)i=t,l=o;else if(d(t.spatialReference,this.spatialReference))i=t.x,l=t.y,s=o;else{const e=g(t,this.spatialReference);if(null==e)return null;i=e.x,l=e.y,s=o}const n=r.resolution*this.size[0],p=r.resolution*this.size[1];return s||(s=new v(null,0,0,0,u())),s.level=e,s.row=Math.floor((this.origin.y-l)/p+.001),s.col=Math.floor((i-this.origin.x)/n+.001),this.updateTileInfo(s),s}updateTileInfo(e,t=w.ExtrapolateOptions.NONE){let o=this.lodAt(e.level);if(!o&&t===w.ExtrapolateOptions.POWER_OF_TWO){const t=this.lods[this.lods.length-1];t.level<e.level&&(o=t)}if(!o)return;const s=e.level-o.level,r=o.resolution*this.size[0]/2**s,i=o.resolution*this.size[1]/2**s;e.id=`${e.level}/${e.row}/${e.col}`,e.extent||(e.extent=u()),e.extent[0]=this.origin.x+e.col*r,e.extent[1]=this.origin.y-(e.row+1)*i,e.extent[2]=e.extent[0]+r,e.extent[3]=e.extent[1]+i}upsampleTile(e){const t=this._upsampleLevels[e.level];return!(!t||-1===t.parentLevel)&&(e.level=t.parentLevel,e.row=Math.floor(e.row/t.factor+.001),e.col=Math.floor(e.col/t.factor+.001),this.updateTileInfo(e),!0)}getTileBounds(e,t){const o=this.lodAt(t.level);if(null==o)return null;const{resolution:s}=o,r=s*this.size[0],i=s*this.size[1];return e[0]=this.origin.x+t.col*r,e[1]=this.origin.y-(t.row+1)*i,e[2]=e[0]+r,e[3]=e[1]+i,e}lodAt(e){return this._levelToLOD?.[e]??null}clone(){return w.fromJSON(this.write({}))}getCompatibleForVTL(e){if(this.size[0]!==this.size[1]||256===this.size[0]&&512===e)return null;const t=(512===this.size[0]&&256===e?-1:0)+(this.spatialReference.isGeographic?1:0);if(this.size[0]===e&&0===t)return this;const o=[],s=this.lods.length-t;for(let r=0;r<s;r++){const e=r+t,{scale:s,resolution:i}=e>=0?this.lods[e]:{scale:2*this.lods[0].scale,resolution:2*this.lods[0].resolution};o.push(new y({level:r,scale:s,resolution:i}))}return new w({size:[e,e],dpi:this.dpi,format:this.format,compressionQuality:this.compressionQuality,origin:this.origin,spatialReference:this.spatialReference,lods:o})}_initializeUpsampleLevels(){const e=this.lods;this._upsampleLevels=[];let t=null;for(let o=0;o<e.length;o++){const s=e[o];this._upsampleLevels[s.level]={parentLevel:t?t.level:-1,factor:t?t.resolution/s.resolution:0},t=s}}};e([r({type:Number,json:{write:!0}})],j.prototype,"compressionQuality",void 0),e([r({type:Number,json:{write:!0}})],j.prototype,"dpi",void 0),e([r({type:String,json:{read:x.read,write:x.write,origins:{"web-scene":{read:!1,write:!1}}}})],j.prototype,"format",void 0),e([r({readOnly:!0})],j.prototype,"isWrappable",null),e([r({type:a,json:{write:!0}})],j.prototype,"origin",void 0),e([l("origin")],j.prototype,"readOrigin",null),e([r({type:[y],value:null,json:{write:!0}})],j.prototype,"lods",null),e([r({readOnly:!0})],j.prototype,"scales",void 0),e([r({cast:e=>Array.isArray(e)?e:"number"==typeof e?[e,e]:[256,256]})],j.prototype,"size",void 0),e([l("size",["rows","cols"])],j.prototype,"readSize",null),e([p("size",{cols:{type:i},rows:{type:i}})],j.prototype,"writeSize",null),e([r({type:c,json:{write:!0}})],j.prototype,"spatialReference",void 0),j=w=e([n("esri.layers.support.TileInfo")],j),function(e){var t;(t=e.ExtrapolateOptions||(e.ExtrapolateOptions={}))[t.NONE=0]="NONE",t[t.POWER_OF_TWO=1]="POWER_OF_TWO"}(j||(j={}));const z=j;export{z 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.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../../chunks/tslib.es6.js";import t from"../../request.js";import i from"../../core/Accessor.js";import{ByteSizeUnit as r}from"../../core/ByteSizeUnit.js";import s from"../../core/Error.js";import{makeHandle as l}from"../../core/handleUtils.js";import"../../core/has.js";import{LRUCache as o}from"../../core/LRUCache.js";import a from"../../core/PooledArray.js";import{isAbortError as n,isAborted as c,onAbort as h,createAbortError as p}from"../../core/promiseUtils.js";import{watch as m,initial as f}from"../../core/reactiveUtils.js";import{waitTicks as u}from"../../core/scheduling.js";import{objectToQuery as v}from"../../core/urlUtils.js";import{property as y}from"../../core/accessorSupport/decorators/property.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{subclass as d}from"../../core/accessorSupport/decorators/subclass.js";import{TileKey as _}from"./TileKey.js";import{Tilemap as b,tilemapDefinitionId as g}from"./Tilemap.js";var j;function w(e,t,i){return new s("tile-map:tile-unavailable","Tile is not available",{level:e,row:t,col:i})}let T=
|
|
5
|
+
import{_ as e}from"../../chunks/tslib.es6.js";import t from"../../request.js";import i from"../../core/Accessor.js";import{ByteSizeUnit as r}from"../../core/ByteSizeUnit.js";import s from"../../core/Error.js";import{makeHandle as l}from"../../core/handleUtils.js";import"../../core/has.js";import{LRUCache as o}from"../../core/LRUCache.js";import a from"../../core/PooledArray.js";import{isAbortError as n,isAborted as c,onAbort as h,createAbortError as p}from"../../core/promiseUtils.js";import{watch as m,initial as f}from"../../core/reactiveUtils.js";import{waitTicks as u}from"../../core/scheduling.js";import{objectToQuery as v}from"../../core/urlUtils.js";import{property as y}from"../../core/accessorSupport/decorators/property.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{subclass as d}from"../../core/accessorSupport/decorators/subclass.js";import{TileKey as _}from"./TileKey.js";import{Tilemap as b,tilemapDefinitionId as g}from"./Tilemap.js";var j;function w(e,t,i){return new s("tile-map:tile-unavailable","Tile is not available",{level:e,row:t,col:i})}let T=class extends i{static{j=this}constructor(e){super(e),this._pendingTilemapRequests={},this.request=t,this.size=32,this._prefetchingEnabled=!0}initialize(){this._tilemapCache=new o(2*r.MEGABYTES),this.addHandles(m((()=>{const{layer:e}=this;return[e?.parsedUrl,e?.tileServers,e?.apiKey,e?.customParameters]}),(()=>this._initializeTilemapDefinition()),f))}get effectiveMinLOD(){return this.minLOD??this.layer.tileInfo.lods[0].level}get effectiveMaxLOD(){return this.maxLOD??this.layer.tileInfo.lods[this.layer.tileInfo.lods.length-1].level}getAvailability(e,t,i){if(!this.layer.tileInfo.lodAt(e)||e<this.effectiveMinLOD||e>this.effectiveMaxLOD)return"unavailable";const r=this._tilemapFromCache(e,t,i,this._tmpTilemapDefinition);return r?r.getAvailability(t,i):"unknown"}fetchAvailability(e,t,i,r){return!this.layer.tileInfo.lodAt(e)||e<this.effectiveMinLOD||e>this.effectiveMaxLOD?Promise.reject(w(e,t,i)):this._fetchTilemap(e,t,i,r).catch((e=>e)).then((r=>{if(r instanceof b){const s=r.getAvailability(t,i);if("unavailable"===s)throw w(e,t,i);return s}if(n(r))throw r;return"unknown"}))}fetchAvailabilityUpsample(e,t,i,r,s){r.level=e,r.row=t,r.col=i;const l=this.layer.tileInfo;l.updateTileInfo(r);const o=this.fetchAvailability(e,t,i,s).catch((e=>{if(n(e))throw e;if(l.upsampleTile(r))return this.fetchAvailabilityUpsample(r.level,r.row,r.col,r,s);throw e}));return this._fetchAvailabilityUpsamplePrefetch(r.id,e,t,i,s,o),o}async _fetchAvailabilityUpsamplePrefetch(e,t,i,r,s,o){if(!this._prefetchingEnabled||null==e)return;const a=`prefetch-${e}`;if(this.hasHandles(a))return;const n=new AbortController;o.then((()=>n.abort()),(()=>n.abort()));let h=!1;const p=l((()=>{h||(h=!0,n.abort())}));if(this.addHandles(p,a),await u(10,n.signal).catch((()=>{})),h||(h=!0,this.removeHandles(a)),c(n))return;const m=new _(e,t,i,r),f={...s,signal:n.signal},v=this.layer.tileInfo;for(let l=0;j._prefetches.length<j._maxPrefetch&&v.upsampleTile(m);++l){const e=this.fetchAvailability(m.level,m.row,m.col,f);j._prefetches.push(e);const t=()=>{j._prefetches.removeUnordered(e)};e.then(t,t)}}static{this._maxPrefetch=4}static{this._prefetches=new a({initialSize:j._maxPrefetch})}_fetchTilemap(e,t,i,r){if(!this.layer.tileInfo.lodAt(e)||e<this.effectiveMinLOD||e>this.effectiveMaxLOD)return Promise.reject(new s("tilemap-cache:level-unavailable",`Level ${e} is unavailable in the service`));const l=this._tmpTilemapDefinition,o=this._tilemapFromCache(e,t,i,l);if(o)return Promise.resolve(o);const a=r?.signal;return r={...r,signal:null},new Promise(((e,t)=>{h(a,(()=>t(p())));const i=g(l);let s=this._pendingTilemapRequests[i];if(!s){s=b.fromDefinition(l,r).then((e=>(this._tilemapCache.put(i,e,e.byteSize),e)));const e=()=>{delete this._pendingTilemapRequests[i]};this._pendingTilemapRequests[i]=s,s.then(e,e)}s.then(e,t)}))}_initializeTilemapDefinition(){if(!this.layer.parsedUrl)return;const{parsedUrl:e,apiKey:t,customParameters:i}=this.layer;this._tilemapCache.clear(),this._tmpTilemapDefinition={service:{url:e.path,query:v({...e.query,...i,token:t??e.query?.token}),tileServers:this.layer.tileServers,request:this.request},width:this.size,height:this.size,level:0,row:0,col:0}}_tilemapFromCache(e,t,i,r){r.level=e,r.row=t-t%this.size,r.col=i-i%this.size;const s=g(r);return this._tilemapCache.get(s)}get test(){}};e([y({constructOnly:!0})],T.prototype,"layer",void 0),e([y({constructOnly:!0})],T.prototype,"minLOD",void 0),e([y({constructOnly:!0})],T.prototype,"maxLOD",void 0),e([y({constructOnly:!0})],T.prototype,"request",void 0),e([y({constructOnly:!0})],T.prototype,"size",void 0),T=j=e([d("esri.layers.support.TilemapCache")],T);export{T as TilemapCache};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../../chunks/tslib.es6.js";import t from"../../request.js";import o from"../../core/Error.js";import{once as r}from"../../core/events.js";import s from"../../core/Logger.js";import{clamp as i}from"../../core/mathUtils.js";import{whenOnce as n}from"../../core/reactiveUtils.js";import{isAbsolute as l,makeAbsolute as a,getProxyRule as c,addProxy as d,isBlobProtocol as p,isDataProtocol as m}from"../../core/urlUtils.js";import{property as u}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/RandomLCG.js";import{subclass as h}from"../../core/accessorSupport/decorators/subclass.js";import{writer as v}from"../../core/accessorSupport/decorators/writer.js";import y from"./MediaElementBase.js";import{mediaElementUrlProperty as g,mediaTypeProperty as f}from"./mediaUtils.js";import{VideoElementSymbol as j}from"../../support/mediaLayerUtils.js";import{i as w}from"../../chunks/persistableUrlUtils.js";var U;let b=class extends y{constructor(e){super(e),this.autoplay=!0,this.content=null,this.controller=null,this.type="video",this[U]=!0}load(){const e=this.video;return"string"==typeof e?this.addResolvingPromise(Promise.all([this._preProcessVideoUrl(e),import("../video/VideoController.js")]).then((async([e,{default:t}])=>{this.controller=new t,this.controller.playerUrl=e,await n((()=>this.controller?.element)),this.controller.loop=!0,this.controller.muted=!0,this.controller.playsInline=!0,this.controller.crossOrigin="anonymous",await n((()=>"can-play"===this.controller?.state)),await this.controller.play(),this.autoplay||this.controller.pause(),this._set("content",this.controller.element)}))):e instanceof HTMLVideoElement?this.addResolvingPromise(this._loadVideo(e).then((()=>{this._set("content",e)}))):this.addResolvingPromise(Promise.reject(new o("video-element:invalid-video-type","Invalid video type",{video:e}))),Promise.resolve(this)}get contentWidth(){return this.content?.videoWidth??0}get contentHeight(){return this.content?.videoHeight??0}get currentTime(){return this.controller?.currentTime}set currentTime(e){if(!this.controller)return;const t=i(e,0,this.controller.duration);this.controller?.setCurrentTime(t)}get duration(){return this.controller?.duration}set video(e){"not-loaded"===this.loadStatus?this._set("video",e):s.getLogger(this).error("#video","video cannot be changed after the element is loaded.")}writeVideo(e,t,r,s){if(!e)return void(s?.messages&&s.messages.push(new o("video-element:unsupported-video","video source is missing")));const i=V(e)?e:null;if(!i)return void(s?.messages&&s.messages.push(new o("video-element:unsupported-video","video source must be an absolute url")));!l(i)&&s?.blockedRelativeUrls&&s.blockedRelativeUrls.push(i);const n=a(i);!w(n)?t[r]=n:s?.messages&&s.messages.push(new o("video-element:unsupported-video","video source cannot be an item resource"))}async _preProcessVideoUrl(e){if(c(e))return d(e);try{return await t(e,{method:"head"}),e}catch{return d(e,!0)}}_loadVideo(e){return new Promise(((t,o)=>{const s=r(e,"canplay",(()=>{this.removeHandles("canplay"),this.autoplay?e.play().then(t,o):t()}));this.addHandles(s,"canplay"),"anonymous"!==e.crossOrigin&&(e.crossOrigin="anonymous",p(e.src)||(e.src=e.src))}))}};
|
|
5
|
+
import{_ as e}from"../../chunks/tslib.es6.js";import t from"../../request.js";import o from"../../core/Error.js";import{once as r}from"../../core/events.js";import s from"../../core/Logger.js";import{clamp as i}from"../../core/mathUtils.js";import{whenOnce as n}from"../../core/reactiveUtils.js";import{isAbsolute as l,makeAbsolute as a,getProxyRule as c,addProxy as d,isBlobProtocol as p,isDataProtocol as m}from"../../core/urlUtils.js";import{property as u}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/RandomLCG.js";import{subclass as h}from"../../core/accessorSupport/decorators/subclass.js";import{writer as v}from"../../core/accessorSupport/decorators/writer.js";import y from"./MediaElementBase.js";import{mediaElementUrlProperty as g,mediaTypeProperty as f}from"./mediaUtils.js";import{VideoElementSymbol as j}from"../../support/mediaLayerUtils.js";import{i as w}from"../../chunks/persistableUrlUtils.js";var U;let b=class extends y{static{U=j}constructor(e){super(e),this.autoplay=!0,this.content=null,this.controller=null,this.type="video",this[U]=!0}load(){const e=this.video;return"string"==typeof e?this.addResolvingPromise(Promise.all([this._preProcessVideoUrl(e),import("../video/VideoController.js")]).then((async([e,{default:t}])=>{this.controller=new t,this.controller.playerUrl=e,await n((()=>this.controller?.element)),this.controller.loop=!0,this.controller.muted=!0,this.controller.playsInline=!0,this.controller.crossOrigin="anonymous",await n((()=>"can-play"===this.controller?.state)),await this.controller.play(),this.autoplay||this.controller.pause(),this._set("content",this.controller.element)}))):e instanceof HTMLVideoElement?this.addResolvingPromise(this._loadVideo(e).then((()=>{this._set("content",e)}))):this.addResolvingPromise(Promise.reject(new o("video-element:invalid-video-type","Invalid video type",{video:e}))),Promise.resolve(this)}get contentWidth(){return this.content?.videoWidth??0}get contentHeight(){return this.content?.videoHeight??0}get currentTime(){return this.controller?.currentTime}set currentTime(e){if(!this.controller)return;const t=i(e,0,this.controller.duration);this.controller?.setCurrentTime(t)}get duration(){return this.controller?.duration}set video(e){"not-loaded"===this.loadStatus?this._set("video",e):s.getLogger(this).error("#video","video cannot be changed after the element is loaded.")}writeVideo(e,t,r,s){if(!e)return void(s?.messages&&s.messages.push(new o("video-element:unsupported-video","video source is missing")));const i=V(e)?e:null;if(!i)return void(s?.messages&&s.messages.push(new o("video-element:unsupported-video","video source must be an absolute url")));!l(i)&&s?.blockedRelativeUrls&&s.blockedRelativeUrls.push(i);const n=a(i);!w(n)?t[r]=n:s?.messages&&s.messages.push(new o("video-element:unsupported-video","video source cannot be an item resource"))}async _preProcessVideoUrl(e){if(c(e))return d(e);try{return await t(e,{method:"head"}),e}catch{return d(e,!0)}}_loadVideo(e){return new Promise(((t,o)=>{const s=r(e,"canplay",(()=>{this.removeHandles("canplay"),this.autoplay?e.play().then(t,o):t()}));this.addHandles(s,"canplay"),"anonymous"!==e.crossOrigin&&(e.crossOrigin="anonymous",p(e.src)||(e.src=e.src))}))}};e([u()],b.prototype,"autoplay",void 0),e([u({readOnly:!0})],b.prototype,"content",void 0),e([u({readOnly:!0})],b.prototype,"contentWidth",null),e([u({readOnly:!0})],b.prototype,"contentHeight",null),e([u()],b.prototype,"controller",void 0),e([u({type:Number})],b.prototype,"currentTime",null),e([u({type:Number})],b.prototype,"duration",null),e([u(g)],b.prototype,"video",null),e([v("video")],b.prototype,"writeVideo",null),e([u(f)],b.prototype,"type",void 0),b=e([h("esri.layers.support.VideoElement")],b);const P=b;function V(e){return"string"==typeof e&&!m(e)&&!p(e)}export{P as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../../../chunks/tslib.es6.js";import{strict as r}from"../../../core/jsonMap.js";import o from"../../../core/JSONSupport.js";import{property as t}from"../../../core/accessorSupport/decorators/property.js";import{cast as a}from"../../../core/accessorSupport/decorators/cast.js";import{enumeration as s}from"../../../core/accessorSupport/decorators/enumeration.js";import{reader as p}from"../../../core/accessorSupport/decorators/reader.js";import{subclass as i}from"../../../core/accessorSupport/decorators/subclass.js";import{ensureType as l,ensureOneOfType as c}from"../../../core/accessorSupport/ensureType.js";import{createTypeReader as u}from"../../../core/accessorSupport/extensions/serializableProperty/reader.js";import n from"../Field.js";import{MapLayerSource as y}from"./MapLayerSource.js";import{QueryTableDataSource as b}from"./QueryTableDataSource.js";import{RasterDataSource as S}from"./RasterDataSource.js";import{TableDataSource as d}from"./TableDataSource.js";var f,j;const m=r()({esriLeftInnerJoin:"left-inner-join",esriLeftOuterJoin:"left-outer-join"});let T=f=class extends o{constructor(e){super(e),this.type="join-table"}readLeftTableSource(e,r,o){return g()(e,r,o)}castLeftTableSource(e){return c(w(),e)}readRightTableSource(e,r,o){return g()(e,r,o)}castRightTableSource(e){return c(w(),e)}clone(){const{leftTableKey:e,rightTableKey:r,leftTableSource:o,rightTableSource:t,joinType:a}=this,s={leftTableKey:e,rightTableKey:r,leftTableSource:o?.clone()??void 0,rightTableSource:t?.clone()??void 0,joinType:a};return new f(s)}};e([s({joinTable:"join-table"}),t({json:{write:{isRequired:!0}}})],T.prototype,"type",void 0),e([t({type:String,json:{write:!0}})],T.prototype,"leftTableKey",void 0),e([t({type:String,json:{write:!0}})],T.prototype,"rightTableKey",void 0),e([t({json:{write:!0}})],T.prototype,"leftTableSource",void 0),e([p("leftTableSource")],T.prototype,"readLeftTableSource",null),e([a("leftTableSource")],T.prototype,"castLeftTableSource",null),e([t({json:{write:!0}})],T.prototype,"rightTableSource",void 0),e([p("rightTableSource")],T.prototype,"readRightTableSource",null),e([a("rightTableSource")],T.prototype,"castRightTableSource",null),e([s(m)],T.prototype,"joinType",void 0),T=f=e([i("esri.layers.support.source.JoinTableDataSource")],T);let h=null;function g(){return h||(h=u({types:w()})),h}let v=null;function w(){return v||(v={key:"type",base:null,typeMap:{"data-layer":R,"map-layer":y}}),v}const L={key:"type",base:null,typeMap:{"join-table":T,"query-table":b,raster:S,table:d}};let R=
|
|
5
|
+
import{_ as e}from"../../../chunks/tslib.es6.js";import{strict as r}from"../../../core/jsonMap.js";import o from"../../../core/JSONSupport.js";import{property as t}from"../../../core/accessorSupport/decorators/property.js";import{cast as a}from"../../../core/accessorSupport/decorators/cast.js";import{enumeration as s}from"../../../core/accessorSupport/decorators/enumeration.js";import{reader as p}from"../../../core/accessorSupport/decorators/reader.js";import{subclass as i}from"../../../core/accessorSupport/decorators/subclass.js";import{ensureType as l,ensureOneOfType as c}from"../../../core/accessorSupport/ensureType.js";import{createTypeReader as u}from"../../../core/accessorSupport/extensions/serializableProperty/reader.js";import n from"../Field.js";import{MapLayerSource as y}from"./MapLayerSource.js";import{QueryTableDataSource as b}from"./QueryTableDataSource.js";import{RasterDataSource as S}from"./RasterDataSource.js";import{TableDataSource as d}from"./TableDataSource.js";var f,j;const m=r()({esriLeftInnerJoin:"left-inner-join",esriLeftOuterJoin:"left-outer-join"});let T=f=class extends o{constructor(e){super(e),this.type="join-table"}readLeftTableSource(e,r,o){return g()(e,r,o)}castLeftTableSource(e){return c(w(),e)}readRightTableSource(e,r,o){return g()(e,r,o)}castRightTableSource(e){return c(w(),e)}clone(){const{leftTableKey:e,rightTableKey:r,leftTableSource:o,rightTableSource:t,joinType:a}=this,s={leftTableKey:e,rightTableKey:r,leftTableSource:o?.clone()??void 0,rightTableSource:t?.clone()??void 0,joinType:a};return new f(s)}};e([s({joinTable:"join-table"}),t({json:{write:{isRequired:!0}}})],T.prototype,"type",void 0),e([t({type:String,json:{write:!0}})],T.prototype,"leftTableKey",void 0),e([t({type:String,json:{write:!0}})],T.prototype,"rightTableKey",void 0),e([t({json:{write:!0}})],T.prototype,"leftTableSource",void 0),e([p("leftTableSource")],T.prototype,"readLeftTableSource",null),e([a("leftTableSource")],T.prototype,"castLeftTableSource",null),e([t({json:{write:!0}})],T.prototype,"rightTableSource",void 0),e([p("rightTableSource")],T.prototype,"readRightTableSource",null),e([a("rightTableSource")],T.prototype,"castRightTableSource",null),e([s(m)],T.prototype,"joinType",void 0),T=f=e([i("esri.layers.support.source.JoinTableDataSource")],T);let h=null;function g(){return h||(h=u({types:w()})),h}let v=null;function w(){return v||(v={key:"type",base:null,typeMap:{"data-layer":R,"map-layer":y}}),v}const L={key:"type",base:null,typeMap:{"join-table":T,"query-table":b,raster:S,table:d}};let R=class extends o{static{j=this}constructor(e){super(e),this.type="data-layer"}clone(){const{fields:e,dataSource:r}=this;return new j({fields:e,dataSource:r})}};e([s({dataLayer:"data-layer"}),t({json:{write:{isRequired:!0}}})],R.prototype,"type",void 0),e([t({type:[n],json:{write:!0}})],R.prototype,"fields",void 0),e([t({types:L,json:{write:!0}})],R.prototype,"dataSource",void 0),R=j=e([i("esri.layers.support.source.DataLayerSource")],R),R.from=l(R);export{R as DataLayerSource,T as JoinTableDataSource};
|
package/package.json
CHANGED
package/portal/Portal.js
CHANGED
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../chunks/tslib.es6.js";import t from"../config.js";import{id as r}from"../kernel.js";import o from"../request.js";import s from"../core/Error.js";import a from"../core/JSONSupport.js";import i from"../core/Loadable.js";import{destroyMaybe as l,removeMaybe as u}from"../core/maybe.js";import{throwIfAborted as n,isAborted as p,createAbortError as h,throwIfAbortError as d}from"../core/promiseUtils.js";import{property as y}from"../core/accessorSupport/decorators/property.js";import{ensureType as c}from"../core/accessorSupport/ensureType.js";import"../core/has.js";import"../core/RandomLCG.js";import{reader as m}from"../core/accessorSupport/decorators/reader.js";import{subclass as f}from"../core/accessorSupport/decorators/subclass.js";import v from"../geometry/Extent.js";import{getLocale as S}from"../intl/locale.js";import{ensureDefaultPortalInstance as P}from"./portalDefault.js";import g from"./PortalGroup.js";import O from"./PortalQueryParams.js";import B from"./PortalQueryResult.js";import D from"./PortalUser.js";import{isApiKeyApplicable as G}from"../support/apiKeyUtils.js";var _;let M;const Q={PortalGroup:()=>Promise.resolve({default:g}),PortalItem:()=>import("./PortalItem.js"),PortalUser:()=>Promise.resolve({default:D})};let U=_=class extends(a.JSONSupportMixin(i)){constructor(e){super(e),this._esriIdCredentialCreateHandle=null,this.access=null,this.allSSL=!1,this.authMode="auto",this.authorizedCrossOriginDomains=null,this.basemapGalleryGroupQuery=null,this.basemapGalleryGroupQuery3D=null,this.bingKey=null,this.canListApps=!1,this.canListData=!1,this.canListPreProvisionedItems=!1,this.canProvisionDirectPurchase=!1,this.canSearchPublic=!0,this.canShareBingPublic=!1,this.canSharePublic=!1,this.canSignInArcGIS=!1,this.canSignInIDP=!1,this.colorSetsGroupQuery=null,this.commentsEnabled=!1,this.created=null,this.culture=null,this.customBaseUrl=null,this.default3DBasemapQuery=null,this.defaultBasemap=null,this.defaultDevBasemap=null,this.defaultExtent=null,this.defaultVectorBasemap=null,this.description=null,this.devBasemapGalleryGroupQuery=null,this.eueiEnabled=null,this.featuredGroups=null,this.featuredItemsGroupQuery=null,this.galleryTemplatesGroupQuery=null,this.layoutGroupQuery=null,this.livingAtlasGroupQuery=null,this.hasCategorySchema=!1,this.hasClassificationSchema=!1,this.helperServices=null,this.homePageFeaturedContent=null,this.homePageFeaturedContentCount=null,this.httpPort=null,this.httpsPort=null,this.id=null,this.ipCntryCode=null,this.isPortal=!1,this.isReadOnly=!1,this.layerTemplatesGroupQuery=null,this.maxTokenExpirationMinutes=null,this.modified=null,this.name=null,this.portalHostname=null,this.portalMode=null,this.portalProperties=null,this.region=null,this.recycleBinEnabled=!1,this.rotatorPanels=null,this.showHomePageDescription=!1,this.sourceJSON=null,this.supportsHostedServices=!1,this.symbolSetsGroupQuery=null,this.templatesGroupQuery=null,this.units=null,this.url=t.portalUrl,this.urlKey=null,this.user=null,this.use3dBasemaps=!0,this.useDefault3dBasemap=!1,this.useStandardizedQuery=!1,this.useVectorBasemaps=!1,this.vectorBasemapGalleryGroupQuery=null}normalizeCtorArgs(e){return"string"==typeof e?{url:e}:e}destroy(){C.unregister(this),this.defaultBasemap=l(this.defaultBasemap),this.defaultDevBasemap=l(this.defaultDevBasemap),this.defaultVectorBasemap=l(this.defaultVectorBasemap),this._esriIdCredentialCreateHandle=u(this._esriIdCredentialCreateHandle)}readAuthorizedCrossOriginDomains(e){if(e)for(const r of e)t.request.trustedServers.includes(r)||t.request.trustedServers.push(r);return e}readDefaultBasemap(e){return this._readBasemap(e)}readDefaultDevBasemap(e){return this._readBasemap(e)}readDefaultVectorBasemap(e){return this._readBasemap(e)}get extraQuery(){const e=this.user?.orgId,t=!e||this.canSearchPublic;return this.id&&!t?` AND orgid:${this.id}`:null}get hasAPIKey(){return G(this.url)}get isOrganization(){return!!this.access}get itemPageUrl(){return this.url?`${this.url}/home/item.html`:null}get restUrl(){let e=this.url;if(e){const t=e.indexOf("/sharing");e=t>0?e.slice(0,t):this.url.replace(/\/+$/,""),e+="/sharing/rest"}return e}get thumbnailUrl(){const e=this.restUrl,t=this.thumbnail;return e&&t?this._normalizeSSL(e+"/portals/self/resources/"+t):null}readUrlKey(e){return e?e.toLowerCase():e}readUser(e){let t=null;return e&&(t=D.fromJSON(e),t.portal=this),t}load(e){const t=import("../Basemap.js").then((({default:t})=>{n(e),M=t})).then((()=>this.sourceJSON?this.sourceJSON:this.fetchSelf(this.authMode,!1,e))).then((e=>{if(!this.hasAPIKey&&r){const e=r;this.credential=e.findCredential(this.restUrl),this.credential||this.authMode!==_.AUTH_MODE_AUTO&&this.authMode!==_.AUTH_MODE_NO_PROMPT||(this._esriIdCredentialCreateHandle?.remove(),this._esriIdCredentialCreateHandle=e.on("credential-create",w(new WeakRef(this))),C.register(this,this._esriIdCredentialCreateHandle,this))}this.sourceJSON=e,this.read(e)}));return this.addResolvingPromise(t),Promise.resolve(this)}async createElevationLayers(){await this.load();const e=this._getHelperService("defaultElevationLayers"),t=(await import("../layers/ElevationLayer.js")).default;return e?e.map((e=>new t({id:e.id,url:e.url}))):[]}async fetchBasemaps(e,t){const r=await this._fetchBasemaps(e,t);if(!0===t?.include3d&&!1!==this.use3dBasemaps){const o=await this._fetchBasemaps3D(e,t);r.unshift(...o)}return r}async fetchDefault3DBasemap(e){if(!this.useDefault3dBasemap||!this.default3DBasemapQuery||"none"===this.default3DBasemapQuery)return null;const t=new O;t.query=this.default3DBasemapQuery,t.disableExtraQuery=!0;const r=(await this.queryItems(t,e)).results.find((e=>"Web Scene"===e.type));return r?new M({portalItem:r}):null}fetchCategorySchema(e){return this.hasCategorySchema?this.request(this.restUrl+"/portals/self/categorySchema",e).then((e=>e.categorySchema)):p(e)?Promise.reject(h()):Promise.resolve([])}fetchFeaturedGroups(e){const t=this.featuredGroups,r=new O({num:100,sortField:"title"});if(t?.length){const o=[];for(const e of t)o.push(`(title:"${e.title}" AND owner:${e.owner})`);return r.query=o.join(" OR "),this.queryGroups(r,e).then((e=>e.results))}return p(e)?Promise.reject(h()):Promise.resolve([])}fetchRegions(e){const t=this.user?.culture||this.culture||S();return this.request(this.restUrl+"/portals/regions",{...e,query:{culture:t}})}fetchSettings(e){const t=this.user?.culture||this.culture||S();return this.request(this.restUrl+"/portals/self/settings",{...e,query:{culture:t}})}static getDefault(){return P((()=>new _))}queryGroups(e,t){return this.queryPortal("/community/groups",e,"PortalGroup",t)}queryItems(e,t){return this.queryPortal("/search",e,"PortalItem",t)}queryUsers(e,t){return e.sortField||(e.sortField="username"),this.queryPortal("/community/users",e,"PortalUser",t)}fetchSelf(e=this.authMode,t=!1,r){const o=this.restUrl+"/portals/self",s={authMode:e,query:{culture:S().toLowerCase()},withCredentials:!0,...r};return"auto"===s.authMode&&(s.authMode="no-prompt"),t&&(s.query.default=!0),this.request(o,s)}queryPortal(e,t,r,o){const s=c(O,t),a=t=>this.request(this.restUrl+e,{...s.toRequestOptions(this),...o}).then((e=>{const r=s.clone();return r.start=e.nextStart,new B({nextQueryParams:r,queryParams:s,total:e.total,results:_._resultsToTypedArray(t,{portal:this},e,o)})})).then((e=>Promise.all(e.results.map((t=>"function"==typeof t.when?t.when():e))).then((()=>e),(t=>(d(t),e)))));return r&&Q[r]?Q[r]().then((({default:e})=>(n(o),a(e)))):a()}signIn(){if(this.hasAPIKey)return this.load().then((()=>{if(!this.user)throw new s("portal:not-authenticated","Unable to authenticate user. Portal.user is missing")}));if(this.authMode===_.AUTH_MODE_ANONYMOUS||this.authMode===_.AUTH_MODE_NO_PROMPT&&!r)return Promise.reject(new s("portal:invalid-auth-mode",`Current "authMode"' is "${this.authMode}"`));if("failed"===this.loadStatus)return Promise.reject(this.loadError);const e=e=>Promise.resolve().then((()=>"not-loaded"===this.loadStatus?(e||(this.authMode="immediate"),this.load().then((()=>null))):"loading"===this.loadStatus?this.load().then((()=>this.credential?null:(this.credential=e,this.fetchSelf("immediate")))):this.user&&this.credential===e?null:(this.credential=e,this.fetchSelf("immediate")))).then((e=>{e&&(this.sourceJSON=e,this.read(e))}));return r?r.getCredential(this.restUrl,{prompt:this.authMode!==_.AUTH_MODE_NO_PROMPT}).then((t=>e(t))):e(this.credential)}normalizeUrl(e){const t=this.credential?.token;return this._normalizeSSL(t?e+(e.includes("?")?"&":"?")+"token="+t:e)}requestToTypedArray(e,t,r){return this.request(e,t).then((e=>{const t=_._resultsToTypedArray(r,{portal:this},e);return Promise.all(t.map((t=>"function"==typeof t.when?t.when():e))).then((()=>t),(()=>t))}))}request(e,t={}){const r={f:"json",...t.query},{authMode:s=(this.authMode===_.AUTH_MODE_ANONYMOUS||this.authMode===_.AUTH_MODE_NO_PROMPT?this.authMode:"auto"),body:a=null,cacheBust:i=!1,method:l="auto",responseType:u="json",signal:n}=t,p={authMode:s,body:a,cacheBust:i,method:l,query:r,responseType:u,timeout:0,signal:n};return t.withCredentials&&(p.withCredentials=!0),o(this._normalizeSSL(e),p).then((e=>e.data))}toJSON(){throw new s("internal:not-yet-implemented","Portal.toJSON is not yet implemented")}static fromJSON(e){if(!e)return null;if(e.declaredClass)throw new Error("JSON object is already hydrated");return new _({sourceJSON:e})}_getHelperService(e){const t=this.helperServices&&this.helperServices[e];if(!t)throw new s("portal:service-not-found",`The \`helperServices\` do not include an entry named "${e}"`);return t}async _fetchBasemaps(e,t){const r=new O;r.query=e||(this.hasAPIKey?this.devBasemapGalleryGroupQuery:this.useVectorBasemaps?this.vectorBasemapGalleryGroupQuery:this.basemapGalleryGroupQuery),r.disableExtraQuery=!0;const o=await this.queryGroups(r,t);if(!o.total)return[];const s=o.results[0];r.num=100,r.query='type:"Web Map" -type:"Web Application"',r.sortField=s.sortField||"name",r.sortOrder=s.sortOrder||"desc";const a=await s.queryItems(r,t);if(!a.total)return[];return a.results.filter((e=>"Web Map"===e.type)).map((e=>new M({portalItem:e})))}async _fetchBasemaps3D(e,t){const r=e||this.basemapGalleryGroupQuery3D;if(!r)return[];const o=new O({query:r,disableExtraQuery:!0}),s=await this.queryGroups(o,t);if(!s.total)return[];const a=s.results[0];o.num=100,o.query='type:"Web Scene"',o.sortField=a.sortField||"name",o.sortOrder=a.sortOrder||"desc";const i=await a.queryItems(o,t);if(!i.total)return[];return i.results.filter((e=>"Web Scene"===e.type)).map((e=>new M({portalItem:e})))}_normalizeSSL(e){return e.replace(/^http:/i,"https:").replace(":7080",":7443")}_readBasemap(e){if(e){const t=M.fromJSON(e);return t.portalItem={portal:this},t}return null}static _resultsToTypedArray(e,t,r,o){let s;if(r){const a=null!=o?o.signal:null;s=r.listings||r.notifications||r.userInvitations||r.tags||r.items||r.groups||r.comments||r.provisions||r.results||r.relatedItems||r,(e||t)&&(s=s.map((r=>{const o=Object.assign(e?e.fromJSON(r):r,t);return"function"==typeof o.load&&o.load(a),o})))}else s=[];return s}};U.AUTH_MODE_ANONYMOUS="anonymous",U.AUTH_MODE_AUTO="auto",U.AUTH_MODE_IMMEDIATE="immediate",U.AUTH_MODE_NO_PROMPT="no-prompt",e([y()],U.prototype,"access",void 0),e([y()],U.prototype,"allSSL",void 0),e([y()],U.prototype,"authMode",void 0),e([y()],U.prototype,"authorizedCrossOriginDomains",void 0),e([m("authorizedCrossOriginDomains")],U.prototype,"readAuthorizedCrossOriginDomains",null),e([y()],U.prototype,"basemapGalleryGroupQuery",void 0),e([y({json:{name:"3DBasemapGalleryGroupQuery"}})],U.prototype,"basemapGalleryGroupQuery3D",void 0),e([y()],U.prototype,"bingKey",void 0),e([y()],U.prototype,"canListApps",void 0),e([y()],U.prototype,"canListData",void 0),e([y()],U.prototype,"canListPreProvisionedItems",void 0),e([y()],U.prototype,"canProvisionDirectPurchase",void 0),e([y()],U.prototype,"canSearchPublic",void 0),e([y()],U.prototype,"canShareBingPublic",void 0),e([y()],U.prototype,"canSharePublic",void 0),e([y()],U.prototype,"canSignInArcGIS",void 0),e([y()],U.prototype,"canSignInIDP",void 0),e([y()],U.prototype,"colorSetsGroupQuery",void 0),e([y()],U.prototype,"commentsEnabled",void 0),e([y({type:Date})],U.prototype,"created",void 0),e([y()],U.prototype,"credential",void 0),e([y()],U.prototype,"culture",void 0),e([y()],U.prototype,"currentVersion",void 0),e([y()],U.prototype,"customBaseUrl",void 0),e([y()],U.prototype,"default3DBasemapQuery",void 0),e([y()],U.prototype,"defaultBasemap",void 0),e([m("defaultBasemap")],U.prototype,"readDefaultBasemap",null),e([y()],U.prototype,"defaultDevBasemap",void 0),e([m("defaultDevBasemap")],U.prototype,"readDefaultDevBasemap",null),e([y({type:v})],U.prototype,"defaultExtent",void 0),e([y()],U.prototype,"defaultVectorBasemap",void 0),e([m("defaultVectorBasemap")],U.prototype,"readDefaultVectorBasemap",null),e([y()],U.prototype,"description",void 0),e([y()],U.prototype,"devBasemapGalleryGroupQuery",void 0),e([y()],U.prototype,"eueiEnabled",void 0),e([y({readOnly:!0})],U.prototype,"extraQuery",null),e([y()],U.prototype,"featuredGroups",void 0),e([y()],U.prototype,"featuredItemsGroupQuery",void 0),e([y()],U.prototype,"galleryTemplatesGroupQuery",void 0),e([y()],U.prototype,"layoutGroupQuery",void 0),e([y()],U.prototype,"livingAtlasGroupQuery",void 0),e([y({readOnly:!0})],U.prototype,"hasAPIKey",null),e([y()],U.prototype,"hasCategorySchema",void 0),e([y()],U.prototype,"hasClassificationSchema",void 0),e([y()],U.prototype,"helpBase",void 0),e([y()],U.prototype,"helperServices",void 0),e([y()],U.prototype,"helpMap",void 0),e([y()],U.prototype,"homePageFeaturedContent",void 0),e([y()],U.prototype,"homePageFeaturedContentCount",void 0),e([y()],U.prototype,"httpPort",void 0),e([y()],U.prototype,"httpsPort",void 0),e([y()],U.prototype,"id",void 0),e([y()],U.prototype,"ipCntryCode",void 0),e([y({readOnly:!0})],U.prototype,"isOrganization",null),e([y()],U.prototype,"isPortal",void 0),e([y()],U.prototype,"isReadOnly",void 0),e([y({readOnly:!0})],U.prototype,"itemPageUrl",null),e([y()],U.prototype,"layerTemplatesGroupQuery",void 0),e([y()],U.prototype,"maxTokenExpirationMinutes",void 0),e([y({type:Date})],U.prototype,"modified",void 0),e([y()],U.prototype,"name",void 0),e([y()],U.prototype,"portalHostname",void 0),e([y()],U.prototype,"portalMode",void 0),e([y()],U.prototype,"portalProperties",void 0),e([y()],U.prototype,"region",void 0),e([y()],U.prototype,"recycleBinEnabled",void 0),e([y({readOnly:!0})],U.prototype,"restUrl",null),e([y()],U.prototype,"rotatorPanels",void 0),e([y()],U.prototype,"showHomePageDescription",void 0),e([y()],U.prototype,"sourceJSON",void 0),e([y()],U.prototype,"staticImagesUrl",void 0),e([y({json:{name:"2DStylesGroupQuery"}})],U.prototype,"stylesGroupQuery2d",void 0),e([y({json:{name:"stylesGroupQuery"}})],U.prototype,"stylesGroupQuery3d",void 0),e([y()],U.prototype,"supportsHostedServices",void 0),e([y()],U.prototype,"symbolSetsGroupQuery",void 0),e([y()],U.prototype,"templatesGroupQuery",void 0),e([y()],U.prototype,"thumbnail",void 0),e([y({readOnly:!0})],U.prototype,"thumbnailUrl",null),e([y()],U.prototype,"units",void 0),e([y()],U.prototype,"url",void 0),e([y()],U.prototype,"urlKey",void 0),e([m("urlKey")],U.prototype,"readUrlKey",null),e([y()],U.prototype,"user",void 0),e([m("user")],U.prototype,"readUser",null),e([y()],U.prototype,"use3dBasemaps",void 0),e([y()],U.prototype,"useDefault3dBasemap",void 0),e([y()],U.prototype,"useStandardizedQuery",void 0),e([y()],U.prototype,"useVectorBasemaps",void 0),e([y()],U.prototype,"vectorBasemapGalleryGroupQuery",void 0),U=_=e([f("esri.portal.Portal")],U);const b=U,C=new FinalizationRegistry((e=>{e.remove()}));function w(e){const t=r;return()=>{const r=e.deref();r&&t.findCredential(r.restUrl)&&r.signIn().catch((()=>{}))}}export{b as default};
|
|
5
|
+
import{_ as e}from"../chunks/tslib.es6.js";import t from"../config.js";import{id as r}from"../kernel.js";import o from"../request.js";import s from"../core/Error.js";import i from"../core/JSONSupport.js";import a from"../core/Loadable.js";import{destroyMaybe as l,removeMaybe as u}from"../core/maybe.js";import{throwIfAborted as n,isAborted as p,createAbortError as h,throwIfAbortError as d}from"../core/promiseUtils.js";import{property as y}from"../core/accessorSupport/decorators/property.js";import{ensureType as c}from"../core/accessorSupport/ensureType.js";import"../core/has.js";import"../core/RandomLCG.js";import{reader as m}from"../core/accessorSupport/decorators/reader.js";import{subclass as f}from"../core/accessorSupport/decorators/subclass.js";import v from"../geometry/Extent.js";import{getLocale as S}from"../intl/locale.js";import{ensureDefaultPortalInstance as P}from"./portalDefault.js";import g from"./PortalGroup.js";import O from"./PortalQueryParams.js";import B from"./PortalQueryResult.js";import D from"./PortalUser.js";import{isApiKeyApplicable as G}from"../support/apiKeyUtils.js";var _;let M;const Q={PortalGroup:()=>Promise.resolve({default:g}),PortalItem:()=>import("./PortalItem.js"),PortalUser:()=>Promise.resolve({default:D})};let U=class extends(i.JSONSupportMixin(a)){static{_=this}static{this.AUTH_MODE_ANONYMOUS="anonymous"}static{this.AUTH_MODE_AUTO="auto"}static{this.AUTH_MODE_IMMEDIATE="immediate"}static{this.AUTH_MODE_NO_PROMPT="no-prompt"}constructor(e){super(e),this._esriIdCredentialCreateHandle=null,this.access=null,this.allSSL=!1,this.authMode="auto",this.authorizedCrossOriginDomains=null,this.basemapGalleryGroupQuery=null,this.basemapGalleryGroupQuery3D=null,this.bingKey=null,this.canListApps=!1,this.canListData=!1,this.canListPreProvisionedItems=!1,this.canProvisionDirectPurchase=!1,this.canSearchPublic=!0,this.canShareBingPublic=!1,this.canSharePublic=!1,this.canSignInArcGIS=!1,this.canSignInIDP=!1,this.colorSetsGroupQuery=null,this.commentsEnabled=!1,this.created=null,this.culture=null,this.customBaseUrl=null,this.default3DBasemapQuery=null,this.defaultBasemap=null,this.defaultDevBasemap=null,this.defaultExtent=null,this.defaultVectorBasemap=null,this.description=null,this.devBasemapGalleryGroupQuery=null,this.eueiEnabled=null,this.featuredGroups=null,this.featuredItemsGroupQuery=null,this.galleryTemplatesGroupQuery=null,this.layoutGroupQuery=null,this.livingAtlasGroupQuery=null,this.hasCategorySchema=!1,this.hasClassificationSchema=!1,this.helperServices=null,this.homePageFeaturedContent=null,this.homePageFeaturedContentCount=null,this.httpPort=null,this.httpsPort=null,this.id=null,this.ipCntryCode=null,this.isPortal=!1,this.isReadOnly=!1,this.layerTemplatesGroupQuery=null,this.maxTokenExpirationMinutes=null,this.modified=null,this.name=null,this.portalHostname=null,this.portalMode=null,this.portalProperties=null,this.region=null,this.recycleBinEnabled=!1,this.rotatorPanels=null,this.showHomePageDescription=!1,this.sourceJSON=null,this.supportsHostedServices=!1,this.symbolSetsGroupQuery=null,this.templatesGroupQuery=null,this.units=null,this.url=t.portalUrl,this.urlKey=null,this.user=null,this.use3dBasemaps=!0,this.useDefault3dBasemap=!1,this.useStandardizedQuery=!1,this.useVectorBasemaps=!1,this.vectorBasemapGalleryGroupQuery=null}normalizeCtorArgs(e){return"string"==typeof e?{url:e}:e}destroy(){C.unregister(this),this.defaultBasemap=l(this.defaultBasemap),this.defaultDevBasemap=l(this.defaultDevBasemap),this.defaultVectorBasemap=l(this.defaultVectorBasemap),this._esriIdCredentialCreateHandle=u(this._esriIdCredentialCreateHandle)}readAuthorizedCrossOriginDomains(e){if(e)for(const r of e)t.request.trustedServers.includes(r)||t.request.trustedServers.push(r);return e}readDefaultBasemap(e){return this._readBasemap(e)}readDefaultDevBasemap(e){return this._readBasemap(e)}readDefaultVectorBasemap(e){return this._readBasemap(e)}get extraQuery(){const e=this.user?.orgId,t=!e||this.canSearchPublic;return this.id&&!t?` AND orgid:${this.id}`:null}get hasAPIKey(){return G(this.url)}get isOrganization(){return!!this.access}get itemPageUrl(){return this.url?`${this.url}/home/item.html`:null}get restUrl(){let e=this.url;if(e){const t=e.indexOf("/sharing");e=t>0?e.slice(0,t):this.url.replace(/\/+$/,""),e+="/sharing/rest"}return e}get thumbnailUrl(){const e=this.restUrl,t=this.thumbnail;return e&&t?this._normalizeSSL(e+"/portals/self/resources/"+t):null}readUrlKey(e){return e?e.toLowerCase():e}readUser(e){let t=null;return e&&(t=D.fromJSON(e),t.portal=this),t}load(e){const t=import("../Basemap.js").then((({default:t})=>{n(e),M=t})).then((()=>this.sourceJSON?this.sourceJSON:this.fetchSelf(this.authMode,!1,e))).then((e=>{if(!this.hasAPIKey&&r){const e=r;this.credential=e.findCredential(this.restUrl),this.credential||this.authMode!==_.AUTH_MODE_AUTO&&this.authMode!==_.AUTH_MODE_NO_PROMPT||(this._esriIdCredentialCreateHandle?.remove(),this._esriIdCredentialCreateHandle=e.on("credential-create",w(new WeakRef(this))),C.register(this,this._esriIdCredentialCreateHandle,this))}this.sourceJSON=e,this.read(e)}));return this.addResolvingPromise(t),Promise.resolve(this)}async createElevationLayers(){await this.load();const e=this._getHelperService("defaultElevationLayers"),t=(await import("../layers/ElevationLayer.js")).default;return e?e.map((e=>new t({id:e.id,url:e.url}))):[]}async fetchBasemaps(e,t){const r=await this._fetchBasemaps(e,t);if(!0===t?.include3d&&!1!==this.use3dBasemaps){const o=await this._fetchBasemaps3D(e,t);r.unshift(...o)}return r}async fetchDefault3DBasemap(e){if(!this.useDefault3dBasemap||!this.default3DBasemapQuery||"none"===this.default3DBasemapQuery)return null;const t=new O;t.query=this.default3DBasemapQuery,t.disableExtraQuery=!0;const r=(await this.queryItems(t,e)).results.find((e=>"Web Scene"===e.type));return r?new M({portalItem:r}):null}fetchCategorySchema(e){return this.hasCategorySchema?this.request(this.restUrl+"/portals/self/categorySchema",e).then((e=>e.categorySchema)):p(e)?Promise.reject(h()):Promise.resolve([])}fetchFeaturedGroups(e){const t=this.featuredGroups,r=new O({num:100,sortField:"title"});if(t?.length){const o=[];for(const e of t)o.push(`(title:"${e.title}" AND owner:${e.owner})`);return r.query=o.join(" OR "),this.queryGroups(r,e).then((e=>e.results))}return p(e)?Promise.reject(h()):Promise.resolve([])}fetchRegions(e){const t=this.user?.culture||this.culture||S();return this.request(this.restUrl+"/portals/regions",{...e,query:{culture:t}})}fetchSettings(e){const t=this.user?.culture||this.culture||S();return this.request(this.restUrl+"/portals/self/settings",{...e,query:{culture:t}})}static getDefault(){return P((()=>new _))}queryGroups(e,t){return this.queryPortal("/community/groups",e,"PortalGroup",t)}queryItems(e,t){return this.queryPortal("/search",e,"PortalItem",t)}queryUsers(e,t){return e.sortField||(e.sortField="username"),this.queryPortal("/community/users",e,"PortalUser",t)}fetchSelf(e=this.authMode,t=!1,r){const o=this.restUrl+"/portals/self",s={authMode:e,query:{culture:S().toLowerCase()},withCredentials:!0,...r};return"auto"===s.authMode&&(s.authMode="no-prompt"),t&&(s.query.default=!0),this.request(o,s)}queryPortal(e,t,r,o){const s=c(O,t),i=t=>this.request(this.restUrl+e,{...s.toRequestOptions(this),...o}).then((e=>{const r=s.clone();return r.start=e.nextStart,new B({nextQueryParams:r,queryParams:s,total:e.total,results:_._resultsToTypedArray(t,{portal:this},e,o)})})).then((e=>Promise.all(e.results.map((t=>"function"==typeof t.when?t.when():e))).then((()=>e),(t=>(d(t),e)))));return r&&Q[r]?Q[r]().then((({default:e})=>(n(o),i(e)))):i()}signIn(){if(this.hasAPIKey)return this.load().then((()=>{if(!this.user)throw new s("portal:not-authenticated","Unable to authenticate user. Portal.user is missing")}));if(this.authMode===_.AUTH_MODE_ANONYMOUS||this.authMode===_.AUTH_MODE_NO_PROMPT&&!r)return Promise.reject(new s("portal:invalid-auth-mode",`Current "authMode"' is "${this.authMode}"`));if("failed"===this.loadStatus)return Promise.reject(this.loadError);const e=e=>Promise.resolve().then((()=>"not-loaded"===this.loadStatus?(e||(this.authMode="immediate"),this.load().then((()=>null))):"loading"===this.loadStatus?this.load().then((()=>this.credential?null:(this.credential=e,this.fetchSelf("immediate")))):this.user&&this.credential===e?null:(this.credential=e,this.fetchSelf("immediate")))).then((e=>{e&&(this.sourceJSON=e,this.read(e))}));return r?r.getCredential(this.restUrl,{prompt:this.authMode!==_.AUTH_MODE_NO_PROMPT}).then((t=>e(t))):e(this.credential)}normalizeUrl(e){const t=this.credential?.token;return this._normalizeSSL(t?e+(e.includes("?")?"&":"?")+"token="+t:e)}requestToTypedArray(e,t,r){return this.request(e,t).then((e=>{const t=_._resultsToTypedArray(r,{portal:this},e);return Promise.all(t.map((t=>"function"==typeof t.when?t.when():e))).then((()=>t),(()=>t))}))}request(e,t={}){const r={f:"json",...t.query},{authMode:s=(this.authMode===_.AUTH_MODE_ANONYMOUS||this.authMode===_.AUTH_MODE_NO_PROMPT?this.authMode:"auto"),body:i=null,cacheBust:a=!1,method:l="auto",responseType:u="json",signal:n}=t,p={authMode:s,body:i,cacheBust:a,method:l,query:r,responseType:u,timeout:0,signal:n};return t.withCredentials&&(p.withCredentials=!0),o(this._normalizeSSL(e),p).then((e=>e.data))}toJSON(){throw new s("internal:not-yet-implemented","Portal.toJSON is not yet implemented")}static fromJSON(e){if(!e)return null;if(e.declaredClass)throw new Error("JSON object is already hydrated");return new _({sourceJSON:e})}_getHelperService(e){const t=this.helperServices&&this.helperServices[e];if(!t)throw new s("portal:service-not-found",`The \`helperServices\` do not include an entry named "${e}"`);return t}async _fetchBasemaps(e,t){const r=new O;r.query=e||(this.hasAPIKey?this.devBasemapGalleryGroupQuery:this.useVectorBasemaps?this.vectorBasemapGalleryGroupQuery:this.basemapGalleryGroupQuery),r.disableExtraQuery=!0;const o=await this.queryGroups(r,t);if(!o.total)return[];const s=o.results[0];r.num=100,r.query='type:"Web Map" -type:"Web Application"',r.sortField=s.sortField||"name",r.sortOrder=s.sortOrder||"desc";const i=await s.queryItems(r,t);if(!i.total)return[];return i.results.filter((e=>"Web Map"===e.type)).map((e=>new M({portalItem:e})))}async _fetchBasemaps3D(e,t){const r=e||this.basemapGalleryGroupQuery3D;if(!r)return[];const o=new O({query:r,disableExtraQuery:!0}),s=await this.queryGroups(o,t);if(!s.total)return[];const i=s.results[0];o.num=100,o.query='type:"Web Scene"',o.sortField=i.sortField||"name",o.sortOrder=i.sortOrder||"desc";const a=await i.queryItems(o,t);if(!a.total)return[];return a.results.filter((e=>"Web Scene"===e.type)).map((e=>new M({portalItem:e})))}_normalizeSSL(e){return e.replace(/^http:/i,"https:").replace(":7080",":7443")}_readBasemap(e){if(e){const t=M.fromJSON(e);return t.portalItem={portal:this},t}return null}static _resultsToTypedArray(e,t,r,o){let s;if(r){const i=null!=o?o.signal:null;s=r.listings||r.notifications||r.userInvitations||r.tags||r.items||r.groups||r.comments||r.provisions||r.results||r.relatedItems||r,(e||t)&&(s=s.map((r=>{const o=Object.assign(e?e.fromJSON(r):r,t);return"function"==typeof o.load&&o.load(i),o})))}else s=[];return s}};e([y()],U.prototype,"access",void 0),e([y()],U.prototype,"allSSL",void 0),e([y()],U.prototype,"authMode",void 0),e([y()],U.prototype,"authorizedCrossOriginDomains",void 0),e([m("authorizedCrossOriginDomains")],U.prototype,"readAuthorizedCrossOriginDomains",null),e([y()],U.prototype,"basemapGalleryGroupQuery",void 0),e([y({json:{name:"3DBasemapGalleryGroupQuery"}})],U.prototype,"basemapGalleryGroupQuery3D",void 0),e([y()],U.prototype,"bingKey",void 0),e([y()],U.prototype,"canListApps",void 0),e([y()],U.prototype,"canListData",void 0),e([y()],U.prototype,"canListPreProvisionedItems",void 0),e([y()],U.prototype,"canProvisionDirectPurchase",void 0),e([y()],U.prototype,"canSearchPublic",void 0),e([y()],U.prototype,"canShareBingPublic",void 0),e([y()],U.prototype,"canSharePublic",void 0),e([y()],U.prototype,"canSignInArcGIS",void 0),e([y()],U.prototype,"canSignInIDP",void 0),e([y()],U.prototype,"colorSetsGroupQuery",void 0),e([y()],U.prototype,"commentsEnabled",void 0),e([y({type:Date})],U.prototype,"created",void 0),e([y()],U.prototype,"credential",void 0),e([y()],U.prototype,"culture",void 0),e([y()],U.prototype,"currentVersion",void 0),e([y()],U.prototype,"customBaseUrl",void 0),e([y()],U.prototype,"default3DBasemapQuery",void 0),e([y()],U.prototype,"defaultBasemap",void 0),e([m("defaultBasemap")],U.prototype,"readDefaultBasemap",null),e([y()],U.prototype,"defaultDevBasemap",void 0),e([m("defaultDevBasemap")],U.prototype,"readDefaultDevBasemap",null),e([y({type:v})],U.prototype,"defaultExtent",void 0),e([y()],U.prototype,"defaultVectorBasemap",void 0),e([m("defaultVectorBasemap")],U.prototype,"readDefaultVectorBasemap",null),e([y()],U.prototype,"description",void 0),e([y()],U.prototype,"devBasemapGalleryGroupQuery",void 0),e([y()],U.prototype,"eueiEnabled",void 0),e([y({readOnly:!0})],U.prototype,"extraQuery",null),e([y()],U.prototype,"featuredGroups",void 0),e([y()],U.prototype,"featuredItemsGroupQuery",void 0),e([y()],U.prototype,"galleryTemplatesGroupQuery",void 0),e([y()],U.prototype,"layoutGroupQuery",void 0),e([y()],U.prototype,"livingAtlasGroupQuery",void 0),e([y({readOnly:!0})],U.prototype,"hasAPIKey",null),e([y()],U.prototype,"hasCategorySchema",void 0),e([y()],U.prototype,"hasClassificationSchema",void 0),e([y()],U.prototype,"helpBase",void 0),e([y()],U.prototype,"helperServices",void 0),e([y()],U.prototype,"helpMap",void 0),e([y()],U.prototype,"homePageFeaturedContent",void 0),e([y()],U.prototype,"homePageFeaturedContentCount",void 0),e([y()],U.prototype,"httpPort",void 0),e([y()],U.prototype,"httpsPort",void 0),e([y()],U.prototype,"id",void 0),e([y()],U.prototype,"ipCntryCode",void 0),e([y({readOnly:!0})],U.prototype,"isOrganization",null),e([y()],U.prototype,"isPortal",void 0),e([y()],U.prototype,"isReadOnly",void 0),e([y({readOnly:!0})],U.prototype,"itemPageUrl",null),e([y()],U.prototype,"layerTemplatesGroupQuery",void 0),e([y()],U.prototype,"maxTokenExpirationMinutes",void 0),e([y({type:Date})],U.prototype,"modified",void 0),e([y()],U.prototype,"name",void 0),e([y()],U.prototype,"portalHostname",void 0),e([y()],U.prototype,"portalMode",void 0),e([y()],U.prototype,"portalProperties",void 0),e([y()],U.prototype,"region",void 0),e([y()],U.prototype,"recycleBinEnabled",void 0),e([y({readOnly:!0})],U.prototype,"restUrl",null),e([y()],U.prototype,"rotatorPanels",void 0),e([y()],U.prototype,"showHomePageDescription",void 0),e([y()],U.prototype,"sourceJSON",void 0),e([y()],U.prototype,"staticImagesUrl",void 0),e([y({json:{name:"2DStylesGroupQuery"}})],U.prototype,"stylesGroupQuery2d",void 0),e([y({json:{name:"stylesGroupQuery"}})],U.prototype,"stylesGroupQuery3d",void 0),e([y()],U.prototype,"supportsHostedServices",void 0),e([y()],U.prototype,"symbolSetsGroupQuery",void 0),e([y()],U.prototype,"templatesGroupQuery",void 0),e([y()],U.prototype,"thumbnail",void 0),e([y({readOnly:!0})],U.prototype,"thumbnailUrl",null),e([y()],U.prototype,"units",void 0),e([y()],U.prototype,"url",void 0),e([y()],U.prototype,"urlKey",void 0),e([m("urlKey")],U.prototype,"readUrlKey",null),e([y()],U.prototype,"user",void 0),e([m("user")],U.prototype,"readUser",null),e([y()],U.prototype,"use3dBasemaps",void 0),e([y()],U.prototype,"useDefault3dBasemap",void 0),e([y()],U.prototype,"useStandardizedQuery",void 0),e([y()],U.prototype,"useVectorBasemaps",void 0),e([y()],U.prototype,"vectorBasemapGalleryGroupQuery",void 0),U=_=e([f("esri.portal.Portal")],U);const b=U,C=new FinalizationRegistry((e=>{e.remove()}));function w(e){const t=r;return()=>{const r=e.deref();r&&t.findCredential(r.restUrl)&&r.signIn().catch((()=>{}))}}export{b as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as t}from"../../chunks/tslib.es6.js";import e from"../../core/JSONSupport.js";import{clone as r}from"../../core/lang.js";import{property as o}from"../../core/accessorSupport/decorators/property.js";import{ensureType as s}from"../../core/accessorSupport/ensureType.js";import{subclass as i}from"../../core/accessorSupport/decorators/subclass.js";import{writer as n}from"../../core/accessorSupport/decorators/writer.js";var a;let p=
|
|
5
|
+
import{_ as t}from"../../chunks/tslib.es6.js";import e from"../../core/JSONSupport.js";import{clone as r}from"../../core/lang.js";import{property as o}from"../../core/accessorSupport/decorators/property.js";import{ensureType as s}from"../../core/accessorSupport/ensureType.js";import{subclass as i}from"../../core/accessorSupport/decorators/subclass.js";import{writer as n}from"../../core/accessorSupport/decorators/writer.js";var a;let p=class extends e{static{a=this}constructor(t){super(t),this.attachmentTypes=null,this.attachmentsWhere=null,this.cacheHint=void 0,this.keywords=null,this.globalIds=null,this.name=null,this.num=null,this.objectIds=null,this.orderByFields=null,this.returnMetadata=!1,this.size=null,this.start=null,this.where=null}writeStart(t,e){e.resultOffset=this.start,e.resultRecordCount=this.num||10}clone(){return new a(r({attachmentTypes:this.attachmentTypes,attachmentsWhere:this.attachmentsWhere,cacheHint:this.cacheHint,keywords:this.keywords,where:this.where,globalIds:this.globalIds,name:this.name,num:this.num,objectIds:this.objectIds,orderByFields:this.orderByFields,returnMetadata:this.returnMetadata,size:this.size,start:this.start}))}};t([o({type:[String],json:{write:!0}})],p.prototype,"attachmentTypes",void 0),t([o({type:String,json:{read:{source:"attachmentsDefinitionExpression"},write:{target:"attachmentsDefinitionExpression"}}})],p.prototype,"attachmentsWhere",void 0),t([o({type:Boolean,json:{write:!0}})],p.prototype,"cacheHint",void 0),t([o({type:[String],json:{write:!0}})],p.prototype,"keywords",void 0),t([o({type:[String],json:{write:!0}})],p.prototype,"globalIds",void 0),t([o({json:{write:!0}})],p.prototype,"name",void 0),t([o({type:Number,json:{read:{source:"resultRecordCount"}}})],p.prototype,"num",void 0),t([o({type:[Number],json:{write:!0}})],p.prototype,"objectIds",void 0),t([o({type:[String],json:{write:!0}})],p.prototype,"orderByFields",void 0),t([o({type:Boolean,json:{default:!1,write:!0}})],p.prototype,"returnMetadata",void 0),t([o({type:[Number],json:{write:!0}})],p.prototype,"size",void 0),t([o({type:Number,json:{read:{source:"resultOffset"}}})],p.prototype,"start",void 0),t([n("start"),n("num")],p.prototype,"writeStart",null),t([o({type:String,json:{read:{source:"definitionExpression"},write:{target:"definitionExpression"}}})],p.prototype,"where",void 0),p=a=t([i("esri.rest.support.AttachmentQuery")],p),p.from=s(p);const c=p;export{c 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.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as t}from"../../chunks/tslib.es6.js";import e from"../../core/Clonable.js";import r from"../../core/Collection.js";import o from"../../core/JSONSupport.js";import{property as i}from"../../core/accessorSupport/decorators/property.js";import{ensureClass as n}from"../../core/accessorSupport/ensureType.js";import"../../core/has.js";import"../../core/RandomLCG.js";import{enumeration as s}from"../../core/accessorSupport/decorators/enumeration.js";import{reader as p}from"../../core/accessorSupport/decorators/reader.js";import{subclass as l}from"../../core/accessorSupport/decorators/subclass.js";import{writer as u}from"../../core/accessorSupport/decorators/writer.js";import a from"../../geometry/SpatialReference.js";import{apiKey as y}from"./commonProperties.js";import{impedanceAttributeNameJsonMap as c,restrictionAttributeNameJsonMap as m,directionsLengthUnitJsonMap as d,directionsOutputTypeJsonMap as v,directionsStyleNameJsonMap as w,durationImpedanceAttributeNameJsonMap as h,lengthUnitJsonMap as j,outputLineJsonMap as f,restrictUTurnJsonMap as b,timeOfDayUsageJsonMap as B,travelDirectionJsonMap as g}from"./networkEnums.js";import A from"./TravelMode.js";var P;function T(t,e,o){null!=t&&(e[o]=r.isCollection(t)?{features:t.toArray().map((t=>t.toJSON()))}:t.toJSON())}let O=
|
|
5
|
+
import{_ as t}from"../../chunks/tslib.es6.js";import e from"../../core/Clonable.js";import r from"../../core/Collection.js";import o from"../../core/JSONSupport.js";import{property as i}from"../../core/accessorSupport/decorators/property.js";import{ensureClass as n}from"../../core/accessorSupport/ensureType.js";import"../../core/has.js";import"../../core/RandomLCG.js";import{enumeration as s}from"../../core/accessorSupport/decorators/enumeration.js";import{reader as p}from"../../core/accessorSupport/decorators/reader.js";import{subclass as l}from"../../core/accessorSupport/decorators/subclass.js";import{writer as u}from"../../core/accessorSupport/decorators/writer.js";import a from"../../geometry/SpatialReference.js";import{apiKey as y}from"./commonProperties.js";import{impedanceAttributeNameJsonMap as c,restrictionAttributeNameJsonMap as m,directionsLengthUnitJsonMap as d,directionsOutputTypeJsonMap as v,directionsStyleNameJsonMap as w,durationImpedanceAttributeNameJsonMap as h,lengthUnitJsonMap as j,outputLineJsonMap as f,restrictUTurnJsonMap as b,timeOfDayUsageJsonMap as B,travelDirectionJsonMap as g}from"./networkEnums.js";import A from"./TravelMode.js";var P;function T(t,e,o){null!=t&&(e[o]=r.isCollection(t)?{features:t.toArray().map((t=>t.toJSON()))}:t.toJSON())}let O=class extends(e.ClonableMixin(o)){static{P=this}constructor(t){super(t),this.accumulateAttributes=null,this.apiKey=null,this.attributeParameterValues=null,this.defaultCutoff=null,this.defaultTargetFacilityCount=null,this.directionsLanguage=null,this.directionsLengthUnits=null,this.directionsOutputType=null,this.directionsStyleName=null,this.directionsTimeAttribute=null,this.facilities=null,this.geometryPrecision=null,this.geometryPrecisionM=null,this.geometryPrecisionZ=null,this.ignoreInvalidLocations=null,this.impedanceAttribute=null,this.incidents=null,this.outputGeometryPrecision=null,this.outputGeometryPrecisionUnits=null,this.outputLines=null,this.outSpatialReference=null,this.overrides=null,this.pointBarriers=null,this.polygonBarriers=null,this.polylineBarriers=null,this.preserveObjectID=null,this.restrictionAttributes=null,this.restrictUTurns=null,this.returnDirections=!1,this.returnFacilities=!1,this.returnIncidents=!1,this.returnPointBarriers=!1,this.returnPolygonBarriers=!1,this.returnPolylineBarriers=!1,this.returnRoutes=!0,this.returnTraversedEdges=null,this.returnTraversedJunctions=null,this.returnTraversedTurns=null,this.returnZ=null,this.timeOfDay=null,this.timeOfDayIsUTC=null,this.timeOfDayUsage=null,this.travelDirection=null,this.travelMode=null,this.useHierarchy=!1}static from(t){return n(P,t)}readAccumulateAttributes(t){return null==t?null:t.map((t=>c.fromJSON(t)))}writeAccumulateAttributes(t,e,r){t?.length&&(e[r]=t.map((t=>c.toJSON(t))))}writeFacilities(t,e,r){T(t,e,r)}writeIncidents(t,e,r){T(t,e,r)}writePointBarriers(t,e,r){T(t,e,r)}writePolygonBarrier(t,e,r){T(t,e,r)}writePolylineBarrier(t,e,r){T(t,e,r)}readRestrictionAttributes(t){return null==t?null:t.map((t=>m.fromJSON(t)))}writeRestrictionAttributes(t,e,r){t?.length&&(e[r]=t.map((t=>m.toJSON(t))))}readTimeOfDay(t,e){const{timeOfDay:r}=e;return null==r?null:"now"===r?"now":new Date(r)}writeTimeOfDay(t,e){null!=t&&(e.timeOfDay="now"===t?"now":t.getTime())}};t([i({type:[String],json:{name:"accumulateAttributeNames",write:!0}})],O.prototype,"accumulateAttributes",void 0),t([p("accumulateAttributes")],O.prototype,"readAccumulateAttributes",null),t([u("accumulateAttributes")],O.prototype,"writeAccumulateAttributes",null),t([i(y)],O.prototype,"apiKey",void 0),t([i({json:{write:!0}})],O.prototype,"attributeParameterValues",void 0),t([i({type:Number,json:{write:!0}})],O.prototype,"defaultCutoff",void 0),t([i({type:Number,json:{write:!0}})],O.prototype,"defaultTargetFacilityCount",void 0),t([i({type:String,json:{write:!0}})],O.prototype,"directionsLanguage",void 0),t([s(d)],O.prototype,"directionsLengthUnits",void 0),t([s(v)],O.prototype,"directionsOutputType",void 0),t([s(w)],O.prototype,"directionsStyleName",void 0),t([s(h,{name:"directionsTimeAttributeName",ignoreUnknown:!1})],O.prototype,"directionsTimeAttribute",void 0),t([i({json:{write:!0}})],O.prototype,"facilities",void 0),t([u("facilities")],O.prototype,"writeFacilities",null),t([i({type:Number,json:{write:!0}})],O.prototype,"geometryPrecision",void 0),t([i({type:Number,json:{write:!0}})],O.prototype,"geometryPrecisionM",void 0),t([i({type:Number,json:{write:!0}})],O.prototype,"geometryPrecisionZ",void 0),t([i({type:Boolean,json:{write:!0}})],O.prototype,"ignoreInvalidLocations",void 0),t([s(c,{name:"impedanceAttributeName",ignoreUnknown:!1})],O.prototype,"impedanceAttribute",void 0),t([i({json:{write:!0}})],O.prototype,"incidents",void 0),t([u("incidents")],O.prototype,"writeIncidents",null),t([i({type:Number,json:{write:!0}})],O.prototype,"outputGeometryPrecision",void 0),t([s(j)],O.prototype,"outputGeometryPrecisionUnits",void 0),t([s(f)],O.prototype,"outputLines",void 0),t([i({type:a,json:{name:"outSR",write:!0}})],O.prototype,"outSpatialReference",void 0),t([i({json:{write:!0}})],O.prototype,"overrides",void 0),t([i({json:{name:"barriers",write:!0}})],O.prototype,"pointBarriers",void 0),t([u("pointBarriers")],O.prototype,"writePointBarriers",null),t([i({json:{write:!0}})],O.prototype,"polygonBarriers",void 0),t([u("polygonBarriers")],O.prototype,"writePolygonBarrier",null),t([i({json:{write:!0}})],O.prototype,"polylineBarriers",void 0),t([u("polylineBarriers")],O.prototype,"writePolylineBarrier",null),t([i({type:Boolean,json:{write:!0}})],O.prototype,"preserveObjectID",void 0),t([i({type:[String],json:{name:"restrictionAttributeNames",write:!0}})],O.prototype,"restrictionAttributes",void 0),t([p("restrictionAttributes")],O.prototype,"readRestrictionAttributes",null),t([u("restrictionAttributes")],O.prototype,"writeRestrictionAttributes",null),t([s(b)],O.prototype,"restrictUTurns",void 0),t([i({type:Boolean,json:{write:!0}})],O.prototype,"returnDirections",void 0),t([i({type:Boolean,json:{write:!0}})],O.prototype,"returnFacilities",void 0),t([i({type:Boolean,json:{write:!0}})],O.prototype,"returnIncidents",void 0),t([i({type:Boolean,json:{name:"returnBarriers",write:!0}})],O.prototype,"returnPointBarriers",void 0),t([i({type:Boolean,json:{write:!0}})],O.prototype,"returnPolygonBarriers",void 0),t([i({type:Boolean,json:{write:!0}})],O.prototype,"returnPolylineBarriers",void 0),t([i({type:Boolean,json:{name:"returnCFRoutes",write:!0}})],O.prototype,"returnRoutes",void 0),t([i({type:Boolean,json:{write:!0}})],O.prototype,"returnTraversedEdges",void 0),t([i({type:Boolean,json:{write:!0}})],O.prototype,"returnTraversedJunctions",void 0),t([i({type:Boolean,json:{write:!0}})],O.prototype,"returnTraversedTurns",void 0),t([i({type:Boolean,json:{write:!0}})],O.prototype,"returnZ",void 0),t([i({json:{write:!0}})],O.prototype,"timeOfDay",void 0),t([p("timeOfDay")],O.prototype,"readTimeOfDay",null),t([u("timeOfDay")],O.prototype,"writeTimeOfDay",null),t([i({type:Boolean,json:{write:!0}})],O.prototype,"timeOfDayIsUTC",void 0),t([s(B)],O.prototype,"timeOfDayUsage",void 0),t([s(g)],O.prototype,"travelDirection",void 0),t([i({type:A,json:{write:!0}})],O.prototype,"travelMode",void 0),t([i({type:Boolean,json:{write:!0}})],O.prototype,"useHierarchy",void 0),O=P=t([l("esri.rest.support.ClosestFacilityParameters")],O);const S=O;export{S 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.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../../chunks/tslib.es6.js";import t from"../../Graphic.js";import o from"../../PopupTemplate.js";import i from"../../core/Clonable.js";import r from"../../core/JSONSupport.js";import{property as s}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{subclass as p}from"../../core/accessorSupport/decorators/subclass.js";import n from"../../geometry/Polyline.js";import{directionLineTypeJsonMap as l}from"./networkEnums.js";import{symbolTypes as a}from"../../symbols/support/typeUtils.js";var u;let
|
|
5
|
+
import{_ as e}from"../../chunks/tslib.es6.js";import t from"../../Graphic.js";import o from"../../PopupTemplate.js";import i from"../../core/Clonable.js";import r from"../../core/JSONSupport.js";import{property as s}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{subclass as p}from"../../core/accessorSupport/decorators/subclass.js";import n from"../../geometry/Polyline.js";import{directionLineTypeJsonMap as l}from"./networkEnums.js";import{symbolTypes as a}from"../../symbols/support/typeUtils.js";var u;let c=class extends(i.ClonableMixin(r)){static{u=this}constructor(e){super(e),this.directionLineType=null,this.directionPointId=null,this.distance=null,this.duration=null,this.fromLevel=null,this.geometry=null,this.objectId=null,this.popupTemplate=null,this.symbol=null,this.toLevel=null,this.type="direction-line"}static{this.fields=[{name:"ObjectID",alias:"ObjectID",type:"esriFieldTypeOID"},{name:"DirectionLineType",alias:"Line Type",type:"esriFieldTypeInteger"},{name:"DirectionPointID",alias:"Direction Point ID",type:"esriFieldTypeInteger"},{name:"FromLevel",alias:"From Level",type:"esriFieldTypeInteger"},{name:"Meters",alias:"Meters",type:"esriFieldTypeDouble"},{name:"Minutes",alias:"Minutes",type:"esriFieldTypeDouble"},{name:"ToLevel",alias:"To Level",type:"esriFieldTypeInteger"}]}static fromGraphic(e){return new u({directionLineType:l.fromJSON(e.attributes.DirectionLineType),directionPointId:e.attributes.DirectionPointID,distance:e.attributes.Meters,duration:e.attributes.Minutes,fromLevel:e.attributes.FromLevel??null,geometry:e.geometry,objectId:e.attributes.ObjectID??e.attributes.__OBJECTID,popupTemplate:e.popupTemplate,symbol:e.symbol,toLevel:e.attributes.ToLevel??null})}toGraphic(){const e={ObjectID:this.objectId,DirectionLineType:null!=this.directionLineType?l.toJSON(this.directionLineType):null,DirectionPointID:this.directionPointId,Meters:this.distance,Minutes:this.duration};return null!=this.fromLevel&&(e.FromLevel=this.fromLevel),null!=this.toLevel&&(e.ToLevel=this.toLevel),new t({geometry:this.geometry,attributes:e,symbol:this.symbol,popupTemplate:this.popupTemplate})}};e([s({type:l.apiValues,json:{read:{source:"attributes.DirectionLineType",reader:l.read}}})],c.prototype,"directionLineType",void 0),e([s({json:{read:{source:"attributes.DirectionPointID"}}})],c.prototype,"directionPointId",void 0),e([s({json:{read:{source:"attributes.Meters"}}})],c.prototype,"distance",void 0),e([s({json:{read:{source:"attributes.Minutes"}}})],c.prototype,"duration",void 0),e([s({json:{read:{source:"attributes.FromLevel"}}})],c.prototype,"fromLevel",void 0),e([s({type:n})],c.prototype,"geometry",void 0),e([s({json:{read:{source:"attributes.ObjectID"}}})],c.prototype,"objectId",void 0),e([s({type:o})],c.prototype,"popupTemplate",void 0),e([s({types:a})],c.prototype,"symbol",void 0),e([s({json:{read:{source:"attributes.ToLevel"}}})],c.prototype,"toLevel",void 0),e([s({readOnly:!0,json:{read:!1}})],c.prototype,"type",void 0),c=u=e([p("esri.rest.support.DirectionLine")],c);const m=c;export{m 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.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../../chunks/tslib.es6.js";import t from"../../Graphic.js";import i from"../../PopupTemplate.js";import r from"../../core/Clonable.js";import a from"../../core/JSONSupport.js";import{property as s}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{reader as o}from"../../core/accessorSupport/decorators/reader.js";import{subclass as n}from"../../core/accessorSupport/decorators/subclass.js";import l from"../../geometry/Point.js";import{directionPointTypeJsonMap as p}from"./networkEnums.js";import{symbolTypes as u}from"../../symbols/support/typeUtils.js";var m;let c=
|
|
5
|
+
import{_ as e}from"../../chunks/tslib.es6.js";import t from"../../Graphic.js";import i from"../../PopupTemplate.js";import r from"../../core/Clonable.js";import a from"../../core/JSONSupport.js";import{property as s}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{reader as o}from"../../core/accessorSupport/decorators/reader.js";import{subclass as n}from"../../core/accessorSupport/decorators/subclass.js";import l from"../../geometry/Point.js";import{directionPointTypeJsonMap as p}from"./networkEnums.js";import{symbolTypes as u}from"../../symbols/support/typeUtils.js";var m;let c=class extends(r.ClonableMixin(a)){static{m=this}constructor(e){super(e),this.alternateName=null,this.arrivalTime=null,this.arrivalTimeOffset=null,this.azimuth=null,this.branchName=null,this.directionPointType=null,this.displayText=null,this.exitName=null,this.geometry=null,this.intersectingName=null,this.level=null,this.name=null,this.objectId=null,this.popupTemplate=null,this.sequence=null,this.shortVoiceInstruction=null,this.stopId=null,this.symbol=null,this.towardName=null,this.type="direction-point",this.voiceInstruction=null}readArrivalTime(e,t){return null!=t.attributes.ArrivalTime?new Date(t.attributes.ArrivalTime):null}static{this.fields=[{name:"ObjectID",alias:"ObjectID",type:"esriFieldTypeOID"},{name:"AlternateName",alias:"Alternative Name",type:"esriFieldTypeString"},{name:"ArrivalTime",alias:"Arrival Time",type:"esriFieldTypeDate"},{name:"ArrivalUTCOffset",alias:"Arrival Time Offset",type:"esriFieldTypeInteger"},{name:"Azimuth",alias:"Azimuth",type:"esriFieldTypeDouble"},{name:"BranchName",alias:"Branch Name",type:"esriFieldTypeString"},{name:"DirectionPointType",alias:"Directions Point Type",type:"esriFieldTypeInteger"},{name:"DisplayText",alias:"Display Text",type:"esriFieldTypeString"},{name:"ExitName",alias:"Exit Name",type:"esriFieldTypeString"},{name:"IntersectingName",alias:"Intersecting Name",type:"esriFieldTypeString"},{name:"Level",alias:"Level",type:"esriFieldTypeInteger"},{name:"Name",alias:"Name",type:"esriFieldTypeString"},{name:"Sequence",alias:"Sequence",type:"esriFieldTypeInteger"},{name:"ShortVoiceInstruction",alias:"Short Voice Instruction",type:"esriFieldTypeString"},{name:"StopID",alias:"Stop ID",type:"esriFieldTypeInteger"},{name:"TowardName",alias:"Toward Name",type:"esriFieldTypeString"},{name:"VoiceInstruction",alias:"Voice Instruction",type:"esriFieldTypeString"}]}static fromGraphic(e){return new m({alternateName:e.attributes.AlternateName??null,arrivalTime:null!=e.attributes.ArrivalTime?new Date(e.attributes.ArrivalTime):null,arrivalTimeOffset:e.attributes.ArrivalUTCOffset??null,azimuth:e.attributes.Azimuth??null,branchName:e.attributes.BranchName??null,directionPointType:p.fromJSON(e.attributes.DirectionPointType),displayText:e.attributes.DisplayText??null,exitName:e.attributes.ExitName??null,geometry:e.geometry,intersectingName:e.attributes.IntersectingName??null,level:e.attributes.Level??null,name:e.attributes.Name??null,objectId:e.attributes.ObjectID??e.attributes.__OBJECTID,popupTemplate:e.popupTemplate,sequence:e.attributes.Sequence,shortVoiceInstruction:e.attributes.ShortVoiceInstruction??null,stopId:e.attributes.StopID??null,symbol:e.symbol,towardName:e.attributes.TowardName??null,voiceInstruction:e.attributes.VoiceInstruction??null})}toGraphic(){const e={ObjectID:this.objectId,DirectionPointType:null!=this.directionPointType?p.toJSON(this.directionPointType):null,Sequence:this.sequence,StopID:this.stopId};return null!=this.alternateName&&(e.AlternateName=this.alternateName),null!=this.arrivalTime&&(e.ArrivalTime=this.arrivalTime.getTime()),null!=this.arrivalTimeOffset&&(e.ArrivalUTCOffset=this.arrivalTimeOffset),null!=this.azimuth&&(e.Azimuth=this.azimuth),null!=this.branchName&&(e.BranchName=this.branchName),null!=this.displayText&&(e.DisplayText=this.displayText),null!=this.exitName&&(e.ExitName=this.exitName),null!=this.intersectingName&&(e.IntersectingName=this.intersectingName),null!=this.level&&(e.Level=this.level),null!=this.name&&(e.Name=this.name),null!=this.shortVoiceInstruction&&(e.ShortVoiceInstruction=this.shortVoiceInstruction),null!=this.towardName&&(e.TowardName=this.towardName),null!=this.voiceInstruction&&(e.VoiceInstruction=this.voiceInstruction),new t({geometry:this.geometry,attributes:e,symbol:this.symbol,popupTemplate:this.popupTemplate})}};e([s({json:{read:{source:"attributes.AlternateName"}}})],c.prototype,"alternateName",void 0),e([s({type:Date})],c.prototype,"arrivalTime",void 0),e([o("arrivalTime",["attributes.ArrivalTime"])],c.prototype,"readArrivalTime",null),e([s({json:{read:{source:"attributes.ArrivalUTCOffset"}}})],c.prototype,"arrivalTimeOffset",void 0),e([s({json:{read:{source:"attributes.Azimuth"}}})],c.prototype,"azimuth",void 0),e([s({json:{read:{source:"attributes.BranchName"}}})],c.prototype,"branchName",void 0),e([s({type:p.apiValues,json:{read:{source:"attributes.DirectionPointType",reader:p.read}}})],c.prototype,"directionPointType",void 0),e([s({json:{read:{source:"attributes.DisplayText"}}})],c.prototype,"displayText",void 0),e([s({json:{read:{source:"attributes.ExitName"}}})],c.prototype,"exitName",void 0),e([s({type:l})],c.prototype,"geometry",void 0),e([s({json:{read:{source:"attributes.IntersectingName"}}})],c.prototype,"intersectingName",void 0),e([s({json:{read:{source:"attributes.Level"}}})],c.prototype,"level",void 0),e([s({json:{read:{source:"attributes.Name"}}})],c.prototype,"name",void 0),e([s({json:{read:{source:"attributes.ObjectID"}}})],c.prototype,"objectId",void 0),e([s({type:i})],c.prototype,"popupTemplate",void 0),e([s({json:{read:{source:"attributes.Sequence"}}})],c.prototype,"sequence",void 0),e([s({json:{read:{source:"attributes.ShortVoiceInstruction"}}})],c.prototype,"shortVoiceInstruction",void 0),e([s({json:{read:{source:"attributes.StopID"}}})],c.prototype,"stopId",void 0),e([s({types:u})],c.prototype,"symbol",void 0),e([s({json:{read:{source:"attributes.TowardName"}}})],c.prototype,"towardName",void 0),e([s({readOnly:!0,json:{read:!1}})],c.prototype,"type",void 0),e([s({json:{read:{source:"attributes.VoiceInstruction"}}})],c.prototype,"voiceInstruction",void 0),c=m=e([n("esri.rest.support.DirectionPoint")],c);const y=c;export{y as default};
|
package/rest/support/JobInfo.js
CHANGED
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../../chunks/tslib.es6.js";import o from"../../request.js";import"../../core/has.js";import{strict as t}from"../../core/jsonMap.js";import s from"../../core/JSONSupport.js";import{onAbort as r,createAbortError as i}from"../../core/promiseUtils.js";import{property as a}from"../../core/accessorSupport/decorators/property.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{enumeration as c}from"../../core/accessorSupport/decorators/enumeration.js";import{subclass as n}from"../../core/accessorSupport/decorators/subclass.js";import{parseUrl as l}from"../utils.js";import u from"../geoprocessor/GPOptions.js";import{gpEncode as b,decode as m}from"../geoprocessor/utils.js";import j from"./GPMessage.js";var p;const
|
|
5
|
+
import{_ as e}from"../../chunks/tslib.es6.js";import o from"../../request.js";import"../../core/has.js";import{strict as t}from"../../core/jsonMap.js";import s from"../../core/JSONSupport.js";import{onAbort as r,createAbortError as i}from"../../core/promiseUtils.js";import{property as a}from"../../core/accessorSupport/decorators/property.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{enumeration as c}from"../../core/accessorSupport/decorators/enumeration.js";import{subclass as n}from"../../core/accessorSupport/decorators/subclass.js";import{parseUrl as l}from"../utils.js";import u from"../geoprocessor/GPOptions.js";import{gpEncode as b,decode as m}from"../geoprocessor/utils.js";import j from"./GPMessage.js";var p;const h=t()({esriJobCancelled:"job-cancelled",esriJobCancelling:"job-cancelling",esriJobDeleted:"job-deleted",esriJobDeleting:"job-deleting",esriJobTimedOut:"job-timed-out",esriJobExecuting:"job-executing",esriJobFailed:"job-failed",esriJobNew:"job-new",esriJobSubmitted:"job-submitted",esriJobSucceeded:"job-succeeded",esriJobWaiting:"job-waiting"},{ignoreUnknown:!1}),d=1e3;let g=class extends s{static{p=this}constructor(e){super(e),this.jobId=null,this.jobStatus=null,this.messages=null,this.progress=null,this.requestOptions=null,this.sourceUrl=null,this._cancelJobTimer=void 0,this._jobCompletionTimer=void 0}async cancelJob(e){const{jobId:t,sourceUrl:s}=this,{path:a}=l(s),c={...this.requestOptions,...e,query:{f:"json"}},n=`${a}/jobs/${t}/cancel`,{data:u}=await o(n,c),{messages:b,jobStatus:m,progress:j}=p.fromJSON(u);return this.set({messages:b,jobStatus:m,progress:j}),"job-cancelled"===m?this:new Promise(((o,t)=>{r(c.signal,(()=>{this.clearCancelJobTimer(),t(i())})),this.clearCancelJobTimer();const s=()=>{this._cancelJobTimer||t(i()),this.checkJobStatus(e).then((({jobStatus:e})=>{switch(e){case"job-cancelling":default:this._cancelJobTimer=setTimeout(s,d);break;case"job-deleted":case"job-deleting":case"job-executing":case"job-failed":case"job-new":case"job-submitted":case"job-succeeded":case"job-timed-out":case"job-waiting":t(this);break;case"job-cancelled":o(this)}}))};this._cancelJobTimer=setTimeout(s,d)}))}destroy(){clearInterval(this._cancelJobTimer),clearInterval(this._jobCompletionTimer)}async checkJobStatus(e){const{path:t}=l(this.sourceUrl),s={...this.requestOptions,...e,query:{f:"json"}},r=`${t}/jobs/${this.jobId}`,{data:i}=await o(r,s),{messages:a,jobStatus:c,progress:n}=p.fromJSON(i);return this.set({messages:a,jobStatus:c,progress:n}),this}async fetchResultData(e,t,s){t=u.from(t||{});const{returnColumnName:r,returnFeatureCollection:i,returnM:a,returnZ:c,outSpatialReference:n}=t,{path:j}=l(this.sourceUrl),p=b({returnColumnName:r||null,returnFeatureCollection:i||null,returnM:a||null,returnZ:c||null,outSR:n,returnType:"data",f:"json"},null),h={...this.requestOptions,...s,query:p},d=`${j}/jobs/${this.jobId}/results/${e}`,{data:g}=await o(d,h);return m(g)}async fetchResultImage(e,t,s){const{path:r}=l(this.sourceUrl),i={...t.toJSON(),f:"json"},a=b(i),c={...this.requestOptions,...s,query:a},n=`${r}/jobs/${this.jobId}/results/${e}`,{data:u}=await o(n,c);return m(u)}async fetchResultMapImageLayer(){const{path:e}=l(this.sourceUrl),o=e.indexOf("/GPServer/"),t=`${e.slice(0,Math.max(0,o))}/MapServer/jobs/${this.jobId}`;return new(0,(await import("../../layers/MapImageLayer.js")).default)({url:t})}async waitForJobCompletion(e={}){const{interval:o=d,signal:t,statusCallback:s}=e;return new Promise(((e,a)=>{r(t,(()=>{this.clearJobCompletionTimer(),a(i())})),this.clearJobCompletionTimer();const c=()=>{this._jobCompletionTimer||a(i()),this.checkJobStatus().then((({jobStatus:t})=>{switch(t){case"job-succeeded":e(this);break;case"job-executing":case"job-new":case"job-submitted":case"job-waiting":s&&s(this),this._jobCompletionTimer=setTimeout(c,o);break;case"job-cancelled":case"job-cancelling":case"job-deleted":case"job-deleting":case"job-failed":case"job-timed-out":a(this);break;default:this._jobCompletionTimer=setTimeout(c,o)}})).catch((e=>{a(e)}))};this._jobCompletionTimer=setTimeout(c,o)}))}clearCancelJobTimer(){clearTimeout(this._cancelJobTimer),this._cancelJobTimer=void 0}clearJobCompletionTimer(){clearTimeout(this._jobCompletionTimer),this._jobCompletionTimer=void 0}};e([a()],g.prototype,"jobId",void 0),e([c(h,{ignoreUnknown:!1})],g.prototype,"jobStatus",void 0),e([a({type:[j]})],g.prototype,"messages",void 0),e([a()],g.prototype,"progress",void 0),e([a()],g.prototype,"requestOptions",void 0),e([a({json:{write:!0}})],g.prototype,"sourceUrl",void 0),g=p=e([n("esri.rest.support.JobInfo")],g);const J=g;export{J 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.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as
|
|
5
|
+
import{_ as t}from"../../chunks/tslib.es6.js";import{property as e}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{subclass as o}from"../../core/accessorSupport/decorators/subclass.js";import r from"./FeatureSet.js";var s;let c=class extends r{static{s=this}constructor(t){super(t),this.doNotLocateOnRestrictedElements=null}clone(){return new s({doNotLocateOnRestrictedElements:this.doNotLocateOnRestrictedElements,...this.cloneProperties()})}};t([e({type:Boolean,json:{write:!0}})],c.prototype,"doNotLocateOnRestrictedElements",void 0),c=s=t([o("esri.rest.support.NetworkFeatureSet")],c);const i=c;export{i as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as t}from"../../chunks/tslib.es6.js";import e from"../../Graphic.js";import r from"../../PopupTemplate.js";import s from"../../core/Clonable.js";import o from"../../core/JSONSupport.js";import{property as
|
|
5
|
+
import{_ as t}from"../../chunks/tslib.es6.js";import e from"../../Graphic.js";import r from"../../PopupTemplate.js";import s from"../../core/Clonable.js";import o from"../../core/JSONSupport.js";import{property as i}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{reader as a}from"../../core/accessorSupport/decorators/reader.js";import{subclass as p}from"../../core/accessorSupport/decorators/subclass.js";import{writer as l}from"../../core/accessorSupport/decorators/writer.js";import u from"../../geometry/Point.js";import{getPrefixedProperties as d,setPrefixedProperties as n,toKebabImpedanceAttributes as c,fromKebabImpedanceAttributes as m}from"../route/utils.js";import{barrierTypeJsonMap as y,curbApproachJsonMap as b,fullEdgeJsonMap as h,statusJsonMap as j,sideOfEdgeJsonMap as g}from"./networkEnums.js";import{symbolTypes as f}from"../../symbols/support/typeUtils.js";var C;let S=class extends(s.ClonableMixin(o)){static{C=this}constructor(t){super(t),this.addedCost=null,this.barrierType=null,this.costs=null,this.curbApproach=null,this.fullEdge=null,this.geometry=null,this.name=null,this.objectId=null,this.popupTemplate=null,this.sideOfEdge=null,this.sourceId=null,this.sourceOid=null,this.status=null,this.symbol=null,this.type="point-barrier"}readCosts(t,e){return d(e.attributes,"Attr_")}writeCosts(t,e){n(t,e,"Attr_")}static{this.fields=[{name:"ObjectID",alias:"ObjectID",type:"esriFieldTypeOID"},{name:"AddedCost",alias:"Added Cost",type:"esriFieldTypeDouble"},{name:"BarrierType",alias:"Barrier Type",type:"esriFieldTypeInteger"},{name:"Costs",alias:"Costs",type:"esriFieldTypeString"},{name:"CurbApproach",alias:"Curb Approach",type:"esriFieldTypeInteger"},{name:"FullEdge",alias:"Full Edge",type:"esriFieldTypeInteger"},{name:"Name",alias:"Name",type:"esriFieldTypeString"},{name:"Status",alias:"Status",type:"esriFieldTypeInteger"}]}static fromGraphic(t){return new C({addedCost:t.attributes.AddedCost??null,barrierType:null!=t.attributes.BarrierType?y.fromJSON(t.attributes.BarrierType):null,costs:null!=t.attributes.Costs?c(JSON.parse(t.attributes.Costs)):null,curbApproach:null!=t.attributes.CurbApproach?b.fromJSON(t.attributes.CurbApproach):null,fullEdge:null!=t.attributes.FullEdge?h.fromJSON(t.attributes.FullEdge):null,geometry:t.geometry,name:t.attributes.Name??null,objectId:t.attributes.ObjectID??t.attributes.__OBJECTID,popupTemplate:t.popupTemplate,status:null!=t.attributes.Status?j.fromJSON(t.attributes.Status):null,symbol:t.symbol})}toGraphic(){const t={ObjectID:this.objectId,AddedCost:this.addedCost,BarrierType:null!=this.barrierType?y.toJSON(this.barrierType):null,Costs:null!=this.costs?JSON.stringify(m(this.costs)):null,CurbApproach:null!=this.curbApproach?b.toJSON(this.curbApproach):null,FullEdge:null!=this.fullEdge?h.toJSON(this.fullEdge):null,Name:this.name,Status:null!=this.status?j.toJSON(this.status):null};return new e({geometry:this.geometry,attributes:t,symbol:this.symbol,popupTemplate:this.popupTemplate})}};t([i()],S.prototype,"addedCost",void 0),t([i({type:y.apiValues,json:{name:"attributes.BarrierType",read:{reader:y.read},write:{writer:y.write}}})],S.prototype,"barrierType",void 0),t([i()],S.prototype,"costs",void 0),t([a("costs",["attributes"])],S.prototype,"readCosts",null),t([l("costs")],S.prototype,"writeCosts",null),t([i({constructOnly:!0,type:b.apiValues,json:{read:{source:"attributes.CurbApproach",reader:b.read}}})],S.prototype,"curbApproach",void 0),t([i({type:h.apiValues,json:{name:"attributes.FullEdge",read:{reader:h.read},write:{writer:h.write}}})],S.prototype,"fullEdge",void 0),t([i({type:u,json:{write:!0}})],S.prototype,"geometry",void 0),t([i({json:{name:"attributes.Name"}})],S.prototype,"name",void 0),t([i({json:{name:"attributes.ObjectID"}})],S.prototype,"objectId",void 0),t([i({type:r})],S.prototype,"popupTemplate",void 0),t([i({type:g.apiValues,json:{read:{source:"attributes.SideOfEdge",reader:g.read}}})],S.prototype,"sideOfEdge",void 0),t([i({json:{read:{source:"attributes.SourceID"}}})],S.prototype,"sourceId",void 0),t([i({json:{read:{source:"attributes.SourceOID"}}})],S.prototype,"sourceOid",void 0),t([i({type:j.apiValues,json:{read:{source:"attributes.Status",reader:j.read}}})],S.prototype,"status",void 0),t([i({types:f})],S.prototype,"symbol",void 0),t([i({readOnly:!0,json:{read:!1}})],S.prototype,"type",void 0),S=C=t([p("esri.rest.support.PointBarrier")],S);const T=S;export{T as default};
|