@arcgis/core 4.25.0-next.20220711 → 4.25.0-next.20220714
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/TimeExtent.js +1 -1
- package/WebMap.js +1 -1
- package/WebScene.js +1 -1
- package/arcade/featureset/sources/FeatureLayerRelated.js +1 -1
- package/arcade/featureset/support/Guid.js +1 -1
- package/arcade/featureset/support/RecentlyUsedCache.js +1 -1
- package/arcade/functions/hash.js +1 -1
- package/arcade/lib/scanner.js +1 -1
- package/assets/components/assets/date-picker/nls/th.json +1 -1
- package/assets/components/assets/icon/changeDetection16.json +1 -0
- package/assets/components/assets/icon/changeDetection24.json +1 -0
- package/assets/components/assets/icon/changeDetection32.json +1 -0
- package/assets/components/assets/icon/imageDisplayOrder16.json +1 -0
- package/assets/components/assets/icon/imageDisplayOrder24.json +1 -0
- package/assets/components/assets/icon/imageDisplayOrder32.json +1 -0
- package/assets/components/assets/icon/numberCircle416.json +1 -0
- package/assets/components/assets/icon/numberCircle424.json +1 -0
- package/assets/components/assets/icon/numberCircle432.json +1 -0
- package/assets/components/assets/icon/numberCircle516.json +1 -0
- package/assets/components/assets/icon/numberCircle524.json +1 -0
- package/assets/components/assets/icon/numberCircle532.json +1 -0
- package/assets/components/assets/icon/numberCircle616.json +1 -0
- package/assets/components/assets/icon/numberCircle624.json +1 -0
- package/assets/components/assets/icon/numberCircle632.json +1 -0
- package/assets/components/assets/icon/numberCircle716.json +1 -0
- package/assets/components/assets/icon/numberCircle724.json +1 -0
- package/assets/components/assets/icon/numberCircle732.json +1 -0
- package/assets/components/assets/icon/numberCircle816.json +1 -0
- package/assets/components/assets/icon/numberCircle824.json +1 -0
- package/assets/components/assets/icon/numberCircle832.json +1 -0
- package/assets/components/assets/icon/numberCircle916.json +1 -0
- package/assets/components/assets/icon/numberCircle924.json +1 -0
- package/assets/components/assets/icon/numberCircle932.json +1 -0
- package/assets/components/assets/icon/showMultipleLayersAtATime16.json +1 -0
- package/assets/components/assets/icon/showMultipleLayersAtATime24.json +1 -0
- package/assets/components/assets/icon/showMultipleLayersAtATime32.json +1 -0
- package/assets/components/assets/icon/showOneLayerAtATime16.json +1 -0
- package/assets/components/assets/icon/showOneLayerAtATime24.json +1 -0
- package/assets/components/assets/icon/showOneLayerAtATime32.json +1 -0
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/0543424b0e2a388644b0.js +1 -0
- package/assets/esri/core/workers/chunks/18f176c7de71a3a7247f.js +1 -0
- package/assets/esri/core/workers/chunks/196e61d9fc80b0bfd0f2.js +1 -0
- package/assets/esri/core/workers/chunks/1b3733100b9fa41905d0.js +1 -0
- package/assets/esri/core/workers/chunks/2560bb8b4c73ea7d41d3.js +1 -0
- package/assets/esri/core/workers/chunks/28124f12fd4ca3f5f07e.js +1 -0
- package/assets/esri/core/workers/chunks/2f60073d3f14fdfba457.js +1 -0
- package/assets/esri/core/workers/chunks/3538bb8545bdf1fe644f.js +1 -0
- package/assets/esri/core/workers/chunks/35f3f714d6faa88b0c0c.js +1 -0
- package/assets/esri/core/workers/chunks/3fcb0d2c45e276ce355e.js +1 -0
- package/assets/esri/core/workers/chunks/3ff904b02414884d0ed6.js +1 -0
- package/assets/esri/core/workers/chunks/40032d2bf404a46b8f80.js +1 -0
- package/assets/esri/core/workers/chunks/{c3459e4b453289f57c2f.js → 405b8535631c30162b01.js} +1 -1
- package/assets/esri/core/workers/chunks/{591a22aaf068a6e0aabb.js → 4ba51f56f9b82aa616ff.js} +1 -1
- package/assets/esri/core/workers/chunks/51dc5863b815a89249ff.js +1 -0
- package/assets/esri/core/workers/chunks/{95cb9cd08941c28ebd85.js → 5821d3a6499d8e84f48a.js} +1 -1
- package/assets/esri/core/workers/chunks/5c81523410359692e633.js +1 -0
- package/assets/esri/core/workers/chunks/6046ed32c45607afbec3.js +1 -0
- package/assets/esri/core/workers/chunks/613fffcc5a1e81f370a6.js +1 -0
- package/assets/esri/core/workers/chunks/61ddd479abf2c97dd408.js +1 -0
- package/assets/esri/core/workers/chunks/698eaae866cf97a56541.js +1 -0
- package/assets/esri/core/workers/chunks/{ecb8d864dd00de322657.js → 6ac72a91978acc0372a3.js} +1 -1
- package/assets/esri/core/workers/chunks/733f6ac0f92f29bf552a.js +1 -0
- package/assets/esri/core/workers/chunks/{35dfba25a9077ab5dbaf.js → 812f929305f8941886d3.js} +2 -2
- package/assets/esri/core/workers/chunks/84790eacac4fe2be1d1a.js +1 -0
- package/assets/esri/core/workers/chunks/88ddf8c15e2398bc5606.js +1 -0
- package/assets/esri/core/workers/chunks/{357a27203f5d8fa152de.js → 8b94a400a04e7a803dc4.js} +1 -1
- package/assets/esri/core/workers/chunks/9ed019174aaf9e3feb61.js +1 -0
- package/assets/esri/core/workers/chunks/ab3bd5fecdb97f2d690e.js +1 -0
- package/assets/esri/core/workers/chunks/abd68b7ba3be4696611c.js +1 -0
- package/assets/esri/core/workers/chunks/{fb97361a09b39a8a0483.js → afb74623cce5dfd0e4de.js} +1 -1
- package/assets/esri/core/workers/chunks/b81c0d35f169a7df25c0.js +1 -0
- package/assets/esri/core/workers/chunks/b8f0a78cdcb1077fa96b.js +1 -0
- package/assets/esri/core/workers/chunks/c3c05fd41d88d6ab013b.js +1 -0
- package/assets/esri/core/workers/chunks/c4db05de1cd997ee2fac.js +1 -0
- package/assets/esri/core/workers/chunks/{d00b0f8236f1526099d4.js → c912ae9afa1997a6e1bb.js} +1 -1
- package/assets/esri/core/workers/chunks/e08686088be0aaca1a99.js +1 -0
- package/assets/esri/core/workers/chunks/e1d8627d8e241249e3b5.js +1 -0
- package/assets/esri/core/workers/chunks/f6df87d05eff63c45481.js +1 -0
- package/assets/esri/core/workers/chunks/f82d86013c68374822c8.js +1 -0
- package/assets/esri/core/workers/chunks/f96e8724ae3458f5e262.js +1 -0
- package/assets/esri/core/workers/chunks/{f6a6178d4df029ff010d.js → fc8c88ef461629881c62.js} +1 -1
- package/assets/esri/themes/base/widgets/_Daylight.scss +1 -2
- package/assets/esri/themes/dark/main.css +1 -1
- package/assets/esri/themes/light/main.css +1 -1
- package/assets/esri/themes/light/view.css +1 -1
- package/chunks/BlendLayers.glsl.js +6 -17
- package/chunks/RasterColorizer.glsl.js +15 -27
- package/chunks/mat4.js +1 -1
- package/core/AsyncSequence.js +1 -1
- package/core/AsyncUpdate.js +1 -1
- package/core/arrayUtils.js +1 -1
- package/core/jsonMap.js +1 -1
- package/core/libs/rbush/PooledRBush.js +1 -1
- package/core/number.js +1 -1
- package/core/quantityUtils.js +1 -1
- package/core/sql/WhereClause.js +1 -1
- package/core/support/WatchUpdatingTracking.js +1 -1
- package/core/workers/Connection.js +1 -1
- package/core/workers/RemoteClient.js +1 -1
- package/core/workers/loaderConfig.js +1 -1
- package/geometry/support/axisAngle.js +1 -1
- package/geometry/support/buffer/types.js +1 -1
- package/geometry/support/meshUtils/exporters/gltf/buffer.js +1 -1
- package/geometry/support/meshUtils/exporters/gltf/bufferview.js +1 -1
- package/geometry/support/meshUtils/exporters/gltf/glb.js +1 -1
- package/geometry/support/meshUtils/exporters/gltf/gltf.js +1 -1
- package/geometry/support/normalizeUtilsSync.js +1 -1
- package/identity/IdentityManagerBase.js +1 -1
- package/interfaces.d.ts +2 -2
- package/layers/BuildingSceneLayer.js +1 -1
- package/layers/graphics/controllers/FeatureTileController3D.js +1 -1
- package/layers/graphics/sources/geojson/GeoJSONSourceWorker.js +1 -1
- package/layers/graphics/sources/support/CSVSourceWorker.js +1 -1
- package/layers/mixins/ArcGISImageService.js +1 -1
- package/layers/support/AggregateField.js +1 -1
- package/layers/support/ElevationQuery.js +1 -1
- package/layers/support/ElevationSampler.js +1 -1
- package/layers/support/ElevationTile.js +1 -1
- package/layers/support/FetchAssociatedFeatureLayer.js +1 -1
- package/layers/support/LayerContingentValuesCache.js +1 -1
- package/layers/support/rasterFormats/ImageCanvasDecoder.js +1 -1
- package/package.json +3 -3
- package/renderers/HeatmapRenderer.js +1 -1
- package/rest/query/operations/pbfDehydratedFeatureSet.js +1 -1
- package/rest/query/operations/pbfJSONFeatureSet.js +1 -1
- package/support/revision.js +1 -1
- package/symbols/cim/CIMSymbolDrawHelper.js +1 -1
- package/symbols/cim/TextRasterizer.js +1 -1
- package/views/2d/engine/imagery/BrushRasterBitmap.js +1 -1
- package/views/2d/engine/imagery/BrushVectorField.js +1 -1
- package/views/2d/engine/vectorTiles/RenderBucket.js +1 -1
- package/views/2d/engine/vectorTiles/VectorTileContainer.js +1 -1
- package/views/2d/engine/vectorTiles/expression/expression.js +1 -1
- package/views/2d/engine/webgl/GraphicDisplayList.js +1 -1
- package/views/2d/engine/webgl/Painter.js +1 -1
- package/views/2d/engine/webgl/TileClipper.js +1 -1
- package/views/2d/engine/webgl/TurboLine.js +1 -1
- package/views/2d/engine/webgl/brushes/BrushBitmap.js +1 -1
- package/views/2d/engine/webgl/brushes/WGLBrush.js +1 -1
- package/views/2d/engine/webgl/brushes/WGLBrushHeatmap.js +1 -1
- package/views/2d/engine/webgl/brushes/WGLBrushStencil.js +1 -1
- package/views/2d/engine/webgl/brushes/WGLGeometryBrush.js +1 -1
- package/views/2d/engine/webgl/effects/highlight/HighlightGradient.js +1 -1
- package/views/2d/engine/webgl/mesh/templates/WGLBaseMarkerTemplate.js +1 -1
- package/views/2d/engine/webgl/mesh/templates/WGLLabelTemplate.js +1 -1
- package/views/2d/engine/webgl/painter/RenderPass.js +1 -1
- package/views/2d/engine/webgl/shaders/sources/shaderRepository.js +1 -1
- package/views/2d/engine/webgl/util/Lock.js +1 -1
- package/views/2d/input/MapViewInputManager.js +1 -1
- package/views/2d/input/handlers/DragPan.js +1 -1
- package/views/2d/input/handlers/DragRotate.js +1 -1
- package/views/2d/input/handlers/GamepadNavigation.js +1 -1
- package/views/2d/input/handlers/PinchAction.js +1 -1
- package/views/2d/layers/BaseDynamicLayerView2D.js +1 -1
- package/views/2d/layers/features/processors/SymbolProcessor.js +1 -1
- package/views/2d/layers/features/tileRenderers/support/WGLFeatureView.js +1 -1
- package/views/2d/layers/support/FeatureLayerProxy.js +1 -1
- package/views/2d/navigation/actions/Pan.js +1 -1
- package/views/3d/analysis/Slice/SliceTool.js +1 -1
- package/views/3d/camera/constraintUtils.js +1 -1
- package/views/3d/environment/SimpleAtmosphere.js +1 -1
- package/views/3d/glTF/internal/BinaryStreamReader.js +1 -1
- package/views/3d/glTF/internal/Resource.js +1 -1
- package/views/3d/input/SceneInputManager.js +1 -1
- package/views/3d/input/handlers/DragRotate.js +1 -1
- package/views/3d/input/handlers/DragZoom.js +1 -1
- package/views/3d/input/handlers/PinchAndPanNavigation.js +1 -1
- package/views/3d/interactive/Manipulator3D.js +1 -1
- package/views/3d/interactive/editingTools/snapping/SnapToScene.js +1 -1
- package/views/3d/interactive/editingTools/transformGraphic/ExtentTransformTool.js +1 -1
- package/views/3d/interactive/editingTools/transformGraphic/GraphicScaleRotateTransform.js +1 -1
- package/views/3d/interactive/editingTools/transformGraphic/PreserveAspectRatio.js +1 -1
- package/views/3d/interactive/editingTools/transformGraphic/ScaleRotateMeshAdapter.js +1 -1
- package/views/3d/interactive/editingTools/transformGraphic/ScaleRotateObjectSymbol3DAdapter.js +1 -1
- package/views/3d/interactive/measurementTools/directLineMeasurement3D/DirectLineMeasurement3DView.js +1 -1
- package/views/3d/interactive/visualElements/LaserlineVisualElement.js +1 -1
- package/views/3d/interactive/visualElements/OutlineVisualElement.js +1 -1
- package/views/3d/interactive/visualElements/PointVisualElement.js +1 -1
- package/views/3d/interactive/visualElements/VerticesVisualElement.js +1 -1
- package/views/3d/layers/BuildingSceneLayerView3D.js +1 -1
- package/views/3d/layers/FeatureLayerViewBase3D.js +1 -1
- package/views/3d/layers/FeatureLikeLayerView3D.js +1 -1
- package/views/3d/layers/GraphicsLayerView3D.js +1 -1
- package/views/3d/layers/GraphicsView3D.js +1 -1
- package/views/3d/layers/I3SMeshView3D.js +1 -1
- package/views/3d/layers/I3SMeshViewLabeler.js +1 -1
- package/views/3d/layers/RouteLayerView3D.js +1 -1
- package/views/3d/layers/SceneLayerGraphicsView3D.js +1 -1
- package/views/3d/layers/SceneLayerView3D.js +1 -1
- package/views/3d/layers/graphics/Deconflictor.js +1 -1
- package/views/3d/layers/graphics/Graphics3DCore.js +1 -1
- package/views/3d/layers/graphics/Graphics3DElevationAlignment.js +1 -1
- package/views/3d/layers/graphics/Graphics3DFeatureProcessor.js +1 -1
- package/views/3d/layers/graphics/Graphics3DFrustumVisibility.js +1 -1
- package/views/3d/layers/graphics/Graphics3DObjectSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DPathSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DPointSymbol.js +1 -1
- package/views/3d/layers/graphics/Graphics3DScaleVisibility.js +1 -1
- package/views/3d/layers/graphics/GraphicsProcessor.js +1 -1
- package/views/3d/layers/graphics/LabelDeconflictor.js +1 -1
- package/views/3d/layers/graphics/Labeler.js +1 -1
- package/views/3d/layers/graphics/Loadable.js +1 -1
- package/views/3d/layers/graphics/ObjectResourceCache.js +1 -1
- package/views/3d/layers/graphics/QueryEngine.js +1 -1
- package/views/3d/layers/i3s/Highlights.js +1 -1
- package/views/3d/layers/i3s/I3SAttributeOverrides.js +1 -1
- package/views/3d/layers/i3s/I3SElevationProvider.js +1 -1
- package/views/3d/layers/i3s/I3SIntersectionHandler.js +1 -1
- package/views/3d/layers/i3s/I3SQueryFeatureAdapter.js +1 -1
- package/views/3d/layers/i3s/I3SUtil.js +1 -1
- package/views/3d/layers/support/FeatureTileFetcher3D.js +1 -1
- package/views/3d/layers/support/FeatureTileFetcher3DDebugger.js +1 -1
- package/views/3d/layers/support/FeatureTileMeasurements3D.js +1 -1
- package/views/3d/layers/support/FeatureTileTree3DDebugger.js +1 -1
- package/views/3d/layers/support/FeatureVisibilityFilter.js +1 -1
- package/views/3d/layers/support/HeatmapFeatureProcessor.js +1 -1
- package/views/3d/layers/support/StageLayerElevationProvider.js +1 -1
- package/views/3d/layers/support/featureReference.js +1 -1
- package/views/3d/state/GoToOperation.js +1 -1
- package/views/3d/state/NearFarHeuristic.js +1 -1
- package/views/3d/state/SurfaceCollisionConstraint.js +1 -1
- package/views/3d/state/ViewState.js +1 -1
- package/views/3d/state/ViewStateManager.js +1 -1
- package/views/3d/state/controllers/GamepadKeyboardController.js +1 -1
- package/views/3d/state/controllers/PointToPointAnimationController.js +1 -1
- package/views/3d/state/controllers/RotateController.js +1 -1
- package/views/3d/state/controllers/SurfaceCollisionCorrectionController.js +1 -1
- package/views/3d/state/controllers/global/PinchAndPanController.js +1 -1
- package/views/3d/state/controllers/global/ZoomController.js +1 -1
- package/views/3d/state/controllers/global/ZoomStepController.js +1 -1
- package/views/3d/state/controllers/local/PinchAndPanController.js +1 -1
- package/views/3d/state/controllers/local/ZoomController.js +1 -1
- package/views/3d/state/controllers/local/ZoomStepController.js +1 -1
- package/views/3d/state/controllers/momentum/MomentumController.js +1 -1
- package/views/3d/state/controllers/momentum/PanPlanarMomentumController.js +1 -1
- package/views/3d/state/controllers/momentum/ZoomSphericalMomentumController.js +1 -1
- package/views/3d/state/helpers/SceneIntersectionHelper.js +1 -1
- package/views/3d/state/utils/navigationUtils.js +1 -1
- package/views/3d/support/AsyncWorkerQueue.js +1 -1
- package/views/3d/support/FrustumExtentIntersection.js +1 -1
- package/views/3d/support/LimitGraphicsMap.js +1 -1
- package/views/3d/support/SharedSymbolResources.js +1 -1
- package/views/3d/support/pointsOfInterest/CameraOnSurface.js +1 -1
- package/views/3d/support/pointsOfInterest/ContentGeometryUpdates.js +1 -1
- package/views/3d/support/pointsOfInterest/Focus.js +1 -1
- package/views/3d/support/pointsOfInterest/SurfaceGeometryUpdates.js +1 -1
- package/views/3d/terrain/BlendLayersTechnique.js +1 -1
- package/views/3d/terrain/OverlayFramebufferObject.js +1 -1
- package/views/3d/terrain/PatchGeometryFactory.js +1 -1
- package/views/3d/terrain/PatchRenderData.js +1 -1
- package/views/3d/terrain/PlanarPatch.js +1 -1
- package/views/3d/terrain/RasterColorizerTechnique.js +1 -1
- package/views/3d/terrain/SphericalPatch.js +1 -1
- package/views/3d/terrain/TerrainSurface.js +1 -1
- package/views/3d/terrain/TileBlendTechniqueConfiguration.js +5 -0
- package/views/3d/terrain/TileCompositor.js +1 -1
- package/views/3d/terrain/TileRenderer.js +1 -1
- package/views/3d/terrain/tileUtils.js +1 -1
- package/views/3d/webgl-engine/collections/Component/ComponentIntersectionData.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/raster/RasterColorizer.glsl.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/terrain/TileBackground.glsl.js +17 -0
- package/views/3d/webgl-engine/core/shaderLibrary/util/BlendLayers.glsl.js +1 -1
- package/views/3d/webgl-engine/core/shaderModules/ShaderBuilder.js +1 -1
- package/views/3d/webgl-engine/lib/BitSet.js +1 -1
- package/views/3d/webgl-engine/lib/GLMaterialRepository.js +1 -1
- package/views/3d/webgl-engine/lib/Highlight.js +1 -1
- package/views/3d/webgl-engine/lib/InstanceBufferData.js +1 -1
- package/views/3d/webgl-engine/lib/MagnifierHelper.js +1 -1
- package/views/3d/webgl-engine/lib/Object3DStateSet.js +1 -1
- package/views/3d/webgl-engine/lib/SSAOHelper.js +1 -1
- package/views/3d/webgl-engine/lib/ShadowMap.js +1 -1
- package/views/3d/webgl-engine/lib/TextTextureAtlas.js +1 -1
- package/views/3d/webgl-engine/lib/TextureBackedBuffer/BufferManager.js +1 -1
- package/views/3d/webgl-engine/lib/TextureBackedBuffer/ManagedTextureBackedBuffer.js +1 -1
- package/views/3d/webgl-engine/lib/depthRangeUtils.js +1 -1
- package/views/3d/webgl-engine/lib/edgeRendering/EdgeRenderer.js +1 -1
- package/views/3d/webgl-engine/lib/edgeRendering/EdgeView.js +1 -1
- package/views/3d/webgl-engine/lib/edgeRendering/edgeBufferWriters.js +1 -1
- package/views/3d/webgl-engine/lib/screenSizePerspectiveUtils.js +1 -1
- package/views/3d/webgl-engine/materials/DefaultMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/LineMarkerMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/PathMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/StippleTextureRepository.js +1 -1
- package/views/GroundView.js +1 -1
- package/views/SceneView.js +1 -1
- package/views/ToolViewManager.js +1 -1
- package/views/input/BrowserEventSource.js +1 -1
- package/views/input/InputManager.js +1 -1
- package/views/input/ViewEvents.js +1 -1
- package/views/input/recognizers/VerticalTwoFingerDrag.js +1 -1
- package/views/interactive/ToolViewManagerManipulatorState.js +1 -1
- package/views/interactive/editGeometry/EditGeometryOperations.js +1 -1
- package/views/interactive/editGeometry/operations/UndoGroup.js +1 -1
- package/views/interactive/sketch/SketchTooltipElevationOptions.js +5 -0
- package/views/interactive/sketch/SketchTooltipOptions.js +1 -1
- package/views/interactive/sketch/SketchTooltipVisibleElements.js +5 -0
- package/views/interactive/snapping/SnappingConstraint.js +1 -1
- package/views/interactive/snapping/candidates/LineSnappingCandidate.js +1 -1
- package/views/interactive/snapping/candidates/RightAngleTriangleSnappingCandidate.js +1 -1
- package/views/interactive/snapping/featureSources/FeatureServiceSnappingSource.js +1 -1
- package/views/interactive/snapping/featureSources/WorkerTileTreeDebugger.js +1 -1
- package/views/interactive/snapping/featureSources/featureServiceSource/FeatureServiceSnappingSourceWorker.js +1 -1
- package/views/interactive/snapping/featureSources/featureServiceSource/FeatureServiceSnappingSourceWorkerHandle.js +1 -1
- package/views/interactive/snapping/featureSources/sceneLayerSource/SceneLayerSnappingSourceWorkerHandle.js +1 -1
- package/views/interactive/tooltip/content/TooltipContentDrawCircle.js +1 -1
- package/views/interactive/tooltip/content/TooltipContentDrawPoint.js +1 -1
- package/views/interactive/tooltip/content/TooltipContentDrawPolygon.js +1 -1
- package/views/interactive/tooltip/content/TooltipContentDrawPolyline.js +1 -1
- package/views/interactive/tooltip/content/TooltipContentDrawRectangle.js +1 -1
- package/views/interactive/tooltip/content/TooltipContentExtentRotate.js +1 -1
- package/views/interactive/tooltip/content/TooltipContentExtentScale.js +1 -1
- package/views/interactive/tooltip/content/TooltipContentReshapeEdgeOffset.js +1 -1
- package/views/interactive/tooltip/content/TooltipContentTransformAbsolute.js +1 -1
- package/views/interactive/tooltip/content/TooltipContentTransformRotate.js +1 -1
- package/views/interactive/tooltip/content/TooltipContentTransformScale.js +1 -1
- package/views/interactive/tooltip/content/TooltipContentTranslateGraphic.js +1 -1
- package/views/interactive/tooltip/content/TooltipContentTranslateGraphicXY.js +1 -1
- package/views/interactive/tooltip/content/TooltipContentTranslateGraphicZ.js +1 -1
- package/views/interactive/tooltip/content/TooltipContentTranslateVertex.js +1 -1
- package/views/interactive/tooltip/content/TooltipContentTranslateVertexXY.js +1 -1
- package/views/interactive/tooltip/content/TooltipContentTranslateVertexZ.js +1 -1
- package/views/navigation/FilteredValue.js +1 -1
- package/views/webgl/FramebufferObject.js +1 -1
- package/webscene/spec-certification/spec.js +1 -1
- package/widgets/AreaMeasurement3D.js +1 -1
- package/widgets/BasemapGallery.js +1 -1
- package/widgets/Editor/CreateFeaturesWorkflow.js +1 -1
- package/widgets/Editor/EditorViewModel.js +1 -1
- package/widgets/Feature/FeatureViewModel.js +1 -1
- package/widgets/LineOfSight.js +1 -1
- package/widgets/ScaleRangeSlider/ScaleRanges.js +1 -1
- package/widgets/Slice/SliceViewModel.js +1 -1
- package/widgets/Slice.js +1 -1
- package/widgets/support/DatePicker.js +1 -1
- package/assets/esri/core/workers/chunks/0273e841e78880e450c5.js +0 -1
- package/assets/esri/core/workers/chunks/0703495557b0df6878c5.js +0 -1
- package/assets/esri/core/workers/chunks/0c067c59a2a1bb4101f9.js +0 -1
- package/assets/esri/core/workers/chunks/1cffa7cf5e10ffbd6eb1.js +0 -1
- package/assets/esri/core/workers/chunks/1fe8daa3a0f4fea3a61c.js +0 -1
- package/assets/esri/core/workers/chunks/2e4887ba01cf8507e3e3.js +0 -1
- package/assets/esri/core/workers/chunks/2ee9ba5b08998b4ddb8e.js +0 -1
- package/assets/esri/core/workers/chunks/35cd0856d669a0a725be.js +0 -1
- package/assets/esri/core/workers/chunks/3a42d96ea3b59d33bfe8.js +0 -1
- package/assets/esri/core/workers/chunks/3d36278e4f7b8267b78c.js +0 -1
- package/assets/esri/core/workers/chunks/3ee5e8d00cd3bc47a9fa.js +0 -1
- package/assets/esri/core/workers/chunks/425e16862feccb467191.js +0 -1
- package/assets/esri/core/workers/chunks/5db5afec37f69c4acaaf.js +0 -1
- package/assets/esri/core/workers/chunks/63922dadaa642a959164.js +0 -1
- package/assets/esri/core/workers/chunks/6ddaf66e5608deda6811.js +0 -1
- package/assets/esri/core/workers/chunks/7574316b3af61c389e8f.js +0 -1
- package/assets/esri/core/workers/chunks/792b4b0a43b4bbbc14ab.js +0 -1
- package/assets/esri/core/workers/chunks/7ad6721cf0ad76ce5a9d.js +0 -1
- package/assets/esri/core/workers/chunks/7b32b8e8ebe48ae0dae2.js +0 -1
- package/assets/esri/core/workers/chunks/7f00125b02bb7211de43.js +0 -1
- package/assets/esri/core/workers/chunks/937eed1e51055f730270.js +0 -1
- package/assets/esri/core/workers/chunks/9b802fcf571c91347da4.js +0 -1
- package/assets/esri/core/workers/chunks/9b9a40b84640f00a1dcb.js +0 -1
- package/assets/esri/core/workers/chunks/a07ab40977e06cb58486.js +0 -1
- package/assets/esri/core/workers/chunks/ac07c732aca6e67232f8.js +0 -1
- package/assets/esri/core/workers/chunks/b02a43cf767d8ee13313.js +0 -1
- package/assets/esri/core/workers/chunks/ba6c6957830b3f0c4ec8.js +0 -1
- package/assets/esri/core/workers/chunks/bfb08d3e2208c6178af9.js +0 -1
- package/assets/esri/core/workers/chunks/c4e9c71be6299c60c539.js +0 -1
- package/assets/esri/core/workers/chunks/cc5a83f3a2b7c8be5db1.js +0 -1
- package/assets/esri/core/workers/chunks/d13951412a57e1af6208.js +0 -1
- package/assets/esri/core/workers/chunks/f135822fceac5ad4667c.js +0 -1
- package/assets/esri/core/workers/chunks/f328a6cd4b7d8c653fc7.js +0 -1
package/TimeExtent.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.25/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as t}from"./chunks/tslib.es6.js";import{JSONSupport as e}from"./core/JSONSupport.js";import{isSome as r,applySome as s,mapOr as i}from"./core/maybe.js";import{truncateDate as n,offsetDate as o}from"./core/timeUtils.js";import{property as l}from"./core/accessorSupport/decorators/property.js";import"./core/arrayUtils.js";import"./core/has.js";import"./core/accessorSupport/ensureType.js";import{reader as a}from"./core/accessorSupport/decorators/reader.js";import{subclass as m}from"./core/accessorSupport/decorators/subclass.js";import{writer as u}from"./core/accessorSupport/decorators/writer.js";var p;let d=p=class extends e{constructor(t){super(t),this.end=null,this.start=null}static get allTime(){return c}static get empty(){return h}readEnd(t,e){return null!=e.end?new Date(e.end):null}writeEnd(t,e){e.end=t?t.getTime():null}get isAllTime(){return this.equals(p.allTime)}get isEmpty(){return this.equals(p.empty)}readStart(t,e){return null!=e.start?new Date(e.start):null}writeStart(t,e){e.start=t?t.getTime():null}clone(){return new p({end:this.end,start:this.start})}equals(t){if(!t)return!1;const e=r(this.start)?this.start.getTime():this.start,s=r(this.end)?this.end.getTime():this.end,i=r(t.start)?t.start.getTime():t.start,n=r(t.end)?t.end.getTime():t.end;return e===i&&s===n}expandTo(t){if(this.isEmpty||this.isAllTime)return this.clone();const e=s(this.start,(e=>n(e,t))),r=s(this.end,(e=>{const r=n(e,t);return
|
|
5
|
+
import{_ as t}from"./chunks/tslib.es6.js";import{JSONSupport as e}from"./core/JSONSupport.js";import{isSome as r,applySome as s,mapOr as i}from"./core/maybe.js";import{truncateDate as n,offsetDate as o}from"./core/timeUtils.js";import{property as l}from"./core/accessorSupport/decorators/property.js";import"./core/arrayUtils.js";import"./core/has.js";import"./core/accessorSupport/ensureType.js";import{reader as a}from"./core/accessorSupport/decorators/reader.js";import{subclass as m}from"./core/accessorSupport/decorators/subclass.js";import{writer as u}from"./core/accessorSupport/decorators/writer.js";var p;let d=p=class extends e{constructor(t){super(t),this.end=null,this.start=null}static get allTime(){return c}static get empty(){return h}readEnd(t,e){return null!=e.end?new Date(e.end):null}writeEnd(t,e){e.end=t?t.getTime():null}get isAllTime(){return this.equals(p.allTime)}get isEmpty(){return this.equals(p.empty)}readStart(t,e){return null!=e.start?new Date(e.start):null}writeStart(t,e){e.start=t?t.getTime():null}clone(){return new p({end:this.end,start:this.start})}equals(t){if(!t)return!1;const e=r(this.start)?this.start.getTime():this.start,s=r(this.end)?this.end.getTime():this.end,i=r(t.start)?t.start.getTime():t.start,n=r(t.end)?t.end.getTime():t.end;return e===i&&s===n}expandTo(t){if(this.isEmpty||this.isAllTime)return this.clone();const e=s(this.start,(e=>n(e,t))),r=s(this.end,(e=>{const r=n(e,t);return e.getTime()===r.getTime()?r:o(r,1,t)}));return new p({start:e,end:r})}intersection(t){if(!t)return this.clone();if(this.isEmpty||t.isEmpty)return p.empty;if(this.isAllTime)return t.clone();if(t.isAllTime)return this.clone();const e=i(this.start,-1/0,(t=>t.getTime())),r=i(this.end,1/0,(t=>t.getTime())),s=i(t.start,-1/0,(t=>t.getTime())),n=i(t.end,1/0,(t=>t.getTime()));let o,l;if(s>=e&&s<=r?o=s:e>=s&&e<=n&&(o=e),r>=s&&r<=n?l=r:n>=e&&n<=r&&(l=n),!isNaN(o)&&!isNaN(l)){const t=new p;return t.start=o===-1/0?null:new Date(o),t.end=l===1/0?null:new Date(l),t}return p.empty}offset(t,e){if(this.isEmpty||this.isAllTime)return this.clone();const s=new p,{start:i,end:n}=this;return r(i)&&(s.start=o(i,t,e)),r(n)&&(s.end=o(n,t,e)),s}union(t){if(!t||t.isEmpty)return this.clone();if(this.isEmpty)return t.clone();if(this.isAllTime||t.isAllTime)return c.clone();const e=r(this.start)&&r(t.start)?new Date(Math.min(this.start.getTime(),t.start.getTime())):null,s=r(this.end)&&r(t.end)?new Date(Math.max(this.end.getTime(),t.end.getTime())):null;return new p({start:e,end:s})}};t([l({type:Date,json:{write:{allowNull:!0}}})],d.prototype,"end",void 0),t([a("end")],d.prototype,"readEnd",null),t([u("end")],d.prototype,"writeEnd",null),t([l({readOnly:!0,json:{read:!1}})],d.prototype,"isAllTime",null),t([l({readOnly:!0,json:{read:!1}})],d.prototype,"isEmpty",null),t([l({type:Date,json:{write:{allowNull:!0}}})],d.prototype,"start",void 0),t([a("start")],d.prototype,"readStart",null),t([u("start")],d.prototype,"writeStart",null),d=p=t([m("esri.TimeExtent")],d);const c=new d,h=new d({start:void 0,end:void 0}),T=d;export{T as default};
|
package/WebMap.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.25/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"./chunks/tslib.es6.js";import{version as t}from"./kernel.js";import r from"./Map.js";import i from"./Viewpoint.js";import{flatten as o}from"./core/arrayUtils.js";import a from"./core/Collection.js";import s from"./core/Error.js";import n from"./core/Loadable.js";import{loadAll as l}from"./core/loadAll.js";import p from"./core/Logger.js";import{unwrap as m,isSome as h}from"./core/maybe.js";import{MultiOriginJSONMixin as u,MultiOriginJSONSupport as d}from"./core/MultiOriginJSONSupport.js";import{EsriPromiseMixin as c}from"./core/Promise.js";import{eachAlways as y}from"./core/promiseUtils.js";import{whenOnce as g}from"./core/reactiveUtils.js";import{urlToObject as w,isDataProtocol as f,dataComponents as b,addQueryParameter as _}from"./core/urlUtils.js";import{property as v}from"./core/accessorSupport/decorators/property.js";import"./core/has.js";import"./core/accessorSupport/ensureType.js";import{reader as I}from"./core/accessorSupport/decorators/reader.js";import{subclass as A}from"./core/accessorSupport/decorators/subclass.js";import{writer as S}from"./core/accessorSupport/decorators/writer.js";import{updateOrigins as j}from"./core/accessorSupport/originUtils.js";import{readLoadable as L}from"./core/accessorSupport/read.js";import O from"./geometry/SpatialReference.js";import{equals as P}from"./geometry/support/spatialReferenceUtils.js";import{geographicToWebMercator as V,webMercatorToGeographic as U}from"./geometry/support/webMercatorUtils.js";import{isServerOrServicesAGOLUrl as T}from"./layers/support/arcgisLayerUrl.js";import{isFeatureServiceLayer as F,isFeatureCollectionLayer as R}from"./layers/support/layerUtils.js";import W from"./networks/UtilityNetwork.js";import C from"./portal/Portal.js";import k from"./portal/PortalItem.js";import{removeTypeKeyword as M,addTypeKeyword as N,hasTypeKeyword as x,TypeKeyword as E}from"./portal/support/portalItemUtils.js";import{project as B}from"./rest/geometryService/project.js";import G from"./rest/support/ProjectParameters.js";import{hasDeveloperBasemapLayer as J,isDeveloperBasemapLayer as D,findSpatialReference as K}from"./support/basemapUtils.js";import $ from"./support/MapFloorInfo.js";import z from"./webdoc/GeotriggersInfo.js";import q from"./webdoc/RangeInfo.js";import H from"./webdoc/Widgets.js";import{getOptimalThumbnailSize as Q}from"./webdoc/support/thumbnailUtils.js";import{getLayerJSON as X}from"./webdoc/support/writeUtils.js";import Y from"./webmap/ApplicationProperties.js";import Z from"./webmap/Bookmark.js";import ee from"./webmap/InitialViewProperties.js";import{Version as te}from"./webmap/Version.js";import re from"./webmap/background/ColorBackground.js";const ie=new te(2,25),oe="Web Map",ae=a.ofType(Z),se=a.ofType(W),ne=new Map;ne.set("image/jpeg","jpeg"),ne.set("image/jpg","jpg"),ne.set("image/png","png"),ne.set("image/gif","gif");const le="ArcGIS Pro",pe=E.JSAPI,me="CollectorDisabled",he="Collector",ue="Data Editing",de="OfflineDisabled",ce="Offline",ye="Workforce Project",ge="Workforce Worker",we="Workforce Dispatcher",fe="Offline Map Areas",be="FieldMapsDisabled",_e=E.DEVELOPER_BASEMAP,ve=["NatGeo_World_Map","Ocean_Basemap","USA_Topo_Maps","World_Imagery","World_Street_Map","World_Terrain_Base","World_Topo_Map","World_Hillshade","Canvas/World_Light_Gray_Base","Canvas/World_Light_Gray_Reference","Canvas/World_Dark_Gray_Base","Canvas/World_Dark_Gray_Reference","Ocean/World_Ocean_Base","Ocean/World_Ocean_Reference","Reference/World_Boundaries_and_Places","Reference/World_Reference_Overlay","Reference/World_Transportation"].map((e=>e.toLowerCase()));let Ie=class extends(u(n.LoadableMixin(c(r)))){constructor(e){super(e),this.applicationProperties=null,this.bookmarks=new ae,this.floorInfo=null,this.geotriggersInfo=null,this.initialViewProperties=new ee,this.portalItem=null,this.presentation=null,this.sourceVersion=null,this.widgets=null,this.utilityNetworks=null,this.authoringApp=this.authoringAppVersion=null,this._isAuthoringAppSetByUser=this._isAuthoringAppVersionSetByUser=!1}destroy(){const e=this.portalItem;this.portalItem=null,e?.destroy()}initialize(){if(this.when().catch((e=>{p.getLogger(this.declaredClass).error("#load()","Failed to load web map",e)})),this.resourceInfo){let t;try{t=this._validateJSON(this.resourceInfo)}catch(e){return void this.addResolvingPromise(Promise.reject(e))}this.read(t)}}set authoringApp(e){this._isAuthoringAppSetByUser=!0,this._set("authoringApp",e)}writeAuthoringApp(e,t){e&&this._isAuthoringAppSetByUser?t.authoringApp=e:t.authoringApp=pe}set authoringAppVersion(e){this._isAuthoringAppVersionSetByUser=!0,this._set("authoringAppVersion",e)}writeAuthoringAppVersion(e,r){e&&this._isAuthoringAppVersionSetByUser?r.authoringAppVersion=e:r.authoringAppVersion=t}readInitialViewProperties(e,t){const r=new ee;t.background&&(r.background=re.fromJSON(t.background));const o=t.initialState?.viewpoint;if(o){if(o.rotation){te.parse(t.version||"","webmap").lessThan(2,20)&&t.authoringApp===le&&(o.rotation*=-1)}r.viewpoint=i.fromJSON(o)}return t.mapRangeInfo&&(r.rangeInfo=q.fromJSON(t.mapRangeInfo)),t.spatialReference&&(r.spatialReference=O.fromJSON(t.spatialReference)),r}writeInitialViewProperties(e,t,r,i){if(!e)return;const o=e.background;o&&o.color&&(t.background=o.write({},i)),e.viewpoint&&(t.initialState={viewpoint:e.viewpoint.write({},i)}),e.rangeInfo&&(t.mapRangeInfo=e.rangeInfo.toJSON(i)),e.spatialReference&&(t.spatialReference=e.spatialReference.write({},i))}writeLayers(e,t,r,i){t[r]=this._writeLayers(e,i,"operational-layers")}readSourceVersion(e,t){const[r,i]=t.version.split(".");return new te(parseInt(r,10),parseInt(i,10))}writeSourceVersion(e,t,r){t[r]=`${ie.major}.${ie.minor}`}writeTables(e,t,r,i){const o=this._writeLayers(e,i,"tables");o.length&&(t[r]=o)}get thumbnailUrl(){return this.portalItem&&this.portalItem.thumbnailUrl||null}set thumbnailUrl(e){e?(this._override("thumbnailUrl",e),this._thumbnailFilename=this._generateCustomThumbnailFilename(e)):this._clearThumbnailOverride()}load(e){return this.addResolvingPromise(this._loadFromSource()),Promise.resolve(this)}loadAll(){return l(this,(e=>{e(this.ground,this.basemap,this.layers,this.tables)}))}read(e,t){t={...t,origin:"web-map"};const r=this._getAuthoringPropsState();L(this,e,(t=>super.read(e,t)),t),this._restoreAuthoringPropsFromState(r)}write(e,t){if("loaded"!==this.loadStatus){const e=new s("webmap:not-loaded","Web map must be loaded before it can be serialized");throw p.getLogger(this.declaredClass).error("#toJSON()","Web map must be loaded before it can be serialized",this.loadError||this.loadStatus),e}return this._removeDanglingLayerRefs(),t={...t,origin:"web-map",restrictedWebMapWriting:!0,webmap:this},super.write(e,t)}async save(e){e=e||{},this._validateItem(),await this._updateFromPromise,await this.load(),await this._loadLayerContainers(),await this._beforeSave(),await this._validateMap();const t=this.portalItem,r={origin:"web-map",messages:[],writtenProperties:[],url:t.itemUrl&&w(t.itemUrl),portal:t.portal||C.getDefault()},i=this.write({},r);return this._validateJSONForWriting(r,e),await this._updateItemProperties(t),await this._updateItem(t,i,r),await this._updateItemThumbnail(),t}async saveAs(e,t){t=t||{};const r=this._getPortalItem(e);await this._updateFromPromise,await this.load(),await this._loadLayerContainers(),await this._beforeSave(),await this._validateMap();const i={origin:"web-map",messages:[],writtenProperties:[],url:null,portal:r.portal},o=this.write({},i);this._validateJSONForWriting(i,t),await this._updateItemPropertiesForSaveAs(r);const a=this._getThumbnailState();return await this._createItem(r,o,i,t),this._restoreThumbnailFromState(a),await this._updateItemThumbnail(),r}async updateFrom(e,t){const r=this._updateFromInternal(e,t);this._updateFromPromise=r,await r;r===this._updateFromPromise&&(this._updateFromPromise=null)}getLayerJSONFromResourceInfo(e){const t=this.resourceInfo;return this._collectAllLayersJSON(o([t?.baseMap?.baseMapLayers,t?.operationalLayers,this.basemap?.resourceInfo?.data?.baseMapLayers])).find((t=>t.id===e.id))}_collectAllLayersJSON(e){return e.reduce(((e,t)=>(e.push(t),"GroupLayer"===t.layerType&&(e=e.concat(this._collectAllLayersJSON(t.layers||[]))),e)),[])}_writeLayers(e,t,r){t={...t,layerContainerType:r};return e.map((e=>m(X(e,"tables"===r?null:this.getLayerJSONFromResourceInfo(e),t)))).filter(Boolean).toArray()}_loadFromSource(){return this.resourceInfo?this._loadFromJSON(this.resourceInfo,{origin:"web-map"}):this.portalItem&&this.portalItem.id?this._loadFromItem(this.portalItem):Promise.resolve(null)}_loadFromItem(e){return e.load().catch((e=>{throw new s("webmap:load-portal-item","Failed to load portal item",{error:e})})).then((()=>{if("Web Map"!==e.type)throw new s("webmap:invalid-portal-item","Invalid portal item type '${type}', expected 'Web Map'",{type:e.type})})).then((()=>e.fetchData())).then((t=>(this.resourceInfo=t,this._readAndLoadFromJSON(t,{origin:"web-map",portal:e.portal||C.getDefault()})))).then((()=>this._computeInitialViewpoint()))}_readAndLoadFromJSON(e,t){const r=this._validateJSON(e);return this.read(r,t),this._loadFromJSON(r,t)}_validateJSON(e){const t=te.parse(e.version||"","webmap");return ie.validate(t),e.version=`${t.major}.${t.minor}`,e}_loadFromJSON(e,t){const r={context:{...t,layerContainerType:"operational-layers"}};return this.portalItem&&(r.context.portal=this.portalItem.portal||C.getDefault()),import("./layers/support/layersCreator.js").then((({populateOperationalLayers:t})=>{const i=[],o=e.operationalLayers;o&&o.length&&i.push(t(this.layers,o,r));const a={...r,context:{...r.context,layerContainerType:"tables"},defaultLayerType:"ArcGISFeatureLayer"},s=e.tables;return s&&s.length&&i.push(t(this.tables,s,a)),y(i).then((()=>{}))}))}async _computeInitialViewpoint(){let e=this.initialViewProperties;const t=e?.viewpoint?.targetGeometry;if(t)return;const r=await this._getExtentFromItem();r&&(e=e?e.clone():new ee,e.viewpoint=new i,e.viewpoint.targetGeometry=r,this.initialViewProperties=e)}async _getExtentFromItem(){const e=this.initialViewProperties?.spatialReference,t=this.portalItem?.extent;if(e&&t){if(e.isWGS84)return t.clone();if(e.isWebMercator)return V(t);return(await import("./portal/support/geometryServiceUtils.js")).getGeometryServiceURL(this.portalItem).then((r=>{const i=new G;return i.geometries=[t],i.outSpatialReference=e,B(r,i)})).then((e=>e[0])).catch((e=>(p.getLogger(this.declaredClass).error("Error projecting item's extent:",e),null)))}return null}_removeDanglingLayerRefs(){const e=this.applicationProperties,t=e&&e.viewing&&e.viewing.search,r=e=>this.allLayers.some((t=>t.id===e));t&&t.layers&&(t.layers=t.layers.filter((e=>r(e.id)))),t&&t.tables&&(t.tables=t.tables.filter((e=>this.tables.some((t=>t.id===e.id)))));const i=e&&e.editing&&e.editing.locationTracking;i&&i.info&&!r(i.info.layerId)&&(e.editing=null);const o=this.presentation&&this.presentation.slides;o&&o.forEach((e=>{e.visibleLayers&&(e.visibleLayers=e.visibleLayers.filter((e=>r(e.id))))}))}async _validateMap(){if(!this.basemap?.baseLayers.length)throw new s("webmap:save","Map does not have a valid basemap with a base layer.");let e=null;if(await g((()=>{const t=K(this.initialViewProperties,this.basemap);return e=t.spatialReference,!t.updating})),!P(e,this.initialViewProperties.spatialReference))throw new s("webmap:save","The spatial reference of the basemap is not compatible with the one from the map.",{expected:this.initialViewProperties.spatialReference,actual:e})}_validateItem(){if(!this.portalItem)throw p.getLogger(this.declaredClass).error("save: requires the portalItem property to be set"),new s("webmap:portal-item-not-set","Portal item to save to has not been set on the WebMap");this._validateItemType(this.portalItem)}_validateItemType(e){if(e.type!==oe)throw new s("webmap:portal-item-wrong-type",`Portal item needs to have type "${oe}"`)}_loadLayerContainers(){const e=[];return this.basemap&&e.push(this.basemap.load()),this.ground&&e.push(this.ground.load()),y(e).then((()=>{}))}async _beforeSave(){const e=[];for(const t of this.allLayers)if("beforeSave"in t&&"function"==typeof t.beforeSave){const r=t.beforeSave();r&&e.push(r)}await y(e)}_loadAllLayers(){const e=this._getAllLayersAndTables().map((e=>e.load()));return y(e).then((()=>{}))}_getAllLayersAndTables(){return this.allLayers.concat(this.allTables)}_validateJSONForWriting(e,t){let r=e.messages.filter((e=>"error"===e.type)).map((e=>new s(e.name,e.message,e.details)));if(t.ignoreUnsupported&&(r=r.filter((e=>"layer:unsupported"!==e.name&&"symbol:unsupported"!==e.name&&"symbol-layer:unsupported"!==e.name&&"property:unsupported"!==e.name&&"url:unsupported"!==e.name))),r.length>0)throw new s("webmap:save","Failed to save webmap due to unsupported or invalid content. See 'details.errors' for more detailed information",{errors:r})}async _updateItemProperties(e){e.extent=await this._getWGS84Extent(this.initialViewProperties.viewpoint.targetGeometry),await this._updateTypeKeywords(e)}async _updateItemPropertiesForSaveAs(e){M(e,me),M(e,be),M(e,E.METADATA),M(e,de),M(e,fe),M(e,we),M(e,ye),M(e,ge),await this._updateItemProperties(e)}async _getWGS84Extent(e){const t=e.clone().normalize();let r;if(t.length>1)for(const i of t)r?i.width>r.width&&(r=i):r=i;else r=t[0];return this._projectToWGS84(r)}async _projectToWGS84(e){const t=e.spatialReference;if(t.isWGS84)return e.clone();if(t.isWebMercator)return U(e);const r=await import("./portal/support/geometryServiceUtils.js"),i=await r.getGeometryServiceURL(this.portalItem),o=new G;o.geometries=[e],o.outSpatialReference=O.WGS84;return(await B(i,o))[0]}async _updateTypeKeywords(e){N(e,pe),await this._loadAllLayers(),this._evalCollectorKeyword(e),this._evalDataEditingKeyword(e),this._evalOfflineKeyword(e),this._evalDeveloperBasemapKeyword(e),e.typeKeywords&&(e.typeKeywords=e.typeKeywords.filter(((e,t,r)=>r.indexOf(e)===t)))}_evalCollectorKeyword(e){x(e,me)||x(e,ye)||x(e,ge)||x(e,we)||!this._hasEditableFeatureLayer()?M(e,he):N(e,he)}_evalDataEditingKeyword(e){this._hasEditableFeatureLayer()?N(e,ue):M(e,ue)}_evalOfflineKeyword(e){!x(e,de)&&this._isOfflineCapableMap()?N(e,ce):M(e,ce)}_evalDeveloperBasemapKeyword(e){J(this.basemap)?N(e,_e):M(e,_e)}_hasEditableFeatureLayer(){return this._getAllLayersAndTables().some((e=>e.loaded&&F(e)&&e.capabilities.operations.supportsEditing&&e.editingEnabled))}_isOfflineCapableMap(){return this._getAllLayersAndTables().filter((e=>"group"!==e.type)).every((e=>e.loaded&&this._isOfflineCapableLayer(e)))}_isFeatureCollectionLike(e){return R(e)||"map-notes"===e.type||"route"===e.type}_isOfflineCapableLayer(e){return F(e)&&e.capabilities.operations.supportsSync||this._isFeatureCollectionLike(e)&&!e.portalItem||("tile"===e.type||"vector-tile"===e.type)&&(e.capabilities.operations.supportsExportTiles||this._isExportableAGOLTileLayer(e)||D(e))&&e.spatialReference.equals(this.initialViewProperties.spatialReference)}_isExportableAGOLTileLayer(e){return"tile"===e.type&&(T(e.url)&&ve.some((t=>e.url.toLowerCase().includes("/"+t+"/"))))}async _updateItem(e,t,r){await e.update({data:t}),this._syncUpInstanceWithItem(e,t,r)}async _createItem(e,t,r,i){const o=this.portalItem,a=!!(o&&o.id&&o.portal.user),n=e.portal;if(await n._signIn(),!await this._canCopyItem(o,a,n))throw new s("webmap:save-as-copy-not-allowed","Owner of this map does not allow others to save a copy");await n.user.addItem({item:e,folder:i.folder,data:t}),this.portalItem=e,this._syncUpInstanceWithItem(e,t,r)}async _canCopyItem(e,t,r){return!(h(e)&&e.id&&e.typeKeywords&&e.typeKeywords.includes("useOnly"))||e.portal.portalHostname===r.portalHostname&&(t||await e.reload(),"admin"===e.itemControl||"update"===e.itemControl)}_syncUpInstanceWithItem(e,t,r){d.prototype.read.call(this,{version:t.version,authoringApp:t.authoringApp,authoringAppVersion:t.authoringAppVersion},{origin:"web-map",ignoreDefaults:!0,url:e.itemUrl&&w(e.itemUrl)}),j(r),this.resourceInfo=t}async _updateItemThumbnail(){this.thumbnailUrl&&this._isOverridden("thumbnailUrl")&&(await this.portalItem.updateThumbnail({thumbnail:this.thumbnailUrl,filename:this._thumbnailFilename}),this._clearThumbnailOverride())}_getPortalItem(e){let t=k.from(e);return t.id&&(t=t.clone(),t.id=null),t.type||(t.type=oe),t.portal||(t.portal=C.getDefault()),this._validateItemType(t),t}async _updateFromInternal(e,t){if(t=t||{},await g((()=>e.ready)),this._updateInitialViewProperties(e,t),e.map===this)for(const r of e.allLayerViews)for(const e of["visible","featureEffect"])e in r&&e in r.layer&&r._isOverridden(e)&&(r.layer[e]=r[e]);await this._updateThumbnailUrl(e,t)}_updateInitialViewProperties(e,t){if(t.backgroundExcluded||(this.initialViewProperties.background=e.background?.clone()),this.initialViewProperties.spatialReference=e.spatialReference.clone(),t.viewpointExcluded||(this.initialViewProperties.viewpoint=new i({rotation:e.rotation,scale:t.scalePreserved?e.scale:null,targetGeometry:this._getViewExtent(e)})),!t.widgetsExcluded)for(const r of e.persistableViewModels)r.updateWebDocument(this)}_getViewExtent(e){const t=e.center.clone().normalize(),r=e.extent.clone(),i=r.width/2;return r.xmin=t.x-i,r.xmax=t.x+i,r}async _updateThumbnailUrl(e,t){if(t.thumbnailExcluded)return;const r=Q(e,t.thumbnailSize),i=await e.takeScreenshot({format:"png",width:r.width,height:r.height});this._setAutoGeneratedThumbnail(i.dataUrl)}_setAutoGeneratedThumbnail(e){this.thumbnailUrl=e,this._thumbnailFilename=null}_clearThumbnailOverride(){this._clearOverride("thumbnailUrl"),this.clear("thumbnailUrl","user"),this._thumbnailFilename=null}_generateCustomThumbnailFilename(e){if(f(e)){const t=b(e),r=t&&t.mediaType,i=r&&ne.get(r.toLowerCase())||null,o=`thumbnail${Date.now()}`;return i?`${o}.${i}`:o}return null}_getThumbnailState(){let e=this.thumbnailUrl;return e&&(e=this._isOverridden("thumbnailUrl")?e:_(e,"w","8192")),{thumbnailUrl:e,filename:this._thumbnailFilename}}_restoreThumbnailFromState(e){this.thumbnailUrl=e.thumbnailUrl,this._thumbnailFilename=e.filename}_getAuthoringPropsState(){return{authoringApp:this.authoringApp,authoringAppVersion:this.authoringAppVersion,isAuthoringAppSetByUser:this._isAuthoringAppSetByUser,isAuthoringAppVersionSetByUser:this._isAuthoringAppVersionSetByUser}}_restoreAuthoringPropsFromState(e){e.isAuthoringAppSetByUser?this.authoringApp=e.authoringApp:this._isAuthoringAppSetByUser=!1,e.isAuthoringAppVersionSetByUser?this.authoringAppVersion=e.authoringAppVersion:this._isAuthoringAppVersionSetByUser=!1}static fromJSON(e){const t=e;if(!t)throw new s("webmap:empty-resource","Expected a JSON resource but got nothing");return new this({resourceInfo:t})}};Ie.VERSION=ie,e([v({type:Y,json:{write:!0}})],Ie.prototype,"applicationProperties",void 0),e([v({type:String,json:{write:{allowNull:!0,ignoreOrigin:!0}}})],Ie.prototype,"authoringApp",null),e([S("authoringApp")],Ie.prototype,"writeAuthoringApp",null),e([v({type:String,json:{write:{allowNull:!0,ignoreOrigin:!0}}})],Ie.prototype,"authoringAppVersion",null),e([S("authoringAppVersion")],Ie.prototype,"writeAuthoringAppVersion",null),e([v({json:{read:{source:"baseMap"},write:{target:"baseMap"}}})],Ie.prototype,"basemap",void 0),e([v({type:ae,json:{write:{overridePolicy:e=>({enabled:!!(e&&e.length>0),ignoreOrigin:!0})}}})],Ie.prototype,"bookmarks",void 0),e([v({type:$,json:{read:{source:"mapFloorInfo"},write:{target:"mapFloorInfo"}}})],Ie.prototype,"floorInfo",void 0),e([v({type:z,json:{write:!0}})],Ie.prototype,"geotriggersInfo",void 0),e([v({type:ee,nonNullable:!0,json:{read:{source:["background","initialState.viewpoint","mapRangeInfo","spatialReference"]},write:{ignoreOrigin:!0,target:{background:{type:re},"initialState.viewpoint":{type:i},mapRangeInfo:{type:q},spatialReference:{type:O}}}}})],Ie.prototype,"initialViewProperties",void 0),e([I("initialViewProperties")],Ie.prototype,"readInitialViewProperties",null),e([S("initialViewProperties")],Ie.prototype,"writeInitialViewProperties",null),e([v({json:{read:!1,write:{target:"operationalLayers",ignoreOrigin:!0}}})],Ie.prototype,"layers",void 0),e([S("layers")],Ie.prototype,"writeLayers",null),e([v({type:k})],Ie.prototype,"portalItem",void 0),e([v({json:{write:!0}})],Ie.prototype,"presentation",void 0),e([v()],Ie.prototype,"resourceInfo",void 0),e([v({readOnly:!0,type:te,json:{read:{source:"version"},write:{allowNull:!0,ignoreOrigin:!0,target:"version",isRequired:!0}}})],Ie.prototype,"sourceVersion",void 0),e([I("sourceVersion")],Ie.prototype,"readSourceVersion",null),e([S("sourceVersion")],Ie.prototype,"writeSourceVersion",null),e([v({json:{read:!1,write:{ignoreOrigin:!0}}})],Ie.prototype,"tables",void 0),e([S("tables")],Ie.prototype,"writeTables",null),e([v()],Ie.prototype,"thumbnailUrl",null),e([v({type:H,json:{write:!0}})],Ie.prototype,"widgets",void 0),e([v({type:se,json:{read:!0,write:!0}})],Ie.prototype,"utilityNetworks",void 0),Ie=e([A("esri.WebMap")],Ie);const Ae=Ie;export{Ae as default};
|
|
5
|
+
import{_ as e}from"./chunks/tslib.es6.js";import{version as t}from"./kernel.js";import r from"./Map.js";import i from"./Viewpoint.js";import o from"./core/Collection.js";import a from"./core/Error.js";import s from"./core/Loadable.js";import{loadAll as n}from"./core/loadAll.js";import l from"./core/Logger.js";import{unwrap as p,isSome as m}from"./core/maybe.js";import{MultiOriginJSONMixin as h,MultiOriginJSONSupport as u}from"./core/MultiOriginJSONSupport.js";import{EsriPromiseMixin as d}from"./core/Promise.js";import{eachAlways as c}from"./core/promiseUtils.js";import{whenOnce as y}from"./core/reactiveUtils.js";import{urlToObject as g,isDataProtocol as w,dataComponents as f,addQueryParameter as b}from"./core/urlUtils.js";import{property as _}from"./core/accessorSupport/decorators/property.js";import"./core/arrayUtils.js";import"./core/has.js";import"./core/accessorSupport/ensureType.js";import{reader as v}from"./core/accessorSupport/decorators/reader.js";import{subclass as I}from"./core/accessorSupport/decorators/subclass.js";import{writer as A}from"./core/accessorSupport/decorators/writer.js";import{updateOrigins as S}from"./core/accessorSupport/originUtils.js";import{readLoadable as j}from"./core/accessorSupport/read.js";import L from"./geometry/SpatialReference.js";import{equals as O}from"./geometry/support/spatialReferenceUtils.js";import{geographicToWebMercator as P,webMercatorToGeographic as V}from"./geometry/support/webMercatorUtils.js";import{isServerOrServicesAGOLUrl as U}from"./layers/support/arcgisLayerUrl.js";import{isFeatureServiceLayer as T,isFeatureCollectionLayer as F}from"./layers/support/layerUtils.js";import R from"./networks/UtilityNetwork.js";import W from"./portal/Portal.js";import C from"./portal/PortalItem.js";import{removeTypeKeyword as k,addTypeKeyword as M,hasTypeKeyword as N,TypeKeyword as x}from"./portal/support/portalItemUtils.js";import{project as E}from"./rest/geometryService/project.js";import B from"./rest/support/ProjectParameters.js";import{hasDeveloperBasemapLayer as G,isDeveloperBasemapLayer as J,findSpatialReference as D}from"./support/basemapUtils.js";import K from"./support/MapFloorInfo.js";import $ from"./webdoc/GeotriggersInfo.js";import z from"./webdoc/RangeInfo.js";import q from"./webdoc/Widgets.js";import{getOptimalThumbnailSize as H}from"./webdoc/support/thumbnailUtils.js";import{getLayerJSON as Q}from"./webdoc/support/writeUtils.js";import X from"./webmap/ApplicationProperties.js";import Y from"./webmap/Bookmark.js";import Z from"./webmap/InitialViewProperties.js";import{Version as ee}from"./webmap/Version.js";import te from"./webmap/background/ColorBackground.js";const re=new ee(2,25),ie="Web Map",oe=o.ofType(Y),ae=o.ofType(R),se=new Map;se.set("image/jpeg","jpeg"),se.set("image/jpg","jpg"),se.set("image/png","png"),se.set("image/gif","gif");const ne="ArcGIS Pro",le=x.JSAPI,pe="CollectorDisabled",me="Collector",he="Data Editing",ue="OfflineDisabled",de="Offline",ce="Workforce Project",ye="Workforce Worker",ge="Workforce Dispatcher",we="Offline Map Areas",fe="FieldMapsDisabled",be=x.DEVELOPER_BASEMAP,_e=["NatGeo_World_Map","Ocean_Basemap","USA_Topo_Maps","World_Imagery","World_Street_Map","World_Terrain_Base","World_Topo_Map","World_Hillshade","Canvas/World_Light_Gray_Base","Canvas/World_Light_Gray_Reference","Canvas/World_Dark_Gray_Base","Canvas/World_Dark_Gray_Reference","Ocean/World_Ocean_Base","Ocean/World_Ocean_Reference","Reference/World_Boundaries_and_Places","Reference/World_Reference_Overlay","Reference/World_Transportation"].map((e=>e.toLowerCase()));let ve=class extends(h(s.LoadableMixin(d(r)))){constructor(e){super(e),this.applicationProperties=null,this.bookmarks=new oe,this.floorInfo=null,this.geotriggersInfo=null,this.initialViewProperties=new Z,this.portalItem=null,this.presentation=null,this.sourceVersion=null,this.widgets=null,this.utilityNetworks=null,this.authoringApp=this.authoringAppVersion=null,this._isAuthoringAppSetByUser=this._isAuthoringAppVersionSetByUser=!1}destroy(){const e=this.portalItem;this.portalItem=null,e?.destroy()}initialize(){if(this.when().catch((e=>{l.getLogger(this.declaredClass).error("#load()","Failed to load web map",e)})),this.resourceInfo){let t;try{t=this._validateJSON(this.resourceInfo)}catch(e){return void this.addResolvingPromise(Promise.reject(e))}this.read(t)}}set authoringApp(e){this._isAuthoringAppSetByUser=!0,this._set("authoringApp",e)}writeAuthoringApp(e,t){e&&this._isAuthoringAppSetByUser?t.authoringApp=e:t.authoringApp=le}set authoringAppVersion(e){this._isAuthoringAppVersionSetByUser=!0,this._set("authoringAppVersion",e)}writeAuthoringAppVersion(e,r){e&&this._isAuthoringAppVersionSetByUser?r.authoringAppVersion=e:r.authoringAppVersion=t}readInitialViewProperties(e,t){const r=new Z;t.background&&(r.background=te.fromJSON(t.background));const o=t.initialState?.viewpoint;if(o){if(o.rotation){ee.parse(t.version||"","webmap").lessThan(2,20)&&t.authoringApp===ne&&(o.rotation*=-1)}r.viewpoint=i.fromJSON(o)}return t.mapRangeInfo&&(r.rangeInfo=z.fromJSON(t.mapRangeInfo)),t.spatialReference&&(r.spatialReference=L.fromJSON(t.spatialReference)),r}writeInitialViewProperties(e,t,r,i){if(!e)return;const o=e.background;o&&o.color&&(t.background=o.write({},i)),e.viewpoint&&(t.initialState={viewpoint:e.viewpoint.write({},i)}),e.rangeInfo&&(t.mapRangeInfo=e.rangeInfo.toJSON(i)),e.spatialReference&&(t.spatialReference=e.spatialReference.write({},i))}writeLayers(e,t,r,i){t[r]=this._writeLayers(e,i,"operational-layers")}readSourceVersion(e,t){const[r,i]=t.version.split(".");return new ee(parseInt(r,10),parseInt(i,10))}writeSourceVersion(e,t,r){t[r]=`${re.major}.${re.minor}`}writeTables(e,t,r,i){const o=this._writeLayers(e,i,"tables");o.length&&(t[r]=o)}get thumbnailUrl(){return this.portalItem&&this.portalItem.thumbnailUrl||null}set thumbnailUrl(e){e?(this._override("thumbnailUrl",e),this._thumbnailFilename=this._generateCustomThumbnailFilename(e)):this._clearThumbnailOverride()}load(e){return this.addResolvingPromise(this._loadFromSource()),Promise.resolve(this)}loadAll(){return n(this,(e=>{e(this.ground,this.basemap,this.layers,this.tables)}))}read(e,t){t={...t,origin:"web-map"};const r=this._getAuthoringPropsState();j(this,e,(t=>super.read(e,t)),t),this._restoreAuthoringPropsFromState(r)}write(e,t){if("loaded"!==this.loadStatus){const e=new a("webmap:not-loaded","Web map must be loaded before it can be serialized");throw l.getLogger(this.declaredClass).error("#toJSON()","Web map must be loaded before it can be serialized",this.loadError||this.loadStatus),e}return this._removeDanglingLayerRefs(),t={...t,origin:"web-map",restrictedWebMapWriting:!0,webmap:this},super.write(e,t)}async save(e){e=e||{},this._validateItem(),await this._updateFromPromise,await this.load(),await this._loadLayerContainers(),await this._beforeSave(),await this._validateMap();const t=this.portalItem,r={origin:"web-map",messages:[],writtenProperties:[],url:t.itemUrl&&g(t.itemUrl),portal:t.portal||W.getDefault()},i=this.write({},r);return this._validateJSONForWriting(r,e),await this._updateItemProperties(t),await this._updateItem(t,i,r),await this._updateItemThumbnail(),t}async saveAs(e,t){t=t||{};const r=this._getPortalItem(e);await this._updateFromPromise,await this.load(),await this._loadLayerContainers(),await this._beforeSave(),await this._validateMap();const i={origin:"web-map",messages:[],writtenProperties:[],url:null,portal:r.portal},o=this.write({},i);this._validateJSONForWriting(i,t),await this._updateItemPropertiesForSaveAs(r);const a=this._getThumbnailState();return await this._createItem(r,o,i,t),this._restoreThumbnailFromState(a),await this._updateItemThumbnail(),r}async updateFrom(e,t){const r=this._updateFromInternal(e,t);this._updateFromPromise=r,await r;r===this._updateFromPromise&&(this._updateFromPromise=null)}getLayerJSONFromResourceInfo(e){const t=this.resourceInfo;return this._collectAllLayersJSON([...t?.baseMap?.baseMapLayers||[],...t?.operationalLayers||[],...this.basemap?.resourceInfo?.data?.baseMapLayers||[]]).find((t=>t.id===e.id))}_collectAllLayersJSON(e){return e.reduce(((e,t)=>(e.push(t),"GroupLayer"===t.layerType&&(e=e.concat(this._collectAllLayersJSON(t.layers||[]))),e)),[])}_writeLayers(e,t,r){t={...t,layerContainerType:r};return e.map((e=>p(Q(e,"tables"===r?null:this.getLayerJSONFromResourceInfo(e),t)))).filter(Boolean).toArray()}_loadFromSource(){return this.resourceInfo?this._loadFromJSON(this.resourceInfo,{origin:"web-map"}):this.portalItem&&this.portalItem.id?this._loadFromItem(this.portalItem):Promise.resolve(null)}_loadFromItem(e){return e.load().catch((e=>{throw new a("webmap:load-portal-item","Failed to load portal item",{error:e})})).then((()=>{if("Web Map"!==e.type)throw new a("webmap:invalid-portal-item","Invalid portal item type '${type}', expected 'Web Map'",{type:e.type})})).then((()=>e.fetchData())).then((t=>(this.resourceInfo=t,this._readAndLoadFromJSON(t,{origin:"web-map",portal:e.portal||W.getDefault()})))).then((()=>this._computeInitialViewpoint()))}_readAndLoadFromJSON(e,t){const r=this._validateJSON(e);return this.read(r,t),this._loadFromJSON(r,t)}_validateJSON(e){const t=ee.parse(e.version||"","webmap");return re.validate(t),e.version=`${t.major}.${t.minor}`,e}_loadFromJSON(e,t){const r={context:{...t,layerContainerType:"operational-layers"}};return this.portalItem&&(r.context.portal=this.portalItem.portal||W.getDefault()),import("./layers/support/layersCreator.js").then((({populateOperationalLayers:t})=>{const i=[],o=e.operationalLayers;o&&o.length&&i.push(t(this.layers,o,r));const a={...r,context:{...r.context,layerContainerType:"tables"},defaultLayerType:"ArcGISFeatureLayer"},s=e.tables;return s&&s.length&&i.push(t(this.tables,s,a)),c(i).then((()=>{}))}))}async _computeInitialViewpoint(){let e=this.initialViewProperties;const t=e?.viewpoint?.targetGeometry;if(t)return;const r=await this._getExtentFromItem();r&&(e=e?e.clone():new Z,e.viewpoint=new i,e.viewpoint.targetGeometry=r,this.initialViewProperties=e)}async _getExtentFromItem(){const e=this.initialViewProperties?.spatialReference,t=this.portalItem?.extent;if(e&&t){if(e.isWGS84)return t.clone();if(e.isWebMercator)return P(t);return(await import("./portal/support/geometryServiceUtils.js")).getGeometryServiceURL(this.portalItem).then((r=>{const i=new B;return i.geometries=[t],i.outSpatialReference=e,E(r,i)})).then((e=>e[0])).catch((e=>(l.getLogger(this.declaredClass).error("Error projecting item's extent:",e),null)))}return null}_removeDanglingLayerRefs(){const e=this.applicationProperties,t=e&&e.viewing&&e.viewing.search,r=e=>this.allLayers.some((t=>t.id===e));t&&t.layers&&(t.layers=t.layers.filter((e=>r(e.id)))),t&&t.tables&&(t.tables=t.tables.filter((e=>this.tables.some((t=>t.id===e.id)))));const i=e&&e.editing&&e.editing.locationTracking;i&&i.info&&!r(i.info.layerId)&&(e.editing=null);const o=this.presentation&&this.presentation.slides;o&&o.forEach((e=>{e.visibleLayers&&(e.visibleLayers=e.visibleLayers.filter((e=>r(e.id))))}))}async _validateMap(){if(!this.basemap?.baseLayers.length)throw new a("webmap:save","Map does not have a valid basemap with a base layer.");let e=null;if(await y((()=>{const t=D(this.initialViewProperties,this.basemap);return e=t.spatialReference,!t.updating})),!O(e,this.initialViewProperties.spatialReference))throw new a("webmap:save","The spatial reference of the basemap is not compatible with the one from the map.",{expected:this.initialViewProperties.spatialReference,actual:e})}_validateItem(){if(!this.portalItem)throw l.getLogger(this.declaredClass).error("save: requires the portalItem property to be set"),new a("webmap:portal-item-not-set","Portal item to save to has not been set on the WebMap");this._validateItemType(this.portalItem)}_validateItemType(e){if(e.type!==ie)throw new a("webmap:portal-item-wrong-type",`Portal item needs to have type "${ie}"`)}_loadLayerContainers(){const e=[];return this.basemap&&e.push(this.basemap.load()),this.ground&&e.push(this.ground.load()),c(e).then((()=>{}))}async _beforeSave(){const e=[];for(const t of this.allLayers)if("beforeSave"in t&&"function"==typeof t.beforeSave){const r=t.beforeSave();r&&e.push(r)}await c(e)}_loadAllLayers(){const e=this._getAllLayersAndTables().map((e=>e.load()));return c(e).then((()=>{}))}_getAllLayersAndTables(){return this.allLayers.concat(this.allTables)}_validateJSONForWriting(e,t){let r=e.messages.filter((e=>"error"===e.type)).map((e=>new a(e.name,e.message,e.details)));if(t.ignoreUnsupported&&(r=r.filter((e=>"layer:unsupported"!==e.name&&"symbol:unsupported"!==e.name&&"symbol-layer:unsupported"!==e.name&&"property:unsupported"!==e.name&&"url:unsupported"!==e.name))),r.length>0)throw new a("webmap:save","Failed to save webmap due to unsupported or invalid content. See 'details.errors' for more detailed information",{errors:r})}async _updateItemProperties(e){e.extent=await this._getWGS84Extent(this.initialViewProperties.viewpoint.targetGeometry),await this._updateTypeKeywords(e)}async _updateItemPropertiesForSaveAs(e){k(e,pe),k(e,fe),k(e,x.METADATA),k(e,ue),k(e,we),k(e,ge),k(e,ce),k(e,ye),await this._updateItemProperties(e)}async _getWGS84Extent(e){const t=e.clone().normalize();let r;if(t.length>1)for(const i of t)r?i.width>r.width&&(r=i):r=i;else r=t[0];return this._projectToWGS84(r)}async _projectToWGS84(e){const t=e.spatialReference;if(t.isWGS84)return e.clone();if(t.isWebMercator)return V(e);const r=await import("./portal/support/geometryServiceUtils.js"),i=await r.getGeometryServiceURL(this.portalItem),o=new B;o.geometries=[e],o.outSpatialReference=L.WGS84;return(await E(i,o))[0]}async _updateTypeKeywords(e){M(e,le),await this._loadAllLayers(),this._evalCollectorKeyword(e),this._evalDataEditingKeyword(e),this._evalOfflineKeyword(e),this._evalDeveloperBasemapKeyword(e),e.typeKeywords&&(e.typeKeywords=e.typeKeywords.filter(((e,t,r)=>r.indexOf(e)===t)))}_evalCollectorKeyword(e){N(e,pe)||N(e,ce)||N(e,ye)||N(e,ge)||!this._hasEditableFeatureLayer()?k(e,me):M(e,me)}_evalDataEditingKeyword(e){this._hasEditableFeatureLayer()?M(e,he):k(e,he)}_evalOfflineKeyword(e){!N(e,ue)&&this._isOfflineCapableMap()?M(e,de):k(e,de)}_evalDeveloperBasemapKeyword(e){G(this.basemap)?M(e,be):k(e,be)}_hasEditableFeatureLayer(){return this._getAllLayersAndTables().some((e=>e.loaded&&T(e)&&e.capabilities.operations.supportsEditing&&e.editingEnabled))}_isOfflineCapableMap(){return this._getAllLayersAndTables().filter((e=>"group"!==e.type)).every((e=>e.loaded&&this._isOfflineCapableLayer(e)))}_isFeatureCollectionLike(e){return F(e)||"map-notes"===e.type||"route"===e.type}_isOfflineCapableLayer(e){return T(e)&&e.capabilities.operations.supportsSync||this._isFeatureCollectionLike(e)&&!e.portalItem||("tile"===e.type||"vector-tile"===e.type)&&(e.capabilities.operations.supportsExportTiles||this._isExportableAGOLTileLayer(e)||J(e))&&e.spatialReference.equals(this.initialViewProperties.spatialReference)}_isExportableAGOLTileLayer(e){return"tile"===e.type&&(U(e.url)&&_e.some((t=>e.url.toLowerCase().includes("/"+t+"/"))))}async _updateItem(e,t,r){await e.update({data:t}),this._syncUpInstanceWithItem(e,t,r)}async _createItem(e,t,r,i){const o=this.portalItem,s=!!(o&&o.id&&o.portal.user),n=e.portal;if(await n._signIn(),!await this._canCopyItem(o,s,n))throw new a("webmap:save-as-copy-not-allowed","Owner of this map does not allow others to save a copy");await n.user.addItem({item:e,folder:i.folder,data:t}),this.portalItem=e,this._syncUpInstanceWithItem(e,t,r)}async _canCopyItem(e,t,r){return!(m(e)&&e.id&&e.typeKeywords&&e.typeKeywords.includes("useOnly"))||e.portal.portalHostname===r.portalHostname&&(t||await e.reload(),"admin"===e.itemControl||"update"===e.itemControl)}_syncUpInstanceWithItem(e,t,r){u.prototype.read.call(this,{version:t.version,authoringApp:t.authoringApp,authoringAppVersion:t.authoringAppVersion},{origin:"web-map",ignoreDefaults:!0,url:e.itemUrl&&g(e.itemUrl)}),S(r),this.resourceInfo=t}async _updateItemThumbnail(){this.thumbnailUrl&&this._isOverridden("thumbnailUrl")&&(await this.portalItem.updateThumbnail({thumbnail:this.thumbnailUrl,filename:this._thumbnailFilename}),this._clearThumbnailOverride())}_getPortalItem(e){let t=C.from(e);return t.id&&(t=t.clone(),t.id=null),t.type||(t.type=ie),t.portal||(t.portal=W.getDefault()),this._validateItemType(t),t}async _updateFromInternal(e,t){if(t=t||{},await y((()=>e.ready)),this._updateInitialViewProperties(e,t),e.map===this)for(const r of e.allLayerViews)for(const e of["visible","featureEffect"])e in r&&e in r.layer&&r._isOverridden(e)&&(r.layer[e]=r[e]);await this._updateThumbnailUrl(e,t)}_updateInitialViewProperties(e,t){if(t.backgroundExcluded||(this.initialViewProperties.background=e.background?.clone()),this.initialViewProperties.spatialReference=e.spatialReference.clone(),t.viewpointExcluded||(this.initialViewProperties.viewpoint=new i({rotation:e.rotation,scale:t.scalePreserved?e.scale:null,targetGeometry:this._getViewExtent(e)})),!t.widgetsExcluded)for(const r of e.persistableViewModels)r.updateWebDocument(this)}_getViewExtent(e){const t=e.center.clone().normalize(),r=e.extent.clone(),i=r.width/2;return r.xmin=t.x-i,r.xmax=t.x+i,r}async _updateThumbnailUrl(e,t){if(t.thumbnailExcluded)return;const r=H(e,t.thumbnailSize),i=await e.takeScreenshot({format:"png",width:r.width,height:r.height});this._setAutoGeneratedThumbnail(i.dataUrl)}_setAutoGeneratedThumbnail(e){this.thumbnailUrl=e,this._thumbnailFilename=null}_clearThumbnailOverride(){this._clearOverride("thumbnailUrl"),this.clear("thumbnailUrl","user"),this._thumbnailFilename=null}_generateCustomThumbnailFilename(e){if(w(e)){const t=f(e),r=t&&t.mediaType,i=r&&se.get(r.toLowerCase())||null,o=`thumbnail${Date.now()}`;return i?`${o}.${i}`:o}return null}_getThumbnailState(){let e=this.thumbnailUrl;return e&&(e=this._isOverridden("thumbnailUrl")?e:b(e,"w","8192")),{thumbnailUrl:e,filename:this._thumbnailFilename}}_restoreThumbnailFromState(e){this.thumbnailUrl=e.thumbnailUrl,this._thumbnailFilename=e.filename}_getAuthoringPropsState(){return{authoringApp:this.authoringApp,authoringAppVersion:this.authoringAppVersion,isAuthoringAppSetByUser:this._isAuthoringAppSetByUser,isAuthoringAppVersionSetByUser:this._isAuthoringAppVersionSetByUser}}_restoreAuthoringPropsFromState(e){e.isAuthoringAppSetByUser?this.authoringApp=e.authoringApp:this._isAuthoringAppSetByUser=!1,e.isAuthoringAppVersionSetByUser?this.authoringAppVersion=e.authoringAppVersion:this._isAuthoringAppVersionSetByUser=!1}static fromJSON(e){const t=e;if(!t)throw new a("webmap:empty-resource","Expected a JSON resource but got nothing");return new this({resourceInfo:t})}};ve.VERSION=re,e([_({type:X,json:{write:!0}})],ve.prototype,"applicationProperties",void 0),e([_({type:String,json:{write:{allowNull:!0,ignoreOrigin:!0}}})],ve.prototype,"authoringApp",null),e([A("authoringApp")],ve.prototype,"writeAuthoringApp",null),e([_({type:String,json:{write:{allowNull:!0,ignoreOrigin:!0}}})],ve.prototype,"authoringAppVersion",null),e([A("authoringAppVersion")],ve.prototype,"writeAuthoringAppVersion",null),e([_({json:{read:{source:"baseMap"},write:{target:"baseMap"}}})],ve.prototype,"basemap",void 0),e([_({type:oe,json:{write:{overridePolicy:e=>({enabled:!!(e&&e.length>0),ignoreOrigin:!0})}}})],ve.prototype,"bookmarks",void 0),e([_({type:K,json:{read:{source:"mapFloorInfo"},write:{target:"mapFloorInfo"}}})],ve.prototype,"floorInfo",void 0),e([_({type:$,json:{write:!0}})],ve.prototype,"geotriggersInfo",void 0),e([_({type:Z,nonNullable:!0,json:{read:{source:["background","initialState.viewpoint","mapRangeInfo","spatialReference"]},write:{ignoreOrigin:!0,target:{background:{type:te},"initialState.viewpoint":{type:i},mapRangeInfo:{type:z},spatialReference:{type:L}}}}})],ve.prototype,"initialViewProperties",void 0),e([v("initialViewProperties")],ve.prototype,"readInitialViewProperties",null),e([A("initialViewProperties")],ve.prototype,"writeInitialViewProperties",null),e([_({json:{read:!1,write:{target:"operationalLayers",ignoreOrigin:!0}}})],ve.prototype,"layers",void 0),e([A("layers")],ve.prototype,"writeLayers",null),e([_({type:C})],ve.prototype,"portalItem",void 0),e([_({json:{write:!0}})],ve.prototype,"presentation",void 0),e([_()],ve.prototype,"resourceInfo",void 0),e([_({readOnly:!0,type:ee,json:{read:{source:"version"},write:{allowNull:!0,ignoreOrigin:!0,target:"version",isRequired:!0}}})],ve.prototype,"sourceVersion",void 0),e([v("sourceVersion")],ve.prototype,"readSourceVersion",null),e([A("sourceVersion")],ve.prototype,"writeSourceVersion",null),e([_({json:{read:!1,write:{ignoreOrigin:!0}}})],ve.prototype,"tables",void 0),e([A("tables")],ve.prototype,"writeTables",null),e([_()],ve.prototype,"thumbnailUrl",null),e([_({type:q,json:{write:!0}})],ve.prototype,"widgets",void 0),e([_({type:ae,json:{read:!0,write:!0}})],ve.prototype,"utilityNetworks",void 0),ve=e([I("esri.WebMap")],ve);const Ie=ve;export{Ie as default};
|
package/WebScene.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.25/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"./chunks/tslib.es6.js";import{version as t}from"./kernel.js";import r from"./Map.js";import i from"./Viewpoint.js";import o from"./core/Collection.js";import s from"./core/Error.js";import a from"./core/Handles.js";import"./core/has.js";import{clone as n}from"./core/lang.js";import l from"./core/Loadable.js";import{loadAll as p}from"./core/loadAll.js";import c from"./core/Logger.js";import{isSome as d}from"./core/maybe.js";import{MultiOriginJSONMixin as h,MultiOriginJSONSupport as u}from"./core/MultiOriginJSONSupport.js";import{EsriPromiseMixin as m}from"./core/Promise.js";import{debounce as y,eachAlways as w}from"./core/promiseUtils.js";import{urlToObject as g,addQueryParameter as f}from"./core/urlUtils.js";import{property as v}from"./core/accessorSupport/decorators/property.js";import"./core/accessorSupport/ensureType.js";import{reader as b}from"./core/accessorSupport/decorators/reader.js";import{subclass as S}from"./core/accessorSupport/decorators/subclass.js";import{writer as A}from"./core/accessorSupport/decorators/writer.js";import{updateOrigins as I}from"./core/accessorSupport/originUtils.js";import{readLoadable as _}from"./core/accessorSupport/read.js";import j from"./geometry/Extent.js";import R from"./geometry/HeightModelInfo.js";import{canProjectWithoutEngine as L}from"./geometry/projection.js";import P from"./geometry/SpatialReference.js";import{validateWebSceneError as V}from"./geometry/support/heightModelInfoUtils.js";import{fromJSON as U}from"./geometry/support/jsonUtils.js";import{isEarth as M}from"./geometry/support/spatialReferenceUtils.js";import O from"./portal/Portal.js";import E from"./portal/PortalItem.js";import C from"./support/MapFloorInfo.js";import{createSchemaValidationError as N,createCopyError as T}from"./support/webSceneUtils.js";import{ViewingMode as G}from"./views/ViewingMode.js";import{isSpatialReferenceSupported as F}from"./views/support/spatialReferenceSupport.js";import{saveResources as $}from"./webdoc/support/saveUtils.js";import{getOptimalThumbnailSize as W}from"./webdoc/support/thumbnailUtils.js";import J from"./webscene/ApplicationProperties.js";import x from"./webscene/Environment.js";import k from"./webscene/InitialViewProperties.js";import B from"./webscene/Presentation.js";import q from"./webscene/TransportationNetwork.js";import{Version as K}from"./webscene/Version.js";const D=new K(1,29),H=()=>{const e=8,t=[],r=D.major;for(let i=e;i<=D.minor;i++)t.push(`${r}.${i}`);return t},z="Web Scene",Q="ViewingMode-Local";let X=class extends(l.LoadableMixin(m(h(r)))){constructor(e){super(e),this._handles=new a,this.applicationProperties=null,this.clippingArea=null,this.clippingEnabled=!1,this.floorInfo=null,this.heightModelInfo=null,this.sourceVersion=null,this.transportationNetworks=null,this.presentation=new B,this.initialViewProperties=new k,this.portalItem=null,this.resourceInfo=null,this._debouncedSaveOperations=y((async(e,t,r)=>{switch(e){case Y.SAVE:return this._saveImpl(t);case Y.SAVE_AS:return this._saveAsImpl(r,t)}})),this.resourceReferences={portalItem:null,paths:[]},this.authoringApp=null,this.authoringAppVersion=null,this._isAuthoringAppSetByUser=!1,this._isAuthoringAppVersionSetByUser=!1}initialize(){if(this.when().catch((e=>{c.getLogger(this.declaredClass).error("#load()","Failed to load web scene",e)})),this.resourceInfo){let t;try{t=this._validateJSON(this.resourceInfo)}catch(e){return void this.addResolvingPromise(Promise.reject(e))}this.read(t),this.addResolvingPromise(this._validateSpatialReference()),this.addResolvingPromise(this._validateHeightModelInfo())}this._handles.add(this.allLayers.on("change",(()=>this._scheduleLayersIdGC())))}destroy(){this._unscheduleLayersIdGC(),this._handles.destroy(),this.presentation&&this.presentation.destroy();const e=this.portalItem;this.portalItem=null,e?.destroy()}writeClippingArea(e,t){t.clippingArea||(t.clippingArea={}),t.clippingArea.geometry=e.toJSON()}readClippingEnabled(e,t){return!!t.clippingArea&&!!t.clippingArea.clip}writeClippingEnabled(e,t){this.clippingArea&&(t.clippingArea||(t.clippingArea={}),t.clippingArea.clip=e)}writeLayers(e,t,r,i){const o={...i,layerContainerType:"operational-layers"},s=e.map((e=>this.verifyWriteLayer(e,i)?e.write({},o):null)).filter((e=>!!e));t[r]=s.toArray()}verifyWriteLayer(e,t){return"write"in e||(t&&t.messages&&t.messages.push(new s("layer:unsupported",`Layers (${e.title}, ${e.id}) of type '${e.declaredClass}' cannot be persisted in web scenes`,{layer:e})),!1)}readSourceVersion(e,t){const[r,i]=t.version.split(".");return new K(parseInt(r,10),parseInt(i,10))}writeSourceVersion(e,t,r){t[r]=`${D.major}.${D.minor}`}get thumbnailUrl(){return this.portalItem&&this.portalItem.thumbnailUrl||null}set thumbnailUrl(e){e?this._override("thumbnailUrl",e):(this._clearOverride("thumbnailUrl"),this.clear("thumbnailUrl","user"))}set authoringApp(e){this._isAuthoringAppSetByUser=!0,this._set("authoringApp",e)}writeAuthoringApp(e,t){e&&this._isAuthoringAppSetByUser?t.authoringApp=e:t.authoringApp="ArcGIS API for JavaScript"}set authoringAppVersion(e){this._isAuthoringAppVersionSetByUser=!0,this._set("authoringAppVersion",e)}writeAuthoringAppVersion(e,r){e&&this._isAuthoringAppVersionSetByUser?r.authoringAppVersion=e:r.authoringAppVersion=t}writeGround(e,t,r,i){t[r]=e?e.write({},i):{transparency:0,layers:[]}}readInitialViewProperties(e,t){const r={};return t.initialState&&t.initialState.environment&&(r.environment=x.fromJSON(t.initialState.environment)),t.spatialReference?r.spatialReference=P.fromJSON(t.spatialReference):r.spatialReference=P.WebMercator,r.viewingMode=t.viewingMode||"global",t.initialState&&t.initialState.viewpoint&&(r.viewpoint=i.fromJSON(t.initialState.viewpoint)),new k(r)}get spatialReference(){return this.initialViewProperties?.spatialReference??P.WebMercator}get viewingMode(){return this.initialViewProperties?.viewingMode??"global"}load(e){return this.addResolvingPromise(this._loadFromSource()),Promise.resolve(this)}loadAll(){return p(this,(e=>{const t=this.presentation&&this.presentation.slides;e(this.ground,this.basemap,this.layers,t&&t.map((e=>e.basemap)))}))}read(e,t){t={...t,origin:"web-scene"};const r=this._isAuthoringAppVersionSetByUser,i=this._isAuthoringAppSetByUser;if(_(this,e,(t=>super.read(e,t)),t),i||(this._isAuthoringAppSetByUser=!1),r||(this._isAuthoringAppVersionSetByUser=!1),e.baseMap&&Array.isArray(e.baseMap.elevationLayers)&&this.sourceVersion.supportsVisibleElevationLayersInSlides){const t=e.baseMap.elevationLayers.map((e=>({id:e.id}))),r=this.presentation.slides,i=(e,t)=>e.visibleLayers.some((e=>e.id===t)),o=t.filter((e=>!r.some((t=>i(t,e.id)))));r.forEach((e=>{e.visibleLayers.addMany(o)}))}}_writeBasemapElevationLayers(e){const t=e.ground&&e.ground.layers;!e.baseMap&&t&&t.length&&(e.baseMap={title:"Basemap",baseMapLayers:[]}),e.baseMap&&(e.baseMap.elevationLayers=n(t))}write(e,t){if("loaded"!==this.loadStatus){const e=new s("webscene:not-loaded","Web scene must be loaded before it can be serialized");throw c.getLogger(this.declaredClass).error("#toJSON()","Web scene must be loaded before it can be serialized",this.loadError||this.loadStatus),e}this._runLayersIdGC();const r=!t?.messages;t={messages:[],...t,origin:"web-scene"};const i=super.write(e,t);if(r){const e=t.messages.filter((e=>"web-document-write:property-required"===e.name));if(e.length){const t=new s("web-document:property-required","One or more properties that are required in the webscene JSON are missing, see details for the specific errors",{errors:e});throw c.getLogger(this.declaredClass).error("#toJSON()","One or more properties that are required in the webscene JSON are missing",e),t}}return this._writeBasemapElevationLayers(i),i}async save(e){return this._debouncedSaveOperations(Y.SAVE,e)}async _saveImpl(e){this.portalItem||(c.getLogger(this.declaredClass).error("save(): requires the .portalItem property to be set"),await Promise.reject(new s("webscene:portal-item-not-set","Portal item to save to has not been set on the WebScene"))),this.portalItem.type!==z&&await Promise.reject(new s("webscene:portal-item-wrong-type",`Portal item needs to have type "${z}"`));const t=this._updateFromPromise;await this._ensureLoadBeforeSave();const r=this._enableVerifyItemRelativeUrls({origin:"web-scene",url:this.portalItem.itemUrl&&g(this.portalItem.itemUrl),messages:[],portal:this.portalItem.portal||O.getDefault(),portalItem:this.portalItem,writtenProperties:[],blockedRelativeUrls:[],resources:{toAdd:[],toUpdate:[],toKeep:[],pendingOperations:[]}}),i=this.write({},r);return await Promise.all(r.resources.pendingOperations),await this._verifySave(i,r,e),this._updateTypeKeywords(this.portalItem),await this.portalItem.update({data:i}),await $(this.resourceReferences,r,null),I(r),t&&await t,await this._saveThumbnail(),this.portalItem}async saveAs(e,t){return this._debouncedSaveOperations(Y.SAVE_AS,t,e)}async _saveAsImpl(e,t){let r=E.from(e);r||(c.getLogger(this.declaredClass).error("saveAs(portalItem): requires a portal item parameter"),await Promise.reject(new s("webscene:portal-item-required","saveAs requires a portal item to save to"))),r.id&&(r=r.clone(),r.id=null);const i=r.portal||O.getDefault();await this._ensureLoadBeforeSave(),r.type=z,r.portal=i;const o=this._enableVerifyItemRelativeUrls({origin:"web-scene",url:null,messages:[],portal:i,portalItem:r,writtenProperties:[],blockedRelativeUrls:[],resources:{toAdd:[],toUpdate:[],toKeep:[],pendingOperations:[]}}),a=this.write({},o);await Promise.all(o.resources.pendingOperations),await this._verifySaveAs(a,o,t);const n=this.thumbnailUrl,l=!this._isOverridden("thumbnailUrl");return this._updateTypeKeywords(r),await i._signIn(),await i.user.addItem({item:r,folder:t&&t.folder,data:a}),await $(this.resourceReferences,o,null),this.portalItem=r,u.prototype.read.call(this,{version:a.version,authoringApp:a.authoringApp,authoringAppVersion:a.authoringAppVersion},{name:"web-scene",ignoreDefaults:!0,url:r.itemUrl&&g(r.itemUrl)}),I(o),n&&(this.thumbnailUrl=l?f(n,"w","8192"):n),o.portalItem=r,await this._saveThumbnail(),r}async _saveThumbnail(){this._isOverridden("thumbnailUrl")&&(await this.portalItem.updateThumbnail({thumbnail:this.thumbnailUrl}),this._clearOverride("thumbnailUrl"),this.clear("thumbnailUrl","user"))}_verifySave(e,t,r,i=!1){if(!M(this.spatialReference))return Promise.reject(new s("webscene:unsupported-spatial-reference","Webscenes using spatial reference systems from Mars or Moon can not be saved currently."));let o,a=t.messages.filter((e=>"error"===e.type)).map((e=>new s(e.name,e.message,e.details)));t.blockedRelativeUrls&&(a=a.concat(t.blockedRelativeUrls.map((e=>new s("url:unsupported",`Relative url '${e}' is not supported in Web Scene`))))),r&&r.ignoreUnsupported&&(a=a.filter((e=>"layer:unsupported"!==e.name&&"symbol:unsupported"!==e.name&&"symbol-layer:unsupported"!==e.name&&"property:unsupported"!==e.name&&"url:unsupported"!==e.name&&"scenemodification:unsupported"!==e.name))),r?.requiredPropertyChecksDisabled&&(a=a.filter((e=>"web-document-write:property-required"!==e.name)));const n=r&&r.strictSchemaValidationEnabled;return o=n?import("./webscene/support/schemaValidator.js").then((t=>{const r=t.validate(e);if(r.length>0){const e=`webscene did not validate:\n${r.join("\n")}`;c.getLogger(this.declaredClass).error(`${i?"saveAs":"save"}(): ${e}`)}return r.map((e=>new s("webscene:schema-validation",e)))})).then((e=>{if(n&&e.length>0){throw N(e.concat(a))}return a})):Promise.resolve(a),o.then((e=>{if(e.length>0)throw new s("webscene:save","Failed to save webscene due to unsupported or invalid content. See 'details.errors' for more detailed information",{errors:e})}))}_verifySaveAs(e,t,r){return this.canNotSaveAs(t)?Promise.reject(T()):this._verifySave(e,t,r,!0)}verifySaveAs(e){const t=this._enableVerifyItemRelativeUrls({origin:"web-scene",messages:[]}),r=this.write({},t);return this._verifySaveAs(r,t,e)}canNotSaveAs(e){return e||(e=this._enableVerifyItemRelativeUrls({origin:"web-scene",messages:[]}),this.write({},e)),e.verifyItemRelativeUrls&&e.verifyItemRelativeUrls.writtenUrls.length>0}async updateFrom(e,t={}){const r=this._updateFrom(e,t);this._updateFromPromise=r,await r;this._updateFromPromise===r&&(this._updateFromPromise=null)}async _updateFrom(e,t={}){if(await e.whenReady(),!t.environmentExcluded&&e.environment&&(this.initialViewProperties.environment=x.prototype.clone.apply(e.environment)),!t.viewpointExcluded&&e.viewpoint&&(this.initialViewProperties.viewpoint=e.viewpoint.clone()),this.initialViewProperties.spatialReference=e.spatialReference.clone(),this.initialViewProperties.viewingMode=e.viewingMode,d(e.clippingArea)?e.clippingArea!==this.clippingArea&&(this.clippingArea=e.clippingArea.clone(),this.clippingEnabled=!0):this.clippingEnabled=!1,e.heightModelInfo&&(this.heightModelInfo=e.heightModelInfo.clone()),e.map===this)for(const r of e.allLayerViews){const e="visible";e in r&&e in r.layer&&r._isOverridden(e)&&(r.layer[e]=r[e])}(!1===t.thumbnailExcluded||null==t.thumbnailExcluded&&!t.viewpointExcluded)&&await this._updateFromThumbnail(e,t.thumbnailSize||void 0)}async _updateFromThumbnail(e,t){const r=W(e,t),i=await e.takeScreenshot({format:"jpg",width:r.width,height:r.height,disableDecorations:!0});this.thumbnailUrl=i.dataUrl}_loadFromSource(){return this.resourceInfo?this._loadFromJSON(this.resourceInfo,{origin:"web-scene"}):this.portalItem&&this.portalItem.id?this._loadFromItem(this.portalItem):this._loadObjectsWithLayers()}_readAndLoadFromJSON(e,t){const r=this._validateJSON(e);return this.read(r,t),this._loadFromJSON(r,t)}_extractOperationalLayers(e){const t=[];if(!this.sourceVersion.supportsGround&&e.baseMap&&Array.isArray(e.baseMap.elevationLayers))for(const o of e.baseMap.elevationLayers)t.push(o);const r=[],i=e=>(e.layers&&(e.layers=e.layers.filter(i)),"ArcGISTiledElevationServiceLayer"!==e.layerType||(this.sourceVersion.supportsGround||r.push(e),!1));return{operationalLayers:e.operationalLayers?e.operationalLayers.filter(i):[],operationalElevationLayers:r,basemapElevationLayers:t}}_loadFromJSON(e,t){const r=new o;return this._validateSpatialReference().then((()=>this._validateHeightModelInfo())).then((()=>import("./layers/support/layersCreator.js"))).then((({populateOperationalLayers:i})=>{const{operationalLayers:o,operationalElevationLayers:s,basemapElevationLayers:a}=this._extractOperationalLayers(e),n=[],l={context:{...t,layerContainerType:"operational-layers"}};if(this.portalItem&&(l.context.portal=this.portalItem.portal||O.getDefault()),a.length>0){const e={...l,context:{...l.context,layerContainerType:"ground"}};e.defaultLayerType="ArcGISTiledElevationServiceLayer",n.push(i(this.ground.layers,a,e))}if(s.length>0){const e={...l,context:{...l.context,layerContainerType:"ground"}};e.defaultLayerType="ArcGISTiledElevationServiceLayer",n.push(i(r,s,e))}return o&&o.length>0&&n.push(i(this.layers,o,l)),w(n).then((()=>{}))})).then((()=>this._loadObjectsWithLayers())).then((()=>{this.ground.layers.addMany(r)}))}async _ensureLoadBeforeSave(){await this.load(),await this._loadObjectsWithLayers();const e=[];for(const t of this.allLayers.items)if("beforeSave"in t&&"function"==typeof t.beforeSave){const r=t.beforeSave();r&&e.push(r)}await w(e)}async _loadObjectsWithLayers(){const e=[];this.ground&&e.push(this.ground.load()),this.basemap&&e.push(this.basemap.load()),this.presentation.slides.forEach((t=>{t.basemap&&e.push(t.basemap.load())})),await w(e)}async _loadFromItem(e){if(await e.load().catch((e=>{throw new s("webscene:load-portal-item","Failed to load portal item",{error:e})})),"Web Scene"!==e.type)throw new s("webscene:invalid-portal-item","Invalid portal item type '${type}', expected 'Web Scene'",{type:e.type});const t=await e.fetchData();this.resourceInfo=t;const r={origin:"web-scene",url:g(e.itemUrl),portal:e.portal||O.getDefault(),portalItem:e,readResourcePaths:[]};await this._readAndLoadFromJSON(t,r),this.resourceReferences={portalItem:e,paths:r.readResourcePaths}}_validateSpatialReference(){const e=this.initialViewProperties,t=this._sceneSpatialReference;let r;if("local"!==e.viewingMode){if(!F(t,G.Global))return Promise.reject(new s("webscene:unsupported-spatial-reference","Unsupported spatial reference (${spatialReference.wkid}) in global mode, only Web Mercator, WGS84 GCS or CGCS2000 are supported",{spatialReference:t,viewingMode:e.viewingMode}));r=e=>!e||L(e,t)}else{if(!F(t,G.Local))return Promise.reject(new s("webscene:unsupported-spatial-reference","Unsupported spatial reference (${spatialReference.wkid}) in local mode, only projected coordinate systems are supported",{spatialReference:t,viewingMode:e.viewingMode}));r=e=>!e||e.equals(t)}const i=e=>e&&(d(e.camera)&&e.camera.position&&e.camera.position.spatialReference||d(e.targetGeometry)&&e.targetGeometry.spatialReference),o=e.viewpoint,a=i(o);if(a&&!r(a))return Promise.reject(new s("webscene:incompatible-camera-spatial-reference","Camera spatial reference (${cameraSpatialReference.wkid}) is incompatible with the scene spatial reference (${sceneSpatialReference.wkid})",{cameraSpatialReference:a,sceneSpatialReference:t,viewingMode:e.viewingMode}));const n=this.presentation.slides.find((e=>!r(i(e.viewpoint))));if(n){const r=i(n.viewpoint);return Promise.reject(new s("webscene:incompatible-slide-spatial-reference","Slide spatial reference (${slideSpatialReference.wkid}) is incompatible with the scene spatial reference (${sceneSpatialReference.wkid})",{slideSpatialReference:r,sceneSpatialReference:t,viewingMode:e.viewingMode}))}return Promise.resolve()}_validateHeightModelInfo(){const e=this._sceneSpatialReference,t=V(this.heightModelInfo,e);return t?Promise.reject(t):Promise.resolve()}_validateJSON(e){const t=K.parse(e.version||"","webscene");return D.validate(t),e.version=`${t.major}.${t.minor}`,1===t.major&&t.minor<=2&&(e.spatialReference=P.WebMercator.toJSON()),e}_updateTypeKeywords(e){"local"===this.initialViewProperties.viewingMode?e.typeKeywords?e.typeKeywords.includes(Q)||e.typeKeywords.push(Q):e.typeKeywords=[Q]:"global"===this.initialViewProperties.viewingMode&&e.typeKeywords&&(e.typeKeywords=e.typeKeywords.filter((e=>e!==Q))),e.typeKeywords&&(e.typeKeywords=e.typeKeywords.filter(((e,t,r)=>r.indexOf(e)===t)))}get _sceneSpatialReference(){return this.initialViewProperties.spatialReference||P.WebMercator}get _verifyItemRelativeRootPath(){return this.portalItem&&this.portalItem.itemUrl?g(this.portalItem.itemUrl).path:null}_enableVerifyItemRelativeUrls(e){const t=this._verifyItemRelativeRootPath;return t&&(e.verifyItemRelativeUrls={rootPath:t,writtenUrls:[]}),e}_unscheduleLayersIdGC(){this._layersIdGCTimeoutId&&(clearTimeout(this._layersIdGCTimeoutId),this._layersIdGCTimeoutId=0)}_scheduleLayersIdGC(){this._unscheduleLayersIdGC(),this._layersIdGCTimeoutId=setTimeout((()=>{this._layersIdGCTimeoutId=0,this._runLayersIdGC()}),3e3)}_runLayersIdGC(){this._unscheduleLayersIdGC();const e=this.applicationProperties&&this.applicationProperties.viewing&&this.applicationProperties.viewing.search,t=e=>this.allLayers.some((t=>t.id===e));e&&e.layers&&(e.layers=e.layers.filter((e=>t(e.id))));const r=this.presentation&&this.presentation.slides;r&&r.forEach((e=>{e.visibleLayers&&(e.visibleLayers=e.visibleLayers.filter((e=>t(e.id))))}))}static fromJSON(e){if(!e)throw new s("webscene:empty-resource","Expected a JSON resource but got nothing");return new this({resourceInfo:e})}};var Y;X.version=`${D.major}.${D.minor}`,e([v({type:J,json:{write:!0}})],X.prototype,"applicationProperties",void 0),e([v({json:{read:{source:"baseMap"},write:{target:"baseMap"}}})],X.prototype,"basemap",void 0),e([v({type:j,json:{read:{source:"clippingArea.geometry",reader:U},write:{target:"clippingArea.geometry"}}})],X.prototype,"clippingArea",void 0),e([A("clippingArea")],X.prototype,"writeClippingArea",null),e([v({type:Boolean,json:{write:{target:"clippingArea.clip"}}})],X.prototype,"clippingEnabled",void 0),e([b("clippingEnabled",["clippingArea"])],X.prototype,"readClippingEnabled",null),e([A("clippingEnabled")],X.prototype,"writeClippingEnabled",null),e([v({type:C,json:{read:{source:"mapFloorInfo"},write:{target:"mapFloorInfo"}}})],X.prototype,"floorInfo",void 0),e([v({type:R,json:{write:!0}})],X.prototype,"heightModelInfo",void 0),e([v({json:{write:{target:"operationalLayers",ignoreOrigin:!0}}})],X.prototype,"layers",void 0),e([A("layers")],X.prototype,"writeLayers",null),e([v({readOnly:!0,type:K,json:{type:H(),write:{ignoreOrigin:!0,target:"version",isRequired:!0,overridePolicy:()=>({enabled:!0,allowNull:!0,ignoreOrigin:!0})}}})],X.prototype,"sourceVersion",void 0),e([b("sourceVersion",["version"])],X.prototype,"readSourceVersion",null),e([A("sourceVersion")],X.prototype,"writeSourceVersion",null),e([v({json:{read:!1,write:!1}})],X.prototype,"tables",void 0),e([v()],X.prototype,"thumbnailUrl",null),e([v({type:String,json:{write:{writerEnsuresNonNull:!0,ignoreOrigin:!0}}})],X.prototype,"authoringApp",null),e([A("authoringApp")],X.prototype,"writeAuthoringApp",null),e([v({type:String,json:{write:{writerEnsuresNonNull:!0,ignoreOrigin:!0}}})],X.prototype,"authoringAppVersion",null),e([A("authoringAppVersion")],X.prototype,"writeAuthoringAppVersion",null),e([v({json:{write:{isRequired:!0,allowNull:!0,ignoreOrigin:!0,enabled:!0}}})],X.prototype,"ground",void 0),e([A("ground")],X.prototype,"writeGround",null),e([v({type:o.ofType(q),json:{write:!0}})],X.prototype,"transportationNetworks",void 0),e([v({type:B,nonNullable:!0,json:{write:{ignoreOrigin:!0,writer:(e,t,r,i)=>{if(e.slides&&e.slides.length>0){const r={...i,isPresentation:!0};t.presentation=e.write({},r)}}}}})],X.prototype,"presentation",void 0),e([v({type:k,nonNullable:!0,json:{write:{target:"initialState",isRequired:!0,ignoreOrigin:!0},default:()=>new k({viewingMode:"global",spatialReference:P.WebMercator})}})],X.prototype,"initialViewProperties",void 0),e([b("initialViewProperties",["initialState.environment","spatialReference","viewingMode","initialState.viewpoint"])],X.prototype,"readInitialViewProperties",null),e([v({type:P,json:{read:!1,write:{isRequired:!0,ignoreOrigin:!0}}})],X.prototype,"spatialReference",null),e([v({type:["local","global"],json:{read:!1,write:{isRequired:!0,ignoreOrigin:!0}}})],X.prototype,"viewingMode",null),e([v({type:E})],X.prototype,"portalItem",void 0),e([v()],X.prototype,"resourceInfo",void 0),X=e([S("esri.WebScene")],X),function(e){e[e.SAVE=0]="SAVE",e[e.SAVE_AS=1]="SAVE_AS"}(Y||(Y={}));const Z=X;export{Z as default};
|
|
5
|
+
import{_ as e}from"./chunks/tslib.es6.js";import{version as t}from"./kernel.js";import r from"./Map.js";import i from"./Viewpoint.js";import o from"./core/Collection.js";import s from"./core/Error.js";import a from"./core/Handles.js";import"./core/has.js";import{clone as n}from"./core/lang.js";import l from"./core/Loadable.js";import{loadAll as p}from"./core/loadAll.js";import c from"./core/Logger.js";import{isSome as d}from"./core/maybe.js";import{MultiOriginJSONMixin as h,MultiOriginJSONSupport as u}from"./core/MultiOriginJSONSupport.js";import{EsriPromiseMixin as m}from"./core/Promise.js";import{debounce as y,eachAlways as w}from"./core/promiseUtils.js";import{urlToObject as g,addQueryParameter as f}from"./core/urlUtils.js";import{property as v}from"./core/accessorSupport/decorators/property.js";import"./core/accessorSupport/ensureType.js";import{reader as b}from"./core/accessorSupport/decorators/reader.js";import{subclass as S}from"./core/accessorSupport/decorators/subclass.js";import{writer as _}from"./core/accessorSupport/decorators/writer.js";import{updateOrigins as A}from"./core/accessorSupport/originUtils.js";import{readLoadable as I}from"./core/accessorSupport/read.js";import j from"./geometry/Extent.js";import R from"./geometry/HeightModelInfo.js";import{canProjectWithoutEngine as L}from"./geometry/projection.js";import P from"./geometry/SpatialReference.js";import{validateWebSceneError as V}from"./geometry/support/heightModelInfoUtils.js";import{fromJSON as U}from"./geometry/support/jsonUtils.js";import{isEarth as M}from"./geometry/support/spatialReferenceUtils.js";import O from"./portal/Portal.js";import E from"./portal/PortalItem.js";import C from"./support/MapFloorInfo.js";import{createSchemaValidationError as N,createCopyError as T}from"./support/webSceneUtils.js";import{ViewingMode as G}from"./views/ViewingMode.js";import{isSpatialReferenceSupported as F}from"./views/support/spatialReferenceSupport.js";import{saveResources as $}from"./webdoc/support/saveUtils.js";import{getOptimalThumbnailSize as W}from"./webdoc/support/thumbnailUtils.js";import J from"./webscene/ApplicationProperties.js";import x from"./webscene/Environment.js";import k from"./webscene/InitialViewProperties.js";import B from"./webscene/Presentation.js";import q from"./webscene/TransportationNetwork.js";import{Version as K}from"./webscene/Version.js";const D=new K(1,29),H=()=>{const e=8,t=[],r=D.major;for(let i=e;i<=D.minor;i++)t.push(`${r}.${i}`);return t},z="Web Scene",Q="ViewingMode-Local";let X=class extends(l.LoadableMixin(m(h(r)))){constructor(e){super(e),this._handles=new a,this.applicationProperties=null,this.clippingArea=null,this.clippingEnabled=!1,this.floorInfo=null,this.heightModelInfo=null,this.sourceVersion=null,this.transportationNetworks=null,this.presentation=new B,this.initialViewProperties=new k,this.portalItem=null,this.resourceInfo=null,this._debouncedSaveOperations=y((async(e,t,r)=>{switch(e){case Y.SAVE:return this._saveImpl(t);case Y.SAVE_AS:return this._saveAsImpl(r,t)}})),this._resourceReferences={portalItem:null,paths:[]},this.authoringApp=null,this.authoringAppVersion=null,this._isAuthoringAppSetByUser=!1,this._isAuthoringAppVersionSetByUser=!1}initialize(){if(this.when().catch((e=>{c.getLogger(this.declaredClass).error("#load()","Failed to load web scene",e)})),this.resourceInfo){let t;try{t=this._validateJSON(this.resourceInfo)}catch(e){return void this.addResolvingPromise(Promise.reject(e))}this.read(t),this.addResolvingPromise(this._validateSpatialReference()),this.addResolvingPromise(this._validateHeightModelInfo())}this._handles.add(this.allLayers.on("change",(()=>this._scheduleLayersIdGC())))}destroy(){this._unscheduleLayersIdGC(),this._handles.destroy(),this.presentation&&this.presentation.destroy();const e=this.portalItem;this.portalItem=null,e?.destroy()}writeClippingArea(e,t){t.clippingArea||(t.clippingArea={}),t.clippingArea.geometry=e.toJSON()}readClippingEnabled(e,t){return!!t.clippingArea&&!!t.clippingArea.clip}writeClippingEnabled(e,t){this.clippingArea&&(t.clippingArea||(t.clippingArea={}),t.clippingArea.clip=e)}writeLayers(e,t,r,i){const o={...i,layerContainerType:"operational-layers"},s=e.map((e=>this.verifyWriteLayer(e,i)?e.write({},o):null)).filter((e=>!!e));t[r]=s.toArray()}verifyWriteLayer(e,t){return"write"in e||(t&&t.messages&&t.messages.push(new s("layer:unsupported",`Layers (${e.title}, ${e.id}) of type '${e.declaredClass}' cannot be persisted in web scenes`,{layer:e})),!1)}readSourceVersion(e,t){const[r,i]=t.version.split(".");return new K(parseInt(r,10),parseInt(i,10))}writeSourceVersion(e,t,r){t[r]=`${D.major}.${D.minor}`}get thumbnailUrl(){return this.portalItem&&this.portalItem.thumbnailUrl||null}set thumbnailUrl(e){e?this._override("thumbnailUrl",e):(this._clearOverride("thumbnailUrl"),this.clear("thumbnailUrl","user"))}set authoringApp(e){this._isAuthoringAppSetByUser=!0,this._set("authoringApp",e)}writeAuthoringApp(e,t){e&&this._isAuthoringAppSetByUser?t.authoringApp=e:t.authoringApp="ArcGIS API for JavaScript"}set authoringAppVersion(e){this._isAuthoringAppVersionSetByUser=!0,this._set("authoringAppVersion",e)}writeAuthoringAppVersion(e,r){e&&this._isAuthoringAppVersionSetByUser?r.authoringAppVersion=e:r.authoringAppVersion=t}writeGround(e,t,r,i){t[r]=e?e.write({},i):{transparency:0,layers:[]}}readInitialViewProperties(e,t){const r={};return t.initialState&&t.initialState.environment&&(r.environment=x.fromJSON(t.initialState.environment)),t.spatialReference?r.spatialReference=P.fromJSON(t.spatialReference):r.spatialReference=P.WebMercator,r.viewingMode=t.viewingMode||"global",t.initialState&&t.initialState.viewpoint&&(r.viewpoint=i.fromJSON(t.initialState.viewpoint)),new k(r)}get spatialReference(){return this.initialViewProperties?.spatialReference??P.WebMercator}get viewingMode(){return this.initialViewProperties?.viewingMode??"global"}load(e){return this.addResolvingPromise(this._loadFromSource()),Promise.resolve(this)}loadAll(){return p(this,(e=>{const t=this.presentation&&this.presentation.slides;e(this.ground,this.basemap,this.layers,t&&t.map((e=>e.basemap)))}))}read(e,t){t={...t,origin:"web-scene"};const r=this._isAuthoringAppVersionSetByUser,i=this._isAuthoringAppSetByUser;if(I(this,e,(t=>super.read(e,t)),t),i||(this._isAuthoringAppSetByUser=!1),r||(this._isAuthoringAppVersionSetByUser=!1),e.baseMap&&Array.isArray(e.baseMap.elevationLayers)&&this.sourceVersion.supportsVisibleElevationLayersInSlides){const t=e.baseMap.elevationLayers.map((e=>({id:e.id}))),r=this.presentation.slides,i=(e,t)=>e.visibleLayers.some((e=>e.id===t)),o=t.filter((e=>!r.some((t=>i(t,e.id)))));r.forEach((e=>{e.visibleLayers.addMany(o)}))}}_writeBasemapElevationLayers(e){const t=e.ground&&e.ground.layers;!e.baseMap&&t&&t.length&&(e.baseMap={title:"Basemap",baseMapLayers:[]}),e.baseMap&&(e.baseMap.elevationLayers=n(t))}write(e,t){if("loaded"!==this.loadStatus){const e=new s("webscene:not-loaded","Web scene must be loaded before it can be serialized");throw c.getLogger(this.declaredClass).error("#toJSON()","Web scene must be loaded before it can be serialized",this.loadError||this.loadStatus),e}this._runLayersIdGC();const r=!t?.messages;t={messages:[],...t,origin:"web-scene"};const i=super.write(e,t);if(r){const e=t.messages.filter((e=>"web-document-write:property-required"===e.name));if(e.length){const t=new s("web-document:property-required","One or more properties that are required in the webscene JSON are missing, see details for the specific errors",{errors:e});throw c.getLogger(this.declaredClass).error("#toJSON()","One or more properties that are required in the webscene JSON are missing",e),t}}return this._writeBasemapElevationLayers(i),i}async save(e){return this._debouncedSaveOperations(Y.SAVE,e)}async _saveImpl(e){this.portalItem||(c.getLogger(this.declaredClass).error("save(): requires the .portalItem property to be set"),await Promise.reject(new s("webscene:portal-item-not-set","Portal item to save to has not been set on the WebScene"))),this.portalItem.type!==z&&await Promise.reject(new s("webscene:portal-item-wrong-type",`Portal item needs to have type "${z}"`));const t=this._updateFromPromise;await this._ensureLoadBeforeSave();const r=this._enableVerifyItemRelativeUrls({origin:"web-scene",url:this.portalItem.itemUrl&&g(this.portalItem.itemUrl),messages:[],portal:this.portalItem.portal||O.getDefault(),portalItem:this.portalItem,writtenProperties:[],blockedRelativeUrls:[],resources:{toAdd:[],toUpdate:[],toKeep:[],pendingOperations:[]}}),i=this.write({},r);return await Promise.all(r.resources.pendingOperations),await this._verifySave(i,r,e),this._updateTypeKeywords(this.portalItem),await this.portalItem.update({data:i}),await $(this._resourceReferences,r,null),A(r),t&&await t,await this._saveThumbnail(),this.portalItem}async saveAs(e,t){return this._debouncedSaveOperations(Y.SAVE_AS,t,e)}async _saveAsImpl(e,t){let r=E.from(e);r||(c.getLogger(this.declaredClass).error("saveAs(portalItem): requires a portal item parameter"),await Promise.reject(new s("webscene:portal-item-required","saveAs requires a portal item to save to"))),r.id&&(r=r.clone(),r.id=null);const i=r.portal||O.getDefault();await this._ensureLoadBeforeSave(),r.type=z,r.portal=i;const o=this._enableVerifyItemRelativeUrls({origin:"web-scene",url:null,messages:[],portal:i,portalItem:r,writtenProperties:[],blockedRelativeUrls:[],resources:{toAdd:[],toUpdate:[],toKeep:[],pendingOperations:[]}}),a=this.write({},o);await Promise.all(o.resources.pendingOperations),await this._verifySaveAs(a,o,t);const n=this.thumbnailUrl,l=!this._isOverridden("thumbnailUrl");return this._updateTypeKeywords(r),await i._signIn(),await i.user.addItem({item:r,folder:t&&t.folder,data:a}),await $(this._resourceReferences,o,null),this.portalItem=r,u.prototype.read.call(this,{version:a.version,authoringApp:a.authoringApp,authoringAppVersion:a.authoringAppVersion},{name:"web-scene",ignoreDefaults:!0,url:r.itemUrl&&g(r.itemUrl)}),A(o),n&&(this.thumbnailUrl=l?f(n,"w","8192"):n),o.portalItem=r,await this._saveThumbnail(),r}async _saveThumbnail(){this._isOverridden("thumbnailUrl")&&(await this.portalItem.updateThumbnail({thumbnail:this.thumbnailUrl}),this._clearOverride("thumbnailUrl"),this.clear("thumbnailUrl","user"))}_verifySave(e,t,r,i=!1){if(!M(this.spatialReference))return Promise.reject(new s("webscene:unsupported-spatial-reference","Webscenes using spatial reference systems from Mars or Moon can not be saved currently."));let o,a=t.messages.filter((e=>"error"===e.type)).map((e=>new s(e.name,e.message,e.details)));t.blockedRelativeUrls&&(a=a.concat(t.blockedRelativeUrls.map((e=>new s("url:unsupported",`Relative url '${e}' is not supported in Web Scene`))))),r&&r.ignoreUnsupported&&(a=a.filter((e=>"layer:unsupported"!==e.name&&"symbol:unsupported"!==e.name&&"symbol-layer:unsupported"!==e.name&&"property:unsupported"!==e.name&&"url:unsupported"!==e.name&&"scenemodification:unsupported"!==e.name))),r?.requiredPropertyChecksDisabled&&(a=a.filter((e=>"web-document-write:property-required"!==e.name)));const n=r&&r.strictSchemaValidationEnabled;return o=n?import("./webscene/support/schemaValidator.js").then((t=>{const r=t.validate(e);if(r.length>0){const e=`webscene did not validate:\n${r.join("\n")}`;c.getLogger(this.declaredClass).error(`${i?"saveAs":"save"}(): ${e}`)}return r.map((e=>new s("webscene:schema-validation",e)))})).then((e=>{if(n&&e.length>0){throw N(e.concat(a))}return a})):Promise.resolve(a),o.then((e=>{if(e.length>0)throw new s("webscene:save","Failed to save webscene due to unsupported or invalid content. See 'details.errors' for more detailed information",{errors:e})}))}_verifySaveAs(e,t,r){return this.canNotSaveAs(t)?Promise.reject(T()):this._verifySave(e,t,r,!0)}verifySaveAs(e){const t=this._enableVerifyItemRelativeUrls({origin:"web-scene",messages:[]}),r=this.write({},t);return this._verifySaveAs(r,t,e)}canNotSaveAs(e){return e||(e=this._enableVerifyItemRelativeUrls({origin:"web-scene",messages:[]}),this.write({},e)),e.verifyItemRelativeUrls&&e.verifyItemRelativeUrls.writtenUrls.length>0}async updateFrom(e,t={}){const r=this._updateFrom(e,t);this._updateFromPromise=r,await r;this._updateFromPromise===r&&(this._updateFromPromise=null)}async _updateFrom(e,t={}){if(await e.whenReady(),!t.environmentExcluded&&e.environment&&(this.initialViewProperties.environment=x.prototype.clone.apply(e.environment)),!t.viewpointExcluded&&e.viewpoint&&(this.initialViewProperties.viewpoint=e.viewpoint.clone()),this.initialViewProperties.spatialReference=e.spatialReference.clone(),this.initialViewProperties.viewingMode=e.viewingMode,d(e.clippingArea)?e.clippingArea!==this.clippingArea&&(this.clippingArea=e.clippingArea.clone(),this.clippingEnabled=!0):this.clippingEnabled=!1,e.heightModelInfo&&(this.heightModelInfo=e.heightModelInfo.clone()),e.map===this)for(const r of e.allLayerViews){const e="visible";e in r&&e in r.layer&&r._isOverridden(e)&&(r.layer[e]=r[e])}(!1===t.thumbnailExcluded||null==t.thumbnailExcluded&&!t.viewpointExcluded)&&await this._updateFromThumbnail(e,t.thumbnailSize||void 0)}async _updateFromThumbnail(e,t){const r=W(e,t),i=await e.takeScreenshot({format:"jpg",width:r.width,height:r.height,disableDecorations:!0});this.thumbnailUrl=i.dataUrl}_loadFromSource(){return this.resourceInfo?this._loadFromJSON(this.resourceInfo,{origin:"web-scene"}):this.portalItem&&this.portalItem.id?this._loadFromItem(this.portalItem):this._loadObjectsWithLayers()}_readAndLoadFromJSON(e,t){const r=this._validateJSON(e);return this.read(r,t),this._loadFromJSON(r,t)}_extractOperationalLayers(e){const t=[];if(!this.sourceVersion.supportsGround&&e.baseMap&&Array.isArray(e.baseMap.elevationLayers))for(const o of e.baseMap.elevationLayers)t.push(o);const r=[],i=e=>(e.layers&&(e.layers=e.layers.filter(i)),"ArcGISTiledElevationServiceLayer"!==e.layerType||(this.sourceVersion.supportsGround||r.push(e),!1));return{operationalLayers:e.operationalLayers?e.operationalLayers.filter(i):[],operationalElevationLayers:r,basemapElevationLayers:t}}_loadFromJSON(e,t){const r=new o;return this._validateSpatialReference().then((()=>this._validateHeightModelInfo())).then((()=>import("./layers/support/layersCreator.js"))).then((({populateOperationalLayers:i})=>{const{operationalLayers:o,operationalElevationLayers:s,basemapElevationLayers:a}=this._extractOperationalLayers(e),n=[],l={context:{...t,layerContainerType:"operational-layers"}};if(this.portalItem&&(l.context.portal=this.portalItem.portal||O.getDefault()),a.length>0){const e={...l,context:{...l.context,layerContainerType:"ground"}};e.defaultLayerType="ArcGISTiledElevationServiceLayer",n.push(i(this.ground.layers,a,e))}if(s.length>0){const e={...l,context:{...l.context,layerContainerType:"ground"}};e.defaultLayerType="ArcGISTiledElevationServiceLayer",n.push(i(r,s,e))}return o&&o.length>0&&n.push(i(this.layers,o,l)),w(n).then((()=>{}))})).then((()=>this._loadObjectsWithLayers())).then((()=>{this.ground.layers.addMany(r)}))}async _ensureLoadBeforeSave(){await this.load(),await this._loadObjectsWithLayers();const e=[];for(const t of this.allLayers.items)if("beforeSave"in t&&"function"==typeof t.beforeSave){const r=t.beforeSave();r&&e.push(r)}await w(e)}async _loadObjectsWithLayers(){const e=[];this.ground&&e.push(this.ground.load()),this.basemap&&e.push(this.basemap.load()),this.presentation.slides.forEach((t=>{t.basemap&&e.push(t.basemap.load())})),await w(e)}async _loadFromItem(e){if(await e.load().catch((e=>{throw new s("webscene:load-portal-item","Failed to load portal item",{error:e})})),"Web Scene"!==e.type)throw new s("webscene:invalid-portal-item","Invalid portal item type '${type}', expected 'Web Scene'",{type:e.type});const t=await e.fetchData();this.resourceInfo=t;const r={origin:"web-scene",url:g(e.itemUrl),portal:e.portal||O.getDefault(),portalItem:e,readResourcePaths:[]};await this._readAndLoadFromJSON(t,r),this._resourceReferences={portalItem:e,paths:r.readResourcePaths}}_validateSpatialReference(){const e=this.initialViewProperties,t=this._sceneSpatialReference;let r;if("local"!==e.viewingMode){if(!F(t,G.Global))return Promise.reject(new s("webscene:unsupported-spatial-reference","Unsupported spatial reference (${spatialReference.wkid}) in global mode, only Web Mercator, WGS84 GCS or CGCS2000 are supported",{spatialReference:t,viewingMode:e.viewingMode}));r=e=>!e||L(e,t)}else{if(!F(t,G.Local))return Promise.reject(new s("webscene:unsupported-spatial-reference","Unsupported spatial reference (${spatialReference.wkid}) in local mode, only projected coordinate systems are supported",{spatialReference:t,viewingMode:e.viewingMode}));r=e=>!e||e.equals(t)}const i=e=>e&&(d(e.camera)&&e.camera.position&&e.camera.position.spatialReference||d(e.targetGeometry)&&e.targetGeometry.spatialReference),o=e.viewpoint,a=i(o);if(a&&!r(a))return Promise.reject(new s("webscene:incompatible-camera-spatial-reference","Camera spatial reference (${cameraSpatialReference.wkid}) is incompatible with the scene spatial reference (${sceneSpatialReference.wkid})",{cameraSpatialReference:a,sceneSpatialReference:t,viewingMode:e.viewingMode}));const n=this.presentation.slides.find((e=>!r(i(e.viewpoint))));if(n){const r=i(n.viewpoint);return Promise.reject(new s("webscene:incompatible-slide-spatial-reference","Slide spatial reference (${slideSpatialReference.wkid}) is incompatible with the scene spatial reference (${sceneSpatialReference.wkid})",{slideSpatialReference:r,sceneSpatialReference:t,viewingMode:e.viewingMode}))}return Promise.resolve()}_validateHeightModelInfo(){const e=this._sceneSpatialReference,t=V(this.heightModelInfo,e);return t?Promise.reject(t):Promise.resolve()}_validateJSON(e){const t=K.parse(e.version||"","webscene");return D.validate(t),e.version=`${t.major}.${t.minor}`,1===t.major&&t.minor<=2&&(e.spatialReference=P.WebMercator.toJSON()),e}_updateTypeKeywords(e){"local"===this.initialViewProperties.viewingMode?e.typeKeywords?e.typeKeywords.includes(Q)||e.typeKeywords.push(Q):e.typeKeywords=[Q]:"global"===this.initialViewProperties.viewingMode&&e.typeKeywords&&(e.typeKeywords=e.typeKeywords.filter((e=>e!==Q))),e.typeKeywords&&(e.typeKeywords=e.typeKeywords.filter(((e,t,r)=>r.indexOf(e)===t)))}get _sceneSpatialReference(){return this.initialViewProperties.spatialReference||P.WebMercator}get _verifyItemRelativeRootPath(){return this.portalItem&&this.portalItem.itemUrl?g(this.portalItem.itemUrl).path:null}_enableVerifyItemRelativeUrls(e){const t=this._verifyItemRelativeRootPath;return t&&(e.verifyItemRelativeUrls={rootPath:t,writtenUrls:[]}),e}_unscheduleLayersIdGC(){this._layersIdGCTimeoutId&&(clearTimeout(this._layersIdGCTimeoutId),this._layersIdGCTimeoutId=0)}_scheduleLayersIdGC(){this._unscheduleLayersIdGC(),this._layersIdGCTimeoutId=setTimeout((()=>{this._layersIdGCTimeoutId=0,this._runLayersIdGC()}),3e3)}_runLayersIdGC(){this._unscheduleLayersIdGC();const e=this.applicationProperties&&this.applicationProperties.viewing&&this.applicationProperties.viewing.search,t=e=>this.allLayers.some((t=>t.id===e));e&&e.layers&&(e.layers=e.layers.filter((e=>t(e.id))));const r=this.presentation&&this.presentation.slides;r&&r.forEach((e=>{e.visibleLayers&&(e.visibleLayers=e.visibleLayers.filter((e=>t(e.id))))}))}static fromJSON(e){if(!e)throw new s("webscene:empty-resource","Expected a JSON resource but got nothing");return new this({resourceInfo:e})}};var Y;X.version=`${D.major}.${D.minor}`,e([v({type:J,json:{write:!0}})],X.prototype,"applicationProperties",void 0),e([v({json:{read:{source:"baseMap"},write:{target:"baseMap"}}})],X.prototype,"basemap",void 0),e([v({type:j,json:{read:{source:"clippingArea.geometry",reader:U},write:{target:"clippingArea.geometry"}}})],X.prototype,"clippingArea",void 0),e([_("clippingArea")],X.prototype,"writeClippingArea",null),e([v({type:Boolean,json:{write:{target:"clippingArea.clip"}}})],X.prototype,"clippingEnabled",void 0),e([b("clippingEnabled",["clippingArea"])],X.prototype,"readClippingEnabled",null),e([_("clippingEnabled")],X.prototype,"writeClippingEnabled",null),e([v({type:C,json:{read:{source:"mapFloorInfo"},write:{target:"mapFloorInfo"}}})],X.prototype,"floorInfo",void 0),e([v({type:R,json:{write:!0}})],X.prototype,"heightModelInfo",void 0),e([v({json:{write:{target:"operationalLayers",ignoreOrigin:!0}}})],X.prototype,"layers",void 0),e([_("layers")],X.prototype,"writeLayers",null),e([v({readOnly:!0,type:K,json:{type:H(),write:{ignoreOrigin:!0,target:"version",isRequired:!0,overridePolicy:()=>({enabled:!0,allowNull:!0,ignoreOrigin:!0})}}})],X.prototype,"sourceVersion",void 0),e([b("sourceVersion",["version"])],X.prototype,"readSourceVersion",null),e([_("sourceVersion")],X.prototype,"writeSourceVersion",null),e([v({json:{read:!1,write:!1}})],X.prototype,"tables",void 0),e([v()],X.prototype,"thumbnailUrl",null),e([v({type:String,json:{write:{writerEnsuresNonNull:!0,ignoreOrigin:!0}}})],X.prototype,"authoringApp",null),e([_("authoringApp")],X.prototype,"writeAuthoringApp",null),e([v({type:String,json:{write:{writerEnsuresNonNull:!0,ignoreOrigin:!0}}})],X.prototype,"authoringAppVersion",null),e([_("authoringAppVersion")],X.prototype,"writeAuthoringAppVersion",null),e([v({json:{write:{isRequired:!0,allowNull:!0,ignoreOrigin:!0,enabled:!0}}})],X.prototype,"ground",void 0),e([_("ground")],X.prototype,"writeGround",null),e([v({type:o.ofType(q),json:{write:!0}})],X.prototype,"transportationNetworks",void 0),e([v({type:B,nonNullable:!0,json:{write:{ignoreOrigin:!0,writer:(e,t,r,i)=>{if(e.slides&&e.slides.length>0){const r={...i,isPresentation:!0};t.presentation=e.write({},r)}}}}})],X.prototype,"presentation",void 0),e([v({type:k,nonNullable:!0,json:{write:{target:"initialState",isRequired:!0,ignoreOrigin:!0},default:()=>new k({viewingMode:"global",spatialReference:P.WebMercator})}})],X.prototype,"initialViewProperties",void 0),e([b("initialViewProperties",["initialState.environment","spatialReference","viewingMode","initialState.viewpoint"])],X.prototype,"readInitialViewProperties",null),e([v({type:P,json:{read:!1,write:{isRequired:!0,ignoreOrigin:!0}}})],X.prototype,"spatialReference",null),e([v({type:["local","global"],json:{read:!1,write:{isRequired:!0,ignoreOrigin:!0}}})],X.prototype,"viewingMode",null),e([v({type:E})],X.prototype,"portalItem",void 0),e([v()],X.prototype,"resourceInfo",void 0),X=e([S("esri.WebScene")],X),function(e){e[e.SAVE=0]="SAVE",e[e.SAVE_AS=1]="SAVE_AS"}(Y||(Y={}));const Z=X;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.25/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import e from"../../../Graphic.js";import t from"../support/FeatureSet.js";import i from"../support/IdSet.js";import{defaultMaxRecords as r,IdState as s}from"../support/shared.js";import a from"../../../rest/support/RelationshipQuery.js";class n extends t{constructor(e){super(e),this.declaredClass="esri.arcade.featureset.sources.FeatureLayerRelated",this._findObjectId=-1,this._requestStandardised=!1,this._removeGeometry=!1,this._overrideFields=null,this.featureObjectId=null,this.
|
|
5
|
+
import e from"../../../Graphic.js";import t from"../support/FeatureSet.js";import i from"../support/IdSet.js";import{defaultMaxRecords as r,IdState as s}from"../support/shared.js";import a from"../../../rest/support/RelationshipQuery.js";class n extends t{constructor(e){super(e),this.declaredClass="esri.arcade.featureset.sources.FeatureLayerRelated",this._findObjectId=-1,this._requestStandardised=!1,this._removeGeometry=!1,this._overrideFields=null,this.featureObjectId=null,this._relatedLayer=null,this.relationship=null,e.spatialReference&&(this.spatialReference=e.spatialReference),this._transparent=!0,this._maxProcessing=1e3,this._layer=e.layer,this._wset=null,this._findObjectId=e.objectId,this.featureObjectId=e.objectId,this.relationship=e.relationship,this._relatedLayer=e.relatedLayer,void 0!==e.outFields&&(this._overrideFields=e.outFields),void 0!==e.includeGeometry&&(this._removeGeometry=!1===e.includeGeometry)}_maxQueryRate(){return r}end(){return this._layer}optimisePagingFeatureQueries(){}async loadImpl(){return await Promise.all([this._layer.load(),this._relatedLayer.load()]),this._initialiseFeatureSet(),this}nativeCapabilities(){return this._relatedLayer.nativeCapabilities()}_initialiseFeatureSet(){if(null==this.spatialReference&&(this.spatialReference=this._layer.spatialReference),this.geometryType=this._relatedLayer.geometryType,this.fields=this._relatedLayer.fields.slice(0),null!==this._overrideFields)if(1===this._overrideFields.length&&"*"===this._overrideFields[0])this._overrideFields=null;else{const e=[],t=[];for(const i of this.fields)if("oid"===i.type)e.push(i),t.push(i.name);else for(const r of this._overrideFields)if(r.toLowerCase()===i.name.toLowerCase()){e.push(i),t.push(i.name);break}this.fields=e,this._overrideFields=t}const e=this._layer.nativeCapabilities();e&&(this._databaseType=e.databaseType,this._requestStandardised=e.requestStandardised),this.objectIdField=this._relatedLayer.objectIdField,this.globalIdField=this._relatedLayer.globalIdField,this.hasM=this._relatedLayer.supportsM,this.hasZ=this._relatedLayer.supportsZ,this.typeIdField=this._relatedLayer.typeIdField,this.types=this._relatedLayer.types}async databaseType(){return await this._relatedLayer.databaseType(),this._databaseType=this._relatedLayer._databaseType,this._databaseType}isTable(){return this._relatedLayer.isTable()}_isInFeatureSet(){return s.InFeatureSet}_candidateIdTransform(e){return e}async _getSet(e){if(null===this._wset){await this._ensureLoaded();const t=await this._getFilteredSet("",null,null,null,e);return this._wset=t,t}return this._wset}_changeFeature(t){const i={};for(const e of this.fields)i[e.name]=t.attributes[e.name];return new e({geometry:!0===this._removeGeometry?null:t.geometry,attributes:i})}async _getFilteredSet(e,t,r,s,n){if(await this.databaseType(),this.isTable()&&t&&null!==e&&""!==e){return new i([],[],!0,null)}const l=this._layer.nativeCapabilities();if(!1===l.canQueryRelated){return new i([],[],!0,null)}if(l.capabilities.queryRelated&&l.capabilities.queryRelated.supportsPagination)return this._getFilteredSetUsingPaging(e,t,r,s,n);let d="",o=!1;null!==s&&l.capabilities&&l.capabilities.queryRelated&&!0===l.capabilities.queryRelated.supportsOrderBy&&(d=s.constructClause(),o=!0);const u=new a;u.objectIds=[this._findObjectId];const h=null!==this._overrideFields?this._overrideFields:this._fieldsIncludingObjectId(this._relatedLayer.fields?this._relatedLayer.fields.map((e=>e.name)):["*"]);u.outFields=h,u.relationshipId=this.relationship.id,u.where="1=1";let c=!0;!0===this._removeGeometry&&(c=!1),u.returnGeometry=c,this._requestStandardised&&(u.sqlFormat="standard"),u.outSpatialReference=this.spatialReference,u.orderByFields=""!==d?d.split(","):null;const y=await l.source.queryRelatedFeatures(u);this._checkCancelled(n);const p=y[this._findObjectId]?y[this._findObjectId].features:[],_=[];for(let i=0;i<p.length;i++)this._featureCache[p[i].attributes[this._relatedLayer.objectIdField]]=p[i],_.push(p[i].attributes[this._relatedLayer.objectIdField]);const f=t&&null!==e&&""!==e,g=null!=r;return new i(f||g?_:[],f||g?[]:_,o,null)}_fieldsIncludingObjectId(e){if(null===e)return[this.objectIdField];const t=e.slice(0);if(t.includes("*"))return t;let i=!1;for(const r of t)if(r.toUpperCase()===this.objectIdField.toUpperCase()){i=!0;break}return!1===i&&t.push(this.objectIdField),t}async _getFilteredSetUsingPaging(e,t,r,s,a){let n="",l=!1;const d=this._layer.nativeCapabilities();null!==s&&d&&d.capabilities.queryRelated&&!0===d.capabilities.queryRelated.supportsOrderBy&&(n=s.constructClause(),l=!0),await this.databaseType();const o="1=1";let u=this._maxQueryRate();const h=d.capabilities.query.maxRecordCount;void 0!==h&&h<u&&(u=h);const c=t&&null!==e&&""!==e,y=null!=r;let p=null,_=!0;!0===this._removeGeometry&&(_=!1);const f=null!==this._overrideFields?this._overrideFields:this._fieldsIncludingObjectId(this._relatedLayer.fields?this._relatedLayer.fields.map((e=>e.name)):["*"]);return p=new i(c||y?["GETPAGES"]:[],c||y?[]:["GETPAGES"],l,{outFields:f.join(","),resultRecordCount:u,resultOffset:0,objectIds:[this._findObjectId],where:o,orderByFields:n,returnGeometry:_,returnIdsOnly:"false",internal:{set:[],lastRetrieved:0,lastPage:0,fullyResolved:!1}}),await this._expandPagedSet(p,u,0,0,a),p}_expandPagedSet(e,t,i,r,s){return this._expandPagedSetFeatureSet(e,t,i,r,s)}_clonePageDefinition(e){return null===e?null:!0!==e.groupbypage?{groupbypage:!1,outFields:e.outFields,resultRecordCount:e.resultRecordCount,resultOffset:e.resultOffset,where:e.where,objectIds:e.objectIds,orderByFields:e.orderByFields,returnGeometry:e.returnGeometry,returnIdsOnly:e.returnIdsOnly,internal:e.internal}:{groupbypage:!0,outFields:e.outFields,resultRecordCount:e.resultRecordCount,useOIDpagination:e.useOIDpagination,generatedOid:e.generatedOid,groupByFieldsForStatistics:e.groupByFieldsForStatistics,resultOffset:e.resultOffset,outStatistics:e.outStatistics,geometry:e.geometry,where:e.where,objectIds:e.objectIds,orderByFields:e.orderByFields,returnGeometry:e.returnGeometry,returnIdsOnly:e.returnIdsOnly,internal:e.internal}}async _getPhysicalPage(e,t,i){const r=e.pagesDefinition.internal.lastRetrieved,s=r,n=e.pagesDefinition.internal.lastPage,l=this._layer.nativeCapabilities(),d=new a;!0===this._requestStandardised&&(d.sqlFormat="standard"),d.relationshipId=this.relationship.id,d.objectIds=e.pagesDefinition.objectIds,d.resultOffset=e.pagesDefinition.internal.lastPage,d.resultRecordCount=e.pagesDefinition.resultRecordCount,d.outFields=e.pagesDefinition.outFields.split(","),d.where=e.pagesDefinition.where,d.orderByFields=""!==e.pagesDefinition.orderByFields?e.pagesDefinition.orderByFields.split(","):null,d.returnGeometry=e.pagesDefinition.returnGeometry,d.outSpatialReference=this.spatialReference;const o=await l.source.queryRelatedFeatures(d);if(this._checkCancelled(i),e.pagesDefinition.internal.lastPage!==n)return 0;const u=o[this._findObjectId]?o[this._findObjectId].features:[];for(let a=0;a<u.length;a++)e.pagesDefinition.internal.set[s+a]=u[a].attributes[this._relatedLayer.objectIdField];for(let a=0;a<u.length;a++)this._featureCache[u[a].attributes[this._relatedLayer.objectIdField]]=u[a];const h=!o[this._findObjectId]||!1===o[this._findObjectId].exceededTransferLimit;return u.length!==e.pagesDefinition.resultRecordCount&&h&&(e.pagesDefinition.internal.fullyResolved=!0),e.pagesDefinition.internal.lastRetrieved=r+u.length,e.pagesDefinition.internal.lastPage+=e.pagesDefinition.resultRecordCount,u.length}async _getFeatures(e,t,i,r){const s=[];-1!==t&&void 0===this._featureCache[t]&&s.push(t);const a=this._maxQueryRate();if(!0===this._checkIfNeedToExpandKnownPage(e,a))return await this._expandPagedSet(e,a,0,0,r),this._getFeatures(e,t,i,r);let n=0;for(let l=e._lastFetchedIndex;l<e._known.length&&(n++,n<=i&&(e._lastFetchedIndex+=1),!("GETPAGES"!==e._known[l]&&void 0===this._featureCache[e._known[l]]&&(e._known[l]!==t&&s.push(e._known[l]),s.length>i)))&&!(n>=i&&0===s.length);l++);if(0===s.length)return"success";throw new Error("Unaccounted for Features. Not in Feature Collection")}async _refineSetBlock(e,t,i){return e}async _stat(e,t,i,r,s,a,n){return{calculated:!1}}get gdbVersion(){return this._relatedLayer.gdbVersion}async _canDoAggregates(e,t,i,r,s){return!1}relationshipMetaData(){return this._relatedLayer.relationshipMetaData()}serviceUrl(){return this._relatedLayer.serviceUrl()}queryAttachments(e,t,i,r,s){return this._relatedLayer.queryAttachments(e,t,i,r,s)}getFeatureByObjectId(e,t){return this._relatedLayer.getFeatureByObjectId(e,t)}getOwningSystemUrl(){return this._relatedLayer.getOwningSystemUrl()}getIdentityUser(){return this._relatedLayer.getIdentityUser()}getDataSourceFeatureSet(){return this._relatedLayer}}export{n 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.25/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
const t=new RegExp("^[a-z0-9]{8}-[a-z0-9]{4}-[a-z0-9]{4}-[a-z0-9]{4}-[a-z0-9]{12}$","i");function e(t){let e="";for(let r=0;r<t;r++)e+=(65536*(1+Math.random())|0).toString(16).substring(1);return e}class r{constructor(t){if(this.
|
|
5
|
+
const t=new RegExp("^[a-z0-9]{8}-[a-z0-9]{4}-[a-z0-9]{4}-[a-z0-9]{4}-[a-z0-9]{12}$","i");function e(t){let e="";for(let r=0;r<t;r++)e+=(65536*(1+Math.random())|0).toString(16).substring(1);return e}class r{constructor(t){if(this._value="",!t)throw new TypeError("Invalid argument; `value` has no value.");this._value=r.EMPTY,t&&t instanceof r?this._value=t.toString():t&&"[object String]"===Object.prototype.toString.call(t)&&r.isGuid(t)&&(this._value=t)}equals(t){return r.isGuid(t)&&this._value===t}isEmpty(){return this._value===r.EMPTY}toString(){return this._value}toJSON(){return this._value}static isGuid(e){return e&&(e instanceof r||t.test(e.toString()))}static create(){return new r([e(2),e(1),e(1),e(1),e(3)].join("-"))}static raw(){return[e(2),e(1),e(1),e(1),e(3)].join("-")}}r.EMPTY="00000000-0000-0000-0000-000000000000";export{r 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.25/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
class e{constructor(e){const s=this;s._keys=[],s._values=[],s.length=0,e&&e.forEach((e=>{s.set(e[0],e[1])}))}entries(){return[].slice.call(this.keys().map((e=>[e,this.get(e)])))}keys(){return[].slice.call(this._keys)}values(){return[].slice.call(this._values)}has(e){return this._keys.includes(e)}get(e){const s=this._keys.indexOf(e);return s>-1?this._values[s]:void 0}deepGet(s){if(!s||!s.length)return null;const t=(s,i)=>null==s?null:i.length?t(s instanceof e?s.get(i[0]):s[i[0]],i.slice(1)):s;return t(this.get(s[0]),s.slice(1))}set(e,s){const t=this,i=this._keys.indexOf(e);return i>-1?t._values[i]=s:(t._keys.push(e),t._values.push(s),t.length=t._values.length),this}sortedSet(e,s,t,i){const h=this,l=this._keys.length,r=t||0,n=void 0!==i?i:l-1;if(0===l)return h._keys.push(e),h._values.push(s),h;if(e===this._keys[r])return this._values.splice(r,0,s),this;if(e===this._keys[n])return this._values.splice(n,0,s),this;if(e>this._keys[n])return this._keys.splice(n+1,0,e),this._values.splice(n+1,0,s),this;if(e<this._keys[r])return this._values.splice(r,0,s),this._keys.splice(r,0,e),this;if(r>=n)return this;const u=r+Math.floor((n-r)/2);return e<this._keys[u]?this.sortedSet(e,s,r,u-1):e>this._keys[u]?this.sortedSet(e,s,u+1,n):this}size(){return this.length}clear(){const e=this;return e._keys.length=e.length=e._values.length=0,this}delete(e){const s=this,t=s._keys.indexOf(e);return t>-1&&(s._keys.splice(t,1),s._values.splice(t,1),s.length=s._keys.length,!0)}forEach(e){this._keys.forEach(((s,t)=>{e(this.get(s),s,t)}))}map(e){return this.keys().map(((s,t)=>e(this.get(s),s,t)))}filter(e){const s=this;return s._keys.forEach(((t,i)=>{!1===e(s.get(t),t,i)&&s.delete(t)})),this}clone(){return new e(this.entries())}}class s{constructor(s=20){this._maxEntries=s,this.
|
|
5
|
+
class e{constructor(e){const s=this;s._keys=[],s._values=[],s.length=0,e&&e.forEach((e=>{s.set(e[0],e[1])}))}entries(){return[].slice.call(this.keys().map((e=>[e,this.get(e)])))}keys(){return[].slice.call(this._keys)}values(){return[].slice.call(this._values)}has(e){return this._keys.includes(e)}get(e){const s=this._keys.indexOf(e);return s>-1?this._values[s]:void 0}deepGet(s){if(!s||!s.length)return null;const t=(s,i)=>null==s?null:i.length?t(s instanceof e?s.get(i[0]):s[i[0]],i.slice(1)):s;return t(this.get(s[0]),s.slice(1))}set(e,s){const t=this,i=this._keys.indexOf(e);return i>-1?t._values[i]=s:(t._keys.push(e),t._values.push(s),t.length=t._values.length),this}sortedSet(e,s,t,i){const h=this,l=this._keys.length,r=t||0,n=void 0!==i?i:l-1;if(0===l)return h._keys.push(e),h._values.push(s),h;if(e===this._keys[r])return this._values.splice(r,0,s),this;if(e===this._keys[n])return this._values.splice(n,0,s),this;if(e>this._keys[n])return this._keys.splice(n+1,0,e),this._values.splice(n+1,0,s),this;if(e<this._keys[r])return this._values.splice(r,0,s),this._keys.splice(r,0,e),this;if(r>=n)return this;const u=r+Math.floor((n-r)/2);return e<this._keys[u]?this.sortedSet(e,s,r,u-1):e>this._keys[u]?this.sortedSet(e,s,u+1,n):this}size(){return this.length}clear(){const e=this;return e._keys.length=e.length=e._values.length=0,this}delete(e){const s=this,t=s._keys.indexOf(e);return t>-1&&(s._keys.splice(t,1),s._values.splice(t,1),s.length=s._keys.length,!0)}forEach(e){this._keys.forEach(((s,t)=>{e(this.get(s),s,t)}))}map(e){return this.keys().map(((s,t)=>e(this.get(s),s,t)))}filter(e){const s=this;return s._keys.forEach(((t,i)=>{!1===e(s.get(t),t,i)&&s.delete(t)})),this}clone(){return new e(this.entries())}}class s{constructor(s=20){this._maxEntries=s,this._values=new e}delete(e){this._values.has(e)&&this._values.delete(e)}get(e){let s=null;return this._values.has(e)&&(s=this._values.get(e),this._values.delete(e),this._values.set(e,s)),s}put(e,s){if(this._values.size()>=this._maxEntries){const e=this._values.keys()[0];this._values.delete(e)}this._values.set(e,s)}}class t{constructor(e=20){this._maxEntries=e,this._cache=new s(this._maxEntries)}clear(){this._cache=new s(this._maxEntries)}addToCache(e,s){this._cache.put(e,s)}removeFromCache(e){this._cache.delete(e)}getFromCache(e){return this._cache.get(e)}}export{t as default};
|
package/arcade/functions/hash.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.25/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
const t=2654435761,s=2246822519,n=3266489917,e=668265263,r=374761393;function h(t){const s=[];for(let n=0,e=t.length;n<e;n++){let e=t.charCodeAt(n);e<128?s.push(e):e<2048?s.push(192|e>>6,128|63&e):e<55296||e>=57344?s.push(224|e>>12,128|e>>6&63,128|63&e):(n++,e=65536+((1023&e)<<10|1023&t.charCodeAt(n)),s.push(240|e>>18,128|e>>12&63,128|e>>6&63,128|63&e))}return new Uint8Array(s)}class i{constructor(t){this._seed=t,this.
|
|
5
|
+
const t=2654435761,s=2246822519,n=3266489917,e=668265263,r=374761393;function h(t){const s=[];for(let n=0,e=t.length;n<e;n++){let e=t.charCodeAt(n);e<128?s.push(e):e<2048?s.push(192|e>>6,128|63&e):e<55296||e>=57344?s.push(224|e>>12,128|e>>6&63,128|63&e):(n++,e=65536+((1023&e)<<10|1023&t.charCodeAt(n)),s.push(240|e>>18,128|e>>12&63,128|e>>6&63,128|63&e))}return new Uint8Array(s)}class i{constructor(t){this._seed=t,this._totallen=0,this._bufs=[],this.init()}init(){return this._bufs=[],this._totallen=0,this}updateFloatArray(t){const s=[];for(const n of t)isNaN(n)?s.push("NaN"):n===1/0?s.push("Infinity"):n===-1/0?s.push("-Infinity"):0===n?s.push("0"):s.push(n.toString(16));this.update(h(s.join("")))}updateIntArray(t){const s=Int32Array.from(t);this.update(new Uint8Array(s.buffer))}updateUint8Array(t){this.update(Uint8Array.from(t))}updateWithString(t){return this.update(h(t))}update(t){return this._bufs.push(t),this._totallen+=t.length,this}digest(){const t=new Uint8Array(this._totallen);let s=0;for(const n of this._bufs)t.set(n,s),s+=n.length;return this.init(),this._xxHash32(t,this._seed)}_xxHash32(h,i=0){const o=h;let u=i+r&4294967295,a=0;if(o.length>=16){const n=[i+t+s&4294967295,i+s&4294967295,i+0&4294967295,i-t&4294967295],e=h,r=e.length-16;let o=0;for(a=0;(4294967280&a)<=r;a+=4){const r=a,h=e[r+0]+(e[r+1]<<8),i=e[r+2]+(e[r+3]<<8),u=h*s+(i*s<<16);let l=n[o]+u&4294967295;l=l<<13|l>>>19;const f=65535&l,p=l>>>16;n[o]=f*t+(p*t<<16)&4294967295,o=o+1&3}u=(n[0]<<1|n[0]>>>31)+(n[1]<<7|n[1]>>>25)+(n[2]<<12|n[2]>>>20)+(n[3]<<18|n[3]>>>14)&4294967295}u=u+h.length&4294967295;const l=h.length-4;for(;a<=l;a+=4){const t=a,s=o[t+0]+(o[t+1]<<8),r=o[t+2]+(o[t+3]<<8);u=u+(s*n+(r*n<<16))&4294967295,u=u<<17|u>>>15,u=(65535&u)*e+((u>>>16)*e<<16)&4294967295}for(;a<o.length;++a){u+=o[a]*r,u=u<<11|u>>>21,u=(65535&u)*t+((u>>>16)*t<<16)&4294967295}return u^=u>>>15,u=((65535&u)*s&4294967295)+((u>>>16)*s<<16),u^=u>>>13,u=((65535&u)*n&4294967295)+((u>>>16)*n<<16),u^=u>>>16,u<0?u+4294967296:u}}export{i as XXH};
|
package/arcade/lib/scanner.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.25/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{assert as e}from"./assert.js";import{Character as t}from"./character.js";import{Messages as i}from"./messages.js";import{TokenType as s}from"./token.js";function n(e){return"0123456789abcdef".indexOf(e.toLowerCase())}function r(e){return"01234567".indexOf(e)}class h{constructor(e,t){this.source=e,this.errorHandler=t,this.trackComment=!1,this.isModule=!1,this.length=e.length,this.index=0,this.lineNumber=e.length>0?1:0,this.lineStart=0,this.curlyStack=[]}saveState(){return{index:this.index,lineNumber:this.lineNumber,lineStart:this.lineStart,curlyStack:this.curlyStack.slice()}}restoreState(e){this.index=e.index,this.lineNumber=e.lineNumber,this.lineStart=e.lineStart,this.curlyStack=e.curlyStack}eof(){return this.index>=this.length}throwUnexpectedToken(e=i.UnexpectedTokenIllegal){return this.errorHandler.throwError(this.index,this.lineNumber,this.index-this.lineStart+1,e)}_tolerateUnexpectedToken(e=i.UnexpectedTokenIllegal){this.errorHandler.tolerateError(this.index,this.lineNumber,this.index-this.lineStart+1,e)}_skipSingleLineComment(e){let i=[],s=0,n=null;for(this.trackComment&&(i=[],s=this.index-e,n={start:{line:this.lineNumber,column:this.index-this.lineStart-e},end:{line:0,column:0}});!this.eof();){const r=this.source.charCodeAt(this.index);if(++this.index,t.isLineTerminator(r)){if(n){n.end={line:this.lineNumber,column:this.index-this.lineStart-1};const t={multiLine:!1,slice:[s+e,this.index-1],range:[s,this.index-1],loc:n};i.push(t)}return 13===r&&10===this.source.charCodeAt(this.index)&&++this.index,++this.lineNumber,this.lineStart=this.index,i}}if(n){n.end={line:this.lineNumber,column:this.index-this.lineStart};const t={multiLine:!1,slice:[s+e,this.index],range:[s,this.index],loc:n};i.push(t)}return i}_skipMultiLineComment(){const e=[];let i=0,s=null;for(this.trackComment&&(i=this.index-2,s={start:{line:this.lineNumber,column:this.index-this.lineStart-2},end:{line:0,column:0}});!this.eof();){const n=this.source.charCodeAt(this.index);if(t.isLineTerminator(n))13===n&&10===this.source.charCodeAt(this.index+1)&&++this.index,++this.lineNumber,++this.index,this.lineStart=this.index;else if(42===n){if(47===this.source.charCodeAt(this.index+1)){if(this.index+=2,s){s.end={line:this.lineNumber,column:this.index-this.lineStart};const t={multiLine:!0,slice:[i+2,this.index-2],range:[i,this.index],loc:s};e.push(t)}return e}++this.index}else++this.index}if(s){s.end={line:this.lineNumber,column:this.index-this.lineStart};const t={multiLine:!0,slice:[i+2,this.index],range:[i,this.index],loc:s};e.push(t)}return this._tolerateUnexpectedToken(),e}scanComments(){let e=null;this.trackComment&&(e=[]);let i=0===this.index;for(;!this.eof();){let s=this.source.charCodeAt(this.index);if(t.isWhiteSpace(s))++this.index;else if(t.isLineTerminator(s))++this.index,13===s&&10===this.source.charCodeAt(this.index)&&++this.index,++this.lineNumber,this.lineStart=this.index,i=!0;else if(47===s)if(s=this.source.charCodeAt(this.index+1),47===s){this.index+=2;const t=this._skipSingleLineComment(2);e&&(e=e.concat(t)),i=!0}else{if(42!==s)break;{this.index+=2;const t=this._skipMultiLineComment();e&&(e=e.concat(t))}}else if(i&&45===s){if(45!==this.source.charCodeAt(this.index+1)||62!==this.source.charCodeAt(this.index+2))break;{this.index+=3;const t=this._skipSingleLineComment(3);e&&(e=e.concat(t))}}else{if(60!==s||this.isModule)break;if("!--"!==this.source.slice(this.index+1,this.index+4))break;{this.index+=4;const t=this._skipSingleLineComment(4);e&&(e=e.concat(t))}}}return e}_isKeyword(e){switch((e=e.toLowerCase()).length){case 2:return"if"===e||"in"===e;case 3:return"var"===e||"for"===e;case 4:return"else"===e;case 5:return"break"===e;case 6:return"return"===e;case 8:return"function"===e||"continue"===e;default:return!1}}_codePointAt(e){let t=this.source.charCodeAt(e);if(t>=55296&&t<=56319){const i=this.source.charCodeAt(e+1);if(i>=56320&&i<=57343){t=1024*(t-55296)+i-56320+65536}}return t}_scanHexEscape(e){const i="u"===e?4:2;let s=0;for(let r=0;r<i;++r){if(this.eof()||!t.isHexDigit(this.source.charCodeAt(this.index)))return null;s=16*s+n(this.source[this.index++])}return String.fromCharCode(s)}_scanUnicodeCodePointEscape(){let e=this.source[this.index],i=0;for("}"===e&&this.throwUnexpectedToken();!this.eof()&&(e=this.source[this.index++],t.isHexDigit(e.charCodeAt(0)));)i=16*i+n(e);return(i>1114111||"}"!==e)&&this.throwUnexpectedToken(),t.fromCodePoint(i)}_getIdentifier(){const e=this.index++;for(;!this.eof();){const i=this.source.charCodeAt(this.index);if(92===i)return this.index=e,this._getComplexIdentifier();if(i>=55296&&i<57343)return this.index=e,this._getComplexIdentifier();if(!t.isIdentifierPart(i))break;++this.index}return this.source.slice(e,this.index)}_getComplexIdentifier(){let e,i=this._codePointAt(this.index),s=t.fromCodePoint(i);for(this.index+=s.length,92===i&&(117!==this.source.charCodeAt(this.index)&&this.throwUnexpectedToken(),++this.index,"{"===this.source[this.index]?(++this.index,e=this._scanUnicodeCodePointEscape()):(e=this._scanHexEscape("u"),null!==e&&"\\"!==e&&t.isIdentifierStart(e.charCodeAt(0))||this.throwUnexpectedToken()),s=e);!this.eof()&&(i=this._codePointAt(this.index),t.isIdentifierPart(i));)e=t.fromCodePoint(i),s+=e,this.index+=e.length,92===i&&(s=s.substr(0,s.length-1),117!==this.source.charCodeAt(this.index)&&this.throwUnexpectedToken(),++this.index,"{"===this.source[this.index]?(++this.index,e=this._scanUnicodeCodePointEscape()):(e=this._scanHexEscape("u"),null!==e&&"\\"!==e&&t.isIdentifierPart(e.charCodeAt(0))||this.throwUnexpectedToken()),s+=e);return s}_octalToDecimal(e){let i="0"!==e,s=r(e);return!this.eof()&&t.isOctalDigit(this.source.charCodeAt(this.index))&&(i=!0,s=8*s+r(this.source[this.index++]),"0123".includes(e)&&!this.eof()&&t.isOctalDigit(this.source.charCodeAt(this.index))&&(s=8*s+r(this.source[this.index++]))),{code:s,octal:i}}_scanIdentifier(){let e;const t=this.index,n=92===this.source.charCodeAt(t)?this._getComplexIdentifier():this._getIdentifier();if(e=1===n.length?s.Identifier:this._isKeyword(n)?s.Keyword:"null"===n.toLowerCase()?s.NullLiteral:"true"===n.toLowerCase()||"false"===n.toLowerCase()?s.BooleanLiteral:s.Identifier,e!==s.Identifier&&t+n.length!==this.index){const e=this.index;this.index=t,this._tolerateUnexpectedToken(i.InvalidEscapedReservedWord),this.index=e}return{type:e,value:n,lineNumber:this.lineNumber,lineStart:this.lineStart,start:t,end:this.index}}_scanPunctuator(){const e=this.index;let t=this.source[this.index];switch(t){case"(":case"{":"{"===t&&this.curlyStack.push("{"),++this.index;break;case".":case")":case";":case",":case"[":case"]":case":":case"?":case"~":++this.index;break;case"}":++this.index,this.curlyStack.pop();break;default:t=this.source.substr(this.index,4),">>>="===t?this.index+=4:(t=t.substr(0,3),"==="===t||"!=="===t||">>>"===t||"<<="===t||">>="===t||"**="===t?this.index+=3:(t=t.substr(0,2),"&&"===t||"||"===t||"=="===t||"!="===t||"+="===t||"-="===t||"*="===t||"/="===t||"++"===t||"--"===t||"<<"===t||">>"===t||"&="===t||"|="===t||"^="===t||"%="===t||"<="===t||">="===t||"=>"===t||"**"===t?this.index+=2:(t=this.source[this.index],"<>=!+-*%&|^/".includes(t)&&++this.index)))}return this.index===e&&this.throwUnexpectedToken(),{type:s.Punctuator,value:t,lineNumber:this.lineNumber,lineStart:this.lineStart,start:e,end:this.index}}_scanHexLiteral(e){let i="";for(;!this.eof()&&t.isHexDigit(this.source.charCodeAt(this.index));)i+=this.source[this.index++];return 0===i.length&&this.throwUnexpectedToken(),t.isIdentifierStart(this.source.charCodeAt(this.index))&&this.throwUnexpectedToken(),{type:s.NumericLiteral,value:parseInt("0x"+i,16),lineNumber:this.lineNumber,lineStart:this.lineStart,start:e,end:this.index}}_scanBinaryLiteral(e){let i="";for(;!this.eof();){const e=this.source[this.index];if("0"!==e&&"1"!==e)break;i+=this.source[this.index++]}if(0===i.length&&this.throwUnexpectedToken(),!this.eof()){const e=this.source.charCodeAt(this.index);(t.isIdentifierStart(e)||t.isDecimalDigit(e))&&this.throwUnexpectedToken()}return{type:s.NumericLiteral,value:parseInt(i,2),lineNumber:this.lineNumber,lineStart:this.lineStart,start:e,end:this.index}}_scanOctalLiteral(e,i){let n="",r=!1;for(t.isOctalDigit(e.charCodeAt(0))?(r=!0,n="0"+this.source[this.index++]):++this.index;!this.eof()&&t.isOctalDigit(this.source.charCodeAt(this.index));)n+=this.source[this.index++];return r||0!==n.length||this.throwUnexpectedToken(),(t.isIdentifierStart(this.source.charCodeAt(this.index))||t.isDecimalDigit(this.source.charCodeAt(this.index)))&&this.throwUnexpectedToken(),{type:s.NumericLiteral,value:parseInt(n,8),octal:r,lineNumber:this.lineNumber,lineStart:this.lineStart,start:i,end:this.index}}_scanNumericLiteral(){const i=this.index;let n=this.source[i];e(t.isDecimalDigit(n.charCodeAt(0))||"."===n,"Numeric literal must start with a decimal digit or a decimal point");let r="";if("."!==n){if(r=this.source[this.index++],n=this.source[this.index],"0"===r){if("x"===n||"X"===n)return++this.index,this._scanHexLiteral(i);if("b"===n||"B"===n)return++this.index,this._scanBinaryLiteral(i);if("o"===n||"O"===n)return this._scanOctalLiteral(n,i)}for(;t.isDecimalDigit(this.source.charCodeAt(this.index));)r+=this.source[this.index++];n=this.source[this.index]}if("."===n){for(r+=this.source[this.index++];t.isDecimalDigit(this.source.charCodeAt(this.index));)r+=this.source[this.index++];n=this.source[this.index]}if("e"===n||"E"===n)if(r+=this.source[this.index++],n=this.source[this.index],"+"!==n&&"-"!==n||(r+=this.source[this.index++]),t.isDecimalDigit(this.source.charCodeAt(this.index)))for(;t.isDecimalDigit(this.source.charCodeAt(this.index));)r+=this.source[this.index++];else this.throwUnexpectedToken();return t.isIdentifierStart(this.source.charCodeAt(this.index))&&this.throwUnexpectedToken(),{type:s.NumericLiteral,value:parseFloat(r),lineNumber:this.lineNumber,lineStart:this.lineStart,start:i,end:this.index}}_scanStringLiteral(){const n=this.index;let r=this.source[n];e("'"===r||'"'===r,"String literal must starts with a quote"),++this.index;let h=!1,c="";for(;!this.eof();){let e=this.source[this.index++];if(e===r){r="";break}if("\\"===e)if(e=this.source[this.index++],e&&t.isLineTerminator(e.charCodeAt(0)))++this.lineNumber,"\r"===e&&"\n"===this.source[this.index]&&++this.index,this.lineStart=this.index;else switch(e){case"u":if("{"===this.source[this.index])++this.index,c+=this._scanUnicodeCodePointEscape();else{const t=this._scanHexEscape(e);null===t&&this.throwUnexpectedToken(),c+=t}break;case"x":{const t=this._scanHexEscape(e);null===t&&this.throwUnexpectedToken(i.InvalidHexEscapeSequence),c+=t;break}case"n":c+="\n";break;case"r":c+="\r";break;case"t":c+="\t";break;case"b":c+="\b";break;case"f":c+="\f";break;case"v":c+="\v";break;case"8":case"9":c+=e,this._tolerateUnexpectedToken();break;default:if(e&&t.isOctalDigit(e.charCodeAt(0))){const t=this._octalToDecimal(e);h=t.octal||h,c+=String.fromCharCode(t.code)}else c+=e}else{if(t.isLineTerminator(e.charCodeAt(0)))break;c+=e}}return""!==r&&(this.index=n,this.throwUnexpectedToken()),{type:s.StringLiteral,value:c,octal:h,lineNumber:this.lineNumber,lineStart:this.lineStart,start:n,end:this.index}}_scanTemplate(){let e="",n=!1;const r=this.index,h="`"===this.source[r];let c=!1,o=2;for(++this.index;!this.eof();){let s=this.source[this.index++];if("`"===s){o=1,c=!0,n=!0;break}if("$"===s){if("{"===this.source[this.index]){this.curlyStack.push("${"),++this.index,n=!0;break}e+=s}else if("\\"===s)if(s=this.source[this.index++],t.isLineTerminator(s.charCodeAt(0)))++this.lineNumber,"\r"===s&&"\n"===this.source[this.index]&&++this.index,this.lineStart=this.index;else switch(s){case"n":e+="\n";break;case"r":e+="\r";break;case"t":e+="\t";break;case"u":if("{"===this.source[this.index])++this.index,e+=this._scanUnicodeCodePointEscape();else{const t=this.index,i=this._scanHexEscape(s);null!==i?e+=i:(this.index=t,e+=s)}break;case"x":{const t=this._scanHexEscape(s);null===t&&this.throwUnexpectedToken(i.InvalidHexEscapeSequence),e+=t;break}case"b":e+="\b";break;case"f":e+="\f";break;case"v":e+="\v";break;default:"0"===s?(t.isDecimalDigit(this.source.charCodeAt(this.index))&&this.throwUnexpectedToken(i.TemplateOctalLiteral),e+="\0"):t.isOctalDigit(s.charCodeAt(0))?this.throwUnexpectedToken(i.TemplateOctalLiteral):e+=s}else t.isLineTerminator(s.charCodeAt(0))?(++this.lineNumber,"\r"===s&&"\n"===this.source[this.index]&&++this.index,this.lineStart=this.index,e+="\n"):e+=s}return n||this.throwUnexpectedToken(),h||this.curlyStack.pop(),{type:s.Template,value:this.source.slice(r+1,this.index-o),cooked:e,head:h,tail:c,lineNumber:this.lineNumber,lineStart:this.lineStart,start:r,end:this.index}}_testRegExp(e,t){const s="";let n=e;t.includes("u")&&(n=n.replace(/\\u\{([0-9a-fA-F]+)\}|\\u([a-fA-F0-9]{4})/g,((e,t,n)=>{const r=parseInt(t||n,16);return r>1114111&&this.throwUnexpectedToken(i.InvalidRegExp),r<=65535?String.fromCharCode(r):s})).replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,s));try{RegExp(n)}catch(r){this.throwUnexpectedToken(i.InvalidRegExp)}try{return new RegExp(e,t)}catch(h){return null}}_scanRegExpBody(){let s=this.source[this.index];e("/"===s,"Regular expression literal must start with a slash");let n=this.source[this.index++],r=!1,h=!1;for(;!this.eof();)if(s=this.source[this.index++],n+=s,"\\"===s)s=this.source[this.index++],t.isLineTerminator(s.charCodeAt(0))&&this.throwUnexpectedToken(i.UnterminatedRegExp),n+=s;else if(t.isLineTerminator(s.charCodeAt(0)))this.throwUnexpectedToken(i.UnterminatedRegExp);else if(r)"]"===s&&(r=!1);else{if("/"===s){h=!0;break}"["===s&&(r=!0)}return h||this.throwUnexpectedToken(i.UnterminatedRegExp),n.substr(1,n.length-2)}_scanRegExpFlags(){let e="",i="";for(;!this.eof();){let s=this.source[this.index];if(!t.isIdentifierPart(s.charCodeAt(0)))break;if(++this.index,"\\"!==s||this.eof())i+=s,e+=s;else if(s=this.source[this.index],"u"===s){++this.index;let t=this.index;const s=this._scanHexEscape("u");if(null!==s)for(i+=s,e+="\\u";t<this.index;++t)e+=this.source[t];else this.index=t,i+="u",e+="\\u";this._tolerateUnexpectedToken()}else e+="\\",this._tolerateUnexpectedToken()}return i}scanRegExp(){const e=this.index,t=this._scanRegExpBody(),i=this._scanRegExpFlags(),n=this._testRegExp(t,i);return{type:s.RegularExpression,value:"",pattern:t,flags:i,regex:n,lineNumber:this.lineNumber,lineStart:this.lineStart,start:e,end:this.index}}lex(){if(this.eof())return{type:s.EOF,value:"",lineNumber:this.lineNumber,lineStart:this.lineStart,start:this.index,end:this.index};const e=this.source.charCodeAt(this.index);return t.isIdentifierStart(e)?this._scanIdentifier():40===e||41===e||59===e?this._scanPunctuator():39===e||34===e?this._scanStringLiteral():46===e?t.isDecimalDigit(this.source.charCodeAt(this.index+1))?this._scanNumericLiteral():this._scanPunctuator():t.isDecimalDigit(e)?this._scanNumericLiteral():96===e||125===e&&"${"===this.curlyStack[this.curlyStack.length-1]?this._scanTemplate():e>=55296&&e<57343&&t.isIdentifierStart(this._codePointAt(this.index))?this._scanIdentifier():this._scanPunctuator()}}export{h as Scanner};
|
|
5
|
+
import{assert as e}from"./assert.js";import{Character as t}from"./character.js";import{Messages as i}from"./messages.js";import{TokenType as s}from"./token.js";function n(e){return"0123456789abcdef".indexOf(e.toLowerCase())}function r(e){return"01234567".indexOf(e)}class h{constructor(e,t){this.source=e,this.errorHandler=t,this.trackComment=!1,this.isModule=!1,this._length=e.length,this.index=0,this.lineNumber=e.length>0?1:0,this.lineStart=0,this.curlyStack=[]}saveState(){return{index:this.index,lineNumber:this.lineNumber,lineStart:this.lineStart,curlyStack:this.curlyStack.slice()}}restoreState(e){this.index=e.index,this.lineNumber=e.lineNumber,this.lineStart=e.lineStart,this.curlyStack=e.curlyStack}eof(){return this.index>=this._length}throwUnexpectedToken(e=i.UnexpectedTokenIllegal){return this.errorHandler.throwError(this.index,this.lineNumber,this.index-this.lineStart+1,e)}_tolerateUnexpectedToken(e=i.UnexpectedTokenIllegal){this.errorHandler.tolerateError(this.index,this.lineNumber,this.index-this.lineStart+1,e)}_skipSingleLineComment(e){let i=[],s=0,n=null;for(this.trackComment&&(i=[],s=this.index-e,n={start:{line:this.lineNumber,column:this.index-this.lineStart-e},end:{line:0,column:0}});!this.eof();){const r=this.source.charCodeAt(this.index);if(++this.index,t.isLineTerminator(r)){if(n){n.end={line:this.lineNumber,column:this.index-this.lineStart-1};const t={multiLine:!1,slice:[s+e,this.index-1],range:[s,this.index-1],loc:n};i.push(t)}return 13===r&&10===this.source.charCodeAt(this.index)&&++this.index,++this.lineNumber,this.lineStart=this.index,i}}if(n){n.end={line:this.lineNumber,column:this.index-this.lineStart};const t={multiLine:!1,slice:[s+e,this.index],range:[s,this.index],loc:n};i.push(t)}return i}_skipMultiLineComment(){const e=[];let i=0,s=null;for(this.trackComment&&(i=this.index-2,s={start:{line:this.lineNumber,column:this.index-this.lineStart-2},end:{line:0,column:0}});!this.eof();){const n=this.source.charCodeAt(this.index);if(t.isLineTerminator(n))13===n&&10===this.source.charCodeAt(this.index+1)&&++this.index,++this.lineNumber,++this.index,this.lineStart=this.index;else if(42===n){if(47===this.source.charCodeAt(this.index+1)){if(this.index+=2,s){s.end={line:this.lineNumber,column:this.index-this.lineStart};const t={multiLine:!0,slice:[i+2,this.index-2],range:[i,this.index],loc:s};e.push(t)}return e}++this.index}else++this.index}if(s){s.end={line:this.lineNumber,column:this.index-this.lineStart};const t={multiLine:!0,slice:[i+2,this.index],range:[i,this.index],loc:s};e.push(t)}return this._tolerateUnexpectedToken(),e}scanComments(){let e=null;this.trackComment&&(e=[]);let i=0===this.index;for(;!this.eof();){let s=this.source.charCodeAt(this.index);if(t.isWhiteSpace(s))++this.index;else if(t.isLineTerminator(s))++this.index,13===s&&10===this.source.charCodeAt(this.index)&&++this.index,++this.lineNumber,this.lineStart=this.index,i=!0;else if(47===s)if(s=this.source.charCodeAt(this.index+1),47===s){this.index+=2;const t=this._skipSingleLineComment(2);e&&(e=e.concat(t)),i=!0}else{if(42!==s)break;{this.index+=2;const t=this._skipMultiLineComment();e&&(e=e.concat(t))}}else if(i&&45===s){if(45!==this.source.charCodeAt(this.index+1)||62!==this.source.charCodeAt(this.index+2))break;{this.index+=3;const t=this._skipSingleLineComment(3);e&&(e=e.concat(t))}}else{if(60!==s||this.isModule)break;if("!--"!==this.source.slice(this.index+1,this.index+4))break;{this.index+=4;const t=this._skipSingleLineComment(4);e&&(e=e.concat(t))}}}return e}_isKeyword(e){switch((e=e.toLowerCase()).length){case 2:return"if"===e||"in"===e;case 3:return"var"===e||"for"===e;case 4:return"else"===e;case 5:return"break"===e;case 6:return"return"===e;case 8:return"function"===e||"continue"===e;default:return!1}}_codePointAt(e){let t=this.source.charCodeAt(e);if(t>=55296&&t<=56319){const i=this.source.charCodeAt(e+1);if(i>=56320&&i<=57343){t=1024*(t-55296)+i-56320+65536}}return t}_scanHexEscape(e){const i="u"===e?4:2;let s=0;for(let r=0;r<i;++r){if(this.eof()||!t.isHexDigit(this.source.charCodeAt(this.index)))return null;s=16*s+n(this.source[this.index++])}return String.fromCharCode(s)}_scanUnicodeCodePointEscape(){let e=this.source[this.index],i=0;for("}"===e&&this.throwUnexpectedToken();!this.eof()&&(e=this.source[this.index++],t.isHexDigit(e.charCodeAt(0)));)i=16*i+n(e);return(i>1114111||"}"!==e)&&this.throwUnexpectedToken(),t.fromCodePoint(i)}_getIdentifier(){const e=this.index++;for(;!this.eof();){const i=this.source.charCodeAt(this.index);if(92===i)return this.index=e,this._getComplexIdentifier();if(i>=55296&&i<57343)return this.index=e,this._getComplexIdentifier();if(!t.isIdentifierPart(i))break;++this.index}return this.source.slice(e,this.index)}_getComplexIdentifier(){let e,i=this._codePointAt(this.index),s=t.fromCodePoint(i);for(this.index+=s.length,92===i&&(117!==this.source.charCodeAt(this.index)&&this.throwUnexpectedToken(),++this.index,"{"===this.source[this.index]?(++this.index,e=this._scanUnicodeCodePointEscape()):(e=this._scanHexEscape("u"),null!==e&&"\\"!==e&&t.isIdentifierStart(e.charCodeAt(0))||this.throwUnexpectedToken()),s=e);!this.eof()&&(i=this._codePointAt(this.index),t.isIdentifierPart(i));)e=t.fromCodePoint(i),s+=e,this.index+=e.length,92===i&&(s=s.substr(0,s.length-1),117!==this.source.charCodeAt(this.index)&&this.throwUnexpectedToken(),++this.index,"{"===this.source[this.index]?(++this.index,e=this._scanUnicodeCodePointEscape()):(e=this._scanHexEscape("u"),null!==e&&"\\"!==e&&t.isIdentifierPart(e.charCodeAt(0))||this.throwUnexpectedToken()),s+=e);return s}_octalToDecimal(e){let i="0"!==e,s=r(e);return!this.eof()&&t.isOctalDigit(this.source.charCodeAt(this.index))&&(i=!0,s=8*s+r(this.source[this.index++]),"0123".includes(e)&&!this.eof()&&t.isOctalDigit(this.source.charCodeAt(this.index))&&(s=8*s+r(this.source[this.index++]))),{code:s,octal:i}}_scanIdentifier(){let e;const t=this.index,n=92===this.source.charCodeAt(t)?this._getComplexIdentifier():this._getIdentifier();if(e=1===n.length?s.Identifier:this._isKeyword(n)?s.Keyword:"null"===n.toLowerCase()?s.NullLiteral:"true"===n.toLowerCase()||"false"===n.toLowerCase()?s.BooleanLiteral:s.Identifier,e!==s.Identifier&&t+n.length!==this.index){const e=this.index;this.index=t,this._tolerateUnexpectedToken(i.InvalidEscapedReservedWord),this.index=e}return{type:e,value:n,lineNumber:this.lineNumber,lineStart:this.lineStart,start:t,end:this.index}}_scanPunctuator(){const e=this.index;let t=this.source[this.index];switch(t){case"(":case"{":"{"===t&&this.curlyStack.push("{"),++this.index;break;case".":case")":case";":case",":case"[":case"]":case":":case"?":case"~":++this.index;break;case"}":++this.index,this.curlyStack.pop();break;default:t=this.source.substr(this.index,4),">>>="===t?this.index+=4:(t=t.substr(0,3),"==="===t||"!=="===t||">>>"===t||"<<="===t||">>="===t||"**="===t?this.index+=3:(t=t.substr(0,2),"&&"===t||"||"===t||"=="===t||"!="===t||"+="===t||"-="===t||"*="===t||"/="===t||"++"===t||"--"===t||"<<"===t||">>"===t||"&="===t||"|="===t||"^="===t||"%="===t||"<="===t||">="===t||"=>"===t||"**"===t?this.index+=2:(t=this.source[this.index],"<>=!+-*%&|^/".includes(t)&&++this.index)))}return this.index===e&&this.throwUnexpectedToken(),{type:s.Punctuator,value:t,lineNumber:this.lineNumber,lineStart:this.lineStart,start:e,end:this.index}}_scanHexLiteral(e){let i="";for(;!this.eof()&&t.isHexDigit(this.source.charCodeAt(this.index));)i+=this.source[this.index++];return 0===i.length&&this.throwUnexpectedToken(),t.isIdentifierStart(this.source.charCodeAt(this.index))&&this.throwUnexpectedToken(),{type:s.NumericLiteral,value:parseInt("0x"+i,16),lineNumber:this.lineNumber,lineStart:this.lineStart,start:e,end:this.index}}_scanBinaryLiteral(e){let i="";for(;!this.eof();){const e=this.source[this.index];if("0"!==e&&"1"!==e)break;i+=this.source[this.index++]}if(0===i.length&&this.throwUnexpectedToken(),!this.eof()){const e=this.source.charCodeAt(this.index);(t.isIdentifierStart(e)||t.isDecimalDigit(e))&&this.throwUnexpectedToken()}return{type:s.NumericLiteral,value:parseInt(i,2),lineNumber:this.lineNumber,lineStart:this.lineStart,start:e,end:this.index}}_scanOctalLiteral(e,i){let n="",r=!1;for(t.isOctalDigit(e.charCodeAt(0))?(r=!0,n="0"+this.source[this.index++]):++this.index;!this.eof()&&t.isOctalDigit(this.source.charCodeAt(this.index));)n+=this.source[this.index++];return r||0!==n.length||this.throwUnexpectedToken(),(t.isIdentifierStart(this.source.charCodeAt(this.index))||t.isDecimalDigit(this.source.charCodeAt(this.index)))&&this.throwUnexpectedToken(),{type:s.NumericLiteral,value:parseInt(n,8),octal:r,lineNumber:this.lineNumber,lineStart:this.lineStart,start:i,end:this.index}}_scanNumericLiteral(){const i=this.index;let n=this.source[i];e(t.isDecimalDigit(n.charCodeAt(0))||"."===n,"Numeric literal must start with a decimal digit or a decimal point");let r="";if("."!==n){if(r=this.source[this.index++],n=this.source[this.index],"0"===r){if("x"===n||"X"===n)return++this.index,this._scanHexLiteral(i);if("b"===n||"B"===n)return++this.index,this._scanBinaryLiteral(i);if("o"===n||"O"===n)return this._scanOctalLiteral(n,i)}for(;t.isDecimalDigit(this.source.charCodeAt(this.index));)r+=this.source[this.index++];n=this.source[this.index]}if("."===n){for(r+=this.source[this.index++];t.isDecimalDigit(this.source.charCodeAt(this.index));)r+=this.source[this.index++];n=this.source[this.index]}if("e"===n||"E"===n)if(r+=this.source[this.index++],n=this.source[this.index],"+"!==n&&"-"!==n||(r+=this.source[this.index++]),t.isDecimalDigit(this.source.charCodeAt(this.index)))for(;t.isDecimalDigit(this.source.charCodeAt(this.index));)r+=this.source[this.index++];else this.throwUnexpectedToken();return t.isIdentifierStart(this.source.charCodeAt(this.index))&&this.throwUnexpectedToken(),{type:s.NumericLiteral,value:parseFloat(r),lineNumber:this.lineNumber,lineStart:this.lineStart,start:i,end:this.index}}_scanStringLiteral(){const n=this.index;let r=this.source[n];e("'"===r||'"'===r,"String literal must starts with a quote"),++this.index;let h=!1,c="";for(;!this.eof();){let e=this.source[this.index++];if(e===r){r="";break}if("\\"===e)if(e=this.source[this.index++],e&&t.isLineTerminator(e.charCodeAt(0)))++this.lineNumber,"\r"===e&&"\n"===this.source[this.index]&&++this.index,this.lineStart=this.index;else switch(e){case"u":if("{"===this.source[this.index])++this.index,c+=this._scanUnicodeCodePointEscape();else{const t=this._scanHexEscape(e);null===t&&this.throwUnexpectedToken(),c+=t}break;case"x":{const t=this._scanHexEscape(e);null===t&&this.throwUnexpectedToken(i.InvalidHexEscapeSequence),c+=t;break}case"n":c+="\n";break;case"r":c+="\r";break;case"t":c+="\t";break;case"b":c+="\b";break;case"f":c+="\f";break;case"v":c+="\v";break;case"8":case"9":c+=e,this._tolerateUnexpectedToken();break;default:if(e&&t.isOctalDigit(e.charCodeAt(0))){const t=this._octalToDecimal(e);h=t.octal||h,c+=String.fromCharCode(t.code)}else c+=e}else{if(t.isLineTerminator(e.charCodeAt(0)))break;c+=e}}return""!==r&&(this.index=n,this.throwUnexpectedToken()),{type:s.StringLiteral,value:c,octal:h,lineNumber:this.lineNumber,lineStart:this.lineStart,start:n,end:this.index}}_scanTemplate(){let e="",n=!1;const r=this.index,h="`"===this.source[r];let c=!1,o=2;for(++this.index;!this.eof();){let s=this.source[this.index++];if("`"===s){o=1,c=!0,n=!0;break}if("$"===s){if("{"===this.source[this.index]){this.curlyStack.push("${"),++this.index,n=!0;break}e+=s}else if("\\"===s)if(s=this.source[this.index++],t.isLineTerminator(s.charCodeAt(0)))++this.lineNumber,"\r"===s&&"\n"===this.source[this.index]&&++this.index,this.lineStart=this.index;else switch(s){case"n":e+="\n";break;case"r":e+="\r";break;case"t":e+="\t";break;case"u":if("{"===this.source[this.index])++this.index,e+=this._scanUnicodeCodePointEscape();else{const t=this.index,i=this._scanHexEscape(s);null!==i?e+=i:(this.index=t,e+=s)}break;case"x":{const t=this._scanHexEscape(s);null===t&&this.throwUnexpectedToken(i.InvalidHexEscapeSequence),e+=t;break}case"b":e+="\b";break;case"f":e+="\f";break;case"v":e+="\v";break;default:"0"===s?(t.isDecimalDigit(this.source.charCodeAt(this.index))&&this.throwUnexpectedToken(i.TemplateOctalLiteral),e+="\0"):t.isOctalDigit(s.charCodeAt(0))?this.throwUnexpectedToken(i.TemplateOctalLiteral):e+=s}else t.isLineTerminator(s.charCodeAt(0))?(++this.lineNumber,"\r"===s&&"\n"===this.source[this.index]&&++this.index,this.lineStart=this.index,e+="\n"):e+=s}return n||this.throwUnexpectedToken(),h||this.curlyStack.pop(),{type:s.Template,value:this.source.slice(r+1,this.index-o),cooked:e,head:h,tail:c,lineNumber:this.lineNumber,lineStart:this.lineStart,start:r,end:this.index}}_testRegExp(e,t){const s="";let n=e;t.includes("u")&&(n=n.replace(/\\u\{([0-9a-fA-F]+)\}|\\u([a-fA-F0-9]{4})/g,((e,t,n)=>{const r=parseInt(t||n,16);return r>1114111&&this.throwUnexpectedToken(i.InvalidRegExp),r<=65535?String.fromCharCode(r):s})).replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,s));try{RegExp(n)}catch(r){this.throwUnexpectedToken(i.InvalidRegExp)}try{return new RegExp(e,t)}catch(h){return null}}_scanRegExpBody(){let s=this.source[this.index];e("/"===s,"Regular expression literal must start with a slash");let n=this.source[this.index++],r=!1,h=!1;for(;!this.eof();)if(s=this.source[this.index++],n+=s,"\\"===s)s=this.source[this.index++],t.isLineTerminator(s.charCodeAt(0))&&this.throwUnexpectedToken(i.UnterminatedRegExp),n+=s;else if(t.isLineTerminator(s.charCodeAt(0)))this.throwUnexpectedToken(i.UnterminatedRegExp);else if(r)"]"===s&&(r=!1);else{if("/"===s){h=!0;break}"["===s&&(r=!0)}return h||this.throwUnexpectedToken(i.UnterminatedRegExp),n.substr(1,n.length-2)}_scanRegExpFlags(){let e="",i="";for(;!this.eof();){let s=this.source[this.index];if(!t.isIdentifierPart(s.charCodeAt(0)))break;if(++this.index,"\\"!==s||this.eof())i+=s,e+=s;else if(s=this.source[this.index],"u"===s){++this.index;let t=this.index;const s=this._scanHexEscape("u");if(null!==s)for(i+=s,e+="\\u";t<this.index;++t)e+=this.source[t];else this.index=t,i+="u",e+="\\u";this._tolerateUnexpectedToken()}else e+="\\",this._tolerateUnexpectedToken()}return i}scanRegExp(){const e=this.index,t=this._scanRegExpBody(),i=this._scanRegExpFlags(),n=this._testRegExp(t,i);return{type:s.RegularExpression,value:"",pattern:t,flags:i,regex:n,lineNumber:this.lineNumber,lineStart:this.lineStart,start:e,end:this.index}}lex(){if(this.eof())return{type:s.EOF,value:"",lineNumber:this.lineNumber,lineStart:this.lineStart,start:this.index,end:this.index};const e=this.source.charCodeAt(this.index);return t.isIdentifierStart(e)?this._scanIdentifier():40===e||41===e||59===e?this._scanPunctuator():39===e||34===e?this._scanStringLiteral():46===e?t.isDecimalDigit(this.source.charCodeAt(this.index+1))?this._scanNumericLiteral():this._scanPunctuator():t.isDecimalDigit(e)?this._scanNumericLiteral():96===e||125===e&&"${"===this.curlyStack[this.curlyStack.length-1]?this._scanTemplate():e>=55296&&e<57343&&t.isIdentifierStart(this._codePointAt(this.index))?this._scanIdentifier():this._scanPunctuator()}}export{h as Scanner};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
[{"d":"M1 14H0V0h6v1H1zm7-2.727V16H2V2h6v1.727a.974.974 0 0 0-.425.238L7 4.54V3H6v3a1 1 0 0 0-1 1v-.191l-2-1v4.34l2-.533V8a1 1 0 0 0 1 1v5H3v1h4v-4.54l.575.576a.984.984 0 0 0 .425.237zM3 4.691l2 1V3H3zM3 13h2v-2.35l-2 .534zM16 0v16h-6v-5.975l1-1v1.391l4-1.066V7.309l-4-2v.667l-1-1V0zm-1 10.384l-4 1.066V15h4zM15 1h-4v3.191l4 2zM6 8h3.353l-1.7 1.7.63.63L11.11 7.5 8.282 4.672l-.629.629L9.353 7H6z"},{"opacity":".5","d":"M11 1h4v5.191l-4-2z"},{"opacity":".25","d":"M6 9h1v6H3v-1h3zm9 1.384l-4 1.066V15h4zM3 4.69l2 1V3H3zM5 13v-2.35l-2 .534V13z"},{"opacity":".75","d":"M3 10.15V5.808l2 1v2.807z"}]
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
[{"opacity":".2","d":"M23 23h-8v-6.807l.024.006h.01a6.316 6.316 0 0 0 2.946-.76 6.344 6.344 0 0 0 .771-.55c.133-.106.267-.212.408-.307a3.2 3.2 0 0 1 .626-.294 5.928 5.928 0 0 0 .559-.239c.434-.246.883-.477 1.32-.679a8.22 8.22 0 0 1 1.22-.394l.116-.03zm-13-2H3v2h8V13h-1zM3 6.334c.25.105.491.216.737.324.768.338 1.52.683 2.244 1.024l1.186.553c.58.268 1.194.576 1.833.906V3H3zM3 20h6v-6.27a8.308 8.308 0 0 0-.948.34c-.612.283-1.236.604-1.84.947a8.357 8.357 0 0 1-.73.31 4.582 4.582 0 0 0-.917.432c-.21.143-.41.301-.608.458a8.538 8.538 0 0 1-.957.685z"},{"opacity":".5","d":"M15 1h8v9.87c-.135-.097-.269-.194-.406-.276a38.984 38.984 0 0 0-3.751-1.99l-.89-.415a54.35 54.35 0 0 0-2.312-1.042l-.376-.153A.706.706 0 0 0 15 6.942z"},{"d":"M10 0v1H1v20H0V0zm2 16.089V24H2V2h10v4.823l-.776.68a.988.988 0 0 0-.224.353V3h-1v7H9l-.35-.244a43.266 43.266 0 0 0-1.777-.885C5.591 8.28 4.305 7.66 3 7.1v8.949c.395-.283.768-.595 1.175-.87a12.48 12.48 0 0 1 1.691-.77q.94-.534 1.905-.979C8.19 13.245 9 13 9 13h1v8H3v2h8v-7.945a.988.988 0 0 0 .224.354zM3 6.334c1.035.436 2.026.898 2.981 1.348l1.186.553c.58.268 1.194.576 1.833.906V3H3zM3 20h6v-6.27a8.308 8.308 0 0 0-.948.34c-.612.283-1.236.604-1.84.947a8.357 8.357 0 0 1-.73.31 4.582 4.582 0 0 0-.917.432c-.21.143-.41.301-.608.458a8.538 8.538 0 0 1-.957.685zM24 0v24H14v-8.238l1-1v.528a5.369 5.369 0 0 0 2.526-.64 5.233 5.233 0 0 0 .634-.454c.163-.129.322-.255.491-.37a3.922 3.922 0 0 1 .806-.386c.15-.057.302-.115.45-.187.449-.256.915-.495 1.387-.714a9.01 9.01 0 0 1 1.36-.442l.294-.08.052.008v-.09a.393.393 0 0 1-.123-.044 7.456 7.456 0 0 0-.753-.518A37.66 37.66 0 0 0 18.46 9.43l-.863-.404c-.762-.358-1.51-.71-2.267-1.024L15 7.868v.282l-1-1V0zm-1 10.87V1h-8v5.942a.706.706 0 0 1 .265.052l.376.153c.807.335 1.572.694 2.311 1.042l.89.415a38.984 38.984 0 0 1 3.752 1.99c.137.082.271.18.406.276zM23 23V12.945l-.115.031a8.22 8.22 0 0 0-1.222.394 18.17 18.17 0 0 0-1.32.68 5.928 5.928 0 0 1-.558.238 3.2 3.2 0 0 0-.626.294c-.14.095-.275.2-.408.306a6.344 6.344 0 0 1-.77.55 6.316 6.316 0 0 1-2.946.761h-.01c-.005 0-.018-.005-.025-.006V23zM12.938 7.846l-.707.707L14.877 11H8v1h6.877l-2.646 2.446.707.707 3.854-3.653z"},{"opacity":".75","d":"M8 10h1l-.35-.244a43.266 43.266 0 0 0-1.777-.885C5.591 8.28 4.305 7.66 3 7.1v8.949c.395-.283.768-.595 1.175-.87a12.48 12.48 0 0 1 1.691-.77q.94-.534 1.905-.979a6.74 6.74 0 0 1 .416-.16c.224-.084.447-.16.669-.224L9 13H8a1 1 0 0 1-1-1v-1a1 1 0 0 1 1-1z"}]
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
[{"opacity":".5","d":"M20 1v7.976S29 14 31 15V1z"},{"opacity":".25","d":"M2 20.367q-.499.062-1 .087V1h11v3H2zM31 31V16.263c-.481.24-1.077.458-2.146.861-1.692.637-4.624 2.671-6.345 3.263A9.795 9.795 0 0 1 20 21v10zM12 13.125L4 9.25V6h8zm3 8.29V31H4V20.6l4-2.2 3.007-1.365A.996.996 0 0 0 12 18h3v1.879l-.06.06a1 1 0 0 0 0 1.415z"},{"opacity":".75","d":"M11 16a1 1 0 0 1 1-1h.428v-1.705L4 8.964v11.562l1.748-.932 2.464-1.36L11 16.908z"},{"d":"M15.646 22.06L15 21.415V31H4v-4h9v-9h-1v8H4v-5a.705.705 0 0 0 .28-.059l.094-.04a5.718 5.718 0 0 0 .586-.283 8.235 8.235 0 0 0 .997-.71c.198-.158.398-.316.608-.459a4.581 4.581 0 0 1 .916-.431c.232-.09.462-.18.731-.31a25.24 25.24 0 0 1 1.84-.948 8.54 8.54 0 0 1 1.032-.363A.994.994 0 0 1 11 17v-.31a9.43 9.43 0 0 0-1.23.43q-.963.444-1.904.979a12.478 12.478 0 0 0-1.691.77c-.54.363-1.001.818-1.565 1.143A6.163 6.163 0 0 1 4 20.3V9.676l.559.227c1.459.606 2.887 1.309 4.314 1.968A52.281 52.281 0 0 1 12 13.46V15h1V6h2v5.586l.646-.647a.993.993 0 0 1 .354-.222V5H3v27h13v-9.717a.993.993 0 0 1-.354-.222zM4 6h8v6.665a50.309 50.309 0 0 0-2.833-1.43l-1.186-.553a74.758 74.758 0 0 0-3.204-1.446l-.516-.21A.691.691 0 0 0 4 8.976zm15-6v12.879l1 1V9.784l.52.212c1.052.436 2.104.93 3.12 1.41l1.191.556a52.332 52.332 0 0 1 5.055 2.68 10.754 10.754 0 0 1 1.052.725.1.1 0 0 0 .062.021v.456c-.009 0-.435.114-.435.114a12.23 12.23 0 0 0-1.836.597c-.645.298-1.29.629-1.906.98-.207.1-.419.181-.63.263a5.225 5.225 0 0 0-1.074.514c-.23.154-.445.325-.659.495a7.575 7.575 0 0 1-.9.644 7.556 7.556 0 0 1-3.56.903V19.12l-1 1V32h13V0zm12 31H20v-9.757a.189.189 0 0 0 .034.01h.005a8.518 8.518 0 0 0 3.971-1.022 8.475 8.475 0 0 0 1.014-.723c.194-.154.39-.31.597-.45a4.517 4.517 0 0 1 .896-.42c.234-.09.467-.181.744-.318a25.067 25.067 0 0 1 1.83-.942 11.368 11.368 0 0 1 1.705-.55l.204-.055zm0-16.684l-.104-.074c-.18-.13-.36-.26-.545-.371a53.374 53.374 0 0 0-5.142-2.726l-1.189-.556a75.197 75.197 0 0 0-3.205-1.445l-.517-.21A.788.788 0 0 0 20 8.875V1h11zM21.207 16.5l-4.854 4.854-.707-.707L19.293 17H12v-1h7.293l-3.646-3.646.707-.707zM13 0v4h-1V1H1v19.3a6.163 6.163 0 0 0 .61-.288c.14-.08.261-.182.39-.275v.855l-.04.026a5.718 5.718 0 0 1-.586.282l-.094.041A.705.705 0 0 1 1 21v5h1v1H0V0z"}]
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
[{"d":"M16 3v7h-3V9h2V7h-2V6h2V4h-2v1h-1V4H9v1H8V4H6v1H5V3zm-6-1L8.5 0 7 2zM7 14l1.5 2 1.5-2zm5-8v7H1V6zM5 7v2h3V7zM2 9h2V7H2zm2 3v-2H2v2zm4 0v-2H5v2zm3-2H9v2h2zm0-3H9v2h2z"},{"opacity":".5","d":"M15 9h-2V7h2zm-4 1H9v2h2zM8 7H5v2h3z"},{"opacity":".25","d":"M4 9H2V7h2zm4 1H5v2h3zm4-6H9v1h3z"}]
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
[{"d":"M15 4h-5l2.5-2.574zm-3.5 19.574L14 21H9zM1 10h16v9H1zm11 4h4v-3h-4zm0 4h4v-3h-4zm-5-4h4v-3H7zm0 4h4v-3H7zm-5-4h4v-3H2zm0 4h4v-3H2zM7 6v3h1V7h4v2h1V7h4v2h1V7h4v3h-4v1h4v3h-4v1h5V6z"},{"opacity":".25","d":"M17 9h-4V7h4zM6 11H2v3h4zm5 4H7v3h4z"},{"opacity":".5","d":"M22 14h-4v-3h4zm-11-3H7v3h4zm5 4h-4v3h4z"}]
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
[{"d":"M30 8v11h-5v-1h4v-4h-4v-1h4V9h-4v4h-1V9h-4v4h-1V9h-4v4h-1V9h-4v4H9V8zM19 6l-2.5-2.574L14 6zm-5 21l2.5 2.574L19 27zm10-13v11H3V14zm-10 1v4h4v-4zm-5 0v4h4v-4zm-5 4h4v-4H4zm4 5v-4H4v4zm5 0v-4H9v4zm5 0v-4h-4v4zm5-4h-4v4h4zm0-5h-4v4h4z"},{"opacity":".25","d":"M19 13h-4V9h4zm10 1h-4v4h4zm-6 1h-4v4h4zm-10 5H9v4h4zm-5-5H4v4h4z"},{"opacity":".5","d":"M29 13h-4V9h4zm-11 7h-4v4h4zm-5-5H9v4h4z"}]
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"M8.5 1.2a7.3 7.3 0 1 0 7.3 7.3 7.3 7.3 0 0 0-7.3-7.3zm0 13.6a6.3 6.3 0 1 1 6.3-6.3 6.307 6.307 0 0 1-6.3 6.3zM10 12H9v-2H4.793L10 4.793V9h2v1h-2zM7.207 9H9V7.207z"
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"M12.5 2.2a10.3 10.3 0 1 0 10.3 10.3A10.299 10.299 0 0 0 12.5 2.2zm0 19.6a9.3 9.3 0 1 1 9.3-9.3 9.31 9.31 0 0 1-9.3 9.3zM15 17h-1v-2H7.586L15 6.793V14h2v1h-2zm-5-3h4V9.207z"
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"M16.5 3.2a13.3 13.3 0 1 0 13.3 13.3A13.3 13.3 0 0 0 16.5 3.2zm0 25.6a12.3 12.3 0 1 1 12.3-12.3 12.314 12.314 0 0 1-12.3 12.3zM19 23h-1v-3h-7.216L19 9.678V19h3v1h-3zm-6-4h5v-6.678z"
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"M8.5 1.2a7.3 7.3 0 1 0 7.3 7.3 7.3 7.3 0 0 0-7.3-7.3zm0 13.6a6.3 6.3 0 1 1 6.3-6.3 6.307 6.307 0 0 1-6.3 6.3zM11 5H7v3.68a3.486 3.486 0 0 1 .73-.28 3.225 3.225 0 0 1 .82-.11 2.176 2.176 0 0 1 .63.09 1.496 1.496 0 0 1 .53.281 1.349 1.349 0 0 1 .365.487 1.67 1.67 0 0 1 .135.697 1.616 1.616 0 0 1-.115.622 1.451 1.451 0 0 1-.315.482 1.411 1.411 0 0 1-.47.31 1.512 1.512 0 0 1-.58.111 1.42 1.42 0 0 1-.845-.26 1.51 1.51 0 0 1-.535-.69l-.88.35a2.372 2.372 0 0 0 .86 1.03 2.467 2.467 0 0 0 1.4.38 2.68 2.68 0 0 0 .98-.175 2.351 2.351 0 0 0 .78-.49 2.264 2.264 0 0 0 .52-.765 2.567 2.567 0 0 0 .19-1.01 2.3 2.3 0 0 0-.18-.925 2.048 2.048 0 0 0-.495-.705 2.167 2.167 0 0 0-.75-.445 2.794 2.794 0 0 0-.945-.155 3.828 3.828 0 0 0-.465.03 1.414 1.414 0 0 0-.365.1L7.98 6H11z"
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"M12.5 2.2a10.3 10.3 0 1 0 10.3 10.3A10.299 10.299 0 0 0 12.5 2.2zm0 19.6a9.3 9.3 0 1 1 9.3-9.3 9.31 9.31 0 0 1-9.3 9.3zM16 8h-5v2.898a4.797 4.797 0 0 1 .753-.165 5.27 5.27 0 0 1 .742-.055 4.16 4.16 0 0 1 1.38.22 3.314 3.314 0 0 1 1.096.627 2.813 2.813 0 0 1 .72.971 2.978 2.978 0 0 1 .254 1.24 3.29 3.29 0 0 1-.255 1.301 3.008 3.008 0 0 1-.72 1.033 3.38 3.38 0 0 1-1.117.682A3.996 3.996 0 0 1 12.42 17a3.733 3.733 0 0 1-1.95-.475 3.274 3.274 0 0 1-1.23-1.288l.976-.4a2.228 2.228 0 0 0 .865.965 2.393 2.393 0 0 0 1.286.358 2.82 2.82 0 0 0 1.001-.173 2.352 2.352 0 0 0 .79-.483 2.226 2.226 0 0 0 .519-.74 2.402 2.402 0 0 0-.015-1.899 2.177 2.177 0 0 0-.557-.74 2.532 2.532 0 0 0-.835-.469 3.212 3.212 0 0 0-1.053-.166 4.537 4.537 0 0 0-1.136.145 5.692 5.692 0 0 0-1.075.393L10 7h6z"
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"M16.5 3.2a13.3 13.3 0 1 0 13.3 13.3A13.3 13.3 0 0 0 16.5 3.2zm0 25.6a12.3 12.3 0 1 1 12.3-12.3 12.314 12.314 0 0 1-12.3 12.3zm.026-5.8a4.694 4.694 0 0 1-4.466-2.3l.9-.4a3.775 3.775 0 0 0 3.566 1.774c.74 0 3.501-.548 3.501-3.23a3.222 3.222 0 0 0-3.378-3.288 7.301 7.301 0 0 0-2.897.592l-.732.355L13.019 10h6.975v.926H14v4.119a8.807 8.807 0 0 1 2.65-.415 4.187 4.187 0 0 1 4.377 4.214c0 3.14-3.032 4.156-4.5 4.156z"
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"M8.5 1.2a7.3 7.3 0 1 0 7.3 7.3 7.3 7.3 0 0 0-7.3-7.3zm0 13.6a6.3 6.3 0 1 1 6.3-6.3 6.307 6.307 0 0 1-6.3 6.3zm-.655-7.052l.01.02a1.303 1.303 0 0 1 .4-.136 2.553 2.553 0 0 1 .48-.048 2.341 2.341 0 0 1 .866.16 2.15 2.15 0 0 1 .704.443 2.028 2.028 0 0 1 .47.68 2.149 2.149 0 0 1 .17.857 2.27 2.27 0 0 1-.185.931 2.096 2.096 0 0 1-.515.718 2.341 2.341 0 0 1-.775.463 2.919 2.919 0 0 1-1.945-.005 2.348 2.348 0 0 1-.775-.467 2.134 2.134 0 0 1-.51-.714 2.176 2.176 0 0 1-.185-.897 2.59 2.59 0 0 1 .19-1.012 5.751 5.751 0 0 1 .5-.926L8.595 5h1.15zm-.8 2.02a1.542 1.542 0 0 0 .104.566 1.327 1.327 0 0 0 .298.46 1.473 1.473 0 0 0 1.058.425 1.557 1.557 0 0 0 .59-.106 1.323 1.323 0 0 0 .458-.306 1.37 1.37 0 0 0 .298-.464 1.593 1.593 0 0 0 .104-.585 1.528 1.528 0 0 0-.104-.57 1.401 1.401 0 0 0-.289-.455 1.244 1.244 0 0 0-.45-.3 1.603 1.603 0 0 0-.597-.107 1.642 1.642 0 0 0-.601.107 1.318 1.318 0 0 0-.765.755 1.555 1.555 0 0 0-.104.58z"
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"M12.5 2.2a10.3 10.3 0 1 0 10.3 10.3A10.299 10.299 0 0 0 12.5 2.2zm0 19.6a9.3 9.3 0 1 1 9.3-9.3 9.31 9.31 0 0 1-9.3 9.3zm-1.22-10.544l.028.028a1.748 1.748 0 0 1 .63-.262 3.41 3.41 0 0 1 .784-.096 3.214 3.214 0 0 1 1.198.22 2.927 2.927 0 0 1 .959.613 2.795 2.795 0 0 1 .636.95 3.15 3.15 0 0 1 .232 1.22 3.203 3.203 0 0 1-.239 1.253 2.744 2.744 0 0 1-.671.964 3.174 3.174 0 0 1-1.023.627 3.762 3.762 0 0 1-2.575 0 3.174 3.174 0 0 1-1.023-.627 2.731 2.731 0 0 1-.671-.964 3.186 3.186 0 0 1-.239-1.254 3.652 3.652 0 0 1 .267-1.404 8.502 8.502 0 0 1 .63-1.24L12.905 7h1.161zm-.966 2.672a2.39 2.39 0 0 0 .161.89 2.06 2.06 0 0 0 .455.701 2.172 2.172 0 0 0 .7.469 2.42 2.42 0 0 0 1.792 0 2.172 2.172 0 0 0 .7-.469 2.074 2.074 0 0 0 .456-.702 2.409 2.409 0 0 0 .16-.889 2.45 2.45 0 0 0-.153-.874 2.033 2.033 0 0 0-.442-.703 1.987 1.987 0 0 0-.7-.461 2.627 2.627 0 0 0-1.834 0 1.974 1.974 0 0 0-.7.461 2.033 2.033 0 0 0-.44.703 2.45 2.45 0 0 0-.155.874z"
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"M16.5 3.2a13.3 13.3 0 1 0 13.3 13.3A13.3 13.3 0 0 0 16.5 3.2zm0 25.6a12.3 12.3 0 1 1 12.3-12.3 12.314 12.314 0 0 1-12.3 12.3zm-2.08-12.982l.038.036a2.566 2.566 0 0 1 .978-.512 4.227 4.227 0 0 1 1.244-.189 4.38 4.38 0 0 1 1.597.288 3.82 3.82 0 0 1 1.282.808 3.723 3.723 0 0 1 .846 1.23 3.958 3.958 0 0 1 .304 1.57 4.02 4.02 0 0 1-.314 1.608 3.6 3.6 0 0 1-.883 1.248 4.045 4.045 0 0 1-1.35.808 5.23 5.23 0 0 1-3.419 0 3.947 3.947 0 0 1-1.34-.808 3.653 3.653 0 0 1-.874-1.248 4.02 4.02 0 0 1-.313-1.607 4.796 4.796 0 0 1 .313-1.733 9.372 9.372 0 0 1 .864-1.679L17.023 10h1.254zm-1.14 3.232a3.145 3.145 0 0 0 .237 1.23 2.935 2.935 0 0 0 1.654 1.625 3.637 3.637 0 0 0 2.564 0 2.935 2.935 0 0 0 1.653-1.626 3.145 3.145 0 0 0 .238-1.23 3.225 3.225 0 0 0-.228-1.212 2.939 2.939 0 0 0-.636-.978 2.882 2.882 0 0 0-.989-.646 3.409 3.409 0 0 0-1.282-.234 3.534 3.534 0 0 0-1.312.234 2.917 2.917 0 0 0-1.662 1.624 3.103 3.103 0 0 0-.237 1.213z"
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"M8.5 1.2a7.3 7.3 0 1 0 7.3 7.3 7.3 7.3 0 0 0-7.3-7.3zm0 13.6a6.3 6.3 0 1 1 6.3-6.3 6.307 6.307 0 0 1-6.3 6.3zM11 5.88L8.176 12h-1.21l2.85-6H6V5h5z"
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"M12.5 2.2a10.3 10.3 0 1 0 10.3 10.3A10.299 10.299 0 0 0 12.5 2.2zm0 19.6a9.3 9.3 0 1 1 9.3-9.3 9.31 9.31 0 0 1-9.3 9.3zM16 8.012L11.416 17h-1.235l4.698-9H9V7h7z"
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"M16.5 3.2a13.3 13.3 0 1 0 13.3 13.3A13.3 13.3 0 0 0 16.5 3.2zm0 25.6a12.3 12.3 0 1 1 12.3-12.3 12.314 12.314 0 0 1-12.3 12.3zM21 11l-5.238 12h-1.316L19.9 11H13v-1h8z"
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"M8.5 1.2a7.3 7.3 0 1 0 7.3 7.3 7.3 7.3 0 0 0-7.3-7.3zm0 13.6a6.3 6.3 0 1 1 6.3-6.3 6.307 6.307 0 0 1-6.3 6.3zm1.035-6.53a1.668 1.668 0 0 1 .526.235 1.808 1.808 0 0 1 .71.925 1.913 1.913 0 0 1 .104.64 2.016 2.016 0 0 1-.19.89 1.97 1.97 0 0 1-.515.66 2.33 2.33 0 0 1-.755.415 2.837 2.837 0 0 1-.91.145 2.887 2.887 0 0 1-.914-.145 2.338 2.338 0 0 1-.76-.415 1.967 1.967 0 0 1-.516-.66 2.002 2.002 0 0 1-.19-.89 1.949 1.949 0 0 1 .105-.65 1.75 1.75 0 0 1 .72-.915 2.044 2.044 0 0 1 .516-.235v-.02a1.612 1.612 0 0 1-1.091-1.58 1.82 1.82 0 0 1 .17-.795 1.88 1.88 0 0 1 .46-.61 2.012 2.012 0 0 1 .676-.39 2.576 2.576 0 0 1 1.644 0 2.05 2.05 0 0 1 .675.38 1.801 1.801 0 0 1 .625 1.395 1.702 1.702 0 0 1-.305 1.01 1.54 1.54 0 0 1-.785.59zm-2.42 1.75a1.452 1.452 0 0 0 .1.55 1.176 1.176 0 0 0 .285.425 1.354 1.354 0 0 0 .44.275 1.531 1.531 0 0 0 .566.1 1.504 1.504 0 0 0 .555-.1 1.287 1.287 0 0 0 .434-.275 1.272 1.272 0 0 0 .285-.425 1.399 1.399 0 0 0 .106-.55 1.342 1.342 0 0 0-.39-.96 1.256 1.256 0 0 0-.435-.28 1.597 1.597 0 0 0-1.11 0 1.305 1.305 0 0 0-.44.28 1.284 1.284 0 0 0-.29.425 1.34 1.34 0 0 0-.106.535zm.23-3.315a1.181 1.181 0 0 0 .086.448 1.094 1.094 0 0 0 .239.364 1.14 1.14 0 0 0 .37.243 1.195 1.195 0 0 0 .466.09 1.127 1.127 0 0 0 .449-.09 1.207 1.207 0 0 0 .37-.243 1.117 1.117 0 0 0 .34-.812 1.125 1.125 0 0 0-.095-.463 1.205 1.205 0 0 0-.25-.368 1.084 1.084 0 0 0-.365-.24 1.186 1.186 0 0 0-.45-.084 1.258 1.258 0 0 0-.465.085 1.05 1.05 0 0 0-.61.607 1.242 1.242 0 0 0-.084.463z"
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"M12.5 2.2a10.3 10.3 0 1 0 10.3 10.3A10.299 10.299 0 0 0 12.5 2.2zm0 19.6a9.3 9.3 0 1 1 9.3-9.3 9.31 9.31 0 0 1-9.3 9.3zm1.302-10.05a2.558 2.558 0 0 1 1.344.938 2.742 2.742 0 0 1 .532 1.708 2.636 2.636 0 0 1-.26 1.183 2.774 2.774 0 0 1-.692.896 3.141 3.141 0 0 1-1.015.574 3.714 3.714 0 0 1-2.422 0 3.141 3.141 0 0 1-1.015-.574 2.79 2.79 0 0 1-.693-.896 2.635 2.635 0 0 1-.26-1.183 2.964 2.964 0 0 1 .141-.931 2.714 2.714 0 0 1 .392-.77 2.525 2.525 0 0 1 .595-.581 2.732 2.732 0 0 1 .749-.364v-.028a1.975 1.975 0 0 1-.609-.329 2.157 2.157 0 0 1-.47-.518 2.63 2.63 0 0 1-.307-.658 2.423 2.423 0 0 1-.112-.735 2.596 2.596 0 0 1 .224-1.092 2.466 2.466 0 0 1 .609-.833 2.81 2.81 0 0 1 .89-.532 3.148 3.148 0 0 1 2.148 0 2.789 2.789 0 0 1 .896.532 2.492 2.492 0 0 1 .609.833 2.596 2.596 0 0 1 .224 1.092 2.454 2.454 0 0 1-.112.735 2.7 2.7 0 0 1-.308.658 2.157 2.157 0 0 1-.47.518 1.975 1.975 0 0 1-.608.33zm-3.472 2.534a2.277 2.277 0 0 0 .154.84 1.89 1.89 0 0 0 .441.672 2.07 2.07 0 0 0 .686.44 2.534 2.534 0 0 0 1.778 0 2.08 2.08 0 0 0 .686-.44 1.89 1.89 0 0 0 .441-.672 2.277 2.277 0 0 0 .154-.84 2.171 2.171 0 0 0-.154-.826 1.924 1.924 0 0 0-.441-.658 2.002 2.002 0 0 0-.686-.434 2.64 2.64 0 0 0-1.778 0 1.993 1.993 0 0 0-.686.434 1.924 1.924 0 0 0-.441.658 2.171 2.171 0 0 0-.154.826zm.35-4.746a1.764 1.764 0 0 0 .14.714 1.68 1.68 0 0 0 .392.56 1.884 1.884 0 0 0 2.576 0 1.694 1.694 0 0 0 .392-.56 1.78 1.78 0 0 0 .14-.714 1.936 1.936 0 0 0-.14-.735 1.773 1.773 0 0 0-.385-.588 1.882 1.882 0 0 0-2.016-.385 1.795 1.795 0 0 0-.574.385 1.773 1.773 0 0 0-.385.588 1.917 1.917 0 0 0-.14.735z"
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"M16.5 3.2a13.3 13.3 0 1 0 13.3 13.3A13.3 13.3 0 0 0 16.5 3.2zm0 25.6a12.3 12.3 0 1 1 12.3-12.3 12.314 12.314 0 0 1-12.3 12.3zm1.494-12.568a3.333 3.333 0 0 1 1.845 1.25 3.839 3.839 0 0 1 .342 3.673 3.335 3.335 0 0 1-.864 1.143 4.044 4.044 0 0 1-1.278.729 4.664 4.664 0 0 1-3.078 0 4.044 4.044 0 0 1-1.278-.73 3.31 3.31 0 0 1-.864-1.142 3.806 3.806 0 0 1 .36-3.68 3.31 3.31 0 0 1 1.827-1.243v-.036a2.753 2.753 0 0 1-.837-.46 3.087 3.087 0 0 1-.63-.683 3.272 3.272 0 0 1-.405-.837 3.06 3.06 0 0 1-.144-.936 3.267 3.267 0 0 1 .279-1.368 3.16 3.16 0 0 1 .756-1.044 3.355 3.355 0 0 1 1.116-.666 4.06 4.06 0 0 1 2.718 0 3.355 3.355 0 0 1 1.116.666 3.16 3.16 0 0 1 .756 1.044 3.267 3.267 0 0 1 .279 1.368 3.06 3.06 0 0 1-.144.936 3.305 3.305 0 0 1-.405.837 2.993 2.993 0 0 1-.639.684 2.943 2.943 0 0 1-.828.459zm-4.464 3.312a2.972 2.972 0 0 0 .216 1.152 2.76 2.76 0 0 0 .603.909 2.7 2.7 0 0 0 .936.603 3.527 3.527 0 0 0 2.43 0 2.71 2.71 0 0 0 .936-.603 2.76 2.76 0 0 0 .603-.91 2.972 2.972 0 0 0 .216-1.151 2.91 2.91 0 0 0-.225-1.143 2.694 2.694 0 0 0-1.548-1.503 3.429 3.429 0 0 0-2.394 0 2.694 2.694 0 0 0-1.548 1.503 2.893 2.893 0 0 0-.225 1.143zm.468-6.21a2.484 2.484 0 0 0 .189.972 2.267 2.267 0 0 0 .53.774 2.608 2.608 0 0 0 .793.513 2.682 2.682 0 0 0 1.98 0 2.62 2.62 0 0 0 .792-.513 2.264 2.264 0 0 0 .53-.774 2.467 2.467 0 0 0 .19-.972 2.582 2.582 0 0 0-.19-.999 2.334 2.334 0 0 0-.53-.792 2.563 2.563 0 0 0-3.564 0 2.336 2.336 0 0 0-.531.792 2.6 2.6 0 0 0-.189.999z"
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"M8.5 1.2a7.3 7.3 0 1 0 7.3 7.3 7.3 7.3 0 0 0-7.3-7.3zm0 13.6a6.3 6.3 0 1 1 6.3-6.3 6.307 6.307 0 0 1-6.3 6.3zm.67-5.66l-.01-.01a1.394 1.394 0 0 1-.41.14 2.465 2.465 0 0 1-.48.05 2.253 2.253 0 0 1-.87-.165 2.165 2.165 0 0 1-.7-.46 2.112 2.112 0 0 1-.47-.705 2.303 2.303 0 0 1-.17-.89 2.448 2.448 0 0 1 .185-.965 2.18 2.18 0 0 1 .516-.745 2.322 2.322 0 0 1 .779-.48 2.73 2.73 0 0 1 .97-.17 2.65 2.65 0 0 1 .97.175 2.341 2.341 0 0 1 .776.485 2.252 2.252 0 0 1 .51.74 2.332 2.332 0 0 1 .184.93 2.794 2.794 0 0 1-.19 1.05 6.544 6.544 0 0 1-.49.96L8.42 12H7.27zm.825-2.08a1.605 1.605 0 0 0-.107-.585 1.44 1.44 0 0 0-.306-.48 1.476 1.476 0 0 0-.475-.325 1.514 1.514 0 0 0-.612-.12 1.57 1.57 0 0 0-.612.115 1.45 1.45 0 0 0-.475.315 1.35 1.35 0 0 0-.306.48 1.68 1.68 0 0 0-.107.61 1.576 1.576 0 0 0 .107.59 1.418 1.418 0 0 0 .301.47 1.327 1.327 0 0 0 .47.31 1.633 1.633 0 0 0 .612.11 1.67 1.67 0 0 0 .617-.11 1.373 1.373 0 0 0 .48-.31 1.4 1.4 0 0 0 .306-.47 1.625 1.625 0 0 0 .107-.6z"
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"M12.5 2.2a10.3 10.3 0 1 0 10.3 10.3A10.299 10.299 0 0 0 12.5 2.2zm0 19.6a9.3 9.3 0 1 1 9.3-9.3 9.31 9.31 0 0 1-9.3 9.3zm1.434-9.126l-.028-.028a1.734 1.734 0 0 1-.63.266 3.333 3.333 0 0 1-.784.098 3.153 3.153 0 0 1-1.197-.224 2.904 2.904 0 0 1-.959-.623 2.827 2.827 0 0 1-.637-.966 3.266 3.266 0 0 1-.23-1.239 3.304 3.304 0 0 1 .238-1.267 2.752 2.752 0 0 1 .671-.987 3.188 3.188 0 0 1 1.022-.637 3.708 3.708 0 0 1 2.576 0A3.204 3.204 0 0 1 15 7.704a2.777 2.777 0 0 1 .671.987 3.322 3.322 0 0 1 .238 1.267 3.788 3.788 0 0 1-.266 1.428 8.92 8.92 0 0 1-.63 1.26L12.31 17h-1.162zm.966-2.716a2.479 2.479 0 0 0-.161-.896 2.091 2.091 0 0 0-.455-.721 2.161 2.161 0 0 0-.7-.476 2.378 2.378 0 0 0-1.792 0 2.166 2.166 0 0 0-.7.476 2.091 2.091 0 0 0-.455.721 2.479 2.479 0 0 0-.16.896 2.506 2.506 0 0 0 .153.89 2.063 2.063 0 0 0 .44.713 1.985 1.985 0 0 0 .701.469 2.58 2.58 0 0 0 1.834 0 1.985 1.985 0 0 0 .7-.469 2.08 2.08 0 0 0 .442-.714 2.528 2.528 0 0 0 .153-.889z"
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"M16.5 3.2a13.3 13.3 0 1 0 13.3 13.3A13.3 13.3 0 0 0 16.5 3.2zm0 25.6a12.3 12.3 0 1 1 12.3-12.3 12.314 12.314 0 0 1-12.3 12.3zm2.344-11.654l-.036-.036a2.398 2.398 0 0 1-.934.512 3.894 3.894 0 0 1-1.185.188 4.033 4.033 0 0 1-1.508-.278 3.55 3.55 0 0 1-1.212-.79 3.626 3.626 0 0 1-.8-1.23 4.228 4.228 0 0 1-.287-1.58 4.054 4.054 0 0 1 .306-1.589 3.707 3.707 0 0 1 .843-1.248 3.806 3.806 0 0 1 1.276-.808A4.414 4.414 0 0 1 16.923 10a4.347 4.347 0 0 1 1.607.287 3.65 3.65 0 0 1 2.083 2.047 4.156 4.156 0 0 1 .296 1.598 5.12 5.12 0 0 1-.287 1.724 9.273 9.273 0 0 1-.809 1.67L16.366 23h-1.185zm1.059-3.214a3.24 3.24 0 0 0-.224-1.221 3.031 3.031 0 0 0-.62-.97 2.826 2.826 0 0 0-.942-.646 3.264 3.264 0 0 0-2.425 0 2.817 2.817 0 0 0-.942.646 3.018 3.018 0 0 0-.62.97 3.24 3.24 0 0 0-.224 1.221 3.37 3.37 0 0 0 .216 1.212 2.84 2.84 0 0 0 .6.97 2.779 2.779 0 0 0 .935.637 3.34 3.34 0 0 0 2.45 0 2.854 2.854 0 0 0 .952-.637 2.896 2.896 0 0 0 .62-.97 3.259 3.259 0 0 0 .224-1.212z"
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"M16 7.523l-2.6 1.463a7.257 7.257 0 0 0-1.192-.477l2.772-1.56zM7.772 8.895L0 4.523l8-4.5 8 4.5-6.95 3.91a6.958 6.958 0 0 0-1.278.462zM2.04 4.523L8 7.876l5.96-3.353L8 1.171zm2.086 7.397l.121-.155L1.02 9.95 0 10.523l3.952 2.223a.991.991 0 0 1 .174-.826zm2.066-2.06L1.02 6.949 0 7.524l5.373 3.022c.237-.22.511-.453.819-.686zm5.716 2.641a1.409 1.409 0 1 1-1.408-1.409 1.41 1.41 0 0 1 1.409 1.409zm4.092 0s-2.462 3.254-5.5 3.254S5 12.5 5 12.5s2.462-3.254 5.5-3.254S16 12.5 16 12.5zm-1.054-.002c-.77-.834-2.51-2.452-4.446-2.452-1.938 0-3.679 1.62-4.447 2.454.768.834 2.51 2.454 4.447 2.454 1.922 0 3.672-1.621 4.446-2.456z"
|