@arcgis/core 4.23.0-next.20220118 → 4.23.0-next.20220126
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Graphic.js +1 -1
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/00c5bb5eecb0e89266df.js +1 -0
- package/assets/esri/core/workers/chunks/021a37e2b191298e80b7.js +1 -0
- package/assets/esri/core/workers/chunks/1370c92c40fd6271553c.js +1 -0
- package/assets/esri/core/workers/chunks/199670a3a564ebe3bd79.js +1 -0
- package/assets/esri/core/workers/chunks/1e4d37c2b9dc83d20a11.js +1 -0
- package/assets/esri/core/workers/chunks/1fbcc8424452d0256bd6.js +1 -0
- package/assets/esri/core/workers/chunks/{7c9d2638693d5f798b23.js → 23b15e7c2f96d260e16c.js} +1 -1
- package/assets/esri/core/workers/chunks/{b2ae5fc4f787ea568b88.js → 2460f3b6ada6ae900dec.js} +1 -1
- package/assets/esri/core/workers/chunks/{99f0d896c17dd09cd285.js → 2629adf79e7fd9f25f07.js} +1 -1
- package/assets/esri/core/workers/chunks/2792ca40f1e92849247c.js +1 -0
- package/assets/esri/core/workers/chunks/2a96f1bba9ce6883e5e0.js +1 -0
- package/assets/esri/core/workers/chunks/2e899ef5881b4ec6fa55.js +1 -0
- package/assets/esri/core/workers/chunks/3231ee3e090bb4cac3fc.js +1 -0
- package/assets/esri/core/workers/chunks/{0c3e3a5baf54bd5e210c.js → 36e250278b5622ccf068.js} +1 -1
- package/assets/esri/core/workers/chunks/395ba088d4864588ff66.js +1 -0
- package/assets/esri/core/workers/chunks/3cc77692b2eee27b9c9e.js +1 -0
- package/assets/esri/core/workers/chunks/3f343f792fd9f44d6f25.js +1 -0
- package/assets/esri/core/workers/chunks/{8a250ec51097f16feb66.js → 40a1e713f63ec77110c0.js} +1 -1
- package/assets/esri/core/workers/chunks/422537fc3df707bb62c9.js +1 -0
- package/assets/esri/core/workers/chunks/{ba6fdaed6c315dc13981.js → 434b16731c6a81f868ef.js} +1 -1
- package/assets/esri/core/workers/chunks/4385a268c2a64281d1c1.js +1 -0
- package/assets/esri/core/workers/chunks/{44b01d42d4ec72913229.js → 438f0b5ae5c53ae4f06a.js} +1 -1
- package/assets/esri/core/workers/chunks/{4d539878bfbd7c549e60.js → 46b4bb66a54bbd8e2e57.js} +1 -1
- package/assets/esri/core/workers/chunks/4c76146014dc15143ba3.js +1 -0
- package/assets/esri/core/workers/chunks/5a4a5585ec8027079f32.js +1 -0
- package/assets/esri/core/workers/chunks/5d991b74d958005c26c4.js +1 -0
- package/assets/esri/core/workers/chunks/5dfe1f8d520025e2118b.js +1 -0
- package/assets/esri/core/workers/chunks/601e697dc7414bda128a.js +1 -0
- package/assets/esri/core/workers/chunks/663ad15b86936eb06b69.js +1 -0
- package/assets/esri/core/workers/chunks/68a59ce98177d8513337.js +1 -0
- package/assets/esri/core/workers/chunks/{9cdaba126ac7fa5f33f0.js → 6cd5e4380d29b9a3c344.js} +1 -1
- package/assets/esri/core/workers/chunks/{a7b1b75643ed31489495.js → 6f50a9647f026a8d4729.js} +1 -1
- package/assets/esri/core/workers/chunks/{47395d225229d237f0ac.js → 7bc5cc5dbf1b7b70ddac.js} +1 -1
- package/assets/esri/core/workers/chunks/7d661129a0d8c466eeec.js +1 -0
- package/assets/esri/core/workers/chunks/{64276aacaafa4c8a15bd.js → 7dcf52d3db3903c8eb9f.js} +1 -1
- package/assets/esri/core/workers/chunks/8070972c0efb78523b68.js +1 -0
- package/assets/esri/core/workers/chunks/8fa0a14165d43ffe87a5.js +1 -0
- package/assets/esri/core/workers/chunks/94515fb3ef38067eeadd.js +1 -0
- package/assets/esri/core/workers/chunks/94b8dbf859df71858d1c.js +1 -0
- package/assets/esri/core/workers/chunks/97a28641b3b2fd31bea2.js +1 -0
- package/assets/esri/core/workers/chunks/{d1454155ee1b8a421cbb.js → 97ec9eef0048760fa260.js} +1 -1
- package/assets/esri/core/workers/chunks/98986e6601b0366376b4.js +1 -0
- package/assets/esri/core/workers/chunks/9cdcf9309d6feda70185.js +1 -0
- package/assets/esri/core/workers/chunks/a78757b9c7e8cbea08fa.js +1 -0
- package/assets/esri/core/workers/chunks/aa04b90b82bf70caaae4.js +1 -0
- package/assets/esri/core/workers/chunks/{b10fcbe1393c812fc219.js → aa861b8eae6c85f3dad4.js} +1 -1
- package/assets/esri/core/workers/chunks/aace7e1fef256bb961c9.js +1 -0
- package/assets/esri/core/workers/chunks/{ed0297fc61014e848c18.js → af5694b4d278cf1db2d9.js} +1 -1
- package/assets/esri/core/workers/chunks/afbb4f802ca5774f0326.js +1 -0
- package/assets/esri/core/workers/chunks/b0b036ad3ad3cd956747.js +1 -0
- package/assets/esri/core/workers/chunks/b2c5f92e3d7606297ca9.js +1 -0
- package/assets/esri/core/workers/chunks/b2d2de935487257c568b.js +1 -0
- package/assets/esri/core/workers/chunks/b2ebe4f6d100e15b512d.js +1 -0
- package/assets/esri/core/workers/chunks/b8316c6469a543029bc6.js +1 -0
- package/assets/esri/core/workers/chunks/{4b69129c0557852d9b3d.js → ba5eb394f098968c22d2.js} +1 -1
- package/assets/esri/core/workers/chunks/bf0a65b4be31959f921d.js +1 -0
- package/assets/esri/core/workers/chunks/bf6dda4a2af14c4b7716.js +1 -0
- package/assets/esri/core/workers/chunks/c890c7fca27170e3341f.js +1 -0
- package/assets/esri/core/workers/chunks/{573dc3064e84ca86844d.js → c959e0d1cf7dce0421b9.js} +1 -1
- package/assets/esri/core/workers/chunks/c976785f2391c77d8a30.js +1 -0
- package/assets/esri/core/workers/chunks/{1fd48459afb58a6cf14f.js → ca2f5faa01d99c21ec14.js} +1 -1
- package/assets/esri/core/workers/chunks/{7aa543a97f055cddea99.js → cc146c57bbdac8029fd8.js} +1 -1
- package/assets/esri/core/workers/chunks/{d39b7983b68d6e5b404d.js → cdbc005eebec1503b99d.js} +1 -1
- package/assets/esri/core/workers/chunks/{7e596478507466953e65.js → cef4af64860ebbfc1c47.js} +1 -1
- package/assets/esri/core/workers/chunks/d72488db62fcf39447b6.js +1 -0
- package/assets/esri/core/workers/chunks/de6cff7b6cbbf99b20d1.js +981 -0
- package/assets/esri/core/workers/chunks/e4b84ca8ddfd48dd79b1.js +1 -0
- package/assets/esri/core/workers/chunks/e4e2036373166c1d5cf5.js +1 -0
- package/assets/esri/core/workers/chunks/e4f93c55eaefab4192b5.js +1 -0
- package/assets/esri/core/workers/chunks/e6165e17fbb07bfc40a1.js +1 -0
- package/assets/esri/core/workers/chunks/e9e5196b44b6923be1a3.js +1 -0
- package/assets/esri/core/workers/chunks/{f678293de9a6d8f5b5db.js → ec89466f76d0ba22525e.js} +1 -1
- package/assets/esri/core/workers/chunks/ee45618c45806ab654cb.js +1 -0
- package/assets/esri/core/workers/chunks/f4baa5ea2e42b1317941.js +1 -0
- package/assets/esri/core/workers/chunks/f760a3e030b0f358a92a.js +1 -0
- package/assets/esri/core/workers/chunks/face43cf5abcd2f5bd9d.js +1 -0
- package/assets/esri/libs/vxl/vxlLayer.wasm +0 -0
- package/assets/esri/themes/base/_mixins.scss +4 -1
- package/assets/esri/themes/base/icons/style.scss +11 -2
- package/assets/esri/themes/base/widgets/_BasemapLayerList.scss +13 -10
- package/assets/esri/themes/base/widgets/_CoordinateConversion.scss +4 -2
- package/assets/esri/themes/base/widgets/_Directions.scss +5 -3
- package/assets/esri/themes/base/widgets/_Editor.scss +5 -2
- package/assets/esri/themes/base/widgets/_ElevationProfile.scss +6 -4
- package/assets/esri/themes/base/widgets/_FeatureTable.scss +6 -0
- package/assets/esri/themes/base/widgets/_ItemList.scss +1 -1
- package/assets/esri/themes/base/widgets/_LayerList.scss +13 -9
- package/assets/esri/themes/base/widgets/_Popup.scss +4 -2
- package/assets/esri/themes/base/widgets/_Print.scss +24 -11
- package/assets/esri/themes/base/widgets/_Search.scss +4 -2
- package/assets/esri/themes/base/widgets/_TableList.scss +9 -7
- package/assets/esri/themes/base/widgets/_Weather.scss +12 -0
- package/assets/esri/themes/base/widgets/_Widget.scss +18 -9
- package/assets/esri/themes/dark/main.css +1 -1
- package/assets/esri/themes/dark-blue/main.css +1 -1
- package/assets/esri/themes/dark-green/main.css +1 -1
- package/assets/esri/themes/dark-purple/main.css +1 -1
- package/assets/esri/themes/dark-red/main.css +1 -1
- package/assets/esri/themes/light/main.css +1 -1
- package/assets/esri/themes/light/view.css +1 -1
- package/assets/esri/themes/light-blue/main.css +1 -1
- package/assets/esri/themes/light-green/main.css +1 -1
- package/assets/esri/themes/light-purple/main.css +1 -1
- package/assets/esri/themes/light-red/main.css +1 -1
- package/assets/esri/widgets/Weather/t9n/Weather.json +1 -1
- package/assets/esri/widgets/Weather/t9n/Weather_en.json +1 -1
- package/chunks/CloudsComposition.glsl.js +4 -4
- package/chunks/ComponentShader.glsl.js +19 -19
- package/chunks/DefaultMaterial.glsl.js +2 -2
- package/chunks/Terrain.glsl.js +11 -11
- package/chunks/WaterSurface.glsl.js +21 -21
- package/chunks/pe.js +1 -1
- package/chunks/vec3.js +1 -1
- package/chunks/vxlLayer.js +1 -1
- package/core/accessorSupport/ensureType.js +1 -1
- package/core/accessorSupport/get.js +1 -1
- package/core/accessorSupport/read.js +1 -1
- package/core/accessorSupport/set.js +1 -1
- package/core/accessorSupport/write.js +1 -1
- package/core/has.js +1 -1
- package/core/libs/gl-matrix-2/math/vec3.js +1 -1
- package/core/typedArrayUtil.js +1 -1
- package/core/workers/workerFactory.js +1 -1
- package/geometry/pe.js +1 -1
- package/geometry/support/axisAngleDegrees.js +1 -1
- package/geometry/support/heightModelInfoUtils.js +1 -1
- package/interfaces.d.ts +315 -78
- package/layers/RouteLayer.js +1 -1
- package/layers/VoxelLayer.js +1 -1
- package/layers/VoxelWasmPerScene.js +1 -1
- package/layers/mixins/OperationalLayer.js +1 -1
- package/layers/support/RasterWorker.js +1 -1
- package/layers/support/rasterDatasets/BaseRaster.js +1 -1
- package/layers/support/rasterFunctions/rasterProjectionHelper.js +1 -1
- package/libs/vxl/enums.js +1 -1
- package/package.json +2 -2
- package/popup/content/AttachmentsContent.js +1 -1
- package/popup/content/support/mediaInfoTypes.js +1 -1
- package/portal/schemas/buildingSceneLayerItem.js +1 -1
- package/portal/schemas/definitions.js +1 -1
- package/portal/schemas/integratedMeshLayerItem.js +1 -1
- package/portal/schemas/pointCloudLayerItem.js +1 -1
- package/portal/schemas/sceneLayerItem.js +1 -1
- package/portal/schemas/webScene.js +1 -1
- package/rasterRenderers.js +1 -1
- package/rest/find.js +1 -1
- package/rest/geometryService/generalize.js +1 -1
- package/rest/geometryService/lengths.js +1 -1
- package/rest/geometryService/offset.js +1 -1
- package/rest/geometryService/relation.js +1 -1
- package/rest/geometryService/trimExtend.js +1 -1
- package/rest/identify.js +1 -1
- package/{tasks → rest}/operations/find.js +0 -0
- package/{tasks → rest}/operations/generalize.js +0 -0
- package/rest/operations/identify.js +5 -0
- package/{tasks → rest}/operations/lengths.js +0 -0
- package/{tasks → rest}/operations/offset.js +0 -0
- package/{tasks → rest}/operations/relation.js +0 -0
- package/{tasks → rest}/operations/trimExtend.js +0 -0
- package/{tasks → rest}/operations/urlUtils.js +0 -0
- package/rest/print.js +1 -1
- package/rest/query/operations/query.js +1 -1
- package/rest/query/operations/queryAttachments.js +1 -1
- package/rest/query/operations/queryRelatedRecords.js +1 -1
- package/rest/query/operations/queryTopFeatures.js +1 -1
- package/rest/route/utils.js +1 -1
- package/rest/support/NetworkServiceDescription.js +1 -1
- package/rest/support/RouteInfo.js +1 -1
- package/rest/support/RouteParameters.js +1 -1
- package/rest/support/RouteSettings.js +5 -0
- package/rest/support/Stop.js +1 -1
- package/rest/support/networkEnums.js +1 -1
- package/support/revision.js +1 -1
- package/symbols/Font.js +1 -1
- package/symbols/LabelSymbol3D.js +1 -1
- package/symbols/PointSymbol3D.js +1 -1
- package/symbols/TextSymbol.js +1 -1
- package/symbols/TextSymbol3DLayer.js +1 -1
- package/symbols/cim/CIMSymbolHelper.js +1 -1
- package/symbols/cim/CIMSymbolRasterizer.js +1 -1
- package/symbols/cim/cimAnalyzer.js +1 -1
- package/symbols/cim/placements/PlacementAlongLineSameSize.js +1 -1
- package/symbols/support/Symbol3DVerticalOffset.js +1 -1
- package/symbols/support/cimSymbolUtils.js +1 -1
- package/symbols/support/previewCIMSymbol.js +1 -1
- package/symbols/support/previewSymbol2D.js +1 -1
- package/symbols/support/previewSymbol3D.js +1 -1
- package/symbols/support/previewWebStyleSymbol.js +1 -1
- package/symbols/support/svgUtils.js +1 -1
- package/symbols/support/textUtils.js +5 -0
- package/symbols.js +1 -1
- package/views/2d/engine/vectorTiles/style/VectorTilesRequestManager.js +1 -1
- package/views/2d/engine/webgl/brushes/raster/BrushRasterBitmap.js +1 -1
- package/views/2d/engine/webgl/mesh/templates/WGLFillTemplate.js +1 -1
- package/views/2d/engine/webgl/shaders/sources/shaderRepository.js +1 -1
- package/views/2d/layers/features/sources/BaseFeatureSource.js +1 -1
- package/views/2d/layers/imagery/BaseImageryTileSubView2D.js +1 -1
- package/views/2d/support/engineHelpers.js +1 -1
- package/views/3d/environment/CloudsComposition.glsl.js +1 -1
- package/views/3d/environment/CloudsComposition.js +1 -1
- package/views/3d/environment/CloudsGenerator.js +1 -1
- package/views/3d/environment/EnvironmentRenderer.js +1 -1
- package/views/3d/environment/Fog.js +1 -1
- package/views/3d/environment/SceneViewEnvironmentManager.js +1 -1
- package/views/3d/environment/weather.js +1 -1
- package/views/3d/interactive/editingTools/transformGraphic/ScaleRotateMeshAdapter.js +1 -1
- package/views/3d/layers/FeatureLayerViewBase3D.js +1 -1
- package/views/3d/layers/FeatureLikeLayerView3D.js +1 -1
- package/views/3d/layers/GraphicsLayerView3D.js +1 -1
- package/views/3d/layers/GraphicsView3D.js +1 -1
- package/views/3d/layers/SceneLayerGraphicsView3D.js +1 -1
- package/views/3d/layers/VoxelLayerView3D.js +1 -1
- package/views/3d/layers/graphics/Graphics3DCore.js +1 -1
- package/views/3d/layers/graphics/Graphics3DDrapedGraphicLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DElevationAlignment.js +1 -1
- package/views/3d/layers/graphics/Graphics3DFeatureProcessor.js +5 -0
- package/views/3d/layers/graphics/Graphics3DFrustumVisibility.js +1 -1
- package/views/3d/layers/graphics/Graphics3DIconSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DLineSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DMeshFillSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DPolygonFillSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DScaleVisibility.js +1 -1
- package/views/3d/layers/graphics/Graphics3DSymbolCreationContext.js +1 -1
- package/views/3d/layers/graphics/Graphics3DSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DTextSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DWaterSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/{Graphics3DGraphicLikeLayerView.js → GraphicsProcessor.js} +1 -1
- package/views/3d/layers/graphics/QueryEngine.js +1 -1
- package/views/3d/support/pointsOfInterest/Focus.js +1 -1
- package/views/3d/terrain/OverlayRenderer.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/Transform.glsl.js +7 -1
- package/views/3d/webgl-engine/core/shaderLibrary/default/DefaultMaterialAuxiliaryPasses.glsl.js +28 -24
- package/views/3d/webgl-engine/core/shaderLibrary/shading/Water.glsl.js +21 -13
- package/views/3d/webgl-engine/core/shaderLibrary/terrain/Overlay.glsl.js +2 -2
- package/views/3d/webgl-engine/core/shaderLibrary/util/CloudsParallaxShading.glsl.js +12 -14
- package/views/3d/webgl-engine/lib/OffscreenRendering.js +1 -1
- package/views/3d/webgl-engine/lib/RenderGeometry.js +1 -1
- package/views/3d/webgl-engine/lib/Renderer.js +1 -1
- package/views/3d/webgl-engine/lib/ShadowAccumulator.js +1 -1
- package/views/3d/webgl-engine/lib/TextRenderParameters.js +1 -1
- package/views/3d/webgl-engine/lib/TextRenderer.js +1 -1
- package/views/3d/webgl-engine/lib/intersectorUtilsConversions.js +1 -1
- package/views/3d/webgl-engine/lib/lodRendering/LodRenderer.js +1 -1
- package/views/3d/webgl-engine/materials/DefaultMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/WaterTechnique.js +1 -1
- package/views/3d/webgl-engine/parts/Model.js +1 -1
- package/views/3d/webgl-engine/parts/ScreenshotManager.js +1 -1
- package/views/3d/webgl-engine/shaders/DefaultMaterialTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/RealisticTreeTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/WaterSurface.glsl.js +1 -1
- package/views/SceneView.js +1 -1
- package/views/interactive/dragEventPipeline.js +1 -1
- package/views/interactive/editGeometry/operations/OffsetEdgeVertex.js +1 -1
- package/views/support/DefaultsFromMap.js +1 -1
- package/views/webgl/ContextState.js +1 -1
- package/views/webgl/FramebufferObject.js +1 -1
- package/views/webgl/Renderbuffer.js +1 -1
- package/views/webgl/RenderingContext.js +1 -1
- package/views/webgl/Texture.js +1 -1
- package/views/webgl/Util.js +1 -1
- package/views/webgl/enums.js +1 -1
- package/views/webgl/rasterUtils.js +1 -1
- package/views/webgl/testFloatBufferBlend.js +1 -1
- package/widgets/Attachments.js +1 -1
- package/widgets/Editor/workflowUtils.js +1 -1
- package/widgets/Feature/FeatureExpression.js +1 -1
- package/widgets/Feature/FeatureMedia/FeatureMediaViewModel.js +1 -1
- package/widgets/Feature/FeatureMedia.js +1 -1
- package/widgets/Feature/FeatureViewModel.js +1 -1
- package/widgets/FeatureForm/InputField.js +1 -1
- package/widgets/FeatureTable/FeatureTableViewModel.js +1 -1
- package/widgets/FeatureTable/Grid/Grid.js +1 -1
- package/widgets/FeatureTable.js +1 -1
- package/widgets/LayerList/LayerListViewModel.js +1 -1
- package/widgets/Popup/PopupViewModel.js +1 -1
- package/widgets/Popup/actionUtils.js +1 -1
- package/widgets/Slice/SliceViewModel.js +1 -1
- package/widgets/Slider/SliderViewModel.js +1 -1
- package/widgets/Slider.js +1 -1
- package/widgets/Weather/WeatherViewModel.js +1 -1
- package/widgets/Weather/css.js +1 -1
- package/widgets/Weather.js +1 -1
- package/widgets/support/InteractiveAnalysisViewModel.js +1 -1
- package/widgets/support/InteractiveToolViewModel.js +1 -1
- package/widgets/support/geolocationUtils.js +1 -1
- package/assets/components/assets/calcite-icon/checkSquareF16.json +0 -1
- package/assets/components/assets/calcite-icon/checkSquareF24.json +0 -1
- package/assets/components/assets/calcite-icon/checkSquareF32.json +0 -1
- package/assets/components/assets/calcite-icon/lineSolid4.json +0 -1
- package/assets/components/assets/calcite-icon/squareF16.json +0 -1
- package/assets/components/assets/calcite-icon/squareF24.json +0 -1
- package/assets/components/assets/calcite-icon/squareF32.json +0 -1
- package/assets/components/assets/calcite-icon/xHexagon16.json +0 -1
- package/assets/components/assets/calcite-icon/xHexagon24.json +0 -1
- package/assets/components/assets/calcite-icon/xHexagon32.json +0 -1
- package/assets/components/assets/calcite-icon/xHexagonF16.json +0 -1
- package/assets/components/assets/calcite-icon/xHexagonF24.json +0 -1
- package/assets/components/assets/calcite-icon/xHexagonF32.json +0 -1
- package/assets/components/assets/calcite-icon/xOctagonF16.json +0 -1
- package/assets/components/assets/calcite-icon/xOctagonF24.json +0 -1
- package/assets/components/assets/calcite-icon/xOctagonF32.json +0 -1
- package/assets/esri/core/workers/chunks/01ef8de7f76a8c61b464.js +0 -1
- package/assets/esri/core/workers/chunks/09da224052976e290828.js +0 -1
- package/assets/esri/core/workers/chunks/0f254c3e91e8fee55f28.js +0 -1
- package/assets/esri/core/workers/chunks/20411bb8e04703962ce6.js +0 -1
- package/assets/esri/core/workers/chunks/21a77eed1a4ef5b0ff08.js +0 -1
- package/assets/esri/core/workers/chunks/23745a5ab47c840dc452.js +0 -1
- package/assets/esri/core/workers/chunks/2416f8bf8bbd2ec786ab.js +0 -1
- package/assets/esri/core/workers/chunks/2d947080a27db6ce0d75.js +0 -1
- package/assets/esri/core/workers/chunks/2e445a8735ea2adb641a.js +0 -1
- package/assets/esri/core/workers/chunks/32f8c4af7e70ebdcb19e.js +0 -1
- package/assets/esri/core/workers/chunks/3564e14010953def6df9.js +0 -1
- package/assets/esri/core/workers/chunks/390d9021169e65c10eb8.js +0 -1
- package/assets/esri/core/workers/chunks/3a9740dccda6a733313c.js +0 -1
- package/assets/esri/core/workers/chunks/403c7d64f12f00330d88.js +0 -1
- package/assets/esri/core/workers/chunks/4409d77c9734de4e82a7.js +0 -1
- package/assets/esri/core/workers/chunks/4c301ca9c493b96df746.js +0 -1
- package/assets/esri/core/workers/chunks/60371c0f750cde87656d.js +0 -1
- package/assets/esri/core/workers/chunks/615aa2d3ecafe30c80c0.js +0 -1
- package/assets/esri/core/workers/chunks/631c5b514bb73782c570.js +0 -1
- package/assets/esri/core/workers/chunks/6c1e92ff4c732dfda756.js +0 -1
- package/assets/esri/core/workers/chunks/722a10c65456844d72b9.js +0 -1
- package/assets/esri/core/workers/chunks/75d53b28afe732c459b2.js +0 -1
- package/assets/esri/core/workers/chunks/85b34d91cf07567d6873.js +0 -1
- package/assets/esri/core/workers/chunks/8967288145f8fbd20e7d.js +0 -1
- package/assets/esri/core/workers/chunks/89de05207744149fb58b.js +0 -1
- package/assets/esri/core/workers/chunks/8fdd5bca3716816d359b.js +0 -1
- package/assets/esri/core/workers/chunks/987182b3a578fc7de251.js +0 -1
- package/assets/esri/core/workers/chunks/99a777693e4539f0b03b.js +0 -1
- package/assets/esri/core/workers/chunks/9d9dffc8884d66a258e4.js +0 -1
- package/assets/esri/core/workers/chunks/a28b53c61bddefb6616e.js +0 -1
- package/assets/esri/core/workers/chunks/a6ff3db3493543df81bc.js +0 -1
- package/assets/esri/core/workers/chunks/a8c13529367c037cdd94.js +0 -1
- package/assets/esri/core/workers/chunks/a960074644c3722be71e.js +0 -1
- package/assets/esri/core/workers/chunks/ac8dca61ade28c542ae2.js +0 -1
- package/assets/esri/core/workers/chunks/b99e69302ea701fff0ea.js +0 -971
- package/assets/esri/core/workers/chunks/b9de831ac379cf1d2969.js +0 -1
- package/assets/esri/core/workers/chunks/bc790b2f964144d10abe.js +0 -1
- package/assets/esri/core/workers/chunks/be2b7cce79fd41627931.js +0 -1
- package/assets/esri/core/workers/chunks/c13dfdd548dcb1bdb294.js +0 -1
- package/assets/esri/core/workers/chunks/c3eca92d02958732e141.js +0 -1
- package/assets/esri/core/workers/chunks/c6bd943fe8fd13bb4806.js +0 -1
- package/assets/esri/core/workers/chunks/c6f94b92e866b881d9b9.js +0 -1
- package/assets/esri/core/workers/chunks/cb68db7169b9dfd1c3ff.js +0 -1
- package/assets/esri/core/workers/chunks/cc96608b2802fbfe7a08.js +0 -1
- package/assets/esri/core/workers/chunks/cd02fe27eb07681cb366.js +0 -1
- package/assets/esri/core/workers/chunks/d52108864136c5a8a618.js +0 -1
- package/assets/esri/core/workers/chunks/da1c2873bdbc0956dca0.js +0 -1
- package/assets/esri/core/workers/chunks/dd433c160f7a0c120b82.js +0 -1
- package/assets/esri/core/workers/chunks/de03439ca2c9782bf325.js +0 -1
- package/assets/esri/core/workers/chunks/e2d68bcd2f99a65387bf.js +0 -1
- package/assets/esri/core/workers/chunks/ef8b75b92cf549e0507e.js +0 -1
- package/assets/esri/core/workers/chunks/f7fc4c993536e62f7f3e.js +0 -1
- package/assets/esri/core/workers/chunks/fd3e5d823dc7917f4b8f.js +0 -1
- package/symbols/support/constants.js +0 -5
- package/tasks/operations/identify.js +0 -5
- package/views/3d/layers/graphics/Graphics3DFeatureLikeLayerView.js +0 -5
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[7783],{96794:(e,t,s)=>{s.d(t,{r:()=>i});var r=s(88764);function i(e,t){if(!(this instanceof i))return new i(e,t);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()}function n(e,t,s){if(!s)return t.indexOf(e);for(var r=0;r<t.length;r++)if(s(e,t[r]))return r;return-1}function o(e,t){a(e,0,e.children.length,t,e)}function a(e,t,s,r,i){i||(i=m(null)),i.minX=1/0,i.minY=1/0,i.maxX=-1/0,i.maxY=-1/0;for(var n,o=t;o<s;o++)n=e.children[o],h(i,e.leaf?r(n):n);return i}function h(e,t){return 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),e}function c(e,t){return e.minX-t.minX}function u(e,t){return e.minY-t.minY}function l(e){return(e.maxX-e.minX)*(e.maxY-e.minY)}function d(e){return e.maxX-e.minX+(e.maxY-e.minY)}function p(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){var s=Math.max(e.minX,t.minX),r=Math.max(e.minY,t.minY),i=Math.min(e.maxX,t.maxX),n=Math.min(e.maxY,t.maxY);return Math.max(0,i-s)*Math.max(0,n-r)}function _(e,t){return e.minX<=t.minX&&e.minY<=t.minY&&t.maxX<=e.maxX&&t.maxY<=e.maxY}function f(e,t){return t.minX<=e.maxX&&t.minY<=e.maxY&&t.maxX>=e.minX&&t.maxY>=e.minY}function m(e){return{children:e,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function y(e,t,s,i,n){for(var o,a=[t,s];a.length;)(s=a.pop())-(t=a.pop())<=i||(o=t+Math.ceil((s-t)/i/2)*i,(0,r.q)(e,o,t,s,n),a.push(t,o,o,s))}i.prototype={all:function(){return this._all(this.data,[])},search:function(e){var t=this.data,s=[],r=this.toBBox;if(!f(e,t))return s;for(var i,n,o,a,h=[];t;){for(i=0,n=t.children.length;i<n;i++)o=t.children[i],f(e,a=t.leaf?r(o):o)&&(t.leaf?s.push(o):_(e,a)?this._all(o,s):h.push(o));t=h.pop()}return s},collides:function(e){var t=this.data,s=this.toBBox;if(!f(e,t))return!1;for(var r,i,n,o,a=[];t;){for(r=0,i=t.children.length;r<i;r++)if(n=t.children[r],f(e,o=t.leaf?s(n):n)){if(t.leaf||_(e,o))return!0;a.push(n)}t=a.pop()}return!1},load:function(e){if(!e||!e.length)return this;if(e.length<this._minEntries){for(var t=0,s=e.length;t<s;t++)this.insert(e[t]);return this}var r=this._build(e.slice(),0,e.length-1,0);if(this.data.children.length)if(this.data.height===r.height)this._splitRoot(this.data,r);else{if(this.data.height<r.height){var i=this.data;this.data=r,r=i}this._insert(r,this.data.height-r.height-1,!0)}else this.data=r;return this},insert:function(e){return e&&this._insert(e,this.data.height-1),this},clear:function(){return this.data=m([]),this},remove:function(e,t){if(!e)return this;for(var s,r,i,o,a=this.data,h=this.toBBox(e),c=[],u=[];a||c.length;){if(a||(a=c.pop(),r=c[c.length-1],s=u.pop(),o=!0),a.leaf&&-1!==(i=n(e,a.children,t)))return a.children.splice(i,1),c.push(a),this._condense(c),this;o||a.leaf||!_(a,h)?r?(s++,a=r.children[s],o=!1):a=null:(c.push(a),u.push(s),s=0,r=a,a=a.children[0])}return this},toBBox:function(e){return e},compareMinX:c,compareMinY:u,toJSON:function(){return this.data},fromJSON:function(e){return this.data=e,this},_all:function(e,t){for(var s=[];e;)e.leaf?t.push.apply(t,e.children):s.push.apply(s,e.children),e=s.pop();return t},_build:function(e,t,s,r){var i,n=s-t+1,a=this._maxEntries;if(n<=a)return o(i=m(e.slice(t,s+1)),this.toBBox),i;r||(r=Math.ceil(Math.log(n)/Math.log(a)),a=Math.ceil(n/Math.pow(a,r-1))),(i=m([])).leaf=!1,i.height=r;var h,c,u,l,d=Math.ceil(n/a),p=d*Math.ceil(Math.sqrt(a));for(y(e,t,s,p,this.compareMinX),h=t;h<=s;h+=p)for(y(e,h,u=Math.min(h+p-1,s),d,this.compareMinY),c=h;c<=u;c+=d)l=Math.min(c+d-1,u),i.children.push(this._build(e,c,l,r-1));return o(i,this.toBBox),i},_chooseSubtree:function(e,t,s,r){for(var i,n,o,a,h,c,u,d;r.push(t),!t.leaf&&r.length-1!==s;){for(u=d=1/0,i=0,n=t.children.length;i<n;i++)h=l(o=t.children[i]),(c=p(e,o)-h)<d?(d=c,u=h<u?h:u,a=o):c===d&&h<u&&(u=h,a=o);t=a||t.children[0]}return t},_insert:function(e,t,s){var r=this.toBBox,i=s?e:r(e),n=[],o=this._chooseSubtree(i,this.data,t,n);for(o.children.push(e),h(o,i);t>=0&&n[t].children.length>this._maxEntries;)this._split(n,t),t--;this._adjustParentBBoxes(i,n,t)},_split:function(e,t){var s=e[t],r=s.children.length,i=this._minEntries;this._chooseSplitAxis(s,i,r);var n=this._chooseSplitIndex(s,i,r),a=m(s.children.splice(n,s.children.length-n));a.height=s.height,a.leaf=s.leaf,o(s,this.toBBox),o(a,this.toBBox),t?e[t-1].children.push(a):this._splitRoot(s,a)},_splitRoot:function(e,t){this.data=m([e,t]),this.data.height=e.height+1,this.data.leaf=!1,o(this.data,this.toBBox)},_chooseSplitIndex:function(e,t,s){var r,i,n,o,h,c,u,d;for(c=u=1/0,r=t;r<=s-t;r++)o=g(i=a(e,0,r,this.toBBox),n=a(e,r,s,this.toBBox)),h=l(i)+l(n),o<c?(c=o,d=r,u=h<u?h:u):o===c&&h<u&&(u=h,d=r);return d},_chooseSplitAxis:function(e,t,s){var r=e.leaf?this.compareMinX:c,i=e.leaf?this.compareMinY:u;this._allDistMargin(e,t,s,r)<this._allDistMargin(e,t,s,i)&&e.children.sort(r)},_allDistMargin:function(e,t,s,r){e.children.sort(r);var i,n,o=this.toBBox,c=a(e,0,t,o),u=a(e,s-t,s,o),l=d(c)+d(u);for(i=t;i<s-t;i++)n=e.children[i],h(c,e.leaf?o(n):n),l+=d(c);for(i=s-t-1;i>=t;i--)n=e.children[i],h(u,e.leaf?o(n):n),l+=d(u);return l},_adjustParentBBoxes:function(e,t,s){for(var r=s;r>=0;r--)h(t[r],e)},_condense:function(e){for(var t,s=e.length-1;s>=0;s--)0===e[s].children.length?s>0?(t=e[s-1].children).splice(t.indexOf(e[s]),1):this.clear():o(e[s],this.toBBox)},_initFormat:function(e){var 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]+"};")}}},8557:(e,t,s)=>{s.d(t,{Z:()=>i});var r=s(70586);class i{constructor(e){this.size=0,this._start=0,this.maxSize=e,this._buffer=new Array(e)}get entries(){return this._buffer}enqueue(e){if(this.size===this.maxSize){const t=this._buffer[this._start];return this._buffer[this._start]=e,this._start=(this._start+1)%this.maxSize,t}return this._buffer[(this._start+this.size++)%this.maxSize]=e,null}dequeue(){if(0===this.size)return null;const e=this._buffer[this._start];return this._buffer[this._start]=null,this.size--,this._start=(this._start+1)%this.maxSize,e}peek(){return 0===this.size?null:this._buffer[this._start]}find(e){if(0===this.size)return null;for(const t of this._buffer)if((0,r.pC)(t)&&e(t))return t;return null}clear(e){let t=this.dequeue();for(;(0,r.pC)(t);)e&&e(t),t=this.dequeue()}}},3920:(e,t,s)=>{s.d(t,{r:()=>u,p:()=>c});var r=s(43697),i=s(15923),n=s(61247),o=s(5600),a=s(52011),h=s(89749);const c=e=>{let t=class extends e{destroy(){var e,t;this.destroyed||(null==(e=this._get("handles"))||e.destroy(),null==(t=this._get("updatingHandles"))||t.destroy())}get handles(){return this._get("handles")||new n.Z}get updatingHandles(){return this._get("updatingHandles")||new h.t}};return(0,r._)([(0,o.Cb)({readOnly:!0})],t.prototype,"handles",null),(0,r._)([(0,o.Cb)({readOnly:!0})],t.prototype,"updatingHandles",null),t=(0,r._)([(0,a.j)("esri.core.HandleOwner")],t),t};let u=class extends(c(i.Z)){};u=(0,r._)([(0,a.j)("esri.core.HandleOwner")],u)},45091:(e,t,s)=>{s.d(t,{Z:()=>u});var r,i,n=s(80442),o=s(71143);(i=r||(r={}))[i.varint=0]="varint",i[i.fixed64=1]="fixed64",i[i.delimited=2]="delimited",i[i.fixed32=5]="fixed32",i[i.unknown=99]="unknown";const a=4294967296,h=new TextDecoder("utf-8"),c=(0,n.Z)("safari")||(0,n.Z)("ios")?6:(0,n.Z)("ff")?12:32;class u{constructor(e,t,s=0,i=(e?e.byteLength:0)){this._tag=0,this._dataType=r.unknown,this._init(e,t,s,i)}_init(e,t,s,r){this._data=e,this._dataView=t,this._pos=s,this._end=r}clone(){return new u(this._data,this._dataView,this._pos,this._end)}pos(){return this._pos}move(e){this._pos=e}nextTag(e){for(;;){if(this._pos===this._end)return!1;const t=this._decodeVarint();if(this._tag=t>>3,this._dataType=7&t,!e||e===this._tag)break;this.skip()}return!0}next(){if(this._pos===this._end)return!1;const e=this._decodeVarint();return this._tag=e>>3,this._dataType=7&e,!0}empty(){return this._pos>=this._end}tag(){return this._tag}getInt32(){return this._decodeVarint()}getInt64(){return this._decodeVarint()}getUInt32(){let e=4294967295;return e=(127&this._data[this._pos])>>>0,this._data[this._pos++]<128?e:(e=(e|(127&this._data[this._pos])<<7)>>>0,this._data[this._pos++]<128?e:(e=(e|(127&this._data[this._pos])<<14)>>>0,this._data[this._pos++]<128?e:(e=(e|(127&this._data[this._pos])<<21)>>>0,this._data[this._pos++]<128?e:(e=(e|(15&this._data[this._pos])<<28)>>>0,this._data[this._pos++]<128?e:void 0))))}getUInt64(){return this._decodeVarint()}getSInt32(){const e=this.getUInt32();return e>>>1^-(1&e)|0}getSInt64(){return this._decodeSVarint()}getBool(){const e=0!==this._data[this._pos];return this._skip(1),e}getEnum(){return this._decodeVarint()}getFixed64(){const e=this._dataView,t=this._pos,s=e.getUint32(t,!0)+e.getUint32(t+4,!0)*a;return this._skip(8),s}getSFixed64(){const e=this._dataView,t=this._pos,s=e.getUint32(t,!0)+e.getInt32(t+4,!0)*a;return this._skip(8),s}getDouble(){const e=this._dataView.getFloat64(this._pos,!0);return this._skip(8),e}getFixed32(){const e=this._dataView.getUint32(this._pos,!0);return this._skip(4),e}getSFixed32(){const e=this._dataView.getInt32(this._pos,!0);return this._skip(4),e}getFloat(){const e=this._dataView.getFloat32(this._pos,!0);return this._skip(4),e}getString(){const e=this._getLength(),t=this._pos,s=this._toString(this._data,t,t+e);return this._skip(e),s}getBytes(){const e=this._getLength(),t=this._pos,s=this._toBytes(this._data,t,t+e);return this._skip(e),s}getLength(){return this._getLengthUnsafe()}processMessageWithArgs(e,t,s,r){const i=this.getMessage(),n=e(i,t,s,r);return i.release(),n}processMessage(e){const t=this.getMessage(),s=e(t);return t.release(),s}getMessage(){const e=this._getLength(),t=u.pool.acquire();return t._init(this._data,this._dataView,this._pos,this._pos+e),this._skip(e),t}release(){u.pool.release(this)}dataType(){return this._dataType}skip(){switch(this._dataType){case r.varint:this._decodeVarint();break;case r.fixed64:this._skip(8);break;case r.delimited:this._skip(this._getLength());break;case r.fixed32:this._skip(4);break;default:throw new Error("Invalid data type!")}}skipLen(e){this._skip(e)}_skip(e){if(this._pos+e>this._end)throw new Error("Attempt to skip past the end of buffer!");this._pos+=e}_decodeVarint(){const e=this._data;let t,s=this._pos,r=0;if(this._end-s>=10)do{if(t=e[s++],r|=127&t,0==(128&t))break;if(t=e[s++],r|=(127&t)<<7,0==(128&t))break;if(t=e[s++],r|=(127&t)<<14,0==(128&t))break;if(t=e[s++],r|=(127&t)<<21,0==(128&t))break;if(t=e[s++],r+=268435456*(127&t),0==(128&t))break;if(t=e[s++],r+=34359738368*(127&t),0==(128&t))break;if(t=e[s++],r+=4398046511104*(127&t),0==(128&t))break;if(t=e[s++],r+=562949953421312*(127&t),0==(128&t))break;if(t=e[s++],r+=72057594037927940*(127&t),0==(128&t))break;if(t=e[s++],r+=0x8000000000000000*(127&t),0==(128&t))break;throw new Error("Varint too long!")}while(0);else{let i=1;for(;s!==this._end&&(t=e[s],0!=(128&t));)++s,r+=(127&t)*i,i*=128;if(s===this._end)throw new Error("Varint overrun!");++s,r+=t*i}return this._pos=s,r}_decodeSVarint(){const e=this._decodeVarint();return e%2?-(e+1)/2:e/2}_getLength(){if(this._dataType!==r.delimited)throw new Error("Not a delimited data type!");return this._decodeVarint()}_getLengthUnsafe(){return this.getUInt32()}_toString(e,t,s){if((s=Math.min(this._end,s))-t>c){const r=e.subarray(t,s);return h.decode(r)}let r="",i="";for(let n=t;n<s;++n){const t=e[n];128&t?i+="%"+t.toString(16):(r+=decodeURIComponent(i)+String.fromCharCode(t),i="")}return i.length&&(r+=decodeURIComponent(i)),r}_toBytes(e,t,s){return s=Math.min(this._end,s),new Uint8Array(e.buffer,t,s-t)}}u.pool=new o.Z(u,null,(e=>{e._data=null,e._dataView=null}))},80903:(e,t,s)=>{s.d(t,{Z:()=>h});var r=s(50758),i=s(92604),n=s(95330),o=s(25045);const a=i.Z.getLogger("esri.core.workers.Connection");class h{constructor(){this._clients=new Array,this._clientPromises=new Array,this._clientIdx=0}destroy(){this.close()}get closed(){return!this._clients||!this._clients.length}open(e,t){return new Promise(((s,r)=>{let i=!0;const a=e=>{(0,n.k_)(t.signal),i&&(i=!1,e())};this._clients.length=e.length,this._clientPromises.length=e.length;for(let i=0;i<e.length;++i){const h=e[i];(0,n.y8)(h)?this._clientPromises[i]=h.then((e=>(this._clients[i]=new o.default(e,t),a(s),this._clients[i])),(()=>(a(r),null))):(this._clients[i]=new o.default(h,t),this._clientPromises[i]=Promise.resolve(this._clients[i]),a(s))}}))}broadcast(e,t,s){const r=new Array(this._clientPromises.length);for(let i=0;i<this._clientPromises.length;++i){const n=this._clientPromises[i];r[i]=n.then((r=>r.invoke(e,t,s)))}return r}close(){for(const e of this._clientPromises)e.then((e=>e.close()));this._clients.length=0,this._clientPromises.length=0}getAvailableClient(){let e;for(let t=0;t<this._clients.length;++t){const s=this._clients[t];if(s){if(!s.isBusy())return Promise.resolve(s)}else e=e||[],e.push(this._clientPromises[t])}return e?Promise.race(e):(this._clientIdx=(this._clientIdx+1)%this._clients.length,Promise.resolve(this._clients[this._clientIdx]))}invoke(e,t,s){let r=null;return Array.isArray(s)?(a.warn("invoke()","The transferList parameter is deprecated, use the options object instead"),r={transferList:s}):r=s,this.closed?Promise.reject(new Error("Connection closed")):this.getAvailableClient().then((s=>s.invoke(e,t,r)))}on(e,t){return Promise.all(this._clientPromises).then((()=>(0,r.AL)(this._clients.map((s=>s.on(e,t))))))}openPorts(){return new Promise((e=>{const t=new Array(this._clientPromises.length);let s=t.length;for(let r=0;r<this._clientPromises.length;++r)this._clientPromises[r].then((i=>{t[r]=i.openPort(),0==--s&&e(t)}))}))}get test(){return{numClients:this._clients.length}}}},66677:(e,t,s)=>{s.d(t,{ld:()=>g,B5:()=>l,M8:()=>f,G:()=>x,Qc:()=>d,DR:()=>p,Nm:()=>m,XG:()=>y,a7:()=>_,wH:()=>I});var r=s(70586),i=s(17452),n=s(25929);const o={mapserver:"MapServer",imageserver:"ImageServer",featureserver:"FeatureServer",sceneserver:"SceneServer",streamserver:"StreamServer",vectortileserver:"VectorTileServer"},a=Object.values(o),h=new RegExp(`^((?:https?:)?\\/\\/\\S+?\\/rest\\/services\\/(.+?)\\/(${a.join("|")}))(?:\\/(?:layers\\/)?(\\d+))?`,"i"),c=new RegExp(`^((?:https?:)?\\/\\/\\S+?\\/([^\\/\\n]+)\\/(${a.join("|")}))(?:\\/(?:layers\\/)?(\\d+))?`,"i"),u=/(.*?)\/(?:layers\/)?(\d+)\/?$/i;function l(e){return!!h.test(e)}function d(e){const t=(0,i.mN)(e),s=t.path.match(h)||t.path.match(c);if(!s)return null;const[,r,n,a,u]=s,l=n.indexOf("/");return{title:g(-1!==l?n.slice(l+1):n),serverType:o[a.toLowerCase()],sublayer:null!=u&&""!==u?parseInt(u,10):null,url:{path:r}}}function p(e){const t=(0,i.mN)(e).path.match(u);return t?{serviceUrl:t[1],sublayerId:Number(t[2])}:null}function g(e){return(e=e.replace(/\s*[/_]+\s*/g," "))[0].toUpperCase()+e.slice(1)}function _(e,t){const s=[];if(e){const t=d(e);(0,r.pC)(t)&&t.title&&s.push(t.title)}if(t){const e=g(t);s.push(e)}if(2===s.length){if(-1!==s[0].toLowerCase().indexOf(s[1].toLowerCase()))return s[0];if(-1!==s[1].toLowerCase().indexOf(s[0].toLowerCase()))return s[1]}return s.join(" - ")}function f(e){if(!e)return!1;const t=-1!==(e=e.toLowerCase()).indexOf(".arcgis.com/"),s=-1!==e.indexOf("//services")||-1!==e.indexOf("//tiles")||-1!==e.indexOf("//features");return t&&s}function m(e,t){return e?(0,i.Qj)((0,i.Hu)(e,t)):e}function y(e){let{url:t}=e;if(!t)return{url:t};t=(0,i.Hu)(t,e.logger);const s=(0,i.mN)(t),n=d(s.path);let o;if((0,r.pC)(n))null!=n.sublayer&&null==e.layer.layerId&&(o=n.sublayer),t=n.url.path;else if(e.nonStandardUrlAllowed){const e=p(s.path);(0,r.pC)(e)&&(t=e.serviceUrl,o=e.sublayerId)}return{url:(0,i.Qj)(t),layerId:o}}function I(e,t,s,r,o){(0,n.w)(t,r,"url",o),r.url&&null!=e.layerId&&(r.url=(0,i.v_)(r.url,s,e.layerId.toString()))}function x(e){if(!e)return!1;const t=e.toLowerCase(),s=-1!==t.indexOf("/services/"),r=-1!==t.indexOf("/mapserver/wmsserver"),i=-1!==t.indexOf("/imageserver/wmsserver"),n=-1!==t.indexOf("/wmsserver");return s&&(r||i||n)}},77863:(e,t,s)=>{s.d(t,{K9:()=>A,O7:()=>l,G$:()=>S});var r=s(20102),i=s(70586),n=s(45091),o=s(5428),a=s(78760);const h=["esriFieldTypeSmallInteger","esriFieldTypeInteger","esriFieldTypeSingle","esriFieldTypeDouble","esriFieldTypeString","esriFieldTypeDate","esriFieldTypeOID","esriFieldTypeGeometry","esriFieldTypeBlob","esriFieldTypeRaster","esriFieldTypeGUID","esriFieldTypeGlobalID","esriFieldTypeXML"],c=["sqlTypeBigInt","sqlTypeBinary","sqlTypeBit","sqlTypeChar","sqlTypeDate","sqlTypeDecimal","sqlTypeDouble","sqlTypeFloat","sqlTypeGeometry","sqlTypeGUID","sqlTypeInteger","sqlTypeLongNVarchar","sqlTypeLongVarbinary","sqlTypeLongVarchar","sqlTypeNChar","sqlTypeNVarchar","sqlTypeOther","sqlTypeReal","sqlTypeSmallInt","sqlTypeSqlXml","sqlTypeTime","sqlTypeTimestamp","sqlTypeTimestamp2","sqlTypeTinyInt","sqlTypeVarbinary","sqlTypeVarchar"],u=["upperLeft","lowerLeft"];function l(e){return e>=h.length?null:h[e]}function d(e){return e>=c.length?null:c[e]}function p(e){return e>=u.length?null:u[e]}function g(e,t){return t>=e.geometryTypes.length?null:e.geometryTypes[t]}function _(e,t,s){const r=t.createPointGeometry(s);for(;e.next();)switch(e.tag()){case 3:{const s=e.getUInt32(),i=e.pos()+s;let n=0;for(;e.pos()<i;)t.addCoordinatePoint(r,e.getSInt64(),n++);break}default:e.skip()}return r}function f(e,t,s){const r=t.createGeometry(s),i=2+(s.hasZ?1:0)+(s.hasM?1:0);for(;e.next();)switch(e.tag()){case 2:{const s=e.getUInt32(),i=e.pos()+s;let n=0;for(;e.pos()<i;)t.addLength(r,e.getUInt32(),n++);break}case 3:{const s=e.getUInt32(),n=e.pos()+s;let o=0;for(t.allocateCoordinates(r);e.pos()<n;)t.addCoordinate(r,e.getSInt64(),o),o++,o===i&&(o=0);break}default:e.skip()}return r}function m(e){const t=new o.Z;let s="esriGeometryPoint";for(;e.next();)switch(e.tag()){case 2:{const s=e.getUInt32(),r=e.pos()+s;for(;e.pos()<r;)t.lengths.push(e.getUInt32());break}case 3:{const s=e.getUInt32(),r=e.pos()+s;for(;e.pos()<r;)t.coords.push(e.getSInt64());break}case 1:s=a.A[e.getEnum()];break;default:e.skip()}return{queryGeometry:t,queryGeometryType:s}}function y(e){for(;e.next();)switch(e.tag()){case 1:return e.getString();case 2:return e.getFloat();case 3:return e.getDouble();case 4:return e.getSInt32();case 5:return e.getUInt32();case 6:return e.getInt64();case 7:return e.getUInt64();case 8:return e.getSInt64();case 9:return e.getBool();default:return e.skip(),null}return null}function I(e){const t={type:l(0)};for(;e.next();)switch(e.tag()){case 1:t.name=e.getString();break;case 2:t.type=l(e.getEnum());break;case 3:t.alias=e.getString();break;case 4:t.sqlType=d(e.getEnum());break;case 5:default:e.skip();break;case 6:t.defaultValue=e.getString()}return t}function x(e){const t={};for(;e.next();)switch(e.tag()){case 1:t.name=e.getString();break;case 2:t.isSystemMaintained=e.getBool();break;default:e.skip()}return t}function b(e,t,s,r){const i=t.createFeature(s);let n=0;for(;e.next();)switch(e.tag()){case 1:{const t=r[n++].name;i.attributes[t]=e.processMessage(y);break}case 2:i.geometry=e.processMessageWithArgs(f,t,s);break;case 4:i.centroid=e.processMessageWithArgs(_,t,s);break;default:e.skip()}return i}function w(e){const t=[1,1,1,1];for(;e.next();)switch(e.tag()){case 1:t[0]=e.getDouble();break;case 2:t[1]=e.getDouble();break;case 4:t[2]=e.getDouble();break;case 3:t[3]=e.getDouble();break;default:e.skip()}return t}function v(e){const t=[0,0,0,0];for(;e.next();)switch(e.tag()){case 1:t[0]=e.getDouble();break;case 2:t[1]=e.getDouble();break;case 4:t[2]=e.getDouble();break;case 3:t[3]=e.getDouble();break;default:e.skip()}return t}function S(e){const t={originPosition:p(0)};for(;e.next();)switch(e.tag()){case 1:t.originPosition=p(e.getEnum());break;case 2:t.scale=e.processMessage(w);break;case 3:t.translate=e.processMessage(v);break;default:e.skip()}return t}function T(e){const t={};for(;e.next();)switch(e.tag()){case 1:t.shapeAreaFieldName=e.getString();break;case 2:t.shapeLengthFieldName=e.getString();break;case 3:t.units=e.getString();break;default:e.skip()}return t}function C(e,t){const s=t.createSpatialReference();for(;e.next();)switch(e.tag()){case 1:s.wkid=e.getUInt32();break;case 5:s.wkt=e.getString();break;case 2:s.latestWkid=e.getUInt32();break;case 3:s.vcsWkid=e.getUInt32();break;case 4:s.latestVcsWkid=e.getUInt32();break;default:e.skip()}return s}function F(e,t){const s=t.createFeatureResult();s.geometryType=g(t,0);let r=!1;for(;e.next();)switch(e.tag()){case 1:s.objectIdFieldName=e.getString();break;case 3:s.globalIdFieldName=e.getString();break;case 4:s.geohashFieldName=e.getString();break;case 5:s.geometryProperties=e.processMessage(T);break;case 7:s.geometryType=g(t,e.getEnum());break;case 8:s.spatialReference=e.processMessageWithArgs(C,t);break;case 10:s.hasZ=e.getBool();break;case 11:s.hasM=e.getBool();break;case 12:s.transform=e.processMessage(S);break;case 9:{const t=e.getBool();s.exceededTransferLimit=t;break}case 13:t.addField(s,e.processMessage(I));break;case 15:r||(t.prepareFeatures(s),r=!0),t.addFeature(s,e.processMessageWithArgs(b,t,s,s.fields));break;case 2:s.uniqueIdField=e.processMessage(x);break;default:e.skip()}return t.finishFeatureResult(s),s}function E(e,t){const s={};let r=null;for(;e.next();)switch(e.tag()){case 4:r=e.processMessageWithArgs(m);break;case 1:s.featureResult=e.processMessageWithArgs(F,t);break;default:e.skip()}return(0,i.pC)(r)&&s.featureResult&&t.addQueryGeometry(s,r),s}function A(e,t){try{const s=2,r=new n.Z(new Uint8Array(e),new DataView(e)),i={};for(;r.next();)r.tag()===s?i.queryResult=r.processMessageWithArgs(E,t):r.skip();return i}catch(e){throw new r.Z("query:parsing-pbf","Error while parsing FeatureSet PBF payload",{error:e})}}},78760:(e,t,s)=>{s.d(t,{A:()=>h,J:()=>c});var r=s(67900),i=s(8744),n=s(70272),o=s(44876),a=s(5428);const h=["esriGeometryPoint","esriGeometryMultipoint","esriGeometryPolyline","esriGeometryPolygon"];class c{constructor(e){this.options=e,this.geometryTypes=h,this._coordinatePtr=0,this._vertexDimension=0}createFeatureResult(){return new o.Z}prepareFeatures(e){this._vertexDimension=2,e.hasZ&&this._vertexDimension++,e.hasM&&this._vertexDimension++}finishFeatureResult(e){if(!e||!e.features||!e.hasZ||!this.options.sourceSpatialReference||!e.spatialReference||(0,i.fS)(e.spatialReference,this.options.sourceSpatialReference)||e.spatialReference.vcsWkid)return;const t=(0,r._R)(this.options.sourceSpatialReference)/(0,r._R)(e.spatialReference);if(1!==t)for(const s of e.features){if(!(0,n.S6)(s))continue;const e=s.geometry.coords;for(let s=2;s<e.length;s+=3)e[s]*=t}}addFeature(e,t){e.features.push(t)}createFeature(){return new n.ZP}createSpatialReference(){return{wkid:0}}createGeometry(){return new a.Z}addField(e,t){e.fields.push(t)}allocateCoordinates(e){e.coords.length=e.lengths.reduce(((e,t)=>e+t),0)*this._vertexDimension,this._coordinatePtr=0}addCoordinate(e,t){e.coords[this._coordinatePtr++]=t}addCoordinatePoint(e,t){e.coords.push(t)}addLength(e,t){e.lengths.push(t)}addQueryGeometry(e,t){e.queryGeometry=t.queryGeometry,e.queryGeometryType=t.queryGeometryType}createPointGeometry(){return new a.Z}}},45178:(e,t,s)=>{s.d(t,{C:()=>i});var r=s(77863);function i(e,t){const s=(0,r.K9)(e,t),i=s.queryResult.featureResult,n=s.queryResult.queryGeometry,o=s.queryResult.queryGeometryType;if(i&&i.features&&i.features.length&&i.objectIdFieldName){const e=i.objectIdFieldName;for(const t of i.features)t.attributes&&(t.objectId=t.attributes[e])}return i&&(i.queryGeometry=n,i.queryGeometryType=o),i}},34599:(e,t,s)=>{s.r(t),s.d(t,{executeQuery:()=>g,executeQueryForCount:()=>y,executeQueryForExtent:()=>I,executeQueryForIds:()=>m,executeQueryPBF:()=>_,executeQueryPBFBuffer:()=>f,queryToQueryStringParameters:()=>p,runQuery:()=>x});var r=s(3172),i=s(70586),n=s(17452),o=s(33955),a=s(38581),h=s(66677),c=s(45178),u=s(28694),l=s(99306);const d="Layer does not support extent calculation.";function p(e,t,s=!1){const r=e.geometry,n=e.toJSON(),a=n,h=e.outSpatialReference;let c,u;if((0,i.pC)(r)){if(c=r.spatialReference,u=r.spatialReference.wkid||JSON.stringify(r.spatialReference),a.geometryType=(0,o.Ji)(r),s&&"extent"===r.type)a.geometry=`${r.xmin},${r.ymin},${r.xmax},${r.ymax}`;else if(s&&"point"===r.type)a.geometry=`${r.x},${r.y}`;else{const e=r.toJSON();delete e.spatialReference,a.geometry=JSON.stringify(e)}a.inSR=u}if(c||(c=h),n.groupByFieldsForStatistics&&(a.groupByFieldsForStatistics=n.groupByFieldsForStatistics.join(",")),n.objectIds&&(a.objectIds=n.objectIds.join(",")),n.orderByFields&&(a.orderByFields=n.orderByFields.join(",")),!n.outFields||!n.returnDistinctValues&&(null!=t&&t.returnCountOnly||null!=t&&t.returnExtentOnly||null!=t&&t.returnIdsOnly)?delete a.outFields:-1!==n.outFields.indexOf("*")?a.outFields="*":a.outFields=n.outFields.join(","),n.outSR?a.outSR=n.outSR.wkid||JSON.stringify(n.outSR):r&&(n.returnGeometry||n.returnCentroid)&&(a.outSR=a.inSR),n.returnGeometry&&delete n.returnGeometry,n.outStatistics&&(a.outStatistics=JSON.stringify(n.outStatistics)),n.pixelSize&&(a.pixelSize=JSON.stringify(n.pixelSize)),n.quantizationParameters&&(s&&(0,i.pC)(c)&&(0,i.pC)(e.quantizationParameters)&&(0,i.pC)(e.quantizationParameters.extent)&&c.equals(e.quantizationParameters.extent.spatialReference)&&delete n.quantizationParameters.extent.spatialReference,a.quantizationParameters=JSON.stringify(n.quantizationParameters)),n.parameterValues&&(a.parameterValues=JSON.stringify(n.parameterValues)),n.rangeValues&&(a.rangeValues=JSON.stringify(n.rangeValues)),n.dynamicDataSource&&(a.layer=JSON.stringify({source:n.dynamicDataSource}),delete n.dynamicDataSource),n.timeExtent){const e=n.timeExtent,{start:t,end:s}=e;null==t&&null==s||(a.time=t===s?t:`${null==t?"null":t},${null==s?"null":s}`),delete n.timeExtent}return a}async function g(e,t,s,r){const n=(0,i.pC)(t.timeExtent)&&t.timeExtent.isEmpty?{data:{features:[]}}:await x(e,t,"json",r);return(0,u.p)(t,s,n.data),n}async function _(e,t,s,r){if((0,i.pC)(t.timeExtent)&&t.timeExtent.isEmpty)return Promise.resolve({data:s.createFeatureResult()});const n=await f(e,t,r),o=n;return o.data=(0,c.C)(n.data,s),o}function f(e,t,s){return x(e,t,"pbf",s)}function m(e,t,s){return(0,i.pC)(t.timeExtent)&&t.timeExtent.isEmpty?Promise.resolve({data:{objectIds:[]}}):x(e,t,"json",s,{returnIdsOnly:!0})}function y(e,t,s){return(0,i.pC)(t.timeExtent)&&t.timeExtent.isEmpty?Promise.resolve({data:{count:0}}):x(e,t,"json",s,{returnIdsOnly:!0,returnCountOnly:!0})}function I(e,t,s){return(0,i.pC)(t.timeExtent)&&t.timeExtent.isEmpty?Promise.resolve({data:{count:0,extent:null}}):x(e,t,"json",s,{returnExtentOnly:!0,returnCountOnly:!0}).then((e=>{const t=e.data;if(t.hasOwnProperty("extent"))return e;if(t.features)throw new Error(d);if(t.hasOwnProperty("count"))throw new Error(d);return e}))}function x(e,t,s,o={},c={}){const u="string"==typeof e?(0,n.mN)(e):e,d=t.geometry?[t.geometry]:[];return o.responseType="pbf"===s?"array-buffer":"json",(0,a.aX)(d,null,o).then((e=>{const a=e&&e[0];(0,i.pC)(a)&&((t=t.clone()).geometry=a);const d=(0,h.M8)(u.path),g=(0,l.A)({...u.query,f:s,...c,...p(t,c,d)});return(0,r.default)((0,n.v_)(u.path,"query"),{...o,query:{...g,...o.query}})}))}},28694:(e,t,s)=>{s.d(t,{p:()=>n});var r=s(70586),i=s(69285);function n(e,t,s){if(!s||!s.features||!s.hasZ)return;const n=(0,i.k)(s.geometryType,t,e.outSpatialReference);if(!(0,r.Wi)(n))for(const e of s.features)n(e.geometry)}},99306:(e,t,s)=>{function r(e){const t={};for(const s in e){if("declaredClass"===s)continue;const i=e[s];if(null!=i&&"function"!=typeof i)if(Array.isArray(i)){t[s]=[];for(let e=0;e<i.length;e++)t[s][e]=r(i[e])}else"object"==typeof i?i.toJSON&&(t[s]=JSON.stringify(i)):t[s]=i}return t}s.d(t,{A:()=>r})},61027:(e,t,s)=>{s.d(t,{_I:()=>r,xp:()=>o,PX:()=>n,QS:()=>l,KS:()=>c,jL:()=>h,vs:()=>a,nE:()=>u});const r=8388607,i=8388608,n=0,o=1,a=e=>(e&i)>>>23,h=e=>e&r,c=e=>a(e)===o?254:255;function u(e){return a(e)===o}function l(e,t){return((t?i:0)|e)>>>0}},29996:(e,t,s)=>{s.d(t,{ws:()=>E,xV:()=>A,UK:()=>k,$_:()=>C,nU:()=>M,hj:()=>F});var r=s(20102),i=s(92604),n=(s(22021),s(95648)),o=(s(37720),s(66039)),a=s(71143);class h{constructor(){this.color=[0,0,0,0],this.haloColor=[0,0,0,0],this.haloSize=0,this.size=12,this.angle=0,this.offsetX=0,this.offsetY=0,this.hAnchor=0,this.vAnchor=0}acquire(e,t,s,r,i,n,o,a,h){this.color=e,this.haloColor=t,this.haloSize=s,this.size=r,this.angle=i,this.offsetX=n,this.offsetY=o,this.hAnchor=a,this.vAnchor=h}release(){this.color[0]=this.color[1]=this.color[2]=this.color[3]=0,this.haloColor[0]=this.haloColor[1]=this.haloColor[2]=this.haloColor[3]=0,this.haloSize=0,this.size=0,this.angle=0,this.offsetX=0,this.offsetY=0,this.hAnchor=0,this.vAnchor=0}}h.pool=new a.Z(h);var c=s(35371);s(75656);const u=i.Z.getLogger("esri.views.2d.engine.webgl.Utils"),l="geometry",d=[{name:l,strideInBytes:32}],p=[{name:l,strideInBytes:20}],g=[{name:l,strideInBytes:12}],_=[{name:l,strideInBytes:40}],f=[{name:l,strideInBytes:36}],m=[{name:l,strideInBytes:36}];function y(e){const t={};for(const s of e)t[s.name]=s.strideInBytes;return t}const I=y([{name:l,strideInBytes:36}]),x=y(d),b=y(p),w=y(g),v=y(_),S=y(f),T=y(m);function C(e,{fill:t}){switch(e){case o.LW.MARKER:return I;case o.LW.FILL:return"dot-density"===t?w:"simple"===t?b:x;case o.LW.LINE:return v;case o.LW.TEXT:return S;case o.LW.LABEL:return T}}function F(e){return"number"==typeof e}function E(e){switch(e){case"butt":return n.RL.BUTT;case"round":return n.RL.ROUND;case"square":return n.RL.SQUARE;default:return u.error(new r.Z("mapview-invalid-type",`Cap type ${e} is not a valid option. Defaulting to round`)),n.RL.ROUND}}function A(e){switch(e){case"miter":return n.AH.MITER;case"bevel":return n.AH.BEVEL;case"round":return n.AH.ROUND;default:return u.error(new r.Z("mapview-invalid-type",`Join type ${e} is not a valid option. Defaulting to round`)),n.AH.ROUND}}function M(e){switch(e){case"opacity":return o.pc.OPACITY;case"color":return o.pc.COLOR;case"rotation":return o.pc.ROTATION;case"size":return o.pc.SIZE;default:return u.error(`Cannot interpret unknown vv: ${e}`),null}}function k(e){switch(e){case c.Br.UNSIGNED_BYTE:return Uint8Array;case c.Br.UNSIGNED_SHORT_4_4_4_4:return Uint16Array;case c.Br.FLOAT:return Float32Array;default:return void u.error(new r.Z("webgl-utils",`Unable to handle type ${e}`))}}c.l1.STATIC_DRAW,new Map},37720:(e,t,s)=>{s.d(t,{t2:()=>i,aH:()=>n});var r=s(12142);function i(e){if(!e)return 0;const{r:t,g:s,b:i,a:n}=e;return(0,r.Jz)(t*n,s*n,i*n,255*n)}function n(e){if(!e)return 0;const[t,s,i,n]=e;return(0,r.Jz)(t*(n/255),s*(n/255),i*(n/255),n)}},66039:(e,t,s)=>{var r,i,n,o,a,h,c;s.d(t,{pc:()=>o,LW:()=>r,X:()=>a,mf:()=>h}),function(e){e[e.FILL=0]="FILL",e[e.LINE=1]="LINE",e[e.MARKER=2]="MARKER",e[e.TEXT=3]="TEXT",e[e.LABEL=4]="LABEL"}(r||(r={})),function(e){e[e.SUCCEEDED=0]="SUCCEEDED",e[e.FAILED_OUT_OF_MEMORY=1]="FAILED_OUT_OF_MEMORY"}(i||(i={})),function(e){e[e.NONE=0]="NONE",e[e.MAP=1]="MAP",e[e.LABEL=2]="LABEL",e[e.LABEL_ALPHA=4]="LABEL_ALPHA",e[e.HITTEST=8]="HITTEST",e[e.HIGHLIGHT=16]="HIGHLIGHT",e[e.CLIP=32]="CLIP",e[e.DEBUG=64]="DEBUG",e[e.NUM_DRAW_PHASES=9]="NUM_DRAW_PHASES"}(n||(n={})),function(e){e[e.SIZE=0]="SIZE",e[e.COLOR=1]="COLOR",e[e.OPACITY=2]="OPACITY",e[e.ROTATION=3]="ROTATION"}(o||(o={})),function(e){e[e.NONE=0]="NONE",e[e.OPACITY=1]="OPACITY",e[e.COLOR=2]="COLOR",e[e.ROTATION=4]="ROTATION",e[e.SIZE_MINMAX_VALUE=8]="SIZE_MINMAX_VALUE",e[e.SIZE_SCALE_STOPS=16]="SIZE_SCALE_STOPS",e[e.SIZE_FIELD_STOPS=32]="SIZE_FIELD_STOPS",e[e.SIZE_UNIT_VALUE=64]="SIZE_UNIT_VALUE"}(a||(a={})),function(e){e[e.MINMAX_TARGETS_OUTLINE=128]="MINMAX_TARGETS_OUTLINE",e[e.SCALE_TARGETS_OUTLINE=256]="SCALE_TARGETS_OUTLINE",e[e.FIELD_TARGETS_OUTLINE=512]="FIELD_TARGETS_OUTLINE",e[e.UNIT_TARGETS_OUTLINE=1024]="UNIT_TARGETS_OUTLINE"}(h||(h={})),function(e){e[e.SPRITE=0]="SPRITE",e[e.GLYPH=1]="GLYPH"}(c||(c={}))},12142:(e,t,s)=>{s.d(t,{UJ:()=>i,Jz:()=>n});const r=new Float32Array(1);function i(e,t){return 65535&e|t<<16}function n(e,t,s,r){return 255&e|(255&t)<<8|(255&s)<<16|r<<24}new Uint32Array(r.buffer)},40660:(e,t,s)=>{s.d(t,{a:()=>h});var r=s(20102),i=s(92604),n=s(66039),o=s(29996);const a=i.Z.getLogger("esri.views.2d.engine.webgl");function h(e){return(0,o.hj)(e.minDataValue)&&(0,o.hj)(e.maxDataValue)&&null!=e.minSize&&null!=e.maxSize?n.X.SIZE_MINMAX_VALUE:(e.expression&&"view.scale"===e.expression||e.valueExpression&&"$view.scale"===e.valueExpression)&&Array.isArray(e.stops)?n.X.SIZE_SCALE_STOPS:(null!=e.field||e.expression&&"view.scale"!==e.expression||e.valueExpression&&"$view.scale"!==e.valueExpression)&&(Array.isArray(e.stops)||"levels"in e&&e.levels)?n.X.SIZE_FIELD_STOPS:(null!=e.field||e.expression&&"view.scale"!==e.expression||e.valueExpression&&"$view.scale"!==e.valueExpression)&&null!=e.valueUnit?n.X.SIZE_UNIT_VALUE:(a.error(new r.Z("mapview-bad-type","Found invalid size VisualVariable",e)),n.X.NONE)}},74259:(e,t,s)=>{s.d(t,{p:()=>g,k:()=>p});var r=s(8557),i=s(32448),n=(s(80442),s(70586)),o=s(96794),a=s(60437),h=s(59999),c=s(61800);function u(e,t){return e<<16|t}function l(e){return(4294901760&e)>>>16}function d(e){return 65535&e}const p={getObjectId:e=>e.getObjectId(),getAttributes:e=>e.readAttributes(),getAttribute:(e,t)=>e.readAttribute(t),cloneWithGeometry:(e,t)=>e,getGeometry:e=>e.readHydratedGeometry(),getCentroid:(e,t)=>e.readCentroid()};class g extends h.J{constructor(e,t,s){super(e,t),this.featureAdapter=p,this.events=new i.Z,this._featureSetsByInstance=new Map,this._objectIdToDisplayId=new Map,this._spatialIndexInvalid=!0,this._indexSearchCache=new r.Z(50),this._index=(0,o.r)(9,(e=>({minX:this._storage.getXMin(e),minY:this._storage.getYMin(e),maxX:this._storage.getXMax(e),maxY:this._storage.getYMax(e)}))),this._storage=t,this.mode=s}get storage(){return this._storage}get storeStatistics(){let e=0,t=0,s=0;return this.forEach((r=>{const i=r.readGeometry();i&&(t+=i.isPoint?1:i.lengths.reduce(((e,t)=>e+t),0),s+=i.isPoint?1:i.lengths.length,e+=1)})),{featureCount:e,vertexCount:t,ringCount:s}}hasInstance(e){return this._featureSetsByInstance.has(e)}onTileData(e,t){if((0,n.Wi)(t.addOrUpdate))return t;if(t.addOrUpdate.attachStorage(this._storage),"snapshot"===this.mode){const s=t.addOrUpdate.getCursor();for(;s.next();){const t=s.getDisplayId();this.setComputedAttributes(this._storage,s,t,e.scale)}return t}this._featureSetsByInstance.set(t.addOrUpdate.instance,t.addOrUpdate);const s=t.addOrUpdate.getCursor();for(;s.next();)this._insertFeature(s,e.scale);return this._spatialIndexInvalid=!0,this.events.emit("changed"),t}search(e){this._rebuildIndex();const t=e.id,s=this._indexSearchCache.find((e=>e.tileId===t));if((0,n.pC)(s))return s.readers;const r=new Map,i=this._searchIndex(e.bounds),o=[];for(const e of i){const t=this._storage.getInstanceId(e),s=l(t),i=d(t);r.has(s)||r.set(s,[]),r.get(s).push(i)}return r.forEach(((e,t)=>{const s=this._featureSetsByInstance.get(t);o.push(c.t.from(s,e))})),this._indexSearchCache.enqueue({tileId:t,readers:o}),o}insert(e){const t=e.getCursor(),s=this._storage;for(;t.next();){var r;const e=u(t.instance,t.getIndex()),i=t.getObjectId(),n=null!=(r=this._objectIdToDisplayId.get(i))?r:this._storage.createDisplayId();t.setDisplayId(n),s.setInstanceId(n,e),this._objectIdToDisplayId.set(i,n)}this._featureSetsByInstance.set(e.instance,e),this._spatialIndexInvalid=!0}remove(e){const t=this._objectIdToDisplayId.get(e);if(!t)return;const s=this._storage.getInstanceId(t),r=d(s),i=l(s),n=this._featureSetsByInstance.get(i);this._objectIdToDisplayId.delete(e),this._storage.releaseDisplayId(t),n.removeAtIndex(r),n.isEmpty&&this._featureSetsByInstance.delete(i),this._spatialIndexInvalid=!0}forEach(e){this._objectIdToDisplayId.forEach((t=>{const s=this._storage.getInstanceId(t),r=this._lookupFeature(s);e(r)}))}forEachUnsafe(e){this._objectIdToDisplayId.forEach((t=>{const s=this._storage.getInstanceId(t),r=l(s),i=d(s),n=this._getFeatureSet(r);n.setIndex(i),e(n)}))}forEachInBounds(e,t){const s=this._searchIndex(e);for(const e of s){const s=this.lookupFeatureByDisplayId(e,this._storage);t((0,n.Wg)(s))}}forEachBounds(e,t,s){this._rebuildIndex();const r=[0,0,0,0];for(const i of e){if(!i.readGeometry())continue;const e=i.getDisplayId();r[0]=this._storage.getXMin(e),r[1]=this._storage.getYMin(e),r[2]=this._storage.getXMax(e),r[3]=this._storage.getYMax(e),t((0,a.JR)(s,r))}}sweepFeatures(e,t,s){this._spatialIndexInvalid=!0,this._objectIdToDisplayId.forEach(((r,i)=>{e.has(r)||(t.releaseDisplayId(r),s&&s.unsetAttributeData(r),this._objectIdToDisplayId.delete(i))})),this.events.emit("changed")}sweepFeatureSets(e){this._spatialIndexInvalid=!0,this._featureSetsByInstance.forEach(((t,s)=>{e.has(s)||this._featureSetsByInstance.delete(s)}))}lookupObjectId(e,t){const s=this.lookupFeatureByDisplayId(e,t);return(0,n.Wi)(s)?null:s.getObjectId()}lookupDisplayId(e){return this._objectIdToDisplayId.get(e)}lookupFeatureByDisplayId(e,t){const s=t.getInstanceId(e);return this._lookupFeature(s)}lookupByDisplayIdUnsafe(e){const t=this._storage.getInstanceId(e),s=l(t),r=d(t),i=this._getFeatureSet(s);return i?(i.setIndex(r),i):null}_insertFeature(e,t){const s=this._storage,r=e.getObjectId(),i=u(e.instance,e.getIndex());s.getInstanceId(e.getDisplayId());let n=this._objectIdToDisplayId.get(r);n||(n=s.createDisplayId(),this._objectIdToDisplayId.set(r,n),this._spatialIndexInvalid=!0),e.setDisplayId(n),s.setInstanceId(n,i),this.setComputedAttributes(s,e,n,t)}_searchIndex(e){this._rebuildIndex();const t={minX:e[0],minY:e[1],maxX:e[2],maxY:e[3]};return this._index.search(t)}_rebuildIndex(){if(!this._spatialIndexInvalid)return;const e=[];"snapshot"===this.mode?this._featureSetsByInstance.forEach((t=>{const s=t.getCursor();for(;s.next();){const t=s.getDisplayId();this._storage.setBounds(t,s)&&e.push(t)}})):this._objectIdToDisplayId.forEach((t=>{const s=this._storage.getInstanceId(t);this._storage.setBounds(t,this._lookupFeature(s))&&e.push(t)})),this._index.clear(),this._index.load(e),this._indexSearchCache.clear(),this._spatialIndexInvalid=!1}_lookupFeature(e){const t=l(e),s=d(e),r=this._getFeatureSet(t);if(!r)return null;const i=r.getCursor();return i.setIndex(s),i}_getFeatureSet(e){return this._featureSetsByInstance.get(e)}}},97783:(e,t,s)=>{s.r(t),s.d(t,{default:()=>vt,getInstances:()=>bt});var r=s(43697),i=s(3920),n=s(80442),o=s(5600),a=(s(67676),s(75215),s(52011)),h=s(11145),c=s(70586),u=s(95330),l=s(43050),d=s(98732),p=s(7673),g=s(99514),_=s(61027),f=s(74259),m=s(66677),y=s(3172),I=s(20102),x=s(92604),b=s(80903),w=s(82397),v=s(16467),S=s(34599),T=s(70272),C=s(87554);class F extends C.s{constructor(e,t,s){super(e),this._featureIndex=-1,this._dateFields=new Set,this._geometryType=s,this._features=t}static fromFeatures(e,t,s){const r=(0,d.Yn)([],e,t,!1,!1,s);for(let t=0;t<r.length;t++)r[t].displayId=e[t].displayId;return F.fromOptimizedFeatures(r,t)}static fromFeatureSet(e,t){const s=(0,d.h_)(e,t);return F.fromOptimizedFeatureSet(s)}static fromOptimizedFeatureSet(e){const{features:t,geometryType:s}=e,r=F.fromOptimizedFeatures(t,s);r._exceededTransferLimit=e.exceededTransferLimit,r._transform=e.transform;for(const t of e.fields)"esriFieldTypeDate"===t.type&&r._dateFields.add(t.name);return r}static fromOptimizedFeatures(e,t,s){const r=C.s.createInstance(),i=new F(r,e,t);return i._transform=s,i}get _current(){return this._features[this._featureIndex]}get geometryType(){return this._geometryType}get hasFeatures(){return!!this._features.length}get hasNext(){return this._featureIndex+1<this._features.length}get exceededTransferLimit(){return this._exceededTransferLimit}get hasZ(){return!1}get hasM(){return!1}removeIds(e){const t=new Set(e);this._features=this._features.filter((e=>!t.has(e.objectId)))}append(e){for(const t of e)this._features.push(t)}getSize(){return this._features.length}getCursor(){return this.copy()}getQuantizationTransform(){return this._transform}getAttributeHash(){let e="";for(const t in this._current.attributes)e+=this._current.attributes[t];return e}getIndex(){return this._featureIndex}setIndex(e){this._featureIndex=e}getObjectId(){return this._current.objectId}getDisplayId(){return this._current.displayId}setDisplayId(e){this._current.displayId=e}getGroupId(){return this._current.groupId}setGroupId(e){this._current.groupId=e}copy(){const e=new F(this.instance,this._features,this.geometryType);return this.copyInto(e),e}next(){for(;++this._featureIndex<this._features.length&&!this._getExists(););return this._featureIndex<this._features.length}readLegacyFeature(){return(0,d.EI)(this._current,this.geometryType,this.hasZ,this.hasM)}readOptimizedFeature(){return this._current}readLegacyPointGeometry(){return this.readGeometry()?{x:this.getX(),y:this.getY()}:null}readLegacyGeometry(){const e=this.readGeometry();return(0,d.di)(e,this.geometryType,this.hasZ,this.hasM)}readLegacyCentroid(){const e=this.readCentroid();return(0,c.Wi)(e)?null:{x:e.coords[0]*this._sx+this._tx,y:e.coords[1]*this._sy+this._ty}}readGeometryArea(){return(0,T.S6)(this._current)?(0,d.lz)(this._current.geometry,2):0}readUnquantizedGeometry(){const e=this.readGeometry();if("esriGeometryPoint"===this.geometryType||!e)return e;const t=e.clone();return function({coords:e,lengths:t}){let s=0;for(const r of t){for(let t=1;t<r;t++)e[2*(s+t)]+=e[2*(s+t)-2],e[2*(s+t)+1]+=e[2*(s+t)-1];s+=r}}(t),t}readHydratedGeometry(){const e=this._current.geometry;if((0,c.Wi)(e))return null;const t=e.clone();return(0,c.pC)(this._transform)&&(0,d.$g)(t,t,this.hasZ,this.hasM,this._transform),t}getXHydrated(){if(!(0,T.S6)(this._current))return 0;const e=this._current.geometry.coords[0],t=this.getQuantizationTransform();return(0,c.Wi)(t)?e:e*t.scale[0]+t.translate[0]}getYHydrated(){if(!(0,T.S6)(this._current))return 0;const e=this._current.geometry.coords[1],t=this.getQuantizationTransform();return(0,c.Wi)(t)?e:t.translate[1]-e*t.scale[1]}getX(){return(0,T.S6)(this._current)?this._current.geometry.coords[0]*this._sx+this._tx:0}getY(){return(0,T.S6)(this._current)?this._current.geometry.coords[1]*this._sy+this._ty:0}readGeometry(){if(!(0,T.S6)(this._current))return null;const e=this._current.geometry.clone();if(e.isPoint)return e.coords[0]=e.coords[0]*this._sx+this._tx,e.coords[1]=e.coords[1]*this._sy+this._ty,e;let t=0;for(const s of e.lengths)e.coords[2*t]=e.coords[2*t]*this._sx+this._tx,e.coords[2*t+1]=e.coords[2*t+1]*this._sy+this._ty,t+=s;return e}readCentroid(){if(!(0,T.S6)(this._current))return null;if(!this._current.centroid){const e=this._computeCentroid();if(!e)return null;e.coords[0]=(e.coords[0]-this._tx)/this._sx,e.coords[1]=(e.coords[1]-this._ty)/this._sy,this._current.centroid=e}const e=this._current.centroid.clone();return e.coords[0]=e.coords[0]*this._sx+this._tx,e.coords[1]=e.coords[1]*this._sx+this._ty,e}_readAttribute(e,t){const s=this._current.attributes[e];if(void 0!==s)return null!=s&&t&&this._dateFields.has(e)?new Date(s):s;const r=this.readAttributes(),i=e.toLocaleLowerCase().trim();for(const e in r)if(e.toLocaleLowerCase().trim()===i){const s=this._current.attributes[e];return null!=s&&t&&this._dateFields.has(e)?new Date(s):s}}copyInto(e){super.copyInto(e),e._featureIndex=this._featureIndex,e._transform=this._transform,e._dateFields=this._dateFields}_readAttributes(){return this._current.attributes}}var E=s(45091),A=s(5428),M=s(77863);const k=268435455;class R{constructor(){this.fieldMap=new Map,this.fields=[],this.hasFeatures=!1,this.fieldCount=0,this.featureCount=0,this.objectIdFieldIndex=0,this.vertexCount=0,this.offsets={attributes:new Array,geometry:new Array},this.centroid=new Array}hasField(e){return this.fieldMap.has(e)}isDateField(e){var t;return null==(t=this.fieldMap.get(e))?void 0:t.isDate}getFieldIndex(e){var t;return null==(t=this.fieldMap.get(e))?void 0:t.index}}function O(e){const t=e.getLength(),s=e.pos()+t,r={name:"",isDate:!1};for(;e.pos()<s&&e.next();)switch(e.tag()){case 1:r.name=e.getString();break;case 2:"esriFieldTypeDate"===(0,M.O7)(e.getEnum())&&(r.isDate=!0);break;default:e.skip()}return r}function L(e){return e.toLowerCase().trim()}function P(e,t,s=!1){const r=e.pos(),i=new R;let n=0,o=0,a=null,h=null,c=null,u=!1;for(;e.next();)switch(e.tag()){case 1:a=e.getString();break;case 3:h=e.getString();break;case 12:c=e.processMessage(M.G$);break;case 9:if(i.exceededTransferLimit=e.getBool(),i.exceededTransferLimit){i.offsets.geometry=s?new Float64Array(8e3):new Int32Array(8e3),i.centroid=s?new Float64Array(16e3):new Int32Array(16e3);for(let e=0;e<i.centroid.length;e++)i.centroid[e]=k}break;case 13:{const t=O(e),s=t.name,r=L(t.name),o={fieldName:s,index:n++,isDate:t.isDate};i.fields.push(o),i.fieldMap.set(t.name,o),i.fieldMap.set(r,o);break}case 15:{const r=e.getLength(),a=e.pos()+r;if(!i.exceededTransferLimit){const e=i.offsets.geometry,t=i.centroid;e.push(0),t.push(k),t.push(k)}!u&&i.exceededTransferLimit&&(u=!0,i.offsets.attributes=s?new Float64Array(8e3*n):new Uint32Array(8e3*n));let h=o*n;for(;e.pos()<a&&e.next();)switch(e.tag()){case 1:{u?i.offsets.attributes[h++]=e.pos():i.offsets.attributes.push(e.pos());const t=e.getLength();e.skipLen(t);break}case 2:if(t){const t=e.getLength(),s=e.pos()+t;for(;e.pos()<s&&e.next();)switch(e.tag()){case 3:{e.getUInt32();const t=e.getSInt64(),s=e.getSInt64();i.centroid[2*o]=t,i.centroid[2*o+1]=s;break}default:e.skip()}}else{i.offsets.geometry[o]=e.pos();const t=e.getLength();i.vertexCount+=t,e.skipLen(t)}break;case 4:{const t=e.getLength(),s=e.pos()+t;for(;e.pos()<s&&e.next();)switch(e.tag()){case 3:{e.getUInt32();const t=e.getSInt64(),s=e.getSInt64();i.centroid[2*o]=t,i.centroid[2*o+1]=s;break}default:e.skip()}break}default:e.skip()}o++,i.hasFeatures=!0;break}default:e.skip()}const l=a||h;if(!l)throw new I.Z("FeatureSet has no objectId or globalId field name");return i.featureCount=o,i.fieldCount=n,i.objectIdFieldIndex=i.getFieldIndex(l),i.transform=c,i.displayIds=new Uint32Array(i.featureCount),i.groupIds=new Uint16Array(i.featureCount),e.move(r),i}const N=x.Z.getLogger("esri.view.2d.layers.features.support.FeatureSetReaderPBF"),U=268435455,D=128e3,q={small:{delta:new Int32Array(128),decoded:new Int32Array(128)},large:{delta:new Int32Array(D),decoded:new Int32Array(D)}};function B(e){return e<=q.small.delta.length?q.small:(e<=q.large.delta.length||(q.large.delta=new Int32Array(Math.round(1.25*e)),q.large.decoded=new Int32Array(Math.round(1.25*e))),q.large)}function z(e){for(;e.next();){if(1===e.tag())return e.getMessage();e.skip()}return null}function G(e,t,s,r,i,n){return.5*Math.abs(e*r+s*n+i*t-e*n-s*t-i*r)}function Z(e,t,s,r){return 0==e*r-s*t&&e*s+t*r>0}class j extends C.s{constructor(e,t,s,r){super(e),this._hasNext=!1,this._isPoints=!1,this._featureIndex=-1,this._featureOffset=0,this._cache={area:0,unquantGeometry:void 0,geometry:void 0,centroid:void 0,legacyFeature:void 0,optFeature:void 0},this._geometryType=r,this._reader=t,this._header=s,this._hasNext=s.hasFeatures,this._isPoints="esriGeometryPoint"===r}static fromBuffer(e,t,s=!1){const r=function(e){try{const t=2,s=new E.Z(new Uint8Array(e),new DataView(e));for(;s.next();){if(s.tag()===t)return z(s.getMessage());s.skip()}}catch(e){const t=new I.Z("query:parsing-pbf","Error while parsing FeatureSet PBF payload",{error:e});N.error(t)}return null}(e),i=P(r,"esriGeometryPoint"===t,s),n=C.s.createInstance();return new j(n,r,i,t)}get geometryType(){return this._geometryType}get size(){return this._header.featureCount}get hasZ(){return!1}get hasM(){return!1}get stride(){return 2+(this.hasZ?1:0)+(this.hasM?1:0)}get hasFeatures(){return this._header.hasFeatures}get hasNext(){return this._hasNext}get exceededTransferLimit(){return this._header.exceededTransferLimit}getSize(){return this.size}getQuantizationTransform(){return this._header.transform}getCursor(){return this.copy()}getIndex(){return this._featureIndex}setIndex(e){this._cache.area=0,this._cache.unquantGeometry=void 0,this._cache.geometry=void 0,this._cache.centroid=void 0,this._cache.legacyFeature=void 0,this._cache.optFeature=void 0,this._featureIndex=e}getAttributeHash(){let e="";return this._header.fields.forEach((({index:t})=>{e+=this._readAttributeAtIndex(t)+"."})),e}getObjectId(){return this._readAttributeAtIndex(this._header.objectIdFieldIndex)}getDisplayId(){return this._header.displayIds[this._featureIndex]}setDisplayId(e){this._header.displayIds[this._featureIndex]=e}getGroupId(){return this._header.groupIds[this._featureIndex]}setGroupId(e){this._header.groupIds[this._featureIndex]=e}readLegacyFeature(){if(void 0===this._cache.legacyFeature){var e;const t=this.readCentroid(),s={attributes:this.readAttributes(),geometry:this._isPoints?this.readLegacyPointGeometry():this.readLegacyGeometry(),centroid:null!=(e=t&&{x:t.coords[0],y:t.coords[1]})?e:null};return this._cache.legacyFeature=s,s}return this._cache.legacyFeature}readOptimizedFeature(){if(void 0===this._cache.optFeature){const e=new T.ZP(this.readGeometry(),this.readAttributes(),this.readCentroid());return e.objectId=this.getObjectId(),e.displayId=this.getDisplayId(),this._cache.optFeature=e,e}return this._cache.optFeature}getXHydrated(){const e=this._header.centroid[2*this._featureIndex],t=this.getQuantizationTransform();return(0,c.Wi)(t)?e:e*t.scale[0]+t.translate[0]}getYHydrated(){const e=this._header.centroid[2*this._featureIndex+1],t=this.getQuantizationTransform();return(0,c.Wi)(t)?e:t.translate[1]-e*t.scale[1]}getX(){return this._header.centroid[2*this._featureIndex]*this._sx+this._tx}getY(){return this._header.centroid[2*this._featureIndex+1]*this._sy+this._ty}readLegacyPointGeometry(){return{x:this.getX(),y:this.getY()}}readLegacyGeometry(e){const t=this.readGeometry(e);return(0,d.di)(t,this.geometryType,!1,!1)}readLegacyCentroid(){const e=this.readCentroid();if(!e)return null;const[t,s]=e.coords;return{x:t,y:s}}readGeometryArea(){return this._cache.area||this.readGeometry(!0),this._cache.area}readUnquantizedGeometry(e=!1){if(void 0===this._cache.unquantGeometry){const t=this.readGeometry(e);if(!t)return this._cache.unquantGeometry=null,null;const s=B(t.coords.length).decoded,r=t.clone(s),i=r.coords;let n=0;for(const e of r.lengths){for(let t=1;t<e;t++){const e=2*(n+t),s=2*(n+t-1);i[e]+=i[s],i[e+1]+=i[s+1]}n+=e}return this._cache.unquantGeometry=r,r}return this._cache.unquantGeometry}readHydratedGeometry(){if(this._isPoints){if(this._header.centroid[2*this._featureIndex]===U)return null;const e=this.getXHydrated(),t=this.getYHydrated();return new A.Z([],[e,t])}const e=this.readGeometry();if(!e)return null;const t=e.clone(),s=this.getQuantizationTransform();return(0,c.pC)(s)&&(0,d.$g)(t,t,this.hasZ,this.hasM,s),t}readGeometry(e=!1){if(void 0===this._cache.geometry){let t=null;if(this._isPoints){if(this._header.centroid[2*this._featureIndex]===U)return null;const e=this.getX(),s=this.getY();t=new A.Z([],[e,s])}else{const s=this._header.offsets.geometry[this._featureIndex],r=this._reader;if(0===s)return null;r.move(s);try{t=e?this._parseGeometryForDisplay(r):this._parseGeometry(r)}catch(e){return console.error("Failed to parse geometry!",e),null}}return this._cache.geometry=t,t}return this._cache.geometry}readCentroid(){if(void 0===this._cache.centroid){let e=null;const t=this._header.centroid[2*this._featureIndex]+this._tx,s=this._header.centroid[2*this._featureIndex+1]+this._ty;return t===U?(e=this._computeCentroid(),e&&(this._header.centroid[2*this._featureIndex]=e.coords[0]-this._tx,this._header.centroid[2*this._featureIndex+1]=e.coords[1]-this._ty)):e=new A.Z([],[t,s]),this._cache.centroid=e,e}return this._cache.centroid}copy(){const e=this._reader.clone(),t=new j(this.instance,e,this._header,this.geometryType);return this.copyInto(t),t}next(){for(this._cache.area=0,this._cache.unquantGeometry=void 0,this._cache.geometry=void 0,this._cache.centroid=void 0,this._cache.legacyFeature=void 0,this._cache.optFeature=void 0;++this._featureIndex<this.size&&!this._getExists(););return this._featureIndex<this.size}_readAttribute(e,t){const s=this._header.hasField(e)?e:function(e){return e.toLowerCase().trim()}(e),r=this._header.getFieldIndex(s);if(null==r)return;const i=this._readAttributeAtIndex(r);return t?null==i?i:this._header.isDateField(s)?new Date(i):i:i}_readAttributes(){const e={};return this._header.fields.forEach((({fieldName:t,index:s})=>{e[t]=this._readAttributeAtIndex(s)})),e}copyInto(e){super.copyInto(e),e._featureIndex=this._featureIndex,e._featureOffset=this._featureOffset,e._hasNext=this._hasNext}_readAttributeAtIndex(e){const t=this._header.offsets.attributes[this._featureIndex*this._header.fieldCount+e],s=this._reader;return s.move(t),function(e){const t=e.getLength(),s=e.pos()+t;for(;e.pos()<s&&e.next();)switch(e.tag()){case 1:return e.getString();case 2:return e.getFloat();case 3:return e.getDouble();case 4:return e.getSInt32();case 5:return e.getUInt32();case 6:return e.getInt64();case 7:return e.getUInt64();case 8:return e.getSInt64();case 9:return e.getBool();default:return e.skip(),null}return null}(s)}_parseGeometry(e){const t=e.getLength(),s=e.pos()+t,r=[],i=[];for(;e.pos()<s&&e.next();)switch(e.tag()){case 2:{const t=e.getUInt32(),s=e.pos()+t;for(;e.pos()<s;)i.push(e.getUInt32());break}case 3:{const t=e.getUInt32(),s=e.pos()+t;for(r.push(e.getSInt32()+this._tx),r.push(e.getSInt32()+this._ty),this.hasZ&&e.getSInt32(),this.hasM&&e.getSInt32();e.pos()<s;)r.push(e.getSInt32()),r.push(e.getSInt32()),this.hasZ&&e.getSInt32(),this.hasM&&e.getSInt32();break}default:e.skip()}return new A.Z(i,r)}_parseGeometryForDisplay(e){const t=e.getLength(),s=e.pos()+t,r=[],i=[];let n=0,o=0,a=null,h=0;const c="esriGeometryPolygon"===this.geometryType;for(;e.pos()<s&&e.next();)switch(e.tag()){case 2:{const t=e.getUInt32(),s=e.pos()+t;for(;e.pos()<s;){const t=e.getUInt32();r.push(t),n+=t}a=B(2*n).delta;break}case 3:{e.getUInt32();const t=2+(this.hasZ?1:0)+(this.hasM?1:0);for(const s of r)if(o+t*s>a.length)for(let t=0;t<s;t++)e.getSInt32(),e.getSInt32(),this.hasZ&&e.getSInt32(),this.hasM&&e.getSInt32();else if(c){const t=this.getAreaSimplificationThreshold(s,this._header.vertexCount);let r=2,n=1;const c=!1;let u=e.getSInt32(),l=e.getSInt32();a[o++]=u,a[o++]=l,this.hasZ&&e.getSInt32(),this.hasM&&e.getSInt32();let d=e.getSInt32(),p=e.getSInt32();for(this.hasZ&&e.getSInt32(),this.hasM&&e.getSInt32();r<s;){let s=e.getSInt32(),i=e.getSInt32();this.hasZ&&e.getSInt32(),this.hasM&&e.getSInt32();const c=u+d,g=l+p;G(u,l,c,g,c+s,g+i)>=t?(h+=-.5*(c-u)*(g+l),n>1&&Z(a[o-2],a[o-1],d,p)?(a[o-2]+=d,a[o-1]+=p):(a[o++]=d,a[o++]=p,n++),u=c,l=g):(s+=d,i+=p),d=s,p=i,r++}n<3||c?o-=2*n:(h+=-.5*(u+d-u)*(l+p+l),Z(a[o-2],a[o-1],d,p)?(a[o-2]+=d,a[o-1]+=p,i.push(n)):(a[o++]=d,a[o++]=p,i.push(++n)))}else{let t=0,r=e.getSInt32(),n=e.getSInt32();this.hasZ&&e.getSInt32(),this.hasM&&e.getSInt32(),a[o++]=r,a[o++]=n,t+=1;for(let i=1;i<s;i++){const s=e.getSInt32(),c=e.getSInt32(),u=r+s,l=n+c;h+=-.5*(u-r)*(l+n),this.hasZ&&e.getSInt32(),this.hasM&&e.getSInt32(),i>2&&Z(a[o-2],a[o-1],s,c)?(a[o-2]+=s,a[o-1]+=c):(a[o++]=s,a[o++]=c,t+=1),r=u,n=l}i.push(t)}break}default:e.skip()}if(this._cache.area=h,!i.length)return null;if(this._tx||this._ty){let e=0;for(const t of i)a[2*e]+=this._tx,a[2*e+1]+=this._ty,e+=t}return new A.Z(i,a)}}class X{constructor(e){this.service=e}destroy(){}}class W extends X{constructor(e){super(e),this._portsOpen=async function(e){const t=new b.Z;return await t.open(e,{}),t}(e.source).then((e=>this.client=e))}destroy(){this.client.close(),this.client=null}async executeQuery(e,t){await this._portsOpen;const s=await this.client.invoke("queryFeatures",e.toJSON(),t);return F.fromFeatureSet(s,this.service.objectIdField)}}class Y extends X{async executeQuery(e,t){const{data:s}=await(0,S.executeQueryPBFBuffer)(this.service.source,e,t),r=!e.quantizationParameters;return j.fromBuffer(s,this.service.geometryType,r)}}class V extends X{async executeQuery(e,t){const{source:s,capabilities:r,spatialReference:i,objectIdField:n,geometryType:o}=this.service;if((0,c.pC)(e.quantizationParameters)&&!r.query.supportsQuantization){const r=e.clone(),o=(0,w.vY)((0,c.Wg)(r.quantizationParameters));r.quantizationParameters=null;const{data:a}=await(0,S.executeQuery)(s,r,i,t),h=(0,d.h_)(a,n);return(0,d.RZ)(o,h),F.fromOptimizedFeatureSet(h)}const{data:a}=await(0,S.executeQuery)(s,e,this.service.spatialReference,t);var h;return"esriGeometryPoint"===o&&(a.features=null==(h=a.features)?void 0:h.filter((e=>{if((0,c.pC)(e.geometry)){const t=e.geometry;return Number.isFinite(t.x)&&Number.isFinite(t.y)}return!0}))),F.fromFeatureSet(a,this.service.objectIdField)}}class H extends X{async executeQuery(e,t){const{capabilities:s}=this.service;if(e.quantizationParameters&&!s.query.supportsQuantization){const s=e.clone(),r=(0,w.vY)((0,c.Wg)(s.quantizationParameters));s.quantizationParameters=null;const i=await(0,v.WW)(this.service.source,e,t);return(0,d.RZ)(r,i),F.fromOptimizedFeatureSet(i)}const r=await(0,v.WW)(this.service.source,e,t);return F.fromOptimizedFeatureSet(r)}}var Q=s(92835),$=s(32448),J=s(22862),K=s(57444),ee=s(8557);class te{constructor(){this.source=!1,this.targets={feature:!1,aggregate:!1},this.storage={filters:!1,data:!1},this.mesh=!1,this.queryFilter=!1,this.why={mesh:[],source:[]}}static create(e){const t=new te;for(const s in e){const r=e[s];if("object"==typeof r)for(const e in r){const i=r[e];t[s][e]=i}t[s]=r}return t}static empty(){return te.create({})}static all(){return te.create({source:!0,targets:{feature:!0,aggregate:!0},storage:{filters:!0,data:!0},mesh:!0})}unset(e){e.source&&(this.source=!1),e.targets.feature&&(this.targets.feature=!1),e.targets.aggregate&&(this.targets.aggregate=!1),e.storage.filters&&(this.storage.filters=!1),e.storage.data&&(this.storage.data=!1),e.mesh&&(this.mesh=!1),e.queryFilter&&(this.queryFilter=!1)}any(){return this.source||this.mesh||this.storage.filters||this.storage.data||this.targets.feature||this.targets.aggregate||this.queryFilter}describe(){let e=0,t="";if(this.mesh){e+=20,t+="-> (20) Mesh needs update\n";for(const e of this.why.mesh)t+=` + ${e}\n`}if(this.source){e+=10,t+="-> (10) The source needs update\n";for(const e of this.why.source)t+=` + ${e}\n`}this.targets.feature&&(e+=5,t+="-> (5) Feature target parameters changed\n"),this.storage.filters&&(e+=5,t+="-> (5) Feature filter parameters changed\n"),this.targets.aggregate&&(e+=4,t+="-> (4) Aggregate target parameters changed\n"),this.storage.data&&(e+=1,t+="-> (1) Texture storage parameters changed");const s=e<5?"Fastest":e<10?"Fast":e<15?"Moderate":e<20?"Slow":"Very Slow";console.debug(`Applying ${s} update of cost ${e}/45 `),console.debug(t)}toJSON(){return{queryFilter:this.queryFilter,source:this.source,targets:this.targets,storage:this.storage,mesh:this.mesh}}}class se{constructor(e){this.requests={done:new Array,stream:new ee.Z(10)},this._edits=null,this._abortController=new AbortController,this._done=!1,this.didSend=!1,this.tile=e}get signal(){return this._abortController.signal}get options(){return{signal:this._abortController.signal}}get empty(){return!this.requests.done.length}get edits(){return this._edits}get done(){return this._done}end(){this._done=!0}clear(){this.requests.done=[]}applyUpdate(e){this.requests.done.forEach((t=>t.message.status.unset(e))),(0,c.pC)(this._edits)&&this._edits.status.unset(e)}add(e){var t;e.message.status=null!=(t=e.message.status)?t:te.empty(),e.message.end&&this.requests.done.forEach((e=>{(0,c.pC)(e.message)&&e.message.end&&(e.message.end=!1)})),this.requests.done.push(e)}edit(e,t){const s=e.getQuantizationTransform(),r=e.geometryType,i=Array.from(e.features()),n=[...t,...i.map((e=>e.objectId))];this.removeIds(n),this._invalidate(),(0,c.Wi)(this._edits)?this._edits={type:"append",addOrUpdate:F.fromOptimizedFeatures(i,r,(0,c.Wg)(s)),id:this.tile.id,status:te.empty(),end:!0}:(this.requests.done.forEach((e=>e.message.end=!1)),(0,c.Wg)(this._edits.addOrUpdate).append(e.features()))}*readers(){for(const{message:e}of this.requests.done)(0,c.pC)(e.addOrUpdate)&&(yield e.addOrUpdate);(0,c.pC)(this._edits)&&(0,c.pC)(this._edits.addOrUpdate)&&(yield this._edits.addOrUpdate)}_invalidate(){for(const e of this.requests.done)e.message.status=te.empty();(0,c.pC)(this._edits)&&(this._edits.status=te.empty())}removeIds(e){this._invalidate();for(const{message:t}of this.requests.done){const s=t.addOrUpdate;(0,c.pC)(s)&&(s.removeIds(e),s.isEmpty&&(t.addOrUpdate=null))}(0,c.pC)(this._edits)&&(0,c.pC)(this._edits.addOrUpdate)&&this._edits.addOrUpdate.removeIds(e),this.requests.done=this.requests.done.filter((e=>e.message.addOrUpdate||e.message.end))}abort(){this._abortController.abort()}}class re{constructor(e){this.events=new $.Z,this._resolver=(0,u.hh)(),this._didEdit=!1,this._subscriptions=new Map,this._outSR=e.outSR,this._serviceInfo=e.serviceInfo,this._onTileUpdateMessage=e.onMessage}destroy(){}async _onMessage(e){var t;const s=this._subscriptions.get(e.id);if(!s)return;const r={...e,remove:null!=(t=e.remove)?t:[],status:e.status};return this._onTileUpdateMessage(r,s.options)}update(e,t){var s;const r=t.fields.length;t.outFields=function(e,t){const s=new Set;return e&&e.forEach((e=>s.add(e))),t&&t.forEach((e=>s.add(e))),s.has("*")?["*"]:Array.from(s)}(null==(s=this._schema)?void 0:s.outFields,t.outFields),t.outFields=t.outFields.length>=.75*r?["*"]:t.outFields,t.outFields.sort();const i=(0,J.Hg)(this._schema,t);if(!i)return;(0,n.Z)("esri-2d-update-debug")&&console.debug("Applying Update - Source:",i);const o="orderByFields"in this._serviceInfo&&this._serviceInfo.orderByFields?this._serviceInfo.orderByFields:this._serviceInfo.objectIdField+" ASC",a={returnCentroid:(0,n.Z)("esri-2d-query-centroid-enabled")&&"esriGeometryPolygon"===this._serviceInfo.geometryType,returnGeometry:!0,timeReferenceUnknownClient:"stream"!==this._serviceInfo.type&&this._serviceInfo.timeReferenceUnknownClient,outFields:t.outFields,outSpatialReference:this._outSR,orderByFields:[o],where:t.definitionExpression||"1=1",gdbVersion:t.gdbVersion,historicMoment:t.historicMoment,timeExtent:Q.Z.fromJSON(t.timeExtent),customParameters:t.customParameters},h=this._schema&&(0,J.uD)(i,"outFields");this._schema&&(0,J.V7)(i,["timeExtent","definitionExpression","gdbVersion","historicMoment","customParameters"])&&(e.why.mesh.push("Layer filter and/or custom parameters changed"),e.why.source.push("Layer filter and/or custom parameters changed"),e.mesh=!0,e.source=!0,e.queryFilter=!0),h&&(e.why.source.push("Layer required fields changed"),e.source=!0),(0,J.Hg)(a,this._queryInfo)&&(this._queryInfo=a),this._schema=t,this._resolver.resolve()}whenInitialized(){return this._resolver.promise}async applyUpdate(e){if(e.queryFilter||e.source&&this._didEdit)return this.refresh(),void(this._didEdit=!1);this._subscriptions.forEach((t=>t.applyUpdate(e))),await this.resend()}refresh(){for(const e of this._tiles())this.unsubscribe(e),this.subscribe(e)}subscribe(e){const t=new se(e);this._subscriptions.set(e.id,t)}unsubscribe(e){const t=this.get(e.id);(0,c.pC)(t)&&t.abort(),this._subscriptions.delete(e.id)}createQuery(e={}){const t=this._queryInfo.historicMoment?new Date(this._queryInfo.historicMoment):null;return new K.Z({...this._queryInfo,historicMoment:t,...e})}get(e){return this._subscriptions.has(e)?this._subscriptions.get(e):null}async queryLastEditDate(){throw new Error("Service does not support query type")}async query(e){throw new Error("Service does not support query")}*_tiles(){const e=Array.from(this._subscriptions.values());for(const t of e)yield t.tile}async edit(e,t){const s=Array.from(this._subscriptions.values()),r=s.map((({tile:e})=>e));for(const e of s)e.removeIds(t);if(e.length){const s=r.map((t=>{const s=this.createTileQuery(t);return s.objectIds=e,{tile:t,query:s}})).map((async({tile:e,query:t})=>({tile:e,result:await this.query(t),query:t}))),i=(await(0,u.WW)(s)).map((async({tile:s,result:r})=>{if(!r.hasFeatures&&!t.length&&!e.length)return;const i=this._subscriptions.get(s.key.id);i&&i.edit(r,e)}));await(0,u.as)(i)}this._didEdit=!0}}var ie=s(34084);const ne=x.Z.getLogger("esri.views.2d.layers.features.sources.BaseFeatureSource");class oe extends re{constructor(e){super(e),this.type="feature",this.mode="on-demand",this._adapter=function(e){const{capabilities:t}=e;return(s=e.source)&&s.capabilities&&s.collection&&s.layerDefinition?new H(e):function(e){return Array.isArray(e.source)}(e)?new W(e):t.query.supportsFormatPBF&&(0,n.Z)("featurelayer-pbf")?new Y(e):new V(e);var s}(e.serviceInfo),this._queue=new ie.e({concurrency:8,process:async e=>{if((0,u.k_)(e),(0,c.pC)(e.tile)){const t=e.tile.key.id,{signal:s}=e,r=(0,n.Z)("esri-tiles-debug")?{tile:t.replace(/\//g,"."),depth:e.depth}:void 0,i=await this._adapter.executeQuery(e.query,{signal:s,query:{...r,...this._schema.customParameters}});return i.level=e.tile.key.level,i}return this._adapter.executeQuery(e.query,{...e,query:this._schema.customParameters})}}),this._patchQueue=new ie.e({concurrency:8,process:async e=>{if((0,u.k_)(e),(0,c.pC)(e.tile)){const t=e.tile.key.id,{signal:s}=e,r=(0,n.Z)("esri-tiles-debug")?{tile:t.replace(/\//g,"."),depth:e.depth}:void 0,i=await this._adapter.executeQuery(e.query,{signal:s,query:{...r,...this._schema.customParameters}});return i.level=e.tile.key.level,i}return this._adapter.executeQuery(e.query,{...e,query:this._schema.customParameters})}})}destroy(){super.destroy(),this._adapter.destroy(),this._queue.destroy(),this._patchQueue.destroy()}get updating(){return!!this._queue.length||Array.from(this._subscriptions.values()).some((e=>!e.done))}get maxRecordCountFactor(){const{query:e}=this._serviceInfo.capabilities;return e.supportsMaxRecordCountFactor?4:null}get maxPageSize(){var e;const{query:t}=this._serviceInfo.capabilities;return(null!=(e=t.maxRecordCount)?e:8e3)*(0,c.Pt)(this.maxRecordCountFactor,1)}get pageSize(){return Math.min(8e3,this.maxPageSize)}enableEvent(e,t){}subscribe(e){super.subscribe(e);const t=this._subscriptions.get(e.id);this._fetchDataTile(e).catch((t=>{(0,u.D_)(t)||ne.error(new I.Z("mapview-query-error","Encountered error when fetching tile",{tile:e,error:t}))})).then((()=>t.end()))}unsubscribe(e){super.unsubscribe(e)}readers(e){return this._subscriptions.get(e).readers()}async query(e){return this._adapter.executeQuery(e,{query:this._schema.customParameters})}async queryLastEditDate(){const e=this._serviceInfo.source,t={...e.query,f:"json"};return(await(0,y.default)(e.path,{query:t,responseType:"json"})).data.editingInfo.lastEditDate}createTileQuery(e,t={}){var s;const r=this.createQuery(t);return r.quantizationParameters=null!=(s=t.quantizationParameters)?s:e.getQuantizationParameters(),r.resultType="tile",r.geometry=e.extent,r.quantizationParameters&&"esriGeometryPolyline"===this._serviceInfo.geometryType&&(r.maxAllowableOffset=e.resolution),r}async _executePatchQuery(e,t,s,r){const i=t.clone();i.outFields=[this._serviceInfo.objectIdField,...s],i.returnCentroid=!1,i.returnGeometry=!1;const n=(0,c.pC)(i.start)?i.start/8e3:0,o=r.signal;return this._patchQueue.push({tile:e,query:i,signal:o,depth:n})}async _resend(e,t){const{query:s,message:r}=e,i=(0,c.pC)(s.outFields)?s.outFields:[],n=this._queryInfo.outFields,o=n.filter((e=>-1===i.indexOf(e)));if((0,c.Wi)(r.addOrUpdate))this._onMessage({...r,type:"append"});else if(o.length)try{const e=this._subscriptions.get(r.id).tile,i=await this._executePatchQuery(e,s,o,t);(0,u.k_)(t),s.outFields=n,r.addOrUpdate.joinAttributes(i),this._onMessage({...r,end:r.end,type:"append"})}catch(e){}else this._onMessage({...r,type:"append"})}async _resendSubscription(e){if(e.empty)return this._onMessage({id:e.tile.id,addOrUpdate:null,end:!1,type:"append"});const t=e.signal;for(const s of e.requests.done)await this._resend(s,{signal:t});return(0,c.pC)(e.edits)?this._onMessage(e.edits):void 0}async resend(){const e=Array.from(this._subscriptions.values());await Promise.all(e.map((e=>this._resendSubscription(e))))}}const ae=(0,n.Z)("esri-mobile"),he={maxDrillLevel:ae?1:4,maxRecordCountFactor:ae?1:3};class ce extends oe{constructor(e){super(e)}async _fetchDataTile(e){const t=this._serviceInfo.capabilities.query.supportsMaxRecordCountFactor,s=this._subscriptions.get(e.key.id),r=s.signal,i=e.getQuantizationParameters();let n=0;const o=async(a,h)=>{const c=this._queryInfo,l=this.createTileQuery(a,{maxRecordCountFactor:t?he.maxRecordCountFactor:void 0,returnExceededLimitFeatures:!1,quantizationParameters:i});n++;try{const t=await this._queue.push({tile:e,query:l,signal:r,depth:h});if(n--,(0,u.k_)(r),!t)return;if(c!==this._queryInfo)return void o(a,h);if(t.exceededTransferLimit&&h<he.maxDrillLevel){for(const e of a.createChildTiles())o(e,h+1);return}const i={id:e.id,addOrUpdate:t,end:0===n,type:"append"};s.add({query:l,message:i}),this._onMessage(i)}catch(t){(0,u.D_)(t)||this._onMessage({id:e.id,addOrUpdate:null,end:!0,type:"append"})}};o(e,0)}}var ue=s(96794),le=s(22021);class de{constructor(e,t,s,r,i=128){this._trackIdToObservations=new Map,this._idCounter=0,this._lastPurge=performance.now(),this._addOrUpdated=new Map,this._removed=[],this._maxAge=0,this._timeInfo=s,this._purgeOptions=r,this.store=e,this.objectIdField=t,this.purgeInterval=i,this._useGeneratedIds="__esri_stream_id__"===this.objectIdField}add(e){if(this._useGeneratedIds){const t=this._nextId();e.attributes[this.objectIdField]=t,e.objectId=t}else e.objectId=e.attributes[this.objectIdField];if(this._addOrUpdated.set(e.objectId,e),this._maxAge=Math.max(this._maxAge,e.attributes[this._timeInfo.startTimeField]),!this._timeInfo.trackIdField)return(0,c.Wi)(this._trackIdLessObservations)&&(this._trackIdLessObservations=new ee.Z(1e5)),void this._trackIdLessObservations.enqueue(e.objectId);const t=e.attributes[this._timeInfo.trackIdField];if(!this._trackIdToObservations.has(t)){const e=(0,c.pC)(this._purgeOptions)&&null!=this._purgeOptions.maxObservations?this._purgeOptions.maxObservations:1e3,s=(0,le.uZ)(e,0,1e3);this._trackIdToObservations.set(t,new ee.Z(s))}const s=this._trackIdToObservations.get(t).enqueue(e.objectId);(0,c.pC)(s)&&(this._addOrUpdated.has(s)?this._addOrUpdated.delete(s):this._removed.push(s))}checkForUpdates(){const e=this._getToAdd(),t=this._getToRemove(),s=performance.now();s-this._lastPurge>=this.purgeInterval&&(this._purge(s),this._lastPurge=s);const r=[];if((0,c.pC)(t))for(const e of t){const t=this.store.removeById(e);(0,c.pC)(t)&&r.push(t)}if((0,c.pC)(e))for(const t of e)t.attributes.__esri_timestamp__=s,this.store.add(t);(e||r)&&this.store.update(e,r)}_getToAdd(){if(!this._addOrUpdated.size)return null;const e=new Array(this._addOrUpdated.size);let t=0;return this._addOrUpdated.forEach((s=>e[t++]=s)),this._addOrUpdated.clear(),e}_getToRemove(){const e=this._removed;return this._removed.length?(this._removed=[],e):null}_nextId(){const e=this._idCounter;return this._idCounter=(this._idCounter+1)%4294967294+1,e}_purge(e){const t=this._purgeOptions;(0,c.pC)(t)&&(this._purgeSomeByDisplayCount(t),this._purgeByAge(t),this._purgeByAgeReceived(e,t),this._purgeTracks())}_purgeSomeByDisplayCount(e){if(!e.displayCount)return;let t=this.store.size;if(t>e.displayCount){if(this._timeInfo.trackIdField)for(const s of this._trackIdToObservations.values())if(t>e.displayCount&&s.size){const e=(0,c.Wg)(s.dequeue());this._removed.push(e),t--}if((0,c.pC)(this._trackIdLessObservations)){let s=t-e.displayCount;for(;s-- >0;){const e=this._trackIdLessObservations.dequeue();(0,c.pC)(e)&&this._removed.push(e)}}}}_purgeByAge(e){var t;if(!e.age||null==(t=this._timeInfo)||!t.startTimeField)return;const s=60*e.age*1e3,r=this._maxAge-s;this.store.forEach((e=>{e.attributes[this._timeInfo.startTimeField]<r&&this._removed.push(e.objectId)}))}_purgeByAgeReceived(e,t){if(!t.ageReceived)return;const s=e-60*t.ageReceived*1e3;this.store.forEach((e=>{e.attributes.__esri_timestamp__<s&&this._removed.push(e.objectId)}))}_purgeTracks(){this._trackIdToObservations.forEach(((e,t)=>{0===e.size&&this._trackIdToObservations.delete(t)}))}}s(66577);var pe=s(17452),ge=(s(37697),s(69285));let _e=class extends($.Z.EventedMixin(i.r)){onFeature(e){this.emit("feature",e)}};_e=(0,r._)([(0,a.j)("esri.layers.graphics.sources.connections.StreamConnection")],_e);const fe=_e,me=x.Z.getLogger("esri.layers.graphics.sources.connections.WebSocketConnection");var ye,Ie;(Ie=ye||(ye={}))[Ie.CONNECTING=0]="CONNECTING",Ie[Ie.OPEN=1]="OPEN",Ie[Ie.CLOSING=2]="CLOSING",Ie[Ie.CLOSED=3]="CLOSED";let xe=class extends fe{constructor(e){super(),this.errorString=null;const{geometryType:t,spatialReference:s,sourceSpatialReference:r}=e;this._config=e,this._featureZScaler=(0,ge.k)(t,r,s),this._open()}async _open(){await this._tryCreateWebSocket(),this.destroyed||await this._handshake()}destroy(){(0,c.pC)(this._websocket)&&(this._websocket.onopen=null,this._websocket.onclose=null,this._websocket.onerror=null,this._websocket.onmessage=null,this._websocket.close()),this._websocket=null}get connectionStatus(){if((0,c.Wi)(this._websocket))return"disconnected";switch(this._websocket.readyState){case ye.CONNECTING:case ye.OPEN:return"connected";case ye.CLOSING:case ye.CLOSED:return"disconnected"}}async _tryCreateWebSocket(e=this._config.source.path,t=1e3,s=0){try{if(this.destroyed)return;const t=(0,pe.fl)(e,this._config.customParameters);this._websocket=await this._createWebSocket(t),this.notifyChange("connectionStatus")}catch(r){const i=t/1e3;return this._config.maxReconnectionAttempts&&s>=this._config.maxReconnectionAttempts?(me.error(new I.Z("websocket-connection","Exceeded maxReconnectionAttempts attempts. No further attempts will be made")),void this.destroy()):(me.error(new I.Z("websocket-connection",`Failed to connect. Attempting to reconnect in ${i}s`,r)),await(0,u.e4)(t),this._tryCreateWebSocket(e,Math.min(1.5*t,1e3*this._config.maxReconnectionInterval),s+1))}}_createWebSocket(e){return new Promise(((t,s)=>{const r=new WebSocket(e);r.onopen=()=>{if(r.onopen=null,this.destroyed)return r.onclose=null,void r.close();r.onclose=e=>this._onClose(e),r.onerror=e=>this._onError(e),r.onmessage=e=>this._onMessage(e),t(r)},r.onclose=e=>{r.onopen=r.onclose=null,s(e)}}))}async _handshake(e=1e4){const t=this._websocket;if((0,c.Wi)(t))return;const s=(0,u.hh)(),r=t.onmessage,{filter:i,outFields:n,spatialReference:o}=this._config;return s.timeout(e),t.onmessage=e=>{var a;let h=null;try{h=JSON.parse(e.data)}catch(e){}h&&"object"==typeof h||(me.error(new I.Z("websocket-connection","Protocol violation. Handshake failed - malformed message",e.data)),s.reject(),this.destroy()),(null==(a=h.spatialReference)?void 0:a.wkid)!==(null==o?void 0:o.wkid)&&(me.error(new I.Z("websocket-connection",`Protocol violation. Handshake failed - expected wkid of ${o.wkid}`,e.data)),s.reject(),this.destroy()),"json"!==h.format&&(me.error(new I.Z("websocket-connection","Protocol violation. Handshake failed - format is not set",e.data)),s.reject(),this.destroy()),i&&h.filter!==i&&me.error(new I.Z("websocket-connection","Tried to set filter, but server doesn't support it")),n&&h.outFields!==n&&me.error(new I.Z("websocket-connection","Tried to set outFields, but server doesn't support it")),t.onmessage=r,s.resolve()},t.send(JSON.stringify({filter:i,outFields:n,format:"json",spatialReference:{wkid:o.wkid}})),s.promise}_onMessage(e){try{const t=JSON.parse(e.data);if("featureResult"!==t.type)throw new I.Z("websocket-connection","Protocol violation - Expected to find message of type 'featureResult'",t);for(const e of t.features)(0,c.pC)(this._featureZScaler)&&this._featureZScaler(e.geometry),this.onFeature(e)}catch(e){return me.error(new I.Z("websocket-connection","Failed to parse message",e)),void this.destroy()}}_onError(e){const t="Encountered an error over WebSocket connection";this._set("errorString",t),me.error("websocket-connection",t)}_onClose(e){this._websocket=null,this.notifyChange("connectionStatus"),1e3!==e.code&&me.error("websocket-connection",`WebSocket closed unexpectedly with error code ${e.code}`),this.destroyed||this._open()}};(0,r._)([(0,o.Cb)()],xe.prototype,"connectionStatus",null),(0,r._)([(0,o.Cb)()],xe.prototype,"errorString",void 0),xe=(0,r._)([(0,a.j)("esri.layers.graphics.sources.connections.WebSocketConnection")],xe);var be=s(33955),we=s(82971);const ve=x.Z.getLogger("esri.layers.graphics.sources.connections.GeoEventConnection"),Se={maxQueryDepth:5,maxRecordCountFactor:3};let Te=class extends xe{constructor(e){super({...Se,...e})}async _open(){const e=await this._fetchServiceDefinition(this._config.source);e.timeInfo.trackIdField||ve.warn("GeoEvent service was configured without a TrackIdField. This may result in certain functionality being disabled. The purgeOptions.maxObservations property will have no effect.");const t=this._fetchWebSocketUrl(e.streamUrls,this._config.spatialReference);this._buddyServicesQuery||(this._buddyServicesQuery=this._queryBuddyServices()),await this._buddyServicesQuery,await this._tryCreateWebSocket(t);const{filter:s,outFields:r}=this._config;this.destroyed||this._setFilter(s,r)}_onMessage(e){let t;try{t=this._enrich(JSON.parse(e.data)),(0,c.pC)(this._featureZScaler)&&this._featureZScaler(t.geometry)}catch(e){return void ve.error(new I.Z("geoevent-connection","Failed to parse message",e))}this.onFeature(t)}async _fetchServiceDefinition(e){const t={f:"json",...this._config.customParameters},s=(0,y.default)(e.path,{query:t,responseType:"json"}),r=(await s).data;return this._serviceDefinition=r,r}_fetchWebSocketUrl(e,t){const s=e[0],{urls:r,token:i}=s,n=this._inferWebSocketBaseUrl(r);return(0,pe.fl)(`${n}/subscribe`,{outSR:""+t.wkid,token:i})}_inferWebSocketBaseUrl(e){if(1===e.length)return e[0];for(const t of e)if(-1!==t.indexOf("wss"))return t;return ve.error(new I.Z("geoevent-connection","Unable to infer WebSocket url",e)),null}async _setFilter(e,t){const s=this._websocket;if((0,c.Wi)(s)||(0,c.Wi)(e)&&(0,c.Wi)(t))return;const r=JSON.stringify({filter:this._serializeFilter(e,t)});let i=!1;const n=(0,u.hh)();return s.onmessage=e=>{const t=JSON.parse(e.data);t.filter&&(t.error&&(ve.error(new I.Z("geoevent-connection","Failed to set service filter",t.error)),this._set("errorString",`Could not set service filter - ${t.error}`),n.reject(t.error)),s.onmessage=this._onMessage.bind(this),i=!0,n.resolve())},s.send(r),setTimeout((()=>{i||(this.destroyed||this._websocket!==s||ve.error(new I.Z("geoevent-connection","Server timed out when setting filter")),n.reject())}),1e4),n.promise}_serializeFilter(e,t){const s={};if((0,c.Wi)(e)&&(0,c.Wi)(t))return s;if((0,c.pC)(e)&&e.geometry)try{const t=(0,be.im)(e.geometry);if("extent"!==t.type)throw new I.Z(`Expected extent but found type ${t.type}`);s.geometry=JSON.stringify(t.shiftCentralMeridian())}catch(e){ve.error(new I.Z("geoevent-connection","Encountered an error when setting connection geometryDefinition",e))}return(0,c.pC)(e)&&e.where&&"1 = 1"!==e.where&&(s.where=e.where),(0,c.pC)(t)&&(s.outFields=t.join(",")),s}_enrich(e){if(!this._relatedFeatures)return e;const t=this._serviceDefinition.relatedFeatures.joinField,s=e.attributes[t];if(!this._relatedFeatures.has(s))return ve.warn("geoevent-connection","Feature join failed. Is the join field configured correctly?",e),e;const{attributes:r,geometry:i}=this._relatedFeatures.get(s);for(const t in r)e.attributes[t]=r[t];return i&&(e.geometry=i),e.geometry||e.centroid||ve.error(new I.Z("geoevent-connection","Found malformed feature - no geometry found",e)),e}async _queryBuddyServices(){try{const{relatedFeatures:e,keepLatestArchive:t}=this._serviceDefinition,s=this._queryRelatedFeatures(e),r=this._queryArchive(t);await s;const i=await r;if(!i)return;for(const e of i.features)this.onFeature(this._enrich(e))}catch(e){ve.error(new I.Z("geoevent-connection","Encountered an error when querying buddy services",{error:e}))}}async _queryRelatedFeatures(e){if(!e)return;const t=await this._queryBuddy(e.featuresUrl);this._addRelatedFeatures(t)}async _queryArchive(e){if(e)return this._queryBuddy(e.featuresUrl)}async _queryBuddy(e){const t=new((await Promise.all([s.e(6968),s.e(7319),s.e(1773),s.e(755),s.e(3471),s.e(511),s.e(635),s.e(9101),s.e(7284),s.e(8422),s.e(8121)]).then(s.bind(s,67284))).default)({url:e}),{capabilities:r}=await t.load(),i=r.query.supportsMaxRecordCountFactor,n=r.query.supportsPagination,o=r.query.supportsCentroid,a=this._config.maxRecordCountFactor,h=t.capabilities.query.maxRecordCount,u=i?h*a:h,l=new K.Z;if(l.outFields=(0,c.Pt)(this._config.outFields,["*"]),l.where=(0,c.Pt)((0,c.U2)(this._config.filter,"where"),"1=1"),l.returnGeometry=!0,l.returnExceededLimitFeatures=!0,l.outSpatialReference=we.Z.fromJSON(this._config.spatialReference),o&&(l.returnCentroid=!0),i&&(l.maxRecordCountFactor=a),n)return l.num=u,t.destroy(),this._queryPages(e,l);const d=await(0,S.executeQuery)(e,l,this._config.sourceSpatialReference);return t.destroy(),d.data}async _queryPages(e,t,s=[],r=0){t.start=(0,c.pC)(t.num)?r*t.num:null;const{data:i}=await(0,S.executeQuery)(e,t,this._config.sourceSpatialReference);return i.exceededTransferLimit&&r<this._config.maxQueryDepth?(i.features.forEach((e=>s.push(e))),this._queryPages(e,t,s,r+1)):(s.forEach((e=>i.features.push(e))),i)}_addRelatedFeatures(e){const t=new Map,s=e.features,r=this._serviceDefinition.relatedFeatures.joinField;for(const e of s){const s=e.attributes[r];t.set(s,e)}this._relatedFeatures=t}};Te=(0,r._)([(0,a.j)("esri.layers.graphics.sources.connections.GeoEventConnection")],Te);const Ce=Te;function Fe(e,t){const s=e.weakClone();if((0,c.pC)(e.geometry)){const r=(0,d.Jd)(t,e.geometry.coords[0]),i=(0,d.IN)(t,e.geometry.coords[1]);s.geometry=new A.Z([],[r,i])}return s}class Ee{constructor(e,t){this.onUpdate=e,this._geometryType=t,this._objectIdToFeature=new Map}get _features(){const e=[];return this._objectIdToFeature.forEach((t=>e.push(t))),e}add(e){this._objectIdToFeature.set(e.objectId,e),this._index=null}get(e){return this._objectIdToFeature.has(e)?this._objectIdToFeature.get(e):null}forEach(e){this._objectIdToFeature.forEach(e)}search(e){return this._index||(this._index=function(e,t){const s=(0,ue.r)(9,"esriGeometryPoint"===t?e=>(0,c.pC)(e.geometry)?{minX:e.geometry.coords[0],minY:e.geometry.coords[1],maxX:e.geometry.coords[0],maxY:e.geometry.coords[1]}:{minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}:e=>{let t=1/0,s=1/0,r=-1/0,i=-1/0;return(0,c.pC)(e.geometry)&&e.geometry.forEachVertex(((e,n)=>{t=Math.min(t,e),s=Math.min(s,n),r=Math.max(r,e),i=Math.max(i,n)})),{minX:t,minY:s,maxX:r,maxY:i}});return s.load(e),s}(this._features,this._geometryType)),function(e,t){return e.search({minX:t.bounds[0],minY:t.bounds[1],maxX:t.bounds[2],maxY:t.bounds[3]})}(this._index,e)}removeById(e){const t=this._objectIdToFeature.get(e);return t?(this._objectIdToFeature.delete(e),this._index=null,t):null}update(e,t){this.onUpdate(e,t)}get size(){return this._objectIdToFeature.size}}class Ae extends re{constructor(e){super(e),this.type="geoevent",this._dataReceiveEventEnabled=!1,this._level=0,this._updateInfo={websocket:0,client:0};const{outSR:t}=e,{geometryType:s,objectIdField:r,timeInfo:i,purgeOptions:n,source:o,spatialReference:a,serviceFilter:h,maxReconnectionAttempts:c,maxReconnectionInterval:u,updateInterval:l,enableDataReceived:p,customParameters:g}=e.serviceInfo,_=new Ee(this._onUpdate.bind(this),s),f=new de(_,r,i,n),m=function(e,t,s,r,i,n,o,a){const h=0===e.path.indexOf("wss://")||0===e.path.indexOf("ws://"),c={source:e,sourceSpatialReference:t,spatialReference:s,geometryType:r,filter:i,maxReconnectionAttempts:n,maxReconnectionInterval:o,customParameters:a};return h?new xe(c):new Ce(c)}(o,a,t,s,h,c,u,g);this._store=_,this._manager=f,this._connection=m,this._quantize=function(e){return"esriGeometryPoint"===e?Fe:(t,s)=>{const r=t.weakClone(),i=new A.Z,n=(0,d.Nh)(i,t.geometry,!1,!1,e,s,!1,!1);return r.geometry=n,r}}(s),this._dataReceiveEventEnabled=p,this._handles=[this._connection.on("feature",(e=>this._onFeature(e))),this._connection.watch("connectionStatus",(e=>this.events.emit("connectionStatus",e))),this._connection.watch("errorString",(e=>this.events.emit("errorString",e)))];let y=performance.now();this._updateIntervalId=setInterval((()=>{const t=performance.now(),s=t-y;if(s>2500){y=t;const e=Math.round(this._updateInfo.client/(s/1e3)),r=Math.round(this._updateInfo.websocket/(s/1e3));this._updateInfo.client=0,this._updateInfo.websocket=0,this.events.emit("updateRate",{client:e,websocket:r})}e.canAcceptRequest()&&this._manager.checkForUpdates()}),l)}destroy(){super.destroy(),clearInterval(this._updateIntervalId),this._handles.forEach((e=>e.remove())),this._connection.destroy()}_fetchDataTile(){}resume(){}enableEvent(e,t){"data-received"===e&&(this._dataReceiveEventEnabled=t)}get updating(){return!1}subscribe(e){super.subscribe(e);const t=this._subscriptions.get(e.id);this._level=e.level;const s=this._getTileFeatures(e);this._onMessage({type:"append",id:e.key.id,addOrUpdate:s,end:!0}),t.didSend=!0}unsubscribe(e){super.unsubscribe(e)}*readers(e){const t=this._subscriptions.get(e),{tile:s}=t;yield this._getTileFeatures(s);for(const e of t.requests.stream.entries)(0,c.pC)(e)&&(0,c.pC)(e.addOrUpdate)&&(yield e.addOrUpdate)}createTileQuery(e){throw new Error("Service does not support tile queries")}async resend(){this._subscriptions.forEach((e=>{const{tile:t}=e,s={type:"append",id:t.id,addOrUpdate:this._getTileFeatures(t),end:!0};this._onMessage(s)}))}_getTileFeatures(e){const t=this._store.search(e).map((t=>this._quantize(t,e.transform)));return F.fromOptimizedFeatures(t,this._serviceInfo.geometryType,e.transform)}_onFeature(e){this._updateInfo.websocket++;try{this._dataReceiveEventEnabled&&this.events.emit("feature",e);const t=(0,d.XA)(e,this._serviceInfo.geometryType,!1,!1,this._serviceInfo.objectIdField);this._manager.add(t)}catch(e){}}_onUpdate(e,t){(0,c.pC)(e)&&(this._updateInfo.client+=e.length),this._subscriptions.forEach(((e,t)=>{e.didSend&&e.tile.level===this._level&&this._onMessage({type:"append",id:t,addOrUpdate:null,clear:!0,end:!1})})),this._subscriptions.forEach(((e,t)=>{if(!e.didSend||e.tile.level!==this._level)return;const s=e.tile,r={type:"append",id:t,addOrUpdate:this._getTileFeatures(s),remove:[],end:!0,status:te.empty()};e.requests.stream.enqueue(r),this._onMessage(r)}))}}const Me=x.Z.getLogger("esri.views.2d.layers.features.sources.FeatureSource");class ke extends oe{constructor(e){super(e)}async _fetchDataTile(e){const t=this._subscriptions.get(e.key.id);let s=!1,r=0,i=0;const n=(r,n)=>{i--,(0,u.k_)(t);const o=e.id,a=r.reader,h=r.query;if(!a.exceededTransferLimit){if(s=!0,0!==n&&!a.hasFeatures){const e={id:o,addOrUpdate:a,end:0===i,type:"append"};return t.add({message:e,query:h}),void this._onMessage(e)}const e={id:o,addOrUpdate:a,end:0===i,type:"append"};return t.add({message:e,query:h}),void this._onMessage(e)}const c={id:o,addOrUpdate:a,end:s&&0===i,type:"append"};t.add({message:c,query:h}),this._onMessage(c)};let o=0,a=0;for(;!s&&a++<20;){let a;for(let h=0;h<o+1;h++){const o=r++;i++,a=this._fetchDataTilePage(e,o,t).then((e=>e&&n(e,o))).catch((t=>{s=!0,(0,u.D_)(t)||(Me.error(new I.Z("mapview-query-error","Encountered error when fetching tile",{tile:e,error:t})),this._onMessage({id:e.id,addOrUpdate:null,end:s,type:"append"}))}))}await a,(0,u.k_)(t),o=Math.min(o+2,6)}}async _fetchDataTilePage(e,t,s){(0,u.k_)(s);const r=this._queryInfo,i={start:this.pageSize*t,num:this.pageSize,returnExceededLimitFeatures:!0,quantizationParameters:e.getQuantizationParameters()};(0,c.pC)(this.maxRecordCountFactor)&&(i.maxRecordCountFactor=this.maxRecordCountFactor);const n=this.createTileQuery(e,i);try{const i=s.signal,o=await this._queue.push({tile:e,query:n,signal:i,depth:t});return(0,u.k_)(s),o?r!==this._queryInfo?this._fetchDataTilePage(e,t,s):{reader:o,query:n}:null}catch(e){return(0,u.H9)(e),null}}}var Re=s(77734),Oe=s(61800);const Le=x.Z.getLogger("esri.views.2d.layers.features.sources.SnapshotFeatureSource");function Pe(e,t,s){const r=e.getXHydrated(),i=e.getYHydrated(),n=t.getColumnForX(r),o=Math.floor(t.normalizeCol(n));return`${s}/${Math.floor(t.getRowForY(i))}/${o}`}function Ne(e,t){if((0,c.Wi)(e))return null;const s=t.transform,r=e.getQuantizationTransform();if((0,c.Wi)(r)){const[t,r]=s.scale,[i,n]=s.translate,o=-i/t,a=1/t,h=n/r,c=1/-r;return e.transform(o,h,a,c)}const[i,n]=r.scale,[o,a]=r.translate,[h,u]=s.scale,[l,d]=s.translate,p=i/h,g=(o-l)/h,_=n/u,f=(-a+d)/u;return e.transform(g,f,p,_)}class Ue extends oe{constructor(e){super(e),this.mode="snapshot",this._loading=!0,this._controller=new AbortController,this._downloadPromise=null,this._didSendEnd=!1,this._queries=new Array,this._invalidated=!1,this._hasAggregates=!1,this._random=new Re.Z(1e3),this._store=e.store,this._markedIdsBufId=this._store.storage.createBitset()}destroy(){super.destroy(),this._controller.abort()}get loading(){return this._loading}get _signal(){return this._controller.signal}update(e,t){super.update(e,t),this._hasAggregates=e.targets.aggregate}async resend(e=!1){if(await this._downloadPromise,this._invalidated||e){const e=(0,c.s3)(this._schema.featureCount,"Expected featureCount to be defined");return this._invalidated=!1,this._subscriptions.forEach((e=>e.clear())),this._downloadPromise=this._download(e),void await this._downloadPromise}const t=this._queries.map((({query:e,reader:t})=>this._sendPatchQuery(e,t)));await Promise.all(t),this._subscriptions.forEach((e=>{e.requests.done.forEach((e=>this._onMessage(e.message)))}))}async refresh(){await this.resend(!0)}async _sendPatchQuery(e,t){const s=(0,c.pC)(e.outFields)?e.outFields:[],r=this._queryInfo.outFields,i=r.filter((e=>-1===s.indexOf(e)));if(!i.length)return;const n=e.clone(),o=this._signal;n.returnGeometry=!1,n.returnCentroid=!1,n.outFields=i,e.outFields=r;const a=await this._queue.push({query:n,depth:0,signal:o});(0,u.k_)({signal:o}),t.joinAttributes(a)}async _fetchDataTile(e){if(!this._downloadPromise){const e=(0,c.s3)(this._schema.featureCount,"Expected featureCount to be defined");this._downloadPromise=this._download(e)}const t=this._store.search(e),s=this._subscriptions.get(e.key.id),r=t.length-1;for(let i=0;i<r;i++){const r=Ne(t[i],e),n={type:"append",id:e.id,addOrUpdate:r,end:!1,status:te.empty()};s.add({query:null,message:n}),this._hasAggregates||await(0,u.e4)(1),this._onMessage(n)}const i=Ne(r>=0?t[r]:null,e),n=this._didSendEnd,o={type:"append",id:e.id,addOrUpdate:i,end:n,status:te.empty()};s.add({query:null,message:o}),this._onMessage(o)}async _download(e){try{await this.whenInitialized();const t=this._store.storage.getBitset(this._markedIdsBufId),s=new Set;t.clear();const r=Math.ceil(e/this.pageSize),i=Array.from({length:r},((e,t)=>t)).sort(((e,t)=>this._random.getInt()-this._random.getInt())).map((e=>this._downloadPage(e,t,s)));await Promise.all(i),this._store.sweepFeatures(t,this._store.storage),this._store.sweepFeatureSets(s)}catch(e){Le.error("mapview-snapshot-source","Encountered and error when downloading feature snapshot",e)}this._sendEnd(),this._loading=!1}async _downloadPage(e,t,s){const r=this.pageSize,i={start:e*r,num:r,cacheHint:!0};(0,c.pC)(this.maxRecordCountFactor)&&(i.maxRecordCountFactor=this.maxRecordCountFactor);const n=this.createQuery(i),o=this._signal,a=await this._queue.push({query:n,depth:e,signal:o});(0,u.k_)({signal:o}),this._queries.push({query:n,reader:a}),this._store.insert(a),s.add(a.instance);const h=a.getCursor();for(;h.next();)t.set(h.getDisplayId());this._send(a)}_send(e){if(!this._subscriptions.size)return;let t=null;const s=new Map,r=new Set,i=new Map;this._subscriptions.forEach((e=>{var n;const o=e.tile;s.set(o.key.id,null),t=o.tileInfoView,r.add(o.level);const{row:a,col:h}=o.key,c=`${o.level}/${a}/${h}`,u=null!=(n=i.get(c))?n:[];u.push(e),i.set(c,u)}));for(const n of r){const r=t.getLODInfoAt(n),o=e.getCursor();for(;o.next();){const e=Pe(o,r,n),t=o.getIndex();if(i.has(e))for(const r of i.get(e)){const e=r.tile.id;let i=s.get(e);(0,c.Wi)(i)&&(i=[],s.set(e,i)),i.push(t)}}}s.forEach(((t,s)=>{if((0,c.pC)(t)){const r=this._subscriptions.get(s),i={type:"append",id:s,addOrUpdate:Ne(Oe.t.from(e,t),r.tile),end:!1,status:te.empty()};r.add({query:null,message:i}),this._onMessage(i)}}))}_sendEnd(){this._subscriptions.forEach((e=>{const t={type:"append",id:e.tile.id,addOrUpdate:null,end:!0,status:te.empty()};e.add({query:null,message:t}),this._onMessage(t)})),this._didSendEnd=!0}}var De=s(16534),qe=s(29996);s(37720),s(66039),s(40660);var Be=s(35371);const ze=x.Z.getLogger("esri.views.layers.2d.features.support.AttributeStore"),Ge=()=>null,Ze={sharedArrayBuffer:(0,n.Z)("esri-shared-array-buffer"),atomics:(0,n.Z)("esri-atomics")};function je(e,t){return s=>t(e(s))}class Xe{constructor(e,t,s,r){this.size=0,this.texelSize=4;const{pixelType:i,layout:n,textureOnly:o}=r;this.textureOnly=o||!1,this.pixelType=i,this._ctype=t,this.layout=n,this._resetRange(),this._shared=e,this.size=s,o||(this.data=this._initData(i,s,e,t))}get buffer(){return(0,c.Po)(this.data,(e=>e.buffer))}unsetComponentAllTexels(e,t){const s=(0,c.Wg)(this.data);for(let r=0;r<this.size*this.size;r++)s[r*this.texelSize+e]&=~t;this.dirtyStart=0,this.dirtyEnd=this.size*this.size-1}setComponentAllTexels(e,t){const s=(0,c.Wg)(this.data);for(let r=0;r<this.size*this.size;r++)s[r*this.texelSize+e]|=255&t;this.dirtyStart=0,this.dirtyEnd=this.size*this.size-1}setComponent(e,t,s){const r=(0,c.Wg)(this.data);for(const i of s)r[i*this.texelSize+e]|=t,this.dirtyStart=Math.min(this.dirtyStart,i),this.dirtyEnd=Math.max(this.dirtyEnd,i)}setComponentTexel(e,t,s){(0,c.Wg)(this.data)[s*this.texelSize+e]|=t,this.dirtyStart=Math.min(this.dirtyStart,s),this.dirtyEnd=Math.max(this.dirtyEnd,s)}unsetComponentTexel(e,t,s){(0,c.Wg)(this.data)[s*this.texelSize+e]&=~t,this.dirtyStart=Math.min(this.dirtyStart,s),this.dirtyEnd=Math.max(this.dirtyEnd,s)}getData(e,t){const s=(0,_.jL)(e);return(0,c.Wg)(this.data)[s*this.texelSize+t]}setData(e,t,s){const r=(0,_.jL)(e),i=1<<t;0!=(this.layout&i)?(this.data[r*this.texelSize+t]=s,this.dirtyStart=Math.min(this.dirtyStart,r),this.dirtyEnd=Math.max(this.dirtyEnd,r)):ze.error("mapview-attributes-store","Tried to set a value for a texel's readonly component")}lock(){this.pixelType===Be.Br.UNSIGNED_BYTE&&this._shared&&Ze.atomics&&"local"!==this._ctype&&Atomics.store(this.data,0,1)}unlock(){this.pixelType===Be.Br.UNSIGNED_BYTE&&this._shared&&Ze.atomics&&"local"!==this._ctype&&Atomics.store(this.data,0,0)}expand(e){if(this.size=e,!this.textureOnly){const t=this._initData(this.pixelType,e,this._shared,this._ctype),s=(0,c.Wg)(this.data);t.set(s),this.data=t}}toMessage(){const e=this.dirtyStart,t=this.dirtyEnd,s=this.texelSize;if(e>t)return null;this._resetRange();const r=!(this._shared||"local"===this._ctype),i=this.pixelType,n=this.layout,o=(0,c.Wg)(this.data);return{start:e,end:t,data:r&&o.slice(e*s,(t+1)*s)||null,pixelType:i,layout:n}}_initData(e,t,s,r){const i=s&&"local"!==r?SharedArrayBuffer:ArrayBuffer,n=(0,qe.UK)(e),o=new n(new i(t*t*4*n.BYTES_PER_ELEMENT));for(let e=0;e<o.length;e+=4)o[e+1]=255;return o}_resetRange(){this.dirtyStart=2147483647,this.dirtyEnd=0}}class We{constructor(e,t){this._client=e,this.config=t,this._attributeComputeMap=new Map,this._blocks=new Array,this._filters=new Array(De.m4),this._targetType=0,this._abortController=new AbortController,this._hasScaleExpr=!1,this._size=32,this._idsToHighlight=new Set;const s=t.supportsTextureFloat?Be.Br.FLOAT:Be.Br.UNSIGNED_BYTE;Ge(`Creating AttributeStore ${Ze.sharedArrayBuffer?"with":"without"} shared memory`),this._blockDescriptors=[{pixelType:Be.Br.UNSIGNED_BYTE,layout:1},{pixelType:Be.Br.UNSIGNED_BYTE,layout:15,textureOnly:!0},{pixelType:s,layout:15},{pixelType:s,layout:15}],this._blocks=this._blockDescriptors.map((()=>null))}destroy(){this._abortController.abort()}get hasScaleExpr(){return this._hasScaleExpr}get _signal(){return this._abortController.signal}get hasHighlight(){return this._idsToHighlight.size>0}update(e,t){this.config=t;const s=t.schema.processors[0].storage,r=(0,J.Hg)(this._schema,s);if((e.targets.feature||e.targets.aggregate)&&(e.storage.data=!0),r&&((0,n.Z)("esri-2d-update-debug")&&console.debug("Applying Update - AttributeStore:",r),e.storage.data=!0,this._schema=s,this._attributeComputeMap.clear(),!(0,c.Wi)(s))){switch(s.target){case"feature":this._targetType=_.PX;break;case"aggregate":this._targetType=_.xp}if("subtype"===s.type)for(const e in s.mapping){const t=s.mapping[e];if((0,c.pC)(t))for(const e of t.mapping)this._bindAttribute(e)}else for(const e of s.mapping)this._bindAttribute(e)}}onTileData(e,t){if((0,c.Wi)(t.addOrUpdate))return;const s=t.addOrUpdate.getCursor();for(;s.next();){const e=s.getDisplayId();this.setAttributeData(e,s)}}invalidateResources(){this._createResourcesPromise=null,this._abortController.abort(),this._abortController=new AbortController}async setHighlight(e,t){const s=this._getBlock(0),r=t.map((e=>(0,_.jL)(e)));s.lock(),s.unsetComponentAllTexels(0,1),s.setComponent(0,1,r),s.unlock(),this._idsToHighlight.clear();for(const t of e)this._idsToHighlight.add(t);await this.sendUpdates()}async updateFilters(e,t){const{config:s,service:r,spatialReference:i}=t,{filters:o}=s,a=o.map(((e,t)=>this._updateFilter(e,t,r,i)));(await Promise.all(a)).some((e=>e))&&(e.storage.filters=!0,(0,n.Z)("esri-2d-update-debug")&&console.debug("Applying Update - AttributeStore:","Filters changed"))}setData(e,t,s,r){const i=(0,_.jL)(e);this._ensureSizeForTexel(i),this._getBlock(t).setData(e,s,r)}getData(e,t,s){return this._getBlock(t).getData(e,s)}getHighlightFlag(e){return this._idsToHighlight.has(e)?De.uG:0}unsetAttributeData(e){const t=(0,_.jL)(e);this._getBlock(0).setData(t,0,0)}setAttributeData(e,t){const s=(0,_.jL)(e);if(this._ensureSizeForTexel(s),this._getBlock(0).setData(s,0,this.getFilterFlags(t)),this._targetType!==(0,_.vs)(e))return;const r=this._attributeComputeMap,i=this.config.supportsTextureFloat?1:2;r.size&&r.forEach(((e,r)=>{const n=r*i%4,o=Math.floor(r*i/4),a=this._getBlock(o+De.aK),h=e(t);if(this.config.supportsTextureFloat)a.setData(s,n,h);else if(h===De.AI)a.setData(s,n,255),a.setData(s,n+1,255);else{const e=(0,le.uZ)(Math.round(h),-32767,32766)+32768,t=255&e,r=(65280&e)>>8;a.setData(s,n,t),a.setData(s,n+1,r)}}))}sendUpdates(){if(this._nextUpdate)return this._nextUpdate.promise;if(this._currUpdate)return this._nextUpdate=(0,u.hh)(),this._nextUpdate.promise;const e={blocks:this._blocks.map((e=>(0,c.pC)(e)?e.toMessage():null))};return this._currUpdate=this._createResources().then((()=>{const t=()=>{if(this._currUpdate=null,this._nextUpdate){const e=this._nextUpdate;this._nextUpdate=null,this.sendUpdates().then((()=>e.resolve()))}},s=this._client.update(e,this._signal).then(t).catch(t);return this._client.render(this._signal),s})).catch((e=>(0,u.D_)(e)?(this._createResourcesPromise=null,this._createResources()):(ze.error(new I.Z("mapview-attribute-store","Encountered an error during client update",e)),Promise.resolve()))),this._currUpdate}_ensureSizeForTexel(e){for(;e>=this._size*this._size;)if(this._expand())return}_bindAttribute(e){let t;if(null!=e.fieldIndex)e.normalizationField&&ze.warn("mapview-arcade","Ignoring normalizationField specified with an arcade expression which is not supported."),t=t=>t.getComputedNumericAtIndex(e.fieldIndex);else{if(!e.field)return;t=e.normalizationField?t=>{const s=t.readAttribute(e.normalizationField);return s?t.readAttribute(e.field)/s:null}:t=>t.readAttribute(e.field)}e.valueRepresentation&&(t=je(t,(t=>function(e,t){if(!e||!t)return e;switch(t){case"radius":case"distance":return 2*e;case"diameter":case"width":return e;case"area":return Math.sqrt(e)}return e}(t,e.valueRepresentation)))),this._attributeComputeMap.set(e.binding,je(t,(e=>null===e||isNaN(e)||e===1/0?De.AI:e)))}_createResources(){if((0,c.pC)(this._createResourcesPromise))return this._createResourcesPromise;this._getBlock(De.xl),Ge("Initializing AttributeStore");const e={shared:Ze.sharedArrayBuffer&&!("local"===this._client.type),size:this._size,blocks:(0,c.Fd)(this._blocks,(e=>({textureOnly:e.textureOnly,buffer:e.buffer,pixelType:e.pixelType})))},t=this._client.initialize(e,this._signal).catch((e=>{(0,u.D_)(e)?this._createResourcesPromise=null:ze.error(new I.Z("mapview-attribute-store","Encountered an error during client initialization",e))}));return this._createResourcesPromise=t,t.then((()=>(0,c.Wi)(this._createResourcesPromise)?this._createResources():void 0)),t}_getBlock(e){const t=this._blocks[e];if((0,c.pC)(t))return t;Ge(`Initializing AttributeBlock at index ${e}`);const s=Ze.sharedArrayBuffer,r=this._client.type,i=new Xe(s,r,this._size,this._blockDescriptors[e]);return this._blocks[e]=i,this._createResourcesPromise=null,i}_expand(){if(this._size<this.config.maxTextureSize){const e=this._size<<=1;return Ge("Expanding block size to",e,this._blocks),(0,c.JR)(this._blocks,(t=>t.expand(e))),this._createResourcesPromise=null,this._size=e,0}return ze.error(new I.Z("mapview-limitations","Maximum number of onscreen features exceeded.")),-1}async _updateFilter(e,t,s,r){const i=this._filters[t],n=(0,c.pC)(i)&&i.hash;if(!i&&!e)return!1;if(n===JSON.stringify(e))return!1;if((0,c.Wi)(e)){if(!i)return!1;const e=1<<t+1,s=this._getBlock(0);return this._filters[t]=null,s.setComponentAllTexels(0,e),this.sendUpdates(),!0}const o=await this._getFilter(t,s);return await o.update(e,r),!0}async _getFilter(e,t){const r=this._filters[e];if((0,c.pC)(r))return r;const{default:i}=await s.e(9169).then(s.bind(s,29169)),n=new i({geometryType:t.geometryType,hasM:!1,hasZ:!1,timeInfo:t.timeInfo,fieldsIndex:new g.Z(t.fields)});return this._filters[e]=n,n}isVisible(e){return!!(2&this._getBlock(0).getData(e,0))}getFilterFlags(e){let t=0;const s=(0,_.KS)(e.getDisplayId());for(let r=0;r<this._filters.length;r++){const i=!!(s&1<<r),n=this._filters[r];t|=(!i||(0,c.Wi)(n)||n.check(e)?1:0)<<r}let r=0;if(this._idsToHighlight.size){const t=e.getObjectId();r=this.getHighlightFlag(t)}return t<<1|r}}function Ye(e,t,s,r){r%2&&(r+=1);let i=0,n=0,o=-90,a=90,h=-180,c=180;for(let e=0;e<r/2;e++){for(let t=0;t<5;t++){const r=(h+c)/2,n=s>r?1:0;i|=n<<29-(t+5*e),h=(1-n)*h+n*r,c=(1-n)*r+n*c}for(let s=0;s<5;s++){const r=(o+a)/2,i=t>r?1:0;n|=i<<29-(s+5*e),o=(1-i)*o+i*r,a=(1-i)*r+i*a}}e.geohashX=i,e.geohashY=n}function Ve(e,t,s,r,i){i%2&&(i+=1);let n=0,o=0,a=-90,h=90,c=-180,u=180;for(let e=0;e<i/2;e++){for(let t=0;t<5;t++){const s=(c+u)/2,i=r>s?1:0;n|=i<<29-(t+5*e),c=(1-i)*c+i*s,u=(1-i)*s+i*u}for(let t=0;t<5;t++){const r=(a+h)/2,i=s>r?1:0;o|=i<<29-(t+5*e),a=(1-i)*a+i*r,h=(1-i)*r+i*h}}e[2*t]=n,e[2*t+1]=o}new Float64Array(2),new Float64Array(2);class He{constructor(e=[],t=8096){this._nodes=0,this._root=new Qe(0,0,0),this._statisticFields=e,this._pool=t?new ee.Z(8096):null}_acquire(e,t,s){this._nodes++;let r=null;return(0,c.pC)(this._pool)&&(r=this._pool.dequeue()),(0,c.pC)(r)?r.realloc(e,t,s):new Qe(e,t,s)}_release(e){this._nodes--,(0,c.pC)(this._pool)&&this._pool.enqueue(e)}get count(){return this._root.count}get size(){return this._nodes}get poolSize(){return(0,c.R2)(this._pool,0,(e=>e.size))}get depth(){let e=0;return this._forEachNode((t=>e=Math.max(e,t.depth))),e}dropLevels(e){this._forEachNode((t=>{if(t.depth>=e)for(let e=0;e<t.children.length;e++){const s=t.children[e];t.children[e]=null,s&&this._release(s)}}))}clear(){this.dropLevels(0)}insert(e,t,s=0){const r=F.fromOptimizedFeatures([e],"esriGeometryPoint").getCursor();r.next();const i=r.readGeometry();if(!i)return;const[n,o]=i.coords,a=e.geohashX,h=e.geohashY;this.insertCursor(r,e.displayId,n,o,a,h,t,s)}insertCursor(e,t,s,r,i,n,o,a=0){let h=this._root,c=0,u=0,l=0;for(;null!==h;){if(h.depth>=a&&(h.count+=1,h.xTotal+=s,h.yTotal+=r,h.xGeohashTotal+=i,h.yGeohashTotal+=n,h.displayId=t,this._updateStatisticsCursor(e,h,1)),c>=o)return void h.add(t);const d=Math.ceil((c+1)/2),p=Math.floor((c+1)/2),g=1-c%2,_=30-(3*d+2*p),f=30-(2*d+3*p),m=(i&7*g+3*(1-g)<<_)>>_,y=(n&3*g+7*(1-g)<<f)>>f,I=m+y*(8*g+4*(1-g));u=u<<3*g+2*(1-g)|m,l=l<<2*g+3*(1-g)|y,null==h.children[I]&&(h.children[I]=this._acquire(u,l,c+1)),c+=1,h=h.children[I]}}remove(e,t){const s=F.fromOptimizedFeatures([e],"esriGeometryPoint").getCursor();s.next();const r=s.readGeometry();if(!r)return;const[i,n]=r.coords,o=e.geohashX,a=e.geohashY;this.removeCursor(s,i,n,o,a,t)}removeCursor(e,t,s,r,i,n){let o=this._root,a=0;for(;null!==o;){if(o.count-=1,o.xTotal-=t,o.yTotal-=s,o.xGeohashTotal-=r,o.yGeohashTotal-=i,this._updateStatisticsCursor(e,o,-1),a>=n)return void o.remove(e.getDisplayId());const h=Math.ceil((a+1)/2),c=Math.floor((a+1)/2),u=1-a%2,l=30-(3*h+2*c),d=30-(2*h+3*c),p=((r&7*u+3*(1-u)<<l)>>l)+((i&3*u+7*(1-u)<<d)>>d)*(8*u+4*(1-u)),g=o.children[p];1===g.count&&(this._release(g),o.children[p]=null),a+=1,o=g}}find(e,t,s){return this._root.find(e,t,s,0,0,0)}findSingleOccupancyNode(e,t,s,r,i){let n=this._root;for(;null!==n;){const o=n.depth,a=n.xNode,h=n.yNode,c=1-o%2,u=n.xGeohashTotal/n.count,l=n.yGeohashTotal/n.count;if(1===n.count&&e<u&&u<=s&&t<l&&l<=r)return n;if(o>=i){n=n.next;continue}const d=Math.ceil((o+1)/2),p=Math.floor((o+1)/2),g=30-(3*d+2*p),_=30-(2*d+3*p),f=~((1<<g)-1),m=~((1<<_)-1),y=(e&f)>>g,I=(t&m)>>_,x=(s&f)>>g,b=(r&m)>>_,w=a<<3*c+2*(1-c),v=h<<2*c+3*(1-c),S=w+8*c+4*(1-c),T=v+4*c+8*(1-c),C=Math.max(w,y),F=Math.max(v,I),E=Math.min(S,x),A=Math.min(T,b);let M=null,k=null;for(let e=F;e<=A;e++)for(let t=C;t<=E;t++){const s=t-w+(e-v)*(8*c+4*(1-c)),r=n.children[s];r&&(M||(M=r,M.next=n.next),k&&(k.next=r),k=r,r.next=n.next)}n=M||n.next}return null}getRegionDisplayIds(e,t,s,r,i){let n=this._root;const o=[];for(;null!==n;){const a=n.depth,h=n.xNode,c=n.yNode;if(a>=i){const i=n.xGeohashTotal/n.count,a=n.yGeohashTotal/n.count;e<=i&&i<=s&&t<=a&&a<=r&&n.displayIds.forEach((e=>o.push(e))),n=n.next;continue}const u=Math.ceil((a+1)/2),l=Math.floor((a+1)/2),d=1-a%2,p=30-(3*u+2*l),g=30-(2*u+3*l),_=~((1<<p)-1),f=~((1<<g)-1),m=(e&_)>>p,y=(t&f)>>g,I=(s&_)>>p,x=(r&f)>>g,b=h<<3*d+2*(1-d),w=c<<2*d+3*(1-d),v=b+8*d+4*(1-d),S=w+4*d+8*(1-d),T=Math.max(b,m),C=Math.max(w,y),F=Math.min(v,I),E=Math.min(S,x);let A=null,M=null;for(let e=C;e<=E;e++)for(let t=T;t<=F;t++){const s=t-b+(e-w)*(8*d+4*(1-d)),r=n.children[s];r&&(A||(A=r,A.next=n.next),M&&(M.next=r),M=r,r.next=n.next)}n=A||n.next}return o}getRegionStatistics(e,t,s,r,i){let n=this._root,o=0,a=0,h=0;const c={};let u=0;for(;null!==n;){const l=n.depth,d=n.xNode,p=n.yNode;if(l>=i){const i=n.xGeohashTotal/n.count,l=n.yGeohashTotal/n.count;e<i&&i<=s&&t<l&&l<=r&&(o+=n.count,a+=n.xTotal,h+=n.yTotal,1===n.count&&(u=n.displayId),this._aggregateStatistics(c,n.statistics)),n=n.next;continue}const g=Math.ceil((l+1)/2),_=Math.floor((l+1)/2),f=1-l%2,m=30-(3*g+2*_),y=30-(2*g+3*_),I=~((1<<m)-1),x=~((1<<y)-1),b=(e&I)>>m,w=(t&x)>>y,v=(s&I)>>m,S=(r&x)>>y,T=d<<3*f+2*(1-f),C=p<<2*f+3*(1-f),F=T+8*f+4*(1-f),E=C+4*f+8*(1-f),A=Math.max(T,b),M=Math.max(C,w),k=Math.min(F,v),R=Math.min(E,S);let O=null,L=null;for(let i=M;i<=R;i++)for(let l=A;l<=k;l++){const d=l-T+(i-C)*(8*f+4*(1-f)),p=n.children[d];if(p){if(i!==M&&i!==R&&l!==A&&l!==k){const i=p.xGeohashTotal/p.count,n=p.yGeohashTotal/p.count;e<i&&i<=s&&t<n&&n<=r&&(o+=p.count,a+=p.xTotal,h+=p.yTotal,1===p.count&&(u=p.displayId),this._aggregateStatistics(c,p.statistics));continue}O||(O=p,O.next=n.next),L&&(L.next=p),L=p,p.next=n.next}}n=O||n.next}return{count:o,attributes:this._normalizeStatistics(c,o),xTotal:a,yTotal:h,referenceId:u}}_forEachNode(e){let t=this._root;for(;null!==t;){const s=this._linkChildren(t)||t.next;e(t),t=s}}_linkChildren(e){let t=null,s=null;for(let r=0;r<=e.children.length;r++){const i=e.children[r];i&&(t||(t=i,t.next=e.next),s&&(s.next=i),s=i,i.next=e.next)}return t}_updateStatisticsCursor(e,t,s){for(const r of this._statisticFields){const i=r.name,n=r.inField?e.readAttribute(r.inField):e.getComputedNumericAtIndex(r.inFieldIndex);switch(r.statisticType){case"norm":{t.statistics[i]||(t.statistics[i]={});const o=r.inNormalizationField,a=e.readAttribute(o),h=t.statistics[i].onStatisticField||0,c=t.statistics[i].onStatisticNormalizationField||0;null==n||isNaN(n)||null==a||0===a||isNaN(a)||(t.statistics[i].onStatisticField=h+s*n,t.statistics[i].onStatisticNormalizationField=c+s*a);break}case"sum":case"avg":{t.statistics[i]||(t.statistics[i]={value:0,nanCount:0});const e=t.statistics[i].value,r=t.statistics[i].nanCount;null==n||isNaN(n)?t.statistics[i].nanCount=r+s:t.statistics[i].value=e+s*n;break}case"avg_angle":{t.statistics[i]||(t.statistics[i]={x:0,y:0,nanCount:0});const e=t.statistics[i].x,r=t.statistics[i].y,o=t.statistics[i].nanCount,a=Math.PI/180;null==n||isNaN(n)?t.statistics[i].nanCount=o+s:(t.statistics[i].x=e+s*Math.cos(n*a),t.statistics[i].y=r+s*Math.sin(n*a));break}case"mode":{t.statistics[i]||(t.statistics[i]={});const e=t.statistics[i][n]||0;t.statistics[i][n]=e+s;break}}}}_aggregateStatistics(e,t){for(const s of this._statisticFields){const r=s.name;switch(s.statisticType){case"sum":case"avg":case"avg_angle":case"mode":case"norm":e[r]||(e[r]={});for(const s in t[r]){const i=e[r][s]||0;e[r][s]=i+t[r][s]}}}}_normalizeStatistics(e,t){const s={};for(const r of this._statisticFields){const i=r.name;switch(r.statisticType){case"norm":{const r=e[i];if(t&&null==r.onStatisticNormalizationField)break;if(t&&r.onStatisticNormalizationField){s[i]=r.onStatisticField/r.onStatisticNormalizationField;break}s[i]=0;break}case"sum":{if(!t)break;const{value:r,nanCount:n}=e[i];if(!(t-n))break;s[i]=r;break}case"avg":{if(!t)break;const{value:r,nanCount:n}=e[i];if(!(t-n))break;s[i]=r/(t-n);break}case"avg_angle":{if(!t)break;const{x:r,y:n,nanCount:o}=e[i];if(!(t-o))break;const a=r/(t-o),h=n/(t-o),c=180/Math.PI,u=Math.atan2(h,a)*c;s[i]=u;break}case"mode":{const t=e[i];let r=0,n=null;for(const e in t){const s=t[e];s>r&&(r=s,n=e)}s[i]="null"===n?null:n;break}}}return s}}class Qe{constructor(e,t,s){this.count=0,this.xTotal=0,this.yTotal=0,this.statistics={},this.displayId=0,this.displayIds=new Set,this.next=null,this.depth=0,this.xNode=0,this.yNode=0,this.xGeohashTotal=0,this.yGeohashTotal=0,this.children=new Array(32);for(let e=0;e<this.children.length;e++)this.children[e]=null;this.xNode=e,this.yNode=t,this.depth=s}realloc(e,t,s){for(let e=0;e<this.children.length;e++)this.children[e]=null;return this.xNode=e,this.yNode=t,this.depth=s,this.next=null,this.xGeohashTotal=0,this.yGeohashTotal=0,this.xTotal=0,this.yTotal=0,this.count=0,this.statistics={},this.displayIds.clear(),this}add(e){this.displayIds.add(e)}remove(e){this.displayIds.delete(e)}getLngLatBounds(){const e=this.depth,t=Math.ceil(e/2),s=Math.floor(e/2),r=30-(3*t+2*s),i=30-(2*t+3*s);return function(e,t){let s=-90,r=90,i=-180,n=180;for(let o=0;o<t;o++){const t=Math.ceil((o+1)/2),a=Math.floor((o+1)/2),h=1-o%2,c=30-(3*t+2*a),u=30-(2*t+3*a),l=2*h+3*(1-h),d=(7*h+3*(1-h)<<c&e.geohashX)>>c,p=(3*h+7*(1-h)<<u&e.geohashY)>>u;for(let e=3*h+2*(1-h)-1;e>=0;e--){const t=(i+n)/2,s=d&1<<e?1:0;i=(1-s)*i+s*t,n=(1-s)*t+s*n}for(let e=l-1;e>=0;e--){const t=(s+r)/2,i=p&1<<e?1:0;s=(1-i)*s+i*t,r=(1-i)*t+i*r}}return[i,s,n,r]}({geohashX:this.xNode<<r,geohashY:this.yNode<<i},this.depth)}find(e,t,s,r,i,n){if(r>=s)return this;const o=1-r%2,a=3*o+2*(1-o),h=2*o+3*(1-o),c=30-i-a,u=30-n-h,l=((e&7*o+3*(1-o)<<c)>>c)+((t&3*o+7*(1-o)<<u)>>u)*(8*o+4*(1-o)),d=this.children[l];return null==d?null:d.find(e,t,s,r+1,i+a,n+h)}}var $e=s(68441),Je=s(8744),Ke=s(37427),et=s(59999);class tt extends T.nd{constructor(e,t,s,r,i){super(new A.Z([],[t,s]),r,null,e),this.geohashBoundsInfo=i}get count(){return this.attributes.cluster_count}static create(e,t,s,r,i,n,o,a){const h=new tt(t,s,r,n,o);return h.displayId=e.createDisplayId(!0),h.referenceId=a,h.tileLevel=i,h}update(e,t,s,r,i,n){return this.geometry.coords[0]=e,this.geometry.coords[1]=t,this.tileLevel=s,this.attributes=r,this.geohashBoundsInfo=i,this.referenceId=null,this.referenceId=n,this}toJSON(){return{objectId:this.objectId,referenceId:1===this.attributes.cluster_count?this.referenceId:null,attributes:{...this.attributes,clusterId:this.objectId},geometry:{x:this.geometry.coords[0],y:this.geometry.coords[1]}}}}function st(e){return 57.29577951308232*e}class rt extends et.J{constructor(e,t,s){super(e,s),this.events=new $.Z,this._geohashLevel=0,this._tileLevel=0,this._aggregateValueRanges={},this._aggregateValueRangesChanged=!1,this._geohashBuf=[],this._clusters=new Map,this._tiles=new Map,this.geometryInfo=e.geometryInfo,this._spatialReference=t,this._projectionSupportCheck=(0,Ke._W)(t,we.Z.WGS84),this._bitsets.geohash=s.getBitset(s.createBitset()),this._bitsets.inserted=s.getBitset(s.createBitset())}async updateSchema(e,t){const s=this._schema;try{await super.updateSchema(e,t),await this._projectionSupportCheck}catch(e){}const r=(0,J.Hg)(s,t);t&&(!(0,c.Wi)(r)||e.source||e.storage.filters)?(((0,J.uD)(r,"params.fields")||!this._tree||e.source)&&(this._tree=new He(this._statisticFields),this._rebuildTree(),(0,n.Z)("esri-2d-update-debug")&&console.debug("Aggregate mesh needs update due to tree changing")),(0,n.Z)("esri-2d-update-debug")&&console.debug("Applying Update - ClusterStore:",r),e.targets[t.name]=!0,e.mesh=!1,this._aggregateValueRanges={}):s&&(e.mesh=!0)}clear(){this._rebuildTree()}sweepFeatures(e,t){this._bitsets.inserted.forEachSet((s=>{if(!e.has(s)){const e=t.lookupByDisplayIdUnsafe(s);this._remove(e)}}))}sweepClusters(e,t,s){this._clusters.forEach(((r,i)=>{r&&r.tileLevel!==s&&(e.releaseDisplayId(r.displayId),t.unsetAttributeData(r.displayId),this._clusters.delete(i))}))}onTileData(e,t,s,r,i=!0){if(!this._schema||(0,c.Wi)(t.addOrUpdate))return t;const n=this._getTransforms(e,this._spatialReference);{const e=t.addOrUpdate.getCursor();for(;e.next();)this._update(e,r)}if(t.status.mesh||!i)return t;const o=new Array,a=this._schema.params.clusterRadius;this._getClustersForTile(o,e,a,s,n),t.addOrUpdate=F.fromOptimizedFeatures(o,"esriGeometryPoint"),t.addOrUpdate.attachStorage(s),t.end=!0;{const r=t.addOrUpdate.getCursor();for(;r.next();){const t=r.getDisplayId();this._bitsets.computed.unset(t),this.setComputedAttributes(s,r,t,e.scale)}}return this._aggregateValueRangesChanged&&t.end&&(this.events.emit("valueRangesChanged",{valueRanges:this._aggregateValueRanges}),this._aggregateValueRangesChanged=!1),t}onTileUpdate({added:e,removed:t}){if(e.length){const t=e[0].level;this._tileLevel=t,this._setGeohashLevel(t)}if(!this._schema)return;const s=this._schema.params.clusterRadius;t.forEach((e=>{this._tiles.delete(e.key.id),this._markTileClustersForDeletion(e,s)}))}getAggregate(e){for(const t of this._clusters.values())if((null==t?void 0:t.displayId)===e)return t.toJSON();return null}getAggregates(){const e=[];for(const t of this._clusters.values())(null==t?void 0:t.tileLevel)===this._tileLevel&&e.push(t.toJSON());return e}getDisplayId(e){const t=this._clusters.get(e);return t?t.displayId:null}getFeatureDisplayIdsForAggregate(e){const t=this._clusters.get(e);if(!t)return[];const s=t.geohashBoundsInfo;return this._tree.getRegionDisplayIds(s.xLL,s.yLL,s.xTR,s.yTR,s.level)}getDisplayIdForReferenceId(e){for(const t of this._clusters.values())if((null==t?void 0:t.referenceId)===e)return t.displayId;return null}getAggregateValueRanges(){return this._aggregateValueRanges}forEach(e){for(const[t,s]of this._clusters)s&&e(s,t)}size(){let e=0;return this.forEach((t=>e++)),e}_rebuildTree(){this._bitsets.computed.clear(),this._bitsets.inserted.clear(),this._tree&&this._tree.clear()}_remove(e){const t=e.getDisplayId(),s=e.getXHydrated(),r=e.getYHydrated(),i=this._geohashBuf[2*t],n=this._geohashBuf[2*t+1];this._bitsets.inserted.has(t)&&(this._bitsets.inserted.unset(t),this._tree.removeCursor(e,s,r,i,n,this._geohashLevel))}_update(e,t){const s=e.getDisplayId(),r=this._bitsets.inserted,i=t.isVisible(s);if(i===r.has(s))return;if(!i)return void this._remove(e);const n=e.getXHydrated(),o=e.getYHydrated();if(!this._setGeohash(s,n,o))return;const a=this._geohashBuf[2*s],h=this._geohashBuf[2*s+1];this._tree.insertCursor(e,s,n,o,a,h,this._geohashLevel),r.set(s)}_setGeohash(e,t,s){if(this._bitsets.geohash.has(e))return!0;const r=this._geohashBuf;if(this._spatialReference.isWebMercator){const i=st(t/$e.sv.radius),n=i-360*Math.floor((i+180)/360);Ve(r,e,st(Math.PI/2-2*Math.atan(Math.exp(-s/$e.sv.radius))),n,12)}else{const i=(0,Ke.iV)({x:t,y:s},this._spatialReference,we.Z.WGS84);if(!i)return!1;Ve(r,e,i.y,i.x,12)}return this._bitsets.geohash.set(e),!0}_getClustersForTile(e,t,s,r,i,n=!0){const o=this._schema.params.clusterPixelBuffer,a=2*s,h=this._getGeohashLevel(t.key.level),u=Math.ceil(2**t.key.level*De.I_/a),l=Math.ceil(o/a)+0,p=Math.ceil(De.I_/a),{row:g,col:_}=t.key,f=_*De.I_,m=g*De.I_,y=Math.floor(f/a)-l,I=Math.floor(m/a)-l,x=y+p+2*l,b=I+p+2*l,w=t.tileInfoView.getLODInfoAt(t.key.level);for(let s=y;s<=x;s++)for(let o=I;o<=b;o++){let a=s;w.wrap&&(a=s<0?s+u:s%u);const l=w.wrap&&s<0,p=w.wrap&&s%u!==s,g=this._lookupCluster(r,w,t.key.level,a,o,h);if((0,c.pC)(g)){const t=(0,c.Po)(i,(e=>l?e.left:p?e.right:e.tile));if(n&&(0,c.Wi)(t))continue;if(!g.count)continue;if((0,c.pC)(t)&&n){const s=g.geometry.clone();let r=g.attributes;s.coords[0]=(0,d.Jd)(t,s.coords[0]),s.coords[1]=(0,d.IN)(t,s.coords[1]),1===g.count&&(0,c.pC)(g.referenceId)&&(r={...g.attributes,referenceId:g.referenceId});const i=new T.ZP(s,r);i.displayId=g.displayId,e.push(i)}}}}_getGeohashLevel(e){return Math.min(Math.ceil(e/2+2),12)}_setGeohashLevel(e){const t=this._getGeohashLevel(e),s=1*(Math.floor(t/1)+1)-1;if(this._geohashLevel!==s)return this._geohashLevel=s,this._rebuildTree(),void this._bitsets.geohash.clear()}_getTransforms(e,t){const s={originPosition:"upperLeft",scale:[e.resolution,e.resolution],translate:[e.bounds[0],e.bounds[3]]},r=(0,Je.C5)(t);if(!r)return{tile:s,left:null,right:null};const[i,n]=r.valid;return{tile:s,left:{...s,translate:[n,e.bounds[3]]},right:{...s,translate:[i-n+e.bounds[0],e.bounds[3]]}}}_getClusterId(e,t,s){return(15&e)<<28|(16383&t)<<14|16383&s}_markForDeletion(e,t,s){const r=this._getClusterId(e,t,s);this._clusters.delete(r)}_getClusterBounds(e,t,s){const r=this._schema.params.clusterRadius,i=2*r;let n=s%2?t*i:t*i-r;const o=s*i;let a=n+i;const h=o-i,c=2**e.level*De.I_;e.wrap&&n<0&&(n=0),e.wrap&&a>c&&(a=c);const u=n/De.I_,l=o/De.I_,d=a/De.I_,p=h/De.I_;return[e.getXForColumn(u),e.getYForRow(l),e.getXForColumn(d),e.getYForRow(p)]}_lookupCluster(e,t,s,r,i,n){const o=this._getClusterId(s,r,i),a=this._clusters.get(o),[h,u,l,d]=this._getClusterBounds(t,r,i),p={x:h,y:u},g={x:l,y:d};let _=0,f=0,m=0,y=0;if(this._spatialReference.isWebMercator){{const e=st(p.x/$e.sv.radius);_=e-360*Math.floor((e+180)/360),f=st(Math.PI/2-2*Math.atan(Math.exp(-p.y/$e.sv.radius)))}{const e=st(g.x/$e.sv.radius);m=e-360*Math.floor((e+180)/360),y=st(Math.PI/2-2*Math.atan(Math.exp(-g.y/$e.sv.radius)))}}else{const e=(0,Ke.iV)(p,this._spatialReference,we.Z.WGS84),t=(0,Ke.iV)(g,this._spatialReference,we.Z.WGS84);if(!e||!t)return null;_=e.x,f=e.y,m=t.x,y=t.y}const I={geohashX:0,geohashY:0},x={geohashX:0,geohashY:0};Ye(I,f,_,n),Ye(x,y,m,n);const b=I.geohashX,w=I.geohashY,v=x.geohashX,S=x.geohashY,T={xLL:b,yLL:w,xTR:v,yTR:S,level:n},C=this._tree.getRegionStatistics(b,w,v,S,n),{count:F,xTotal:E,yTotal:A,referenceId:M}=C,k=F?E/F:0,R=F?A/F:0;if(0===F)return this._clusters.set(o,null),null;const O={cluster_count:F,...C.attributes},L=(0,c.pC)(a)?a.update(k,R,s,O,T,M):tt.create(e,o,k,R,s,O,T,M);return 0===F&&(L.geometry.coords[0]=(h+l)/2,L.geometry.coords[1]=(u+d)/2),this._clusters.set(o,L),this._updateAggregateValueRangeForCluster(L,L.tileLevel),L}_updateAggregateValueRangeForCluster(e,t){const s=this._aggregateValueRanges[t]||{minValue:1/0,maxValue:0},r=s.minValue,i=s.maxValue;s.minValue=Math.min(r,e.count),s.maxValue=Math.max(i,e.count),this._aggregateValueRanges[t]=s,r===s.minValue&&i===s.maxValue||(this._aggregateValueRangesChanged=!0)}_markTileClustersForDeletion(e,t){const s=2*t,r=Math.ceil(De.I_/s),{row:i,col:n}=e.key,o=n*De.I_,a=i*De.I_,h=Math.floor(o/s),c=Math.floor(a/s);for(let t=h;t<h+r;t++)for(let s=c;s<c+r;s++)this._markForDeletion(e.key.level,t,s)}}class it{constructor(){this._freeIds=[],this._idCounter=1}createId(e=!1){return(0,_.QS)(this._getFreeId(),e)}releaseId(e){this._freeIds.push(e)}_getFreeId(){return this._freeIds.length?this._freeIds.pop():this._idCounter++}}var nt=s(93054);function ot(e,t,s){if(!(e.length>t))for(;e.length<=t;)e.push(s)}class at{constructor(){this._numerics=[],this._strings=[],this._idGenerator=new it,this._allocatedSize=256,this._bitsets=[],this._instanceIds=[],this._bounds=[]}createBitset(){const e=this._bitsets.length;return this._bitsets.push(nt.p.create(this._allocatedSize,_._I)),e+1}getBitset(e){return this._bitsets[e-1]}_expand(){this._allocatedSize<<=1;for(const e of this._bitsets)e.resize(this._allocatedSize)}_ensureNumeric(e,t){this._numerics[e]||(this._numerics[e]=[]),ot(this._numerics[e],t,0)}_ensureInstanceId(e){ot(this._instanceIds,e,0)}_ensureString(e,t){this._strings[e]||(this._strings[e]=[]),ot(this._strings[e],t,null)}createDisplayId(e=!1){const t=this._idGenerator.createId();return t>this._allocatedSize&&this._expand(),(0,_.QS)(t,e)}releaseDisplayId(e){for(const t of this._bitsets)t.unset(e);return this._idGenerator.releaseId(e&_._I)}getComputedNumeric(e,t){return this.getComputedNumericAtIndex(e&_._I,0)}setComputedNumeric(e,t,s){return this.setComputedNumericAtIndex(e&_._I,s,0)}getComputedString(e,t){return this.getComputedStringAtIndex(e&_._I,0)}setComputedString(e,t,s){return this.setComputedStringAtIndex(e&_._I,0,s)}getComputedNumericAtIndex(e,t){const s=e&_._I;return this._ensureNumeric(t,s),this._numerics[t][s]}setComputedNumericAtIndex(e,t,s){const r=e&_._I;this._ensureNumeric(t,r),this._numerics[t][r]=s}getInstanceId(e){const t=e&_._I;return this._ensureInstanceId(t),this._instanceIds[t]}setInstanceId(e,t){const s=e&_._I;this._ensureInstanceId(s),this._instanceIds[s]=t}getComputedStringAtIndex(e,t){const s=e&_._I;return this._ensureString(t,s),this._strings[t][s]}setComputedStringAtIndex(e,t,s){const r=e&_._I;this._ensureString(t,r),this._strings[t][r]=s}getXMin(e){return this._bounds[4*(e&_._I)]}getYMin(e){return this._bounds[4*(e&_._I)+1]}getXMax(e){return this._bounds[4*(e&_._I)+2]}getYMax(e){return this._bounds[4*(e&_._I)+3]}setBounds(e,t){const s=t.readHydratedGeometry();if(!s||!s.coords.length)return!1;let r=1/0,i=1/0,n=-1/0,o=-1/0;s.forEachVertex(((e,t)=>{r=Math.min(r,e),i=Math.min(i,t),n=Math.max(n,e),o=Math.max(o,t)}));const a=e&_._I;return ot(this._bounds,4*a+4,0),this._bounds[4*a]=r,this._bounds[4*a+1]=i,this._bounds[4*a+2]=n,this._bounds[4*a+3]=o,!0}}function ht(e){if(!(0,u.D_)(e)&&!function(e){return"worker:port-closed"===e.name}(e))throw e}function ct(e){return"feature"===e.type&&"snapshot"===e.mode}let ut=class extends i.r{constructor(){super(...arguments),this._storage=new at,this._markedIdsBufId=this._storage.createBitset(),this._lastCleanup=performance.now(),this._cleanupNeeded=!1,this._invalidated=!1,this._tileToResolver=new Map,this._didEdit=!1,this.tileStore=null,this.config=null,this.processor=null,this.remoteClient=null,this.service=null}initialize(){this._initAttributeStore(),this._initStores(),this._initQueryEngine(),this._initSource(),this._updateQueue=new ie.e({concurrency:"geoevent"===this._source.type?1:4,process:(e,t)=>this._onTileMessage(e,{signal:t})}),this.handles.add([this.tileStore.on("update",this.onTileUpdate.bind(this)),this.watch("updating",(e=>!e&&this.onIdle()))]),this._checkUpdating=setInterval((()=>this.notifyChange("updating")),300)}async startup(){this._initAttributeStore()}_initSource(){const e=this.tileStore.tileScheme;this._source=function(e,t,s,r,i,n){const o=function(e,t,s,r,i,n){switch(e.type){case"snapshot":return{type:"feature",origin:"snapshot",featureCount:(0,c.Pt)(e.featureCount,0),serviceInfo:e,onMessage:r,outSR:t,tileInfoView:s,canAcceptRequest:i,store:n};case"stream":return{type:"geoevent",serviceInfo:e,onMessage:r,outSR:t,canAcceptRequest:i};case"memory":case"on-demand":return{type:"feature",serviceInfo:e,onMessage:r,outSR:t,origin:function(e){return Array.isArray(e)?"local":"path"in e&&(0,m.M8)(e.path)?"hosted":"unknown"}(e.source),tileInfoView:s,canAcceptRequest:i}}}(e,t,s,r,i,n);switch(o.type){case"feature":switch(o.origin){case"hosted":case"local":return new ke(o);case"snapshot":return new Ue(o);case"unknown":return new ce(o)}case"geoevent":return new Ae(o)}}(this.service,this.spatialReference,e,((e,t)=>(this._invalidated=!0,this._patchTile(e,t))),(()=>this._updateQueue.length<50),this.featureStore),this._proxyEvents()}_proxyEvents(){if("geoevent"===this._source.type){const e=this._source.events;this.handles.add([e.on("connectionStatus",(e=>this.remoteClient.invoke("setProperty",{propertyName:"connectionStatus",value:e}).catch(ht))),e.on("errorString",(e=>this.remoteClient.invoke("setProperty",{propertyName:"errorString",value:e}).catch(ht))),e.on("feature",(e=>this.remoteClient.invoke("emitEvent",{name:"data-received",event:{attributes:e.attributes,centroid:e.centroid,geometry:e.geometry}}).catch(ht))),e.on("updateRate",(e=>this.remoteClient.invoke("emitEvent",{name:"update-rate",event:{...e}}).catch(ht)))])}}_initAttributeStore(){this.attributeStore?this.attributeStore.invalidateResources():this.attributeStore=new We({type:"remote",initialize:(e,t)=>(0,u.R8)(this.remoteClient.invoke("tileRenderer.featuresView.attributeView.initialize",e,{signal:t}).catch(ht)),update:(e,t)=>(0,u.R8)(this.remoteClient.invoke("tileRenderer.featuresView.attributeView.requestUpdate",e,{signal:t}).catch(ht)),render:e=>(0,u.R8)(this.remoteClient.invoke("tileRenderer.featuresView.requestRender",void 0,{signal:e}).catch(ht))},this.config)}_initStores(){const e="snapshot"===this.service.type?"snapshot":"on-demand",t={geometryInfo:{geometryType:this.service.geometryType,hasM:!1,hasZ:!1},spatialReference:this.spatialReference,fieldsIndex:this.fieldsIndex,fields:this.service.fields};this.featureStore=new f.p(t,this._storage,e),this.aggregateStore=new rt(t,this.spatialReference,this._storage),this.handles.add(this.aggregateStore.events.on("valueRangesChanged",(e=>{this.remoteClient.invoke("emitEvent",{name:"valueRangesChanged",event:{valueRanges:e.valueRanges}}).catch(ht)})))}_initQueryEngine(){var e;const t=this;null==(e=this.queryEngine)||e.destroy(),this.queryEngine=new p.Z({definitionExpression:this.config.definitionExpression,fields:this.service.fields,geometryType:this.service.geometryType,objectIdField:this.service.objectIdField,hasM:!1,hasZ:!1,spatialReference:this.spatialReference.toJSON(),cacheSpatialQueries:!0,featureStore:this.featureStore,aggregateAdapter:{getFeatureObjectIds:e=>t.aggregateStore.getFeatureDisplayIdsForAggregate(e).map((e=>t.getObjectId(e)))},timeInfo:this.service.timeInfo})}destroy(){this._updateQueue.destroy(),this._source.destroy(),this.queryEngine.destroy(),this.attributeStore&&this.attributeStore.destroy();for(const e of this.tileStore.tiles)this._source.unsubscribe(e);clearInterval(this._checkUpdating)}get fieldsIndex(){return new g.Z(this.service.fields)}get hasAggregates(){return!!this.config.schema.targets.aggregate}get spatialReference(){return this.tileStore.tileScheme.spatialReference}get updating(){return this.isUpdating()}isUpdating(){return this._source.updating||!!this._updateQueue.length}enableEvent(e){this._source.enableEvent(e.name,e.value)}pause(){this._updateQueue.pause(),this._updateQueue.clear()}async update(e,t){this._set("config",t),this._schema=t.schema,this._initQueryEngine(),await Promise.all([this._source.update(e,t.schema.source),this.featureStore.updateSchema(e,t.schema.targets.feature),this.attributeStore.update(e,t),this.attributeStore.updateFilters(e,this)]),await this.aggregateStore.updateSchema(e,t.schema.targets.aggregate),(0,n.Z)("esri-2d-update-debug")&&e.describe()}async applyUpdate(e){e.mesh&&this.clearTiles(),this._updateQueue.resume(),await this._source.applyUpdate(e),this.notifyChange("updating"),await(0,l.OY)(this,"updating",!0),this.hasAggregates&&(await(0,u.e4)(10),await(0,l.OY)(this,"updating",!0))}async onEdits({edits:e}){(0,n.Z)("esri-2d-update-debug")&&console.debug("Applying Edit:",e),this._didEdit=!0;try{const t=e.removed.map((e=>e.objectId&&-1!==e.objectId?e.objectId:this._lookupObjectIdByGlobalId(e.globalId))),s=e.addOrModified.map((({objectId:e})=>e));this.featureStore.invalidate(),await this._source.edit(s,t),this.clearTiles(),this.notifyChange("updating"),this.aggregateStore.clear(),await this._source.resend(),await(0,l.OY)(this,"updating",!0)}catch(e){}}async refresh(e){if(!e){const e=te.empty();return e.storage.filters=!0,this.applyUpdate(e)}this.featureStore.invalidate(),this.clearTiles(),this._source.refresh(),this._cleanupNeeded=!0,this.notifyChange("updating"),await(0,l.OY)(this,"updating",!0)}clearTiles(){for(const e of this.tileStore.tiles)this.processor.onTileClear(e)}onTileUpdate(e){this.aggregateStore.onTileUpdate(e);for(const t of e.added)this._source.subscribe(t),this._level=t.level;for(const t of e.removed)this._source.unsubscribe(t),this._cleanupNeeded=!0,this._tileToResolver.has(t.id)&&(this._tileToResolver.get(t.id).resolve(),this._tileToResolver.delete(t.id));this.notifyChange("updating")}onIdle(){this._invalidated&&((this.hasAggregates||"heatmap"===this.processor.type)&&this._repushCurrentLevelTiles(),this._invalidated=!1),this._markAndSweep()}async querySummaryStatistics({query:e,params:t}){return this.queryEngine.executeQueryForSummaryStatistics(e,t)}async queryUniqueValues({query:e,params:t}){return this.queryEngine.executeQueryForUniqueValues(e,t)}async queryClassBreaks({query:e,params:t}){return this.queryEngine.executeQueryForClassBreaks(e,t)}async queryHistogram({query:e,params:t}){return this.queryEngine.executeQueryForHistogram(e,t)}queryExtent(e){return this.queryEngine.executeQueryForExtent(e)}queryFeatures(e){return this.queryEngine.executeQuery(e)}async queryVisibleFeatures(e){const t=await this.queryEngine.executeQuery(e),s=t.objectIdFieldName;return t.features=t.features.filter((e=>{const t=e.attributes[s],r=this.getDisplayId(t);return this.attributeStore.isVisible(r)})),t}queryFeatureCount(e){return this.queryEngine.executeQueryForCount(e)}queryLatestObservations(e){return this.queryEngine.executeQueryForLatestObservations(e)}queryObjectIds(e){return this.queryEngine.executeQueryForIds(e)}async queryStatistics(){return this.featureStore.storeStatistics}getObjectId(e){return this.featureStore.lookupObjectId(e,this._storage)}getDisplayId(e){if(this._schema.targets.aggregate){const t=this.aggregateStore.getDisplayId(e);if((0,c.Wi)(t)){const t=this.featureStore.lookupDisplayId(e);return this.aggregateStore.getDisplayIdForReferenceId(t)}return t}return this.featureStore.lookupDisplayId(e)}getFeatures(e){const t=[],s=[];for(const r of e)if((0,_.nE)(r)){const e=this.getAggregate(r);if((0,c.pC)(e))if((0,c.pC)(e.referenceId)){const s=this.getFeature(e.referenceId);(0,c.pC)(s)&&t.push(s)}else s.push(e)}else{const e=this.getFeature(r);(0,c.pC)(e)&&t.push(e)}return{features:t,aggregates:s}}getFeature(e){const t=this.featureStore.lookupFeatureByDisplayId(e,this._storage);if((0,c.Wi)(t))return null;const s=t.readHydratedGeometry(),r=(0,d.di)(s,t.geometryType,t.hasZ,t.hasM);return{attributes:t.readAttributes(),geometry:r}}getAggregate(e){return this.aggregateStore.getAggregate(e)}getAggregates(){return this.aggregateStore.getAggregates()}async setHighlight(e){const t=e.map((e=>this.getDisplayId(e)));return this.attributeStore.setHighlight(e,t)}_lookupObjectIdByGlobalId(e){const t=this.service.globalIdField;if((0,c.Wi)(t))throw new Error("Expected globalIdField to be defined");let s=null;if(this.featureStore.forEach((r=>{e===r.readAttribute(t)&&(s=r.getObjectId())})),(0,c.Wi)(s))throw new Error(`Expected to find a feature with globalId ${e}`);return s}_repushCurrentLevelTiles(){const e=this.tileStore.tiles.filter((e=>e.level===this._level));for(const t of e)this._patchTile({type:"append",id:t.key.id,addOrUpdate:F.fromOptimizedFeatures([],this.service.geometryType),remove:[],end:!0,status:te.empty()})}_maybeForceCleanup(){performance.now()-this._lastCleanup>5e3&&this._markAndSweep()}_patchTile(e,t){const s=this._updateQueue.push(e,t).then((()=>{this.notifyChange("updating")})).catch((e=>{this.notifyChange("updating")}));return this.notifyChange("updating"),s}async _onTileMessage(e,t){(0,u.k_)(t);const s=this.tileStore.get(e.id);if(!s)return;if(e.clear)return this.processor.onTileClear(s);const r=e.status;this._cleanupNeeded=!0;const i=[];for(const t of e.remove){const e=this.featureStore.lookupDisplayId(t);e&&i.push(e)}e.remove=i;try{if((0,c.Wi)(e.addOrUpdate))return void this.processor.onTileMessage(s,{...e,addOrUpdate:null},this.hasAggregates,t).catch(u.H9);if(e.addOrUpdate.setArcadeSpatialReference(this.spatialReference),this.featureStore.hasInstance(e.addOrUpdate.instance)&&r.targets.feature||(r.targets.feature=!0,this.featureStore.onTileData(s,e)),r.storage.data&&r.storage.filters||(r.storage.data=!0,r.storage.filters=!0,this.attributeStore.onTileData(s,e),"geoevent"===this._source.type||this._didEdit?(await this.attributeStore.sendUpdates(),(0,u.k_)(t)):this.attributeStore.sendUpdates()),this.hasAggregates&&!r.targets.aggregate){r.targets.aggregate=!0;const t=ct(this._source)&&this._source.loading,i=!ct(this._source)||t||e.end;if(this.aggregateStore.onTileData(s,e,this._storage,this.attributeStore,i),!i)return;r.mesh||(this.attributeStore.onTileData(s,e),await this.attributeStore.sendUpdates(),this.processor.onTileClear(s))}r.mesh||(r.mesh=!0,await this.processor.onTileMessage(s,e,this.hasAggregates,t),(0,u.k_)(t)),this._maybeForceCleanup()}catch(e){(0,u.H9)(e)}}_mark(e,t,s){const r=(4294901760&this._storage.getInstanceId(e))>>>16;e&&(t.add(r),s.set(e))}_markAndSweep(){if(this._lastCleanup=performance.now(),"feature"===this._source.type&&"snapshot"===this._source.mode||"geoevent"!==this._source.type&&!this._cleanupNeeded)return;this._cleanupNeeded=!1;const e=this._storage.getBitset(this._markedIdsBufId),t=new Set;e.clear();for(const s of this.tileStore.tiles)for(const r of this._source.readers(s.id)){const s=r.getCursor();for(;s.next();){let r=s.getDisplayId();if(!r){const e=s.getObjectId();r=this.featureStore.lookupDisplayId(e)}this._mark(r,t,e)}}"symbol"===this.processor.type&&this.processor.forEachBufferId((s=>{this._mark(s,t,e)})),this._updateQueue.forEach((s=>{for(const r of s.remove){const s=this.featureStore.lookupDisplayId(r);this._mark(s,t,e)}})),this.config.schema.targets.aggregate&&(this.aggregateStore.sweepFeatures(e,this.featureStore),this.aggregateStore.sweepClusters(this._storage,this.attributeStore,this._level)),this.featureStore.sweepFeatures(e,this._storage,this.attributeStore),this.featureStore.sweepFeatureSets(t)}};(0,r._)([(0,o.Cb)({constructOnly:!0})],ut.prototype,"tileStore",void 0),(0,r._)([(0,o.Cb)()],ut.prototype,"config",void 0),(0,r._)([(0,o.Cb)({readOnly:!0})],ut.prototype,"fieldsIndex",null),(0,r._)([(0,o.Cb)()],ut.prototype,"processor",void 0),(0,r._)([(0,o.Cb)({constructOnly:!0})],ut.prototype,"remoteClient",void 0),(0,r._)([(0,o.Cb)({constructOnly:!0})],ut.prototype,"service",void 0),(0,r._)([(0,o.Cb)()],ut.prototype,"spatialReference",null),(0,r._)([(0,o.Cb)()],ut.prototype,"updating",null),ut=(0,r._)([(0,a.j)("esri.views.2d.layers.features.controllers.FeatureController2D")],ut);const lt=ut;var dt=s(3651),pt=s(67524),gt=s(55415);const _t={added:[],removed:[]},ft=new Set,mt=new gt.Z(0,0,0,0);class yt extends $.Z{constructor(e){super(),this._tiles=new Map,this._index=(0,ue.r)(9,(0,n.Z)("esri-csp-restrictions")?e=>({minX:e.bounds[0],minY:e.bounds[1],maxX:e.bounds[2],maxY:e.bounds[3]}):[".bounds[0]",".bounds[1]",".bounds[2]",".bounds[3]"]),this.tiles=[],this.tileScheme=e}destroy(){this.clear()}clear(){this.tiles.length=0,this._tiles.clear(),this._index.clear()}has(e){return this._tiles.has(e)}get(e){return this._tiles.get(e)}boundsIntersections(e){return this._index.search({minX:e[0],minY:e[1],maxX:e[2],maxY:e[3]})}updateTiles(e){const t={added:[],removed:[]};for(const s of e.added)if(!this.has(s)){const e=new dt.n(this.tileScheme,s);this._tiles.set(s,e),this._index.insert(e),t.added.push(e)}for(const s of e.removed)if(this.has(s)){const e=this.get(s);this._tiles.delete(s),this._index.remove(e),t.removed.push(e)}this.tiles.length=0,this._tiles.forEach((e=>this.tiles.push(e))),(t.added.length||t.removed.length)&&this.emit("update",t)}setViewState(e){const t=this.tileScheme.getTileCoverage(e,0);if(!t)return;const{spans:s,lodInfo:r}=t,{level:i}=r;if(s.length>0)for(const{row:e,colFrom:t,colTo:n}of s)for(let s=t;s<=n;s++){const t=mt.set(i,e,r.normalizeCol(s),r.getWorldForColumn(s)).id;if(ft.add(t),!this.has(t)){const e=new dt.n(this.tileScheme,t);this._tiles.set(t,e),this._index.insert(e),this.tiles.push(e),_t.added.push(e)}}for(let e=this.tiles.length-1;e>=0;e--){const t=this.tiles[e];ft.has(t.id)||(this._tiles.delete(t.id),this.tiles.splice(e,1),this._index.remove(t),_t.removed.push(t))}(_t.added.length||_t.removed.length)&&this.emit("update",_t),pt.Z.pool.release(t),ft.clear(),_t.added.length=0,_t.removed.length=0}}var It=s(83068);const xt=new Set;function bt(){return xt}let wt=class extends i.r{constructor(){super(...arguments),this.controller=null,this.processor=null,this.remoteClient=null,this.tileStore=null,this.service=null,this.viewState=null,this._paused=!1,this._pendingTileUpdates=[]}initialize(){this.handles.add(this.watch("updating",(e=>{this.remoteClient.invoke("setUpdating",e).catch((e=>{}))})))}destroy(){var e,t,s;null==(e=this.controller)||e.destroy(),null==(t=this.processor)||t.destroy(),null==(s=this.tileStore)||s.destroy(),this.controller=this.processor=this.tileStore=this.remoteClient=null}get updating(){return!this.controller||this.controller.updating}async startup({service:e,config:t,tileInfo:s,tiles:r}){if(this._paused=!0,this.service=e,!this.tileStore){const e=new It.Z(h.Z.fromJSON(s));this.tileStore=new yt(e)}for(await this._createProcessorAndController(t),await this.update({config:t},!0),this.tileStore.clear(),this.tileStore.updateTiles(r),this._paused=!1;this._pendingTileUpdates.length;)this.tileStore.updateTiles(this._pendingTileUpdates.pop())}async updateTiles(e){this._paused?this._pendingTileUpdates.push(e):this.tileStore.updateTiles(e)}async update({config:e},t=!1){const s=te.empty();return t||this.controller.pause(),await Promise.all([this.processor.update(s,e),this.controller.update(s,e)]),s.toJSON()}async applyUpdate(e){return this.controller.applyUpdate(te.create(e))}async _createProcessorAndController(e){await Promise.all([this._handleControllerConfig(e),this._handleProcessorConfig(e)]),this.controller.processor=this.processor}async _handleControllerConfig(e){const t=await this._createController(this.service,e);return await t.startup(),t}async _handleProcessorConfig(e){return this._createProcessor(this.service,e)}async _createController(e,t){this.controller&&this.controller.destroy();const{tileStore:s,remoteClient:r}=this,i=new lt({service:e,config:t,tileStore:s,remoteClient:r});return this.controller=i,i}async _createProcessor(e,t){const r=t.schema.processors[0].type,i=(await function(e){return"heatmap"===e?s.e(2399).then(s.bind(s,12399)):Promise.all([s.e(8422),s.e(6810),s.e(3437)]).then(s.bind(s,61945))}(r)).default,{remoteClient:n,tileStore:o}=this,a=new i({service:e,config:t,tileStore:o,remoteClient:n});return this.processor&&this.processor.destroy(),this.processor=a,a}};(0,r._)([(0,o.Cb)()],wt.prototype,"controller",void 0),(0,r._)([(0,o.Cb)()],wt.prototype,"processor",void 0),(0,r._)([(0,o.Cb)()],wt.prototype,"updating",null),(0,r._)([(0,o.Cb)()],wt.prototype,"viewState",void 0),wt=(0,r._)([(0,a.j)("esri.views.2d.layers.features.Pipeline")],wt);const vt=wt},59999:(e,t,s)=>{s.d(t,{J:()=>c});var r=s(80442),i=s(70586),n=s(22862),o=s(59266),a=s(92604);const h=s.e(4695).then(s.bind(s,14695));class c{constructor(e,t){this._canCacheExpressionValue=!1,this._sourceInfo=e,this._bitsets={computed:t.getBitset(t.createBitset())}}invalidate(){this._bitsets.computed.clear()}async updateSchema(e,t){const s=(0,n.Hg)(this._schema,t);if(this._schema=t,!t||(0,i.Wi)(s)||!(0,n.uD)(s,"attributes"))return;(0,r.Z)("esri-2d-update-debug")&&console.debug("Applying Update - Store:",s),this._bitsets.computed.clear(),e.targets[t.name]=!0;const o=t.attributes,a=[],h=[];for(const e in o){const t=o[e];switch(t.type){case"field":break;case"expression":a.push(this._createArcadeComputedField(t));break;case"label-expression":a.push(this._createLabelArcadeComputedField(t));break;case"statistic":h.push(t)}}this._computedFields=await Promise.all(a),this._canCacheExpressionValue=!this._computedFields.some((e=>"expression"===e.type&&e.expression.referencesScale())),this._statisticFields=h}setComputedAttributes(e,t,s,r){const i=this._bitsets.computed;if(!this._canCacheExpressionValue||!i.has(s)){i.set(s);for(const i of this._computedFields){const n=this._evaluateField(t,i,r);switch(i.resultType){case"numeric":e.setComputedNumericAtIndex(s,i.fieldIndex,n);break;case"string":e.setComputedStringAtIndex(s,i.fieldIndex,n)}}}}async _createArcadeComputedField(e){const t=this._sourceInfo.spatialReference,s=this._sourceInfo.fieldsIndex;return{...e,expression:await(0,o.Yi)(e.valueExpression,t,s)}}async _createLabelArcadeComputedField(e){const t=this._sourceInfo.spatialReference,s=this._sourceInfo.fieldsIndex,{createLabelFunction:r}=await h,i=await r(e.label,s,t);return{...e,builder:i}}_evaluateField(e,t,s){switch(t.type){case"label-expression":{const s=e.readArcadeFeature();return t.builder.evaluate(s)||""}case"expression":{const{expression:r}=t;return function(e,t,s){e.referencesGeometry();const r=t.readArcadeFeature();try{return e.evaluate({...s,$feature:r})}catch(e){return a.Z.getLogger("esri.views.2d.support.arcadeOnDemand").warn("Feature arcade evaluation failed:",e),null}}(r,e,{$view:{scale:s}})}}}}},87554:(e,t,s)=>{s.d(t,{s:()=>T}),s(66577);var r,i,n,o=s(80442),a=s(70586),h=s(29730),c=s(98732),u=s(5428),l=s(93054),d=s(33955);let p=0;const g=null!=(r=(0,o.Z)("featurelayer-simplify-thresholds"))?r:[.5,.5,.5,.5],_=g[0],f=g[1],m=g[2],y=g[3],I=null!=(i=(0,o.Z)("featurelayer-simplify-payload-size-factors"))?i:[1,2,4],x=I[0],b=I[1],w=I[2],v=null!=(n=(0,o.Z)("featurelayer-simplify-mobile-factor"))?n:2,S=(0,o.Z)("esri-mobile");class T{constructor(e){this.type="FeatureSetReader",this.seen=!1,this.instance=0,this._tx=0,this._ty=0,this._sx=1,this._sy=1,this._deleted=null,this._joined=[],this._objectIdToIndex=null,this._level=0,this.instance=e}static createInstance(){return p++,p=p>65535?0:p,p}get isEmpty(){return(0,a.pC)(this._deleted)&&this._deleted.countSet()===this.getSize()}set level(e){this._level=e}getAreaSimplificationThreshold(e,t){let s=1;const r=S?v:1;t>4e6?s=w*r:t>1e6?s=b*r:t>5e5?s=x*r:t>1e5&&(s=r);let i=0;e>4e3?i=y*s:e>2e3?i=m*s:e>100?i=f:e>15&&(i=_);let n=8;return this._level<4?n=1:this._level<5?n=2:this._level<6&&(n=4),i*n}setArcadeSpatialReference(e){this._arcadeSpatialReference=e}attachStorage(e){this._storage=e}getQuantizationTransform(){throw new Error("Unable to find transform for featureSet")}getStorage(){return this._storage}getComputedNumeric(e){return this.getComputedNumericAtIndex(0)}setComputedNumeric(e,t){return this.setComputedNumericAtIndex(t,0)}getComputedString(e){return this.getComputedStringAtIndex(0)}setComputedString(e,t){return this.setComputedStringAtIndex(0,t)}getComputedNumericAtIndex(e){return this._storage.getComputedNumericAtIndex(this.getDisplayId(),e)}setComputedNumericAtIndex(e,t){this._storage.setComputedNumericAtIndex(this.getDisplayId(),e,t)}getComputedStringAtIndex(e){return this._storage.getComputedStringAtIndex(this.getDisplayId(),e)}setComputedStringAtIndex(e,t){return this._storage.setComputedStringAtIndex(this.getDisplayId(),e,t)}transform(e,t,s,r){const i=this.copy();return i._tx+=e,i._ty+=t,i._sx*=s,i._sy*=r,i}readAttribute(e,t=!1){const s=this._readAttribute(e,t);if(void 0!==s)return s;for(const s of this._joined){s.setIndex(this.getIndex());const r=s._readAttribute(e,t);if(void 0!==r)return r}}readAttributes(){const e=this._readAttributes();for(const t of this._joined){t.setIndex(this.getIndex());const s=t._readAttributes();for(const t of Object.keys(s))e[t]=s[t]}return e}joinAttributes(e){this._joined.push(e)}readArcadeFeature(){return this}geometry(){const e=this.readHydratedGeometry(),t=(0,c.di)(e,this.geometryType,this.hasZ,this.hasM),s=(0,d.im)(t);return s&&(s.spatialReference=this._arcadeSpatialReference),s}field(e){return this.readAttribute(e,!0)}hasField(e){return!0}setField(e,t){}keys(){return[]}castToText(){return""}removeIds(e){if((0,a.Wi)(this._objectIdToIndex)){const e=new Map,t=this.getCursor();for(;t.next();)e.set(t.getObjectId(),t.getIndex());this._objectIdToIndex=e}const t=this._objectIdToIndex;for(const s of e)t.has(s)&&this.removeAtIndex(t.get(s))}removeAtIndex(e){(0,a.Wi)(this._deleted)&&(this._deleted=l.p.create(this.getSize())),this._deleted.set(e)}readGeometryForDisplay(){return this.readUnquantizedGeometry(!0)}readLegacyGeometryForDisplay(){return this.readLegacyGeometry(!0)}*features(){const e=this.getCursor();for(;e.next();)yield e.readOptimizedFeature()}_getExists(){return(0,a.Wi)(this._deleted)||!this._deleted.has(this.getIndex())}_computeCentroid(){if("esriGeometryPolygon"!==this.geometryType)return null;const e=this.readUnquantizedGeometry();if(!e||e.hasIndeterminateRingOrder)return null;const t=(0,a.Pt)(this.getQuantizationTransform(),null);return(0,h.Y)(new u.Z,e,this.hasM,this.hasZ,t)}copyInto(e){e.seen=this.seen,e._storage=this._storage,e._arcadeSpatialReference=this._arcadeSpatialReference,e._joined=this._joined,e._tx=this._tx,e._ty=this._ty,e._sx=this._sx,e._sy=this._sy,e._deleted=this._deleted,e._objectIdToIndex=this._objectIdToIndex}}},61800:(e,t,s)=>{s.d(t,{t:()=>i});var r=s(87554);class i extends r.s{constructor(e,t){super(r.s.createInstance()),this._currentIndex=-1,this._reader=e,this._indices=t}static from(e,t){return new i(e.copy(),t)}get hasNext(){return this._currentIndex+1<this._indices.length}getSize(){return this._indices.length}getCursor(){return this.copy()}copy(){const e=new i(this._reader.copy(),this._indices);return e._currentIndex=this._currentIndex,e}next(){for(;this._nextIndex()&&!this._reader._getExists(););return this._currentIndex<this._indices.length}_nextIndex(){return++this._currentIndex<this._indices.length&&(this._reader.setIndex(this._indices[this._currentIndex]),!0)}setArcadeSpatialReference(e){this._reader.setArcadeSpatialReference(e)}attachStorage(e){this._reader.attachStorage(e)}get geometryType(){return this._reader.geometryType}get hasFeatures(){return this._reader.hasFeatures}get exceededTransferLimit(){return this._reader.exceededTransferLimit}get hasZ(){return this._reader.hasZ}get hasM(){return this._reader.hasM}getStorage(){return this._reader.getStorage()}getComputedNumeric(e){return this._reader.getComputedNumericAtIndex(0)}setComputedNumeric(e,t){return this._reader.setComputedNumericAtIndex(t,0)}getComputedString(e){return this._reader.getComputedStringAtIndex(0)}setComputedString(e,t){return this._reader.setComputedStringAtIndex(0,t)}getComputedNumericAtIndex(e){return this._reader.getComputedNumericAtIndex(e)}setComputedNumericAtIndex(e,t){this._reader.setComputedNumericAtIndex(e,t)}getComputedStringAtIndex(e){return this._reader.getComputedStringAtIndex(e)}setComputedStringAtIndex(e,t){return this._reader.setComputedStringAtIndex(e,t)}transform(e,t,s,r){const i=this.copy();return i._reader=this._reader.transform(e,t,s,r),i}readAttribute(e,t=!1){return this._reader.readAttribute(e,t)}readAttributes(){return this._reader.readAttributes()}joinAttributes(e){return this._reader.joinAttributes(e)}readArcadeFeature(){return this._reader.readArcadeFeature()}geometry(){return this._reader.geometry()}field(e){return this.readAttribute(e,!0)}hasField(e){return this._reader.hasField(e)}setField(e,t){return this._reader.setField(e,t)}keys(){return this._reader.keys()}castToText(){return this._reader.castToText()}getQuantizationTransform(){return this._reader.getQuantizationTransform()}getAttributeHash(){return this._reader.getAttributeHash()}getObjectId(){return this._reader.getObjectId()}getDisplayId(){return this._reader.getDisplayId()}setDisplayId(e){return this._reader.setDisplayId(e)}getGroupId(){return this._reader.getGroupId()}setGroupId(e){return this._reader.setGroupId(e)}getXHydrated(){return this._reader.getXHydrated()}getYHydrated(){return this._reader.getYHydrated()}getX(){return this._reader.getX()}getY(){return this._reader.getY()}setIndex(e){return this._reader.setIndex(e)}getIndex(){return this._reader.getIndex()}readLegacyFeature(){return this._reader.readLegacyFeature()}readOptimizedFeature(){return this._reader.readOptimizedFeature()}readLegacyPointGeometry(){return this._reader.readLegacyPointGeometry()}readLegacyGeometry(){return this._reader.readLegacyGeometry()}readLegacyCentroid(){return this._reader.readLegacyCentroid()}readGeometryArea(){return this._reader.readGeometryArea()}readUnquantizedGeometry(){return this._reader.readUnquantizedGeometry()}readHydratedGeometry(){return this._reader.readHydratedGeometry()}readGeometry(){return this._reader.readGeometry()}readCentroid(){return this._reader.readCentroid()}_readAttribute(e,t){throw new Error("Error: Should not be called. Underlying _reader should be used instead")}_readAttributes(){throw new Error("Error: Should not be called. Underlying _reader should be used instead")}}},93054:(e,t,s)=>{s.d(t,{p:()=>r});class r{constructor(e,t){this._mask=0,this._buf=e,this._mask=t}static fromBuffer(e,t){return new r(e,t)}static create(e,t=4294967295){const s=new Uint32Array(Math.ceil(e/32));return new r(s,t)}_getIndex(e){return Math.floor(e/32)}has(e){const t=this._mask&e;return!!(this._buf[this._getIndex(t)]&1<<t%32)}hasRange(e,t){let s=e,r=t;for(;s%32&&s!==r;){if(this.has(s))return!0;s++}for(;r%32&&s!==r;){if(this.has(s))return!0;r--}if(s===r)return!1;for(let e=s/32;e!==r/32;e++)if(this._buf[e])return!0;return!1}set(e){const t=this._mask&e,s=this._getIndex(t),r=1<<t%32;this._buf[s]|=r}setRange(e,t){let s=e,r=t;for(;s%32&&s!==r;)this.set(s++);for(;r%32&&s!==r;)this.set(r--);if(s!==r)for(let e=s/32;e!==r/32;e++)this._buf[e]=4294967295}unset(e){const t=this._mask&e,s=this._getIndex(t),r=1<<t%32;this._buf[s]&=4294967295^r}resize(e){const t=this._buf,s=new Uint32Array(Math.ceil(e/32));s.set(t),this._buf=s}or(e){for(let t=0;t<this._buf.length;t++)this._buf[t]|=e._buf[t];return this}and(e){for(let t=0;t<this._buf.length;t++)this._buf[t]&=e._buf[t];return this}xor(e){for(let t=0;t<this._buf.length;t++)this._buf[t]^=e._buf[t];return this}ior(e){for(let t=0;t<this._buf.length;t++)this._buf[t]|=~e._buf[t];return this}iand(e){for(let t=0;t<this._buf.length;t++)this._buf[t]&=~e._buf[t];return this}ixor(e){for(let t=0;t<this._buf.length;t++)this._buf[t]^=~e._buf[t];return this}any(){for(let e=0;e<this._buf.length;e++)if(this._buf[e])return!0;return!1}copy(e){for(let t=0;t<this._buf.length;t++)this._buf[t]=e._buf[t];return this}clone(){return new r(this._buf.slice(),this._mask)}clear(){for(let e=0;e<this._buf.length;e++)this._buf[e]=0}forEachSet(e){for(let t=0;t<this._buf.length;t++){let s=this._buf[t],r=32*t;if(s)for(;s;)1&s&&e(r),s>>>=1,r++}}countSet(){let e=0;return this.forEachSet((t=>{e++})),e}}},3651:(e,t,s)=>{s.d(t,{n:()=>h});var r=s(3894),i=s(6570),n=s(24470),o=s(6388),a=s(55415);class h{constructor(e,t){this.key=new a.Z(0,0,0,0),this.bounds=(0,n.Ue)(),this.objectIds=new Set,this.key.set(t);const s=e.getLODInfoAt(this.key);this.tileInfoView=e,this.tileInfoView.getTileBounds(this.bounds,this.key,!0),this.resolution=s.resolution,this.scale=s.scale,this.level=s.level}get id(){return this.key.id}get extent(){return i.Z.fromBounds(this.bounds,this.tileInfoView.tileInfo.spatialReference)}get transform(){return{originPosition:"upperLeft",scale:[this.resolution,this.resolution],translate:[this.bounds[0],this.bounds[3]]}}createChildTiles(){const e=this.key.getChildKeys(),t=r.Z.acquire();for(let s=0;s<e.length;s++)t[s]=new h(this.tileInfoView,e[s]);return t}getQuantizationParameters(){return o.Z.fromJSON({mode:"view",originPosition:"upperLeft",tolerance:this.resolution,extent:{xmin:this.bounds[0],ymin:this.bounds[1],xmax:this.bounds[2],ymax:this.bounds[3],spatialReference:this.tileInfoView.tileInfo.spatialReference}})}}},67524:(e,t,s)=>{s.d(t,{Z:()=>i});var r=s(71143);class i{constructor(){this.spans=[]}acquire(e){this.lodInfo=e}release(){this.lodInfo=null,this.spans.length=0}forEach(e,t){const{spans:s,lodInfo:r}=this,{level:i}=r;if(0!==s.length)for(const{row:n,colFrom:o,colTo:a}of s)for(let s=o;s<=a;s++)e.call(t,i,n,r.normalizeCol(s),r.getWorldForColumn(s))}}i.pool=new r.Z(i)},83068:(e,t,s)=>{s.d(t,{Z:()=>_});var r=s(8744),i=s(70586),n=s(55415);function o(e,t){return[e,t]}function a(e,t,s){return e[0]=t,e[1]=s,e}const h=new n.Z("0/0/0/0");class c{constructor(e,t,s,r,i,n,o,a,h,c,u,l){this.level=e,this.resolution=t,this.scale=s,this.origin=r,this.first=i,this.last=n,this.size=o,this.norm=a,this.worldStart=h,this.worldEnd=c,this.worldSize=u,this.wrap=l}static create(e,t,s=null){const n=(0,r.C5)(e.spatialReference),h=t.origin||o(e.origin.x,e.origin.y),u=o(e.size[0]*t.resolution,e.size[1]*t.resolution),l=o(-1/0,-1/0),d=o(1/0,1/0),p=o(1/0,1/0);(0,i.pC)(s)&&(a(l,Math.max(0,Math.floor((s.xmin-h[0])/u[0])),Math.max(0,Math.floor((h[1]-s.ymax)/u[1]))),a(d,Math.max(0,Math.floor((s.xmax-h[0])/u[0])),Math.max(0,Math.floor((h[1]-s.ymin)/u[1]))),a(p,d[0]-l[0]+1,d[1]-l[1]+1));const{cols:g,rows:_}=t;let f,m,y,I;return!s&&g&&_&&(a(l,g[0],_[0]),a(d,g[1],_[1]),a(p,g[1]-g[0]+1,_[1]-_[0]+1)),e.isWrappable?(f=o(Math.ceil(Math.round((n.valid[1]-n.valid[0])/t.resolution)/e.size[0]),p[1]),m=o(Math.floor((n.origin[0]-h[0])/u[0]),l[1]),y=o(f[0]+m[0]-1,d[1]),I=!0):(m=l,y=d,f=p,I=!1),new c(t.level,t.resolution,t.scale,h,l,d,p,u,m,y,f,I)}normalizeCol(e){if(!this.wrap)return e;const t=this.worldSize[0];return e<0?t-1-Math.abs((e+1)%t):e%t}denormalizeCol(e,t){return this.wrap?this.worldSize[0]*t+e:e}getWorldForColumn(e){return this.wrap?Math.floor(e/this.worldSize[0]):0}getFirstColumnForWorld(e){return e*this.worldSize[0]+this.first[0]}getLastColumnForWorld(e){return e*this.worldSize[0]+this.first[0]+this.size[0]-1}getColumnForX(e){return(e-this.origin[0])/this.norm[0]}getXForColumn(e){return this.origin[0]+e*this.norm[0]}getRowForY(e){return(this.origin[1]-e)/this.norm[1]}getYForRow(e){return this.origin[1]-e*this.norm[1]}getTileBounds(e,t,s=!1){h.set(t);const r=s?h.col:this.denormalizeCol(h.col,h.world),i=h.row;return function(e,t,s,r,i){e[0]=t,e[1]=s,e[2]=r,e[3]=i}(e,this.getXForColumn(r),this.getYForRow(i+1),this.getXForColumn(r+1),this.getYForRow(i)),e}getTileCoords(e,t,s=!1){h.set(t);const r=s?h.col:this.denormalizeCol(h.col,h.world);return Array.isArray(e)?a(e,this.getXForColumn(r),this.getYForRow(h.row)):(e.x=this.getXForColumn(r),e.y=this.getYForRow(h.row)),e}}var u=s(67524);class l{constructor(e,t,s){this.row=e,this.colFrom=t,this.colTo=s}}const d=new n.Z("0/0/0/0");class p{constructor(e,t,s,r,i,n,o,a){this.x=e,this.ymin=t,this.ymax=s,this.invM=r,this.leftAdjust=i,this.rightAdjust=n,this.leftBound=o,this.rightBound=a}static create(e,t){e[1]>t[1]&&([e,t]=[t,e]);const[s,r]=e,[i,n]=t,o=i-s,a=n-r,h=0!==a?o/a:0,c=(Math.ceil(r)-r)*h,u=(Math.floor(r)-r)*h;return new p(s,Math.floor(r),Math.ceil(n),h,o<0?c:u,o<0?u:c,o<0?i:s,o<0?s:i)}incrRow(){this.x+=this.invM}getLeftCol(){return Math.max(this.x+this.leftAdjust,this.leftBound)}getRightCol(){return Math.min(this.x+this.rightAdjust,this.rightBound)}}const g=[[0,0],[0,0],[0,0],[0,0]];class _{constructor(e,t=null){this.tileInfo=e,this.fullExtent=t,this.scales=[],this._lodInfos=null,this._infoByScale={},this._infoByLevel={};const s=e.lods.slice();s.sort((function(e,t){return t.scale-e.scale}));const r=this._lodInfos=s.map((s=>c.create(e,s,t)));s.forEach(((e,t)=>{this._infoByLevel[e.level]=r[t],this._infoByScale[e.scale]=r[t],this.scales[t]=e.scale}),this),this._wrap=e.isWrappable}get spatialReference(){return this.tileInfo.spatialReference}getLODInfoAt(e){return this._infoByLevel["number"==typeof e?e:e.level]}getTileBounds(e,t,s=!1){d.set(t);const r=this._infoByLevel[d.level];return r?r.getTileBounds(e,d,s):e}getTileCoords(e,t,s=!1){d.set(t);const r=this._infoByLevel[d.level];return r?r.getTileCoords(e,d,s):e}getTileCoverage(e,t=192,s="closest"){const r="closest"===s?this.getClosestInfoForScale(e.scale):this.getSmallestInfoForScale(e.scale),i=u.Z.pool.acquire(r),n=this._wrap;let o,a,h,c=1/0,d=-1/0;const _=i.spans;g[0][0]=g[0][1]=g[1][1]=g[3][0]=-t,g[1][0]=g[2][0]=e.size[0]+t,g[2][1]=g[3][1]=e.size[1]+t;for(const t of g)e.toMap(t,t),t[0]=r.getColumnForX(t[0]),t[1]=r.getRowForY(t[1]);const f=[];let m=3;for(let e=0;e<4;e++){if(g[e][1]===g[m][1]){m=e;continue}const t=p.create(g[e],g[m]);c=Math.min(t.ymin,c),d=Math.max(t.ymax,d),void 0===f[t.ymin]&&(f[t.ymin]=[]),f[t.ymin].push(t),m=e}if(null==c||null==d||d-c>100)return null;let y=[];for(o=c;o<d;){null!=f[o]&&(y=y.concat(f[o])),a=1/0,h=-1/0;for(let e=y.length-1;e>=0;e--){const t=y[e];a=Math.min(a,t.getLeftCol()),h=Math.max(h,t.getRightCol())}if(a=Math.floor(a),h=Math.floor(h),o>=r.first[1]&&o<=r.last[1])if(n)if(r.size[0]<r.worldSize[0]){const e=Math.floor(h/r.worldSize[0]);for(let t=Math.floor(a/r.worldSize[0]);t<=e;t++)_.push(new l(o,Math.max(r.getFirstColumnForWorld(t),a),Math.min(r.getLastColumnForWorld(t),h)))}else _.push(new l(o,a,h));else a>r.last[0]||h<r.first[0]||(a=Math.max(a,r.first[0]),h=Math.min(h,r.last[0]),_.push(new l(o,a,h)));o+=1;for(let e=y.length-1;e>=0;e--){const t=y[e];t.ymax>=o?t.incrRow():y.splice(e,1)}}return i}getTileParentId(e){d.set(e);const t=this._infoByLevel[d.level],s=this._lodInfos.indexOf(t)-1;return s<0?null:(this._getTileIdAtLOD(d,this._lodInfos[s],d),d.id)}getTileResolution(e){const t=this._infoByLevel["object"==typeof e?e.level:e];return t?t.resolution:-1}getTileScale(e){const t=this._infoByLevel[e.level];return t?t.scale:-1}intersects(e,t){d.set(t);const s=this._infoByLevel[d.level],r=e.lodInfo;if(r.resolution>s.resolution){this._getTileIdAtLOD(d,r,d);const t=r.denormalizeCol(d.col,d.world);for(const s of e.spans)if(s.row===d.row&&s.colFrom<=t&&s.colTo>=t)return!0}if(r.resolution<s.resolution){const[t,i,n,o]=e.spans.reduce(((e,t)=>(e[0]=Math.min(e[0],t.row),e[1]=Math.max(e[1],t.row),e[2]=Math.min(e[2],t.colFrom),e[3]=Math.max(e[3],t.colTo),e)),[1/0,-1/0,1/0,-1/0]),a=s.denormalizeCol(d.col,d.world),h=r.getColumnForX(s.getXForColumn(a)),c=r.getRowForY(s.getYForRow(d.row)),u=r.getColumnForX(s.getXForColumn(a+1))-1,l=r.getRowForY(s.getYForRow(d.row+1))-1;return!(h>o||u<n||c>i||l<t)}const i=r.denormalizeCol(d.col,d.world);return e.spans.some((e=>e.row===d.row&&e.colFrom<=i&&e.colTo>=i))}normalizeBounds(e,t,s){if(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],this._wrap){const t=(0,r.C5)(this.tileInfo.spatialReference),i=-s*(t.valid[1]-t.valid[0]);e[0]+=i,e[2]+=i}return e}getSmallestInfoForScale(e){const t=this.scales;if(this._infoByScale[e])return this._infoByScale[e];if(e>t[0])return this._infoByScale[t[0]];for(let s=1;s<t.length-1;s++)if(e>t[s]+1e-6)return this._infoByScale[t[s-1]];return this._infoByScale[t[t.length-1]]}getClosestInfoForScale(e){const t=this.scales;return this._infoByScale[e]||(e=t.reduce(((t,s)=>Math.abs(s-e)<Math.abs(t-e)?s:t),t[0])),this._infoByScale[e]}scaleToLevel(e){const t=this.scales;if(this._infoByScale[e])return this._infoByScale[e].level;for(let s=t.length-1;s>=0;s--)if(e<t[s])return s===t.length-1?this._infoByScale[t[t.length-1]].level:this._infoByScale[t[s]].level+(t[s]-e)/(t[s]-t[s+1]);return this._infoByScale[t[0]].level}scaleToZoom(e){return this.tileInfo.scaleToZoom(e)}_getTileIdAtLOD(e,t,s){const r=this._infoByLevel[s.level];return e.set(s),t.resolution<r.resolution?null:(t.resolution===r.resolution||(e.level=t.level,e.col=Math.floor(s.col*r.resolution/t.resolution+.01),e.row=Math.floor(s.row*r.resolution/t.resolution+.01)),e)}}},55415:(e,t,s)=>{s.d(t,{Z:()=>i});var r=s(71143);class i{constructor(e,t,s,r){this.set(e,t,s,r)}static getId(e,t,s,r){return"object"==typeof e?`${e.level}/${e.row}/${e.col}/${e.world}`:`${e}/${t}/${s}/${r}`}get key(){return this}get id(){return this.toString()}set id(e){this.set(e)}get hash(){const e=4095&this.row,t=4095&this.col,s=63&this.level;return(3&this.world)<<30|t<<22|e<<8|s}acquire(e,t,s,r){this.set(e,t,s,r)}contains(e){const t=e.level-this.level;return this.row===e.row>>t&&this.col===e.col>>t&&this.world===e.world}equals(e){return this.level===e.level&&this.row===e.row&&this.col===e.col&&this.world===e.world}clone(){return new i(this)}release(){this.level=0,this.row=0,this.col=0,this.world=0}set(e,t,s,r){if(null==e)this.level=0,this.row=0,this.col=0,this.world=0;else if("object"==typeof e)this.level=e.level||0,this.row=e.row||0,this.col=e.col||0,this.world=e.world||0;else if("string"==typeof e){const[t,s,r,i]=e.split("/");this.level=parseFloat(t),this.row=parseFloat(s),this.col=parseFloat(r),this.world=parseFloat(i)}else this.level=+e,this.row=+t,this.col=+s,this.world=+r||0;return this}toString(){return`${this.level}/${this.row}/${this.col}/${this.world}`}getParentKey(){return this.level<=0?null:new i(this.level-1,this.row>>1,this.col>>1,this.world)}getChildKeys(){const e=this.level+1,t=this.row<<1,s=this.col<<1,r=this.world;return[new i(e,t,s,r),new i(e,t,s+1,r),new i(e,t+1,s,r),new i(e,t+1,s+1,r)]}compareRowMajor(e){return this.row<e.row?-1:this.row>e.row?1:this.col<e.col?-1:this.col>e.col?1:0}}i.pool=new r.Z(i,null,null,25,50)},34084:(e,t,s)=>{s.d(t,{e:()=>h});var r=s(70586),i=s(95330);class n{constructor(e=(e=>e.values().next().value)){this._peeker=e,this._items=new Set}get length(){return this._items.size}clear(){this._items.clear()}last(){if(0===this._items.size)return;let e;for(e of this._items);return e}peek(){if(0!==this._items.size)return this._peeker(this._items)}push(e){this.contains(e)||this._items.add(e)}contains(e){return this._items.has(e)}pop(){if(0===this.length)return;const e=this.peek();return this._items.delete((0,r.j0)(e)),e}popLast(){if(0===this.length)return;const e=this.last();return this._items.delete((0,r.j0)(e)),e}remove(e){this._items.delete(e)}filter(e){return this._items.forEach((t=>{e(t)||this._items.delete(t)})),this}}var o=s(1654);class a{constructor(e,t){this.item=e,this.controller=t,this.promise=null}}class h{constructor(e){this._deferreds=new Map,this._controllers=new Map,this._processingItems=new Map,this._isPaused=!1,this._schedule=null,this._task=null,this.concurrency=1,e.concurrency&&(this.concurrency=e.concurrency),this._queue=new n(e.peeker),this.process=e.process;const t=e.scheduler;e.priority&&(0,r.pC)(t)&&(this._task=t.registerTask(e.priority,this))}destroy(){this.clear(),this._schedule&&(this._schedule.remove(),this._schedule=null),this._task&&(this._task.remove(),this._task=null)}get length(){return this._processingItems.size+this._queue.length}abort(e){const t=this._controllers.get(e);t&&t.abort()}clear(){this._queue.clear();const e=[];this._controllers.forEach((t=>e.push(t))),this._controllers.clear(),e.forEach((e=>e.abort())),this._processingItems.clear(),this._cancelNext()}forEach(e){this._deferreds.forEach(((t,s)=>e(s)))}get(e){const t=this._deferreds.get(e);return t?t.promise:void 0}isOngoing(e){return this._processingItems.has(e)}has(e){return this._deferreds.has(e)}pause(){this._isPaused||(this._isPaused=!0,this._cancelNext())}push(e,t){const s=this.get(e);if(s)return s;const n=new AbortController;let o=null;t&&(o=(0,i.fu)(t,(()=>n.abort())));const a=()=>{h.remove(),(0,r.pC)(o)&&o.remove(),this._deferreds.delete(e),this._controllers.delete(e),this._queue.remove(e),this._processingItems.delete(e),this._scheduleNext()},h=(0,i.$F)(n.signal,(()=>{const t=this._processingItems.get(e);t&&t.controller.abort(),a(),c.reject((0,i.zE)())})),c=(0,i.dD)();return this._deferreds.set(e,c),this._controllers.set(e,n),c.promise.then(a,a),this._queue.push(e),this._scheduleNext(),c.promise}last(){return this._queue.last()}peek(){return this._queue.peek()}popLast(){return this._queue.popLast()}reset(){const e=[];this._processingItems.forEach((t=>e.push(t))),this._processingItems.clear();for(const t of e)this._queue.push(t.item),t.controller.abort();this._scheduleNext()}resume(){this._isPaused&&(this._isPaused=!1,this._scheduleNext())}takeAll(){const e=[];for(;this._queue.length;)e.push(this._queue.pop());return this.clear(),e}get running(){return!this._isPaused&&this._queue.length>0&&this._processingItems.size<this.concurrency}runTask(e){for(;!e.done&&this._queue.length>0&&this._processingItems.size<this.concurrency;)this._process(this._queue.pop()),e.madeProgress()}_scheduleNext(){this._task||this._isPaused||this._schedule||(this._schedule=(0,o.Os)((()=>{this._schedule=null,this._next()})))}_next(){for(;this._queue.length>0&&this._processingItems.size<this.concurrency;)this._process(this._queue.pop())}_cancelNext(){this._schedule&&(this._schedule.remove(),this._schedule=null)}_processResult(e,t){this._canProcessFulfillment(e)&&(this._scheduleNext(),this._deferreds.get(e.item).resolve(t))}_processError(e,t){this._canProcessFulfillment(e)&&(this._scheduleNext(),this._deferreds.get(e.item).reject(t))}_canProcessFulfillment(e){return!!this._deferreds.get(e.item)&&this._processingItems.get(e.item)===e}_process(e){if((0,r.Wi)(e))return;let t;const s=new AbortController,n=new a(e,s);this._processingItems.set(e,n);try{t=this.process(e,s.signal)}catch(e){this._processError(n,e)}(0,i.y8)(t)?(n.promise=t,t.then((e=>this._processResult(n,e)),(e=>this._processError(n,e)))):this._processResult(n,t)}get test(){return{update:e=>this.runTask(e)}}}},89749:(e,t,s)=>{s.d(t,{t:()=>l});var r=s(43697),i=s(15923),n=s(61247),o=s(70586),a=s(17445),h=s(1654),c=s(5600),u=s(52011);let l=class extends i.Z{constructor(){super(...arguments),this.updating=!1,this.handleId=0,this.handles=new n.Z,this.scheduleHandleId=0,this.pendingPromises=new Set}destroy(){this.removeAll(),this.handles.destroy()}add(e,t,s={}){const r=++this.handleId;s.sync||this._installSyncUpdatingWatch(e,r);const i=(0,a.YP)(e,t,s);return this.handles.add(i,r),{remove:()=>this.handles.remove(r)}}addOnCollectionChange(e,t,{initial:s=!1}={}){const r=++this.handleId;return this.handles.add([(0,a.on)(e,"after-changes",this._createSyncUpdatingCallback(),a.Z_),(0,a.on)(e,"change",t,{onListenerAdd:s?e=>t({added:e.items,removed:[],moved:[],target:e}):void 0})],r),{remove:()=>this.handles.remove(r)}}addPromise(e){if((0,o.Wi)(e))return e;const t=++this.handleId;this.handles.add({remove:()=>{this.pendingPromises.delete(e)&&(0!==this.pendingPromises.size||this.handles.has(d)||this._set("updating",!1))}},t),this.pendingPromises.add(e),this._set("updating",!0);const s=()=>this.handles.remove(t);return e.then(s,s),e}removeAll(){this.pendingPromises.clear(),this.handles.removeAll(),this._set("updating",!1)}_installSyncUpdatingWatch(e,t){const s=this._createSyncUpdatingCallback(),r=(0,a.YP)(e,s,{sync:!0,equals:()=>!1});return this.handles.add(r,t),r}_createSyncUpdatingCallback(){return()=>{this.handles.remove(d),++this.scheduleHandleId;const e=this.scheduleHandleId;this._get("updating")||this._set("updating",!0),this.handles.add((0,h.Os)((()=>{e===this.scheduleHandleId&&(this._set("updating",this.pendingPromises.size>0),this.handles.remove(d))})),d)}}};(0,r._)([(0,c.Cb)({readOnly:!0})],l.prototype,"updating",void 0),l=(0,r._)([(0,u.j)("esri.views.support.WatchUpdatingTracking")],l);const d=-42;var p,g;(g=p||(p={}))[g.NONE=0]="NONE",g[g.SYNC=1]="SYNC",g[g.INIT=2]="INIT"},75656:(e,t,s)=>{s.d(t,{x:()=>c});var r=s(22021),i=s(70586),n=s(49300),o=s(54738),a=s(35371),h=s(46314);class c{constructor(e,t,s=null){this._context=e,this.type="texture",this._glName=null,this._descriptor=void 0,this._samplingModeDirty=!1,this._wrapModeDirty=!1,e.instanceCounter.increment(a._g.Texture,this),this._descriptor={target:a.No.TEXTURE_2D,samplingMode:a.cw.LINEAR,wrapMode:a.e8.REPEAT,flipped:!1,hasMipmap:!1,isOpaque:!1,unpackAlignment:4,preMultiplyAlpha:!1,...t},this._descriptor.target===a.No.TEXTURE_CUBE_MAP?this._setDataCubeMap(s):this.setData(s)}get glName(){return this._glName}get descriptor(){return this._descriptor}get isDirty(){return this._samplingModeDirty||this._wrapModeDirty}dispose(){this._context.gl&&this._glName&&(this._context.unbindTextureAllUnits(this),this._context.gl.deleteTexture(this._glName),this._glName=null,this._context.instanceCounter.decrement(a._g.Texture,this))}release(){this.dispose()}resize(e,t){const s=this._descriptor;s.width===e&&s.height===t||(s.width=e,s.height=t,this._descriptor.target===a.No.TEXTURE_CUBE_MAP?this._setDataCubeMap(null):this.setData(null))}_setDataCubeMap(e=null){for(let t=a.No.TEXTURE_CUBE_MAP_POSITIVE_X;t<=a.No.TEXTURE_CUBE_MAP_NEGATIVE_Z;t++)this.setData(e,t)}setData(e,t=a.No.TEXTURE_2D){if(!this._context||!this._context.gl)return;const s=this._context.gl;this._glName||(this._glName=s.createTexture()),void 0===e&&(e=null),null===e&&(this._descriptor.width=this._descriptor.width||4,this._descriptor.height=this._descriptor.height||4);const r=this._context.bindTexture(this,c.TEXTURE_UNIT_FOR_UPDATES),o=this._descriptor;c._validateTexture(this._context,o),s.pixelStorei(s.UNPACK_ALIGNMENT,o.unpackAlignment),s.pixelStorei(s.UNPACK_FLIP_Y_WEBGL,o.flipped?1:0),s.pixelStorei(s.UNPACK_PREMULTIPLY_ALPHA_WEBGL,o.preMultiplyAlpha?1:0);const h=o.pixelFormat;let u=o.internalFormat?o.internalFormat:this._deriveInternalFormat(h,o.dataType);if(e instanceof ImageData||e instanceof HTMLImageElement||e instanceof HTMLCanvasElement||e instanceof HTMLVideoElement){let r=e.width,i=e.height;e instanceof HTMLVideoElement&&(r=e.videoWidth,i=e.videoHeight),o.width&&o.height,s.texImage2D(t,0,u,h,o.dataType,e),(0,n.zu)(s),o.hasMipmap&&this.generateMipmap(),void 0===o.width&&(o.width=r),void 0===o.height&&(o.height=i)}else{null!=o.width&&null!=o.height||console.error("Width and height must be specified!"),s.DEPTH24_STENCIL8&&u===s.DEPTH_STENCIL&&(u=s.DEPTH24_STENCIL8);let r=o.width,a=o.height;if(function(e){return(0,i.pC)(e)&&"type"in e&&"compressed"===e.type}(e)){const i=Math.round(Math.log(Math.max(r,a))/Math.LN2)+1;o.hasMipmap=o.hasMipmap&&i===e.levels.length;for(let i=0;;++i){const n=e.levels[Math.min(i,e.levels.length-1)];if(s.compressedTexImage2D(t,i,u,r,a,0,n),1===r&&1===a||!o.hasMipmap)break;r=Math.max(1,r>>1),a=Math.max(1,a>>1)}}else if((0,i.pC)(e))s.texImage2D(t,0,u,r,a,0,h,o.dataType,e),(0,n.zu)(s),o.hasMipmap&&this.generateMipmap();else for(let e=0;s.texImage2D(t,e,u,r,a,0,h,o.dataType,null),(0,n.zu)(s),(1!==r||1!==a)&&o.hasMipmap;++e)r=Math.max(1,r>>1),a=Math.max(1,a>>1)}c._applySamplingMode(s,this._descriptor),c._applyWrapMode(s,this._descriptor),c._applyAnisotropicFilteringParameters(this._context,this._descriptor),(0,n.zu)(s),this._context.bindTexture(r,c.TEXTURE_UNIT_FOR_UPDATES)}updateData(e,t,s,r,i,n,o=a.No.TEXTURE_2D){n||console.error("An attempt to use uninitialized data!"),this._glName||console.error("An attempt to update uninitialized texture!");const h=this._context.gl,u=this._descriptor,l=this._context.bindTexture(this,c.TEXTURE_UNIT_FOR_UPDATES);(t<0||s<0||r>u.width||i>u.height||t+r>u.width||s+i>u.height)&&console.error("An attempt to update out of bounds of the texture!"),h.pixelStorei(h.UNPACK_ALIGNMENT,u.unpackAlignment),h.pixelStorei(h.UNPACK_FLIP_Y_WEBGL,u.flipped?1:0),h.pixelStorei(h.UNPACK_PREMULTIPLY_ALPHA_WEBGL,u.preMultiplyAlpha?1:0),n instanceof ImageData||n instanceof HTMLImageElement||n instanceof HTMLCanvasElement||n instanceof HTMLVideoElement?h.texSubImage2D(o,e,t,s,u.pixelFormat,u.dataType,n):h.texSubImage2D(o,e,t,s,r,i,u.pixelFormat,u.dataType,n),this._context.bindTexture(l,c.TEXTURE_UNIT_FOR_UPDATES)}generateMipmap(){const e=this._descriptor;e.hasMipmap||(e.hasMipmap=!0,this._samplingModeDirty=!0,c._validateTexture(this._context,e)),e.samplingMode===a.cw.LINEAR?(this._samplingModeDirty=!0,e.samplingMode=a.cw.LINEAR_MIPMAP_NEAREST):e.samplingMode===a.cw.NEAREST&&(this._samplingModeDirty=!0,e.samplingMode=a.cw.NEAREST_MIPMAP_NEAREST);const t=this._context.bindTexture(this,c.TEXTURE_UNIT_FOR_UPDATES);this._context.gl.generateMipmap(e.target),this._context.bindTexture(t,c.TEXTURE_UNIT_FOR_UPDATES)}setSamplingMode(e){e!==this._descriptor.samplingMode&&(this._descriptor.samplingMode=e,this._samplingModeDirty=!0)}setWrapMode(e){e!==this._descriptor.wrapMode&&(this._descriptor.wrapMode=e,c._validateTexture(this._context,this._descriptor),this._wrapModeDirty=!0)}applyChanges(){const e=this._context.gl,t=this._descriptor;this._samplingModeDirty&&(c._applySamplingMode(e,t),this._samplingModeDirty=!1),this._wrapModeDirty&&(c._applyWrapMode(e,t),this._wrapModeDirty=!1)}_deriveInternalFormat(e,t){if(this._context.type===o.zO.WEBGL1)return e;if(t===a.Br.FLOAT)switch(e){case a.VI.RGBA:return a.VI.RGBA32F;case a.VI.RGB:return a.VI.RGB32F;default:throw new Error("Unable to derive format")}return e}static _validateTexture(e,t){(t.width<0||t.height<0)&&console.error("Negative dimension parameters are not allowed!");const s=(0,r.wt)(t.width)&&(0,r.wt)(t.height);(0,h.Z)(e.gl)||s||("number"==typeof t.wrapMode?t.wrapMode!==a.e8.CLAMP_TO_EDGE&&console.error("Non-power-of-two textures must have a wrap mode of CLAMP_TO_EDGE!"):t.wrapMode.s===a.e8.CLAMP_TO_EDGE&&t.wrapMode.t===a.e8.CLAMP_TO_EDGE||console.error("Non-power-of-two textures must have a wrap mode of CLAMP_TO_EDGE!"),t.hasMipmap&&console.error("Mipmapping requires power-of-two textures!"))}static _applySamplingMode(e,t){let s=t.samplingMode,r=t.samplingMode;s===a.cw.LINEAR_MIPMAP_NEAREST||s===a.cw.LINEAR_MIPMAP_LINEAR?(s=a.cw.LINEAR,t.hasMipmap||(r=a.cw.LINEAR)):s!==a.cw.NEAREST_MIPMAP_NEAREST&&s!==a.cw.NEAREST_MIPMAP_LINEAR||(s=a.cw.NEAREST,t.hasMipmap||(r=a.cw.NEAREST)),e.texParameteri(t.target,e.TEXTURE_MAG_FILTER,s),e.texParameteri(t.target,e.TEXTURE_MIN_FILTER,r)}static _applyWrapMode(e,t){"number"==typeof t.wrapMode?(e.texParameteri(t.target,e.TEXTURE_WRAP_S,t.wrapMode),e.texParameteri(t.target,e.TEXTURE_WRAP_T,t.wrapMode)):(e.texParameteri(t.target,e.TEXTURE_WRAP_S,t.wrapMode.s),e.texParameteri(t.target,e.TEXTURE_WRAP_T,t.wrapMode.t))}static _applyAnisotropicFilteringParameters(e,t){var s;const r=e.capabilities.textureFilterAnisotropic;r&&e.gl.texParameterf(t.target,r.TEXTURE_MAX_ANISOTROPY,null!=(s=t.maxAnisotropy)?s:1)}}c.TEXTURE_UNIT_FOR_UPDATES=0},46314:(e,t,s)=>{function r(e){return window.WebGL2RenderingContext&&e instanceof window.WebGL2RenderingContext}s.d(t,{Z:()=>r})},49300:(e,t,s)=>{s.d(t,{zu:()=>c,hZ:()=>a,CG:()=>h});var r=s(20102),i=s(80442);const n=s(92604).Z.getLogger("esri/views/webgl"),o=!!(0,i.Z)("enable-feature:webgl-debug");function a(){return o}function h(){return o}function c(e){if(a()){const t=e.getError();if(t){const s=function(e,t){switch(t){case e.INVALID_ENUM:return"Invalid Enum. An unacceptable value has been specified for an enumerated argument.";case e.INVALID_VALUE:return"Invalid Value. A numeric argument is out of range.";case e.INVALID_OPERATION:return"Invalid Operation. The specified command is not allowed for the current state.";case e.INVALID_FRAMEBUFFER_OPERATION:return"Invalid Framebuffer operation. The currently bound framebuffer is not framebuffer complete when trying to render to or to read from it.";case e.OUT_OF_MEMORY:return"Out of memory. Not enough memory is left to execute the command.";case e.CONTEXT_LOST_WEBGL:return"WebGL context has been lost";default:return"Unknown error"}}(e,t),i=(new Error).stack;n.error(new r.Z("webgl-error","WebGL error occured",{message:s,stack:i}))}}}},54738:(e,t,s)=>{var r,i;function n(e,t,s={}){const i=t===r.WEBGL1?["webgl","experimental-webgl","webkit-3d","moz-webgl"]:["webgl2"];let n=null;for(const t of i){try{n=e.getContext(t,s)}catch(e){}if(n)break}return n}s.d(t,{zO:()=>r,kr:()=>n}),s(80442),(i=r||(r={}))[i.WEBGL1=1]="WEBGL1",i[i.WEBGL2=2]="WEBGL2"}}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[6740,36],{1692:(e,t,i)=>{i.d(t,{Z:()=>w});var r=i(43697),s=i(66577),n=i(51773),l=i(78223),o=i(15923),a=(i(80442),i(22974)),u=i(92604),c=i(70586),p=i(31263),d=i(1153),f=i(52011);u.Z.getLogger("esri.core.Clonable");const y=e=>{let t=class extends e{clone(){const e=(0,c.s3)((0,d.vw)(this),"unable to clone instance of non-accessor class"),t=e.metadatas,i=e.store,r={},s=new Map;for(const e in t){const n=t[e],l=null==i?void 0:i.originOf(e);if(n.readOnly||!1===n.clonable||l!==p.s3.USER&&l!==p.s3.DEFAULTS)continue;const o=this[e];let u=null;const c=n.clonable;u="function"==typeof c?c(o):"reference"===c?o:(0,a.Vo)(o),null!=o&&null==u||(l===p.s3.DEFAULTS?s.set(e,u):r[e]=u)}const n=new(0,Object.getPrototypeOf(this).constructor)(r);if(s.size){var l;const e=null==(l=(0,d.vw)(n))?void 0:l.store;if(e)for(const[t,i]of s)e.set(t,i,p.s3.DEFAULTS)}return n}};return t=(0,r._)([(0,f.j)("esri.core.Clonable")],t),t};let m=class extends(y(o.Z)){};m=(0,r._)([(0,f.j)("esri.core.Clonable")],m);var h=i(96674),b=i(99001),g=i(5600),v=(i(67676),i(75215),i(33955));let x=class extends(y(h.wq)){constructor(...e){super(...e),this.isAggregate=!1,this.layer=null,this.popupTemplate=null,this.sourceLayer=null,Object.defineProperty(this,"uid",{value:(0,b.D)(),configurable:!0})}normalizeCtorArgs(e,t,i,r){return e&&!e.declaredClass?e:{geometry:e,symbol:t,attributes:i,popupTemplate:r}}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),this._notifyLayer("geometry",t,e))}set symbol(e){const t=this._get("symbol");t!==e&&(this._set("symbol",e),this._notifyLayer("symbol",t,e))}set visible(e){const t=this._get("visible");t!==e&&(this._set("visible",e),this._notifyLayer("visible",t,e))}getEffectivePopupTemplate(e=!1){if(this.popupTemplate)return this.popupTemplate;for(const t of[this.sourceLayer,this.layer])if(t){if("popupTemplate"in t&&t.popupTemplate)return t.popupTemplate;if(e&&"defaultPopupTemplate"in t&&(0,c.pC)(t.defaultPopupTemplate))return t.defaultPopupTemplate}return null}getAttribute(e){return this.attributes&&this.attributes[e]}setAttribute(e,t){if(this.attributes){const i=this.getAttribute(e);this.attributes[e]=t,this._notifyLayer("attributes",i,t,e)}else this.attributes={[e]:t},this._notifyLayer("attributes",void 0,t,e)}getObjectId(){return this.sourceLayer&&"objectIdField"in this.sourceLayer&&this.sourceLayer.objectIdField?this.getAttribute(this.sourceLayer.objectIdField):null}toJSON(){return{geometry:(0,c.pC)(this.geometry)?this.geometry.toJSON():null,symbol:(0,c.pC)(this.symbol)?this.symbol.toJSON():null,attributes:{...this.attributes},popupTemplate:this.popupTemplate&&this.popupTemplate.toJSON()}}notifyGeometryChanged(){this._notifyLayer("geometry",this.geometry,this.geometry)}_notifyLayer(e,t,i,r){if(!this.layer||!("graphicChanged"in this.layer))return;const s={graphic:this,property:e,oldValue:t,newValue:i};"attributes"===e&&(s.attributeName=r),this.layer.graphicChanged(s)}};(0,r._)([(0,g.Cb)({value:null})],x.prototype,"attributes",null),(0,r._)([(0,g.Cb)({value:null,types:s.qM,json:{read:v.im}})],x.prototype,"geometry",null),(0,r._)([(0,g.Cb)({type:Boolean})],x.prototype,"isAggregate",void 0),(0,r._)([(0,g.Cb)({clonable:"reference"})],x.prototype,"layer",void 0),(0,r._)([(0,g.Cb)({type:n.Z})],x.prototype,"popupTemplate",void 0),(0,r._)([(0,g.Cb)({clonable:"reference"})],x.prototype,"sourceLayer",void 0),(0,r._)([(0,g.Cb)({value:null,types:l.LB})],x.prototype,"symbol",null),(0,r._)([(0,g.Cb)({type:Boolean,value:!0})],x.prototype,"visible",null),x=(0,r._)([(0,f.j)("esri.Graphic")],x),(x||(x={})).generateUID=b.D;const w=x},44543:(e,t,i)=>{i.d(t,{F:()=>p,M:()=>r});const r={Base64:0,Hex:1,String:2,Raw:3};function s(e,t){const i=(65535&e)+(65535&t);return(e>>16)+(t>>16)+(i>>16)<<16|65535&i}function n(e,t,i,r,n,l){return s(function(e,t){return e<<t|e>>>32-t}(s(s(t,e),s(r,l)),n),i)}function l(e,t,i,r,s,l,o){return n(t&i|~t&r,e,t,s,l,o)}function o(e,t,i,r,s,l,o){return n(t&r|i&~r,e,t,s,l,o)}function a(e,t,i,r,s,l,o){return n(t^i^r,e,t,s,l,o)}function u(e,t,i,r,s,l,o){return n(i^(t|~r),e,t,s,l,o)}function c(e,t){e[t>>5]|=128<<t%32,e[14+(t+64>>>9<<4)]=t;let i=1732584193,r=-271733879,n=-1732584194,c=271733878;for(let t=0;t<e.length;t+=16){const p=i,d=r,f=n,y=c;i=l(i,r,n,c,e[t+0],7,-680876936),c=l(c,i,r,n,e[t+1],12,-389564586),n=l(n,c,i,r,e[t+2],17,606105819),r=l(r,n,c,i,e[t+3],22,-1044525330),i=l(i,r,n,c,e[t+4],7,-176418897),c=l(c,i,r,n,e[t+5],12,1200080426),n=l(n,c,i,r,e[t+6],17,-1473231341),r=l(r,n,c,i,e[t+7],22,-45705983),i=l(i,r,n,c,e[t+8],7,1770035416),c=l(c,i,r,n,e[t+9],12,-1958414417),n=l(n,c,i,r,e[t+10],17,-42063),r=l(r,n,c,i,e[t+11],22,-1990404162),i=l(i,r,n,c,e[t+12],7,1804603682),c=l(c,i,r,n,e[t+13],12,-40341101),n=l(n,c,i,r,e[t+14],17,-1502002290),r=l(r,n,c,i,e[t+15],22,1236535329),i=o(i,r,n,c,e[t+1],5,-165796510),c=o(c,i,r,n,e[t+6],9,-1069501632),n=o(n,c,i,r,e[t+11],14,643717713),r=o(r,n,c,i,e[t+0],20,-373897302),i=o(i,r,n,c,e[t+5],5,-701558691),c=o(c,i,r,n,e[t+10],9,38016083),n=o(n,c,i,r,e[t+15],14,-660478335),r=o(r,n,c,i,e[t+4],20,-405537848),i=o(i,r,n,c,e[t+9],5,568446438),c=o(c,i,r,n,e[t+14],9,-1019803690),n=o(n,c,i,r,e[t+3],14,-187363961),r=o(r,n,c,i,e[t+8],20,1163531501),i=o(i,r,n,c,e[t+13],5,-1444681467),c=o(c,i,r,n,e[t+2],9,-51403784),n=o(n,c,i,r,e[t+7],14,1735328473),r=o(r,n,c,i,e[t+12],20,-1926607734),i=a(i,r,n,c,e[t+5],4,-378558),c=a(c,i,r,n,e[t+8],11,-2022574463),n=a(n,c,i,r,e[t+11],16,1839030562),r=a(r,n,c,i,e[t+14],23,-35309556),i=a(i,r,n,c,e[t+1],4,-1530992060),c=a(c,i,r,n,e[t+4],11,1272893353),n=a(n,c,i,r,e[t+7],16,-155497632),r=a(r,n,c,i,e[t+10],23,-1094730640),i=a(i,r,n,c,e[t+13],4,681279174),c=a(c,i,r,n,e[t+0],11,-358537222),n=a(n,c,i,r,e[t+3],16,-722521979),r=a(r,n,c,i,e[t+6],23,76029189),i=a(i,r,n,c,e[t+9],4,-640364487),c=a(c,i,r,n,e[t+12],11,-421815835),n=a(n,c,i,r,e[t+15],16,530742520),r=a(r,n,c,i,e[t+2],23,-995338651),i=u(i,r,n,c,e[t+0],6,-198630844),c=u(c,i,r,n,e[t+7],10,1126891415),n=u(n,c,i,r,e[t+14],15,-1416354905),r=u(r,n,c,i,e[t+5],21,-57434055),i=u(i,r,n,c,e[t+12],6,1700485571),c=u(c,i,r,n,e[t+3],10,-1894986606),n=u(n,c,i,r,e[t+10],15,-1051523),r=u(r,n,c,i,e[t+1],21,-2054922799),i=u(i,r,n,c,e[t+8],6,1873313359),c=u(c,i,r,n,e[t+15],10,-30611744),n=u(n,c,i,r,e[t+6],15,-1560198380),r=u(r,n,c,i,e[t+13],21,1309151649),i=u(i,r,n,c,e[t+4],6,-145523070),c=u(c,i,r,n,e[t+11],10,-1120210379),n=u(n,c,i,r,e[t+2],15,718787259),r=u(r,n,c,i,e[t+9],21,-343485551),i=s(i,p),r=s(r,d),n=s(n,f),c=s(c,y)}return[i,r,n,c]}function p(e,t=r.Hex){const i=t||r.Base64,s=c(function(e){const t=[];for(let i=0,r=8*e.length;i<r;i+=8)t[i>>5]|=(255&e.charCodeAt(i/8))<<i%32;return t}(e),8*e.length);switch(i){case r.Raw:return s;case r.Hex:return function(e){const t="0123456789abcdef",i=[];for(let r=0,s=4*e.length;r<s;r++)i.push(t.charAt(e[r>>2]>>r%4*8+4&15)+t.charAt(e[r>>2]>>r%4*8&15));return i.join("")}(s);case r.String:return function(e){const t=[];for(let i=0,r=32*e.length;i<r;i+=8)t.push(String.fromCharCode(e[i>>5]>>>i%32&255));return t.join("")}(s);case r.Base64:return function(e){const t=[];for(let i=0,r=4*e.length;i<r;i+=3){const r=(e[i>>2]>>i%4*8&255)<<16|(e[i+1>>2]>>(i+1)%4*8&255)<<8|e[i+2>>2]>>(i+2)%4*8&255;for(let s=0;s<4;s++)8*i+6*s>32*e.length?t.push("="):t.push("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(r>>6*(3-s)&63))}return t.join("")}(s)}}},74085:(e,t,i)=>{function r(e){}i.d(t,{Bg:()=>r}),i(80442)},12501:(e,t,i)=>{i.r(t),i.d(t,{default:()=>E});var r,s=i(43697),n=i(22303),l=i(3172),o=i(20102),a=i(22974),u=i(92604),c=i(13867),p=i(70586),d=i(95330),f=i(19153),y=i(5600),m=(i(75215),i(52011)),h=i(30556),b=i(35671),g=i(5499),v=i(12571),x=i(59266),w=i(17386);const S=u.Z.getLogger("esri.renderers.DictionaryRenderer"),V={type:"CIMSimpleLineCallout",lineSymbol:{type:"CIMLineSymbol",symbolLayers:[{type:"CIMSolidStroke",width:.5,color:[0,0,0,255]}]}};let C=r=class extends((0,v.W)(g.Z)){constructor(e){super(e),this._ongoingRequests=new Map,this._symbolCache=new c.Z(100),this.config=null,this.fieldMap=null,this.scaleExpression=null,this.scaleExpressionTitle=null,this.url=null,this.type="dictionary"}writeData(e,t){e&&(t.scalingExpressionInfo={expression:e,returnType:"number"})}writeVisualVariables(e,t,i,r){null!=r&&r.origin||super.writeVisualVariables(e,t,i,r)}clone(){return new r({config:(0,a.d9)(this.config),scaleExpression:this.scaleExpression,scaleExpressionTitle:this.scaleExpressionTitle,fieldMap:(0,a.d9)(this.fieldMap),url:(0,a.d9)(this.url),visualVariables:(0,a.d9)(this.visualVariables)})}async getSymbolAsync(e,t){let i;this._dictionaryPromise||(this._dictionaryPromise=this.fetchResources(t));try{i=await this._dictionaryPromise}catch(e){if((0,d.D_)(e))return this._dictionaryPromise=null,null}const r={};if(this.fieldMap)for(const t of this._symbolFields){const i=this.fieldMap[t];if(i&&null!==e.attributes[i]&&void 0!==e.attributes[i]){const s=""+e.attributes[i];r[t]=s}else r[t]=""}const s=i(r,t);if(!s||"string"!=typeof s)return null;const l=(0,f.hP)(s).toString(),o=this._symbolCache.get(l);if(o)return o.catch((()=>{this._symbolCache.pop(l)})),o;const a=s.split(";"),u=[],c=[];for(const e of a)if(e&&0!==e.length)if(-1===e.indexOf("po:"))if(-1!==e.indexOf("|")){for(const t of e.split("|"))if(this._itemNames.has(t)){u.push(t);break}}else this._itemNames.has(e)&&u.push(e);else{const t=e.substr(3).split("|");if(3===t.length){const e=t[0],i=t[1];let r=t[2];if("DashTemplate"===i)r=r.split(" ").map((e=>Number(e)));else if("Color"===i){const e=new n.Z(r).toRgba();r=[e[0],e[1],e[2],255*e[3]]}else r=Number(r);c.push({primitiveName:e,propertyName:i,value:r})}}const y=!(0,p.pC)(e.geometry)||!e.geometry.hasZ&&"point"===e.geometry.type,m=this._cimPartsToCIMSymbol(u,c,y,t);return this._symbolCache.put(l,m,1),m}async collectRequiredFields(e,t){await this.collectVVRequiredFields(e,t),this.scaleExpression&&await(0,b.io)(e,t,this.scaleExpression);for(const i in this.fieldMap){const r=this.fieldMap[i];t.has(r)&&e.add(r)}}get arcadeRequired(){return!0}async fetchResources(e){if(this._dictionaryPromise)return this._dictionaryPromise;if(!this.url)return void S.error("no valid URL!");const t=(0,p.pC)(e)?e.abortOptions:null,i=(0,l.default)(this.url+"/resources/styles/dictionary-info.json",{responseType:"json",query:{f:"json"},...t}),[{data:r}]=await Promise.all([i,(0,x.LC)()]);if(!r)throw this._dictionaryPromise=null,new o.Z("esri.renderers.DictionaryRenderer","Bad dictionary data!");const s=r.expression,n=r.authoringInfo;this._refSymbolUrlTemplate=this.url+"/"+r.cimRefTemplateUrl,this._itemNames=new Set(r.itemsNames),this._symbolFields=n.symbol;const a={};if(this.config){const e=this.config;for(const t in e)a[t]=e[t]}if(n.configuration)for(const e of n.configuration)a.hasOwnProperty(e.name)||(a[e.name]=e.value);const u=[];if((0,p.pC)(e)&&e.fields&&this.fieldMap)for(const t of this._symbolFields){const i=this.fieldMap[t],r=e.fields.filter((e=>e.name===i));r.length>0&&u.push({...r[0],name:t})}return this._dictionaryPromise=(0,x.pp)(s,(0,p.pC)(e)?e.spatialReference:null,u,a).then((e=>{const t={scale:0};return(i,r)=>{const s=e.repurposeFeature({geometry:null,attributes:i});return t.scale=(0,p.pC)(r)?r.scale:void 0,e.evaluate({$feature:s,$view:t})}})).catch((e=>(S.error("Creating dictinoary expression failed:",e),null))),this._dictionaryPromise}getSymbol(){return null}getSymbols(){return[]}getAttributeHash(){return this.visualVariables&&this.visualVariables.reduce(((e,t)=>e+t.getAttributeHash()),"")}getMeshHash(){return`${this.url}-${JSON.stringify(this.fieldMap)}`}getSymbolFields(){return this._symbolFields}async _getSymbolPart(e,t){if(this._ongoingRequests.has(e))return this._ongoingRequests.get(e).then((e=>e.data));const i=this._refSymbolUrlTemplate.replace(/\{itemName\}/gi,e),r=(0,l.default)(i,{responseType:"json",query:{f:"json"},...t});this._ongoingRequests.set(e,r);try{return(await r).data}catch(t){return this._ongoingRequests.delete(e),Promise.reject(t)}}_combineSymbolParts(e,t,i){if(!e||0===e.length)return null;const r={...e[0]};if(e.length>1){r.symbolLayers=[];for(const t of e){const e=t;r.symbolLayers.unshift(...e.symbolLayers)}}return i&&(r.callout=V),{type:"CIMSymbolReference",symbol:r,primitiveOverrides:t}}async _cimPartsToCIMSymbol(e,t,i,r){const s=new Array(e.length);for(let t=0;t<e.length;t++)s[t]=this._getSymbolPart(e[t],r);const n=await Promise.all(s);return new w.Z({data:this._combineSymbolParts(n,t,i)})}};(0,s._)([(0,y.Cb)({type:Object,json:{read:{source:"configuration"},write:{target:"configuration"}}})],C.prototype,"config",void 0),(0,s._)([(0,y.Cb)({type:Object,json:{write:!0}})],C.prototype,"fieldMap",void 0),(0,s._)([(0,y.Cb)({type:String,json:{read:{source:"scalingExpressionInfo.expression"},write:!0}})],C.prototype,"scaleExpression",void 0),(0,s._)([(0,h.c)("scaleExpression")],C.prototype,"writeData",null),(0,s._)([(0,y.Cb)({type:String,json:{read:{source:"scalingExpressionInfo.title"},write:{target:"scalingExpressionInfo.title",overridePolicy(e){return{enabled:!!e&&!!this.scaleExpression}}}}})],C.prototype,"scaleExpressionTitle",void 0),(0,s._)([(0,y.Cb)({type:String,json:{write:!0}})],C.prototype,"url",void 0),(0,s._)([(0,h.c)("visualVariables")],C.prototype,"writeVisualVariables",null),C=r=(0,s._)([(0,m.j)("esri.renderers.DictionaryRenderer")],C);const E=C},95088:(e,t,i)=>{i.d(t,{Z:()=>z});var r,s=i(43697),n=i(22303),l=i(22974),o=i(44422),a=i(75215),u=i(36030),c=i(5600),p=i(52011),d=i(35671),f=i(5499),y=i(12571),m=i(96674),h=i(92604),b=(i(67676),i(80442),i(90578));const g=h.Z.getLogger("esri.renderers.support.AttributeColorInfo");let v=r=class extends m.wq{constructor(e){super(e),this.color=null,this.field=null,this.label=null,this.valueExpression=null,this.valueExpressionTitle=null}castField(e){return null==e?e:"function"==typeof e?(g.error(".field: field must be a string value"),null):(0,a.Zs)(e)}getAttributeHash(){return`${this.field}-${this.valueExpression}`}clone(){return new r({color:this.color&&this.color.clone(),field:this.field,label:this.label,valueExpression:this.valueExpression,valueExpressionTitle:this.valueExpressionTitle})}};(0,s._)([(0,c.Cb)({type:n.Z,json:{type:[Number],write:!0}})],v.prototype,"color",void 0),(0,s._)([(0,c.Cb)({type:String,json:{write:!0}})],v.prototype,"field",void 0),(0,s._)([(0,b.p)("field")],v.prototype,"castField",null),(0,s._)([(0,c.Cb)({type:String,json:{write:!0}})],v.prototype,"label",void 0),(0,s._)([(0,c.Cb)({type:String,json:{write:!0}})],v.prototype,"valueExpression",void 0),(0,s._)([(0,c.Cb)({type:String,json:{write:!0}})],v.prototype,"valueExpressionTitle",void 0),v=r=(0,s._)([(0,p.j)("esri.renderers.support.AttributeColorInfo")],v);const x=v;var w;let S=w=class extends m.wq{constructor(){super(...arguments),this.unit=null}clone(){return new w({unit:this.unit})}};(0,s._)([(0,c.Cb)({type:String,json:{write:!0}})],S.prototype,"unit",void 0),S=w=(0,s._)([(0,p.j)("esri.renderers.support.DotDensityLegendOptions")],S);const V=S;var C,E=i(20256),_=i(4095);let F=C=class extends((0,y.W)(f.Z)){constructor(e){super(e),this.attributes=null,this.backgroundColor=new n.Z([0,0,0,0]),this.blendDots=!0,this.dotBlendingEnabled=!0,this.dotShape="square",this.dotSize=1,this.legendOptions=null,this.outline=new _.Z,this.dotValue=null,this.referenceDotValue=null,this.referenceScale=null,this.seed=1,this.type="dot-density"}calculateDotValue(e){if(null==this.referenceScale)return this.dotValue;const t=e/this.referenceScale*this.dotValue;return t<1?1:t}getSymbol(){return new E.Z({outline:this.outline})}async getSymbolAsync(){return this.getSymbol()}getSymbols(){return[this.getSymbol()]}getAttributeHash(){return this.attributes&&this.attributes.reduce(((e,t)=>e+t.getAttributeHash()),"")}getMeshHash(){return JSON.stringify(this.outline)}clone(){return new C({attributes:(0,l.d9)(this.attributes),backgroundColor:(0,l.d9)(this.backgroundColor),dotBlendingEnabled:(0,l.d9)(this.dotBlendingEnabled),dotShape:(0,l.d9)(this.dotShape),dotSize:(0,l.d9)(this.dotSize),dotValue:(0,l.d9)(this.dotValue),legendOptions:(0,l.d9)(this.legendOptions),outline:(0,l.d9)(this.outline),referenceScale:(0,l.d9)(this.referenceScale),visualVariables:(0,l.d9)(this.visualVariables),authoringInfo:this.authoringInfo&&this.authoringInfo.clone()})}getControllerHash(){return`${this.attributes.map((e=>e.field||e.valueExpression||""))}-${this.outline&&JSON.stringify(this.outline.toJSON())||""}`}async collectRequiredFields(e,t){await this.collectVVRequiredFields(e,t);for(const i of this.attributes)i.valueExpression&&await(0,d.io)(e,t,i.valueExpression),i.field&&e.add(i.field)}};(0,s._)([(0,c.Cb)({type:[x],json:{write:!0}})],F.prototype,"attributes",void 0),(0,s._)([(0,c.Cb)({type:n.Z,json:{write:!0}})],F.prototype,"backgroundColor",void 0),(0,s._)([(0,c.Cb)({type:Boolean}),(0,o.B)("dotBlendingEnabled")],F.prototype,"blendDots",void 0),(0,s._)([(0,c.Cb)({type:Boolean,json:{write:!0}})],F.prototype,"dotBlendingEnabled",void 0),(0,s._)([(0,c.Cb)({type:String,json:{write:!1}})],F.prototype,"dotShape",void 0),(0,s._)([(0,c.Cb)({type:Number,json:{write:!1}})],F.prototype,"dotSize",void 0),(0,s._)([(0,c.Cb)({type:V,json:{write:!0}})],F.prototype,"legendOptions",void 0),(0,s._)([(0,c.Cb)({type:_.Z,json:{default:null,write:!0}})],F.prototype,"outline",void 0),(0,s._)([(0,c.Cb)({type:Number,json:{write:!0}})],F.prototype,"dotValue",void 0),(0,s._)([(0,c.Cb)({type:Number}),(0,o.B)("dotValue")],F.prototype,"referenceDotValue",void 0),(0,s._)([(0,c.Cb)({type:Number,json:{write:!0}})],F.prototype,"referenceScale",void 0),(0,s._)([(0,c.Cb)({type:Number,json:{write:!0}})],F.prototype,"seed",void 0),(0,s._)([(0,u.J)({dotDensity:"dot-density"})],F.prototype,"type",void 0),F=C=(0,s._)([(0,p.j)("esri.renderers.DotDensityRenderer")],F);const z=F},79056:(e,t,i)=>{i.d(t,{Z:()=>b});var r,s=i(43697),n=i(22303),l=i(22974),o=i(5600),a=(i(75215),i(36030)),u=i(52011),c=i(35671),p=i(5499),d=i(96674);i(67676),i(80442);let f=r=class extends d.wq{constructor(e){super(e),this.color=null,this.ratio=null}clone(){return new r({color:this.color,ratio:this.ratio})}};(0,s._)([(0,o.Cb)({type:n.Z,json:{write:!0}})],f.prototype,"color",void 0),(0,s._)([(0,o.Cb)({type:Number,json:{write:!0}})],f.prototype,"ratio",void 0),f=r=(0,s._)([(0,u.j)("esri.renderers.support.HeatmapColorStop")],f);const y=f;var m;let h=m=class extends p.Z{constructor(e){super(e),this.blurRadius=10,this.colorStops=[new y({ratio:0,color:new n.Z("rgba(255, 140, 0, 0)")}),new y({ratio:.75,color:new n.Z("rgba(255, 140, 0, 1)")}),new y({ratio:.9,color:new n.Z("rgba(255, 0, 0, 1)")})],this.field=null,this.fieldOffset=0,this.maxPixelIntensity=100,this.minPixelIntensity=0,this.type="heatmap"}async collectRequiredFields(e,t){const i=this.field;i&&"string"==typeof i&&(0,c.AB)(e,t,i)}getAttributeHash(){return null}getMeshHash(){return`${JSON.stringify(this.colorStops)}.${this.blurRadius}.${this.field}`}clone(){return new m({blurRadius:this.blurRadius,colorStops:(0,l.d9)(this.colorStops),field:this.field,maxPixelIntensity:this.maxPixelIntensity,minPixelIntensity:this.minPixelIntensity})}};(0,s._)([(0,o.Cb)({type:Number,json:{write:!0}})],h.prototype,"blurRadius",void 0),(0,s._)([(0,o.Cb)({type:[y],json:{write:!0}})],h.prototype,"colorStops",void 0),(0,s._)([(0,o.Cb)({type:String,json:{write:!0}})],h.prototype,"field",void 0),(0,s._)([(0,o.Cb)({type:Number,json:{write:{overridePolicy:(e,t,i)=>({enabled:null==i})}}})],h.prototype,"fieldOffset",void 0),(0,s._)([(0,o.Cb)({type:Number,json:{write:!0}})],h.prototype,"maxPixelIntensity",void 0),(0,s._)([(0,o.Cb)({type:Number,json:{write:!0}})],h.prototype,"minPixelIntensity",void 0),(0,s._)([(0,a.J)({heatmap:"heatmap"})],h.prototype,"type",void 0),h=m=(0,s._)([(0,u.j)("esri.renderers.HeatmapRenderer")],h);const b=h},84382:(e,t,i)=>{i.d(t,{Z:()=>f});var r,s=i(43697),n=i(22974),l=i(5600),o=(i(75215),i(36030)),a=i(52011),u=i(5499),c=i(12571),p=i(9833);let d=r=class extends((0,c.W)(u.Z)){constructor(e){super(e),this.description=null,this.label=null,this.symbol=null,this.type="simple"}async collectRequiredFields(e,t){await Promise.all([this.collectSymbolFields(e,t),this.collectVVRequiredFields(e,t)])}async collectSymbolFields(e,t){await Promise.all(this.getSymbols().map((i=>i.collectRequiredFields(e,t))))}getSymbol(e,t){return this.symbol}async getSymbolAsync(e,t){return this.symbol}getSymbols(){return this.symbol?[this.symbol]:[]}getAttributeHash(){return this.visualVariables&&this.visualVariables.reduce(((e,t)=>e+t.getAttributeHash()),"")}getMeshHash(){return this.getSymbols().reduce(((e,t)=>e+JSON.stringify(t)),"")}get arcadeRequired(){return this.arcadeRequiredForVisualVariables}clone(){return new r({description:this.description,label:this.label,symbol:this.symbol&&this.symbol.clone(),visualVariables:(0,n.d9)(this.visualVariables),authoringInfo:this.authoringInfo&&this.authoringInfo.clone()})}};(0,s._)([(0,l.Cb)({type:String,json:{write:!0}})],d.prototype,"description",void 0),(0,s._)([(0,l.Cb)({type:String,json:{write:!0}})],d.prototype,"label",void 0),(0,s._)([(0,l.Cb)(p.G)],d.prototype,"symbol",void 0),(0,s._)([(0,o.J)({simple:"simple"})],d.prototype,"type",void 0),d=r=(0,s._)([(0,a.j)("esri.renderers.SimpleRenderer")],d);const f=d},91423:(e,t,i)=>{i.d(t,{a:()=>o});var r=i(20941),s=i(63213),n=i(32400);const l=(0,s.d)({types:n.A});function o(e,t,i){return e?e&&(e.styleName||e.styleUrl)&&"uniqueValue"!==e.type?(i&&i.messages&&i.messages.push(new r.Z("renderer:unsupported","Only UniqueValueRenderer can be referenced from a web style, but found '"+e.type+"'",{definition:e,context:i})),null):l(e,t,i):null}},99282:(e,t,i)=>{i.d(t,{a:()=>n});var r=i(67900),s=i(68441);const n={inches:(0,r.En)(1,"meters","inches"),feet:(0,r.En)(1,"meters","feet"),"us-feet":(0,r.En)(1,"meters","us-feet"),yards:(0,r.En)(1,"meters","yards"),miles:(0,r.En)(1,"meters","miles"),"nautical-miles":(0,r.En)(1,"meters","nautical-miles"),millimeters:(0,r.En)(1,"meters","millimeters"),centimeters:(0,r.En)(1,"meters","centimeters"),decimeters:(0,r.En)(1,"meters","decimeters"),meters:(0,r.En)(1,"meters","meters"),kilometers:(0,r.En)(1,"meters","kilometers"),"decimal-degrees":1/(0,r.ty)(1,"meters",s.sv.radius)}},32400:(e,t,i)=>{i.d(t,{A:()=>c,o:()=>p});var r=i(16050),s=i(12501),n=i(95088),l=i(79056),o=i(5499),a=i(84382),u=i(30687);const c={key:"type",base:o.Z,typeMap:{heatmap:l.Z,simple:a.Z,"unique-value":u.Z,"class-breaks":r.Z,"dot-density":n.Z,dictionary:s.default},errorContext:"renderer"},p={key:"type",base:o.Z,typeMap:{simple:a.Z,"unique-value":u.Z,"class-breaks":r.Z},errorContext:"renderer"}},51706:(e,t,i)=>{var r,s;function n(e){return e&&"esri.renderers.visualVariables.SizeVariable"===e.declaredClass}function l(e){return null!=e&&!isNaN(e)&&isFinite(e)}function o(e){return e.valueExpression?r.Expression:e.field&&"string"==typeof e.field?r.Field:r.Unknown}function a(e,t){const i=t||o(e),n=e.valueUnit||"unknown";return i===r.Unknown?s.Constant:e.stops?s.Stops:null!=e.minSize&&null!=e.maxSize&&null!=e.minDataValue&&null!=e.maxDataValue?s.ClampedLinear:"unknown"===n?null!=e.minSize&&null!=e.minDataValue?e.minSize&&e.minDataValue?s.Proportional:s.Additive:s.Identity:s.RealWorldSize}i.d(t,{RY:()=>r,hL:()=>s,PS:()=>o,QW:()=>a,iY:()=>n,qh:()=>l}),function(e){e.Unknown="unknown",e.Expression="expression",e.Field="field"}(r||(r={})),function(e){e.Unknown="unknown",e.Stops="stops",e.ClampedLinear="clamped-linear",e.Proportional="proportional",e.Additive="additive",e.Constant="constant",e.Identity="identity",e.RealWorldSize="real-world-size"}(s||(s={}))},28101:(e,t,i)=>{i.d(t,{PR:()=>S,Lq:()=>y,Km:()=>m,cM:()=>h,ap:()=>b,V3:()=>x,B3:()=>f});var r=i(22303),s=i(1692),n=i(74085),l=i(92604),o=i(70586),a=i(99282),u=i(51706);const c=l.Z.getLogger("esri.renderers.visualVariables.support.visualVariableUtils"),p=new s.Z,d=Math.PI,f=/^\s*(return\s+)?\$view\.scale\s*(;)?\s*$/i;function y(e,t,i){const s="visualVariables"in e&&e.visualVariables?e.visualVariables.filter((e=>"color"===e.type))[0]:e;if(!s)return;if("esri.renderers.visualVariables.ColorVariable"!==s.declaredClass)return void c.warn("The visualVariable should be an instance of esri.renderers.visualVariables.ColorVariable");const n="number"==typeof t,l=n?null:t,a=l&&l.attributes;let u=n?t:null;const p=s.field,{ipData:d,hasExpression:f}=s.cache;let y=s.cache.compiledFunc;if(!p&&!f){const e=s.stops;return e&&e[0]&&e[0].color}if("number"!=typeof u)if(f){if(!(0,o.pC)(i)||!(0,o.pC)(i.arcade))return void c.error("Use of arcade expressions requires an arcade context");const e={viewingMode:i.viewingMode,scale:i.scale,spatialReference:i.spatialReference},t=i.arcade.arcadeUtils,r=t.getViewInfo(e),n=t.createExecContext(l,r);if(!y){const e=t.createSyntaxTree(s.valueExpression);y=t.createFunction(e),s.cache.compiledFunc=y}u=t.executeFunction(y,n)}else a&&(u=a[p]);const m=s.normalizationField,h=a?parseFloat(a[m]):void 0;if(null!=u&&(!m||n||!isNaN(h)&&0!==h)){isNaN(h)||n||(u/=h);const e=w(u,d);if(e){const t=e[0],n=e[1],l=t===n?s.stops[t].color:r.Z.blendColors(s.stops[t].color,s.stops[n].color,e[2],(0,o.pC)(i)?i.color:void 0);return new r.Z(l)}}}function m(e,t,i){const r="visualVariables"in e&&e.visualVariables?e.visualVariables.filter((e=>"opacity"===e.type))[0]:e;if(!r)return;if("esri.renderers.visualVariables.OpacityVariable"!==r.declaredClass)return void c.warn("The visualVariable should be an instance of esri.renderers.visualVariables.OpacityVariable");const s="number"==typeof t,n=s?null:t,l=n&&n.attributes;let a=s?t:null;const u=r.field,{ipData:p,hasExpression:d}=r.cache;let f=r.cache.compiledFunc;if(!u&&!d){const e=r.stops;return e&&e[0]&&e[0].opacity}if("number"!=typeof a)if(d){if((0,o.Wi)(i)||(0,o.Wi)(i.arcade))return void c.error("Use of arcade expressions requires an arcade context");const e={viewingMode:i.viewingMode,scale:i.scale,spatialReference:i.spatialReference},t=i.arcade.arcadeUtils,s=t.getViewInfo(e),l=t.createExecContext(n,s);if(!f){const e=t.createSyntaxTree(r.valueExpression);f=t.createFunction(e),r.cache.compiledFunc=f}a=t.executeFunction(f,l)}else l&&(a=l[u]);const y=r.normalizationField,m=l?parseFloat(l[y]):void 0;if(null!=a&&(!y||s||!isNaN(m)&&0!==m)){isNaN(m)||s||(a/=m);const e=w(a,p);if(e){const t=e[0],i=e[1];if(t===i)return r.stops[t].opacity;{const s=r.stops[t].opacity;return s+(r.stops[i].opacity-s)*e[2]}}}}function h(e,t,i){const r="visualVariables"in e&&e.visualVariables?e.visualVariables.filter((e=>"rotation"===e.type))[0]:e;if(!r)return;if("esri.renderers.visualVariables.RotationVariable"!==r.declaredClass)return void c.warn("The visualVariable should be an instance of esri.renderers.visualVariables.RotationVariable");const s=r.axis||"heading",n="heading"===s&&"arithmetic"===r.rotationType?90:0,l="heading"===s&&"arithmetic"===r.rotationType?-1:1,a="number"==typeof t?null:t,u=a&&a.attributes,p=r.field,{hasExpression:d}=r.cache;let f=r.cache.compiledFunc,y=0;if(!p&&!d)return y;if(d){if((0,o.Wi)(i)||(0,o.Wi)(i.arcade))return void c.error("Use of arcade expressions requires an arcade context");const e={viewingMode:i.viewingMode,scale:i.scale,spatialReference:i.spatialReference},t=i.arcade.arcadeUtils,s=t.getViewInfo(e),n=t.createExecContext(a,s);if(!f){const e=t.createSyntaxTree(r.valueExpression);f=t.createFunction(e),r.cache.compiledFunc=f}y=t.executeFunction(f,n)}else u&&(y=u[p]||0);return y="number"!=typeof y||isNaN(y)?null:n+l*y,y}function b(e,t,i){const r="visualVariables"in e&&e.visualVariables?e.visualVariables.filter((e=>"size"===e.type))[0]:e;if(!r)return;if("esri.renderers.visualVariables.SizeVariable"!==r.declaredClass)return void c.warn("The visualVariable should be an instance of esri.renderers.visualVariables.SizeVariable");const s=function(e,t,i,r,s){switch(t.transformationType){case u.hL.Additive:return function(e,t,i,r){return e+(g(t.minSize,i,r)||t.minDataValue)}(e,t,i,r);case u.hL.Constant:return function(e,t,i){const r=e.stops;let s=r&&r.length&&r[0].size;return null==s&&(s=e.minSize),g(s,t,i)}(t,i,r);case u.hL.ClampedLinear:return function(e,t,i,r){const s=(e-t.minDataValue)/(t.maxDataValue-t.minDataValue),n=g(t.minSize,i,r),l=g(t.maxSize,i,r),a=(0,o.pC)(r)?r.shape:void 0;if(e<=t.minDataValue)return n;if(e>=t.maxDataValue)return l;if("area"===t.scaleBy&&a){const e="circle"===a,t=e?d*(n/2)**2:n*n,i=t+s*((e?d*(l/2)**2:l*l)-t);return e?2*Math.sqrt(i/d):Math.sqrt(i)}return n+s*(l-n)}(e,t,i,r);case u.hL.Proportional:return function(e,t,i,r){const s=(0,o.pC)(r)?r.shape:void 0,n=e/t.minDataValue,l=g(t.minSize,i,r),a=g(t.maxSize,i,r);let u=null;return u="circle"===s?2*Math.sqrt(n*(l/2)**2):"square"===s||"diamond"===s||"image"===s?Math.sqrt(n*l**2):n*l,v(u,l,a)}(e,t,i,r);case u.hL.Stops:return function(e,t,i,r,s){const[n,l,o]=w(e,s);if(n===l)return g(t.stops[n].size,i,r);{const e=g(t.stops[n].size,i,r);return e+(g(t.stops[l].size,i,r)-e)*o}}(e,t,i,r,s);case u.hL.RealWorldSize:return function(e,t,i,r){const s=((0,o.pC)(r)&&r.resolution?r.resolution:1)*a.a[t.valueUnit],n=g(t.minSize,i,r),l=g(t.maxSize,i,r),{valueRepresentation:u}=t;let c=null;return c="area"===u?2*Math.sqrt(e/d)/s:"radius"===u||"distance"===u?2*e/s:e/s,v(c,n,l)}(e,t,i,r);case u.hL.Identity:return e;case u.hL.Unknown:return null}}(function(e,t,i){const r="number"==typeof t,s=r?null:t,n=s&&s.attributes;let l=r?t:null;const{isScaleDriven:a}=e.cache;let p=e.cache.compiledFunc;if(a){const t=(0,o.pC)(i)?i.scale:void 0,r=(0,o.pC)(i)?i.view:void 0;l=null==t||"3d"===r?function(e){let t=null,i=null;const r=e.stops;return r?(t=r[0].value,i=r[r.length-1].value):(t=e.minDataValue||0,i=e.maxDataValue||0),(t+i)/2}(e):t}else if(!r)switch(e.inputValueType){case u.RY.Expression:{if((0,o.Wi)(i)||(0,o.Wi)(i.arcade))return void c.error("Use of arcade expressions requires an arcade context");const t={viewingMode:i.viewingMode,scale:i.scale,spatialReference:i.spatialReference},r=i.arcade.arcadeUtils,n=r.getViewInfo(t),a=r.createExecContext(s,n);if(!p){const t=r.createSyntaxTree(e.valueExpression);p=r.createFunction(t),e.cache.compiledFunc=p}l=r.executeFunction(p,a);break}case u.RY.Field:n&&(l=n[e.field]);break;case u.RY.Unknown:l=null}if(!(0,u.qh)(l))return null;if(r||!e.normalizationField)return l;const d=n?parseFloat(n[e.normalizationField]):null;return(0,u.qh)(d)&&0!==d?l/d:null}(r,t,i),r,t,i,r.cache.ipData);return null==s||isNaN(s)?0:s}function g(e,t,i){return null==e?null:(0,u.iY)(e)?b(e,t,i):(0,u.qh)(e)?e:null}function v(e,t,i){return(0,u.qh)(i)&&e>i?i:(0,u.qh)(t)&&e<t?t:e}function x(e,t,i){const{isScaleDriven:r}=e.cache;if(!(r&&"3d"===i||t))return null;const s={scale:t,view:i};let n=g(e.minSize,p,s),l=g(e.maxSize,p,s);if(null!=n||null!=l){if(n>l){const e=l;l=n,n=e}return{minSize:n,maxSize:l}}}function w(e,t){if(!t)return;let i=0,r=t.length-1;return t.some(((t,s)=>e<t?(r=s,!0):(i=s,!1))),[i,r,(e-t[i])/(t[r]-t[i])]}function S(e,t,i){const r=["proportional","proportional","proportional"];for(const s of e){const e=s.useSymbolValue?"symbol-value":b(s,t,i);switch(s.axis){case"width":r[0]=e;break;case"depth":r[1]=e;break;case"height":r[2]=e;break;case"width-and-depth":r[0]=e,r[1]=e;break;case"all":case void 0:case null:r[0]=e,r[1]=e,r[2]=e;break;default:(0,n.Bg)(s.axis)}}return r}},72961:(e,t,i)=>{i.r(t),i.d(t,{addAggregateFields:()=>ee,createMatcherSchema:()=>ie,createSchema:()=>$,createSymbolSchema:()=>U,createSymbolSchemaOptions:()=>A}),i(16050),i(12501),i(95088),i(79056),i(5499);var r=i(84382),s=(i(30687),i(91423),i(20102)),n=i(80442),l=i(22974),o=i(92604),a=i(70586),u=i(62357),c=i(21878),p=i(66039),d=i(29996),f=i(63523),y=i(40660);i(24562);var m=i(34240),h=i(16534);function b(e,t){return Math.max(e,t)}i(83798),i(17332),i(24470),i(73913),i(30729),i(58195),i(28823),h.eF.metrics,new m.Z(0,0,24,24);const g=o.Z.getLogger("esri.renderers.visualVariables.support.utils");function v(e){return e.map((e=>function(e){return("size"===e.type||"color"===e.type||"opacity"===e.type)&&null!=e.stops}(e)?function(e){return e.stops=function(e,t){return t.length<=8?t:(g.warn(`Found ${t.length} Visual Variable stops, but MapView only supports 8. Displayed stops will be simplified.`),t.length>16?function(e,t){const[i,...r]=t,s=r.pop(),n=r[0].value,l=r[r.length-1].value,o=(l-n)/6,a=[];for(let i=n;i<l;i+=o){let s=0;for(;i>=r[s].value;)s++;const n=r[s],l=t[s-1],o=i-l.value,c=n.value===l.value?1:o/(n.value-l.value);if("color"===e){const e=r[s],n=t[s-1],l=e.color.clone();l.r=x(n.color.r,l.r,c),l.g=x(n.color.g,l.g,c),l.b=x(n.color.b,l.b,c),l.a=x(n.color.a,l.a,c),a.push({value:i,color:l,label:e.label})}else if("size"===e){const e=r[s],n=t[s-1],l=(0,u.t_)(e.size),o=x((0,u.t_)(n.size),l,c);a.push({value:i,size:o,label:e.label})}else{const e=r[s],n=x(t[s-1].opacity,e.opacity,c);a.push({value:i,opacity:n,label:e.label})}}return[i,...a,s]}(e,t):function(e){const[t,...i]=e,r=i.pop();for(;i.length>6;){let e=0,t=0;for(let r=1;r<i.length;r++){const s=i[r-1],n=i[r],l=Math.abs(n.value-s.value);l>t&&(t=l,e=r)}i.splice(e,1)}return[t,...i,r]}(t))}(e.type,e.stops),e}(e.clone()):e))}function x(e,t,i){return(1-i)*e+i*t}var w,S=i(44543),V=i(23847),C=i(30856),E=i(43697),_=i(5600),F=(i(75215),i(52011)),z=i(30556),T=i(51706);let R=w=class extends V.Z{writeLevels(e,t,i){for(const i in e){const e=this.levels[i];return void(t.stops=e)}}clone(){return new w({axis:this.axis,field:this.field,valueExpression:this.valueExpression,valueExpressionTitle:this.valueExpressionTitle,maxDataValue:this.maxDataValue,maxSize:(0,T.iY)(this.maxSize)?this.maxSize.clone():this.maxSize,minDataValue:this.minDataValue,minSize:(0,T.iY)(this.minSize)?this.minSize.clone():this.minSize,normalizationField:this.normalizationField,stops:this.stops&&this.stops.map((e=>e.clone())),target:this.target,useSymbolValue:this.useSymbolValue,valueRepresentation:this.valueRepresentation,valueUnit:this.valueUnit,legendOptions:this.legendOptions&&this.legendOptions.clone(),levels:(0,l.d9)(this.levels)})}};(0,E._)([(0,_.Cb)()],R.prototype,"levels",void 0),(0,E._)([(0,z.c)("levels")],R.prototype,"writeLevels",null),R=w=(0,E._)([(0,F.j)("esri.views.2d.engine.LevelDependentSizeVariable")],R);const I=o.Z.getLogger("esri.views.2d.layers.support.clusterUtils");n.Z.add("esri-cluster-arcade-enabled",!0);const j=(0,n.Z)("esri-cluster-arcade-enabled");function N(e,t){const{name:i,outStatistic:r}=t,{onStatisticField:n,onStatisticValueExpression:l,statisticType:o}=r;if(l){const t=(0,S.F)(l.toLowerCase());e.push({name:i,outStatistic:{onStatisticField:t,onStatisticValueExpression:l,statisticType:o}})}else n?e.push({name:i,outStatistic:{onStatisticField:n,statisticType:o}}):I.error(new s.Z("mapview-unsupported-field","Unable to handle field",{field:t}))}function L(e,t,i){const r=(0,S.F)(t),s="mode"===i?`cluster_type_${r}`:`cluster_avg_${r}`;return e.some((e=>e.name===s))||e.push({name:s,outStatistic:{onStatisticField:r,onStatisticValueExpression:t,statisticType:i}}),s}function Z(e,t,i,r){if("cluster_count"===t||e.some((e=>e.name===t)))return t;const s=function(e,t,i){switch(e){case"avg":case"avg_angle":return`cluster_avg_${t}`;case"mode":return`cluster_type_${t}`;case"norm":{const e=i,r="field",s=t.toLowerCase()+",norm:"+r+","+e.toLowerCase();return"cluster_avg_"+(0,S.F)(s)}}}(i,t,r);return e.some((e=>e.name===s))||("norm"===i?e.push({name:s,outStatistic:{onStatisticField:t,onStatisticNormalizationField:r,statisticType:i}}):e.push({name:s,outStatistic:{onStatisticField:t,statisticType:i}})),s}const O=new(i(35454).Xn)({esriGeometryPoint:"point",esriGeometryMultipoint:"multipoint",esriGeometryPolyline:"polyline",esriGeometryPolygon:"polygon",esriGeometryMultiPatch:"multipatch",mesh:"mesh"}),M=o.Z.getLogger("esri.views.2d.layers.features.schemaUtils"),P="ValidationError",k={esriGeometryPoint:["above-right","above-center","above-left","center-center","center-left","center-right","below-center","below-left","below-right"],esriGeometryPolygon:["always-horizontal"],esriGeometryPolyline:["center-along"],esriGeometryMultipoint:null};function q(e){return(0,f.hF)(e)}function D(e){var t;return"line-marker"===e.type?{type:"line-marker",color:null==(t=e.color)?void 0:t.toJSON(),placement:e.placement,style:e.style}:(0,c.i)(e.toJSON()).toJSON()}function A(e){let t=0,i=0,r=!1,s=!0,n=!0;if((0,a.pC)(e)&&(i=function(e){if(!("visualVariables"in e))return 0;if(!e.hasVisualVariables("size"))return 0;const t=e.getVisualVariablesForType("size");if(!t[0])return 0;const i=t[0];if("outline"===i.target)return 0;if("stops"===i.transformationType)return i.stops.map((e=>e.size)).reduce(b,0);if("clamped-linear"===i.transformationType){let e=-1/0,t=-1/0;return e="number"==typeof i.maxSize?i.maxSize:i.maxSize.stops.map((e=>e.size)).reduce(b,0),t="number"==typeof i.minSize?i.minSize:i.minSize.stops.map((e=>e.size)).reduce(b,0),Math.max(e,t)}return"real-world-size"===i.transformationType?30:void 0}(e),"visualVariables"in e&&(t=function(e){if(!e)return p.X.NONE;let t=0;for(const i of e)if("size"===i.type){const e=(0,y.a)(i);t|=e,"outline"===i.target&&(t|=e<<4)}else"color"===i.type?t|=p.X.COLOR:"opacity"===i.type?t|=p.X.OPACITY:"rotation"===i.type&&(t|=p.X.ROTATION);return t}(e.visualVariables||[]),r="dot-density"===e.type),!r)){const t=e.getSymbols();"backgroundFillSymbol"in e&&e.backgroundFillSymbol&&t.push(e.backgroundFillSymbol);for(const e of t)if("cim"===e.type&&(s=!1),"simple-fill"===e.type||"picture-fill"===e.type){const t=e.outline;t&&"none"!==t.style&&"solid"!==t.style&&(n=!1);const i=t&&"none"!==t.style&&"solid"!==t.style,r="simple-fill"===e.type&&"none"!==e.style&&"solid"!==e.style;("picture-fill"===e.type||r||i)&&(s=!1)}}return r&&(n=!1),{vvFlags:t,maxVVSize:i,supportsOutlineFills:n,stride:{fill:r?"dot-density":s?"simple":"default"}}}function U(e,t,i){return B(e,A(t),i)}function B(e,t,i){if(!e)return null;switch(e.type){case"simple-fill":case"picture-fill":return function(e,t,i){const r=t.supportsOutlineFills,s=(0,f.jj)(p.LW.FILL,{...t,isOutlinedFill:r}),n=i?q(s):s,l=e.clone(),o=l.outline;t.supportsOutlineFills||(l.outline=null);const a={materialKey:n,hash:l.hash(),isOutlinedFill:!!t.supportsOutlineFills,...D(l)};if(t.supportsOutlineFills)return a;const u=[];if(u.push(a),o){const e=(0,f.jj)(p.LW.LINE,{...t,isOutline:!0}),r={materialKey:i?q(e):e,hash:o.hash(),...D(o)};u.push(r)}return{type:"composite-symbol",layers:u,hash:u.reduce(((e,t)=>t.hash+e),"")}}(e,t,i);case"simple-marker":case"picture-marker":return function(e,t,i){const r=(0,f.jj)(p.LW.MARKER,t),s=i?q(r):r,n=D(e);return{materialKey:s,hash:e.hash(),...n,angle:e.angle,maxVVSize:t.maxVVSize}}(e,t,i);case"simple-line":return function(e,t,i){const r=(0,f.jj)(p.LW.LINE,t),s=i?q(r):r,n=e.clone(),l=n.marker;n.marker=null;const o=[];if(o.push({materialKey:s,hash:n.hash(),...D(n)}),l){var a;const e=(0,f.jj)(p.LW.MARKER,t),r=i?q(e):e;l.color=null!=(a=l.color)?a:n.color,o.push({materialKey:r,hash:l.hash(),lineWidth:n.width,...D(l)})}return{type:"composite-symbol",layers:o,hash:o.reduce(((e,t)=>t.hash+e),"")}}(e,t,i);case"text":return function(e,t,i){const r=(0,f.jj)(p.LW.TEXT,t),s=i?q(r):r,n=D(e);return{materialKey:s,hash:e.hash(),...n,angle:e.angle,maxVVSize:t.maxVVSize}}(e,t,i);case"label":return function(e,t,i){const r=e.toJSON(),s=(0,f.jj)(p.LW.LABEL,{...t,placement:r.labelPlacement});return{materialKey:i?q(s):s,hash:e.hash(),...r,labelPlacement:r.labelPlacement}}(e,t,i);case"cim":return{type:"cim",rendererKey:t.vvFlags,data:e.data,maxVVSize:t.maxVVSize};case"CIMSymbolReference":return{type:"cim",rendererKey:t.vvFlags,data:e,maxVVSize:t.maxVVSize};case"web-style":return{...D(e),type:"web-style",hash:e.hash(),rendererKey:t.vvFlags,maxVVSize:t.maxVVSize};default:throw new Error(`symbol not supported ${e.type}`)}}function W(e,t){const i=(0,l.d9)(e);return i.some((e=>function(e,t){const i=e.labelPlacement,r=k[t];if(!e.symbol)return M.warn("No ILabelClass symbol specified."),!0;if(!r)return M.error(new s.Z("mapview-labeling:unsupported-geometry-type",`Unable to create labels for Feature Layer, ${t} is not supported`)),!0;if(!r.some((e=>e===i))){const s=r[0];i&&M.warn(`Found invalid label placement type ${i} for ${t}. Defaulting to ${s}`),e.labelPlacement=s}return!1}(e,t)))?[]:i}function $(e){return(0,n.Z)("esri-2d-update-debug")&&console.debug("Created new schema",J(e,!0)),J(e)}function J(e,t=!1){try{var i,n;const l=function(e,t=!1){const i=new Array;return i.push(function(e,t,i=!1){const n={indexCount:0,fields:{}},l="featureReduction"in e&&e.featureReduction,o=l?"aggregate":"feature";if("sublayers"in e){const t={type:"subtype",subtypeField:e.subtypeField,renderers:{},stride:{fill:"default"}},r={type:"subtype",mapping:{},target:"feature"},l={type:"subtype",classes:{}},u={type:"symbol",target:"feature",aggregateFields:[],attributes:n,storage:r,mesh:{matcher:t,aggregateMatcher:null,labels:l,sortKey:null}},c=new Set;let p=0;for(const{renderer:u,subtypeCode:d,labelingInfo:f,labelsVisible:y}of e.sublayers){const e=ie(n,o,u,i),m=te(n,o,u),h=y&&f;if("visualVariables"in u&&u.visualVariables&&u.visualVariables.length)throw new s.Z(P,"Visual variables are currently not supported for subtype layers");if("dictionary"===e.type)throw new s.Z(P,"Dictionary renderer is not supported in subtype layers");if("subtype"===e.type)throw new s.Z(P,"Nested subtype renderers is not supported");if((0,a.pC)(m)&&"subtype"===m.type)throw new s.Z(P,"Nested subtype storage is not supported");if((0,a.pC)(m)&&"dot-density"===m.type)throw new s.Z(P,"Dot density attributes are not supported in subtype layers");if(c.has(d))throw new s.Z(P,"Subtype codes for sublayers must be unique");c.add(d),t.renderers[d]=e,r.mapping[d]=m,h&&(l.classes[d]=h.map((e=>Q(u,n,e,"feature",p++,i))))}return u}if("heatmap"===e.renderer.type){const{blurRadius:t,fieldOffset:i,field:r}=e.renderer;return{type:"heatmap",aggregateFields:[],attributes:n,target:o,storage:null,mesh:{blurRadius:t,fieldOffset:i,field:Y(n,{target:o,field:r,resultType:"numeric"}).field}}}{const t=[],u="aggregate"===o?((e,t,i,r)=>{const n=t.clone();if(!(e=>{const t=t=>I.error(new s.Z("Unsupported-renderer",t,{renderer:e}));if("unique-value"===e.type){if(e.field2||e.field3)return t("FeatureReductionCluster does not support multi-field UniqueValueRenderers"),!1}else if("class-breaks"===e.type){if(e.normalizationField){const i=e.normalizationType;if("field"!==i)return t(`FeatureReductionCluster does not support a normalizationType of ${i}`),!1}}else if("simple"!==e.type)return t(`FeatureReductionCluster does not support renderers of type ${e.type}`),!1;if(!j){if("valueExpression"in e&&e.valueExpression)return t("FeatureReductionCluster does not currently support renderer.valueExpression. Support will be added in a future release"),!1;if(("visualVariables"in e&&e.visualVariables||[]).some((e=>!(!("valueExpression"in e)||!e.valueExpression))))return t("FeatureReductionCluster does not currently support visualVariables with a valueExpression. Support will be added in a future release"),!1}return!0})(n))return n;if(i.fields)for(const t of i.fields)N(e,t);if("visualVariables"in n){const t=(n.visualVariables||[]).filter((e=>"$view.scale"!==e.valueExpression)),r=(e=>{for(const t of e)if("size"===t.type)return t;return null})(t);t.forEach((t=>{"rotation"===t.type?t.field?t.field=Z(e,t.field,"avg_angle"):t.valueExpression&&(t.field=L(e,t.valueExpression,"avg_angle"),t.valueExpression=null):t.normalizationField?(t.field=Z(e,t.field,"norm",t.normalizationField),t.normalizationField=null):t.field?t.field=Z(e,t.field,"avg"):(t.field=L(e,t.valueExpression,"avg"),t.valueExpression=null)})),(0,a.Wi)(r)&&!(e=>{for(const t of e)if("cluster_count"===t.field)return!0;return!1})(t)&&(t.push(((e,t)=>{const i=[new C.Z({value:0,size:0}),new C.Z({value:1})];if((0,a.Wi)(t))return new V.Z({field:"cluster_count",stops:[...i,new C.Z({value:2,size:0})]});const r=Object.keys(t).reduce(((r,s)=>({...r,[s]:[...i,new C.Z({value:Math.max(2,t[s].minValue),size:e.clusterMinSize}),new C.Z({value:Math.max(3,t[s].maxValue),size:e.clusterMaxSize})]})),{});return new R({field:"cluster_count",levels:r})})(i,null)),n.dynamicClusterSize=!0),n.visualVariables=t}switch(n.type){case"simple":break;case"unique-value":n.field?n.field=Z(e,n.field,"mode"):n.valueExpression&&(n.field=L(e,n.valueExpression,"mode"),n.valueExpression=null);break;case"class-breaks":n.normalizationField?(n.field=Z(e,n.field,"norm",n.normalizationField),n.normalizationField=null):n.field?n.field=Z(e,n.field,"avg"):(n.field=L(e,n.valueExpression,"avg"),n.valueExpression=null)}return n})(t,e.renderer,l):e.renderer;ee(n,t);const c=ie(n,o,u,i);let p=null;const d=te(n,o,u),f=function(e){return O.toJSON(e)}(e.geometryType);let y=e.labelsVisible&&e.labelingInfo||[],m=[];if(l){if("selection"===l.type)throw new s.Z(P,"Mapview does not support `selection` reduction type",l);if(l.symbol){const e=new r.Z({symbol:l.symbol,visualVariables:"visualVariables"in u?u.visualVariables:null});p=ie(n,o,e,i)}m=l&&l.labelsVisible&&l.labelingInfo||[]}y=W(y,f),m=W(m,f);let h=0;const b=[...y.map((e=>Q(u,n,e,"feature",h++,i))),...m.map((e=>Q(u,n,e,"aggregate",h++,i)))],g=function(e,t){if((0,a.Wi)(t)||!t.length)return null;t.length>1&&M.warn(`Layer rendering currently only supports ordering by 1 orderByInfo, but found ${t.length}. All but the first will be discarded`);const i=t[0],r="ascending"===i.order?"asc":"desc";return i.field?{field:i.field,order:r}:i.valueExpression?{fieldIndex:X(e,{type:"expression",target:"feature",valueExpression:i.valueExpression,resultType:"numeric"}).fieldIndex,order:r}:(M.error(new s.Z(P,"Expected to find a field or valueExpression for OrderByInfo",i)),null)}(n,e.orderBy);return{type:"symbol",target:o,attributes:n,aggregateFields:t,storage:d,mesh:{matcher:c,labels:{type:"simple",classes:b},aggregateMatcher:p,sortKey:g}}}}(e)),i}(e,t),o={};return l.map((t=>function(e,t,i){switch(i.target){case"feature":return void G(e,K(t),i);case"aggregate":{if(!("featureReduction"in t))return;const r=t.featureReduction;if("selection"===r.type)throw new s.Z(P,"Mapview does not support `selection` reduction type",r);return G(e,K(t),i),void function(e,t,i){e.aggregate||(e.aggregate={name:"aggregate",input:"feature",filters:null,attributes:{},params:{clusterRadius:(0,u.F2)(t.clusterRadius/2),clusterPixelBuffer:64*Math.ceil((0,u.F2)(t.clusterMaxSize)/64),fields:i.aggregateFields}}),H(e.aggregate,i.attributes.fields)}(e,r,i)}}}(o,e,t))),{source:{definitionExpression:e.definitionExpression,fields:e.fields.map((e=>e.toJSON())),gdbVersion:e.gdbVersion,historicMoment:null==(i=e.historicMoment)?void 0:i.getTime(),outFields:e.availableFields,pixelBuffer:e.pixelBuffer,spatialReference:e.spatialReference.toJSON(),timeExtent:null==(n=e.timeExtent)?void 0:n.toJSON(),customParameters:e.customParameters},attributes:{fields:{},indexCount:0},processors:l,targets:o}}catch(e){if(e.fieldName===P)return M.error(e),null;throw e}}function H(e,t){for(const i in t){const r=t[i];if(r.target!==e.name)continue;const s=e.attributes[i];s?(s.context.mesh=s.context.mesh||r.context.mesh,s.context.storage=s.context.storage||r.context.storage):e.attributes[i]=r}return e}function K(e){var t,i,r,s,n;return[null!=(t=null==(i=(0,a.Wg)(e.filter))?void 0:i.toJSON())?t:null,null!=(r=null==(s=(0,a.Wg)(null==(n=(0,a.Wg)(e.featureEffect))?void 0:n.filter))?void 0:s.toJSON())?r:null]}function G(e,t,i){return e.feature||(e.feature={name:"feature",input:"source",filters:t,attributes:{}}),H(e.feature,i.attributes.fields),e}function Y(e,t){return t.field?X(e,{...t,type:"field",field:t.field}):t.valueExpression?X(e,{...t,type:"expression",valueExpression:t.valueExpression}):{field:null,fieldIndex:null}}function X(e,t){switch(t.type){case"expression":{const i=t.valueExpression;if(!e.fields[i]){const r=e.indexCount++;e.fields[i]={...t,name:i,fieldIndex:r}}return{fieldIndex:e.fields[i].fieldIndex}}case"label-expression":{const i=JSON.stringify(t.label);if(!e.fields[i]){const r=e.indexCount++;e.fields[i]={...t,name:i,fieldIndex:r}}return{fieldIndex:e.fields[i].fieldIndex}}case"field":{const i=t.field;return"aggregate"===t.target&&e.fields[i]||(e.fields[i]={...t,name:i}),{field:i}}case"statistic":return e.fields[t.name]={...t},{field:t.name}}}function Q(e,t,i,r,s,n=!1){const l=X(t,{type:"label-expression",target:r,context:{mesh:!0},resultType:"string",label:{labelExpression:i.labelExpression,labelExpressionInfo:i.labelExpressionInfo?{expression:i.labelExpressionInfo.expression}:null,symbol:!!i.symbol,where:i.where}}),{fieldIndex:o}=l;return{...U(i,e,n),fieldIndex:o,target:r,index:s}}function ee(e,t){const i={mesh:!0,storage:!0};for(const r of t){const{name:t,outStatistic:s}=r,{statisticType:n,onStatisticField:l}=s;let o=null,a=null,u=null;const c="numeric",p="feature";"onStatisticValueExpression"in s?a=X(e,{type:"expression",target:p,valueExpression:s.onStatisticValueExpression,resultType:c}).fieldIndex:"onStatisticNormalizationField"in s?(o=X(e,{type:"field",target:p,field:l,resultType:c}).field,u=s.onStatisticNormalizationField):o=X(e,{type:"field",target:p,field:l,resultType:c}).field,X(e,{type:"statistic",target:"aggregate",name:t,context:i,inField:o,inNormalizationField:u,inFieldIndex:a,statisticType:n})}}function te(e,t,i){switch(i.type){case"dot-density":return function(e,t,i){return i&&i.length?{type:"dot-density",mapping:i.map(((i,r)=>{const{field:s,fieldIndex:n}=Y(e,{valueExpression:i.valueExpression,field:i.field,resultType:"numeric",target:t});return{binding:r,field:s,fieldIndex:n}})),target:t}:{type:"dot-density",mapping:[],target:t}}(e,t,i.attributes);case"simple":case"class-breaks":case"unique-value":case"dictionary":return function(e,t,i){if(!i||!i.length)return{type:"visual-variable",mapping:[],target:t};const r={storage:!0},s="numeric";return{type:"visual-variable",mapping:v(i).map((i=>{var n;const l=(0,d.nU)(i.type),{field:o,fieldIndex:a}=Y(e,{target:t,valueExpression:i.valueExpression,field:i.field,context:r,resultType:s});switch(i.type){case"size":return"$view.scale"===i.valueExpression?null:{type:"size",binding:l,field:o,fieldIndex:a,normalizationField:Y(e,{target:t,field:i.normalizationField,context:r,resultType:s}).field,valueRepresentation:null!=(n=i.valueRepresentation)?n:null};case"color":return{type:"color",binding:l,field:o,fieldIndex:a,normalizationField:Y(e,{target:t,field:i.normalizationField,context:r,resultType:s}).field};case"opacity":return{type:"opacity",binding:l,field:o,fieldIndex:a,normalizationField:Y(e,{target:t,field:i.normalizationField,context:r,resultType:s}).field};case"rotation":return{type:"rotation",binding:l,field:o,fieldIndex:a}}})).filter((e=>e)),target:t}}(e,t,i.visualVariables);case"heatmap":return null}}function ie(e,t,i,r=!1){const n=(0,a.Pt)(e,{indexCount:0,fields:{}});switch(i.type){case"simple":case"dot-density":return function(e,t,i=!1){const r=t.getSymbols(),s=r.length?r[0]:null,{stride:n}=A(t);return{type:"simple",symbol:U(s,t,i),stride:n}}(0,i,r);case"class-breaks":return function(e,t,i,r=!1){const s=i.backgroundFillSymbol,{field:n,fieldIndex:l}=Y(e,{target:t,field:i.field,valueExpression:i.valueExpression,resultType:"numeric",context:{mesh:!0,use:"renderer.field"}}),o=i.normalizationType,a="log"===o?"esriNormalizeByLog":"percent-of-total"===o?"esriNormalizeByPercentOfTotal":"field"===o?"esriNormalizeByField":null,u=A(i),c=i.classBreakInfos.map((e=>({symbol:B(e.symbol,u,r),min:e.minValue,max:e.maxValue}))).sort(((e,t)=>e.min-t.min));return{type:"interval",attributes:e.fields,field:n,fieldIndex:l,backgroundFillSymbol:B(s,u,r),defaultSymbol:B(i.defaultSymbol,u,r),intervals:c,normalizationField:i.normalizationField,normalizationTotal:i.normalizationTotal,normalizationType:a,isMaxInclusive:i.isMaxInclusive,stride:u.stride}}(n,t,i,r);case"unique-value":return function(e,t,i,r=!1){const n=[],l=i.backgroundFillSymbol,o={target:t,context:{mesh:!0},resultType:"string"};if(i.field&&"string"!=typeof i.field)throw new s.Z(P,"Expected renderer.field to be a string",i);const{field:a,fieldIndex:u}=Y(e,{...o,field:i.field,valueExpression:i.valueExpression}),c=A(i);for(const e of i.uniqueValueInfos)n.push({value:""+e.value,symbol:B(e.symbol,c,r)});return{type:"map",attributes:e.fields,field:a,fieldIndex:u,field2:Y(e,{...o,field:i.field2}).field,field3:Y(e,{...o,field:i.field3}).field,fieldDelimiter:i.fieldDelimiter,backgroundFillSymbol:B(l,c),defaultSymbol:B(i.defaultSymbol,c),map:n,stride:c.stride}}(n,t,i,r);case"dictionary":return function(e,t,i=!1){return{type:"dictionary",renderer:t.toJSON(),stride:{fill:"default"}}}(0,i,r)}}}}]);
|