@arcgis/core 5.0.0-next.36 → 5.0.0-next.38
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/WebLinkChart.js +1 -1
- package/analysis/ShadowCast/types.d.ts +2 -0
- package/applications/Components/analysisUtils.d.ts +1 -0
- package/applications/Components/analysisUtils.js +1 -1
- package/applications/Components/testUtils.d.ts +4 -0
- package/applications/Components/testUtils.js +5 -0
- package/arcade/arcadeAsyncRuntime.js +1 -1
- package/arcade/arcadeCompiler.js +1 -1
- package/arcade/featureSetUtils.js +1 -1
- package/arcade/featureset/actions/Adapted.js +1 -1
- package/arcade/featureset/actions/AttributeFilter.js +1 -1
- package/arcade/featureset/actions/GroupBy.js +1 -1
- package/arcade/featureset/actions/SpatialFilter.js +1 -1
- package/arcade/featureset/sources/FeatureLayerDynamic.js +1 -1
- package/arcade/featureset/sources/FeatureLayerMemory.js +1 -1
- package/arcade/featureset/sources/FeatureLayerOGC.js +1 -1
- package/arcade/featureset/sources/FeatureLayerRelated.js +1 -1
- package/arcade/featureset/support/FeatureSet.js +1 -1
- package/arcade/featureset/support/FeatureSetIterator.js +1 -1
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/014dbe6fa93a277b08f7.js +1 -0
- package/assets/esri/core/workers/chunks/{51355866a0dcf41cfded.js → 0a5427127634738aa239.js} +1 -1
- package/assets/esri/core/workers/chunks/{c7c721de93bc8688e13c.js → 1d4ea8db272655c0608c.js} +1 -1
- package/assets/esri/core/workers/chunks/1d566539ff6fb6ac798c.js +1 -0
- package/assets/esri/core/workers/chunks/1de216d9850c39c1735d.js +1 -0
- package/assets/esri/core/workers/chunks/262232437d37a7460b11.js +1 -0
- package/assets/esri/core/workers/chunks/2795e491f803654413d2.js +1 -0
- package/assets/esri/core/workers/chunks/2f9129003f77bfeab2f9.js +1 -0
- package/assets/esri/core/workers/chunks/{1817cf11e85afca947d3.js → 328106e181e5957ceaa5.js} +1 -1
- package/assets/esri/core/workers/chunks/{d3db7244fac7398cc700.js → 4b6a44c6265c8959abd8.js} +1 -1
- package/assets/esri/core/workers/chunks/50ffb22c48fadd36c748.js +1 -0
- package/assets/esri/core/workers/chunks/{f1ac1c8b1331ec79e898.js → 59ce992d3a5e7c32b9fb.js} +1 -1
- package/assets/esri/core/workers/chunks/{8a946cbc816f373c136b.js → 5e30acfda04f7fc2b676.js} +1 -1
- package/assets/esri/core/workers/chunks/6330d8767ba1d5329daa.js +1 -0
- package/assets/esri/core/workers/chunks/{3f03165487c1c2340fff.js → 690a40d2eef52bfc149f.js} +1 -1
- package/assets/esri/core/workers/chunks/{dd34d56caafa38d4b8e4.js → 7aa730e5ac7b268e3c98.js} +1 -1
- package/assets/esri/core/workers/chunks/{b451dc416eebd0931ef8.js → 7ab237d19b84d89ff483.js} +7 -7
- package/assets/esri/core/workers/chunks/{1fa55d4c4b092a98bdd7.js → b56c07c0b43cb1999070.js} +1 -1
- package/assets/esri/core/workers/chunks/{bfb9cbe59d36d18f9157.js → cda5c95fd49b8901f7d4.js} +1 -1
- package/assets/esri/core/workers/chunks/{c9e7cc5d853908ab5b2f.js → ce99abfdcd71ff9e4e36.js} +1 -1
- package/assets/esri/core/workers/chunks/{726a797f5df7eeee0b3d.js → d786b17cc9062b1450ac.js} +1 -1
- package/assets/esri/core/workers/chunks/{52c8687b473c9953c2f2.js → d9958654c6438f28237b.js} +1 -1
- package/assets/esri/core/workers/chunks/{2e76fbd3c874300fc4a7.js → de3da4d31a7529761565.js} +1 -1
- package/assets/esri/core/workers/chunks/{eb6218634a492667506a.js → e501d68a1464805c4b4e.js} +1 -1
- package/assets/esri/core/workers/chunks/{33431e8131f6017de2f9.js → e7f4d135ef9665de1468.js} +1 -1
- package/assets/esri/core/workers/chunks/{d8623f5f13a084e439c2.js → e9bc3c6482ba778c9349.js} +37 -37
- package/assets/esri/core/workers/chunks/{7420fa18ba12014b22ea.js → ee67c8a7c1f8b482cd99.js} +1 -1
- package/assets/esri/core/workers/chunks/{abb05a903440d97a6a74.js → f441fc74451330384fb0.js} +1 -1
- package/assets/esri/core/workers/chunks/f609b256df9eb3803464.js +1 -0
- package/assets/esri/core/workers/chunks/f97a7cb367634353177d.js +1 -0
- package/chunks/CloudsComposition.glsl.js +1 -1
- package/chunks/ComponentShader.glsl.js +2 -2
- package/chunks/DefaultMaterial.glsl.js +1 -1
- package/chunks/GaussianSplat.glsl.js +2 -2
- package/chunks/Laserlines.glsl.js +1 -1
- package/chunks/Path.glsl.js +1 -1
- package/chunks/RealisticTree.glsl.js +1 -1
- package/chunks/Terrain.glsl.js +34 -36
- package/chunks/WaterSurface.glsl.js +1 -1
- package/chunks/boundedPlane.js +1 -1
- package/chunks/cameraUtilsSpherical.js +1 -1
- package/chunks/vec32.js +1 -1
- package/config.js +1 -1
- package/core/has.js +1 -1
- package/core/iteratorUtils.js +1 -1
- package/core/libs/gl-matrix-2/math/quat.js +1 -1
- package/core/libs/gl-matrix-2/math/vec3.js +1 -1
- package/geometry/support/buffer/BufferView.js +1 -1
- package/geometry/support/curves/densifyCurvedGeometry.js +1 -1
- package/geometry/support/lineSegment.js +1 -1
- package/geometry/support/meshUtils/merge.js +1 -1
- package/geometry/support/sphere.js +1 -1
- package/interfaces.d.ts +59 -5
- package/kernel.js +1 -1
- package/layers/Lyr3DWasmPerSceneView.js +1 -1
- package/layers/VoxelWasmPerSceneView.js +1 -1
- package/layers/knowledgeGraph/layerUtils.js +1 -1
- package/layers/orientedImagery/transformations/worldToImage.js +1 -1
- package/layers/support/csvUtils.js +1 -1
- package/layers/video/VideoController.js +1 -1
- package/layers/voxel/VoxelVolume.js +1 -1
- package/package.json +5 -5
- package/support/revision.js +1 -1
- package/support/tests/meshUtils.js +5 -0
- package/support/tests/serviceMockDependencies.js +5 -0
- package/support/tests/setupServiceMocksMesh.js +5 -0
- package/views/2d/analysis/ElevationProfile/ElevationProfileLineVisualization2D.js +1 -1
- package/views/2d/interactive/SegmentLabels2D.js +1 -1
- package/views/2d/layers/features/FeaturePipelineWorker.js +1 -1
- package/views/3d/FocusAreasView.js +1 -1
- package/views/3d/analysis/AreaMeasurement/support/MeasurementData.js +1 -1
- package/views/3d/analysis/Dimension/DimensionTool.js +1 -1
- package/views/3d/analysis/Dimension/lengthDimensionConstraintUtils.js +1 -1
- package/views/3d/analysis/Dimension/lengthDimensionUtils.js +1 -1
- package/views/3d/analysis/ElevationProfile/ElevationProfileLineVisualization3D.js +1 -1
- package/views/3d/analysis/ElevationProfile/ElevationProfileVisualization3D.js +1 -1
- package/views/3d/analysis/ElevationProfileAnalysisView3D.js +1 -1
- package/views/3d/analysis/LineOfSight/LineOfSightController.js +1 -1
- package/views/3d/analysis/LineOfSight/LineOfSightIntersectionResult.js +1 -1
- package/views/3d/analysis/Slice/SliceTool.js +1 -1
- package/views/3d/analysis/Slice/sliceToolUtils.js +1 -1
- package/views/3d/analysis/Viewshed/ViewshedScaleOrientManipulation.js +1 -1
- package/views/3d/analysis/Viewshed/ViewshedSubTool.js +1 -1
- package/views/3d/analysis/Viewshed/ViewshedSubVisualization.js +1 -1
- package/views/3d/analysis/Viewshed/ViewshedTool.js +1 -1
- package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementCutFillVisualization.js +1 -1
- package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementShiftTool.js +1 -1
- package/views/3d/animation/pointToPoint/Camera.js +1 -1
- package/views/3d/camera/constraintUtils/distance.js +1 -1
- package/views/3d/camera/constraintUtils/tilt.js +1 -1
- package/views/3d/environment/ChapmanAtmosphere.js +1 -1
- package/views/3d/environment/CloudsParameters.js +1 -1
- package/views/3d/environment/EnvironmentManager.js +1 -1
- package/views/3d/environment/MarsAtmosphere.js +1 -1
- package/views/3d/interactive/SegmentLabels3D.js +1 -1
- package/views/3d/interactive/editingTools/manipulations/MoveZManipulation.js +1 -1
- package/views/3d/interactive/editingTools/media/MediaElementManipulator3D.js +1 -1
- package/views/3d/interactive/editingTools/reshape/edgeOffsetUtils.js +1 -1
- package/views/3d/interactive/measurementTools/directLineMeasurement3D/DirectLineMeasurement3DTool.js +1 -1
- package/views/3d/interactive/visualElements/MeasurementArrowVisualElement.js +1 -1
- package/views/3d/interactive/visualElements/RightAngleQuadVisualElement.js +1 -1
- package/views/3d/layers/FeatureLikeLayerView3D.js +1 -1
- package/views/3d/layers/FlowSubView3D.js +1 -1
- package/views/3d/layers/GraphicsLayerView3D.js +1 -1
- package/views/3d/layers/I3SMeshView3D.js +1 -1
- package/views/3d/layers/ImagerySubView3D.js +1 -1
- package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
- package/views/3d/layers/PointCloudWorker.js +1 -1
- package/views/3d/layers/RouteLayerView3D.js +1 -1
- package/views/3d/layers/graphics/Graphics3DGraphicsPipeline.js +1 -1
- package/views/3d/layers/graphics/Graphics3DObject3DGraphicLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DScaleVisibility.js +1 -1
- package/views/3d/layers/graphics/objectResourceUtils.js +1 -1
- package/views/3d/layers/graphics/pipeline/rendering/DirectRenderer.js +1 -1
- package/views/3d/layers/i3s/I3SViewportQueries.js +1 -1
- package/views/3d/layers/i3s/PointCloudRenderer.js +1 -1
- package/views/3d/layers/support/FeatureTileMeasurements3D.js +1 -1
- package/views/3d/layers/support/FeatureTileVisibility3D.js +1 -1
- package/views/3d/state/Frustum.js +1 -1
- package/views/3d/state/ViewStateManager.js +1 -1
- package/views/3d/state/controllers/FovController.js +1 -1
- package/views/3d/state/controllers/GamepadKeyboardController.js +1 -1
- package/views/3d/state/controllers/momentum/ZoomPlanarMomentumController.js +1 -1
- package/views/3d/support/FrustumExtentIntersection.js +1 -1
- package/views/3d/support/cameraUtils.js +1 -1
- package/views/3d/support/flow/FlowSubViewTiles3D.js +1 -1
- package/views/3d/support/gaussianSplatting/GaussianSplatDataStore.js +1 -1
- package/views/3d/support/gaussianSplatting/GaussianSplatFadeHelper.js +1 -1
- package/views/3d/support/intersectionUtils.js +1 -1
- package/views/3d/support/pointsOfInterest/CameraOnSurface.js +1 -1
- package/views/3d/support/pointsOfInterest/CenterOnSurface.js +1 -1
- package/views/3d/support/pointsOfInterest/Focus.js +1 -1
- package/views/3d/support/viewpointUtils.js +1 -1
- package/views/3d/terrain/OverlayManager.js +1 -1
- package/views/3d/terrain/OverlayRenderer.js +1 -1
- package/views/3d/terrain/PatchRenderData.js +1 -1
- package/views/3d/terrain/SphericalPatch.js +1 -1
- package/views/3d/terrain/TerrainRenderer.js +1 -1
- package/views/3d/terrain/TerrainSurface.js +1 -1
- package/views/3d/terrain/Tile.js +1 -1
- package/views/3d/terrain/TileCompositor.js +1 -1
- package/views/3d/webgl/RenderCamera.js +1 -1
- package/views/3d/webgl-engine/collections/Component/Material/ComponentMaterial.js +1 -1
- package/views/3d/webgl-engine/collections/Component/Material/ComponentTechnique.js +1 -1
- package/views/3d/webgl-engine/collections/Component/Material/ComponentTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/core/renderPasses/RenderPassManager.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/Slice.glsl.js +4 -7
- package/views/3d/webgl-engine/core/shaderLibrary/TextureBackedBuffer.glsl.js +4 -4
- package/views/3d/webgl-engine/core/shaderLibrary/TextureBackedBufferFields.glsl.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/hud/HUD.glsl.js +6 -6
- package/views/3d/webgl-engine/core/shaderLibrary/shading/EvaluateAmbientLighting.glsl.js +4 -4
- package/views/3d/webgl-engine/core/shaderLibrary/shading/EvaluateSceneLighting.glsl.js +19 -15
- package/views/3d/webgl-engine/core/shaderLibrary/shading/MainLighting.glsl.js +2 -2
- package/views/3d/webgl-engine/core/shaderLibrary/terrain/Overlay.glsl.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/terrain/TerrainTexture.glsl.js +5 -5
- package/views/3d/webgl-engine/core/shaderLibrary/terrain/TileBackground.glsl.js +14 -14
- package/views/3d/webgl-engine/core/shaderLibrary/util/BlendModes.glsl.js +16 -37
- package/views/3d/webgl-engine/core/shaderLibrary/util/GaussianSplatUnpacking.glsl.js +8 -8
- package/views/3d/webgl-engine/effects/RenderPluginManager.js +1 -1
- package/views/3d/webgl-engine/effects/debug/RenderNodeVisualizerNode.js +1 -1
- package/views/3d/webgl-engine/effects/geometry/RenderOccludedRenderNode.js +1 -1
- package/views/3d/webgl-engine/effects/haze/Haze.js +1 -1
- package/views/3d/webgl-engine/effects/transparency/OITBlend.js +1 -1
- package/views/3d/webgl-engine/lib/BindParameters.js +1 -1
- package/views/3d/webgl-engine/lib/CutFillColor.js +1 -1
- package/views/3d/webgl-engine/lib/GaussianSplatRenderNode.js +1 -1
- package/views/3d/webgl-engine/lib/Normals.js +1 -1
- package/views/3d/webgl-engine/lib/Object3D.js +1 -1
- package/views/3d/webgl-engine/lib/Renderer.js +1 -1
- package/views/3d/webgl-engine/lib/RenderingContext.js +1 -1
- package/views/3d/webgl-engine/lib/ShadowAccumulator.js +1 -1
- package/views/3d/webgl-engine/lib/SortedRenderGeometryRenderer.js +1 -1
- package/views/3d/webgl-engine/lib/TextureBackedBuffer/TextureBackedBuffer.js +1 -1
- package/views/3d/webgl-engine/lib/TextureBackedBuffer/TextureBackedBufferFieldCreation.js +5 -0
- package/views/3d/webgl-engine/lib/TextureBackedBuffer/TextureBackedBufferFields.js +1 -1
- package/views/3d/webgl-engine/lib/TextureBackedBuffer/TextureBackedBufferLayout.js +1 -1
- package/views/3d/webgl-engine/lib/TextureBackedBuffer/TextureBackedBufferLayoutField.js +5 -0
- package/views/3d/webgl-engine/lib/TextureBackedBuffer/TextureBufferView.js +5 -0
- package/views/3d/webgl-engine/lib/Viewshed.js +1 -1
- package/views/3d/webgl-engine/lib/edgeRendering/edgePreprocessing.js +1 -1
- package/views/3d/webgl-engine/lib/geometryDataUtils.js +1 -1
- package/views/3d/webgl-engine/lib/triangleIntersectionUtils.js +1 -1
- package/views/3d/webgl-engine/materials/CheckerBoardMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/ColorMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/DefaultMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/DefaultTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/materials/HUDMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/HeatmapDensityMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/ImageMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/LineCalloutMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/LineMarkerMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/MeasurementArrowMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/NativeLineMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/PatternMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/RibbonLineMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/ShadedColorMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/SlicePlaneMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/WaterMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/renderers/VaoRenderer.js +1 -1
- package/views/3d/webgl-engine/materials/renderers/VaoWriter.js +1 -1
- package/views/3d/webgl-engine/shaders/ColorMaterialTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/DefaultMaterialTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/GaussianSplat.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/GaussianSplatTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/shaders/ImageMaterialTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/LineMarkerTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/NativeLineTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/OutputColorHighlightOLID.glsl.js +9 -10
- package/views/3d/webgl-engine/shaders/PatternTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/RibbonLineTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/SphereDepthInterpolate.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/Terrain.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/TerrainTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/TerrainTechniqueConfiguration.js +1 -1
- package/views/BreakpointsOwner.js +1 -1
- package/views/GroundView.js +1 -1
- package/views/SceneView.js +1 -1
- package/views/ToolViewManager.js +1 -1
- package/views/analysis/ElevationProfile/elevationProfileVisualizationUtils.js +1 -1
- package/views/interactive/GraphicManipulator.js +1 -1
- package/views/interactive/InteractiveToolBase.js +1 -1
- package/views/interactive/ToolViewManagerManipulatorState.js +1 -1
- package/views/interactive/coordinateHelper.js +1 -1
- package/views/interactive/editGeometry/operations/OffsetEdgeVertex.js +1 -1
- package/views/interactive/sketch/constraints.js +1 -1
- package/views/interactive/snapping/featureSources/sceneLayerSource/SceneLayerSnappingSourceWorker.js +1 -1
- package/views/interactive/snapping/featureSources/sceneLayerSource/sceneLayerSnappingUtils.js +1 -1
- package/views/interactive/snapping/hints/LineSnappingHint.js +1 -1
- package/views/interactive/tooltip/tooltipCommonUtils.js +1 -1
- package/views/layers/LayerView.js +1 -1
- package/views/navigation/PanSphericalMomentumEstimator.js +1 -1
- package/views/support/LayerViewManager.js +1 -1
- package/views/support/euclideanAreaMeasurementUtils.js +1 -1
- package/views/support/euclideanLengthMeasurementUtils.js +1 -1
- package/views/support/geodesicLengthMeasurementUtils.js +1 -1
- package/views/support/geometry3dUtils.js +1 -1
- package/webmap/utils.js +1 -1
- package/widgets/Sketch/SketchViewModel.js +1 -1
- package/widgets/Slider.js +1 -1
- package/assets/esri/core/workers/chunks/11687718c8635eb7bf37.js +0 -1
- package/assets/esri/core/workers/chunks/15c1a48e8cd2a8882d85.js +0 -1
- package/assets/esri/core/workers/chunks/1b9e7d416c9f00e020bb.js +0 -1
- package/assets/esri/core/workers/chunks/24a3c6f0154787968724.js +0 -1
- package/assets/esri/core/workers/chunks/5000a37fba27464d10ca.js +0 -1
- package/assets/esri/core/workers/chunks/951a3442d4342539f2ea.js +0 -1
- package/assets/esri/core/workers/chunks/b075d3714fab0591d67c.js +0 -1
- package/assets/esri/core/workers/chunks/d8975dd7b85b5d065ee4.js +0 -1
- package/assets/esri/core/workers/chunks/e0a74250d22fa1d7dc18.js +0 -1
- package/assets/esri/core/workers/chunks/f43e1e1a1b2eb737e00c.js +0 -1
- package/views/3d/webgl-engine/core/shaderLibrary/util/FastApproximateTrigonometry.glsl.js +0 -26
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[3345,3548,4342,7548,7694],{159:(e,t,r)=>{r.d(t,{A:()=>o});var i,n=r(31635),a=r(69622),s=r(91429),l=r(99157);let o=i=class extends a.A{constructor(e){super(e),this.steps=[]}getInverse(){const e=new i;for(let t=this.steps.length-1;t>=0;t--){const r=this.steps[t];e.steps.push(r.getInverse())}return e}};(0,n.Cg)([(0,s.MZ)({type:[l.A],nonNullable:!0})],o.prototype,"steps",void 0),o=i=(0,n.Cg)([(0,s.$K)("esri.geometry.operators.support.GeographicTransformation")],o)},4146:(e,t,r)=>{r.d(t,{A:()=>_});var i=r(31635),n=r(11254),a=r(49186),s=r(65529),l=r(4902),o=r(92474),u=r(53966),c=r(74887),d=r(84952),p=r(91429),h=r(5443),y=r(16930),f=r(92602),m=r(79677);let g=0,_=class extends((0,s.Zt)((0,l.s)(o.x_))){constructor(){super(...arguments),this.attributionDataUrl=null,this.fullExtent=new h.A(-180,-90,180,90,y.A.WGS84),this.id=Date.now().toString(16)+"-layer-"+g++,this.legendEnabled=!0,this.listMode="show",this.opacity=1,this.parent=null,this.persistenceEnabled=!1,this.popupEnabled=!0,this.attributionVisible=!0,this.spatialReference=y.A.WGS84,this.title=null,this.type=null,this.url=null,this.visibilityTimeExtent=null,this.visible=!0}static async fromArcGISServerUrl(e){const t="string"==typeof e?{url:e}:e;return(await Promise.all([r.e(812),r.e(7982)]).then(r.bind(r,27982))).fromUrl(t)}static fromPortalItem(e){return async function(e){const t="portalItem"in e?e:{portalItem:e},{fromItem:i}=await Promise.all([r.e(812),r.e(5613),r.e(5710)]).then(r.bind(r,45613));try{return await i(t)}catch(e){const r=t?.portalItem,i=r?.id||"unset",n=r?.portal?.url||f.A.portalUrl;throw u.A.getLogger("esri.layers.support.fromPortalItem").error("#fromPortalItem()","Failed to create layer from portal item (portal: '"+n+"', id: '"+i+"')",e),e}}(e)}initialize(){this.when().catch(e=>{(0,c.zf)(e)||u.A.getLogger(this).error("#load()",`Failed to load layer (title: '${this.title??"no title"}', id: '${this.id??"no id"}')`,{error:e})})}destroy(){const{parent:e}=this;e&&(this.parent=null,e.removeChildLayer?.(this))}get effectiveVisible(){return this.visible&&(this.parent?.effectiveVisible??!0)}get hasAttributionData(){return null!=this.attributionDataUrl}get loaded(){return super.loaded}removeFromParent(){const{parent:e}=this;e&&(e.removeChildLayer?.(this),this.parent=null)}get parsedUrl(){return(0,d.An)(this.url)}createLayerView(e,t){return Promise.reject(new a.A("layer:create-layer-view","Layer does not support creating a layer view"))}async fetchAttributionData(){const e=this.attributionDataUrl;if(this.hasAttributionData&&e)return(await(0,n.A)(e,{query:{f:"json"},responseType:"json"})).data;throw new a.A("layer:no-attribution-data","Layer does not have attribution data")}};(0,i.Cg)([(0,p.MZ)({type:String})],_.prototype,"attributionDataUrl",void 0),(0,i.Cg)([(0,p.MZ)({readOnly:!0})],_.prototype,"effectiveVisible",null),(0,i.Cg)([(0,p.MZ)({type:h.A})],_.prototype,"fullExtent",void 0),(0,i.Cg)([(0,p.MZ)({readOnly:!0})],_.prototype,"hasAttributionData",null),(0,i.Cg)([(0,p.MZ)({type:String,clonable:!1})],_.prototype,"id",void 0),(0,i.Cg)([(0,p.MZ)({type:Boolean,nonNullable:!0})],_.prototype,"legendEnabled",void 0),(0,i.Cg)([(0,p.MZ)({type:["show","hide","hide-children"]})],_.prototype,"listMode",void 0),(0,i.Cg)([(0,p.MZ)({type:Number,range:{min:0,max:1},nonNullable:!0})],_.prototype,"opacity",void 0),(0,i.Cg)([(0,p.MZ)({clonable:!1})],_.prototype,"parent",void 0),(0,i.Cg)([(0,p.MZ)({readOnly:!0})],_.prototype,"parsedUrl",null),(0,i.Cg)([(0,p.MZ)({type:Boolean,readOnly:!0})],_.prototype,"persistenceEnabled",void 0),(0,i.Cg)([(0,p.MZ)({type:Boolean})],_.prototype,"popupEnabled",void 0),(0,i.Cg)([(0,p.MZ)({type:Boolean})],_.prototype,"attributionVisible",void 0),(0,i.Cg)([(0,p.MZ)({type:y.A})],_.prototype,"spatialReference",void 0),(0,i.Cg)([(0,p.MZ)({type:String})],_.prototype,"title",void 0),(0,i.Cg)([(0,p.MZ)({readOnly:!0,json:{read:!1}})],_.prototype,"type",void 0),(0,i.Cg)([(0,p.MZ)()],_.prototype,"url",void 0),(0,i.Cg)([(0,p.MZ)({type:m.A})],_.prototype,"visibilityTimeExtent",void 0),(0,i.Cg)([(0,p.MZ)({type:Boolean,nonNullable:!0})],_.prototype,"visible",void 0),_=(0,i.Cg)([(0,p.$K)("esri.layers.Layer")],_)},6797:(e,t,r)=>{r.d(t,{Ui:()=>p});var i=r(69622),n=r(7762),a=r(88620);const s=new Set(["esri.Color","esri.portal.Portal","esri.symbols.support.Symbol3DAnchorPosition2D","esri.symbols.support.Symbol3DAnchorPosition3D"]);function l(e){return e instanceof i.A}function o(e){return e instanceof n.A?Object.keys(e.items):l(e)?(0,a.oY)(e).keys():e?Object.keys(e):[]}function u(e,t){return e instanceof n.A?e.items[t]:e[t]}function c(e){return e?e.declaredClass:null}function d(e,t){const r=e.diff;if(r&&"function"==typeof r)return r(e,t);const i=o(e),n=o(t);if(0===i.length&&0===n.length)return;if(!i.length||!n.length||function(e,t){return!(!Array.isArray(e)||!Array.isArray(t))&&e.length!==t.length}(e,t))return{type:"complete",oldValue:e,newValue:t};const a=n.filter(e=>!i.includes(e)),p=i.filter(e=>!n.includes(e)),h=i.filter(r=>n.includes(r)&&u(e,r)!==u(t,r)).concat(a,p).sort(),y=c(e);if(y&&s.has(y)&&h.length)return{type:"complete",oldValue:e,newValue:t};let f;const m=l(e)&&l(t);for(const i of h){const n=u(e,i),a=u(t,i);let s;if((m||"function"!=typeof n&&"function"!=typeof a)&&n!==a&&(null!=n||null!=a)){if(r&&r[i]&&"function"==typeof r[i])s=r[i]?.(n,a);else if(n instanceof Date&&a instanceof Date){if(n.getTime()===a.getTime())continue;s={type:"complete",oldValue:n,newValue:a}}else s="object"==typeof n&&"object"==typeof a&&c(n)===c(a)?d(n,a):{type:"complete",oldValue:n,newValue:a};null!=s&&(null!=f?f.diff[i]=s:f={type:"partial",diff:{[i]:s}})}}return f}function p(e,t){if("function"!=typeof e&&"function"!=typeof t&&(null!=e||null!=t))return null==e||null==t||"object"==typeof e&&"object"==typeof t&&c(e)!==c(t)?{type:"complete",oldValue:e,newValue:t}:d(e,t)}},9762:(e,t,r)=>{r.r(t),r.d(t,{projectBuffer:()=>n});var i=r(37539);function n(e,t,r,n,a,s,l=Math.floor(e.length/3)){const o=(0,i.jd)(t,a);if(null==o)return!1;if(o===i.pO){if(e===n&&r===s)return!0;const t=r+3*l;for(let i=r,a=s;i<t;i++,a++)n[a]=e[i]??0;return!0}const u=r+3*l;for(let t=r,i=s;t<u;t+=3,i+=3)o(e,t,n,i);return!0}},10536:(e,t,r)=>{function i(e){const t={};for(const r in e){if("declaredClass"===r)continue;const n=e[r];if(null!=n&&"function"!=typeof n)if(Array.isArray(n)){t[r]=[];for(let e=0;e<n.length;e++)t[r][e]=i(n[e])}else"object"==typeof n?n.toJSON&&(t[r]=JSON.stringify(n)):t[r]=n}return t}r.d(t,{z:()=>i})},16215:(e,t,r)=>{r.d(t,{S:()=>n,Y:()=>i});const i=Symbol("BasemapInstance");function n(e){return null!=e&&"object"==typeof e&&i in e}},16494:(e,t,r)=>{r.d(t,{Nd:()=>l,W5:()=>s});var i=r(37330);const n=["dd","dl","dt","h1","h2","h3","h4","h5","h6","sub","sup","animate","animatetransform","circle","clippath","defs","ellipse","g","image","line","lineargradient","marker","mask","path","pattern","polygon","polyline","radialgradient","rect","stop","svg","switch","symbol","text","textpath","tspan","use"].reduce((e,t)=>(e[t]=[],e),{}),a=["align","alink","alt","bgcolor","border","cellpadding","cellspacing","class","color","cols","colspan","coords","d","dir","face","height","hspace","ismap","lang","marginheight","marginwidth","multiple","nohref","noresize","noshade","nowrap","ref","rel","rev","rows","rowspan","scrolling","shape","span","summary","tabindex","title","usemap","valign","value","vlink","vspace","width"],s=new i.I({whiteList:n,onTagAttr:(e,t,r)=>{const i=`${t}="${r}"`;if(a.includes(t))return i},stripIgnoreTag:!0,stripIgnoreTagBody:["script","style"]},!0),l=new i.I({whiteList:{br:[]},stripIgnoreTag:!0,escapeHtml:e=>e},!1)},17126:(e,t,r)=>{r.d(t,{dw:()=>s,qD:()=>l,qW:()=>o});var i=r(11254),n=r(21325),a=r(10536);function s(e,t){const r=e.toJSON();return r.objectIds&&(r.objectIds=r.objectIds.join(",")),r.orderByFields&&(r.orderByFields=r.orderByFields.join(",")),r.outFields&&!t?.returnCountOnly?r.outFields.includes("*")?r.outFields="*":r.outFields=r.outFields.join(","):delete r.outFields,r.outSR&&(r.outSR=(0,n.YX)(r.outSR)),r.dynamicDataSource&&(r.layer=JSON.stringify({source:r.dynamicDataSource}),delete r.dynamicDataSource),r}async function l(e,t,r){const i=await u(e,t,r),n=i.data,a=n.geometryType,s=n.spatialReference,l={};for(const e of n.relatedRecordGroups){const t={fields:void 0,geometryType:a,spatialReference:s,hasZ:!!n.hasZ,hasM:!!n.hasM,features:e.relatedRecords};if(null!=e.objectId)l[e.objectId]=t;else for(const r of Object.keys(e))"relatedRecords"!==r&&(l[e[r]]=t)}return{...i,data:l}}async function o(e,t,r){const i=await u(e,t,r,{returnCountOnly:!0}),n=i.data,a={};for(const e of n.relatedRecordGroups)null!=e.objectId&&(a[e.objectId]=e.count);return{...i,data:a}}async function u(e,t,r={},n){const l=(0,a.z)({...e.query,f:"json",...n,...s(t,n)});return(0,i.A)(e.path+"/queryRelatedRecords",{...r,query:{...r.query,...l}})}},17311:(e,t,r)=>{r.d(t,{A:()=>h});var i=r(31635),n=r(69622),a=r(4576),s=r(60999),l=r(7762),o=r(16494),u=r(91429),c=r(30524),d=r(43668);const p=/<br\s*\/*>/gi;let h=class extends n.A{constructor(e){super(e),this._featureUtils=null,this.effectivePopupTemplate=null}get _arcadeTask(){return this.expressionsUsedInTitle.length>0?this._get("_arcadeTask")||(0,s.UT)(()=>(0,d.l)()):null}get featureUtilsPromise(){return this._get("featureUtilsPromise")??r.e(9926).then(r.bind(r,29926)).then(e=>this._featureUtils=e)}get calculatedExpressions(){const e=new l.A;if(!this.expressionsUsedInTitle.length)return e;if(!this._arcadeTask?.value){for(const t of this.expressionsUsedInTitle??[])e.push({name:t.name,invalid:!0});return e}for(const t of this.expressionsUsedInTitle)try{const r=this._arcadeTask.value.arcade.parseScript(t.expression,["$layer","$map","$datastore"]);if(r.isAsync){e.push({name:t.name,invalid:!0});break}e.push({name:t.name,syntax:r,invalid:!1,func:this._arcadeTask.value.arcade.compileScript(r,{vars:{$feature:"any"}})})}catch{e.push({name:t.name,invalid:!0});break}return e}get expressionsUsedInTitle(){let e=this.effectivePopupTemplate?.title??"";return"string"!=typeof e?[]:(e=e.toLowerCase(),this.effectivePopupTemplate?.expressionInfos?.filter(t=>e.includes(`{expression/${t.name.toLowerCase()}}`))??[])}get fieldInfoMap(){return this._featureUtils?this._createFieldInfoMap(this._featureUtils.getAllFieldInfos(this.effectivePopupTemplate)):null}get hasBadExpressions(){return this.calculatedExpressions.some(e=>!0===e.invalid)}get requiredFields(){const e=new Set;if(this._arcadeTask?.value&&!this.hasBadExpressions)for(const t of this.calculatedExpressions?.toArray()??[])try{const r=this._arcadeTask.value.arcade.extractFieldLiterals(t.syntax);for(const t of r){const r=t.split("."),i=this.fieldsIndex.get(r.at(-1)??"");i&&e.add(i.name)}}catch{}const t=this._extractFieldNames(this.workingTitle);for(const r of t){const t=this.fieldsIndex.get(r);t&&e.add(t.name)}return null!=this.objectIdField&&e.add(this.objectIdField),e}get titleFromDisplayField(){let e="";return this.displayField&&(e=this.fieldsIndex.get(this.displayField)?.name??""),e||(e=this.fieldsIndex.get(this.objectIdField)?.name??""),e?`{${e}}`:""}get workingTitle(){const e=this.effectivePopupTemplate?this.effectivePopupTemplate.title:"";return""===e||null==e||this.hasBadExpressions||"string"!=typeof e?this.titleFromDisplayField:e}async getTitle(e,t,r){const i=t.getObjectId()??t.attributes[e.objectIdField];return(await this.getTitles(e,[t],r)).get(i)??""}async getTitles(e,t,r){const i=new Map,n=r?.timeZone??"system";try{const[{substituteFieldsInLinksAndAttributes:a}]=await Promise.all([this.featureUtilsPromise,this._arcadeTask?.promise]);r?.fetchMissingFields&&(t=await this._checkAndReQueryGraphics(e,t));const{fieldInfoMap:s,workingTitle:l}=this,u=l&&s;t.forEach(t=>{const c=t.getObjectId()??t.attributes[e.objectIdField];let d=u?a({attributes:t.attributes,expressionAttributes:null,fieldInfoMap:s,globalAttributes:this._createFormattedAttributes(e,t,n).global,layer:e,text:l}):"";r?.removeHTML&&(d=o.Nd.sanitize(d).replaceAll(p," ")),i.set(c,d)})}catch{}return i}async _checkAndReQueryGraphics(e,t){const r=t.map(t=>t.getObjectId()??t.attributes[e.objectIdField]).filter(a.Ru);if(r.length!==t.length)return t;if(t.some(e=>!(0,c.Kl)(e,this.requiredFields))){const i=e.createQuery();i.where="1=1",i.outFields=[...this.requiredFields],i.objectIds=r;const n=await e.queryFeatures(i);if(n?.features.length===t.length)return n.features}return t}_createFieldInfoMap(e){const t=new Map;if(!e)return t;for(const r of e){if(!r.fieldName)continue;const e=this.fieldsIndex.get(r.fieldName),i=e?.name??r.fieldName;r.fieldName=i,t.set(i.toLowerCase(),r)}return t}_createFormattedAttributes(e,t,r="system"){const i=this.effectivePopupTemplate?.fieldInfos??[],n={};if(!this._featureUtils)return{};if(!this.hasBadExpressions&&this.calculatedExpressions.length>0&&this._arcadeTask?.value){const r=this._arcadeTask.value.Feature.createFromGraphicLikeObject(t.geometry,t.attributes,e,null);for(const e of this.calculatedExpressions)try{n[`expression/${e.name}`]=e.func({vars:{$feature:r}})}catch{}}const a={...t.attributes,...n};return{global:this._featureUtils.formatAttributes({fieldInfos:i,attributes:a,graphic:t,timeZone:r,layer:e,fieldInfoMap:this.fieldInfoMap}),content:[]}}_extractFieldNames(e){return(0,c.nw)(e).filter(e=>!(e.startsWith("relationships/")||e.startsWith("expression/")))}};(0,i.Cg)([(0,u.MZ)({readOnly:!0})],h.prototype,"_arcadeTask",null),(0,i.Cg)([(0,u.MZ)()],h.prototype,"_featureUtils",void 0),(0,i.Cg)([(0,u.MZ)({readOnly:!0})],h.prototype,"featureUtilsPromise",null),(0,i.Cg)([(0,u.MZ)({readOnly:!0})],h.prototype,"calculatedExpressions",null),(0,i.Cg)([(0,u.MZ)()],h.prototype,"displayField",void 0),(0,i.Cg)([(0,u.MZ)()],h.prototype,"effectivePopupTemplate",void 0),(0,i.Cg)([(0,u.MZ)()],h.prototype,"expressionsUsedInTitle",null),(0,i.Cg)([(0,u.MZ)()],h.prototype,"fieldsIndex",void 0),(0,i.Cg)([(0,u.MZ)()],h.prototype,"fieldInfoMap",null),(0,i.Cg)([(0,u.MZ)()],h.prototype,"fields",void 0),(0,i.Cg)([(0,u.MZ)()],h.prototype,"objectIdField",void 0),(0,i.Cg)([(0,u.MZ)()],h.prototype,"requiredFields",null),h=(0,i.Cg)([(0,u.$K)("esri.layers.support.TitleCreator")],h)},22671:(e,t,r)=>{r.d(t,{A:()=>g});var i,n=r(31635),a=r(52106),s=r(66552),l=r(25482),o=r(4718),u=r(91429),c=r(16930),d=r(65864),p=r(50498),h=r(20437),y=r(36005),f=r(43937);const m=new s.J({esriGeometryPoint:"point",esriGeometryMultipoint:"multipoint",esriGeometryPolyline:"polyline",esriGeometryPolygon:"polygon",esriGeometryEnvelope:"extent",mesh:"mesh","":null});let g=i=class extends l.o{constructor(e){super(e),this.displayFieldName=null,this.exceededTransferLimit=!1,this.features=[],this.fields=null,this.geometryType=null,this.hasM=!1,this.hasZ=!1,this.queryGeometry=null,this.spatialReference=null}readFeatures(e,t){return this.readFeaturesWithClass(e,t,a.A)}writeGeometryType(e,t,r,i){if(e)return void m.write(e,t,r,i);const{features:n}=this;if(n)for(const e of n)if(null!=e?.geometry)return void m.write(e.geometry.type,t,r,i)}readQueryGeometry(e,t){if(!e)return null;const r=!!e.spatialReference,i=(0,d.rS)(e);return i&&!r&&t.spatialReference&&(i.spatialReference=c.A.fromJSON(t.spatialReference)),i}writeSpatialReference(e,t){if(e)return void(t.spatialReference=e.toJSON());const{features:r}=this;if(r)for(const e of r)if(e&&null!=e.geometry&&e.geometry.spatialReference)return void(t.spatialReference=e.geometry.spatialReference.toJSON())}clone(){return new i(this.cloneProperties())}cloneProperties(){return(0,o.o8)({displayFieldName:this.displayFieldName,exceededTransferLimit:this.exceededTransferLimit,features:this.features,fields:this.fields,geometryType:this.geometryType,hasM:this.hasM,hasZ:this.hasZ,queryGeometry:this.queryGeometry,spatialReference:this.spatialReference,transform:this.transform})}toJSON(e){const t=this.write();if(t.features&&Array.isArray(e)&&e.length>0)for(let r=0;r<t.features.length;r++){const i=t.features[r];if(i.geometry){const t=e?.[r];i.geometry=t?.toJSON()||i.geometry}}return t}quantize(e){const{scale:[t,r],translate:[i,n]}=e,a=this.features,s=this._getQuantizationFunction(this.geometryType,e=>Math.round((e-i)/t),e=>Math.round((n-e)/r));for(let e=0,t=a.length;e<t;e++)s?.(a[e].geometry)||(a.splice(e,1),e--,t--);return this.transform=e,this}unquantize(){const{geometryType:e,features:t,transform:r}=this;if(!r)return this;const{translate:[i,n],scale:[a,s]}=r;let l=null,o=null;if(this.hasZ&&null!=r?.scale?.[2]){const{translate:[,,e],scale:[,,t]}=r;l=r=>r*t+e}if(this.hasM&&null!=r?.scale?.[3]){const{translate:[,,,e],scale:[,,,t]}=r;o=r=>null==r?r:r*t+e}const u=this._getHydrationFunction(e,e=>e*a+i,e=>n-e*s,l,o);for(const{geometry:e}of t)null!=e&&u&&u(e);return this.transform=null,this}readFeaturesWithClass(e,t,r){const i=c.A.fromJSON(t.spatialReference),n=[];for(let t=0;t<e.length;t++){const a=e[t],s=r.fromJSON(a),l=a.geometry?.spatialReference;null==s.geometry||l||(s.geometry.spatialReference=i);const o=a.aggregateGeometries,u=s.aggregateGeometries;if(o&&null!=u)for(const e in u){const t=u[e],r=o[e],n=r?.spatialReference;null==t||n||(t.spatialReference=i)}n.push(s)}return n}_quantizePoints(e,t,r){let i,n;const a=[];for(let s=0,l=e.length;s<l;s++){const l=e[s];if(s>0){const e=t(l[0]),s=r(l[1]);e===i&&s===n||(a.push([e-i,s-n]),i=e,n=s)}else i=t(l[0]),n=r(l[1]),a.push([i,n])}return a.length>0?a:null}_getQuantizationFunction(e,t,r){return"point"===e?e=>(e.x=t(e.x),e.y=r(e.y),e):"polyline"===e||"polygon"===e?e=>{const i=(0,d.Bi)(e)?e.rings:e.paths,n=[];for(let e=0,a=i.length;e<a;e++){const a=i[e],s=this._quantizePoints(a,t,r);s&&n.push(s)}return n.length>0?((0,d.Bi)(e)?e.rings=n:e.paths=n,e):null}:"multipoint"===e?e=>{const i=this._quantizePoints(e.points,t,r);return i&&i.length>0?(e.points=i,e):null}:"extent"===e?e=>e:null}_getHydrationFunction(e,t,r,i,n){return"point"===e?e=>{e.x=t(e.x),e.y=r(e.y),i&&(e.z=i(e.z))}:"polyline"===e||"polygon"===e?e=>{const a=(0,d.Bi)(e)?e.rings:e.paths;let s,l;for(let e=0,i=a.length;e<i;e++){const i=a[e];for(let e=0,n=i.length;e<n;e++){const n=i[e];e>0?(s+=n[0],l+=n[1]):(s=n[0],l=n[1]),n[0]=t(s),n[1]=r(l)}}if(i&&n)for(let e=0,t=a.length;e<t;e++){const t=a[e];for(let e=0,r=t.length;e<r;e++){const r=t[e];r[2]=i(r[2]),r[3]=n(r[3])}}else if(i)for(let e=0,t=a.length;e<t;e++){const t=a[e];for(let e=0,r=t.length;e<r;e++){const r=t[e];r[2]=i(r[2])}}else if(n)for(let e=0,t=a.length;e<t;e++){const t=a[e];for(let e=0,r=t.length;e<r;e++){const r=t[e];r[2]=n(r[2])}}}:"extent"===e?e=>{e.xmin=t(e.xmin),e.ymin=r(e.ymin),e.xmax=t(e.xmax),e.ymax=r(e.ymax),i&&null!=e.zmax&&null!=e.zmin&&(e.zmax=i(e.zmax),e.zmin=i(e.zmin)),n&&null!=e.mmax&&null!=e.mmin&&(e.mmax=n(e.mmax),e.mmin=n(e.mmin))}:"multipoint"===e?e=>{const a=e.points;let s,l;for(let e=0,i=a.length;e<i;e++){const i=a[e];e>0?(s+=i[0],l+=i[1]):(s=i[0],l=i[1]),i[0]=t(s),i[1]=r(l)}if(i&&n)for(let e=0,t=a.length;e<t;e++){const t=a[e];t[2]=i(t[2]),t[3]=n(t[3])}else if(i)for(let e=0,t=a.length;e<t;e++){const t=a[e];t[2]=i(t[2])}else if(n)for(let e=0,t=a.length;e<t;e++){const t=a[e];t[2]=n(t[2])}}:null}};(0,n.Cg)([(0,u.MZ)({type:String,json:{write:!0}})],g.prototype,"displayFieldName",void 0),(0,n.Cg)([(0,u.MZ)({type:Boolean,json:{write:{overridePolicy:e=>({enabled:e})}}})],g.prototype,"exceededTransferLimit",void 0),(0,n.Cg)([(0,u.MZ)({type:[a.A],json:{write:!0}})],g.prototype,"features",void 0),(0,n.Cg)([(0,y.w)("features")],g.prototype,"readFeatures",null),(0,n.Cg)([(0,u.MZ)({type:[h.A],json:{write:!0}})],g.prototype,"fields",void 0),(0,n.Cg)([(0,u.MZ)({type:["point","multipoint","polyline","polygon","extent","mesh"],json:{read:{reader:m.read}}})],g.prototype,"geometryType",void 0),(0,n.Cg)([(0,f.K)("geometryType")],g.prototype,"writeGeometryType",null),(0,n.Cg)([(0,u.MZ)({type:Boolean,json:{write:{overridePolicy:e=>({enabled:e})}}})],g.prototype,"hasM",void 0),(0,n.Cg)([(0,u.MZ)({type:Boolean,json:{write:{overridePolicy:e=>({enabled:e})}}})],g.prototype,"hasZ",void 0),(0,n.Cg)([(0,u.MZ)({types:p.yR,json:{write:!0}})],g.prototype,"queryGeometry",void 0),(0,n.Cg)([(0,y.w)("queryGeometry")],g.prototype,"readQueryGeometry",null),(0,n.Cg)([(0,u.MZ)({type:c.A,json:{write:!0}})],g.prototype,"spatialReference",void 0),(0,n.Cg)([(0,f.K)("spatialReference")],g.prototype,"writeSpatialReference",null),(0,n.Cg)([(0,u.MZ)({json:{write:!0}})],g.prototype,"transform",void 0),g=i=(0,n.Cg)([(0,u.$K)("esri.rest.support.FeatureSet")],g),g.prototype.toJSON.isDefaultToJSON=!0},29005:(e,t,r)=>{r.d(t,{A:()=>u});var i=r(31635),n=r(69540),a=r(66552),s=r(25482),l=r(91429);const o=new a.J({esriFeatureEditToolAutoCompletePolygon:"auto-complete-polygon",esriFeatureEditToolCircle:"circle",esriFeatureEditToolEllipse:"ellipse",esriFeatureEditToolFreehand:"freehand",esriFeatureEditToolLine:"line",esriFeatureEditToolNone:"none",esriFeatureEditToolPoint:"point",esriFeatureEditToolPolygon:"polygon",esriFeatureEditToolRectangle:"rectangle",esriFeatureEditToolArrow:"arrow",esriFeatureEditToolTriangle:"triangle",esriFeatureEditToolLeftArrow:"left-arrow",esriFeatureEditToolRightArrow:"right-arrow",esriFeatureEditToolUpArrow:"up-arrow",esriFeatureEditToolDownArrow:"down-arrow"});let u=class extends((0,n.OU)(s.o)){constructor(e){super(e),this.name=null,this.description=null,this.drawingTool=null,this.prototype=null,this.thumbnail=null}};(0,i.Cg)([(0,l.MZ)({json:{write:!0}})],u.prototype,"name",void 0),(0,i.Cg)([(0,l.MZ)({json:{write:!0}})],u.prototype,"description",void 0),(0,i.Cg)([(0,l.MZ)({json:{read:o.read,write:o.write}})],u.prototype,"drawingTool",void 0),(0,i.Cg)([(0,l.MZ)({json:{write:!0}})],u.prototype,"prototype",void 0),(0,i.Cg)([(0,l.MZ)({json:{write:!0}})],u.prototype,"thumbnail",void 0),u=(0,i.Cg)([(0,l.$K)("esri.layers.support.FeatureTemplate")],u)},30235:(e,t,r)=>{r.d(t,{A:()=>y});var i=r(48938),n=r(87449),a=r(11221),s=r(33325),l=r(80609),o=r(4576),u=r(39516),c=r(91075),d=r(68654),p=r(33143),h=r(20437);class y extends a.Jn{constructor(e){super(),this.declaredClass="esri.arcade.featureset.sources.FeatureLayerMemory",this._removeGeometry=!1,this._overrideFields=null,this._forceIsTable=!1,this._maxProcessing=1e3,this._layer=e.layer,e.spatialReference&&(this.spatialReference=e.spatialReference),!0===e.isTable&&(this._forceIsTable=!0),void 0!==e.outFields&&(this._overrideFields=e.outFields),void 0!==e.includeGeometry&&(this._removeGeometry=!1===e.includeGeometry)}_maxQueryRate(){return s.gO}async loadImpl(){return!0===this._layer.loaded?(this._initialiseFeatureSet(),this):(await this._layer.load(),this._initialiseFeatureSet(),this)}get gdbVersion(){return""}_initialiseFeatureSet(){if(this.spatialReference??=this._layer.spatialReference,this.geometryType=this._layer.geometryType??"",this.fields=this._layer.fields.slice(),null!==this._overrideFields)if(1===this._overrideFields.length&&"*"===this._overrideFields[0])this._overrideFields=null;else{const e=new Set(this._overrideFields.map(e=>e.toLowerCase()));this.fields=this.fields.filter(({type:t,name:r})=>"oid"===t||this._layer.objectIdField===r||e.has(r.toLowerCase())),this._overrideFields=this.fields.map(({name:e})=>e)}this.objectIdField=this._layer.objectIdField;for(const e of this.fields)"global-id"===e.type&&(this.globalIdField=e.name);this._databaseType=0,this.hasZ=!0===this._layer.capabilities?.data?.supportsZ,this.hasM=!0===this._layer.capabilities?.data?.supportsM,this.subtypeField=("subtypeField"in this._layer?this._layer.subtypeField:null)??"",this.subtypes="subtypes"in this._layer?this._layer.subtypes:null,this.typeIdField=("typeIdField"in this._layer?this._layer.typeIdField:null)??"",this.types="types"in this._layer?this._layer.types:null}isTable(){return this._forceIsTable||"isTable"in this._layer&&this._layer.isTable||"table"===this._layer.type||!this._layer.geometryType}async _queryAll(){return(await this.query({abortSignal:i._})).features}_queryLayerFeaturesJSON(e){return"queryFeaturesJSON"in this._layer?this._layer.queryFeaturesJSON(e):this._layer.source.queryFeaturesJSON(e)}async query(e){await this._ensureLoaded();let t="",r=!1;if(null!=e.orderBy&&(t=e.orderBy.constructClause(),r=!0),this.isTable()&&null!=e.spatialFilter)return a.An;const i=this._createQuery();return i.where=(0,u.mA)(i.where,null==e.where?null==e.spatialFilter?"1=1":"":(0,l.YY)(e.where,0)),null!=e.spatialFilter&&(i.spatialRelationship=this._makeRelationshipEnum(e.spatialFilter.relation),i.relationParameter=this._makeRelationshipParam(e.spatialFilter.relation),i.geometry=e.spatialFilter.geometry),i.outSpatialReference=this.spatialReference,i.orderByFields=""!==t?t.split(","):null,{filterApplied:!0,spatialFilterApplied:!0,ordered:r,features:async function*(){const t=await this._queryLayerFeaturesJSON(i);(0,n.dZ)(e.abortSignal);for(const e of(0,o.Ho)(t.features,this._maxQueryRate()))(0,a.Rn)(e,t.spatialReference??this.spatialReference.toJSON()),yield e}.apply(this)}}async queryStat(e){return{calculated:!1}}async canQueryAggregate(e){return!1}async queryAggregate(e){throw new n.dr("NeverReach")}_createQuery(){const e=this._layer.createQuery();return e.returnZ=this.hasZ,e.returnM=this.hasM,e.outFields=this._overrideFields??["*"],e.returnGeometry=!this._removeGeometry,e}_makeRelationshipEnum(e){if(e.includes("esriSpatialRelRelation"))return"relation";switch(e){case"esriSpatialRelRelation":return"relation";case"esriSpatialRelIntersects":return"intersects";case"esriSpatialRelContains":return"contains";case"esriSpatialRelOverlaps":return"overlaps";case"esriSpatialRelWithin":return"within";case"esriSpatialRelTouches":return"touches";case"esriSpatialRelCrosses":return"crosses";case"esriSpatialRelEnvelopeIntersects":return"envelope-intersects"}return e}_makeRelationshipParam(e){return e.includes("esriSpatialRelRelation")?e.split(":")[1]:""}relationshipMetadata(){return[]}nativeCapabilities(){return{title:this._layer.title??"",canQueryRelated:!1,source:this,capabilities:this._layer.capabilities,databaseType:this._databaseType,requestStandardised:!0}}static create(e,t){let r=e.layerDefinition.objectIdField;const i=e.layerDefinition.typeIdField??"",n=[];if(e.layerDefinition.types)for(const t of e.layerDefinition.types)n.push(p.A.fromJSON(t));let a=e.layerDefinition.geometryType;void 0===a&&(a=e.featureSet.geometryType||"");let s=e.featureSet.features;if(!r){let t=!1;for(const i of e.layerDefinition.fields)if("oid"===i.type||"esriFieldTypeOID"===i.type){r=i.name,t=!0;break}if(!1===t){let t="FID",i=!0,n=0;for(;i;){let r=!0;for(const i of e.layerDefinition.fields)if(i.name===t){r=!1;break}!0===r?i=!1:(n++,t="FID"+n.toString())}e.layerDefinition.fields.push({type:"esriFieldTypeOID",name:t,alias:t});const a=[];for(let r=0;r<s.length;r++)a.push({geometry:e.featureSet.features[r].geometry,attributes:{...e.featureSet.features[r].attributes,[t]:r}});s=a,r=t}}const l=[];for(const t of e.layerDefinition.fields)t instanceof h.A?l.push(t):l.push(h.A.fromJSON(t));let o=a;switch(o||(o=""),o){case"esriGeometryPoint":o="point";break;case"esriGeometryPolyline":o="polyline";break;case"esriGeometryPolygon":o="polygon";break;case"esriGeometryEnvelope":o="extent";break;case"esriGeometryMultipoint":o="multipoint";break;case"":case"esriGeometryNull":o="esriGeometryNull"}if("esriGeometryNull"!==o){const e=t.toJSON();for(const t of s)t.geometry&&t.geometry instanceof c.A==0&&(t.geometry.type=o,void 0===t.geometry.spatialReference&&(t.geometry.spatialReference=e))}else for(const e of s)e.geometry&&(e.geometry=null);const u={outFields:["*"],source:s,fields:l,hasZ:!0===e.layerDefinition.hasZ||!0===e.featureSet.hasZ,hasM:!0===e.layerDefinition.hasM||!0===e.featureSet.hasM,types:n,typeIdField:i,objectIdField:r,spatialReference:t},f="esriGeometryNull"===o||null===o;f||(u.geometryType=o);const m=new d.default(u);return e.layerDefinition.subtypeField&&e.layerDefinition.subtypes&&m.read({subtypes:e.layerDefinition.subtypes,subtypeField:e.layerDefinition.subtypeField}),new y({layer:m,spatialReference:t,isTable:f})}async queryAttachments(){return[]}async getFeatureByObjectId(e){const t=this._createQuery();t.where=this.objectIdField+"="+e.toString();const r=await this._queryLayerFeaturesJSON(t);return 1===r.features.length?((0,a.Rn)(r.features,r.spatialReference??this.spatialReference.toJSON()),r.features[0]):null}serviceUrl(){return""}async getOwningSystemUrl(){return""}async getIdentityUser(){return""}get preferredTimeZone(){return"preferredTimeZone"in this._layer?this._layer.preferredTimeZone:null}get dateFieldsTimeZone(){return"dateFieldsTimeZone"in this._layer?this._layer.dateFieldsTimeZone:null}get datesInUnknownTimezone(){return"datesInUnknownTimezone"in this._layer&&this._layer.datesInUnknownTimezone}get editFieldsInfo(){return"editFieldsInfo"in this._layer?this._layer.editFieldsInfo:null}get timeInfo(){return this._layer.timeInfo}async getFeatureSetInfo(){const e=this._layer.title&&this._layer.parent;return{layerId:null,layerName:null,itemId:null,serviceLayerUrl:null,webMapLayerId:e?this._layer.id??null:null,webMapLayerTitle:e?this._layer.title??null:null,className:null,objectClassId:null}}}},30445:(e,t,r)=>{r.r(t),r.d(t,{constructAssociationMetaDataFeatureSetFromUrl:()=>U,constructFeatureSet:()=>P,constructFeatureSetFromPortalItem:()=>V,constructFeatureSetFromRelationship:()=>G,constructFeatureSetFromUrl:()=>N,convertToFeatureSet:()=>J,createFeatureSetCollectionFromMap:()=>Q,createFeatureSetCollectionFromService:()=>z,initialiseMetaDataCache:()=>E});var i=r(11254);class n{constructor(){this.declaredRootClass="esri.arcade.featureSetCollection",this._layerById={},this._layerByName={}}add(e,t,r){this._layerById[t]=r,this._layerByName[e]=r}async featureSetByName(e,t=!0,r=["*"]){return void 0===this._layerByName[e]?null:this._layerByName[e]}async featureSetById(e,t=!0,r=["*"]){return void 0===this._layerById[e]?null:this._layerById[e]}castToText(e=!1){return"object, FeatureSetCollection"}}var a=r(78878),s=r(35704),l=r(70333),o=r(48938),u=r(61454),c=r(66395),d=r(87449),p=r(11221),h=r(33325),y=r(80609),f=r(50145),m=r(4576),g=r(80200),_=r(39516),w=r(88368),b=r(68654),F=r(17126),I=r(54546),v=r(61956),S=r(7562);function T(e,t){null==e.clause&&(e.clause=function(e){if(0===e.length)throw new d.dr("NeverReach");const t=[];for(let r=0;r<e.length;r++){const i=e[r],n=[`"${i.name.replaceAll('"','""')}" ${i.asc?">":"<"} @last_${r}`];for(let t=0;t<r;t++){const r=e[t];n.push(`"${r.name.replaceAll('"','""')}" = @last_${t}`)}t.push(n.join(" AND "))}const r=t.join(" OR ");return w.A.create(r)}(e.keyFields));for(let r=0;r<e.keyFields.length;r++){const i=e.keyFields[r].name;e.clause.parameters[`last_${r}`]=t.attributes[i]}}class R extends p.Jn{constructor(e){super(),this.declaredClass="esri.arcade.featureset.sources.FeatureLayerDynamic",this._removeGeometry=!1,this._overrideFields=null,this._requestStandardised=!1,this._useDefinitionExpression=!0,this._recentlyUsedQueries=null,this._featureSetQueryInterceptor=null,this._featureSetInfo=null,this._maxProcessing=1e3,this._layer=e.layer,e.spatialReference&&(this.spatialReference=e.spatialReference),void 0!==e.outFields&&(this._overrideFields=e.outFields),void 0!==e.includeGeometry&&(this._removeGeometry=!1===e.includeGeometry),e.lrucache&&(this._recentlyUsedQueries=e.lrucache),e.interceptor&&(this._featureSetQueryInterceptor=e.interceptor)}_maxQueryRate(){return h.gO}get urlQueryPath(){return this._layer.parsedUrl.path||""}convertQueryToLruCacheKey(e){const t=this.urlQueryPath+","+(0,h.JB)(e.toJSON());return(0,g.d)(t,g.T.String)}async loadImpl(){return!0===this._layer.loaded?(this._initialiseFeatureSet(),this):(await this._layer.load(),this._initialiseFeatureSet(),this)}_initialiseFeatureSet(){if(this.spatialReference??=this._layer.spatialReference,this.geometryType=this._layer.geometryType??"",this.fields=this._layer.fields.slice(),this.hasZ=!0===this._layer.capabilities?.data?.supportsZ,this.hasM=!0===this._layer.capabilities?.data?.supportsM,null!==this._overrideFields)if(1===this._overrideFields.length&&"*"===this._overrideFields[0])this._overrideFields=null;else{const e=new Set(this._overrideFields.map(e=>e.toLowerCase()));this.fields=this.fields.filter(({type:t,name:r})=>"oid"===t||e.has(r.toLowerCase())),this._overrideFields=this.fields.map(({name:e})=>e)}if(this._layer.source&&this._layer.source.sourceJSON){const e=this._layer.source.sourceJSON.currentVersion;!0===this._layer.source.sourceJSON.useStandardizedQueries?(this._databaseType=1,null!=e&&e>=10.61&&(this._databaseType=0)):null!=e&&(e>=10.5&&(this._databaseType=1,this._requestStandardised=!0),e>=10.61&&(this._databaseType=0))}this.objectIdField=this._layer.objectIdField;for(const e of this.fields)"global-id"===e.type&&(this.globalIdField=e.name);this.subtypeField=this._layer.subtypeField??"",this.subtypes=this._layer.subtypes,this.typeIdField=("typeIdField"in this._layer?this._layer.typeIdField:null)??"",this.types="types"in this._layer?this._layer.types:null}async _runDatabaseProbe(e){await this._ensureLoaded();const t=new v.A;this.datesInUnknownTimezone&&(t.timeReferenceUnknownClient=!0),t.where=e.replace("OBJECTID",this._layer.objectIdField);try{return await this._layer.queryObjectIds(t),!0}catch{return!1}}_canUsePagination(){return!(!this._layer.capabilities||!this._layer.capabilities.query||!0!==this._layer.capabilities.query.supportsPagination)}_cacheableFeatureSetSourceKey(){return this._layer.url}get gdbVersion(){return this._layer&&this._layer.capabilities&&this._layer.capabilities.data&&this._layer.capabilities.data.isVersioned?this._layer.gdbVersion||"SDE.DEFAULT":""}nativeCapabilities(){return{title:this._layer.title??"",source:this,canQueryRelated:!0,capabilities:this._layer.capabilities,databaseType:this._databaseType,requestStandardised:this._requestStandardised}}async _queryAll(){return(await this.query({abortSignal:o._})).features}async query(e){return await this._ensureLoaded(),this.isTable()&&null!=e.spatialFilter?p.An:this._canUsePagination()?this._queryUsingPaging(e):this._queryUsingIdSetTraversal(e)}async _queryUsingPaging(e){let t="",r=!1;null!=e.orderBy&&!0===this._layer.capabilities?.query?.supportsOrderBy&&(t=e.orderBy.constructClause(),r=!0);const i=await this.databaseType(),n=null==e.where?null==e.spatialFilter?"1=1":"":(0,y.YY)(e.where,i);let a=this._maxQueryRate();const s=this._layer.capabilities?.query.maxRecordCount;null!=s&&s<a&&(a=s);const l=!0!==this._removeGeometry,o=this._overrideFields??this._fieldsIncludingObjectId(["*"]),u=this._createQuery();return u.where=(0,_.mA)(u.where,n),null!=e.spatialFilter&&(u.spatialRelationship=this._makeRelationshipEnum(e.spatialFilter.relation),u.relationParameter=this._makeRelationshipParam(e.spatialFilter.relation),u.geometry=e.spatialFilter.geometry),u.orderByFields=""!==t?t.split(","):null,u.outFields=o,u.returnGeometry=l,u.outSpatialReference=this.spatialReference,{ordered:r,filterApplied:!0,spatialFilterApplied:!0,features:this._queryPaginated(u,a,e.abortSignal)}}async*_queryPaginated(e,t,r){let i;e.num=t,e.start=0;do{(0,d.dZ)(r),i=await this.executeQuery(e,"execute"),yield i.features,e.start+=t}while(!0===i.exceededTransferLimit)}async _queryUsingIdSetTraversal(e){let t="",r=!1;null!=e.orderBy&&this._layer.capabilities&&this._layer.capabilities.query&&!0===this._layer.capabilities.query.supportsOrderBy&&(t=e.orderBy.constructClause(),r=!0);const i=await this.databaseType(),n=null==e.where?null==e.spatialFilter?"1=1":"":(0,y.YY)(e.where,i),a=this._createQuery();a.where=(0,_.mA)(a.where,n),null!=e.spatialFilter&&(a.spatialRelationship=this._makeRelationshipEnum(e.spatialFilter.relation),a.relationParameter=this._makeRelationshipParam(e.spatialFilter.relation),a.geometry=e.spatialFilter.geometry),a.orderByFields=""!==t?t.split(","):null,a.outSpatialReference=this.spatialReference;const s=await this.executeQuery(a,"executeForIds");if((0,d.dZ)(e.abortSignal),null==s||s.length<=0)return p.An;let l=this._maxQueryRate();const o=this._layer.capabilities?.query.maxRecordCount;null!=o&&o<l&&(l=o);const u=this._createQuery();return a.outFields=this._overrideFields??this._fieldsIncludingObjectId(["*"]),a.returnGeometry=!0!==this._removeGeometry,a.outSpatialReference=this.spatialReference,{ordered:r,filterApplied:!0,spatialFilterApplied:!0,features:this._traverseIdSet(u,s,l,e.abortSignal)}}async*_traverseIdSet(e,t,r,i){for(let n=0;n<t.length;n+=r){e.objectIds=t.slice(n,n+r),(0,d.dZ)(i);const a=await this.executeQuery(e,"execute");yield a.features}}async queryStat(e){await this._ensureLoaded();const t=this._layer.capabilities?.query,r=!!t?.supportsSqlExpression,i=!!t?.supportsStatistics,n=!!t?.supportsDistinct,a=(0,f.Dp)(e.stat);if("count"===a)return n?this._queryCount(e):{calculated:!1};const s=e.field;if(null==s)return{calculated:!1};if(!1===i||!1===(0,y.DA)(s)&&!1===r||!1===s.isStandardized)return null!=e.spatialFilter||null!=e.where?{calculated:!1}:this._manualStat(e.stat,s,e.limit??h.gO,e.abortSignal);if("distinct"===a)return!1===n?null!=e.spatialFilter||null!=e.where?{calculated:!1}:this._manualStat(a,s,e.limit??h.gO,e.abortSignal):{calculated:!1};const l=await this.databaseType();if(this.isTable()&&null!=e.spatialFilter)return{calculated:!0,result:null};const o=this._createQuery();o.where=(0,_.mA)(o.where,null==e.where?null==e.spatialFilter?"1=1":"":(0,y.YY)(e.where,l)),null!=e.spatialFilter&&(o.spatialRelationship=this._makeRelationshipEnum(e.spatialFilter.relation),o.relationParameter=this._makeRelationshipParam(e.spatialFilter.relation),o.geometry=e.spatialFilter.geometry);const u=new S.A;u.statisticType=a,u.onStatisticField=(0,y.YY)(s,l),u.outStatisticFieldName="ARCADE_STAT_RESULT",o.returnGeometry=!1;let c="ARCADE_STAT_RESULT";o.outStatistics=[u];const p=await this.executeQuery(o,"execute");if(!p.hasOwnProperty("features")||0===p.features.length)throw new d.dr("InvalidStatResponse");let m=!1;const g=p.fields??[];for(const e of g)if("ARCADE_STAT_RESULT"===e.name.toUpperCase()){c=e.name,"esriFieldTypeDate"===e.type&&(m=!0);break}const w=p.features[0].attributes[c];return{calculated:!0,result:m&&null!=w?new Date(w):w}}async _queryCount(e){const t=await this.databaseType();if(this.isTable()&&null!=e.spatialFilter)return{calculated:!0,result:0};const r=this._createQuery();return r.where=(0,_.mA)(r.where,null==e.where?null==e.spatialFilter?"1=1":"":(0,y.YY)(e.where,t)),null!=e.spatialFilter&&(r.spatialRelationship=this._makeRelationshipEnum(e.spatialFilter.relation),r.relationParameter=this._makeRelationshipParam(e.spatialFilter.relation),r.geometry=e.spatialFilter.geometry),r.returnGeometry=!1,{calculated:!0,result:await this.executeQuery(r,"executeForCount")}}async canQueryAggregate(e){await this._ensureLoaded();let t=!1;const r=this._layer.capabilities?.query,i=!0===r?.supportsSqlExpression;if(null!=r&&!0===r.supportsStatistics&&!0===r.supportsOrderBy&&(t=!0),t)for(const r of e.statistics)(!1===r.workingexpr?.isStandardized||!1===(0,y.DA)(r.workingexpr)&&!1===i)&&(t=!1);return t}async queryAggregate(e){if(await this._ensureLoaded(),this.isTable()&&null!=e.spatialFilter)return p.An;const t=await this.databaseType(),r=e.groupBy,i=e.orderBy;let n=null;if(!this._layer.capabilities.query.supportsPaginationOnAggregatedQueries){const e=this.getFieldsIndex();n={keyFields:r.map((t,r)=>({name:e.normalizeFieldName(t)??t,asc:null==i||1===i._directions[r]}))}}let a="",s=!1;null!=i&&!0===this._layer.capabilities?.query?.supportsOrderBy&&(null==n||(0,m.MJ)(r,0,r.length,i._fields,0,Math.min(i._fields.length,r.length),(e,t)=>e.toLowerCase()===t.toLowerCase()))&&(a=i.constructClause(),s=!0),""===a&&(a=r.join(","));const l=e.statistics.map(e=>new S.A({onStatisticField:null!==e.workingexpr?(0,y.YY)(e.workingexpr,t):"",outStatisticFieldName:e.field,statisticType:e.toStatisticsName()}));let o=this._maxQueryRate();const u=this._layer.capabilities?.query.maxRecordCount;null!=u&&u<o&&(o=u);const c=null==e.where?null==e.spatialFilter?"1=1":"":(0,y.YY)(e.where,t),d=this._createQuery();return d.where=(0,_.mA)(d.where,c),null!=e.spatialFilter&&(d.spatialRelationship=this._makeRelationshipEnum(e.spatialFilter.relation),d.relationParameter=this._makeRelationshipParam(e.spatialFilter.relation),d.geometry=e.spatialFilter.geometry),d.orderByFields=""!==a?a.split(","):null,d.outFields=["*"],d.outStatistics=l,d.groupByFieldsForStatistics=r,d.returnGeometry=!1,null==n?{filterApplied:!0,spatialFilterApplied:!0,ordered:s,features:this._queryPaginated(d,o,e.abortSignal)}:{filterApplied:!0,spatialFilterApplied:!0,ordered:s,features:this._queryKeysetPaginated(d,n,e.abortSignal)}}async*_queryKeysetPaginated(e,t,r){const i=e.where;for(;;){if(null!=t.clause){if(!this._layer.capabilities.query.supportsOrderBy)throw new d.dr("NotImplemented");e.where=(0,_.mA)(i,(0,y.YY)(t.clause,await this.databaseType()))}const n=await this.executeQuery(e,"execute");if((0,d.dZ)(r),!n.hasOwnProperty("features"))throw new d.dr("InvalidStatResponse");if(yield n.features,0===n.features.length||!0!==n.exceededTransferLimit)break;T(t,n.features.at(-1))}}_createQuery(){const e=this._layer.createQuery();return e.returnZ=this.hasZ,e.returnM=this.hasM,this.datesInUnknownTimezone&&(e.timeReferenceUnknownClient=!0),this._requestStandardised&&(e.sqlFormat="standard"),this._useDefinitionExpression?"subtype-group"===this._layer.type&&(e.where=this._layer.definitionExpression):e.where=null,e}executeQuery(e,t){const r="execute"===t?async e=>{const t=await this._layer.source.queryFeaturesJSON(e);return(0,p.Rn)(t.features,t.spatialReference??this.spatialReference.toJSON()),t}:"executeForCount"===t?this._layer.queryFeatureCount.bind(this._layer):this._layer.queryObjectIds.bind(this._layer);let i=null;if(this._recentlyUsedQueries){const t=this.convertQueryToLruCacheKey(e);i=this._recentlyUsedQueries.getFromCache(t),null===i&&(i=r(e),this._recentlyUsedQueries.addToCache(t,i),i=i.catch(e=>{throw this._recentlyUsedQueries?.removeFromCache(t),e}))}return this._featureSetQueryInterceptor&&this._featureSetQueryInterceptor.preLayerQueryCallback({layer:this._layer,query:e,method:t}),null===i&&(i=r(e)),i}_fieldsIncludingObjectId(e){if(null===e)return[this.objectIdField];const t=e.slice();if(t.includes("*"))return t;let r=!1;for(const e of t)if(e.toUpperCase()===this.objectIdField.toUpperCase()){r=!0;break}return r||t.push(this.objectIdField),t}isTable(){return this._layer.isTable||null===this._layer.geometryType||"table"===this._layer.type||""===this._layer.geometryType||"esriGeometryNull"===this._layer.geometryType}_makeRelationshipEnum(e){if(e.includes("esriSpatialRelRelation"))return"relation";switch(e){case"esriSpatialRelRelation":return"relation";case"esriSpatialRelIntersects":return"intersects";case"esriSpatialRelContains":return"contains";case"esriSpatialRelOverlaps":return"overlaps";case"esriSpatialRelWithin":return"within";case"esriSpatialRelTouches":return"touches";case"esriSpatialRelCrosses":return"crosses";case"esriSpatialRelEnvelopeIntersects":return"envelope-intersects"}return e}_makeRelationshipParam(e){return e.includes("esriSpatialRelRelation")?e.split(":")[1]:""}static create(e,t,r,i,n){const a=new b.default({url:e,outFields:null===t?["*"]:t});return new R({layer:a,spatialReference:r,lrucache:i,interceptor:n})}relationshipMetadata(){return this._layer&&this._layer.source&&this._layer.source.sourceJSON?.relationships?this._layer.source.sourceJSON.relationships:[]}serviceUrl(){return(0,h.Qi)(this._layer.parsedUrl.path)}async queryAttachments(e,t,r,i,n){const a=this._layer;if(!function(e){const t=e.capabilities;return t?.data.supportsAttachment&&t?.operations.supportsQueryAttachments}(a))return[];const s=new I.A({objectIds:[e],returnMetadata:n});(t&&t>0||r&&r>0)&&(s.size=[t&&t>0?t:0,r&&r>0?r:t+1]),i&&i.length>0&&(s.attachmentTypes=i),this._featureSetQueryInterceptor&&this._featureSetQueryInterceptor.preLayerQueryCallback({layer:a,query:s,method:"attachments"});const l=await a.queryAttachments(s);return l?.[e]?l[e].map(t=>{const r=`${this._layer.parsedUrl.path}/${e}/attachments/${t.id}`;let i=null;return n&&t.exifInfo&&(i=c.A.convertJsonToArcade(t.exifInfo,"system",!0)),new u.A(t.id,t.name,t.contentType,t.size,r,i,t.keywords??null)}):[]}async queryRelatedFeatures(e){const t=(0,F.dw)(e);t.f="json",this._requestStandardised&&(t.sqlFormat="standard"),this._featureSetQueryInterceptor&&this._featureSetQueryInterceptor.preRequestCallback({layer:this._layer,queryPayload:t,method:"relatedrecords",url:this._layer.parsedUrl.path+"/queryRelatedRecords"});const r=await(0,i.A)(this._layer.parsedUrl.path+"/queryRelatedRecords",{responseType:"json",query:t});if(r.data){const e={},t=r.data;if(t?.relatedRecordGroups){const r=t.spatialReference,i=!0===t.exceededTransferLimit;for(const n of t.relatedRecordGroups)(0,p.Rn)(n.relatedRecords,r),e[n.objectId]={features:n.relatedRecords,exceededTransferLimit:i}}return e}throw new d.dr("InvalidRequest")}async getFeatureByObjectId(e,t){const r=this._createQuery();r.outFields=t,r.returnGeometry=!1,r.outSpatialReference=this.spatialReference,r.where=(0,_.mA)(r.where,this.objectIdField+"="+e.toString()),this._featureSetQueryInterceptor&&this._featureSetQueryInterceptor.preLayerQueryCallback({layer:this._layer,query:r,method:"execute"});const i=await this._layer.source.queryFeaturesJSON(r);return 1===i.features.length?((0,p.Rn)(i.features,i.spatialReference??this.spatialReference.toJSON()),i.features[0]):null}async getIdentityUser(){await this.load();const e=l.id?.findCredential(this._layer.url);return e?e.userId:null}async getOwningSystemUrl(){await this.load();const e=l.id?.findServerInfo(this._layer.url);if(e)return e.owningSystemUrl??"";let t=this._layer.url;const r=t.toLowerCase().indexOf("/rest/services");if(t=r>-1?t.slice(0,r):t,t){t+="/rest/info";try{const e=await(0,i.A)(t,{query:{f:"json"}});let r="";return e.data?.owningSystemUrl&&(r=e.data.owningSystemUrl),r}catch{return""}}return""}getDataSourceFeatureSet(){const e=new R({layer:this._layer,spatialReference:this.spatialReference??void 0,outFields:this._overrideFields??void 0,includeGeometry:!this._removeGeometry,lrucache:this._recentlyUsedQueries??void 0,interceptor:this._featureSetQueryInterceptor??void 0});return e._useDefinitionExpression=!1,e}get preferredTimeZone(){return this._layer.preferredTimeZone??null}get dateFieldsTimeZone(){return this._layer.dateFieldsTimeZone??null}get datesInUnknownTimezone(){return this._layer.datesInUnknownTimezone??!1}get editFieldsInfo(){return this._layer.editFieldsInfo??null}get timeInfo(){return this._layer.timeInfo??null}async getFeatureSetInfo(){if(this._featureSetInfo)return this._featureSetInfo;let e=null,t="serviceItemId"in this._layer?this._layer.serviceItemId:null;const r=this._layer.parsedUrl?.path??null;if(r){const n=await(0,i.A)(r,{responseType:"json",query:{f:"json"}});e=n?.data?.name??null,t=n?.data?.serviceItemId??null}const n=this._layer.title&&null!==(this._layer.parent??null);return this._featureSetInfo={layerId:this._layer.layerId,layerName:""===e?null:e,itemId:""===t?null:t,serviceLayerUrl:""===r?null:r,webMapLayerId:n?this._layer.id??null:null,webMapLayerTitle:n?this._layer.title??null:null,className:null,objectClassId:null},this._featureSetInfo}}var A=r(30235),C=r(52006);class x extends p.Jn{constructor(e){super(),this.declaredClass="esri.arcade.featureset.sources.FeatureLayerOGC",this._outFields=null,this._returnGeometry=!0,this._layer=e.layer,e.spatialReference&&(this.spatialReference=e.spatialReference),null!=e.outFields&&(this._outFields=e.outFields),null!=e.includeGeometry&&(this._returnGeometry=e.includeGeometry)}_maxQueryRate(){return this._layer.effectiveMaxRecordCount}async loadImpl(){return this._layer.loaded?(this._initialiseFeatureSet(),this):(await this._layer.load(),this._initialiseFeatureSet(),this)}_initialiseFeatureSet(){if(this.spatialReference??=this._layer.spatialReference,this.geometryType=this._layer.geometryType??"",this.fields=this._layer.fields.slice(),null!=this._outFields)if(1===this._outFields.length&&"*"===this._outFields[0])this._outFields=null;else{const e=new Set(this._outFields.map(e=>e.toLowerCase()));this.fields=this.fields.filter(({name:t})=>t===this._layer.objectIdField||e.has(t.toLowerCase())),this._outFields=this.fields.map(({name:e})=>e)}this.objectIdField=this._layer.objectIdField,this.hasZ=!!this._layer.hasZ,this.hasM=!1,this.typeIdField=this._layer.typeIdField??"",this.types=this._layer.types??null;const e=this._layer.source.getSource().layerDefinition.featureCount;null!=e&&e>=0&&(this._totalCount=e)}isTable(){return this._layer.isTable}async _queryAll(){const e=this._layer.createQuery();return e.outSpatialReference=this.spatialReference,this._queryPaginated(e,this._layer.effectiveMaxRecordCount,o._)}async query(e){await this._ensureLoaded();const t=this._layer.createQuery();if(t.outSpatialReference=this.spatialReference,null!=e.spatialFilter&&!(0,C.Ed)(e.spatialFilter.geometry))switch(e.spatialFilter.relation){case"esriSpatialRelIntersects":case"esriSpatialRelContains":case"esriSpatialRelOverlaps":case"esriSpatialRelWithin":case"esriSpatialRelTouches":case"esriSpatialRelCrosses":t.geometry=e.spatialFilter.geometry.extent}return this._hasCachedFeatures||null==t.geometry?{filterApplied:null==e.where,spatialFilterApplied:null==e.spatialFilter,ordered:!1,features:await this.queryAll(e.abortSignal)}:{filterApplied:null==e.where,spatialFilterApplied:null==e.spatialFilter||"extent"===e.spatialFilter.geometry.type&&"esriSpatialRelIntersects"===e.spatialFilter.relation,ordered:!1,features:this._queryPaginated(t,this._layer.effectiveMaxRecordCount,e.abortSignal)}}async*_queryPaginated(e,t,r){let i;e.num=t,e.start=0;do{(0,d.dZ)(r),i=await this._layer.source.queryFeaturesJSON(e);const t=i.spatialReference??this.spatialReference.toJSON();yield i.features.map(e=>{const r={};for(const t of this.fields)r[t.name]=e.attributes[t.name];let i=null;return this._returnGeometry&&!this.isTable()&&null!=e.geometry&&(e.geometry.spatialReference=t,i=e.geometry),{geometry:i,attributes:r}}),e.start+=i.features.length}while(!0===i.exceededTransferLimit)}async queryStat(e){return{calculated:!1}}async canQueryAggregate(e){return!1}async queryAggregate(e){throw new d.dr("NeverReach")}nativeCapabilities(){return{title:this._layer.title??"",canQueryRelated:!1,source:this,capabilities:this._layer.capabilities,databaseType:this._databaseType,requestStandardised:!0}}async queryAttachments(){return[]}serviceUrl(){return""}relationshipMetadata(){return[]}get gdbVersion(){return""}getFeatureByObjectId(){throw new d.dr("NeverReach")}async getOwningSystemUrl(){return""}async getIdentityUser(){return""}get preferredTimeZone(){return null}get dateFieldsTimeZone(){return null}get datesInUnknownTimezone(){return!1}get editFieldsInfo(){return null}get timeInfo(){return this._layer.timeInfo}async getFeatureSetInfo(){const e=this._layer.title&&this._layer.parent;return{layerId:null,layerName:null,itemId:null,serviceLayerUrl:null,webMapLayerId:e?this._layer.id??null:null,webMapLayerTitle:e?this._layer.title??null:null,className:null,objectClassId:null}}}var M=r(26591);class L extends p.Jn{constructor(e){super(),this.declaredClass="esri.arcade.featureset.sources.FeatureLayerRelated",this._removeGeometry=!1,this._overrideFields=null,this._maxProcessing=1e3,this._layer=e.layer,e.spatialReference&&(this.spatialReference=e.spatialReference),this._findObjectId=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 h.gO}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(),this.hasZ=this._relatedLayer.hasZ,this.hasM=this._relatedLayer.hasM,null!==this._overrideFields)if(1===this._overrideFields.length&&"*"===this._overrideFields[0])this._overrideFields=null;else{const e=new Set(this._overrideFields.map(e=>e.toLowerCase()));this.fields=this.fields.filter(({type:t,name:r})=>"oid"===t||e.has(r.toLowerCase())),this._overrideFields=this.fields.map(({name:e})=>e)}const e=this._layer.nativeCapabilities();e&&(this._databaseType=e.databaseType),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,this.subtypeField=this._relatedLayer.subtypeField,this.subtypes=this._relatedLayer.subtypes}async databaseType(){return this._databaseType=await this._relatedLayer.databaseType(),this._databaseType}isTable(){return this._relatedLayer.isTable()}async _queryAll(){return(await this.query({abortSignal:o._})).features}async query(e){if(await this._ensureLoaded(),await this.databaseType(),this.isTable()&&null!=e.spatialFilter)return p.An;const t=this._layer.nativeCapabilities();if(!1===t.canQueryRelated)return p.An;if(t.capabilities?.queryRelated.supportsPagination)return this._queryUsingPaging(t.source,e);let r="",i=!1;null!=e.orderBy&&!0===t.capabilities?.queryRelated.supportsOrderBy&&(r=e.orderBy.constructClause(),i=!0);const n=new M.default;return n.objectIds=[this._findObjectId],n.outFields=null!==this._overrideFields?this._overrideFields:this._fieldsIncludingObjectId(this._relatedLayer.fields?this._relatedLayer.fields.map(e=>e.name):["*"]),n.relationshipId=this.relationship.id,n.where="1=1",n.returnGeometry=!0!==this._removeGeometry,n.outSpatialReference=this.spatialReference,n.orderByFields=""!==r?r.split(","):null,{filterApplied:null==e.where,spatialFilterApplied:null==e.spatialFilter,ordered:i,features:async function*(){const r=await t.source.queryRelatedFeatures(n);(0,d.dZ)(e.abortSignal),yield r[this._findObjectId]?r[this._findObjectId].features:[]}.apply(this)}}async _queryUsingPaging(e,t){let r="",i=!1;const n=this._layer.nativeCapabilities();null!=t.orderBy&&!0===n.capabilities?.queryRelated.supportsOrderBy&&(r=t.orderBy.constructClause(),i=!0),await this.databaseType();let a=this._maxQueryRate();const s=n.capabilities?.query.maxRecordCount;null!=s&&s<a&&(a=s);const l=new M.default;return l.relationshipId=this.relationship.id,l.objectIds=[this._findObjectId],l.outFields=null!==this._overrideFields?this._overrideFields:this._fieldsIncludingObjectId(this._relatedLayer.fields?this._relatedLayer.fields.map(e=>e.name):["*"]),l.where="1=1",l.orderByFields=""!==r?r.split(","):null,l.returnGeometry=!0!==this._removeGeometry,l.outSpatialReference=this.spatialReference,{filterApplied:null==t.where,spatialFilterApplied:null==t.spatialFilter,ordered:i,features:this._queryPaginated(e,l,a,t.abortSignal)}}async*_queryPaginated(e,t,r,i){let n;t.num=r,t.start=0;do{(0,d.dZ)(i),n=(await e.queryRelatedFeatures(t))[this._findObjectId]??{exceededTransferLimit:!1,features:[]},yield n.features,t.start+=r}while(!0===n.exceededTransferLimit)}async queryStat(e){return{calculated:!1}}async canQueryAggregate(e){return!1}async queryAggregate(e){throw new d.dr("NeverReach")}_fieldsIncludingObjectId(e){if(null===e)return[this.objectIdField];const t=e.slice();if(t.includes("*"))return t;let r=!1;for(const e of t)if(e.toUpperCase()===this.objectIdField.toUpperCase()){r=!0;break}return r||t.push(this.objectIdField),t}get gdbVersion(){return this._relatedLayer.gdbVersion}relationshipMetadata(){return this._relatedLayer.relationshipMetadata()}serviceUrl(){return this._relatedLayer.serviceUrl()}queryAttachments(e,t,r,i,n){return this._relatedLayer.queryAttachments(e,t,r,i,n)}getFeatureByObjectId(e,t){return this._relatedLayer.getFeatureByObjectId(e,t)}getOwningSystemUrl(){return this._relatedLayer.getOwningSystemUrl()}getIdentityUser(){return this._relatedLayer.getIdentityUser()}getDataSourceFeatureSet(){return this._relatedLayer}get preferredTimeZone(){return this._relatedLayer.preferredTimeZone??null}get dateFieldsTimeZone(){return this._relatedLayer.dateFieldsTimeZone??null}get datesInUnknownTimezone(){return this._relatedLayer.datesInUnknownTimezone}get editFieldsInfo(){return this._relatedLayer.editFieldsInfo??null}get timeInfo(){return this._relatedLayer.timeInfo??null}getFeatureSetInfo(){return this._relatedLayer.getFeatureSetInfo()}}var j=r(23732),O=r(92474),k=r(4146),q=r(80812);function E(){null===j.A.applicationCache&&(j.A.applicationCache=new j.A)}async function Z(e,t,r){if(j.A.applicationCache){const r=j.A.applicationCache.getLayerInfo(e);if(r){const i=await r;return new b.default({url:e,outFields:t,sourceJSON:i})}const i=new b.default({url:e,outFields:t}),n=(async()=>(await i.load(),i.sourceJSON))();if(j.A.applicationCache){j.A.applicationCache.setLayerInfo(e,n);try{return await n,i}catch(t){throw j.A.applicationCache.clearLayerInfo(e),t}}return await n,i}if(null!=r){const i=r.getCachedLayerMetadata(e);if(i){const r=await i;return new b.default({url:e,outFields:t,sourceJSON:r})}const n=new b.default({url:e,outFields:t}),a=(async()=>(await n.load(),n.sourceJSON))();r.setCachedLayerMetadata(e,a);try{return await a,n}catch(t){throw r.removeCachedLayerMetadata(e,a),t}}return new b.default({url:e,outFields:t})}async function N(e,t,r,i,n,a=null){return P(await Z(e,["*"],n),t,r,i,n,a)}function P(e,t=null,r=null,i=!0,n=null,a=null){switch(e.type){case"catalog-footprint":return P(e.parent,t,r,i,n,a);case"subtype-sublayer":{const l=P(e.parent,t,r,i,n,a);return new s.A({parentfeatureset:l,whereclause:w.A.create(e.parent.subtypeField+"="+e.subtypeCode.toString(),{fieldsIndex:e.parent.fieldsIndex,timeZone:l.dateFieldsTimeZoneDefaultUTC})})}case"csv":case"geojson":case"knowledge-graph-sublayer":case"wfs":return new A.A({layer:e,spatialReference:t,outFields:r,includeGeometry:i,lrucache:n,interceptor:a});case"catalog":case"feature":case"oriented-imagery":case"subtype-group":{const s={layer:e,spatialReference:t,outFields:r,includeGeometry:i,lrucache:n,interceptor:a};return!e.url&&e.source?new A.A(s):new R(s)}case"ogc-feature":return new x({layer:e,spatialReference:t,outFields:r,includeGeometry:i});default:throw new Error(`Unsupported layer type: ${e.type}`)}}async function D(e,t){if(null!==j.A.applicationCache){const t=j.A.applicationCache.getLayerInfo(e);if(null!==t)return t}if(null!=t){const r=t.getCachedServiceMetadata(e);if(null!=r)return r}const r=(async()=>{const t=await(0,i.A)(e,{responseType:"json",query:{f:"json"},authMode:"no-prompt"});if(t.data){const e=t.data;return e.layers||(e.layers=[]),e.tables||(e.tables=[]),e}return{layers:[],tables:[]}})();if(null!==j.A.applicationCache){j.A.applicationCache.setLayerInfo(e,r);try{return await r}catch(t){throw j.A.applicationCache.clearLayerInfo(e),t}}if(null!=t){t.setCachedServiceMetadata(e,r);try{return await r}catch(i){throw t.removeCachedServiceMetadata(e,r),i}}return r}async function U(e,t,r){const n={metadata:null,networkId:-1,unVersion:3,terminals:[],layerIdLookup:new Map,sourceIdLookup:new Map,queryelem:null,layerNameLkp:{},lkp:null},a=await D(e,null);if(n.metadata=a,void 0!==a.controllerDatasetLayers?.utilityNetworkLayerId&&null!==a.controllerDatasetLayers.utilityNetworkLayerId){if(a.layers)for(const e of a.layers)n.layerNameLkp[e.id]=e.name;if(a.tables)for(const e of a.tables)n.layerNameLkp[e.id]=e.name;const l=a.controllerDatasetLayers.utilityNetworkLayerId;n.networkId=l;const o=await async function(e,t){const r="QUERYDATAELEMTS:"+t.toString()+":"+e;if(null!==j.A.applicationCache){const e=j.A.applicationCache.getLayerInfo(r);if(null!==e)return e}const n=(async()=>{const r=await(0,i.A)(e+"/queryDataElements",{method:"post",responseType:"json",query:{layers:JSON.stringify([t.toString()]),f:"json"}});if(r.data){const e=r.data;if(e.layerDataElements?.[0])return e.layerDataElements[0]}throw new d.dr("DataElementsNotFound")})();if(null!==j.A.applicationCache){j.A.applicationCache.setLayerInfo(r,n);try{return await n}catch(e){throw j.A.applicationCache.clearLayerInfo(r),e}}return n}(e,l);if(o){n.queryelem=o,n.queryelem?.dataElement&&void 0!==n.queryelem.dataElement.schemaGeneration&&(n.unVersion=n.queryelem.dataElement.schemaGeneration),n.lkp={},n.queryelem.dataElement.domainNetworks||(n.queryelem.dataElement.domainNetworks=[]);for(const e of n.queryelem.dataElement.domainNetworks){for(const t of e.edgeSources??[]){const e={layerId:t.layerId,sourceId:t.sourceId,className:n.layerNameLkp[t.layerId]??null};n.layerIdLookup.set(e.layerId,e),n.sourceIdLookup.set(e.sourceId,e),e.className&&(n.lkp[e.className]=e)}for(const t of e.junctionSources??[]){const e={layerId:t.layerId,sourceId:t.sourceId,className:n.layerNameLkp[t.layerId]??null};n.layerIdLookup.set(e.layerId,e),n.sourceIdLookup.set(e.sourceId,e),e.className&&(n.lkp[e.className]=e)}}if(n.queryelem.dataElement.terminalConfigurations)for(const e of n.queryelem.dataElement.terminalConfigurations)for(const t of e.terminals)n.terminals.push({terminalId:t.terminalId,terminalName:t.terminalName});const a=await async function(e){if(null!==j.A.applicationCache){const t=j.A.applicationCache.getLayerInfo(e);if(null!==t)return t}const t=(async()=>{const t=await(0,i.A)(e,{responseType:"json",query:{f:"json"}});return t.data?t.data:null})();if(null!==j.A.applicationCache){j.A.applicationCache.setLayerInfo(e,t);try{return await t}catch(t){throw j.A.applicationCache.clearLayerInfo(e),t}}return t}(e+"/"+l);if(void 0!==a.systemLayers?.associationsTableId&&null!==a.systemLayers.associationsTableId){let i=null;if(r&&n.unVersion<8){const r=[];n.unVersion>=4&&(r.push("STATUS"),r.push("PERCENTALONG")),i=await N(e+"/"+a.systemLayers.associationsTableId,t,["OBJECTID","FROMNETWORKSOURCEID","TONETWORKSOURCEID","FROMGLOBALID","TOGLOBALID","TOTERMINALID","FROMTERMINALID","ASSOCIATIONTYPE","ISCONTENTVISIBLE","GLOBALID",...r],!1,null,null),await i.load(),n.unVersion>=4&&(i=new s.A({parentfeatureset:i,whereclause:w.A.create("STATUS NOT IN (1, 2, 3, 4, 5, 6, 7, 9, 10, 11, 12, 13, 14, 15, 17, 18, 19, 20, 21, 22, 23, 25, 26, 27, 28, 29, 30, 31, 33, 34, 35, 36, 37, 38, 39, 41, 42, 43, 44, 45, 46, 47, 49, 50, 51, 52, 53, 54, 55, 57, 58, 59, 60, 61, 62, 63)",{fieldsIndex:i.getFieldsIndex(),timeZone:i.dateFieldsTimeZoneDefaultUTC})}),await i.load())}return{lkp:n.lkp,associations:i,unVersion:n.unVersion,terminals:n.terminals,layerIdLookup:n.layerIdLookup,sourceIdLookup:n.sourceIdLookup}}return{associations:null,unVersion:n.unVersion,lkp:null,terminals:[],layerIdLookup:new Map,sourceIdLookup:new Map}}return{associations:null,unVersion:n.unVersion,lkp:null,terminals:[],layerIdLookup:new Map,sourceIdLookup:new Map}}return{associations:null,unVersion:n.unVersion,lkp:null,terminals:[],layerIdLookup:new Map,sourceIdLookup:new Map}}async function G(e,t,r,i=null,n=null,a=!0,s=null,l=null){let o=e.serviceUrl();if(!o)return null;o=o.endsWith("/")?o+t.relatedTableId.toString():o+"/"+t.relatedTableId.toString();const u=await N(o,i,n,a,s,l);return new L({layer:e,relatedLayer:u,relationship:t,objectId:r,spatialReference:i,outFields:n,includeGeometry:a,lrucache:s,interceptor:l})}class B extends n{constructor(e,t=null,r=null,i=null){super(),this._map=e,this._overrideSpatialReference=t,this._lrucache=r,this._interceptor=i,this._instantLayers=[]}_makeAndAddFeatureSet(e,t=!0,r=null){const i=P(e,this._overrideSpatialReference,null===r?["*"]:r,t,this._lrucache,this._interceptor);return this._instantLayers.push({featureset:i,opitem:e,includeGeometry:t,outFields:JSON.stringify(r)}),i}async featureSetByName(e,t=!0,r=null){if((0,O.Zm)(this._map)&&!this._map.loaded)return await this._map.load(),this.featureSetByName(e,t,r);null===r&&(r=["*"]),r=(r=r.slice()).sort();const i=JSON.stringify(r);for(let r=0;r<this._instantLayers.length;r++){const n=this._instantLayers[r];if(n.opitem.title===e&&n.includeGeometry===t&&n.outFields===i)return this._instantLayers[r].featureset}const n=this._map.allLayers.find(t=>(0,h.eB)(t)&&t.title===e);if(null!=n)return this._makeAndAddFeatureSet(n,t,r);if(this._map.allTables){const i=this._map.allTables.find(t=>(0,h.eB)(t)&&t.title===e);if(null!=i)return this._makeAndAddFeatureSet(i,t,r)}return null}async featureSetById(e,t=!0,r=["*"]){if((0,O.Zm)(this._map)&&!this._map.loaded)return await this._map.load(),this.featureSetById(e,t,r);null===r&&(r=["*"]),r=(r=r.slice()).sort();const i=JSON.stringify(r);for(let r=0;r<this._instantLayers.length;r++){const n=this._instantLayers[r];if(n.opitem.id===e&&n.includeGeometry===t&&n.outFields===i)return this._instantLayers[r].featureset}const n=this._map.allLayers.find(t=>(0,h.eB)(t)&&t.id===e);if(n)return this._makeAndAddFeatureSet(n,t,r);if(this._map.allTables){const i=this._map.allTables.find(t=>(0,h.eB)(t)&&t.id===e);if(null!=i)return this._makeAndAddFeatureSet(i,t,r)}return null}}class $ extends n{constructor(e,t=null,r=null,i=null){super(),this._url=e,this._overrideSpatialReference=t,this._lrucache=r,this._interceptor=i,this.metadata=null,this._instantLayers=[]}get url(){return this._url}_makeAndAddFeatureSet(e,t=!0,r=null){const i=P(e,this._overrideSpatialReference,null===r?["*"]:r,t,this._lrucache);return this._instantLayers.push({featureset:i,opitem:e,includeGeometry:t,outFields:JSON.stringify(r)}),i}async _loadMetaData(){const e=await D(this._url,this._lrucache);return this.metadata=e,e}load(){return this._loadMetaData()}clone(){return new $(this._url,this._overrideSpatialReference,this._lrucache,this._interceptor)}async featureSetByName(e,t=!0,r=null){null===r&&(r=["*"]),r=(r=r.slice()).sort();const i=JSON.stringify(r);for(let r=0;r<this._instantLayers.length;r++){const n=this._instantLayers[r];if(n.opitem.title===e&&n.includeGeometry===t&&n.outFields===i)return this._instantLayers[r].featureset}const n=await this._loadMetaData();let a=null;for(const t of n.layers??[])t.name===e&&(a=t);if(!a)for(const t of n.tables??[])t.name===e&&(a=t);if(a){const e=await Z(this._url+"/"+a.id,["*"],this._lrucache);return this._makeAndAddFeatureSet(e,t,r)}return null}async featureSetById(e,t=!0,r=["*"]){null===r&&(r=["*"]),r=(r=r.slice()).sort();const i=JSON.stringify(r);e=null!=e?e.toString():"";for(let r=0;r<this._instantLayers.length;r++){const n=this._instantLayers[r];if(n.opitem.id===e&&n.includeGeometry===t&&n.outFields===i)return this._instantLayers[r].featureset}const n=await this._loadMetaData();let a=null;for(const t of n.layers??[])null!==t.id&&void 0!==t.id&&t.id.toString()===e&&(a=t);if(!a)for(const t of n.tables??[])null!==t.id&&void 0!==t.id&&t.id.toString()===e&&(a=t);if(a){const e=await Z(this._url+"/"+a.id,["*"],this._lrucache);return this._makeAndAddFeatureSet(e,t,r)}return null}}function Q(e,t,r=null,i=null){return new B(e,t,r,i)}function z(e,t,r=null,i=null){return new $(e,t,r,i)}function J(e,t,r,i,n){if(null===e)return null;if((0,a.m)(e)){switch(t){case"datasource":return e.getDataSourceFeatureSet();case"parent":return e;case"root":return e.getRootFeatureSet()}return null}if(e instanceof k.A&&(0,h.NI)(e)){const a=e;switch(t){case"datasource":return P(a,n,"outFields"in a?a.outFields:null,!0,r,i).getDataSourceFeatureSet();case"parent":case"root":return P(a,n,"outFields"in a?a.outFields:null,!0,r,i)}return null}if((0,a.a1)(e)){switch(t){case"datasource":return P(e.parent,n,e.parent.outFields,!0,r,i).getDataSourceFeatureSet();case"parent":case"root":return P(e,n,e.parent.outFields,!0,r,i)}return null}return null}async function V(e,t,r,i,n,a,s,l=null){if(j.A.applicationCache){const o=j.A.applicationCache.getLayerInfo(e+":"+a.url);if(o)return K(await o,t,r,i,n,s,l)}if(null!=s){const o=s.getCachedPortalItem(a.url,e);if(null!=o)return await K(await o,t,r,i,n,s,l)}const o=new q.default({id:e,portal:a}).load();j.A.applicationCache?j.A.applicationCache.setLayerInfo(e+":"+a.url,o):null!=s&&s.setCachedPortalItem(a.url,e,o);try{return await K(await o,t,r,i,n,s,l)}catch(t){throw j.A.applicationCache&&j.A.applicationCache.clearLayerInfo(e+":"+a.url),null!=s&&s.removeCachedPortalItem(a.url,e,o),t}}async function K(e,t,r,i,n,a,s){let l;if("Feature Service"===e.type||"Map Service"===e.type)l=await Z((0,h.Qi)(e.url??"")+"/"+t,["*"],a);else{if(t)throw new Error(`layerId=${t} provided for ${e.type} item`);if(null!=a){const t=a.getCachedPortalItemLayer(e.portal.url,e.id);if(null!=t)l=await t;else{const t=k.A.fromPortalItem(e);a.setCachedPortalItemLayer(e.portal.url,e.id,t);try{l=await t}catch(r){throw a.removeCachedPortalItemLayer(e.portal.url,e.id,t),r}}}else l=await k.A.fromPortalItem(e)}return P(l,r,i,n,a,s)}},32730:(e,t,r)=>{r.d(t,{BI:()=>m,D3:()=>y,XJ:()=>f,lc:()=>h,mX:()=>_,rU:()=>g,tH:()=>v});var i=r(799);const n="__begin__",a="__end__",s=new RegExp(n,"ig"),l=new RegExp(a,"ig"),o=new RegExp("^"+n,"i"),u=new RegExp(a+"$","i"),c='"',d=c+" + ",p=" + "+c;function h(e){return e.replaceAll(new RegExp("\\[","g"),"{").replaceAll(new RegExp("\\]","g"),"}")}function y(e){return e.replaceAll(new RegExp("\\{","g"),"[").replaceAll(new RegExp("\\}","g"),"]")}function f(e){const t={expression:"",type:"none"};return e.labelExpressionInfo?e.labelExpressionInfo.value?(t.expression=e.labelExpressionInfo.value,t.type="conventional"):e.labelExpressionInfo.expression&&(t.expression=e.labelExpressionInfo.expression,t.type="arcade"):null!=e.labelExpression&&(t.expression=h(e.labelExpression),t.type="conventional"),t}function m(e){const t=f(e);if(!t)return null;switch(t.type){case"conventional":return _(t.expression);case"arcade":return t.expression}return null}function g(e){const t=f(e);if(!t)return null;switch(t.type){case"conventional":return function(e){const t=e?.match(w);return t?.[1].trim()||null}(t.expression);case"arcade":return v(t.expression)}return null}function _(e){let t;return e?(t=(0,i.HC)(e,e=>n+'$feature["'+e+'"]'+a),t=o.test(t)?t.replace(o,""):c+t,t=u.test(t)?t.replace(u,""):t+c,t=t.replaceAll(s,d).replaceAll(l,p)):t='""',t}const w=/^\s*\{([^}]+)\}\s*$/i,b=/^\s*(?:(?:\$feature\.(\w+))|(?:\$feature\[(["'])(.+)(\2)\]));?\s*$/i,F=/^\s*(?:(?:\$feature\.(\w+))|(?:\$feature\[(["'])(.+)(\2)\]));?\s*(?:DomainName\(\s*\$feature\s*,\s*(["'])(\1|\3)(\5)\s*\));?\s*$/i,I=/^\s*(?:DomainName\(\s*\$feature\s*,\s*(["'])(.+)(\1)\s*\));?\s*$/i;function v(e){if(!e)return null;let t=b.exec(e)||F.exec(e);return t?t[1]||t[3]:(t=I.exec(e),t?t[2]:null)}},32756:(e,t,r)=>{r.d(t,{Rr:()=>l,fY:()=>u,ne:()=>o});var i=r(31635),n=r(93637),a=r(91429),s=r(91880);function l(e,t,r){if(!e)return null;const i=e.find(e=>!!e.field);if(!i)return null;const n=new s.A;return n.read(i,r),[n]}const o={type:[s.A],json:{origins:{"web-scene":{write:!1,read:!1}},name:"layerDefinition.orderBy",read:{reader:l},write:{writer:function(e,t,r,i){const a=e.find(e=>!!e.field);a&&(0,n.sM)(r,[a.toJSON()],t)}}}},u=e=>{const t=e;let r=class extends t{constructor(){super(...arguments),this.orderBy=null}};return(0,i.Cg)([(0,a.MZ)(o)],r.prototype,"orderBy",void 0),r=(0,i.Cg)([(0,a.$K)("esri.layers.mixins.OrderedLayer")],r),r}},33143:(e,t,r)=>{r.d(t,{A:()=>d});var i=r(31635),n=r(69540),a=r(25482),s=r(91429),l=r(8631),o=r(29005),u=r(36005),c=r(43937);let d=class extends((0,n.OU)(a.o)){constructor(e){super(e),this.id=null,this.name=null,this.domains=null,this.templates=null}readDomains(e){const t={};for(const r of Object.keys(e))t[r]=(0,l.rS)(e[r]);return t}writeDomains(e,t){const r={};for(const t of Object.keys(e))e[t]&&(r[t]=e[t]?.toJSON());t.domains=r}};(0,i.Cg)([(0,s.MZ)({json:{write:!0}})],d.prototype,"id",void 0),(0,i.Cg)([(0,s.MZ)({json:{write:!0}})],d.prototype,"name",void 0),(0,i.Cg)([(0,s.MZ)({json:{write:!0}})],d.prototype,"domains",void 0),(0,i.Cg)([(0,u.w)("domains")],d.prototype,"readDomains",null),(0,i.Cg)([(0,c.K)("domains")],d.prototype,"writeDomains",null),(0,i.Cg)([(0,s.MZ)({type:[o.A],json:{write:!0}})],d.prototype,"templates",void 0),d=(0,i.Cg)([(0,s.$K)("esri.layers.support.FeatureType")],d)},35704:(e,t,r)=>{r.d(t,{A:()=>u});var i=r(48938),n=r(87449),a=r(11221),s=r(33325),l=r(80609),o=r(88368);class u extends a.t1{constructor(e){super(),this.declaredClass="esri.arcade.featureset.actions.AttributeFilter",this._maxProcessing=1e3,this._parent=e.parentfeatureset,e.whereclause instanceof o.A?(this._whereClause=e.whereclause,this._whereClauseFunction=null):(this._whereClauseFunction=e.whereclause,this._whereClause=null)}_initialiseFeatureSet(){this.fields=this._parent.fields.slice(),this.geometryType=this._parent.geometryType,this.objectIdField=this._parent.objectIdField,this.globalIdField=this._parent.globalIdField,this.spatialReference=this._parent.spatialReference,this.hasM=this._parent.hasM,this.hasZ=this._parent.hasZ,this.typeIdField=this._parent.typeIdField,this.types=this._parent.types,this.subtypeField=this._parent.subtypeField,this.subtypes=this._parent.subtypes}async _queryAll(){return(await this.query({abortSignal:i._})).features}async query(e){let t=e.where;null!==this._whereClauseFunction||(null!=t?null!==this._whereClause&&(t=(0,l.kg)(this._whereClause,t)):t=this._whereClause),await this._ensureLoaded();const r=await this._parent.query({...e,where:t});return(0,n.dZ)(e.abortSignal),r.filterApplied&&null==this._whereClauseFunction?r:{...r,features:this._applyFilter(r.features,e.abortSignal)}}async*_applyFilter(e,t){for await(const r of e)if((0,n.dZ)(t),null!=this._whereClause){const e=r.filter(e=>this._whereClause.testFeature(e));e.length>0&&(yield e)}else if(null!=this._whereClauseFunction){const e=[];for(const t of r)await this._whereClauseFunction(t)&&e.push(t);e.length>0&&(yield e)}else yield r}async queryStat(e){if(null!==this._whereClauseFunction)return null==e.where&&null==e.spatialFilter?this._manualStat(e.stat,e.field,e.limit??s.gO,e.abortSignal):{calculated:!1};let t=this._whereClause;null!=e.where&&null!==this._whereClause&&(t=(0,l.kg)(this._whereClause,e.where));const r=await this._parent.queryStat({...e,where:t});return r.calculated?r:null==e.where&&null==e.spatialFilter?this._manualStat(e.stat,e.field,e.limit??s.gO,e.abortSignal):{calculated:!1}}async canQueryAggregate(e){if(null!==this._whereClauseFunction)return!1;let t=e.where;return null!=t?null!==this._whereClause&&(t=(0,l.kg)(this._whereClause,t)):t=this._whereClause,this._parent.canQueryAggregate({...e,where:t})}async queryAggregate(e){let t=e.where;return null!=t?null!==this._whereClause&&(t=(0,l.kg)(this._whereClause,t)):t=this._whereClause,this._parent.queryAggregate({...e,where:t})}getFieldsIndex(){return this._parent.getFieldsIndex()}}},37352:(e,t,r)=>{r.d(t,{A:()=>o});var i,n=r(31635),a=r(7762),s=r(25482),l=r(91429);let o=i=class extends s.o{constructor(e){super(e),this.floorField=null,this.viewAllMode=!1,this.viewAllLevelIds=new a.A}clone(){return new i({floorField:this.floorField,viewAllMode:this.viewAllMode,viewAllLevelIds:this.viewAllLevelIds})}};(0,n.Cg)([(0,l.MZ)({type:String,json:{write:{isRequired:!0}}})],o.prototype,"floorField",void 0),(0,n.Cg)([(0,l.MZ)({json:{read:!1,write:!1}})],o.prototype,"viewAllMode",void 0),(0,n.Cg)([(0,l.MZ)({json:{read:!1,write:!1}})],o.prototype,"viewAllLevelIds",void 0),o=i=(0,n.Cg)([(0,l.$K)("esri.layers.support.LayerFloorInfo")],o)},37539:(e,t,r)=>{r.d(t,{pO:()=>f,jd:()=>p,Tp:()=>h,w5:()=>d});var i=r(34727),n=r(86211),a=r(73941),s=r(79258);Math.PI;const l=s.$O.radius,o=s.$O.eccentricitySquared,u={a1:l*o,a2:l*o*l*o,a3:l*o*o/2,a4:l*o*l*o*2.5,a5:l*o+l*o*o/2,a6:1-o};s.$O.radius,s.$O.flattening,s.Sw.radius,s.Sw.flattening,s.sH.radius,s.sH.flattening,s.sH.radius;var c=r(21325);const d={2:{5:f,7:null,9:null,10:f,1:v,6:null,8:null,0:null,3:g,11:_,2:f,4:C},5:{5:f,7:null,9:null,10:f,1:v,6:null,8:null,0:null,3:g,11:_,2:f,4:C},7:{5:null,7:f,9:null,10:f,1:null,6:I,8:null,0:null,3:null,11:null,2:null,4:null},9:{5:null,7:null,9:f,10:f,1:null,6:null,8:F,0:null,3:null,11:null,2:null,4:null},3:{5:m,7:null,9:null,10:m,1:function(e,t,r,i){const n=e[t]/k,a=O-2*Math.atan(Math.exp(-e[t+1]/k)),s=k+(e[t+2]??0),l=Math.cos(a)*s;r[i]=Math.cos(n)*l,r[i+1]=Math.sin(n)*l,r[i+2]=Math.sin(a)*s},6:null,8:null,0:null,3:f,11:function(e,t,r,i){m(e,t,r,i),_(r,i,r,i)},2:m,4:function(e,t,r,i){m(e,t,r,i),C(r,i,r,i)}},4:{5:x,7:null,9:null,10:x,1:function(e,t,r,i){x(e,t,r,i),v(r,i,r,i)},6:null,8:null,0:null,3:function(e,t,r,i){x(e,t,r,i),g(r,i,r,i)},11:function(e,t,r,i){x(e,t,r,i),_(r,i,r,i)},2:x,4:f},1:{5:A,7:null,9:null,10:A,1:f,6:null,8:null,0:null,3:function(e,t,r,i){A(e,t,r,i),g(r,i,r,i)},11:function(e,t,r,i){A(e,t,r,i),_(r,i,r,i)},2:A,4:function(e,t,r,i){A(e,t,r,i),C(r,i,r,i)}},6:{5:null,7:R,9:null,10:R,1:null,6:f,8:null,0:null,3:null,11:null,2:null,4:null},8:{5:null,7:null,9:T,10:T,1:null,6:null,8:f,0:null,3:null,11:null,2:null,4:null},0:{5:null,7:null,9:null,10:null,1:null,6:null,8:null,0:f,3:null,11:null,2:null,4:null},10:{5:f,7:f,9:f,10:f,1:v,6:I,8:F,0:null,3:g,11:_,2:f,4:C},11:{5:w,7:null,9:null,10:w,1:function(e,t,r,i){w(e,t,r,i),v(r,i,r,i)},6:null,8:null,0:null,3:function(e,t,r,i){w(e,t,r,i),g(r,i,r,i)},11:f,2:w,4:function(e,t,r,i){w(e,t,r,i),C(r,i,r,i)}}};function p(e,t){return h(e,t)?.projector}function h(e,t){if(null==e||null==t)return null;if(M.source.spatialReference===e&&M.dest.spatialReference===t)return M;const r=y(e,M.source),i=y(t,M.dest);return 0===r&&0===i?(0,c.aI)(e,t)?M.projector=f:M.projector=null:M.projector=d[r][i],M}function y(e,t){return e?t.spatialReference===e?t.spatialReferenceId:(t.spatialReference=e,"metersPerUnit"in t&&(t.metersPerUnit=(0,n.GA)(e,1)),(0,a.jA)(e)?t.spatialReferenceId=1:(0,c.oT)(e)?t.spatialReferenceId=2:(0,c.K8)(e)?t.spatialReferenceId=3:(0,c.r1)(e)?t.spatialReferenceId=11:e.wkt===a.Ro.wkt?t.spatialReferenceId=4:4490===e.wkid?t.spatialReferenceId=5:e.wkt===a.FY.wkt?t.spatialReferenceId=6:e.wkt===a.LJ.wkt?t.spatialReferenceId=8:(0,c.q8)(e)?t.spatialReferenceId=7:(0,c.KQ)(e)?t.spatialReferenceId=9:t.spatialReferenceId=0):0}function f(e,t,r,i){e!==r&&(r[i++]=e[t++],r[i++]=e[t++],r[i]=e[t]??0)}function m(e,t,r,i){r[i]=j*(e[t]/k),r[i+1]=j*(O-2*Math.atan(Math.exp(-e[t+1]/k))),r[i+2]=e[t+2]??0}function g(e,t,r,n){!function(e,t,r,n,a){const s=.4999999*Math.PI,l=(0,i.qE)(L*e[t+1],-s,s),o=Math.sin(l);r[n++]=L*e[t]*a.radius,r[n++]=a.halfSemiMajorAxis*Math.log((1+o)/(1-o)),r[n]=e[t+2]??0}(e,t,r,n,s.$O)}function _(e,t,r,i){r[i]=e[t]*q,r[i+1]=e[t+1]*q,r[i+2]=e[t+2]??0}function w(e,t,r,i){r[i]=e[t]*E,r[i+1]=e[t+1]*E,r[i+2]=e[t+2]??0}function b(e,t,r,i,n){const a=n+(e[t+2]??0),s=L*e[t],l=L*e[t+1],o=Math.cos(l)*a;r[i]=Math.cos(s)*o,r[i+1]=Math.sin(s)*o,r[i+2]=Math.sin(l)*a}function F(e,t,r,i){b(e,t,r,i,s.Sw.radius)}function I(e,t,r,i){b(e,t,r,i,s.sH.radius)}function v(e,t,r,i){b(e,t,r,i,s.$O.radius)}function S(e,t,r,n,a){const s=e[t],l=e[t+1],o=e[t+2]??0,u=Math.sqrt(s*s+l*l+o*o),c=(0,i.YN)(o/(0===u?1:u)),d=Math.atan2(l,s);r[n++]=j*d,r[n++]=j*c,r[n]=u-a}function T(e,t,r,i){S(e,t,r,i,s.Sw.radius)}function R(e,t,r,i){S(e,t,r,i,s.sH.radius)}function A(e,t,r,i){S(e,t,r,i,s.$O.radius)}function C(e,t,r,i){!function(e,t,r,i,n){const a=L*e[t],s=L*e[t+1],l=e[t+2]??0,o=Math.sin(s),u=Math.cos(s),c=n.radius/Math.sqrt(1-n.eccentricitySquared*o*o);r[i++]=(c+l)*u*Math.cos(a),r[i++]=(c+l)*u*Math.sin(a),r[i++]=(c*(1-n.eccentricitySquared)+l)*o}(e,t,r,i,s.$O)}function x(e,t,r,i){const n=u,a=e[t],l=e[t+1],o=e[t+2]??0;let c,d,p,h,y,f,m,g,_,w,b,F,I,v,S,T,R,A,C,x,M;c=Math.abs(o),d=a*a+l*l,p=Math.sqrt(d),h=d+o*o,y=Math.sqrt(h),x=Math.atan2(l,a),f=o*o/h,m=d/h,v=n.a2/y,S=n.a3-n.a4/y,m>.3?(g=c/y*(1+m*(n.a1+v+f*S)/y),C=Math.asin(g),w=g*g,_=Math.sqrt(1-w)):(_=p/y*(1-f*(n.a5-v-m*S)/y),C=Math.acos(_),w=1-_*_,g=Math.sqrt(w)),b=1-s.$O.eccentricitySquared*w,F=s.$O.radius/Math.sqrt(b),I=n.a6*F,v=p-F*_,S=c-I*g,R=_*v+g*S,T=_*S-g*v,A=T/(I/b+R),C+=A,M=R+T*A/2,o<0&&(C=-C),r[i++]=j*x,r[i++]=j*C,r[i]=M}const M={source:{spatialReference:null,spatialReferenceId:0,metersPerUnit:1},dest:{spatialReference:null,spatialReferenceId:0,metersPerUnit:1},projector:f},L=(0,i.kU)(1),j=(0,i.KJ)(1),O=.5*Math.PI,k=s.$O.radius,q=k*Math.PI/180,E=180/(k*Math.PI)},41366:(e,t,r)=>{r.d(t,{K:()=>d,Q:()=>o});var i=r(31635),n=r(66552),a=r(53966),s=r(91429),l=r(93223);const o=(0,n.O)()({naturalLog:"natural-log",squareRoot:"square-root",percentOfTotal:"percent-of-total",log:"log",field:"field"}),u="percent-of-total",c="field",d=e=>{const t=e;let r=class extends t{constructor(){super(...arguments),this.normalizationField=null,this.normalizationMaxValue=null,this.normalizationMinValue=null,this.normalizationTotal=null}get normalizationType(){let e=this._get("normalizationType");const t=!!this.normalizationField,r=null!=this.normalizationTotal;return t||r?(e=t&&c||r&&u||null,t&&r&&a.A.getLogger(this).warn("warning: both normalizationField and normalizationTotal are set!")):e!==c&&e!==u||(e=null),e}set normalizationType(e){this._set("normalizationType",e)}};return(0,i.Cg)([(0,s.MZ)({type:String,json:{name:"parameters.normalizationField",write:!0}})],r.prototype,"normalizationField",void 0),(0,i.Cg)([(0,s.MZ)({type:Number,json:{name:"parameters.normalizationMaxValue",write:!0}})],r.prototype,"normalizationMaxValue",void 0),(0,i.Cg)([(0,s.MZ)({type:Number,json:{name:"parameters.normalizationMinValue",write:!0}})],r.prototype,"normalizationMinValue",void 0),(0,i.Cg)([(0,s.MZ)({type:Number,json:{name:"parameters.normalizationTotal",write:!0}})],r.prototype,"normalizationTotal",void 0),(0,i.Cg)([(0,l.e)(o,{name:"parameters.normalizationType"})],r.prototype,"normalizationType",null),r=(0,i.Cg)([(0,s.$K)("esri.rest.support.NormalizationBinParametersMixin")],r),r}},41560:(e,t,r)=>{r.d(t,{Ch:()=>s,mW:()=>a});var i=r(34727),n=r(39516);function a(e,t){return{...t,filterMode:e.mode}}function s(e,t,r){const a=function(e){if("manual"===u(e))return null;const t=[Number.NEGATIVE_INFINITY,Number.POSITIVE_INFINITY];for(const{minScale:r,maxScale:i}of e.filters)t[0]=Math.max(t[0],c(r)),t[1]=Math.min(t[1],d(i));return t}(e);if(a&&((0,i.gg)(t,a[0])||(0,i.ZH)(r,a[1])))return"";const s=Array.from(l(e,t,r)),o=function(e,t,r){if(0===e.length)return!0;const n=c(e.at(0)?.minScale),a=d(e.at(-1)?.maxScale);if((0,i.ZH)(n,t)||(0,i.gg)(a,r))return!0;for(let t=0;t<e.length-1;t++){const r=e[t],n=e[t+1];if((0,i.ZH)(c(n.minScale),d(r.maxScale)))return!0}return!1}(s,t,r)?"1=1":s.map(e=>e.where||"1=1").reduce((e,t)=>(0,n.IW)(e,t),"");return o&&"1=1"!==o?o:""}function*l(e,t,r){if("manual"===u(e)){const t=e.filters.find(t=>t.id===e.activeFilterId);t&&(yield t)}else{"object"==typeof t&&(t=t.scale);for(const i of e.filters)o(i.minScale,i.maxScale,t,r)&&(yield i)}}function o(e,t,r,n){return e=c(e),r=c(r),t=d(t),!(!(0,i.Sp)(r,e)&&(n??r)>e||(0,i.Hx)(t,r)||void 0!==n&&(0,i.Sp)(n,e))}function u(e){return"mode"in e?e.mode:e.filterMode}function c(e){return e||Number.POSITIVE_INFINITY}function d(e){return e||0}},45067:(e,t,r)=>{r.d(t,{A:()=>c});var i=r(31635),n=r(69540),a=r(66552),s=r(25482),l=r(91429);const o=new a.J({esriRelCardinalityOneToOne:"one-to-one",esriRelCardinalityOneToMany:"one-to-many",esriRelCardinalityManyToMany:"many-to-many"}),u=new a.J({esriRelRoleOrigin:"origin",esriRelRoleDestination:"destination"});let c=class extends((0,n.OU)(s.o)){constructor(e){super(e),this.cardinality=null,this.catalogId=null,this.composite=null,this.id=null,this.keyField=null,this.keyFieldInRelationshipTable=null,this.name=null,this.relatedTableId=null,this.relationshipTableId=null,this.role=null}};(0,i.Cg)([(0,l.MZ)({json:{read:o.read,write:o.write}})],c.prototype,"cardinality",void 0),(0,i.Cg)([(0,l.MZ)({json:{name:"catalogID"}})],c.prototype,"catalogId",void 0),(0,i.Cg)([(0,l.MZ)({json:{read:!0,write:!0}})],c.prototype,"composite",void 0),(0,i.Cg)([(0,l.MZ)({json:{read:!0,write:!0}})],c.prototype,"id",void 0),(0,i.Cg)([(0,l.MZ)({json:{read:!0,write:!0}})],c.prototype,"keyField",void 0),(0,i.Cg)([(0,l.MZ)({json:{read:!0,write:!0}})],c.prototype,"keyFieldInRelationshipTable",void 0),(0,i.Cg)([(0,l.MZ)({json:{read:!0,write:!0}})],c.prototype,"name",void 0),(0,i.Cg)([(0,l.MZ)({json:{read:!0,write:!0}})],c.prototype,"relatedTableId",void 0),(0,i.Cg)([(0,l.MZ)({json:{read:!0,write:!0}})],c.prototype,"relationshipTableId",void 0),(0,i.Cg)([(0,l.MZ)({json:{read:u.read,write:u.write}})],c.prototype,"role",void 0),c=(0,i.Cg)([(0,l.$K)("esri.layers.support.Relationship")],c)},46140:(e,t,r)=>{r.d(t,{R:()=>n});var i=r(49186);let n=class e{constructor(e,t,r=""){this.major=e,this.minor=t,this._context=r}lessThan(e,t){return this.major<e||e===this.major&&this.minor<t}greaterEqual(e,t){return!this.lessThan(e,t)}validate(e){if(this.major!==e.major){const t=this._context&&this._context+":",r=this._context&&this._context+" ";throw new i.A(t+"unsupported-version",`Required major ${r}version is '${this.major}', but got '\${version.major}.\${version.minor}'`,{version:e})}}clone(){return new e(this.major,this.minor,this._context)}static parse(t,r=""){const[n,a]=t.split("."),s=/^\s*\d+\s*$/;if(!n?.match||!s.test(n))throw new i.A((r&&r+":")+"invalid-version","Expected major version to be a number, but got '${version}'",{version:t});if(!a?.match||!s.test(a))throw new i.A((r&&r+":")+"invalid-version","Expected minor version to be a number, but got '${version}'",{version:t});const l=parseInt(n,10),o=parseInt(a,10);return new e(l,o,r)}}},52136:(e,t,r)=>{r.d(t,{p:()=>a});var i=r(31635),n=r(91429);const a=e=>{const t=e;let r=class extends t{get apiKey(){return this._isOverridden("apiKey")?this._get("apiKey"):"portalItem"in this?this.portalItem?.apiKey:null}set apiKey(e){null!=e?this._override("apiKey",e):(this._clearOverride("apiKey"),this.clear("apiKey","user"))}};return(0,i.Cg)([(0,n.MZ)({type:String})],r.prototype,"apiKey",null),r=(0,i.Cg)([(0,n.$K)("esri.layers.mixins.APIKeyMixin")],r),r}},55674:(e,t,r)=>{r.d(t,{Ad:()=>h,Gj:()=>m,QY:()=>p,lL:()=>g,xR:()=>y});var i=r(66131),n=r(49186),a=(r(44208),r(44729)),s=r(15032),l=r(65864),o=r(95466),u=r(43668),c=r(98623);const d=["geometry","scale","timeProperties"];function p(e,t){if(null!=t)for(const r of d)t.hasArcadeDependency(r)&&e.add(r);return e}function h(e,t){return f.create(e,t,null,["$feature","$view"])}function y(e,t,r){return f.create(e,t,r,["$feature","$view","$config"])}class f{static async create(e,t,r,i){const{arcade:a,Dictionary:s}=await(0,u.l)();let l;try{l=a.parseScript(e)}catch(t){throw new n.A("arcade-bad-expression","Failed to parse arcade script",{script:e,error:t})}const o=a.scriptUsesGeometryEngine(l);o&&await a.enableGeometrySupport(),await a.loadDependentModules(new Set,l,null,!1,o);const c={vars:i.reduce((e,t)=>({...e,[t]:null}),{}),spatialReference:t,useAsync:!1},d=a.compileScript(l,c);let p=null;null!=r&&(p=new s(r),p.immutable=!0);const h=new s;return h.immutable=!1,h.setField("scale",0),new f(e,a,l,d,t,h,p,s)}constructor(e,t,r,i,n,a,s,l){this.script=e,this._arcade=t,this._syntaxTree=r,this._compiled=i,this._spatialReference=n,this._viewDict=a,this._configDict=s,this._dictionaryCtor=l,this._dependencies=new Map,this._featureReader=new m,this._dependencies.set("geometry",t.scriptTouchesGeometry(this._syntaxTree)),this._dependencies.set("scale",this._arcade.referencesMember(this._syntaxTree,"scale")),this._dependencies.set("timeProperties",this._arcade.scriptUsesViewProperties(this._syntaxTree,["timeProperties"]))}evaluate(e,t){const r=t.$view?.timeZone;if(t.$view){let e;if(this._viewDict.setField("scale",t.$view.scale),null!=t.$view.timeProperties){const{currentStart:n,currentEnd:a}=t.$view.timeProperties;e=new this._dictionaryCtor({currentStart:null!=n?null!=r?i.lY.epochToArcadeDate(n,r):i.lY.unknownEpochToArcadeDate(n):void 0,currentEnd:null!=a?null!=r?i.lY.epochToArcadeDate(a,r):i.lY.unknownEpochToArcadeDate(a):void 0,startIncluded:!0,endIncluded:!0})}this._viewDict.setField("timeProperties",e)}return this._compiled({vars:{$view:this._viewDict,$config:this._configDict,$feature:e},spatialReference:this._spatialReference,timeZone:r})}repurposeFeature(e,t){return this._featureReader.bind(e,t,this._spatialReference),this._featureReader}references(e){return this._dependencies.get(e)??!1}}class m{constructor(){this._boundTarget=null,this._boundSchema={fields:null,fieldsIndex:null,spatialReference:null,get geometryType(){return null},get objectIdField(){return null}},this.arcadeDeclaredClass="esri.arcade.Feature",this._contextTimeZone=null}bind(e,t,r){const i=t??new o.A(g(e.attributes));this._boundTarget=e,this._boundSchema.fields=i.fields,this._boundSchema.fieldsIndex=i,this._boundSchema.spatialReference=r}_getField(e){return this._boundSchema.fieldsIndex.get(e)}get contextTimeZone(){return this._contextTimeZone}set contextTimeZone(e){this._contextTimeZone=e}readArcadeFeature(){return this}hasField(e){return this._boundSchema.fieldsIndex.has(e)}geometry(){if("fromJSON"in this._boundTarget)return this._boundTarget.geometry;const e=(0,l.rS)(this._boundTarget.geometry);if(e){if(!this._boundSchema.spatialReference)throw new Error("InternalError: Expected spatial reference to be defined");e.spatialReference=this._boundSchema.spatialReference}return e}_hasGeometry(){return null!=this._boundTarget.geometry}isUnknownDateTimeField(e){return this._boundSchema.fieldsIndex.getTimeZone(e)===c.L5}field(e,t=!0){const r=this._getField(e);if(r){const t=this._boundTarget.attributes[r.name];if(null==t)return null;switch(r.type){case"date-only":case"esriFieldTypeDateOnly":return a.n.fromReader(t);case"time-only":case"esriFieldTypeTimeOnly":return s.k.fromReader(t);case"esriFieldTypeTimestampOffset":case"timestamp-offset":return i.lY.fromReaderAsTimeStampOffset(t);case"date":case"esriFieldTypeDate":return this.isUnknownDateTimeField(e)?i.lY.unknownEpochToArcadeDate(t):i.lY.epochToArcadeDate(t,this.contextTimeZone??c.qU);default:return t}}if(t)throw new Error(`Field ${e} does not exist`);return null}setField(e,t){throw new Error("Unable to update feature attribute values, feature is readonly")}keys(){return this._boundSchema.fieldsIndex.fields.map(e=>e.name)}isEmpty(){return this._boundSchema.fields.length<=0&&!this._hasGeometry()}castToText(e=!1){return JSON.stringify(this._boundTarget)}gdbVersion(){return null}fullSchema(){return this._boundSchema}castAsJson(e=null){return{attributes:this._boundTarget.attributes,geometry:!0===e?.keepGeometryType?this.geometry():this.geometry()?.toJSON()??null}}castAsJsonAsync(e=null,t=null){return Promise.resolve(this.castAsJson(t))}}function g(e){const t=[];for(const r in e)t.push({name:r,alias:r,type:"string"==typeof e[r]?"esriFieldTypeString":"esriFieldTypeDouble"});return t}},58501:(e,t,r)=>{r.d(t,{q:()=>n});var i=r(62815);function n(e,t,r){if(!r?.features||!r.hasZ)return;const n=(0,i.N)(r.geometryType,t,e.outSpatialReference);if(n)for(const e of r.features)n(e.geometry)}},62815:(e,t,r)=>{r.d(t,{N:()=>s});var i=r(86211),n=r(73941),a=r(21325);function s(e,t,r){if(null==t||null==r||r.vcsWkid||(0,a.aI)(t,r)||(0,n.xP)(t)||(0,n.xP)(r))return null;const s=(0,i.G9)(t)/(0,i.G9)(r);if(1===s)return null;switch(e){case"point":case"esriGeometryPoint":return e=>function(e,t){null!=e?.z&&(e.z*=t)}(e,s);case"polyline":case"esriGeometryPolyline":return e=>function(e,t){if(e)for(const r of e.paths)for(const e of r)e.length>2&&(e[2]*=t)}(e,s);case"polygon":case"esriGeometryPolygon":return e=>function(e,t){if(e)for(const r of e.rings)for(const e of r)e.length>2&&(e[2]*=t)}(e,s);case"multipoint":case"esriGeometryMultipoint":return e=>function(e,t){if(e)for(const r of e.points)r.length>2&&(r[2]*=t)}(e,s);case"extent":case"esriGeometryEnvelope":return e=>function(e,t){e&&null!=e.zmin&&null!=e.zmax&&(e.zmin*=t,e.zmax*=t)}(e,s);default:return null}}},73681:(e,t,r)=>{r.d(t,{n:()=>o});var i=r(49186),n=r(53966),a=r(46140),s=r(95466),l=r(55674);class o{static async from(e,t,r){const s=e.dictionary_version?a.R.parse(e.dictionary_version):null,c=new Set(e.itemsNames),d={};if(t)for(const e in t)d[e]=t[e];if(e.authoringInfo.configuration)for(const t of e.authoringInfo.configuration)d.hasOwnProperty(t.name)||(d[t.name]=t.value);const p=new Set(e.authoringInfo.symbol);for(const e of Object.keys(r))p.delete(e);p.size&&n.A.getLogger("esri.renderers.support.DictionaryScriptEvaluator").warnOnce("missing-fields: fieldMap entries for the following symbol fields are missing",{symbolFields:p});const h=await(0,l.xR)(e.expression,null,d);if(!h)throw new i.A("dictionary-renderer:expression-error","Unable to create dictionary renderer expression");const y=!s||!s.greaterEqual(4,0);y&&n.A.getLogger("esri.renderers.support.DictionaryScriptEvaluator").warnOnce("Dictionary script does not support native field types. Applying fallback",{version:s});const f=new u(r,y);return new o(y,c,h,f)}constructor(e,t,r,i){this._requiresFieldCoercionToString=e,this._itemNames=t,this._compiled=r,this._reader=i}get itemNames(){return this._itemNames}evaluate(e,t,r,i){try{return this._reader.bind(e,r,i),this._compiled.evaluate(this._reader,{$view:{scale:t}})}catch(e){n.A.getLogger("esri.renderers.support.DictionaryScriptEvaluator").warnOnce("arcade: dictionary script evaluation failed",{error:e})}return null}createDictionaryFieldsIndex(e){if(!this._requiresFieldCoercionToString)return new s.A(e);const t=e.map(e=>({...e,type:"esriFieldTypeString"}));return new s.A(t)}}class u extends l.Gj{constructor(e,t){super(),this._fieldMap=e,this._requiresFieldCoercionToString=t}_getField(e){const t=this._fieldMap[e]??e;return this._boundSchema.fieldsIndex.get(t)}field(e){if(!this._requiresFieldCoercionToString)return super.field(e,!1);const t=this._getField(e);return null==t||null==this._boundTarget.attributes[t.name]?"":""+this._boundTarget.attributes[t.name]}}},77548:(e,t,r)=>{r.d(t,{Gh:()=>g,tk:()=>h,BR:()=>p,wI:()=>d,G$:()=>f,$x:()=>y,Ov:()=>o,UC:()=>a,W_:()=>u,OP:()=>m,TU:()=>l,XX:()=>s,jy:()=>c});var i=r(70333),n=r(11254);function a(e){return null!=e&&"object"==typeof e&&"type"in e&&"knowledge-graph-sublayer"===e.type}r(7762),r(84952),r(36563),r(36708),r(4146),new WeakMap,r(16215);const s={Point:"SceneLayer","3DObject":"SceneLayer",IntegratedMesh:"IntegratedMeshLayer",PointCloud:"PointCloudLayer",Building:"BuildingSceneLayer"};function l(e){const t=e?.type;return"building-scene"===t||"integrated-mesh"===t||"point-cloud"===t||"scene"===t}function o(e){return"feature"===e?.type&&!e.url&&"memory"===e.source?.type}function u(e){const t=e?.type;return("feature"===t||"subtype-group"===t||"oriented-imagery"===t)&&"feature-layer"===e?.source?.type}function c(e){return function(e){return null!=e&&"object"==typeof e&&"type"in e&&"feature"===e.type}(e)&&function(e){return"feature"===e?.type&&"feature-layer"===e.source?.type}(e)}async function d(e,t){const r=i.id?.findServerInfo(e);if(null!=r?.currentVersion)return r.owningSystemUrl||null;const a=e.toLowerCase().indexOf("/rest/services");if(-1===a)return null;const s=`${e.slice(0,a)}/rest/info`,l=null!=t?t.signal:null,{data:o}=await(0,n.A)(s,{query:{f:"json"},responseType:"json",signal:l});return o?.owningSystemUrl||null}function p(e){return function(e){if(!("capabilities"in e))return!1;switch(e.type){case"catalog":case"catalog-footprint":case"csv":case"feature":case"geojson":case"imagery":case"knowledge-graph-sublayer":case"ogc-feature":case"oriented-imagery":case"scene":case"sublayer":case"subtype-group":case"subtype-sublayer":case"wfs":return!0;default:return!1}}(e)?"effectiveCapabilities"in e?e.effectiveCapabilities:e.capabilities:null}function h(e){return!!function(e){if(!("editingEnabled"in e))return!1;switch(e.type){case"csv":case"feature":case"geojson":case"oriented-imagery":case"scene":case"subtype-group":case"subtype-sublayer":case"knowledge-graph-sublayer":return!0;default:return!1}}(e)&&("effectiveEditingEnabled"in e?e.effectiveEditingEnabled:e.editingEnabled)}function y(e,t){return null}function f(e){return null}function m(e){return!e||"Feature Service"===e.type&&!e.sourceUrl}function g(e,t){if(!t||!m(e))return;const r=(e.url,null);r&&(e.url=r)}},79677:(e,t,r)=>{r.d(t,{A:()=>d});var i,n=r(31635),a=r(25482),s=r(88930),l=r(91429),o=r(98623),u=r(36005),c=r(43937);let d=class extends a.o{static{i=this}static get allTime(){return p}static get empty(){return h}static fromArray(e){return new i({start:null!=e[0]?new Date(e[0]):e[0],end:null!=e[1]?new Date(e[1]):e[1]})}constructor(e){super(e),this.end=null,this.start=null}readEnd(e,t){return null!=t.end?new Date(t.end):null}writeEnd(e,t){t.end=e?.getTime()??null}get isAllTime(){return this.equals(i.allTime)}get isEmpty(){return this.equals(i.empty)}readStart(e,t){return null!=t.start?new Date(t.start):null}writeStart(e,t){t.start=e?.getTime()??null}clone(){return new i({end:this.end,start:this.start})}equals(e){if(!e)return!1;const t=this.start?.getTime()??this.start,r=this.end?.getTime()??this.end,i=e.start?.getTime()??e.start,n=e.end?.getTime()??e.end;return t===i&&r===n}expandTo(e,t=o.qU){if(this.isEmpty||this.isAllTime)return this.clone();let r=this.start;r&&(r=(0,s.lL)(r,e,t));let n=this.end;if(n){const r=(0,s.lL)(n,e,t);n=n.getTime()===r.getTime()?r:(0,s.S1)(r,1,e,t)}return new i({start:r,end:n})}intersection(e){if(!e)return this.clone();if(this.isEmpty||e.isEmpty)return i.empty;if(this.isAllTime)return e.clone();if(e.isAllTime)return this.clone();const t=this.start?.getTime()??-1/0,r=this.end?.getTime()??1/0,n=e.start?.getTime()??-1/0,a=e.end?.getTime()??1/0;let s,l;return n>=t&&n<=r?s=n:t>=n&&t<=a&&(s=t),r>=n&&r<=a?l=r:a>=t&&a<=r&&(l=a),null==s||null==l||isNaN(s)||isNaN(l)?i.empty:new i({start:s===-1/0?null:new Date(s),end:l===1/0?null:new Date(l)})}offset(e,t,r=o.qU){if(this.isEmpty||this.isAllTime)return this.clone();const n=new i,{start:a,end:l}=this;return null!=a&&(n.start=(0,s.S1)(a,e,t,r)),null!=l&&(n.end=(0,s.S1)(l,e,t,r)),n}toArray(){return this.isEmpty?[void 0,void 0]:[this.start?.getTime()??null,this.end?.getTime()??null]}union(e){if(!e||e.isEmpty)return this.clone();if(this.isEmpty)return e.clone();if(this.isAllTime||e.isAllTime)return p.clone();const t=null!=this.start&&null!=e.start?new Date(Math.min(this.start.getTime(),e.start.getTime())):null,r=null!=this.end&&null!=e.end?new Date(Math.max(this.end.getTime(),e.end.getTime())):null;return new i({start:t,end:r})}};(0,n.Cg)([(0,l.MZ)({type:Date,json:{write:{allowNull:!0}}})],d.prototype,"end",void 0),(0,n.Cg)([(0,u.w)("end")],d.prototype,"readEnd",null),(0,n.Cg)([(0,c.K)("end")],d.prototype,"writeEnd",null),(0,n.Cg)([(0,l.MZ)({readOnly:!0,json:{read:!1}})],d.prototype,"isAllTime",null),(0,n.Cg)([(0,l.MZ)({readOnly:!0,json:{read:!1}})],d.prototype,"isEmpty",null),(0,n.Cg)([(0,l.MZ)({type:Date,json:{write:{allowNull:!0}}})],d.prototype,"start",void 0),(0,n.Cg)([(0,u.w)("start")],d.prototype,"readStart",null),(0,n.Cg)([(0,c.K)("start")],d.prototype,"writeStart",null),d=i=(0,n.Cg)([(0,l.$K)("esri.time.TimeExtent")],d);const p=new d,h=new d({start:void 0,end:void 0})},91218:(e,t,r)=>{r.r(t),r.d(t,{canProjectWithoutEngine:()=>$,initializeProjection:()=>z,isEqualBaseGCS:()=>Q,isLoaded:()=>M,isLoadedOrLoad:()=>L,isLoadedOrLoadFor:()=>j,load:()=>k,project:()=>q,projectExtent:()=>re,projectMany:()=>E,projectMultipoint:()=>Y,projectOrLoad:()=>Z,projectOrLoadMany:()=>N,projectPoint:()=>V,projectPolygon:()=>ee,projectPolyline:()=>H,projectWithZConversion:()=>B,projectWithoutEngine:()=>J,requiresLoad:()=>O,test:()=>U,tryProjectWithZConversion:()=>G,unload:()=>D});var i=r(49186),n=r(74887),a=r(62788),s=r(95488),l=r(51850),o=r(21276),u=r(73941),c=r(5443),d=r(91075),p=r(48526),h=r(86738),y=r(39829),f=r(82799),m=r(16930),g=r(159),_=r(9762),w=r(37539);function b(e,t,r,i,n,a){return F[0]=e,F[1]=t,F[2]=r,(0,_.projectBuffer)(F,i,0,n,a,0)}const F=(0,l.vt)();var I=r(21325),v=r(62815);let S=null,T=null,R=null,A=null,C={};const x=new s.I;function M(){return!!(T?.isLoaded()&&R?.isLoaded()&&A?.isLoaded())}function L(){return!!M()||((0,a.gc)(x),k(),!1)}function j(e,t){return!e||!t||$(e,t)||L()}function O(e,t){return!$(e,t)&&!M()}async function k(e){null==S&&(S=Promise.all([r.e(3276).then(r.bind(r,83276)).then(e=>(T=e,T.load())),r.e(8377).then(r.bind(r,8377)).then(e=>(R=e,R.load())),r.e(2158).then(r.bind(r,12158)).then(e=>(A=e,A.load()))])),await S,(0,n.Te)(e),x.notify()}function q(e,t,r){return Array.isArray(e)?0===e.length?[]:((0,o.H)(e),E(e,e[0].spatialReference,t,r)):((0,o.f)(e),E([e],e.spatialReference,t,r)[0])}function E(e,t,r,i){if(null==t||null==r)return e;if($(t,r,i))return e.map(e=>J(e,t,r));if(null==i?.geographicTransformation&&(0,u.jA)(t))return e.map(e=>J(e,t,m.A.WGS84)).map(e=>G(e,r));if(null==i?.geographicTransformation&&(0,u.jA)(r))return e.map(e=>G(e,m.A.WGS84)).map(e=>J(e,m.A.WGS84,r));if(!M())throw new P;if(!i?.geographicTransformation)if(i?.extendedParams)i={...i,geographicTransformation:A.getTransformation(t,r,i.areaOfInterestExtent)||new g.A};else if(!i?.areaOfInterestExtent){const e=function(e,t){return[e.wkid?.toString()??"-1",e.wkt?.toString()??"",e.wkt2?.toString()??"",t.wkid?.toString()??"-1",t.wkt?.toString()??"",t.wkt2?.toString()??""].join()}(t,r);let n=C[e];n||(n=A.getTransformation(t,r)||new g.A,C[e]=n),i={geographicTransformation:n}}return e[0].spatialReference||(e[0].spatialReference=t),e[0]instanceof d.A?T.executeMany(e,r,i):R.executeMany(e,r,i)}function Z(e,t){const r=N([e],t);return null!=r.pending?{pending:r.pending,geometry:null}:null!=r.geometries?{pending:null,geometry:r.geometries[0]}:{pending:null,geometry:null}}function N(e,t){if(!M())for(const r of e)if(null!=r&&!(0,I.aI)(r.spatialReference,t)&&(0,I.fn)(r.spatialReference)&&(0,I.fn)(t)&&!$(r.spatialReference,t))return(0,a.gc)(x),{pending:k(),geometries:null};return{pending:null,geometries:e.map(e=>null==e?null:(0,I.aI)(e.spatialReference,t)?e:(0,I.fn)(e.spatialReference)&&(0,I.fn)(t)?G(e,t):null)}}class P extends i.A{constructor(){super("projection:not-loaded","projection engine not fully loaded yet, please call load()")}}function D(){S=null,T=null,R=null,A=null,C={}}const U={get loadPromise(){return S}};function G(e,t){try{const r=q(e,t);if(null==r)return null;"xmin"in e&&"xmin"in r&&(r.zmin=e.zmin,r.zmax=e.zmax);const i=(0,v.N)(r.type,e.spatialReference,t);return null!=i&&i(r),r}catch(e){if(!(e instanceof P))throw e;return null}}async function B(e,t,r){const i=e.spatialReference;return null!=i&&null!=t&&await z(i,t,null,r),G(e,t)}function $(e,t,r){return!(r?.areaOfInterestExtent||r?.extendedParams||r?.geographicTransformation)&&(!!(0,I.aI)(e,t)||(0,I.fn)(e)&&(0,I.fn)(t)&&!!(0,w.jd)(e,t))}function Q(e,t){if((0,I.aI)(e,t))return!0;if(!(0,I.fn)(e)||!(0,I.fn)(t))return!1;const r=(0,I.oT)(e)||(0,I.K8)(e)||(0,I.x1)(e),i=(0,I.oT)(t)||(0,I.K8)(t)||(0,I.x1)(t);return r&&i}async function z(e,t,r,i){if(M())return(0,n.NO)(i);if(Array.isArray(e)){for(const{source:t,dest:r,options:n}of e)if(t&&r&&!$(t,r,n))return k(i)}else if(e&&t&&!$(e,t,r))return k(i);return(0,n.NO)(i)}function J(e,t,r){return e?"x"in e?K(e,t,new h.A,r,0):"xmin"in e?ie(e,t,new c.A,r,0):"rings"in e?te(e,t,new y.A,r,0):"paths"in e?X(e,t,new f.A,r,0):"points"in e?W(e,t,new p.A,r,0):null:null}function V(e,t,r=t.spatialReference,i=0){return null!=r&&null!=e.spatialReference&&null!=K(e,e.spatialReference,t,r,i)}function K(e,t,r,i,n){ae[0]=e.x,ae[1]=e.y;const a=e.z;return ae[2]=void 0!==a?a:n,(0,_.projectBuffer)(ae,t,0,ae,i,0)?(r.x=ae[0],r.y=ae[1],r.spatialReference=i,void 0!==a||(0,u.xP)(i)?(r.z=ae[2],r.hasZ=!0):(r.z=void 0,r.hasZ=!1),void 0===e.m?(r.m=void 0,r.hasM=!1):(r.m=e.m,r.hasM=!0),r):null}function Y(e,t,r=t.spatialReference,i=0){return null!=e.spatialReference&&null!=r&&null!=W(e,e.spatialReference,t,r,i)}function W(e,t,r,i,n){const{points:a,hasZ:s,hasM:l}=e,o=[],c=a.length,d=[];for(const e of a)d.push(e[0],e[1],s?e[2]:n);if(!(0,_.projectBuffer)(d,t,0,d,i,0,c))return null;const p=s||(0,u.xP)(i);for(let e=0;e<c;++e){const t=3*e,r=d[t],i=d[t+1];p&&l?o.push([r,i,d[t+2],a[e][3]]):p?o.push([r,i,d[t+2]]):l?o.push([r,i,a[e][2]]):o.push([r,i])}return r.points=o,r.spatialReference=i,r.hasZ=s,r.hasM=l,r}function H(e,t,r=t.spatialReference,i=0){return null!=e.spatialReference&&null!=r&&null!=X(e,e.spatialReference,t,r,i)}function X(e,t,r,i,n){const{paths:a,hasZ:s,hasM:l}=e,o=[];if(!ne(a,s??!1,l??!1,t,o,i,n))return null;const c=s||(0,u.xP)(i);return r.paths=o,r.spatialReference=i,r.hasZ=c,r.hasM=l,r}function ee(e,t,r=t.spatialReference,i=0){return null!=e.spatialReference&&null!=r&&null!=te(e,e.spatialReference,t,r,i)}function te(e,t,r,i,n){const{rings:a,hasZ:s,hasM:l}=e,o=[];if(!ne(a,s??!1,l??!1,t,o,i,n))return null;const c=s||(0,u.xP)(i);return r.rings=o,r.spatialReference=i,r.hasZ=c,r.hasM=l,r}function re(e,t,r=t.spatialReference,i=0){return null!=e.spatialReference&&null!=r&&null!=ie(e,e.spatialReference,t,r,i)}function ie(e,t,r,i,n){const{xmin:a,ymin:s,xmax:l,ymax:o,hasZ:c,hasM:d}=e;if(!b(a,s,c?e.zmin:n,t,ae,i))return null;const p=c||(0,u.xP)(i);return r.xmin=ae[0],r.ymin=ae[1],p&&(r.zmin=ae[2]),b(l,o,c?e.zmax:n,t,ae,i)?(r.xmax=ae[0],r.ymax=ae[1],p&&(r.zmax=ae[2]),d&&(r.mmin=e.mmin,r.mmax=e.mmax),r.spatialReference=i,r):null}function ne(e,t,r,i,n,a,s=0){const l=new Array;for(const r of e)for(const e of r)l.push(e[0],e[1],t?e[2]:s);if(!(0,_.projectBuffer)(l,i,0,l,a,0))return!1;let o=0;n.length=0;const c=t||(0,u.xP)(a);for(const t of e){const e=new Array;for(const i of t)c&&r?e.push([l[o++],l[o++],l[o++],i[3]]):c?e.push([l[o++],l[o++],l[o++]]):r?(e.push([l[o++],l[o++],i[2]]),o++):(e.push([l[o++],l[o++]]),o++);n.push(e)}return!0}const ae=(0,l.vt)()},91880:(e,t,r)=>{r.d(t,{A:()=>u});var i,n=r(31635),a=r(66552),s=r(25482),l=r(91429);const o=new a.J({asc:"ascending",desc:"descending"});let u=class extends s.o{static{i=this}constructor(e){super(e),this.field=null,this.valueExpression=null,this.order="ascending"}clone(){return new i({field:this.field,valueExpression:this.valueExpression,order:this.order})}};(0,n.Cg)([(0,l.MZ)({type:String,json:{write:!0}})],u.prototype,"field",void 0),(0,n.Cg)([(0,l.MZ)({type:String,json:{write:!0,origins:{"web-scene":{read:!1,write:!1}}}})],u.prototype,"valueExpression",void 0),(0,n.Cg)([(0,l.MZ)({type:o.apiValues,json:{type:o.jsonValues,read:o.read,write:o.write}})],u.prototype,"order",void 0),u=i=(0,n.Cg)([(0,l.$K)("esri.layers.support.OrderByInfo")],u)},99157:(e,t,r)=>{r.d(t,{A:()=>l});var i,n=r(31635),a=r(69622),s=r(91429);let l=i=class extends a.A{constructor(e){super(e),this.isInverse=!1,this.wkt=null,this.wkid=null}getInverse(){return new i({isInverse:!this.isInverse,wkid:this.wkid,wkt:this.wkt})}};(0,n.Cg)([(0,s.MZ)()],l.prototype,"isInverse",void 0),(0,n.Cg)([(0,s.MZ)()],l.prototype,"wkt",void 0),(0,n.Cg)([(0,s.MZ)()],l.prototype,"wkid",void 0),l=i=(0,n.Cg)([(0,s.$K)("esri.geometry.operators.support.GeographicTransformationStep")],l)}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[8948],{6518:(e,t,n)=>{n.d(t,{F:()=>a});var i=n(44208),r=n(75503),o=n(19419);const s={minX:0,minY:0,maxX:0,maxY:0};class a{constructor(){this._indexInvalid=!1,this._boundsToLoad=[],this._boundsById=new Map,this._idByBounds=new Map,this._index=new r.wq(9,(0,i.A)("esri-csp-restrictions")?e=>({minX:e[0],minY:e[1],maxX:e[2],maxY:e[3]}):["[0]","[1]","[2]","[3]"]),this._loadIndex=()=>{if(this._indexInvalid){const e=new Array(this._idByBounds.size);let t=0;this._idByBounds.forEach((n,i)=>{e[t++]=i}),this._indexInvalid=!1,this._index.clear(),this._index.load(e)}else this._boundsToLoad.length&&(this._index.load(Array.from(new Set(this._boundsToLoad.filter(e=>this._idByBounds.has(e))))),this._boundsToLoad.length=0)}}get fullBounds(){if(!this._boundsById.size)return null;const e=(0,o.Ie)();for(const t of this._boundsById.values())t&&(e[0]=Math.min(t[0],e[0]),e[1]=Math.min(t[1],e[1]),e[2]=Math.max(t[2],e[2]),e[3]=Math.max(t[3],e[3]));return e}get valid(){return!this._indexInvalid}clear(){this._indexInvalid=!1,this._boundsToLoad.length=0,this._boundsById.clear(),this._idByBounds.clear(),this._index.clear()}delete(e){const t=this._boundsById.get(e);this._boundsById.delete(e),t&&(this._idByBounds.delete(t),this._indexInvalid||this._index.remove(t))}forEachInBounds(e,t){this._loadIndex(),function(e,t,n){(function(e){s.minX=e[0],s.minY=e[1],s.maxX=e[2],s.maxY=e[3]})(t),e.search(s,n)}(this._index,e,e=>t(this._idByBounds.get(e)))}get(e){return this._boundsById.get(e)}has(e){return this._boundsById.has(e)}invalidateIndex(){this._indexInvalid||(this._indexInvalid=!0,this._boundsToLoad.length=0)}set(e,t){if(!this._indexInvalid){const t=this._boundsById.get(e);t&&(this._index.remove(t),this._idByBounds.delete(t))}this._boundsById.set(e,t),t&&(this._idByBounds.set(t,e),this._indexInvalid||(this._boundsToLoad.push(t),this._boundsToLoad.length>5e4&&this._loadIndex()))}}},8460:(e,t,n)=>{n.d(t,{$C:()=>y,Hh:()=>s,Tu:()=>c,Wg:()=>h,Xq:()=>f,i6:()=>g,pM:()=>u,vJ:()=>m});var i=n(2741);let r,o=null;function s(){return r||(r=n.e(3666).then(n.bind(n,3666)).then(e=>e.l).then(({default:e})=>e({locateFile:e=>(0,i.s)(`esri/libs/linkchartlayout/${e}`)})).then(e=>{!function(e){o=e}(e)}),r)}const a={right:0,left:1,top:2,bottom:3},l={none:0,"start-only":1,"start-and-end":2};function p(e){const t={timeDirection:"right",timeBannerUTCOffsetInMinutes:0,eventsTicksVisualization:"start-and-end",showDurationLineForNonZeroDurationEntityEvents:!0,durationLineWidth:5,entityPositionAtDurationRatio:1,showNonZeroDurationIntervalBounds:!1,separateTimeOverlaps:!0,separateTimelineOverlaps:!0,moveFirstBends:!0,secondBendRatio:.3,lineSeparationMultiplier:1,spaceSeparatedLinesEvenly:!1,useBezierCurves:!1,separatedLineShapeRatio:0,...e?.toJSON(),eventsTicksVisualization:e?.eventsTicksVisualization??"start-and-end"};return{...t,timeDirection:{value:a[t.timeDirection]??a.right},eventsTicksVisualization:{value:l[t.eventsTicksVisualization]??l["start-and-end"]}}}function d(e,t,n,i,r,s){const a=n.length,l=r.length,p=Float64Array.BYTES_PER_ELEMENT,d=Uint32Array.BYTES_PER_ELEMENT,u=Uint8Array.BYTES_PER_ELEMENT,c=16+a*(u+2*p)+l*(2*d),h=o._malloc(c);try{const u=h+16-h%16,c=u+a*p,y=c+a*p,m=y+l*d,f=m+l*d,g=()=>[o.HEAPF64.subarray(u>>3,(u>>3)+a),o.HEAPF64.subarray(c>>3,(c>>3)+a),o.HEAPU32.subarray(y>>2,(y>>2)+l),o.HEAPU32.subarray(m>>2,(m>>2)+l),o.HEAPU8.subarray(f,f+a)],[b,w,_,M,I]=g();b.set(n),w.set(i),_.set(r),M.set(s),I.set(t);const T=e(a,f,u,c,l,y,m);let C=null,v=null;if(0===T.value){const e=o.getLayoutLinksTypes(),t=o.getLayoutLinksVerticesEndIndices(),n=o.getLayoutLinksVertices(),i=o.countLayoutLinksVertices();!l||e&&t?i&&!n?T.value=1:(C={types:new Uint8Array(o.HEAPU8.subarray(e,e+l)),vertexEndIndex:new Uint32Array(o.HEAPU32.subarray(t>>2,(t>>2)+l)),vertices:new Float64Array(o.HEAPF64.subarray(n>>3,(n>>3)+2*i))},v=o.getAuxiliaryGraphicElements()):T.value=1}const[A,x,E,S,k]=g();return n.set(A),i.set(x),r.set(E),s.set(S),t.set(k),{status:T.value,links:C,graphics:v}}finally{o._free(h),o.cleanupLayout()}}var u,c,h,y,m,f,g,b;(b=u||(u={})).getMinIdealEdgeLength=function(){return o.getMinIdealEdgeLength()},b.apply=function(e,t,n,i,r,s,a=2,l=1,p=-1){return d((t,n,i,r,s,d,u)=>o.applyForceDirectedLayout(e,t,n,i,r,s,d,u,a,l,p),t,n,i,r,s)},function(e){e.apply=function(e,t,n,i,r,s,a=2,l=1,p=-1){return d((t,n,i,r,s,d,u)=>o.applyCommunityLayout(e,t,n,i,r,s,d,u,a,l,p),t,n,i,r,s)}}(c||(c={})),function(e){e.apply=function(e,t,n,i,r,s){return d((t,n,i,r,s,a,l)=>o.applySimpleLayout(e,t,n,i,r,s,a,l),t,n,i,r,s)}}(h||(h={})),function(e){e.apply=function(e,t,n,i,r,s){return d((t,n,i,r,s,a,l)=>o.applyHierarchicalLayout(e,t,n,i,r,s,a,l),t,n,i,r,s)}}(y||(y={})),function(e){e.apply=function(e,t,n,i,r,s){return d((t,n,i,r,s,a,l)=>o.applyRadialTreeLayout(e,t,n,i,r,s,a,l),t,n,i,r,s)}}(m||(m={})),function(e){e.apply=function(e,t,n,i,r,s){return d((t,n,i,r,s,a,l)=>o.applySmartTreeLayout(e,t,n,i,r,s,a,l),t,n,i,r,s)}}(f||(f={})),function(e){e.apply=function(e,t,n,i,r,s,a,l,u,c,h,y){return d((t,n,i,a,l,d,m)=>{if(r.length!==t)return{value:1};if(s.length!==t)return{value:1};if(u.length!==l)return{value:1};if(c.length!==l)return{value:1};const f=Float64Array.BYTES_PER_ELEMENT,g=16,b=o._malloc(g+t*f),w=o._malloc(g+t*f),_=o._malloc(g+l*f),M=o._malloc(g+l*f),I=b+g-b%g,T=w+g-w%g,C=_+g-_%g,v=M+g-M%g;try{return o.HEAPF64.subarray(I>>3,(I>>3)+t).set(r),o.HEAPF64.subarray(T>>3,(T>>3)+t).set(s),o.HEAPF64.subarray(C>>3,(C>>3)+l).set(u),o.HEAPF64.subarray(v>>3,(v>>3)+l).set(c),o.applyChronologicalLayout(e,t,n,i,a,I,T,l,d,m,C,v,h,p(y))}finally{o._free(b),o._free(w),o._free(_),o._free(M)}},t,n,i,a,l)}}(g||(g={}))},15375:(e,t,n)=>{n.d(t,{BL:()=>l,Cz:()=>r,KQ:()=>o,M1:()=>a,T1:()=>s,dr:()=>i});const i="ESRI__ID",r="ESRI__OriginID",o="ESRI__DestID",s="ESRI__LayoutGeometry",a="ESRI__AggregationCount",l="LC.ESRI__IsSpatial"},23150:(e,t,n)=>{n.d(t,{A:()=>a});var i=n(31635),r=n(91429),o=n(82799),s=n(54238);let a=class extends s.A{constructor(e){super(e),this.originId=null,this.destinationId=null,this.layoutGeometry=null}};(0,i.Cg)([(0,r.MZ)({type:String,json:{write:!0}})],a.prototype,"originId",void 0),(0,i.Cg)([(0,r.MZ)({type:String,json:{write:!0}})],a.prototype,"destinationId",void 0),(0,i.Cg)([(0,r.MZ)({type:o.A,json:{write:!0}})],a.prototype,"layoutGeometry",void 0),a=(0,i.Cg)([(0,r.$K)("esri.rest.knowledgeGraph.Relationship")],a)},24137:(e,t,n)=>{n.d(t,{P:()=>I});var i=n(31635),r=n(69622),o=n(49186),s=n(53966),a=n(91869),l=n(74887),p=n(39516),d=n(91429),u=n(5443),c=n(39829),h=n(91218),y=n(21325),m=n(15375);const f=(e,t)=>{if("column-reference"===e.type)return e.column===t.systemOidFieldName?"ID(n)":`n.${e.column}`;if("string"===e.type)return`'${e.value}'`;if("number"===e.type)return`${e.value}`;if("binary-expression"===e.type&&t.supportedSqlTypes.has(e.left.type)&&t.supportedSqlTypes.has(e.right.type)&&t.supportedSqlOperators.has(e.operator))return`${f(e.left,t)} ${e.operator} ${f(e.right,t)}`;if("binary-expression"===e.type&&"LIKE"===e.operator){let n="";if("function"===e.left.type&&"column-reference"===e.left.args.value[0].type)n+=`lower(n.${e.left.args.value[0].column})`;else{if("column-reference"!==e.left.type)return t.unsupportedOperationFound=!0,"";n+=`lower(n.${e.left.column})`}if(n+=" CONTAINS (","string"!==e.right.type)return t.unsupportedOperationFound=!0,"";{let t=e.right.value;t.startsWith("%")&&(t=t.slice(1)),t.endsWith("%")&&(t=t.slice(0,-1)),n+=`'${t.toLowerCase()}')`}return n}return t.unsupportedOperationFound=!0,""};var g=n(69860),b=n(30504),w=n(48441),_=n(42538),M=n(61956);let I=class extends r.A{constructor(e){super(e),this._processingCacheUpdatesLookup=new Map,this.knowledgeGraph=null,this.inclusionModeDefinition={generateAllSublayers:!0,namedTypeDefinitions:new Map},this.entityTypeNames=new Set,this.relationshipTypeNames=new Set,this.geographicLookup=new Map,this.sublayerCaches=new Map,this.nodeConnectionsLookup=new Map,this.relationshipConnectionsLookup=new Map,this.memberIdTypeLookup=new Map;const t=new Map;e.knowledgeGraph.dataModel.entityTypes?.forEach(n=>{n.name&&(t.set(n.name,"entity"),this._processingCacheUpdatesLookup.set(n.name,[]),e.inclusionModeDefinition&&!e.inclusionModeDefinition?.generateAllSublayers||this.entityTypeNames.add(n.name),n.properties?.forEach(e=>{e.geometryType&&"esriGeometryNull"!==e.geometryType&&this.geographicLookup.set(n.name,{name:e.name??"",geometryType:e.geometryType})}))}),e.knowledgeGraph.dataModel.relationshipTypes?.forEach(n=>{n.name&&(t.set(n.name,"relationship"),this._processingCacheUpdatesLookup.set(n.name,[]),e.inclusionModeDefinition&&!e.inclusionModeDefinition?.generateAllSublayers||this.relationshipTypeNames.add(n.name),n.properties?.forEach(e=>{e.geometryType&&"esriGeometryNull"!==e.geometryType&&this.geographicLookup.set(n.name,{name:e.name??"",geometryType:e.geometryType})}))}),e.inclusionModeDefinition?.namedTypeDefinitions.forEach((n,i)=>{if("entity"===t.get(i))this.entityTypeNames.add(i);else{if("relationship"!==t.get(i))return s.A.getLogger(this).warn(`A named type, ${i}, was in the inclusion list that wasn't in the data model and will be removed`),void e.inclusionModeDefinition?.namedTypeDefinitions.delete(i);this.relationshipTypeNames.add(i)}const r=new Map;n.members?.forEach(e=>{(0,a.tE)(this.memberIdTypeLookup,e.id,()=>new Set).add(i)}),this.sublayerCaches.set(i,r)})}addToLayer(e){e.forEach(({typeName:e,id:t})=>{if(!this.inclusionModeDefinition)throw new o.A("knowledge-graph:layer-data-manager","You cannot add to a layer's exclusion list if it was not created with an exclusion list originally");if(this.inclusionModeDefinition.namedTypeDefinitions.has(e)){if(this.inclusionModeDefinition.namedTypeDefinitions.has(e)){const n=this.inclusionModeDefinition.namedTypeDefinitions.get(e);n.members||(n.members=new Map),n.members.set(t,{id:t}),(0,a.tE)(this.memberIdTypeLookup,t,()=>new Set).add(e)}}else{const n=new Map;n.set(t,{id:t}),this.inclusionModeDefinition.namedTypeDefinitions.set(e,{useAllData:!1,members:n}),(0,a.tE)(this.memberIdTypeLookup,t,()=>new Set).add(e)}})}getById(e){return g.A.getInstance().readFromStoreById(e)}async getData(e,t,n){if(t.objectType.name&&this.inclusionModeDefinition?.namedTypeDefinitions&&this.inclusionModeDefinition.namedTypeDefinitions.size>0&&!this.inclusionModeDefinition.namedTypeDefinitions.has(t.objectType.name))return[];let i;if(i=e||new M.A({where:"1=1",outFields:["*"]}),"link-chart"===t.parentCompositeLayer.type){const e=t.parentCompositeLayer,n=this._processingCacheUpdatesLookup.get(t.objectType.name??""),r=i.outFields;r&&1===r.length&&r[0]===m.dr&&"1=1"===i.where||await Promise.all(n??[]);const o=this.sublayerCaches.has(t.objectType.name??"")?Array.from(this.sublayerCaches.get(t.objectType.name)?.values()):[],s=[];return o.forEach(n=>{if(this.relationshipTypeNames.has(t.objectType.name)){n.geometry=e.relationshipLinkChartDiagramLookup.get(n.attributes[t.objectIdField]);const i=this.memberIdTypeLookup.get(n.attributes[m.Cz]),r=this.memberIdTypeLookup.get(n.attributes[m.KQ]),o=this._isEndEntitySpatial(i,n,m.Cz),s=this._isEndEntitySpatial(r,n,m.KQ);n.attributes[m.BL]=Number(o&&s)}else{n.geometry=e.entityLinkChartDiagramLookup.get(n.attributes[t.objectIdField]);const i=this.geographicLookup.get(t.objectType.name);i&&n.attributes[i.name]?n.attributes[m.BL]=1:n.attributes[m.BL]=0}n.attributes[m.T1]=n.geometry,s.push(n)}),s}return this.retrieveDataFromService(i,t,n)}async getConnectedRecordIds(e,t,n){const i=[];let r="";const o=this._getNamedTypeIdMapFromNodeIds(e);if(t&&0!==t?.length){for(const e of t)r=r+e+"|";r=r.slice(0,-1)}const s={},a=[];for(const[e,n]of o){const i=`${e}_ids`;s[i]=n,t&&0!==t?.length?a.push(`MATCH (n:${e}) WHERE id(n) IN $${i} WITH n MATCH (n)-[r:${r}]-(m) RETURN id(r), type(r), id(m), labels(m)[0]`):a.push(`MATCH (n:${e}) WHERE id(n) IN $${i} WITH n MATCH (n)-[r]-(m) RETURN id(r), type(r), id(m), labels(m)[0]`)}if(!a.length)return i;const l=a.join(" UNION "),p=(await(0,w.executeQueryStreaming)(this.knowledgeGraph,new _.A({openCypherQuery:l,bindParameters:s}),{signal:n?.signal})).resultRowsStream.getReader();for(;;){const{done:e,value:t}=await p.read();if(e)break;for(let e=0;e<t.length;e++){const n=t[e];i.push({id:n[0],typeName:n[1]}),i.push({id:n[2],typeName:n[3]})}}return i}async getRelationshipsBetweenNodes(e,t,n){const i=this._getNamedTypeIdMapFromNodeIds(e);if(0===i.size)return[];const r={relationshipExclusionIds:t,possibleConnectionEntityIds:e},o=[];for(const[e,t]of i.entries()){const n=`${e}_ids`;r[n]=t,o.push(`MATCH (n:${e}) WHERE id(n) IN $${n} WITH n MATCH (n)-[r]->(m) WHERE id(m) IN $possibleConnectionEntityIds AND NOT id(r) IN $relationshipExclusionIds RETURN id(r), type(r)`)}const s=o.join(" UNION "),a=[],l=(await(0,w.executeQueryStreaming)(this.knowledgeGraph,new _.A({openCypherQuery:s,bindParameters:r}),{signal:n?.signal})).resultRowsStream.getReader();for(;;){const{done:e,value:t}=await l.read();if(e)break;for(let e=0;e<t.length;e++){const n=t[e];a.push({id:n[0],typeName:n[1]})}}return a}async getRelationshipsFromNodes(e,t,n,i){const r=this._getNamedTypeIdMapFromNodeIds(e);if(0===r.size||0===t.length)return[];const o={relationshipExclusionIds:n,possibleConnectionEntityIds:t},s=[];for(const[e,t]of r.entries()){const n=`${e}_ids`;o[n]=t,s.push(`MATCH (n:${e}) WHERE id(n) IN $${n} WITH n MATCH (n)-[r]-(m) WHERE id(m) IN $possibleConnectionEntityIds AND NOT id(r) IN $relationshipExclusionIds RETURN id(r), type(r)`)}const a=s.join(" UNION "),l=new Map,p=(await(0,w.executeQueryStreaming)(this.knowledgeGraph,new _.A({openCypherQuery:a,bindParameters:o}),{signal:i?.signal})).resultRowsStream.getReader();for(;;){const{done:e,value:t}=await p.read();if(e)break;for(let e=0;e<t.length;e++){const n=t[e];let i=l.get(n[1]);i||(i=new Set,l.set(n[1],i)),i.add(n[0])}}const d=[];for(const[e,t]of l)for(const n of t)d.push({id:n,typeName:e});return d}async refreshCacheContent(e,t,n,i=!0,r){const s=g.A.getInstance(),p=[],d=new Map,u=new Map;this.knowledgeGraph.dataModel.entityTypes?.forEach(e=>{e.name&&u.set(e.name,e)}),this.knowledgeGraph.dataModel.relationshipTypes?.forEach(e=>{e.name&&u.set(e.name,e)}),e||this.inclusionModeDefinition?e?e.forEach(e=>{if(this.memberIdTypeLookup.has(e))for(const t of this.memberIdTypeLookup.get(e))d.has(t)?d.get(t)?.push(e):d.set(t,[e])}):this.inclusionModeDefinition?.namedTypeDefinitions?.forEach((e,t)=>{e.useAllData?d.set(t,null):e.members&&e.members.forEach(e=>{d.has(t)&&null!==d.get(t)?d.get(t)?.push(e.id):d.set(t,[e.id])})}):(this.knowledgeGraph.dataModel.entityTypes?.forEach(e=>{e.name&&d.set(e.name,null)}),this.knowledgeGraph.dataModel.entityTypes?.forEach(e=>{e.name&&d.set(e.name,null)}));for(const[e,l]of d){const d=new Set(l),c=new Promise((p,c)=>{(async()=>{const p=new Set,c=[];let h,y="",f=!1;if(t||u.get(e)?.properties?.forEach(e=>{e.name&&p.add(e.name)}),n&&this.geographicLookup.has(e)){const t=this.geographicLookup.get(e)?.name;t&&p.add(t)}if(this.entityTypeNames.has(e))y=`MATCH (n:${e}) ${l?"WHERE id(n) IN $ids ":""}return ID(n)`,p.forEach(e=>{y+=`, n.${e}`,c.push(e)});else{if(!this.relationshipTypeNames.has(e))throw new o.A("knowledge-graph:layer-data-manager",`The graph type of ${e} could not be determined. Was this type set in the KG data model and inclusion definition?`);f=!0,y=`MATCH ()-[n:${e}]->() ${l?"WHERE id(n) IN $ids ":""}return ID(n), id(startNode(n)), id(endNode(n))`,p.forEach(e=>{y+=`, n.${e}`,c.push(e)})}h=new _.A(l?{openCypherQuery:y,bindParameters:{ids:l}}:{openCypherQuery:y});const g=(await(0,w.executeQueryStreaming)(this.knowledgeGraph,h,{signal:r?.signal})).resultRowsStream.getReader();for(;;){const{done:t,value:n}=await g.read();if(t)break;const r=[];for(let e=0;e<n.length;e++){const t=n[e];let i=0,o=0;const s={properties:{}};for(s.id=t[i],i++,o++,f&&(s.originId=t[i],i++,o++,s.destinationId=t[i],i++,o++,(0,a.tE)(this.nodeConnectionsLookup,s.originId,()=>new Set).add(s.id),(0,a.tE)(this.nodeConnectionsLookup,s.destinationId,()=>new Set).add(s.id),(0,a.tE)(this.relationshipConnectionsLookup,s.id,()=>[s.originId,s.destinationId]));i<t.length;i++)s.properties[c[i-o]]=t[i];d.delete(s.id),r.push(s)}const o=s.writeToStore(r,m.dr,this.geographicLookup.get(e)?.name);this.sublayerCaches.has(e)||this.sublayerCaches.set(e,new Map),i&&!this.inclusionModeDefinition?.namedTypeDefinitions.has(e)&&this.inclusionModeDefinition?.namedTypeDefinitions.set(e,{useAllData:!1,members:new Map}),i&&!this.inclusionModeDefinition?.namedTypeDefinitions.get(e).members&&(this.inclusionModeDefinition.namedTypeDefinitions.get(e).members=new Map);const l=this.sublayerCaches.get(e);o.forEach(t=>{l?.set(t.attributes[m.dr],t),i&&!this.inclusionModeDefinition?.namedTypeDefinitions.get(e).members.has(t.attributes[m.dr])&&(this.inclusionModeDefinition?.namedTypeDefinitions.get(e).members.set(t.attributes[m.dr],{id:t.attributes[m.dr]}),(0,a.tE)(this.memberIdTypeLookup,t.attributes[m.dr],()=>new Set).add(e))})}const b=this.inclusionModeDefinition?.namedTypeDefinitions.get(e);if(b)for(const e of d)b.members?.delete(e)})().then(()=>{p(null)}).catch(e=>{"AbortError"===e.name?p(null):c(e)})});p.push(c),this._processingCacheUpdatesLookup.get(e)?.push(c)}if(await Promise.all(p),r?.signal?.aborted)throw(0,l.NK)()}removeFromLayer(e){const t=new Set,n=new Set(e.map(e=>e.id));for(const n of e)t.add(n.typeName),1===this.memberIdTypeLookup.get(n.id)?.size?this.memberIdTypeLookup.delete(n.id):this.memberIdTypeLookup.get(n.id)?.delete(n.typeName),this.inclusionModeDefinition?.namedTypeDefinitions.forEach((e,t)=>{t===n.typeName&&e.members?.has(n.id)&&e.members.delete(n.id)});t.forEach(e=>{this.sublayerCaches.get(e)?.forEach((t,i)=>{n.has(i)&&this.sublayerCaches.get(e)?.delete(i)})})}async retrieveDataFromService(e,t,n){const i=g.A.getInstance(),r=new Set,s=[];let a,l="",d=[];const M="relationship"===t.graphType,I=this.inclusionModeDefinition?.namedTypeDefinitions?.get(t.objectType.name)?.useAllData,T=t.parentCompositeLayer.sublayerIdsCache.get(t.objectType.name);let C=!I&&T?Array.from(T).sort():null;if(this.inclusionModeDefinition?.namedTypeDefinitions?.get(t.objectType.name)?.useAllData)this.inclusionModeDefinition?.namedTypeDefinitions?.get(t.objectType.name)?.useAllData&&null!=e.objectIds&&(C=e.objectIds);else if(null!=e.objectIds&&C&&C.length>0){const t=e.objectIds;e.objectIds=C.filter(e=>t.includes(e))}else if(null!=e.objectIds)C=e.objectIds;else{if(this.inclusionModeDefinition?.namedTypeDefinitions.has(t.objectType.name)&&(!this.inclusionModeDefinition.namedTypeDefinitions.get(t.objectType.name)?.members||this.inclusionModeDefinition.namedTypeDefinitions.get(t.objectType.name)?.members?.size<1))return e.objectIds=[],[];e.objectIds=C}if(null!=e.outFields){const n=e.outFields;n.includes("*")?t.fields.forEach(e=>{r.add(e.name)}):n.forEach(e=>{e!==m.dr&&e!==t.geometryFieldName&&r.add(e)})}if(null!=e.geometry){const n=e.geometry;let i;const d=t.parentCompositeLayer.dataManager.knowledgeGraph.serviceDefinition,m=d?.spatialReference,f=d?.serviceCapabilities?.geometryCapabilities;let g=f?.geometryMaxBoundingRectangleSizeX,w=f?.geometryMaxBoundingRectangleSizeY;if("point"===n.type){let e=n;e.spatialReference?.isWGS84||(await(0,h.initializeProjection)(e.spatialReference,y.KK),e=(0,h.project)(e,y.KK)),i=new u.A({spatialReference:y.KK,xmin:e.x-1e-4,ymin:e.y-1e-4,xmax:e.x+1e-4,ymax:e.y+1e-4})}else n?.extent?.spatialReference&&!n.spatialReference?.isWGS84?(await(0,h.initializeProjection)(n.extent.spatialReference,y.KK),i=(0,h.project)(n.extent,y.KK)):i=n.extent;if(g&&w&&m){if(4326!==m.wkid){const e=new u.A({spatialReference:m,xmax:g,ymax:w}),t=(0,h.project)(e,y.KK);g=t.xmax,w=t.ymax}if(i.xmax-i.xmin>g)throw new o.A("knowledge-graph:layer-data-manager",`Extent x bounds should be within ${g}° latitude, limit exceeded`);if(i.ymax-i.ymin>w)throw new o.A("knowledge-graph:layer-data-manager",`Extent y bounds should be within ${w}° longitude, limit exceeded`)}if(null!=e.where&&"1=1"!==e.where){const n=await(0,p.GP)(e.where.toUpperCase(),t.fieldsIndex);t.fields.forEach(e=>{n.fieldNames.includes(e.name)&&r.add(e.name)})}l=M?`Match ()-[n:${t.objectType.name}]->() WHERE esri.graph.ST_Intersects($param_filter_geom, n.${t.geometryFieldName}) return ID(n), id(startNode(r)), id(endNode(r))`:`Match (n:${t.objectType.name}) WHERE esri.graph.ST_Intersects($param_filter_geom, n.${t.geometryFieldName}) return ID(n)`,t.geometryFieldName&&r.add(t.geometryFieldName),r.forEach(e=>{l+=`, n.${e}`,s.push(e)}),a=new _.A({openCypherQuery:l,bindParameters:{param_filter_geom:new c.A({rings:(0,b.Wq)(i)})}})}else{let n="";if(null!=e.where&&"1=1"!==e.where){const i=await(0,p.GP)(e.where,t.fieldsIndex);t.fields.forEach(e=>{i.fieldNames.includes(e.name)&&r.add(e.name)});const o={systemOidFieldName:m.dr,supportedSqlTypes:new Set(["column-reference","string","number","binary-expression"]),supportedSqlOperators:new Set(["=","<","<=","<>",">",">=","AND","OR","LIKE"]),unsupportedOperationFound:!1};n=f(i.parseTree,o),o.unsupportedOperationFound&&(n="")}let i="";i=M?`Match ()-[n:${t.objectType.name}]->()`:`Match (n:${t.objectType.name})`;let o=!1;C&&(o=!0,i+=" WHERE ID(n) IN $ids"),n&&(i+=o?" AND":" WHERE",i+=` ${n}`),i+=" return ID(n)",M&&(i+=", id(startNode(n)), id(endNode(n))"),e.returnGeometry&&t.geometryFieldName&&r.add(t.geometryFieldName),r.forEach(e=>{i+=`, n.${e}`,s.push(e)}),a=new _.A(C?{openCypherQuery:i,bindParameters:{ids:C}}:{openCypherQuery:i})}const v=(await(0,w.executeQueryStreaming)(t.parentCompositeLayer.dataManager.knowledgeGraph,a,n)).resultRowsStream.getReader();for(;;){const{done:e,value:n}=await v.read();if(e)break;const r=[];for(let e=0;e<n.length;e++){const t=n[e];let i=0,o=0;const a={properties:{}};for(a.id=t[i],i++,o++,M&&(a.originId=t[i],i++,o++,a.destinationId=t[i],i++,o++);i<t.length;i++)a.properties[s[i-o]]=t[i];r.push(a)}d=d.concat(i.writeToStore(r,m.dr,t.parentCompositeLayer.dataManager.geographicLookup.get(t.objectType.name)?.name))}return d}_isEndEntitySpatial(e,t,n){for(const i of e??[])if(this.entityTypeNames.has(i)){const e=this.geographicLookup.get(i),r=e&&this.sublayerCaches.get(i)?.get(t.attributes[n]);if(e&&r?.attributes[e.name])return!0}return!1}_getNamedTypeIdMapFromNodeIds(e){const t=new Map;return e.forEach(e=>{if(this.memberIdTypeLookup.has(e))for(const n of this.memberIdTypeLookup.get(e)){if(!this.entityTypeNames.has(n))return;t.has(n)?t.get(n)?.push(e):t.set(n,[e])}}),t}};(0,i.Cg)([(0,d.MZ)()],I.prototype,"knowledgeGraph",void 0),(0,i.Cg)([(0,d.MZ)()],I.prototype,"inclusionModeDefinition",void 0),(0,i.Cg)([(0,d.MZ)()],I.prototype,"entityTypeNames",void 0),(0,i.Cg)([(0,d.MZ)()],I.prototype,"relationshipTypeNames",void 0),(0,i.Cg)([(0,d.MZ)()],I.prototype,"geographicLookup",void 0),(0,i.Cg)([(0,d.MZ)()],I.prototype,"sublayerCaches",void 0),(0,i.Cg)([(0,d.MZ)()],I.prototype,"nodeConnectionsLookup",void 0),(0,i.Cg)([(0,d.MZ)()],I.prototype,"relationshipConnectionsLookup",void 0),(0,i.Cg)([(0,d.MZ)()],I.prototype,"memberIdTypeLookup",void 0),I=(0,i.Cg)([(0,d.$K)("esri.layers.knowledgeGraph.KnowledgeGraphLayerDataManager")],I)},25927:(e,t,n)=>{n.d(t,{A:()=>a});var i=n(31635),r=n(91429),o=n(86738),s=n(54238);let a=class extends s.A{constructor(e){super(e),this.layoutGeometry=null}};(0,i.Cg)([(0,r.MZ)({type:o.A,json:{write:!0}})],a.prototype,"layoutGeometry",void 0),a=(0,i.Cg)([(0,r.$K)("esri.rest.knowledgeGraph.Entity")],a)},30504:(e,t,n)=>{n.d(t,{k5:()=>p,aq:()=>l,Wq:()=>d}),n(52106);var i=n(49186),r=(n(86738),n(39829),n(82799),n(94194),n(69860),n(8460),n(66552));(0,r.O)()({none:"none",startAndEnd:"start-and-end",startOnly:"start-only"}),(0,r.O)()({absoluteValue:"absolute-value",multiplier:"multiplier"});const o=new Map([["basic-grid","basic-grid"],["geographic-organic-standard","geographic-organic-standard"],["hierarchical-bottom-to-top","hierarchical-bottom-to-top"],["hierarchical-top-to-bottom","hierarchical-bottom-to-top"],["organic-community","organic-community"],["organic-fusiform","organic-standard"],["organic-leaf-circle","organic-standard"],["organic-standard","organic-standard"],["radial-node-centric","radial-root-centric"],["radial-root-centric","radial-root-centric"],["tree-bottom-to-top","tree-left-to-right"],["tree-left-to-right","tree-left-to-right"],["tree-right-to-left","tree-left-to-right"],["tree-top-to-bottom","tree-left-to-right"],["chronological-mono-timeline","chronological-mono-timeline"],["chronological-multi-timeline","chronological-multi-timeline"]]);var s=n(48441),a=n(42538);async function l(e,t,n){const i=[],r=function(e,t){const n=new Map;if(t.dataModel?.relationshipTypes)for(const e of t.dataModel.relationshipTypes)e.name&&n.set(e.name,[]);for(const t of e)n.has(t.typeName)&&n.get(t.typeName)?.push(t.id);return n}(e,t),o={},l=[];for(const[e,t]of r){if(t.length<1)continue;const n=`${e}_ids`;o[n]=t,l.push(`MATCH (n)-[r:${e}]->(m) WHERE id(r) in $${n} RETURN id(n), labels(n)[0], id(m), labels(m)[0]`)}if(0===l.length)return[];const p=l.join(" UNION "),d=new a.A({openCypherQuery:p,bindParameters:o}),u=(await(0,s.executeQueryStreaming)(t,d,n?.requestOptions)).resultRowsStream.getReader();for(;;){const{done:e,value:t}=await u.read();if(e)break;for(const e of t)i.push({id:e[0],typeName:e[1]}),i.push({id:e[2],typeName:e[3]})}return i}n(40863),n(94985),n(68249);const p=e=>o.get(e)??"radial-root-centric";function d(e){if(!e.spatialReference.isWGS84)throw new i.A("knowledge-graph:layer-support-utils","The utilsExtentToInBoundsRings function only supports WGS84 spatial references.");return e.clone().normalize().map(e=>[[e.xmin,e.ymin],[e.xmin,e.ymax],[e.xmax,e.ymax],[e.xmax,e.ymin],[e.xmin,e.ymin]])}},37531:(e,t,n)=>{n.d(t,{dt:()=>c,GG:()=>g,UQ:()=>f,Sx:()=>d});var i=n(68197),r=n(60999),o=(n(44208),n(51850)),s=(n(76369),n(62046)),a=(n(2741),n(11254),n(66344));new Map([["dash",[4,3]],["dashdot",[4,3,1,3]],["dot",[1,3]],["longdash",[8,3]],["longdashdot",[8,3,1,3]],["longdashdotdot",[8,3,1,3,1,3]],["shortdash",[4,1]],["shortdashdot",[4,1,1,1]],["shortdashdotdot",[4,1,1,1,1,1]],["shortdot",[1,1]],["solid",[]]]),new a.q(1e3),new i.A([128,128,128]);var l=n(28975),p=n(33910);function d(e,t){if(!e)return null;let n=null;return(0,p.wk)(e)?n=function(e){const t=e.symbolLayers;if(!t)return null;let n=null;return t.forEach(e=>{"object"===e.type&&e.resource?.href||(n="water"===e.type?e.color:e.material?e.material.color:null)}),n?new i.A(n):null}(e):(0,p.$y)(e)&&(n="cim"===e.type?(0,s.Nk)(e):e.color?new i.A(e.color):null),n?u(n,t):null}function u(e,t){if(null==t||null==e)return e;const n=e.toRgba();return n[3]=n[3]*t,new i.A(n)}function c(e,t,n){e&&(t||null!=n)&&(t&&(t=new i.A(t)),(0,p.wk)(e)?function(e,t,n){const r=e.symbolLayers;if(!r)return;const o=(e,r=!1)=>{let o=t??e??null;return null!=n?.override&&(!o&&r&&(o=new i.A([255,255,255])),o&&(o.a=n.override)),u(o,n?.add)};r.forEach(e=>{if("water"===e.type)return void(e.color=u(e.color,n?.add));const t=null!=e.material?e.material.color:null,i=o(t,"icon"===e.type&&null!=e.resource?.href);null==e.material?e.material=new l.N({color:i}):e.material.color=i,"outline"in e&&e.outline?.color&&null!=n?.add&&(e.outline.color=u(e.outline.color,n.add)),"marker"in e&&null!=e.marker&&(e.marker.color=o(e.marker.color))})}(e,t,n):(0,p.$y)(e)&&function(e,t,n){t=t??e.color,null!=n?.override&&t&&(t.a=n.override),t&&(e.color=u(t,n?.add)),"outline"in e&&e.outline?.color&&(e.outline.color=u(e.outline.color,n?.add))}(e,t,n))}function h(e){for(const t of e)if("number"==typeof t)return t;return null}function y(e,t,n){for(let i=0;i<3;i++){const r=e[i];switch(r){case"symbol-value":{const e=n[i];return null!=e?e/t[i]:1}case"proportional":break;default:if(r&&t[i])return r/t[i]}}return null}function m(e,t,n,i){switch(e){case"proportional":return n*i;case"symbol-value":return null!=t?t:n;default:return e}}async function f(e,t){if(e&&t)return(0,p.wk)(e)?async function(e,t){const i=e.symbolLayers;i&&await(0,r.jJ)(i,async e=>async function(e,t){switch(e.type){case"extrude":!function(e,t){const n=t[2];"number"==typeof n&&(e.size=n)}(e,t);break;case"icon":case"line":case"text":!function(e,t){const n=h(t);null!=n&&(e.size=n)}(e,t);break;case"path":!function(e,t){const n=y(t,o.Un,[e.width,void 0,e.height]);null!=n&&(e.width=m(t[0],e.width,1,n),e.height=m(t[2],e.height,1,n))}(e,t);break;case"object":await async function(e,t){const{resourceSize:i,symbolSize:r}=await async function(e){const{computeObjectLayerResourceSize:t}=await n.e(5404).then(n.bind(n,95404)),i=await t(e,10),{width:r,height:o,depth:s}=e,a=[r,s,o];let l=1;for(let e=0;e<3;e++){const t=a[e];if(null!=t){l=t/i[e];break}}for(let e=0;e<3;e++)null==a[e]&&(a[e]=i[e]*l);return{resourceSize:i,symbolSize:a}}(e),o=y(t,i,r);null!=o&&(e.width=m(t[0],r[0],i[0],o),e.depth=m(t[1],r[1],i[1],o),e.height=m(t[2],r[2],i[2],o))}(e,t)}}(e,t))}(e,t):void((0,p.$y)(e)&&function(e,t){const n=h(t);if(null!=n)switch(e.type){case"simple-marker":e.size=n;break;case"picture-marker":{const t=e.width/e.height;t>1?(e.width=n,e.height=n*t):(e.width=n*t,e.height=n);break}case"simple-line":e.width=n;break;case"text":e.font.size=n}}(e,t))}function g(e,t,n){if(e&&null!=t)if((0,p.wk)(e)){const i=e.symbolLayers;i&&i.forEach(e=>{if("object"===e.type)switch(n){case"tilt":e.tilt=(e.tilt??0)+t;break;case"roll":e.roll=(e.roll??0)+t;break;default:e.heading=(e.heading??0)+t}"icon"===e.type&&(e.angle+=t)})}else if((0,p.$y)(e))switch(e.type){case"simple-marker":case"picture-marker":case"text":e.angle+=t;break;case"cim":(0,s.KU)(e,t,!0)}}},37730:(e,t,n)=>{n.d(t,{T:()=>r});var i=n(43334);const r={getObjectId:e=>e.objectId,getAttributes:e=>e.attributes,getAttribute:(e,t)=>e.attributes[t],cloneWithGeometry:(e,t)=>new i.Om(t,e.attributes,null,e.objectId),getGeometry:e=>e.geometry,getCentroid:(e,t)=>e.ensureCentroid(t)}},40662:(e,t,n)=>{n.d(t,{A:()=>s});var i=n(31635),r=n(91429),o=n(77901);let s=class extends o.A{constructor(e){super(e)}};s=(0,i.Cg)([(0,r.$K)("esri.rest.knowledgeGraph.ObjectValue")],s)},42095:(e,t,n)=>{n.d(t,{A:()=>a});var i=n(31635),r=n(25482),o=n(91429),s=n(77901);let a=class extends r.o{constructor(e){super(e),this.path=[]}};(0,i.Cg)([(0,o.MZ)({type:[s.A],json:{write:!0}})],a.prototype,"path",void 0),a=(0,i.Cg)([(0,o.$K)("esri.rest.knowledgeGraph.Path")],a)},42538:(e,t,n)=>{n.d(t,{A:()=>l});var i=n(31635),r=n(91429),o=n(16930),s=n(69622);let a=class extends s.A{constructor(e){super(e),this.openCypherQuery=""}};(0,i.Cg)([(0,r.MZ)()],a.prototype,"openCypherQuery",void 0),a=(0,i.Cg)([(0,r.$K)("esri.rest.knowledgeGraph.GraphQuery")],a);let l=class extends a{constructor(e){super(e),this.bindParameters=null,this.bindGeometryQuantizationParameters=null,this.outputQuantizationParameters=null,this.outputSpatialReference=null,this.provenanceBehavior=null}};(0,i.Cg)([(0,r.MZ)()],l.prototype,"bindParameters",void 0),(0,i.Cg)([(0,r.MZ)()],l.prototype,"bindGeometryQuantizationParameters",void 0),(0,i.Cg)([(0,r.MZ)()],l.prototype,"outputQuantizationParameters",void 0),(0,i.Cg)([(0,r.MZ)({type:o.A})],l.prototype,"outputSpatialReference",void 0),(0,i.Cg)([(0,r.MZ)()],l.prototype,"provenanceBehavior",void 0),l=(0,i.Cg)([(0,r.$K)("esri.rest.knowledgeGraph.GraphQueryStreaming")],l)},54238:(e,t,n)=>{n.d(t,{A:()=>s});var i=n(31635),r=n(91429),o=n(77901);let s=class extends o.A{constructor(e){super(e),this.typeName=null,this.id=null}};(0,i.Cg)([(0,r.MZ)({type:String,json:{write:!0}})],s.prototype,"typeName",void 0),(0,i.Cg)([(0,r.MZ)({type:String,json:{write:!0}})],s.prototype,"id",void 0),s=(0,i.Cg)([(0,r.$K)("esri.rest.knowledgeGraph.GraphNamedObject")],s)},54898:(e,t,n)=>{n.d(t,{Gz:()=>$,O9:()=>G,hZ:()=>P,CP:()=>q,dD:()=>Z,UT:()=>R,MY:()=>F,Td:()=>D,iW:()=>j,e$:()=>B,qN:()=>k});var i=n(68197),r=n(49186),o=n(91869),s=(n(85105),n(58769));n(39410),n(33421),n(21774),n(93885);const a=s.A;var l=n(965),p=n(91218),d=n(16930),u=n(17136),c=n(99352),h=n(15375),y=n(29005),m=n(46499),f=n(73913),g=n(77548),b=n(48441),w=n(25927),_=n(31635),M=n(69622),I=n(91429);let T=class extends M.A{constructor(e){super(e),this.entityAdds=void 0,this.entityUpdates=void 0,this.entityDeletes=void 0,this.relationshipAdds=void 0,this.relationshipUpdates=void 0,this.relationshipDeletes=void 0,this.options=void 0}};(0,_.Cg)([(0,I.MZ)()],T.prototype,"entityAdds",void 0),(0,_.Cg)([(0,I.MZ)()],T.prototype,"entityUpdates",void 0),(0,_.Cg)([(0,I.MZ)()],T.prototype,"entityDeletes",void 0),(0,_.Cg)([(0,I.MZ)()],T.prototype,"relationshipAdds",void 0),(0,_.Cg)([(0,I.MZ)()],T.prototype,"relationshipUpdates",void 0),(0,_.Cg)([(0,I.MZ)()],T.prototype,"relationshipDeletes",void 0),(0,_.Cg)([(0,I.MZ)()],T.prototype,"options",void 0),T=(0,_.Cg)([(0,I.$K)("esri.rest.knowledgeGraph.GraphApplyEdits")],T);var C=n(23150),v=n(54218),A=n(40863),x=n(68249);const E={initializeLayersFromClientData:async(e,t,n)=>{if(t||(t=[...e.layers,...e.tables].map(e=>e.graphTypeName)),0===t?.length)return;const i=new Map;for(const n of t)i.set(n,S(e,n));const r=await(0,b.fetchClientDataAtKeys)(e.dataManager.knowledgeGraph,Array.from(i.values()),{requestOptions:{signal:n?.signal}});for(const t of[...e.layers,...e.tables]){const n=t.objectType.name;if(null==n)continue;const i=r.get(S(e,n));if(i){const e=JSON.parse(i);null===e||"object"!=typeof e||e.hasOwnProperty("showLabels")||(e.showLabels=!1),t.read(e,{origin:"service"})}}},getInclusionDefinitionFromCypherResults:async(e,t,n)=>{const i=U(e.dataModel),r=(await(0,b.executeQueryStreaming)(e,t,n)).resultRowsStream.getReader();for(;;){const{done:e,value:t}=await r.read();if(e)break;for(const e of t)for(const t of e)z(t,i)}return i},getInclusionDefinitionFromIdTypePairs:(e,t)=>{const n=U(e.dataModel);for(const{id:e,typeName:i}of t){const t=n.namedTypeDefinitions.get(i);if(!t)throw new r.A("WebLinkChart:data-model-desync","The provided id-type pairs contained a named type not reflected in the provided knowledge graph data model.");t.members?.set(e,{id:e})}return n}},S=(e,t)=>"knowledge-graph"===e.type?`${t}/Map`:`${t}/LinkChart/LinkChartSubLayer`;async function k(e,t,n){return E.initializeLayersFromClientData(e,t,n)}const N=["#4a0932","#b31515","#18382e","#a64f1b","#102432","#8c213f","#ed9310","#2c6954","#144d59","#ffc730","#75351e","#454f4b","#78b1c2","#191921","#8f8f82","#9be0c0","#dbb658","#87b051","#11495c","#c43541","#9c5596","#44498b","#ad9d63","#86afb3","#5c98ca","#b0bfa2","#73241f","#b86b53","#d9d78c","#3e756d","#f260a1","#a0d17d","#c27c30","#eb82eb","#ffdf3c","#ffb259","#ab52b3","#3cccb4","#0095ba","#d92b30"],L="#8f8f82";function D(e){return e<0||e>=N.length?new i.A(L):new i.A(N[e])}function R(e){const t=e.toArray();return new A.A({data:{type:"CIMSymbolReference",symbol:{type:"CIMLineSymbol",symbolLayers:[{type:"CIMSolidStroke",enable:!0,style:"solid",width:.75,color:t},{type:"CIMVectorMarker",enable:!0,size:6,markerPlacement:{type:"CIMMarkerPlacementOnLine",angleToLine:!0,relativeTo:"LineMiddle"},frame:{xmin:-10,ymin:-5,xmax:0,ymax:5},markerGraphics:[{type:"CIMMarkerGraphic",geometry:{rings:[[[-12,-3.47],[-12,3.6],[1.96,-.03],[-12,-3.47]]]},symbol:{type:"CIMPolygonSymbol",symbolLayers:[{type:"CIMSolidFill",enable:!0,color:t}]}}]}]}}})}function F(e){let t="ESRI__ID",n=4;for(const i of e)if(i.name){if("name"===i.name.toLowerCase()){t=i.name;break}i.name.toLowerCase().includes("name")?(t=i.name,n=2):"esriFieldTypeString"===i.fieldType&&n>3&&(t=i.name,n=3)}return t}function j(e,t,n){const i={color:[80,80,80],haloColor:[255,255,255],haloSize:.7,font:{size:10,weight:"normal"}},r=new m.A({labelExpressionInfo:new f.A({expression:"ESRI__ID"===n?`${t}`:`$feature.${n}`}),labelPlacement:"above-center",symbol:new x.A(i)}),o=new m.A({labelExpressionInfo:new f.A({expression:`'${t}' + IIf($feature.ESRI__AggregationCount>1, ' (' + $feature.ESRI__AggregationCount + ')', '')`}),labelPlacement:"center-along",labelPosition:"parallel",repeatLabel:!1,symbol:new x.A({...i,yoffset:"12px"})});return"entity"===e?[r]:[o]}function B(e,t,n){const i={color:[255,255,255],haloColor:[0,0,0],haloSize:.7,font:{size:10,weight:"bold"}},r="ESRI__ID"===n?`${e}`:`$feature.${n}`;return"point"===t?[new m.A({labelExpressionInfo:new f.A({expression:r}),labelPlacement:"above-center",symbol:new x.A(i)})]:"polyline"===t?[new m.A({labelExpressionInfo:new f.A({expression:r}),labelPlacement:"center-along",repeatLabel:!0,symbol:new x.A(i)})]:"polygon"===t?[new m.A({labelExpressionInfo:new f.A({expression:r}),labelPlacement:"always-horizontal",symbol:new x.A(i)})]:null}const O={capabilities:[],allowGeometryUpdates:!1,serviceCapabilities:{geometryCapabilities:{supportsZValues:!1,supportsMValues:!1}}};function P(e){const{capabilities:t,allowGeometryUpdates:n,serviceCapabilities:{geometryCapabilities:{supportsZValues:i,supportsMValues:r}}}=e?.serviceDefinition||O,o=e?.dataModel.arcgisManaged?t:t.filter(e=>"Query"===e),s=new Set(o);return{analytics:{supportsCacheHint:!1},attachment:null,data:{isVersioned:!1,isBranchVersioned:!1,supportsAttachment:!1,supportsM:r,supportsZ:i},metadata:{supportsAdvancedFieldProperties:!1},operations:{supportsCalculate:!1,supportsTruncate:!1,supportsValidateSql:!1,supportsAdd:s.has("Create"),supportsDelete:s.has("Delete"),supportsEditing:s.has("Editing"),supportsChangeTracking:!1,supportsQuery:s.has("Query"),supportsQueryBins:!1,supportsQueryPivot:!1,supportsQueryAnalytics:!1,supportsQueryAttachments:!1,supportsQueryTopFeatures:!1,supportsResizeAttachments:!1,supportsSync:!1,supportsUpdate:s.has("Update"),supportsExceedsLimitStatistics:!1,supportsAsyncConvert3D:!1},query:c.F,queryRelated:{supportsCount:!1,supportsOrderBy:!1,supportsPagination:!1,supportsCacheHint:!1},queryTopFeatures:{supportsCacheHint:!1},queryAttributeBins:c.P,editing:{supportsGeometryUpdate:!!e?.dataModel.arcgisManaged&&n,supportsGlobalId:!1,supportsReturnServiceEditsInSourceSpatialReference:!1,supportsRollbackOnFailure:!1,supportsUpdateWithoutM:!1,supportsUploadWithItemId:!1,supportsDeleteByAnonymous:!1,supportsDeleteByOthers:s.has("Delete"),supportsUpdateByAnonymous:!1,supportsUpdateByOthers:s.has("Update"),supportsAsyncApplyEdits:!1,zDefault:void 0}}}async function G(e,t){const n=new T,i=t.graphTypeName,r=t.graphType,s="knowledge-graph"===t.parentCompositeLayer.type?t.geometryFieldName:null,a=!!t.fieldsIndex.get(s)?.editable,l=e=>{const n={...e};for(const e of t.fields)e.editable||delete n[e.name];for(const t of Object.keys(e))t.includes("ESRI__")&&delete n[t];return n},c=async e=>{await(0,p.initializeProjection)(e.spatialReference,d.A.WGS84);const t=(0,p.project)(e,d.A.WGS84);return"point"===t.type?t.normalize():(await(0,u.el)(t))[0]};for(const t of e.addFeatures??[]){const e=l(t.attributes);(0,g.UC)(t.sourceLayer)&&t.sourceLayer.graphTypeName===i&&("entity"===r?(n.entityAdds||(n.entityAdds=[]),s&&t.geometry&&(e[s]=await c(t.geometry)),n.entityAdds.push(new w.A({properties:e,typeName:i}))):(n.relationshipAdds||(n.relationshipAdds=[]),n.relationshipAdds.push(new C.A({properties:e,typeName:i}))))}for(const t of e.updateFeatures??[]){const e=t.attributes[h.dr],o=l(t.attributes);(0,g.UC)(t.sourceLayer)&&t.sourceLayer.graphTypeName===i&&("entity"===r?(n.entityUpdates||(n.entityUpdates=[]),s&&a&&t.geometry&&(o[s]=await c(t.geometry)),n.entityUpdates.push(new w.A({id:e,properties:o,typeName:i}))):(n.relationshipUpdates||(n.relationshipUpdates=[]),n.relationshipUpdates.push(new C.A({id:e,properties:o,typeName:i}))))}const y=new Map;for(const t of e.deleteFeatures??[])if((0,v.DU)(t)){const e=t,n=(0,o.tE)(y,e.sourceLayer.graphTypeName,()=>({typeName:e.sourceLayer.graphTypeName,ids:[]}));e.sourceLayer.graphTypeName===i&&n.ids.push(e.attributes[h.dr])}else t.objectId&&"string"==typeof t.objectId&&(0,o.tE)(y,i,()=>({typeName:i,ids:[]})).ids.push(t.objectId);for(const e of y.values())e.ids.length>0&&("entity"===r?(n.entityDeletes||(n.entityDeletes=[]),n.entityDeletes.push({typeName:e.typeName,ids:e.ids})):(n.relationshipDeletes||(n.relationshipDeletes=[]),n.relationshipDeletes.push({typeName:e.typeName,ids:e.ids})));return n}function $(e,t){const n={addFeatureResults:[],updateFeatureResults:[],deleteFeatureResults:[],addAttachmentResults:[],updateAttachmentResults:[],deleteAttachmentResults:[]};for(const i of e.editResults)if(i.typeName===t){for(const e of i.adds)n.addFeatureResults.push({objectId:e.id,globalId:e.id});for(const e of i.updates)n.updateFeatureResults.push({objectId:e.id,globalId:e.id});for(const e of i.deletes)n.deleteFeatureResults.push({objectId:e.id,globalId:e.id})}return n}function Z(e){if(!e.objectType)return null;const t=[];for(const n of e.fields)!n.name.includes("ESRI__")&&n.editable&&"geometry"!==n.type&&t.push(new a({fieldName:n.name}));return new l.A({elements:t})}function q(e){if(!e.objectType)return null;let t=null;switch(e.geometryType){case"point":case"multipoint":t="point";break;case"polyline":t="line";break;case"polygon":t="polygon";break;default:t=null}return[new y.A({name:e.graphTypeName,drawingTool:t,prototype:{}})]}function U(e){const t={namedTypeDefinitions:new Map,generateAllSublayers:!1},{entityTypes:n,relationshipTypes:i}=e,r=[...n,...i];for(const e of r)t.namedTypeDefinitions.set(e.name,{useAllData:!1,members:new Map});return t}function z(e,t){if(e&&"object"==typeof e)if(function(e){return!(!e||"object"!=typeof e||Array.isArray(e))&&"id"in e&&"typeName"in e}(e)){const n=t.namedTypeDefinitions.get(e.typeName);if(!n)throw new r.A("WebLinkChart:data-model-desync","The query result contained a named type not reflected in the provided knowledge graph data model.");n.members.set(e.id,{id:e.id})}else if(function(e){return!(!e||"object"!=typeof e||Array.isArray(e))&&e&&"path"in e&&Array.isArray(e.path)}(e))for(const n of e.path)z(n,t);else if(Array.isArray(e))for(const n of e)z(n,t);else if(function(e){return!(!e||"object"!=typeof e||Array.isArray(e)||"id"in e)&&"properties"in e&&"object"==typeof e.properties}(e))for(const n of Object.values(e.properties??{}))z(n,t)}},62046:(e,t,n)=>{n.d(t,{Fe:()=>d,KU:()=>y,Nk:()=>o});var i=n(68197),r=n(93397);function o(e){const t=[];return s((0,r.lW)(e),t),t.length?new i.A((0,r.e6)(t[0])):null}function s(e,t){if(!e)return;let n;n="CIMTextSymbol"===e.type?e.symbol:e;const i="CIMPolygonSymbol"===e.type;if(n?.symbolLayers)for(const e of n.symbolLayers)if(!(e.colorLocked||i&&((0,r.mA)(e)||(0,r.MM)(e)&&e.markerPlacement&&(0,r.zr)(e.markerPlacement))))switch(e.type){case"CIMPictureMarker":case"CIMPictureStroke":case"CIMPictureFill":e.tintColor&&a(t,e.tintColor);break;case"CIMVectorMarker":e.markerGraphics?.forEach(e=>{s(e.symbol,t)});break;case"CIMSolidStroke":case"CIMSolidFill":a(t,e.color);break;case"CIMGradientFill":l(t,e);break;case"CIMHatchFill":s(e.lineSymbol,t)}}function a(e,t){for(const n of e)if(n.join(".")===t.join("."))return;e.push(t)}function l(e,t){const n=t.colorRamp?.type;switch(n){case"CIMMultipartColorRamp":t.colorRamp.colorRamps?.forEach(t=>{"CIMLinearContinuousColorRamp"===t.type&&p(e,t)});break;case"CIMLinearContinuousColorRamp":case"CIMPolarContinuousColorRamp":p(e,t.colorRamp)}}function p(e,t){t&&(t.fromColor&&a(e,t.fromColor),t.toColor&&a(e,t.toColor))}function d(e,t,n){t instanceof i.A||(t=new i.A(t));const o=(0,r.lW)(e);o&&u(o,t,n)}function u(e,t,n){if(!e)return;let i;i="CIMTextSymbol"===e.type?e.symbol:e;const o="CIMPolygonSymbol"===i?.type;if(i?.symbolLayers)for(const e of i.symbolLayers){if(e.colorLocked)continue;if(o)if(n){const{layersToColor:t}=n;if(((0,r.mA)(e)||(0,r.MM)(e)&&e.markerPlacement&&(0,r.zr)(e.markerPlacement))&&"fill"===t||(0,r.jn)(e)&&"outline"===t)continue}else if((0,r.mA)(e)||(0,r.MM)(e)&&e.markerPlacement&&(0,r.zr)(e.markerPlacement))continue;const i=t.toArray();switch(e.type){case"CIMPictureMarker":case"CIMPictureStroke":case"CIMPictureFill":e.tintColor=i;break;case"CIMVectorMarker":e.markerGraphics?.forEach(e=>{u(e.symbol,t,n)});break;case"CIMSolidStroke":case"CIMSolidFill":e.color=i;break;case"CIMGradientFill":c(e,t);break;case"CIMHatchFill":u(e.lineSymbol,t,n)}}}function c(e,t){const n=e.colorRamp?.type;switch(n){case"CIMMultipartColorRamp":e.colorRamp.colorRamps?.forEach(e=>{"CIMLinearContinuousColorRamp"===e.type&&h(e,t)});break;case"CIMLinearContinuousColorRamp":case"CIMPolarContinuousColorRamp":h(e.colorRamp,t)}}function h(e,t){if(e&&(e.fromColor&&(e.fromColor=t.toArray()),e.toColor)){const n=t.clone();n.a=0,e.toColor=n.toArray()}}function y(e,t,n=!1){const i=(0,r.lW)(e);if(n&&(t=360-t),"CIMTextSymbol"!==i?.type){if("CIMPointSymbol"===i?.type&&i.symbolLayers){const e=t-(i.angle||0);for(const t of i.symbolLayers)if((0,r.MM)(t)){let n=t.rotation||0;t.rotateClockwise?n-=e:n+=e,t.rotation=n}i.angle=t}}else i.angle=t}},62796:(e,t,n)=>{n.d(t,{A:()=>ce});var i=n(31635),r=n(37838),o=n(49186),s=n(4718),a=n(53966),l=n(25728),p=n(91429),d=(n(29953),n(5443)),u=n(86738),c=n(39829),h=n(82799),y=n(91218),m=n(16930),f=n(21325),g=n(50498),b=n(55156),w=n(60950),_=n(89808),M=n(99959);const I=Symbol("isKnowledgeGraphGraphicOriginSymbol");var T;class C extends M.A{get[(T=I,w.ym)](){return this.sublayer}get[b.e](){return this.sublayer}get[_.Q](){return this.sublayer}constructor(e,t){super(),this[T]=!0,this.type="knowledge-graph",this.layer=e,this.sublayer=t}get id(){return this.layer.id}}const v=Symbol("isLinkChartGraphicOriginSymbol");var A;class x extends M.A{get[(A=v,_.Q)](){return this.layer}constructor(e,t){super(),this[A]=!0,this.type="link-chart",this.layer=e,this.sublayer=t}get id(){return`${this.layer.id}:__${this.sublayer.id}__`}}var E=n(4146),S=n(83221),k=n(56390),N=n(64714),L=n(15375);const D=(0,n(17036).p)(),R=e=>{const t=e;let n=class extends t{constructor(){super(...arguments),this.fields=[],this.fieldsIndex=null}};return(0,i.Cg)([(0,p.MZ)(D.fields)],n.prototype,"fields",void 0),(0,i.Cg)([(0,p.MZ)(D.fieldsIndex)],n.prototype,"fieldsIndex",void 0),n=(0,i.Cg)([(0,p.$K)("esri.layers.knowledgeGraph.KnowledgeGraphSublayerBase")],n),n};var F=n(54898),j=n(63074),B=n(6455),O=n(87718),P=n(56658),G=n(32756),$=n(54310),Z=n(25036),q=n(82935),U=n(10873),z=n(13213),Q=n(20437),Y=n(30524),H=n(46499),W=n(39383),K=n(96184),X=n(96576),V=n(65494),J=n(41214),ee=n(48441),te=n(22671),ne=n(61956),ie=n(30291),re=n(37531),oe=n(61322),se=n(43937);function ae(e){if(!e.json)return e;e.json.write=le(e.json.write);const t=e.json.origins;if(!t)return e;let n;for(n in t){const e=t[n];e&&(e.write=le(e.write))}return e}function le(e){return"object"==typeof e&&e?(!1!==e.enabled&&(e.overridePolicy=function(e){const{target:t,writer:n,overridePolicy:i,...r}=e;return function(e,t){const n=de.call(this,e,t);return n.enabled?{...r,...n}:n}}(e)),e):!0===e?pe():e}function pe(){return{overridePolicy:de}}function de(e,t){const n=!!this.geometryType;let i={enabled:n};return n&&(i={...i,...ue.call(this,e,t)}),i}function ue(e,t){return{ignoreOrigin:this.originIdOf(t)>0}}let ce=class extends(R((0,B.FJ)((0,P.J)((0,O.F)((0,j.dM)((0,G.fY)((0,q.e)((0,Z.j)((0,$.J)((0,l.P)(E.A))))))))))){constructor(e){super(e),this.blendMode="normal",this.charts=null,this.definitionExpression=null,this.displayFilterEnabled=!0,this.displayFilterInfo=null,this.effect=null,this.elevationInfo=null,this.featureEffect=null,this.graphType=null,this.labelsVisible=!0,this.layerType=null,this.legendEnabled=!0,this.maxScale=0,this.minScale=0,this.objectIdField=L.dr,this.objectType=null,this.opacity=1,this.orderBy=null,this.parent=null,this.parentCompositeLayer=null,this.persistenceEnabled=!0,this.popupEnabled=!0,this.popupTemplate=null,this.refreshInterval=0,this.source={openPorts:()=>this.load().then(()=>{const e=new MessageChannel;return new oe.default(e.port1,{channel:e,client:{queryFeatures:(e,t={})=>{const n=ne.A.fromJSON(e);return this.queryFeaturesJSON(n,t)}}}),[e.port2]})},this.type="knowledge-graph-sublayer",this.useViewTime=!0,this.visible=!0}get capabilities(){return this.parent?this.parent.sublayerCapabilities:(0,F.hZ)(null)}get userHasUpdateItemPrivileges(){return!!this.parent?.userHasUpdateItemPrivileges}get editingEnabled(){return this._isOverridden("editingEnabled")?this._get("editingEnabled"):this.capabilities.operations.supportsEditing}set editingEnabled(e){this._overrideIfSome("editingEnabled",e)}get isTable(){return"link-chart"!==this.parentCompositeLayer?.type&&null==this.geometryFieldName}get defaultPopupTemplate(){return this.createPopupTemplate()}set featureReduction(e){const t=this._normalizeFeatureReduction(e);this._set("featureReduction",t)}get fields(){const e=[];return this.objectType?.properties?.forEach(t=>{const n="esriFieldTypeOID"===t.fieldType?"esriFieldTypeInteger":t.fieldType;e.push(Q.A.fromJSON({name:t.name,type:n,alias:t.alias,defaultValue:t.defaultValue,editable:t.editable,nullable:t.nullable}))}),e.push(Q.A.fromJSON({name:this.objectIdField,type:"esriFieldTypeString",alias:this.objectIdField,editable:!1}),Q.A.fromJSON({name:L.M1,type:"esriFieldTypeInteger",alias:L.M1,editable:!1}),Q.A.fromJSON({name:L.BL,type:"esriFieldTypeInteger",alias:L.BL,editable:!1})),e}get formTemplate(){return this._isOverridden("formTemplate")?this._get("formTemplate"):(0,F.dD)(this)}set formTemplate(e){this._overrideIfSome("formTemplate",e)}get geometryType(){if("link-chart"===this.parentCompositeLayer?.type)return"relationship"===this.graphType?"polyline":"point";const e=this.parentCompositeLayer?.dataManager.geographicLookup.get(this.objectType?.name),t=e?.geometryType;return t&&"esriGeometryNull"!==t?g.gy.fromJSON(t):null}get geometryFieldName(){if("link-chart"===this.parentCompositeLayer?.type)return L.T1;const e=this.parentCompositeLayer?.dataManager.geographicLookup.get(this.objectType?.name);return e?.name??null}get graphicOrigin(){if(!this.parent)return null;switch(this.parent.type){case"knowledge-graph":return new C(this.parent,this);case"link-chart":return new x(this.parent,this)}}get graphTypeName(){return this.objectType?.name}set graphTypeName(e){this._set("graphTypeName",e)}get hasM(){const e=this.parentCompositeLayer?.dataManager.geographicLookup.get(this.objectType?.name),t=e?.name,n=t?this.objectType?.properties?.[t]:null;return n?.hasM??!1}get hasZ(){const e=this.parentCompositeLayer?.dataManager.geographicLookup.get(this.objectType?.name),t=e?.name,n=t?this.objectType?.properties?.[t]:null;return n?.hasZ??!1}set labelingInfo(e){this._set("labelingInfo",e)}get labelingInfo(){if(this._isOverridden("labelingInfo"))return this._get("labelingInfo");if(!this.objectType||!this.parentCompositeLayer||!this.graphTypeName)return null;const e=this.objectType.properties?(0,F.MY)(this.objectType.properties):"ESRI__ID";return"link-chart"===this.parentCompositeLayer.type?(0,F.iW)(this.graphType,this.graphTypeName,e):(0,F.e$)(this.graphTypeName,this.geometryType,e)}set renderer(e){(0,Y.yp)(e,this.fieldsIndex),this._set("renderer",e)}get renderer(){if(this._isOverridden("renderer"))return this._get("renderer");const e=this.parentCompositeLayer?.dataManager?.knowledgeGraph?.dataModel,t=[...e?.entityTypes??[],...e?.relationshipTypes??[]].map(e=>e.name).indexOf(this.graphTypeName),n=(0,F.Td)(t);if("link-chart"===this.parentCompositeLayer?.type){if("relationship"===this.graphType)return new X.A({type:"simple",symbol:(0,F.UT)(n)});const e=(0,V.r)((0,N.F0)(g.gy.toJSON("point")).renderer);return(0,re.dt)(e.symbol,n),e}const i=(0,V.r)((0,N.F0)(g.gy.toJSON(this.geometryType)).renderer);return(0,re.dt)(i.symbol,n),i}get spatialReference(){return this.parentCompositeLayer?.dataManager?.knowledgeGraph?.dataModel?.spatialReference??m.A.WGS84}get templates(){return this._isOverridden("templates")?this._get("templates"):(0,F.CP)(this)}set templates(e){this._overrideIfSome("templates",e)}set timeInfo(e){this._set("timeInfo",e)}get title(){return this._isOverridden("title")?this._get("title"):this.graphTypeName}set title(e){this._set("title",e)}writeTitle(e,t){t.title=e??"Layer"}createPopupTemplate(e){return(0,ie.tn)(this,e)}createQuery(){return new ne.A({where:"1=1",outFields:["*"]})}getField(e){return this.fieldsIndex.get(e)}getFieldDomain(e,t){return null}async queryFeatures(e,t){await this.load();const{resolvedQuery:n,queryEngine:i}=await this._setupQueryObjects(e),r=this.graphicOrigin,o=te.A.fromJSON(await i.executeQuery(n.toJSON(),t?.signal));return o.features.forEach(e=>{e.sourceLayer=this,e.origin=r}),o}async queryFeaturesJSON(e,t){await this.load();const{resolvedQuery:n,queryEngine:i}=await this._setupQueryObjects(e);return await i.executeQuery(n.toJSON(),t?.signal)}async queryFeatureCount(e,t){await this.load();const{resolvedQuery:n,queryEngine:i}=await this._setupQueryObjects(e);return i.executeQueryForCount(n.toJSON(),t?.signal)}async queryExtent(e={},t){await this.load();const n={...e,returnGeometry:!0},{resolvedQuery:i,queryEngine:r}=await this._setupQueryObjects(n),o=await r.executeQueryForExtent(i.toJSON(),t?.signal);let s;return s=null!=o.extent?.xmin&&null!=o.extent?.xmax&&null!=o.extent?.ymin&&null!=o.extent?.ymax?new d.A(o.extent):new d.A,{count:o.count,extent:s}}async queryObjectIds(e,t){await this.load();const n=ne.A.from(e);let i;if("link-chart"===this.parentCompositeLayer.type&&this._cachedQueryEngine)i=this._cachedQueryEngine;else{const e=await this.parentCompositeLayer.dataManager.getData(n,this,t);i=this.loadQueryEngine(e)}return await i.executeQueryForIds(n.toJSON(),t?.signal)}async applyEdits(e){if(!this.parentCompositeLayer.dataManager.knowledgeGraph)throw new o.A("knowledge-graph-sublayer:no-knowledge-graph","ApplyEdits cannot be executed because the parent does not have a Knowledge Graph model. This is usually caused by the layer not yet being loaded");const t=await(0,F.O9)(e,this);t.options={cascadeDelete:!0,cascadeProvenanceDelete:!!this.parent?.knowledgeGraph.serviceDefinition.supportsProvenance||void 0};const n=await(0,ee.executeApplyEdits)(this.parentCompositeLayer.dataManager.knowledgeGraph,t),i=(0,F.Gz)(n,this.graphTypeName),r={addedFeatures:i.addFeatureResults,updatedFeatures:i.updateFeatureResults,deletedFeatures:i.deleteFeatureResults,addedAttachments:i.addAttachmentResults,deletedAttachments:i.deleteAttachmentResults,updatedAttachments:i.updateAttachmentResults,exceededTransferLimit:!1,historicMoment:new Date,edits:void 0};return this.emit("edits",r),this.emit("apply-edits",{result:Promise.resolve(r)}),"link-chart"===this.parentCompositeLayer.type&&await this.parentCompositeLayer.refreshLinkChartCache([...r.addedFeatures.map(e=>e.globalId),...r.updatedFeatures.map(e=>e.globalId),...r.deletedFeatures.map(e=>e.globalId)]),i}loadQueryEngine(e){const t=new S.A({geometryType:g.gy.toJSON(this.geometryType),hasM:this.hasM,hasZ:this.hasZ}),n=new k.do({fieldsIndex:this.fieldsIndex.toJSON(),geometryType:g.gy.toJSON(this.geometryType),hasM:this.hasM,hasZ:this.hasZ,featureIdInfo:{type:"object-id",fieldName:this.objectIdField},spatialReference:this.spatialReference.toJSON(),timeInfo:this.timeInfo?.toJSON(),featureStore:t});return n.featureStore.addMany(e),n}async refreshCachedQueryEngine(){const e=await this.parentCompositeLayer.dataManager.getData(new ne.A({where:"1=1",outFields:[L.dr]}),this);this._cachedQueryEngine=this.loadQueryEngine(e)}load(e){return this.addResolvingPromise(this.parent.load(e).then(()=>(0,Y.sv)(this.timeInfo,this.fieldsIndex))),Promise.resolve(this)}async _setupQueryObjects(e,t){const n=ne.A.from(e),i=n.geometry;if(i&&!i.spatialReference?.isWGS84&&(await(0,y.initializeProjection)(i.spatialReference,f.KK),n.geometry=(0,y.project)(i instanceof c.A||i instanceof h.A||i instanceof u.A?i:i.extent,f.KK)),"link-chart"===this.parentCompositeLayer.type&&this._cachedQueryEngine)return{resolvedQuery:n,queryEngine:this._cachedQueryEngine};const r=await this.parentCompositeLayer.dataManager.getData(n,this,t);return{resolvedQuery:n,queryEngine:this.loadQueryEngine(r)}}};(0,i.Cg)([(0,p.MZ)(ae((0,s.o8)(j.sU)))],ce.prototype,"blendMode",void 0),(0,i.Cg)([(0,p.MZ)({readOnly:!0})],ce.prototype,"capabilities",null),(0,i.Cg)([(0,p.MZ)({readOnly:!0})],ce.prototype,"userHasUpdateItemPrivileges",null),(0,i.Cg)([(0,p.MZ)({type:Boolean})],ce.prototype,"editingEnabled",null),(0,i.Cg)([(0,p.MZ)()],ce.prototype,"isTable",null),(0,i.Cg)([(0,p.MZ)({json:{origins:{"web-scene":{write:!1}},write:pe()}})],ce.prototype,"charts",void 0),(0,i.Cg)([(0,p.MZ)({readOnly:!0})],ce.prototype,"defaultPopupTemplate",null),(0,i.Cg)([(0,p.MZ)({type:String,json:{origins:{service:{read:!1}},name:"layerDefinition.definitionExpression",write:{ignoreOrigin:!0}}})],ce.prototype,"definitionExpression",void 0),(0,i.Cg)([(0,p.MZ)(ae((0,s.o8)(B.Dp)))],ce.prototype,"displayFilterEnabled",void 0),(0,i.Cg)([(0,p.MZ)(ae((0,s.o8)(B.KV)))],ce.prototype,"displayFilterInfo",void 0),(0,i.Cg)([(0,p.MZ)(ae((0,s.o8)(j.LF)))],ce.prototype,"effect",void 0),(0,i.Cg)([(0,p.MZ)()],ce.prototype,"elevationInfo",void 0),(0,i.Cg)([(0,p.MZ)(ae((0,s.o8)(O.Y)))],ce.prototype,"featureEffect",void 0),(0,i.Cg)([(0,p.MZ)(ae((0,s.o8)(z.d)))],ce.prototype,"featureReduction",null),(0,i.Cg)([(0,p.MZ)()],ce.prototype,"fields",null),(0,i.Cg)([(0,p.MZ)()],ce.prototype,"formTemplate",null),(0,i.Cg)([(0,p.MZ)()],ce.prototype,"geometryType",null),(0,i.Cg)([(0,p.MZ)()],ce.prototype,"geometryFieldName",null),(0,i.Cg)([(0,p.MZ)({readOnly:!0})],ce.prototype,"graphicOrigin",null),(0,i.Cg)([(0,p.MZ)({type:["entity","relationship"],nonNullable:!0,json:{write:{isRequired:!0,ignoreOrigin:!0}}})],ce.prototype,"graphType",void 0),(0,i.Cg)([(0,p.MZ)({type:String,nonNullable:!0,json:{write:{isRequired:!0,ignoreOrigin:!0}}})],ce.prototype,"graphTypeName",null),(0,i.Cg)([(0,p.MZ)()],ce.prototype,"hasM",null),(0,i.Cg)([(0,p.MZ)()],ce.prototype,"hasZ",null),(0,i.Cg)([(0,p.MZ)({type:String,json:{origins:{service:{read:!1},"portal-item":{read:!1}},write:{ignoreOrigin:!0}}})],ce.prototype,"id",void 0),(0,i.Cg)([(0,p.MZ)({type:Boolean,value:!0,nonNullable:!0,json:{name:"showLabels",default:!1,write:{overridePolicy(){return{enabled:!!this.geometryType,alwaysWriteDefaults:!0,ignoreOrigin:!0}}}}})],ce.prototype,"labelsVisible",void 0),(0,i.Cg)([(0,p.MZ)({type:[H.A],json:{name:"layerDefinition.drawingInfo.labelingInfo",read:function(e,t,n){const i=[["ESRI__AGGREGATION_COUNT",L.M1],["ESRI__ORIGIN_ID",L.Cz],["ESRI__DESTINATION_ID",L.KQ],["ESRI__LAYOUT_GEOMETRY",L.T1]];try{for(const t of e)for(const[e,n]of i)t.labelExpression=t.labelExpression?.replaceAll(e,n),t.labelExpressionInfo?.expression&&(t.labelExpressionInfo.expression=t.labelExpressionInfo.expression.replaceAll(e,n))}catch(e){a.A.getLogger(this).warn("Error updating labelingInfo",e)}return(0,W.w)(e,t,n)},write:pe()}})],ce.prototype,"labelingInfo",null),(0,i.Cg)([(0,p.MZ)({readOnly:!0,json:{read:!1,write:{writer(e,t){switch(this.parentCompositeLayer?.type){case"link-chart":t.layerType="LinkChartSubLayer";break;case"knowledge-graph":t.layerType=this.geometryType?"KnowledgeGraphSubLayer":"KnowledgeGraphSubTable"}},isRequired:!0,ignoreOrigin:!0,writerEnsuresNonNull:!0}}})],ce.prototype,"layerType",void 0),(0,i.Cg)([(0,p.MZ)(ae((0,s.o8)(U.fV)))],ce.prototype,"legendEnabled",void 0),(0,i.Cg)([(0,p.MZ)(ae((0,s.o8)(U.hG)))],ce.prototype,"maxScale",void 0),(0,i.Cg)([(0,p.MZ)(ae((0,s.o8)(U.hn)))],ce.prototype,"minScale",void 0),(0,i.Cg)([(0,p.MZ)()],ce.prototype,"objectIdField",void 0),(0,i.Cg)([(0,p.MZ)()],ce.prototype,"objectType",void 0),(0,i.Cg)([(0,p.MZ)(ae((0,s.o8)(U.ke)))],ce.prototype,"opacity",void 0),(0,i.Cg)([(0,p.MZ)(ae((0,s.o8)(G.ne)))],ce.prototype,"orderBy",void 0),(0,i.Cg)([(0,p.MZ)({clonable:!1})],ce.prototype,"parent",void 0),(0,i.Cg)([(0,p.MZ)()],ce.prototype,"parentCompositeLayer",void 0),(0,i.Cg)([(0,p.MZ)(ae((0,s.o8)(U.M6)))],ce.prototype,"popupEnabled",void 0),(0,i.Cg)([(0,p.MZ)({type:r.A,json:{name:"popupInfo",write:{ignoreOrigin:!0}}})],ce.prototype,"popupTemplate",void 0),(0,i.Cg)([(0,p.MZ)({type:Number,json:{write:{overridePolicy:ue}}})],ce.prototype,"refreshInterval",void 0),(0,i.Cg)([(0,p.MZ)({types:J.Hg,json:{name:"layerDefinition.drawingInfo.renderer",write:pe()}})],ce.prototype,"renderer",null),(0,i.Cg)([(0,p.MZ)()],ce.prototype,"source",void 0),(0,i.Cg)([(0,p.MZ)()],ce.prototype,"spatialReference",null),(0,i.Cg)([(0,p.MZ)()],ce.prototype,"templates",null),(0,i.Cg)([(0,p.MZ)({type:K.A,json:{name:"layerDefinition.timeInfo",write:{overridePolicy:ue},origins:{"web-document":{name:"layerDefinition.timeInfo",read:!0,write:{overridePolicy:ue}},"portal-item":{name:"layerDefinition.timeInfo",read:!0,write:{overridePolicy:ue}}}}})],ce.prototype,"timeInfo",null),(0,i.Cg)([(0,p.MZ)({type:String,json:{write:{isRequired:!0,ignoreOrigin:!0,writerEnsuresNonNull:!0}}})],ce.prototype,"title",null),(0,i.Cg)([(0,se.K)("title")],ce.prototype,"writeTitle",null),(0,i.Cg)([(0,p.MZ)({json:{read:!1}})],ce.prototype,"type",void 0),(0,i.Cg)([(0,p.MZ)(ae((0,s.o8)(q.B)))],ce.prototype,"useViewTime",void 0),(0,i.Cg)([(0,p.MZ)({type:Boolean,json:{name:"visibility",write:pe()}})],ce.prototype,"visible",void 0),ce=(0,i.Cg)([(0,p.$K)("esri.layers.knowledgeGraph.KnowledgeGraphSublayer")],ce)},64714:(e,t,n)=>{n.d(t,{F0:()=>a,Vx:()=>d,e2:()=>c,f:()=>h});var i=n(44208),r=n(4718),o=n(99352),s=n(93470);function a(e){return{renderer:{type:"simple",symbol:"esriGeometryPoint"===e||"esriGeometryMultipoint"===e?s.Cb:"esriGeometryPolyline"===e?s.yM:s.WR}}}const l=/^[_$a-zA-Z][_$a-zA-Z0-9]*$/;let p=1;function d(e,t){if((0,i.A)("esri-csp-restrictions"))return()=>({[t]:null,...e});try{let n=`this${u(t)} = null;`;for(const t in e)n+=`this${u(t)} = ${JSON.stringify(e[t])};`;const i=new Function(`\n return class AttributesClass$${p++} {\n constructor() {\n ${n};\n }\n }\n `)();return()=>new i}catch(n){return()=>({[t]:null,...e})}}function u(e){return l.test(e)?`.${e}`:`["${e}"]`}function c(e={}){return[{name:"New Feature",description:"",prototype:{attributes:(0,r.o8)(e)}}]}function h(e,t){return{analytics:{supportsCacheHint:!1},attachment:null,data:{isVersioned:!1,isBranchVersioned:!1,supportsAttachment:!1,supportsM:!1,supportsZ:e},metadata:{supportsAdvancedFieldProperties:!1},operations:{supportsCalculate:!1,supportsTruncate:!1,supportsValidateSql:!1,supportsAdd:t,supportsDelete:t,supportsEditing:t,supportsChangeTracking:!1,supportsQuery:!0,supportsQueryBins:!0,supportsQueryPivot:!1,supportsQueryAnalytics:!1,supportsQueryAttachments:!1,supportsQueryTopFeatures:!1,supportsResizeAttachments:!1,supportsSync:!1,supportsUpdate:t,supportsExceedsLimitStatistics:!0,supportsAsyncConvert3D:!1},query:o.F,queryRelated:{supportsCount:!0,supportsOrderBy:!0,supportsPagination:!0,supportsCacheHint:!1},queryTopFeatures:{supportsCacheHint:!1},queryAttributeBins:o.P,editing:{supportsGeometryUpdate:t,supportsGlobalId:!1,supportsReturnServiceEditsInSourceSpatialReference:!1,supportsRollbackOnFailure:!1,supportsUpdateWithoutM:!1,supportsUploadWithItemId:!1,supportsDeleteByAnonymous:!1,supportsDeleteByOthers:!1,supportsUpdateByAnonymous:!1,supportsUpdateByOthers:!1,supportsAsyncApplyEdits:!1,zDefault:void 0}}}},67996:(e,t,n)=>{n.d(t,{cZ:()=>S,XW:()=>D,fe:()=>k});var i=n(11254),r=n(49186),o=n(91869),s=(n(90708),n(92722)),a=n(16930);class l{constructor(){this.version="",this.queryResult=new p}}class p{constructor(){this.featureResult=new d}}class d{constructor(){this.objectIdFieldName="",this.uniqueIdField=new u,this.globalIdFieldName="",this.geohashFieldName="",this.geometryProperties=new c,this.geometryType=null,this.spatialReference=new a.A,this.exceededTransferLimit=!1,this.hasZ=!1,this.hasM=!1,this.transform=new h,this.fields=[],this.fieldNameToAttributeIndexMap={},this.values=[],this.features=[],this.geometryFields=[]}}class u{constructor(){this.name="",this.isSystemMaintained=!1}}class c{constructor(){this.shapeAreaFieldName="",this.shapeLengthFieldName="",this.units=""}}class h{constructor(){this.quantizeOriginPosition="upperLeft",this.scale=new y,this.translate=new m}}class y{constructor(){this.xScale=0,this.yScale=0,this.mScale=0,this.zScale=0}}class m{constructor(){this.xTranslate=0,this.yTranslate=0,this.mTranslate=0,this.zTranslate=0}}class f{constructor(){this.name="",this.fieldType="esriFieldTypeString",this.alias="",this.sqlType="sqlTypeVarchar",this.domain="",this.defaultValue=""}}class g{constructor(){this.attributes=[],this.compressedGeometry=new b,this.centroid=new b,this.aggregateGeometries=[]}}class b{constructor(){this.geometryType=null,this.lengths=[],this.coords=[]}}const w=["ELEMENTUID","TYPENAME"];var _=n(45724),M=n(35448);const I={upperLeft:0,lowerLeft:1},T={sqlTypeBigInt:0,sqlTypeBinary:1,sqlTypeBit:2,sqlTypeChar:3,sqlTypeDate:4,sqlTypeDecimal:5,sqlTypeDouble:6,sqlTypeFloat:7,sqlTypeGeometry:8,sqlTypeGUID:9,sqlTypeInteger:10,sqlTypeLongNVarchar:11,sqlTypeLongVarbinary:12,sqlTypeLongVarchar:13,sqlTypeNChar:14,sqlTypeNVarChar:15,sqlTypeOther:16,sqlTypeReal:17,sqlTypeSmallInt:18,sqlTypeSqlXml:19,sqlTypeTime:20,sqlTypeTimestamp:21,sqlTypeTimestamp2:22,sqlTypeTinyInt:23,sqlTypeVarbinary:24,sqlTypeVarchar:25};var C=n(93637);function v(e){const t=new b;t.geometryType=(0,C.i7)(M.bV,e.geometry_type.value);const n=[],i=[];for(let t=0;t<e.lengths.length;t++)n.push(e.lengths[t]);for(let t=0;t<e.coords.length;t++)i.push(e.coords[t]);return t.lengths=n,t.coords=i,t}function A(e){const t=new f;return t.name=e.name,t.alias=e.alias,t.fieldType=(0,C.i7)(M.r5,e.field_type.value),t.sqlType=(0,C.i7)(T,e.sql_type.value),t.domain=e.domain,t.defaultValue=e.default_value,t}function x(e){const t=A(e);return t.geometryType=(0,C.i7)(M.bV,e.geometry_type.value),t}function E(e){const t=new h;t.quantizeOriginPosition=(0,C.i7)(I,e.quantizeOriginPosition.value);const n=t.scale,i=e.scale;n.xScale=i.xScale,n.yScale=i.yScale,n.mScale=i.mScale,n.zScale=i.zScale;const r=t.translate,o=e.translate;return r.xTranslate=o.xTranslate,r.yTranslate=o.yTranslate,r.mTranslate=o.mTranslate,r.zTranslate=o.zTranslate,t}async function S(e,t,n){t??=!1;const s={generateAllSublayers:t,namedTypeDefinitions:new Map};return await async function(e,t){const n=await(0,i.A)(e,{responseType:"array-buffer",signal:t?.signal}),o=await n.data;return async function(e){const t=new((await(0,_.I)()).MapOfObjectIdentifierSetsDecoder),n=t.decode(new Uint8Array(e)),i=new Map;if(0!==n.error_code)throw new r.A("knowledge-graph:layer-support-utils",n.error_message);const o=t.get_map_of_identifier_sets(),s=o.keys,a=s.size();for(let e=0;e<a;e++){const t=s.get(e),n=o.query_identifier_set(t),a=[];if(1===n.id_array_type.value){const e=n.get_globalid_array(),t=e.count();for(let n=0;n<t;n++)a.push(e.get_globalid_at(n))}else if(3===n.id_array_type.value){const e=n.get_identifier_array(),t=e.count();for(let n=0;n<t;n++)a.push(e.get_identifier_at(n).toString())}else if(2===n.id_array_type.value){const e=n.get_string_array(),t=e.count();for(let n=0;n<t;n++)a.push(e.get_string_at(n))}else{if(0!==n.id_array_type.value)throw new r.A("knowledge-graph:layer-support-utils","Tried to encode an unexpected ID Array type.");{const e=n.get_oid_array(),t=e.count();for(let n=0;n<t;n++)a.push(e.get_objectid_at(n).toString())}}i.set(t,a)}return t.delete(),i}(new Uint8Array(o))}(e,n).then(e=>{!function(e,t){for(const[n,i]of e){const e=(0,o.tE)(t.namedTypeDefinitions,n,()=>({useAllData:!1,members:new Map}));for(const t of i)e.members.has(t)||e.members.set(t,{id:t})}}(e,s)}),s}async function k(e){const t=await(0,_.I)(),n=new t.MapOfObjectIdentifierSets;!function(e,t,n){for(const[i,r]of n.namedTypeDefinitions){if(!r.members||r.useAllData)continue;const n=r.members.keys();let o=!1,s=!0;const a=new t.ObjectIdArray,l=new t.StringArray,p=new t.GlobalIdArray,d=new t.IdentifierArray,u=new t.ObjectIdentifierSet;for(const e of n)s&&(o=!isNaN(Number(e)),s=!1),o?a.add_objectid(Number(e)):(l.add_string(e),p.add_globalid(e)),d.add_identifier(e);u.set_oid_array(a),u.set_string_array(l),u.set_globalid_array(p),u.set_identifier_array(d),a.delete(),l.delete(),p.delete(),d.delete(),e.put_identifier_set(i,u),u.delete()}}(n,t,e);const i=new t.MapOfObjectIdentifierSetsEncoder;try{i.set_map_of_identifier_sets(n),i.encode();const e=i.get_encoding_result();if(0!==e.error.error_code)throw new r.A("knowledge-graph:layer-support-utils",e.error.error_message);const t=structuredClone(e.get_byte_buffer());return i.delete(),t}finally{n.delete()}}async function N(e,t){const n=await(0,i.A)(e,{responseType:"array-buffer",signal:t?.signal});return async function(e){const t=new((await(0,_.I)()).FeatureCollectionDecoder),n=t.decode(new Uint8Array(e));if(0!==n.error_code)throw new r.A("knowledge-graph:layer-support-utils",n.error_message);const i=function(e){const t=new l;t.version=e.version;const n=e.get_query_result();if(0!==n.results_type.value)throw new Error("Got a non-feature collection type");const i=n.get_feature_result(),r=t.queryResult.featureResult;r.objectIdFieldName=i.objectid_field_name,r.exceededTransferLimit=i.exceeded_transfer_limit,r.hasM=i.has_m,r.hasZ=i.has_z,r.geometryType=(0,C.i7)(M.bV,i.geometry_type.value),r.globalIdFieldName=i.globalid_field_name,r.geohashFieldName=i.geohash_field_name;const o=r.uniqueIdField,s=i.unique_id_field;o.name=s.name,o.isSystemMaintained=s.isSystemMaintained;const a=r.geometryProperties,p=i.geometry_properties;a.shapeAreaFieldName=p.shapeAreaFieldName,a.shapeLengthFieldName=p.shapeLengthFieldName,a.units=p.units;const d=r.spatialReference,u=i.spatial_reference;d.wkid=u.wkid,d.latestWkid=u.latestWkid,d.vcsWkid=u.vcsWkid,d.latestVcsWkid=u.latestVcsWkid,d.wkt=u.wkt,r.transform=E(i.transform);const c=r.fields,h=r.fieldNameToAttributeIndexMap,y=i.fields,m=y.size();for(let e=0;e<m;e++){const t=y.get(e),n=A(t);c.push(n),h[n.name]=e,t.delete()}y.delete();const f=r.values,b=i.values_count();for(let e=0;e<b;e++)f.push(i.get_value_at(e));const _=r.features,I=i.features,T=I.size();if(T>0)for(const e of w)if(void 0===h[e])throw new Error(`Feature collection missing required attribute: ${e}`);for(let e=0;e<T;e++){const t=new g,n=I.get(e),i=t.attributes,r=n.attributes_count();for(let e=0;e<r;e++)i.push(n.get_attribute_at(e));const o=n.get_compressed_geometry();o&&(t.compressedGeometry=v(o),t.centroid=v(n.get_centroid()));const s=t.aggregateGeometries,a=n.aggregate_geometries,l=a.size();for(let e=0;e<l;e++){const t=a.get(e),n=v(t);s.push(n),t.delete()}a.delete(),_.push(t),n.delete()}I.delete();const S=r.geometryFields,k=i.geometry_fields,N=k.size();for(let e=0;e<N;e++){const t=k.get(e),n=x(t);S.push(n),t.delete()}return k.delete(),t}(t.get_feature_collection());return t.delete(),i}(await n.data)}function L(e,t){if(!e?.queryResult?.featureResult)return t;const{hasZ:n,hasM:i}=e.queryResult.featureResult,r=e.queryResult.featureResult.fieldNameToAttributeIndexMap;for(const a of e.queryResult.featureResult.features){const e=a.attributes[r.TYPENAME],l=(0,o.tE)(t.namedTypeDefinitions,e,()=>({useAllData:!1,members:new Map})),p=a.attributes[r.ELEMENTUID];if(a.compressedGeometry?.coords?.length>0){let e=a.compressedGeometry.lengths;"esriGeometryPoint"===a.compressedGeometry.geometryType&&(e=[]),l.members.set(p,{id:p,linkChartLocation:new s.A(e,a.compressedGeometry.coords,n,i)})}else l.members.set(p,{id:p})}return t}const D={fetchAndConvertSerializedLinkChart:(e,t)=>async function(e,t){const n=[],i={generateAllSublayers:!1,namedTypeDefinitions:new Map};return e.entitiesUrl&&n.push(N(e.entitiesUrl,t).then(e=>{L(e,i)})),e.relationshipsUrl&&n.push(N(e.relationshipsUrl,t).then(e=>{L(e,i)})),await Promise.all(n),i}(e,t)}},69860:(e,t,n)=>{n.d(t,{A:()=>a});var i=n(65864),r=n(90708),o=n(43334),s=n(15375);class a{constructor(){this._featureLookup=new Map}static getInstance(){return a.instance||(a.instance=new a),a.instance}static resetInstance(){a.instance&&(a.instance=null)}deleteFromStore(e){e.forEach(e=>{this._featureLookup.delete(e)})}readFromStoreByList(e){const t=[];return e.forEach(e=>{const n=this.readFromStoreById(e);n&&t.push(n)}),t}readFromStoreById(e){return this._featureLookup.get(e)??null}writeToStore(e,t,n){const a=[];return e.forEach(e=>{if(!e?.id)return;e.properties||(e.properties=[]);let l=null;n&&e.properties[n]&&(l=(0,r.Ux)(e.properties[n])),"originId"in e&&"destinationId"in e&&(e.properties[s.Cz]=e.originId,e.properties[s.KQ]=e.destinationId),e.properties[t]=e.id;let p=e.properties;if(e.id){const t=this._featureLookup.get(e.id);if(t?.attributes){p={...t.attributes,...p};const e=n&&p[n];null!=e&&(p[n]=(0,i.rS)(e)),l=l??t.geometry}}const d=new o.Om(l?.clone(),p,null,e.id);this._featureLookup.set(`${e.typeName?`${e.typeName}__${e.id}`:e.id}`,d),a.push(d)}),a}}},75503:(e,t,n)=>{n.d(t,{EC:()=>v,wq:()=>a});var i=n(4576),r=n(21818),o=(n(44208),n(15142)),s=n(11006);class a{constructor(e=9,t){this._compareMinX=c,this._compareMinY=h,this._toBBox=e=>e,this._maxEntries=Math.max(4,e||9),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),t&&("function"==typeof t?this._toBBox=t:this._initFormat(t)),this.clear()}destroy(){this.clear(),M.prune(),I.prune(),T.prune(),C.prune()}all(e){l(this._data,e)}search(e,t){let n=this._data;const i=this._toBBox;if(w(e,n))for(M.clear();n;){for(let r=0,o=n.children.length;r<o;r++){const o=n.children[r],s=n.leaf?i(o):o;w(e,s)&&(n.leaf?t(o):b(e,s)?l(o,t):M.push(o))}n=M.pop()}}collides(e){let t=this._data;const n=this._toBBox;if(!w(e,t))return!1;for(M.clear();t;){for(let i=0,r=t.children.length;i<r;i++){const r=t.children[i],o=t.leaf?n(r):r;if(w(e,o)){if(t.leaf||b(e,o))return!0;M.push(r)}}t=M.pop()}return!1}load(e){if(!e.length)return this;if(e.length<this._minEntries){for(let t=0,n=e.length;t<n;t++)this.insert(e[t]);return this}let t=this._build(e.slice(),0,e.length-1,0);if(this._data.children.length)if(this._data.height===t.height)this._splitRoot(this._data,t);else{if(this._data.height<t.height){const e=this._data;this._data=t,t=e}this._insert(t,this._data.height-t.height-1,!0)}else this._data=t;return this}insert(e){return e&&this._insert(e,this._data.height-1),this}clear(){return this._data=new x([]),this}remove(e){if(!e)return this;let t,n=this._data,o=null,s=0,a=!1;const l=this._toBBox(e);for(T.clear(),C.clear();n||T.length>0;){if(n||(n=T.pop(),o=T.data[T.length-1],s=C.pop()??0,a=!0),n.leaf&&(t=(0,i.qh)(n.children,(0,r.zI)(e),n.children.length,n.indexHint),-1!==t))return n.children.splice(t,1),T.push(n),this._condense(T),this;a||n.leaf||!b(n,l)?o?(s++,n=o.children[s],a=!1):n=null:(T.push(n),C.push(s),s=0,o=n,n=n.children[0])}return this}toJSON(){return this._data}fromJSON(e){return this._data=e,this}_build(e,t,n,i){const r=n-t+1;let o=this._maxEntries;if(r<=o){const i=new x(e.slice(t,n+1));return p(i,this._toBBox),i}i||(i=Math.ceil(Math.log(r)/Math.log(o)),o=Math.ceil(r/o**(i-1)));const s=new E([]);s.height=i;const a=Math.ceil(r/o),l=a*Math.ceil(Math.sqrt(o));_(e,t,n,l,this._compareMinX);for(let r=t;r<=n;r+=l){const t=Math.min(r+l-1,n);_(e,r,t,a,this._compareMinY);for(let n=r;n<=t;n+=a){const r=Math.min(n+a-1,t);s.children.push(this._build(e,n,r,i-1))}}return p(s,this._toBBox),s}_insert(e,t,n){const i=this._toBBox,r=n?e:i(e);T.clear();const o=function(e,t,n,i){for(;i.push(t),!0!==t.leaf&&i.length-1!==n;){let n,i=1/0,r=1/0;for(let o=0,s=t.children.length;o<s;o++){const s=t.children[o],a=y(s),l=f(e,s)-a;l<r?(r=l,i=a<i?a:i,n=s):l===r&&a<i&&(i=a,n=s)}t=n||t.children[0]}return t}(r,this._data,t,T);for(o.children.push(e),u(o,r);t>=0&&T.data[t].children.length>this._maxEntries;)this._split(T,t),t--;!function(e,t,n){for(let i=n;i>=0;i--)u(t.data[i],e)}(r,T,t)}_split(e,t){const n=e.data[t],i=n.children.length,r=this._minEntries;this._chooseSplitAxis(n,r,i);const o=this._chooseSplitIndex(n,r,i);if(!o)return;const s=n.children.splice(o,n.children.length-o),a=n.leaf?new x(s):new E(s);a.height=n.height,p(n,this._toBBox),p(a,this._toBBox),t?e.data[t-1].children.push(a):this._splitRoot(n,a)}_splitRoot(e,t){this._data=new E([e,t]),this._data.height=e.height+1,p(this._data,this._toBBox)}_chooseSplitIndex(e,t,n){let i,r,o;i=r=1/0;for(let s=t;s<=n-t;s++){const t=d(e,0,s,this._toBBox),a=d(e,s,n,this._toBBox),l=g(t,a),p=y(t)+y(a);l<i?(i=l,o=s,r=p<r?p:r):l===i&&p<r&&(r=p,o=s)}return o}_chooseSplitAxis(e,t,n){const i=e.leaf?this._compareMinX:c,r=e.leaf?this._compareMinY:h;this._allDistMargin(e,t,n,i)<this._allDistMargin(e,t,n,r)&&e.children.sort(i)}_allDistMargin(e,t,n,i){e.children.sort(i);const r=this._toBBox,o=d(e,0,t,r),s=d(e,n-t,n,r);let a=m(o)+m(s);for(let i=t;i<n-t;i++){const t=e.children[i];u(o,e.leaf?r(t):t),a+=m(o)}for(let i=n-t-1;i>=t;i--){const t=e.children[i];u(s,e.leaf?r(t):t),a+=m(s)}return a}_condense(e){for(let t=e.length-1;t>=0;t--){const n=e.data[t];if(0===n.children.length)if(t>0){const r=e.data[t-1],o=r.children;o.splice((0,i.qh)(o,n,o.length,r.indexHint),1)}else this.clear();else p(n,this._toBBox)}}_initFormat(e){const t=["return a"," - b",";"];this._compareMinX=new Function("a","b",t.join(e[0])),this._compareMinY=new Function("a","b",t.join(e[1])),this._toBBox=new Function("a","return {minX: a"+e[0]+", minY: a"+e[1]+", maxX: a"+e[2]+", maxY: a"+e[3]+"};")}}function l(e,t){let n=e;for(I.clear();n;){if(!0===n.leaf)for(const e of n.children)t((0,r.zI)(e));else I.pushArray(n.children);n=I.pop()??null}}function p(e,t){d(e,0,e.children.length,t,e)}function d(e,t,n,i,r){r||(r=new x([])),r.minX=1/0,r.minY=1/0,r.maxX=-1/0,r.maxY=-1/0;for(let o,s=t;s<n;s++)o=e.children[s],u(r,e.leaf?i(o):o);return r}function u(e,t){e.minX=Math.min(e.minX,t.minX),e.minY=Math.min(e.minY,t.minY),e.maxX=Math.max(e.maxX,t.maxX),e.maxY=Math.max(e.maxY,t.maxY)}function c(e,t){return e.minX-t.minX}function h(e,t){return e.minY-t.minY}function y(e){return(e.maxX-e.minX)*(e.maxY-e.minY)}function m(e){return e.maxX-e.minX+(e.maxY-e.minY)}function f(e,t){return(Math.max(t.maxX,e.maxX)-Math.min(t.minX,e.minX))*(Math.max(t.maxY,e.maxY)-Math.min(t.minY,e.minY))}function g(e,t){const n=Math.max(e.minX,t.minX),i=Math.max(e.minY,t.minY),r=Math.min(e.maxX,t.maxX),o=Math.min(e.maxY,t.maxY);return Math.max(0,r-n)*Math.max(0,o-i)}function b(e,t){return e.minX<=t.minX&&e.minY<=t.minY&&t.maxX<=e.maxX&&t.maxY<=e.maxY}function w(e,t){return t.minX<=e.maxX&&t.minY<=e.maxY&&t.maxX>=e.minX&&t.maxY>=e.minY}function _(e,t,n,i,r){const o=[t,n];for(;o.length;){const t=o.pop(),n=o.pop();if(t-n<=i)continue;const a=n+Math.ceil((t-n)/i/2)*i;(0,s.q)(e,a,n,t,r),o.push(n,a,a,t)}}const M=new o.A,I=new o.A,T=new o.A,C=new o.A({deallocator:void 0});class v{constructor(){this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0}}class A extends v{constructor(){super(...arguments),this.height=1,this.indexHint=new i.vW}}class x extends A{constructor(e){super(),this.children=e,this.leaf=!0}}class E extends A{constructor(e){super(),this.children=e,this.leaf=!1}}},77901:(e,t,n)=>{n.d(t,{A:()=>s});var i=n(31635),r=n(25482),o=n(91429);let s=class extends r.o{constructor(e){super(e),this.properties=null}};(0,i.Cg)([(0,o.MZ)({json:{write:!0}})],s.prototype,"properties",void 0),s=(0,i.Cg)([(0,o.$K)("esri.rest.knowledgeGraph.GraphObject")],s)},83221:(e,t,n)=>{n.d(t,{A:()=>y});var i=n(4576),r=n(49186),o=n(65529),s=n(53966),a=n(70328),l=n(19419),p=n(90708),d=n(6518),u=n(51441),c=n(37730);const h=(0,a.vt)();class y{constructor(e){this.geometryInfo=e,this._boundsStore=new d.F,this._featuresById=new Map,this._usedMemory=0,this.events=new o.bk,this.featureAdapter=c.T}get usedMemory(){return this._usedMemory}get geometryType(){return this.geometryInfo.geometryType}get hasM(){return this.geometryInfo.hasM}get hasZ(){return this.geometryInfo.hasZ}get numFeatures(){return this._featuresById.size}get fullBounds(){return this._boundsStore.fullBounds}get storeStatistics(){let e=0;return this._featuresById.forEach(t=>{null!=t.geometry&&t.geometry.coords&&(e+=t.geometry.coords.length)}),{featureCount:this._featuresById.size,vertexCount:e/(this.hasZ?this.hasM?4:3:this.hasM?3:2)}}getFullExtent(e){if(null==this.fullBounds)return null;const[t,n,i,r]=this.fullBounds;return{xmin:t,ymin:n,xmax:i,ymax:r,spatialReference:(0,u.ag)(e)}}add(e){this._add(e),this._emitChanged()}addMany(e){for(const t of e)this._add(t);this._emitChanged()}upsertMany(e){const t=e.map(e=>this._upsert(e));return this._emitChanged(),t.filter(i.Ru)}clear(){this._featuresById.clear(),this._boundsStore.clear(),this._emitChanged(),this._usedMemory=0}removeById(e){const t=this._featuresById.get(e);return t?(this._remove(t),this._emitChanged(),t):null}removeManyById(e){this._boundsStore.invalidateIndex();for(const t of e){const e=this._featuresById.get(t);e&&this._remove(e)}this._emitChanged()}forEachBounds(e,t){for(const n of e){const e=this._boundsStore.get(n.objectId);e&&t((0,a.Jt)(h,e))}}getFeature(e){return this._featuresById.get(e)}has(e){return this._featuresById.has(e)}forEach(e){this._featuresById.forEach(t=>e(t))}forEachInBounds(e,t){this._boundsStore.forEachInBounds(e,e=>{t(this._featuresById.get(e))})}_emitChanged(){this.events.emit("changed",void 0)}_add(e){if(!e)return;const t=e.objectId;if(null==t)return void s.A.getLogger("esri.layers.graphics.data.FeatureStore").error(new r.A("featurestore:invalid-feature","feature id is missing",{feature:e}));const n=this._featuresById.get(t);let i;if(n?(e.displayId=n.displayId,i=this._boundsStore.get(t),this._boundsStore.delete(t),this._usedMemory-=this.estimateFeatureUsedMemory?.(n)??0):null!=this.onFeatureAdd&&this.onFeatureAdd(e),!e.geometry?.coords?.length)return this._boundsStore.set(t,null),void this._featuresById.set(t,e);i=(0,p.jQ)(null!=i?i:(0,l.vt)(),e.geometry),null!=i&&this._boundsStore.set(t,i),this._featuresById.set(t,e),this._usedMemory+=this.estimateFeatureUsedMemory?.(e)??0}_upsert(e){const t=e?.objectId;if(null==t)return s.A.getLogger("esri.layers.graphics.data.FeatureStore").error(new r.A("featurestore:invalid-feature","feature id is missing",{feature:e})),null;const n=this._featuresById.get(t);if(!n)return this._add(e),e;this._usedMemory-=this.estimateFeatureUsedMemory?.(n)??0;const{geometry:i,attributes:o}=e;for(const e in o)n.attributes[e]=o[e];return i&&(n.geometry=i,this._boundsStore.set(t,(0,p.jQ)((0,l.vt)(),i)??null)),this._usedMemory+=this.estimateFeatureUsedMemory?.(n)??0,n}_remove(e){null!=this.onFeatureRemove&&this.onFeatureRemove(e);const t=e.objectId;return this._boundsStore.delete(t),this._featuresById.delete(t),this._usedMemory-=this.estimateFeatureUsedMemory?.(e)??0,e}}}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[6418],{4902:(e,t,r)=>{r.d(t,{s:()=>i});var a=r(31635),s=r(64108);let n=0;const i=e=>{const t=e;let r=class extends t{constructor(...e){super(...e),Object.defineProperty(this,"uid",{writable:!1,configurable:!1,value:Date.now().toString(16)+"-object-"+n++})}};return r=(0,a.Cg)([(0,s.$)("esri.core.Identifiable")],r),r};i(class{})},11221:(e,t,r)=>{r.d(t,{t1:()=>w,Jn:()=>A,Rn:()=>T,An:()=>_});var a=r(48938),s=r(23732),n=r(87449),i=r(31635),o=r(52106),l=r(93833),u=r(60999);class c{constructor(e,t){this._parent=e,this._abortSignal=t,this._done=!1,this._features=null,this._batchMutex=new u.aD,this._currentPage=null,this._pageCursor=-1}get _numAvailable(){return null==this._currentPage||this._pageCursor<0?0:Math.max(this._currentPage.length-this._pageCursor,0)}_takeNFeatures(e){if(null==this._currentPage)return[];const t=this._currentPage.slice(this._pageCursor,this._pageCursor+e);return this._pageCursor+=t.length,t.map(e=>o.A.fromJSON(e))}_takeOneFeature(){const e=this._currentPage[this._pageCursor];return this._pageCursor+=1,o.A.fromJSON(e)}async _nextBatch(){if(this._done)return!1;const e=await(this._features??=this._parent.queryAll(this._abortSignal));let t;do{if(t=await e.next(),t.done)return this._done=!0,this._currentPage=null,this._pageCursor=-1,!1}while(t.value.length<=0);return this._currentPage=t.value,this._pageCursor=0,!0}async nextBatchAsArcadeFeatures(e,t){const r=await this.nextBatch(e);return null==r?r:r.map(e=>l.Xj.createFromGraphicLikeObject(e.geometry,e.attributes,this._parent,t))}async nextBatch(e){const t={stack:[],error:void 0,hasError:!1};try{if(this._done)return null;if(e<=0)return[];if((0,i.mS)(t,await this._batchMutex.acquire(),!1),this._numAvailable>=e)return this._takeNFeatures(e);const r=[];let a=e;do{const e=this._takeNFeatures(a);a-=e.length,r.push(e)}while(a>0&&await this._nextBatch());const s=r.flat();return s.length>0?s:null}catch(e){t.error=e,t.hasError=!0}finally{(0,i.hk)(t)}}async next(){const e={stack:[],error:void 0,hasError:!1};try{return this._done?null:((0,i.mS)(e,await this._batchMutex.acquire(),!1),this._numAvailable>=1||await this._nextBatch()?this._takeOneFeature():null)}catch(t){e.error=t,e.hasError=!0}finally{(0,i.hk)(e)}}}var h=r(33325),p=r(50145),d=r(71163),y=r(5479),g=r(88368),f=r(16930),m=r(65864),b=r(95466);function T(e,t){for(const r of e)null!=r.geometry&&(r.geometry.spatialReference??=t)}const _=Object.freeze({ordered:!0,filterApplied:!0,spatialFilterApplied:!0,features:Object.freeze({next:()=>Promise.resolve({done:!0,value:void 0}),[Symbol.asyncIterator](){return this}})});class w{constructor(){this.declaredRootClass="esri.arcade.featureset.support.FeatureSet",this._parent=null,this._maxProcessing=200,this._maxQuery=500,this._totalCount=-1,this._databaseType=7,this._databaseTypeProbed=null,this._loadPromise=null,this._allFeatures=null,this._fieldsIndex=null,this.typeIdField=null,this.types=null,this.subtypeField=null,this.subtypes=null,this.fields=null,this.geometryType="",this.objectIdField="",this.globalIdField="",this.spatialReference=null,this.hasM=!1,this.hasZ=!1}_ensureLoaded(){return this.load()}load(){return null===this._loadPromise&&(this._loadPromise=this.loadImpl()),this._loadPromise}async loadImpl(){return await(this._parent?.load()),this._initialiseFeatureSet(),this}_initialiseFeatureSet(){null!==this._parent?(this.fields=this._parent.fields.slice(),this.geometryType=this._parent.geometryType,this.objectIdField=this._parent.objectIdField,this.globalIdField=this._parent.globalIdField,this.spatialReference=this._parent.spatialReference,this.hasM=this._parent.hasM,this.hasZ=this._parent.hasZ,this.typeIdField=this._parent.typeIdField,this.types=this._parent.types,this.subtypeField=this._parent.subtypeField,this.subtypes=this._parent.subtypes):(this.fields=[],this.typeIdField="",this.subtypeField="",this.objectIdField="",this.globalIdField="",this.spatialReference=new f.A({wkid:4326}),this.geometryType=h.ik.point)}getField(e,t){return e=e.toLowerCase(),(t||this.fields).find(t=>t.name.toLowerCase()===e)}getFieldsIndex(){return null===this._fieldsIndex&&(this._fieldsIndex=b.A.fromLayer({timeInfo:this.timeInfo,editFieldsInfo:this.editFieldsInfo,dateFieldsTimeZone:this.dateFieldsTimeZone,datesInUnknownTimezone:this.datesInUnknownTimezone,fields:this.fields})),this._fieldsIndex}_maxProcessingRate(){return null!==this._parent?Math.min(this._maxProcessing,this._parent._maxProcessingRate()):Math.min(this._maxProcessing,this._maxQueryRate())}_maxQueryRate(){return null!==this._parent?Math.max(this._maxQuery,this._parent._maxQueryRate()):this._maxQuery}nativeCapabilities(){return this._parent.nativeCapabilities()}get _hasCachedFeatures(){return null!=this._allFeatures}async queryAll(e){null==this._allFeatures&&(this._allFeatures=this._queryAll().then(e=>(0,y.N5)(e)));const t=(await this._allFeatures)();return null==e||e===a._?t:async function*(){for await(const r of t)(0,n.dZ)(e),yield r}()}async databaseType(){if(7===this._databaseType){if(null!==s.A.applicationCache){const e=s.A.applicationCache.getDatabaseType(this._cacheableFeatureSetSourceKey());if(null!==e)return e}if(null!==this._databaseTypeProbed)return this._databaseTypeProbed;try{this._databaseTypeProbed=this._getDatabaseTypeImpl(),null!==s.A.applicationCache&&s.A.applicationCache.setDatabaseType(this._cacheableFeatureSetSourceKey(),this._databaseTypeProbed)}catch(e){throw null!==s.A.applicationCache&&s.A.applicationCache.clearDatabaseType(this._cacheableFeatureSetSourceKey()),e}return this._databaseTypeProbed}return this._databaseType}async _getDatabaseTypeImpl(){const e=[{dbType:2,probeSql:"(CAST( '2015-01-01' as DATETIME) = CAST( '2015-01-01' as DATETIME)) AND OBJECTID<0"},{dbType:3,probeSql:"(TO_DATE('2003-11-18','YYYY-MM-DD') = TO_DATE('2003-11-18','YYYY-MM-DD')) AND OBJECTID<0"},{dbType:1,probeSql:"(date '2015-01-01 10:10:10' = date '2015-01-01 10:10:10') AND OBJECTID<0"}];for(const t of e)if(!0===await this._runDatabaseProbe(t.probeSql))return t.dbType;return 1}_cacheableFeatureSetSourceKey(){return"MUSTBESET"}async _runDatabaseProbe(e){if(null!==this._parent)return this._parent._runDatabaseProbe(e);throw new n.dr("NotImplemented")}isTable(){return this._parent?.isTable()??!1}first(e){return this.iterator(e).next()}async isEmpty(e){return this._totalCount>=0?0===this._totalCount:null==await this.first(e)}async calculateStatistic(e,t,r,a){await this._ensureLoaded();let s=await this.queryStat({stat:e,field:t,limit:r,abortSignal:a});return!1===s.calculated&&(s=await this._manualStat(e,t,r,a)),s.result}async _manualStat(e,t,r,a){let s=null;switch(e.toLowerCase()){case"count":{if(this._totalCount>=0)return{calculated:!0,result:this._totalCount};const e=await this.queryAll(a);let t=0;for await(const r of e)t+=r.length;return this._totalCount=t,{calculated:!0,result:t}}case"distinct":return s=await(0,p.dM)(this,t,r,a),{calculated:!0,result:s};case"avg":case"mean":return s=await(0,p.i2)(this,t,a),{calculated:!0,result:s};case"stdev":return s=await(0,p.b$)(this,t,a),{calculated:!0,result:s};case"variance":return s=await(0,p.GV)(this,t,a),{calculated:!0,result:s};case"sum":return s=await(0,p.cz)(this,t,a),{calculated:!0,result:s};case"min":return s=await(0,p.jk)(this,t,a),{calculated:!0,result:s};case"max":return s=await(0,p.T9)(this,t,a),{calculated:!0,result:s};default:return{calculated:!0,result:0}}}iterator(e){return new c(this,e)}async sumArea(e,t,r){let a=0;for await(const s of await this.queryAll(r))for(const r of s)null!=r.geometry&&(a+=null!=t?await(0,d.C)("geodeticArea",[r.geometry,e,t]):await(0,d.C)("area",[r.geometry,e]));return a}async sumLength(e,t,r){let a=0;for await(const s of await this.queryAll(r))for(const r of s)null!=r.geometry&&(a+=null!=t?await(0,d.C)("geodeticLength",[r.geometry,e,t]):await(0,d.C)("length",[r.geometry,e]));return a}async count(e){return await this.load(),this.calculateStatistic("count",g.A.create("1",{fieldsIndex:this.getFieldsIndex(),timeZone:this.dateFieldsTimeZoneDefaultUTC}),-1,e??a._)}castToText(e=!1){return"object, FeatureSet"}queryAttachments(e,t,r,a,s){return this._parent.queryAttachments(e,t,r,a,s)}serviceUrl(){return this._parent.serviceUrl()}subtypeMetadata(){return this.subtypeField&&this.subtypes?{subtypeField:this.subtypeField,subtypes:this.subtypes?this.subtypes.map(e=>({name:e.name,code:e.code})):[]}:this.typeIdField?{subtypeField:this.typeIdField,subtypes:this.types?this.types.map(e=>({name:e.name,code:e.id})):[]}:null}relationshipMetadata(){return this._parent.relationshipMetadata()}get gdbVersion(){return this._parent?this._parent.gdbVersion:""}schema(){const e=[];for(const t of this.fields)e.push((0,h.nE)(t));return{objectIdField:this.objectIdField,globalIdField:this.globalIdField,geometryType:void 0===h.yT[this.geometryType]?"esriGeometryNull":h.yT[this.geometryType],fields:e}}async convertToText(e,t){if("schema"===e)return await this._ensureLoaded(),JSON.stringify(this.schema());if("featureset"===e){await this._ensureLoaded();const e=[];for await(const r of await this.queryAll(t))for(const t of r){const r={geometry:t.geometry??null,attributes:t.attributes};if(null!==r.geometry&&r.geometry.spatialReference){const{spatialReference:e,...t}=r.geometry;r.geometry=t}e.push(r)}return JSON.stringify({...this.schema(),features:e,spatialReference:this.spatialReference.toJSON()})}return this.castToText()}getFeatureByObjectId(e,t){return this._parent.getFeatureByObjectId(e,t)}getOwningSystemUrl(){return this._parent.getOwningSystemUrl()}getIdentityUser(){return this._parent.getIdentityUser()}getRootFeatureSet(){return this._parent.getRootFeatureSet()}getDataSourceFeatureSet(){return null!==this._parent?this._parent.getDataSourceFeatureSet():this}castAsJson(e=null){return"keeptype"===e?.featureset?this:"none"===e?.featureset?null:{type:"FeatureSet"}}async castAsJsonAsync(e=null,t=null){if("keeptype"===t?.featureset)return this;if("schema"===t?.featureset)return await this._ensureLoaded(),JSON.parse(JSON.stringify(this.schema()));if("none"===t?.featureset)return null;await this._ensureLoaded();const r=[];for await(const a of await this.queryAll(e))for(const e of a){const a={geometry:e.geometry?!0===t?.keepGeometryType?(0,m.rS)(e.geometry):e.geometry:null,attributes:e.attributes};if(null!==a.geometry&&a.geometry.spatialReference&&!0!==t?.keepGeometryType){delete a.geometry.spatialReference;const{spatialReference:e,...t}=a.geometry;a.geometry=t}r.push(a)}return{...this.schema(),features:r,spatialReference:!0===t?.keepGeometryType?this.spatialReference:this.spatialReference?.toJSON()}}fieldTimeZone(e){return this.getFieldsIndex().getTimeZone(e)}get preferredTimeZone(){return this._parent?.preferredTimeZone??null}get dateFieldsTimeZone(){return this._parent?.dateFieldsTimeZone??null}get dateFieldsTimeZoneDefaultUTC(){return this.datesInUnknownTimezone?"unknown":this.dateFieldsTimeZone||"UTC"}get datesInUnknownTimezone(){return this._parent.datesInUnknownTimezone}get editFieldsInfo(){return this._parent?.editFieldsInfo??null}get timeInfo(){return this._parent?.timeInfo??null}getFeatureSetInfo(){return this._parent?this._parent.getFeatureSetInfo():Promise.resolve(null)}}class A extends w{constructor(){super(...arguments),this._parent=null}getRootFeatureSet(){return this}}},23732:(e,t,r)=>{r.d(t,{A:()=>a});class a{static{this.applicationCache=null}constructor(){this._databaseTypeMetaData={},this._layerInfo={}}clearDatabaseType(e){void 0===this._databaseTypeMetaData[e]&&delete this._databaseTypeMetaData[e]}getDatabaseType(e){return"MUSTBESET"===e||void 0===this._databaseTypeMetaData[e]?null:this._databaseTypeMetaData[e]}setDatabaseType(e,t){this._databaseTypeMetaData[e]=t}getLayerInfo(e){return void 0===this._layerInfo[e]?null:this._layerInfo[e]}setLayerInfo(e,t){this._layerInfo[e]=t}clearLayerInfo(e){void 0!==this._layerInfo[e]&&delete this._layerInfo[e]}}},36708:(e,t,r)=>{r.d(t,{C_:()=>p,OH:()=>g,Vh:()=>f,on:()=>h,pc:()=>m,wB:()=>l,z7:()=>u});var a=r(37955),s=r(36563),n=r(97768),i=r(74887),o=r(14012);function l(e,t,r={}){return c(e,t,r,d)}function u(e,t,r={}){return c(e,t,r,y)}function c(e,t,r={},a){let s=null;const i=r.once?(e,r)=>{a(e)&&((0,n.xt)(s),t(e,r))}:(e,r)=>{a(e)&&t(e,r)};if(s=(0,o.Cn)(e,i,r.sync,r.equals),r.initial){const t=e();i(t,t)}return s}function h(e,t,r,i={}){let o=null,u=null,c=null;function h(){o&&u&&(u.remove(),i.onListenerRemove?.(o),o=null,u=null)}function p(e){i.once&&i.once&&(0,n.xt)(c),r(e)}const d=l(e,(e,r)=>{h(),(0,a.wb)(e)&&(o=e,u=(0,a.on)(e,t,p),i.onListenerAdd?.(e))},{sync:i.sync,initial:!0});return c=(0,s.hA)(()=>{d.remove(),h()}),c}function p(e,t){return function(e,t,r){if((0,i.G4)(r))return Promise.reject((0,i.NK)());const a=e();if(t?.(a))return Promise.resolve(a);let o=null;function l(){o=(0,n.xt)(o)}return new Promise((a,n)=>{o=(0,s.vE)([(0,i.u7)(r,()=>{l(),n((0,i.NK)())}),c(e,e=>{l(),a(e)},{sync:!1,once:!0},t??d)])})}(e,y,t)}function d(e){return!0}function y(e){return!!e}r(80559);const g={sync:!0},f={initial:!0},m={sync:!0,initial:!0}},50145:(e,t,r)=>{r.d(t,{Dp:()=>c,GV:()=>y,T9:()=>p,b$:()=>g,cz:()=>f,dM:()=>b,i2:()=>d,jk:()=>h});var a=r(87449),s=(r(33325),r(80609)),n=r(44729),i=r(55612),o=r(15032);function l(e){let t=0;for(let r=0;r<e.length;r++)t+=e[r];return t/e.length}function u(e){const t=l(e);let r=0;for(let a=0;a<e.length;a++)r+=(t-e[a])**2;return r/(e.length-1)}function c(e){switch(e.toLowerCase()){case"distinct":return"distinct";case"avg":case"mean":return"avg";case"min":return"min";case"sum":return"sum";case"max":return"max";case"stdev":case"stddev":return"stddev";case"var":case"variance":return"var";case"count":return"count"}return null}async function h(e,t,r){const a=await m(e,t,r);return 0===a.length?null:Math.min.apply(Math,a)}async function p(e,t,r){const a=await m(e,t,r);return 0===a.length?null:Math.max.apply(Math,a)}async function d(e,t,r){let a="";t&&!(0,s.DA)(t)&&(a=(0,s.IY)(t,e.fields));const n=await m(e,t,r);if(0===n.length)return null;const i=l(n);return null===i?i:"integer"===a?function(e){return e=+e,isFinite(e)?e-e%1||(e<0?-0:0===e?e:0):e}(i):i}async function y(e,t,r){const a=await m(e,t,r);return 0===a.length?null:u(a)}async function g(e,t,r){const a=await m(e,t,r);return 0===a.length?null:Math.sqrt(u(a))}async function f(e,t,r){const a=await m(e,t,r);return 0===a.length?null:function(e){let t=0;for(let r=0;r<e.length;r++)t+=e[r];return t}(a)}async function m(e,t,r){const s=await e.queryAll(r),l=[],u={ticker:0};for await(const e of s){if(u.ticker+=e.length,u.ticker>=100&&(u.ticker=0,await new Promise(e=>{setTimeout(e,0)})),r?.aborted)throw new a.dr("Cancelled");for(const r of e){const e=t?.calculateValue(r);null===e||(l[l.length]=e instanceof n.n||e instanceof o.k?e.toNumber():e instanceof i.g?e.toMilliseconds():e)}}return l}async function b(e,t,r=1e3,s=null){if(null==t)return[];const l=await e.queryAll(s),u=[],c=new Set,h={ticker:0};for await(const e of l){if(h.ticker+=e.length,h.ticker>=100&&(h.ticker=0,await new Promise(e=>{setTimeout(e,0)})),s?.aborted)throw new a.dr("Cancelled");for(const a of e){const e=t.calculateValue(a);let s=e;if(e instanceof n.n?s="!!DATEONLY!!-"+e.toString():e instanceof i.g?s="!!TSOFFSETONLY!!-"+e.toString():e instanceof o.k?s="!!TIMEONLY!!-"+e.toString():e instanceof Date&&(s="!!DATE!!-"+e.toString()),null!=e&&(c.has(s)||(u.push(e),c.add(s))),u.length>=r&&-1!==r)return u}}return u}},50498:(e,t,r)=>{r.d(t,{Ye:()=>h,gy:()=>c,yR:()=>p});var a=r(66552),s=r(5443),n=r(91075),i=r(48526),o=r(86738),l=r(39829),u=r(82799);const c=(0,a.O)()({esriGeometryPoint:"point",esriGeometryMultipoint:"multipoint",esriGeometryPolyline:"polyline",esriGeometryPolygon:"polygon"}),h=(0,a.O)()({esriGeometryPoint:"point",esriGeometryMultipoint:"multipoint",esriGeometryPolyline:"polyline",esriGeometryPolygon:"polygon",esriGeometryEnvelope:"extent",mesh:"mesh"}),p={base:n.A,key:"type",typeMap:{extent:s.A,multipoint:i.A,point:o.A,polyline:u.A,polygon:l.A}}},52106:(e,t,r)=>{r.d(t,{A:()=>w});var a,s=r(31635),n=r(37838),i=r(69540),o=r(51447),l=r(25482),u=r(53966),c=r(36708),h=r(24326),p=r(91429),d=r(12195),y=r(65864),g=r(50498),f=r(55156),m=r(60950),b=r(54339),T=r(33910);function _(e){if(null==e)return null;const t={};for(const r in e){const a=e[r];a&&(t[r]=a.toJSON())}return 0!==Object.keys(t).length?t:null}let w=class extends((0,i.OU)(l.o)){static{a=this}constructor(e){super(e),this.isAggregate=!1,this.layer=null,this.origin=null,this.sourceLayer=null,this._version=0,Object.defineProperty(this,"uid",{value:(0,h.c)(),configurable:!0}),Object.defineProperty(this,"_lastMeshTransform",{value:{},configurable:!0,writable:!0,enumerable:!1}),arguments.length>1&&(0,o.eF)(u.A.getLogger(this),"Graphic",{version:"4.30"})}initialize(){this._watchMeshGeometryChanges()}set aggregateGeometries(e){const t=this._get("aggregateGeometries");JSON.stringify(t)!==JSON.stringify(e)&&this._set("aggregateGeometries",e)}set attributes(e){const t=this._get("attributes");t!==e&&(this._set("attributes",e),this._notifyLayer("attributes",t,e))}set geometry(e){const t=this._get("geometry");t!==e&&(this._set("geometry",e),"mesh"!==e?.type&&this._notifyLayer("geometry",t,e))}set popupTemplate(e){const t=this._get("popupTemplate");t!==e&&(this._set("popupTemplate",e),this._notifyLayer("popupTemplate",t,e))}set symbol(e){const t=this._get("symbol");t!==e&&(this._set("symbol",e),this._notifyLayer("symbol",t,e))}get version(){return this._version}set visible(e){const t=this._get("visible");t!==e&&(this._set("visible",e),this._notifyLayer("visible",t,e))}cloneShallow(){return new a({aggregateGeometries:this.aggregateGeometries,attributes:this.attributes,geometry:this.geometry,isAggregate:this.isAggregate,layer:this.layer,popupTemplate:this.popupTemplate,sourceLayer:this.sourceLayer,symbol:this.symbol,visible:this.visible,origin:this.origin})}getEffectivePopupTemplate(e=!1){if(this.popupTemplate)return this.popupTemplate;const t=(0,m.E_)(this.origin);if(t)return t.popupTemplate??(e?t.defaultPopupTemplate:null)??null;const r=this.origin&&"layer"in this.origin?this.origin.layer:null;for(const t of[r,this.sourceLayer,this.layer])if(t&&"object"==typeof t){if("popupTemplate"in t&&t.popupTemplate)return t.popupTemplate;if(e&&"defaultPopupTemplate"in t&&null!=t.defaultPopupTemplate)return t.defaultPopupTemplate}return null}getAttribute(e){return this.attributes?.[e]}setAttribute(e,t){if(this.attributes){const r=this.getAttribute(e);this.attributes[e]=t,this._notifyLayer("attributes",r,t,e)}else this.attributes={[e]:t}}getObjectId(){const e=(0,f.I)(this.origin);if(e)return(0,b.r)(this,e);const t=this.sourceLayer??this.layer;return t?(0,b.r)(this,t):null}getGlobalId(){const e=(0,f.I)(this.origin);if(e?.globalIdField)return this.getAttribute(e.globalIdField);const t=this.sourceLayer??this.layer;return t&&"globalIdField"in t&&t.globalIdField?this.getAttribute(t.globalIdField):null}toJSON(){return{aggregateGeometries:_(this.aggregateGeometries),geometry:null!=this.geometry?this.geometry.toJSON():null,symbol:null!=this.symbol?this.symbol.toJSON():null,attributes:(0,d.W)(this.attributes)?this.attributes.toJSON():{...this.attributes},popupTemplate:this.popupTemplate?.toJSON()??null}}notifyMeshTransformChanged(e={}){const{geometry:t}=this;if("mesh"===t?.type){const r={origin:t.origin,transform:t.transform};this._notifyLayer("origin-transform",r,r,e.action)}}_notifyLayer(e,t,r,a){if(this._version++,!this.layer||!("graphicChanged"in this.layer))return;const s={graphic:this,property:e,oldValue:t,newValue:r};"origin-transform"===e&&(s.action=a),"attributes"===e&&(s.attributeName=a),this.layer.graphicChanged(s)}_watchMeshGeometryChanges(){this.addHandles([(0,c.z7)(()=>"mesh"===this.geometry?.type&&this.geometry.vertexSpace.origin?{localMatrix:this.geometry.transform?.localMatrix,origin:this.geometry.vertexSpace.origin}:void 0,({localMatrix:e,origin:t})=>{this._lastMeshTransform.localMatrix===e&&this._lastMeshTransform.origin===t||(this._lastMeshTransform.localMatrix=e,this._lastMeshTransform.origin=t,this.notifyMeshTransformChanged())}),(0,c.z7)(()=>"mesh"===this.geometry?.type?{vertexAttributes:this.geometry.vertexAttributes}:void 0,()=>{const e=this.geometry;"mesh"===e?.type&&e.vertexSpace.origin?(this._lastMeshTransform.localMatrix=e.transform?.localMatrix,this._lastMeshTransform.origin=e.vertexSpace.origin):(this._lastMeshTransform.localMatrix=void 0,this._lastMeshTransform.origin=void 0),this._notifyLayer("geometry",this.geometry,this.geometry)},{equals:(e,t)=>e===t,sync:!0})])}};(0,s.Cg)([(0,p.MZ)({value:null,json:{read:function(e){if(!e)return null;const t={};for(const r in e){const a=(0,y.rS)(e[r]);a&&(t[r]=a)}return 0!==Object.keys(t).length?t:null}}})],w.prototype,"aggregateGeometries",null),(0,s.Cg)([(0,p.MZ)({value:null})],w.prototype,"attributes",null),(0,s.Cg)([(0,p.MZ)({value:null,types:g.yR,json:{read:y.rS}})],w.prototype,"geometry",null),(0,s.Cg)([(0,p.MZ)({type:Boolean})],w.prototype,"isAggregate",void 0),(0,s.Cg)([(0,p.MZ)({clonable:!1})],w.prototype,"layer",void 0),(0,s.Cg)([(0,p.MZ)({clonable:"reference"})],w.prototype,"origin",void 0),(0,s.Cg)([(0,p.MZ)({type:n.A,value:null})],w.prototype,"popupTemplate",null),(0,s.Cg)([(0,p.MZ)({clonable:"reference"})],w.prototype,"sourceLayer",void 0),(0,s.Cg)([(0,p.MZ)({value:null,types:T.Es})],w.prototype,"symbol",null),(0,s.Cg)([(0,p.MZ)({clonable:!1,json:{read:!1,write:!1}})],w.prototype,"_version",void 0),(0,s.Cg)([(0,p.MZ)({type:Boolean,value:!0})],w.prototype,"visible",null),w=a=(0,s.Cg)([(0,p.$K)("esri.Graphic")],w)},55156:(e,t,r)=>{r.d(t,{I:()=>s,e:()=>a});const a=Symbol("idFieldsProviderSymbol");function s(e){return(t=e)&&a in t?e[a]:void 0;var t}},71163:(e,t,r)=>{r.d(t,{C:()=>l});var a=r(29953);let s,n,i=!1;function o(){return s??=(0,a.ho)("arcadeGeometryOperatorsWorker").then(e=>{n=e,i=!0,s=void 0})}async function l(e,t){return i?n.apply("invokeGeometryOp",[e,t]):(await o(),l(e,t))}},80609:(e,t,r)=>{r.d(t,{C6:()=>_,DA:()=>L,F1:()=>b,F6:()=>g,IY:()=>w,Ju:()=>v,Kb:()=>d,Mi:()=>c,Nf:()=>m,R8:()=>f,YY:()=>u,bD:()=>h,bm:()=>T,kg:()=>p,oj:()=>C});var a=r(66131),s=r(33325),n=r(1262),i=r(15032),o=r(88368),l=r(28097);function u(e,t){return y(e?.parseTree,t,e?.parameters)}function c(e,t,r){return y(e,t,r)}function h(e,t,r,a){const s=y(e.parseTree,0,e.parameters,t,r);return o.A.create(s,{fieldsIndex:a,timeZone:e.timeZone,currentUser:e.currentUser})}function p(e,t,r="AND"){return o.A.create("(("+u(e,0)+")"+r+"("+u(t,0)+"))",{fieldsIndex:e.fieldsIndex,timeZone:e.timeZone,currentUser:e.currentUser})}function d(e){return!0===e.delimited?`"${e.column.split('"').join('""')}"`:e.column}function y(e,t,r,a=null,i=null){let o,l,u,c;switch(e.type){case"interval":return C(y(e.value,t,r,a,i),e.qualifier,e.op);case"case-expression":{let s=" CASE ";"simple"===e.format&&(s+=y(e.operand,t,r,a,i));for(let n=0;n<e.clauses.length;n++)s+=" WHEN "+y(e.clauses[n].operand,t,r,a,i)+" THEN "+y(e.clauses[n].value,t,r,a,i);return null!==e.else&&(s+=" ELSE "+y(e.else,t,r,a,i)),s+=" END ",s}case"parameter":{const a=r[e.value.toLowerCase()];if("string"==typeof a)return"'"+r[e.value.toLowerCase()].toString().replaceAll("'","''")+"'";if((0,s.$P)(a))return T(a,t);if((0,s.Lk)(a))return T(a,t);if((0,s.eg)(a))return b(a,t);if((0,s.rX)(a))return f(a,t);if((0,s.f0)(a))return m(a,t);if(Array.isArray(a)){const e=[];for(let r=0;r<a.length;r++)"string"==typeof a[r]?e.push("'"+a[r].toString().replaceAll("'","''")+"'"):(0,s.$P)(a[r])||(0,s.Lk)(a[r])?e.push(T(a[r],t)):(0,s.eg)(a[r])?e.push(b(a[r],t)):(0,s.rX)(a[r])?e.push(f(a[r],t)):(0,s.f0)(a[r])?e.push(m(a[r],t)):e.push(a[r].toString());return e}return a.toString()}case"expression-list":l=[];for(const s of e.value)l.push(y(s,t,r,a,i));return l;case"unary-expression":return" ( NOT "+y(e.expr,t,r,a,i)+" ) ";case"binary-expression":switch(e.operator){case"AND":return" ("+y(e.left,t,r,a,i)+" AND "+y(e.right,t,r,a,i)+") ";case"OR":return" ("+y(e.left,t,r,a,i)+" OR "+y(e.right,t,r,a,i)+") ";case"IS":if("null"!==e.right.type)throw new n.L("UnsupportedIsRhs");return" ("+y(e.left,t,r,a,i)+" IS NULL )";case"ISNOT":if("null"!==e.right.type)throw new n.L("UnsupportedIsRhs");return" ("+y(e.left,t,r,a,i)+" IS NOT NULL )";case"IN":return o=[],"expression-list"===e.right.type?(o=y(e.right,t,r,a,i)," ("+y(e.left,t,r,a,i)+" IN ("+o.join(",")+")) "):(c=y(e.right,t,r,a,i),Array.isArray(c)?" ("+y(e.left,t,r,a,i)+" IN ("+c.join(",")+")) ":" ("+y(e.left,t,r,a,i)+" IN ("+c+")) ");case"NOT IN":return o=[],"expression-list"===e.right.type?(o=y(e.right,t,r,a,i)," ("+y(e.left,t,r,a,i)+" NOT IN ("+o.join(",")+")) "):(c=y(e.right,t,r,a,i),Array.isArray(c)?" ("+y(e.left,t,r,a,i)+" NOT IN ("+c.join(",")+")) ":" ("+y(e.left,t,r,a,i)+" NOT IN ("+c+")) ");case"BETWEEN":return u=y(e.right,t,r,a,i)," ("+y(e.left,t,r,a,i)+" BETWEEN "+u[0]+" AND "+u[1]+" ) ";case"NOTBETWEEN":return u=y(e.right,t,r,a,i)," ("+y(e.left,t,r,a,i)+" NOT BETWEEN "+u[0]+" AND "+u[1]+" ) ";case"LIKE":return""!==e.escape?" ("+y(e.left,t,r,a,i)+" LIKE "+y(e.right,t,r,a,i)+" ESCAPE '"+e.escape+"') ":" ("+y(e.left,t,r,a,i)+" LIKE "+y(e.right,t,r,a,i)+") ";case"NOT LIKE":return""!==e.escape?" ("+y(e.left,t,r,a,i)+" NOT LIKE "+y(e.right,t,r,a,i)+" ESCAPE '"+e.escape+"') ":" ("+y(e.left,t,r,a,i)+" NOT LIKE "+y(e.right,t,r,a,i)+") ";case"<>":case"<":case">":case">=":case"<=":case"=":case"*":case"-":case"+":case"/":return" ("+y(e.left,t,r,a,i)+" "+e.operator+" "+y(e.right,t,r,a,i)+") ";case"||":return" ("+y(e.left,t,r,a,i)+" "+(2===t?"+":e.operator)+" "+y(e.right,t,r,a,i)+") "}throw new n.L("UnsupportedOperator",{operator:e.operator});case"null":return"null";case"boolean":return!0===e.value?"1":"0";case"string":return"'"+e.value.toString().replaceAll("'","''")+"'";case"timestamp":return`timestamp '${e.value}'`;case"date":return`date '${e.value}'`;case"time":return`time '${e.value}'`;case"number":return e.value.toString();case"current-time":return _(e.mode,t);case"current-user":return"CURRENT_USER";case"column-reference":return a&&a.toLowerCase()===e.column.toLowerCase()?"("+i+")":d(e);case"data-type":return e.value;case"function":{const s=y(e.args,t,r,a,i);return g(e.name,s,t)}}throw new n.L("UnsupportedSyntax",{node:e.type})}function g(e,t,r){switch(e.toLowerCase().trim()){case"cos":case"sin":case"tan":case"cosh":case"tanh":case"sinh":case"acos":case"asin":case"atan":case"floor":case"log10":case"log":case"abs":if(1!==t.length)throw new n.L("InvalidFunctionParameters",{function:e.toLowerCase().trim()});return`${e.toUpperCase().trim()}(${t[0]})`;case"ceiling":case"ceil":if(1!==t.length)throw new n.L("InvalidFunctionParameters",{function:"ceiling"});return"CEILING("+t[0]+")";case"mod":case"power":case"nullif":if(2!==t.length)throw new n.L("InvalidFunctionParameters",{function:e.toLowerCase().trim()});return`${e.toUpperCase().trim()}(${t[0]},${t[1]})`;case"round":if(2===t.length)return"ROUND("+t[0]+","+t[1]+")";if(1===t.length)return"ROUND("+t[0]+")";throw new n.L("InvalidFunctionParameters",{function:"round"});case"truncate":if(t.length<1||t.length>2)throw new n.L("InvalidFunctionParameters",{function:"truncate"});return 2===r?"ROUND("+t[0]+(1===t.length?"0":","+t[1])+",1)":"TRUNCATE("+t[0]+(1===t.length?")":","+t[1]+")");case"char_length":case"len":if(1!==t.length)throw new n.L("InvalidFunctionParameters",{function:"char_length"});switch(r){case 2:return"LEN("+t[0]+")";case 3:return"LENGTH("+t[0]+")";default:return"CHAR_LENGTH("+t[0]+")"}case"coalesce":case"concat":{if(t.length<1)throw new n.L("InvalidFunctionParameters",{function:e.toLowerCase()});let r=e.toUpperCase().trim()+"(";for(let e=0;e<t.length;e++)0!==e&&(r+=","),r+=t[e];return r+=")",r}case"lower":case"lcase":if(1!==t.length)throw new n.L("InvalidFunctionParameters",{function:"lower"});return"LOWER("+t[0]+")";case"upper":case"ucase":if(1!==t.length)throw new n.L("InvalidFunctionParameters",{function:"upper"});return"UPPER("+t[0]+")";case"substring":{let e="";switch(r){case 3:return e="SUBSTR("+t[0]+","+t[1],3===t.length&&(e+=","+t[2]),e+=")",e;case 2:return e=3===t.length?"SUBSTRING("+t[0]+","+t[1]+","+t[2]+")":"SUBSTRING("+t[0]+", "+t[1]+", LEN("+t[0]+") - "+t[1]+")",e;default:return e="SUBSTRING("+t[0]+" FROM "+t[1],3===t.length&&(e+=" FOR "+t[2]),e+=")",e}}case"extract":return"EXTRACT("+t[0].replaceAll("'","")+" FROM "+t[1]+")";case"cast":{let e="";switch(r){case 3:switch(t[1].type){case"date":e="DATE";break;case"float":e="DOUBLE";break;case"integer":e="INTEGER";break;case"real":e="REAL";break;case"smallint":e="SMALLINT";break;case"timestamp":e="TIMESTAMP";break;case"varchar":e="VARCHAR("+t[1].size.toString()+")"}return`CAST(${t[0]} AS ${e})`;case 4:switch(t[1].type){case"date":e="DATE";break;case"float":e="DOUBLE PRECISION";break;case"integer":e="INT";break;case"real":e="REAL";break;case"smallint":e="SMALLINT";break;case"timestamp":e="TIMESTAMP";break;case"varchar":e="VARCHAR("+t[1].size.toString()+")"}return`CAST(${t[0]} AS ${e})`;case 2:switch(t[1].type){case"date":e="DATE";break;case"float":e="FLOAT";break;case"integer":e="INT";break;case"real":e="REAL";break;case"smallint":e="SMALLINT";break;case"timestamp":e="DATETIME";break;case"varchar":e="VARCHAR("+t[1].size.toString()+")"}return`CAST(${t[0]} AS ${e})`;default:switch(t[1].type){case"date":e="DATE";break;case"float":e="FLOAT";break;case"integer":e="INTEGER";break;case"real":e="REAL";break;case"smallint":e="SMALLINT";break;case"timestamp":e="TIMESTAMP";break;case"varchar":e="VARCHAR("+t[1].size.toString()+")"}return`CAST(${t[0]} AS ${e})`}}}throw new n.L("InvalidFunctionParameters",{function:e})}function f(e,t){const r=e.toDateTime(),a=0===r.hour&&0===r.minute&&0===r.second&&0===r.millisecond;switch(t){case 6:case 0:case 1:return a?`date '${r.toFormat("yyyy-LL-dd")}'`:`timestamp '${r.toFormat("yyyy-LL-dd HH:mm:ss")}'`;case 3:return a?`TO_DATE('${r.toFormat("yyyy-LL-dd")}','YYYY-MM-DD')`:`TO_DATE('${r.toFormat("yyyy-LL-dd HH:mm:ss")}','YYYY-MM-DD HH24:MI:SS')`;case 2:return`'${r.toFormat(a?"yyyy-LL-dd":"yyyy-LL-dd HH:mm:ss")}'`;case 5:return`#${r.toFormat(a?"LL-dd-yyyy":"LL-dd-yyyy HH:mm:ss")}#`;case 4:return`TIMESTAMP '${r.toFormat(a?"yyyy-LL-dd":"yyyy-LL-dd HH:mm:ss")}'`;default:return`timestamp '${r.toFormat("yyyy-LL-dd HH:mm:ss")}'`}}function m(e,t){switch(t){case 6:case 0:case 1:default:return e.toSQLWithKeyword();case 3:return`TO_DATE('${e.toFormat("Y-MM-DD")}'`;case 2:return`'${e.toFormat("Y-MM-DD")}'`;case 5:return`#${e.toFormat("Y-MM-DD")}#`;case 4:return`TIMESTAMP '${e.toFormat("Y-MM-DD")}'`}}function b(e,t){switch(e instanceof i.k&&(e=e.toStorageString()),t){case 3:return`TO_DATE('${e}', 'HH24:MI:SS')`;case 2:return`'${e}'`;default:return`time '${e}'`}}function T(e,t){return f(a.lY.dateTimeToArcadeDate((0,s.Lk)(e)?e:l.c9.fromJSDate(e)),t)}function _(e,t){switch(t){case 6:case 0:case 1:case 3:case 5:default:return"date"===e?"CURRENT_DATE":"time"===e?"CURRENT_TIME":"CURRENT_TIMESTAMP";case 2:return"date"===e?"CAST(GETDATE() AS DATE)":"time"===e?"CAST(GETDATE() AS TIME)":"GETDATE()";case 4:return"date"===e?"CURRENT_DATE":"time"===e?"LOCALTIME":"CURRENT_TIMESTAMP"}}function w(e,t,r={}){const a={},s={},n={esriFieldTypeSmallInteger:"integer",esriFieldTypeInteger:"integer",esriFieldTypeBigInteger:"integer",esriFieldTypeSingle:"double",esriFieldTypeDouble:"double",esriFieldTypeString:"string",esriFieldTypeTimeOnly:"time-only",esriFieldTypeDateOnly:"date-only",esriFieldTypeTimestampOffset:"timestamp-offset",esriFieldTypeDate:"date",esriFieldTypeOID:"integer",esriFieldTypeGUID:"guid",esriFieldTypeGlobalID:"guid",oid:"integer",long:"integer","small-integer":"integer",integer:"integer","big-integer":"integer",single:"double","time-only":"time-only","date-only":"date-only","timestamp-offset":"timestemp-offset",double:"double",date:"date",guid:"guid","global-id":"guid",string:"string"};for(const e of t){const t=e.type?n[e.type]:void 0;a[e.name.toLowerCase()]=void 0===t?"":t}for(const e in r){const t=n[r[e]];s[e.toLowerCase()]=void 0===t?"":t}switch(A(a,e.parseTree,e.parameters,s)){case"double":return"double";case"integer":return"integer";case"date":return"date";case"date-only":return"date-only";case"time-only":return"time-only";case"timestamp-offset":return"timestamp-offset";case"string":return"string";case"global-id":case"guid":return"guid"}return""}function A(e,t,r,a){let i;switch(t.type){case"interval":return"integer";case"case-expression":{const s=[];if("simple"===t.format){for(let n=0;n<t.clauses.length;n++)s.push(A(e,t.clauses[n].value,r,a));null!==t.else&&s.push(A(e,t.else,r,a))}else{for(let n=0;n<t.clauses.length;n++)s.push(A(e,t.clauses[n].value,r,a));null!==t.else&&s.push(A(e,t.else,r,a))}return S(s)}case"parameter":{const e=a[t.value.toLowerCase()];if(void 0===e&&r){const e=r[t.value.toLowerCase()];if(void 0===e)return"";if(null===e)return"";if("string"==typeof e||e instanceof String)return"string";if("boolean"==typeof e)return"boolean";if((0,s.$P)(e))return"date";if((0,s.rX)(e))return"date";if((0,s.f0)(e))return"date-only";if((0,s.eg)(e))return"time-only";if("number"==typeof e)return e%1==0?"integer":"double"}return void 0===e?"":e}case"expression-list":{const s=[];for(const n of t.value)s.push(A(e,n,r,a));return s}case"unary-expression":return"boolean";case"binary-expression":switch(t.operator){case"AND":case"OR":case"IN":case"NOT IN":case"BETWEEN":case"NOTBETWEEN":case"LIKE":case"NOT LIKE":case"<>":case"<":case">":case">=":case"<=":case"=":return"boolean";case"IS":case"ISNOT":if("null"!==t.right.type)throw new n.L("UnsupportedIsRhs");return"boolean";case"*":case"-":case"+":case"/":return S([A(e,t.left,r,a),A(e,t.right,r,a)]);case"||":return"string";default:throw new n.L("UnsupportedOperator",{operator:t.operator})}case"null":return"";case"boolean":return"boolean";case"string":return"string";case"number":return null===t.value?"":t.value%1==0?"integer":"double";case"date":return"date";case"timestamp":return t.withtimezone?"timestamp-offset":"date";case"time":return"time-only";case"current-time":return"time"===t.mode?"time-only":"date";case"current-user":return"string";case"column-reference":{const r=e[t.column.toLowerCase()];return void 0===r?"":r}case"function":switch(t.name.toLowerCase()){case"cast":switch(t.args?.value[1]?.value.type??""){case"integer":case"smallint":return"integer";case"real":case"float":return"double";case"date":case"timestamp":return!0===t.args?.value[1]?.value?.withtimezone?"timestamp-offset":"date";case"time":return"time-only";case"varchar":return"string";default:return""}case"position":case"extract":case"char_length":case"mod":return"integer";case"round":if(i=A(e,t.args,r,a),Array.isArray(i)){if(i.length<=0)return"double";i=i[0]}return i;case"sign":return"integer";case"ceiling":case"floor":case"abs":return i=A(e,t.args,r,a),Array.isArray(i)&&(i=S(i)),"integer"===i||"double"===i?i:"double";case"area":case"length":case"log":case"log10":case"sin":case"cos":case"tan":case"asin":case"acos":case"atan":case"cosh":case"sinh":case"tanh":case"power":return"double";case"substring":case"trim":case"concat":case"lower":case"upper":return"string";case"truncate":return"double";case"nullif":case"coalesce":return i=A(e,t.args,r,a),Array.isArray(i)?i.length>0?i[0]:"":i}return""}throw new n.L("UnsupportedSyntax",{node:t.type})}const I={boolean:1,string:2,integer:3,double:4,date:5};function S(e){if(e){let t="";for(const r of e)""!==r&&(t=""===t||I[t]<I[r]?r:t);return t}return""}function v(e,t){return F(e.parseTree,t)}function L(e){return"column-reference"===e?.parseTree.type}function F(e,t){if(null==e)return!1;switch(e.type){case"when-clause":return F(e.operand,t)||F(e.value,t);case"case-expression":for(const r of e.clauses)if(F(r,t))return!0;return!("simple"!==e.format||!F(e.operand,t))||!(null===e.else||!F(e.else,t));case"parameter":case"null":case"boolean":case"date":case"timestamp":case"time":case"string":case"number":return!1;case"expression-list":for(const r of e.value)if(F(r,t))return!0;return!1;case"unary-expression":return F(e.expr,t);case"binary-expression":return F(e.left,t)||F(e.right,t);case"column-reference":return t.toLowerCase()===e.column.toLowerCase();case"function":return F(e.args,t)}return!1}function E(e){let t="";return t+=e.period.toUpperCase(),t}function C(e,t,r){let a="";return a="interval-period"===t.type?E(t):E(t.start)+" TO "+E(t.end),"INTERVAL "+r+" "+e+" "+a}},87449:(e,t,r)=>{r.d(t,{dZ:()=>i,dr:()=>n});var a=r(799);const s={Cancelled:"Cancelled",InvalidStatResponse:"Invalid statistics response from service",InvalidRequest:"Invalid request",RequestFailed:"Request failed - {reason}",MissingFeatures:"Missing features",AggregationFieldNotFound:"Aggregation field not found",DataElementsNotFound:"Data elements not found on service",NeverReach:"Encountered unreachable logic",NotImplemented:"Not implemented"};class n extends Error{constructor(e,t){super((0,a.HC)(s[e],t)),this.declaredRootClass="esri.arcade.featureset.support.featureseterror",Error.captureStackTrace&&Error.captureStackTrace(this,n)}}function i(e){if(null!=e&&e?.aborted)throw new n("Cancelled")}}}]);
|